From 9ec88254f2a4d8b240398e123c37bb75e84c2e3b Mon Sep 17 00:00:00 2001 From: sewardj Date: Wed, 8 Aug 2001 15:44:28 +0000 Subject: [PATCH] [project @ 2001-08-08 15:44:28 by sewardj] Disable use of finalisers attached to UnlinkedBCOs, since finalisers attached to non-atomic objects may run too early :-( --- ghc/compiler/ghci/ByteCodeLink.lhs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/ghci/ByteCodeLink.lhs b/ghc/compiler/ghci/ByteCodeLink.lhs index 310f6c4..325dc00 100644 --- a/ghc/compiler/ghci/ByteCodeLink.lhs +++ b/ghc/compiler/ghci/ByteCodeLink.lhs @@ -191,7 +191,12 @@ assembleBCO (ProtoBCO nm instrs origin malloced) <- mkBits findLabel init_asm_state instrs let ul_bco = UnlinkedBCO nm final_insns final_lits final_ptrs final_itbls - when (not (null malloced)) (addFinalizer ul_bco (mapM_ zonk malloced)) + + -- 8 Aug 01: Finalisers aren't safe when attached to non-primitive + -- objects, since they might get run too early. Disable this until + -- we figure out what to do. + -- when (not (null malloced)) (addFinalizer ul_bco (mapM_ zonk malloced)) + return ul_bco where zonk (A# a#) = do -- putStrLn ("freeing malloc'd block at " ++ show (A# a#)) -- 1.7.10.4