diff options
author | Ian Lynagh <igloo@earth.li> | 2010-10-21 12:08:53 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-10-21 12:08:53 +0000 |
commit | 7f476a8a4006acaf0a2ee8b7a9d05f0377cca94b (patch) | |
tree | 6bcc28b1727337fa05e488d165487972219b3299 /compiler/codeGen | |
parent | 7ec78f77f4d591a2ab0090769920fd4773641c33 (diff) | |
download | haskell-7f476a8a4006acaf0a2ee8b7a9d05f0377cca94b.tar.gz |
Use takeUniqFromSupply in emitProcWithConvention
We were using the supply's unique, and then passing the same supply to
initUs_, which sounds like a bug waiting to happen.
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/StgCmmMonad.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/codeGen/StgCmmMonad.hs b/compiler/codeGen/StgCmmMonad.hs index f1823bd176..f109251e73 100644 --- a/compiler/codeGen/StgCmmMonad.hs +++ b/compiler/codeGen/StgCmmMonad.hs @@ -604,8 +604,9 @@ emitProcWithConvention :: Convention -> CmmInfo -> CLabel -> CmmFormals -> CmmAGraph -> FCode () emitProcWithConvention conv info lbl args blocks = do { us <- newUniqSupply - ; let (offset, entry) = mkEntry (mkBlockId $ uniqFromSupply us) conv args - blks = initUs_ us $ lgraphOfAGraph $ entry <*> blocks + ; let (uniq, us') = takeUniqFromSupply us + (offset, entry) = mkEntry (mkBlockId uniq) conv args + blks = initUs_ us' $ lgraphOfAGraph $ entry <*> blocks ; let proc_block = CmmProc info lbl args ((offset, Just initUpdFrameOff), blks) ; state <- getState ; setState $ state { cgs_tops = cgs_tops state `snocOL` proc_block } } |