summaryrefslogtreecommitdiff
path: root/compiler/ghci/ByteCodeAsm.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ghci/ByteCodeAsm.hs')
-rw-r--r--compiler/ghci/ByteCodeAsm.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/ghci/ByteCodeAsm.hs b/compiler/ghci/ByteCodeAsm.hs
index f7cea3b567..476a9b2efd 100644
--- a/compiler/ghci/ByteCodeAsm.hs
+++ b/compiler/ghci/ByteCodeAsm.hs
@@ -125,9 +125,12 @@ mallocStrings hsc_env ulbcos = do
return bco { unlinkedBCOLits = lits, unlinkedBCOPtrs = ptrs }
spliceLit (BCONPtrStr _) = do
- (RemotePtr p : rest) <- get
- put rest
- return (BCONPtrWord (fromIntegral p))
+ rptrs <- get
+ case rptrs of
+ (RemotePtr p : rest) -> do
+ put rest
+ return (BCONPtrWord (fromIntegral p))
+ _ -> panic "mallocStrings:spliceLit"
spliceLit other = return other
splicePtr (BCOPtrBCO bco) = BCOPtrBCO <$> splice bco