Skip to content

Commit

Permalink
Adapt to "ghc-heap: Don't Box NULL pointers" commit
Browse files Browse the repository at this point in the history
Fixes #6.
  • Loading branch information
RyanGlScott committed Jun 28, 2022
1 parent c757338 commit bf3be66
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/src/GHC/Debug/Decode/Convert.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{- Convert a GenClosure to a DebugClosure -}
module GHC.Debug.Decode.Convert where

Expand Down Expand Up @@ -40,10 +41,14 @@ convertClosure itb g =
-}
GHC.OtherClosure _ a2 a3 -> OtherClosure itb a2 a3
GHC.WeakClosure _ a2 a3 a4 a5 a6 ->
#if __GLASGOW_HASKELL__ >= 905
let w_link = a6
#else
-- nullPtr check
let w_link = if a6 == 0
then Nothing
else Just a6
#endif
in WeakClosure itb a2 a3 a4 a5 w_link
GHC.UnsupportedClosure _ -> UnsupportedClosure itb
c -> error ("Unexpected closure type: " ++ show c)

0 comments on commit bf3be66

Please sign in to comment.