From 5e7d7570fdbd20f3f9113ed439efcb968939a3fc Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 9 Oct 2007 14:25:54 +0000 Subject: [PATCH] FIX #1743, create a fresh unique for each Id we bind at a breakpoint --- compiler/main/InteractiveEval.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index cdb6c94..9afedae 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -64,6 +64,7 @@ import ByteCodeInstr import Linker import DynFlags import Unique +import UniqSupply import Module import Panic import UniqFM @@ -582,7 +583,13 @@ bindLocalsAtBreakpoint hsc_env apStack (Just info) = do where mkNewId :: OccName -> Id -> IO Id mkNewId occ id = do - let uniq = idUnique id + us <- mkSplitUniqSupply 'I' + -- we need a fresh Unique for each Id we bind, because the linker + -- state is single-threaded and otherwise we'd spam old bindings + -- whenever we stop at a breakpoint. The InteractveContext is properly + -- saved/restored, but not the linker state. See #1743, test break026. + let + uniq = uniqFromSupply us loc = nameSrcSpan (idName id) name = mkInternalName uniq occ loc ty = idType id -- 1.7.10.4