Fix tcInstHeadTyNotSynonym
[ghc-hetmet.git] / compiler / cmm / CmmCPSGen.hs
index 4b8f83b..abea84f 100644 (file)
@@ -168,7 +168,7 @@ continuationToProc (max_stack, update_frame_size, formats) stack_use uniques
                             else case lookup (mkReturnPtLabel $ getUnique next) formats of
                               Nothing -> [CmmBranch next]
                               Just cont_format ->
-                                pack_continuation False curr_format cont_format ++
+                                pack_continuation True curr_format cont_format ++
                                 tail_call (curr_stack - cont_stack)
                                           (CmmLit $ CmmLabel $ mkReturnPtLabel $ getUnique next)
                                           arguments
@@ -385,7 +385,6 @@ pack_continuation allow_header_set
                       (ContinuationFormat _ cont_id cont_frame_size live_regs)
   = pack_frame curr_frame_size cont_frame_size maybe_header continuation_args
   where
-    continuation_function = CmmLit $ CmmLabel $ fromJust cont_id
     continuation_args = map (maybe Nothing (Just . CmmReg . CmmLocal))
                             live_regs
     needs_header_set =
@@ -394,7 +393,7 @@ pack_continuation allow_header_set
           _ -> isJust cont_id
 
     maybe_header = if allow_header_set && needs_header_set
-                   then Just continuation_function
+                   then maybe Nothing (Just . CmmLit . CmmLabel) cont_id
                    else Nothing
 
 pack_frame :: WordOff         -- ^ Current frame size