[project @ 2005-08-11 22:50:16 by simonmar]
authorsimonmar <unknown>
Thu, 11 Aug 2005 22:50:16 +0000 (22:50 +0000)
committersimonmar <unknown>
Thu, 11 Aug 2005 22:50:16 +0000 (22:50 +0000)
fix bug in slurpSCCs that causes SCCs to be pushed in the wrong order
on closures occasionally.

ghc/compiler/profiling/SCCfinal.lhs

index 58c62e2..c95db9c 100644 (file)
@@ -230,14 +230,13 @@ stgMassageForProfiling pdeps mod_name us stg_binds
 -}
 
     do_rhs (StgRhsClosure _ bi fv u srt args expr)
-      = slurpSCCs currentCCS expr              `thenMM` \ (expr', ccs) ->
-       do_expr expr'                           `thenMM` \ expr'' ->
+      = slurpSCCs currentCCS expr      `thenMM` \ (expr', ccs) ->
+       do_expr expr'                   `thenMM` \ expr'' ->
        returnMM (StgRhsClosure ccs bi fv u srt args expr'')
       where
        slurpSCCs ccs (StgSCC cc e) 
             = collectCC cc                     `thenMM_`
-              slurpSCCs ccs e                  `thenMM` \ (e', ccs')  ->
-              returnMM (e', pushCCOnCCS cc ccs')
+              slurpSCCs (cc `pushCCOnCCS` ccs) e
        slurpSCCs ccs e 
             = returnMM (e, ccs)