Commit 7f476a8a authored by Ian Lynagh's avatar Ian Lynagh
Browse files

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.
parent 7ec78f77
......@@ -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 } }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment