Commit 733e845d authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

CmmLayoutStack: Add unwind information on stack fixups

Currently stack fixup blocks don't include unwinding information,
leaving a small window where our unwinding information is incorrect. Fix
this by adding unwinding information to emitted fixup blocks.

Reviewers: scpmw, simonmar, austin

Reviewed By: simonmar

Subscribers: thomie

Differential Revision:
parent 3eb737ee
......@@ -528,8 +528,16 @@ makeFixupBlock dflags sp0 l stack tscope assigs
| otherwise = do
tmp_lbl <- newBlockId
let sp_off = sp0 - sm_sp stack
maybeAddUnwind block
| debugLevel dflags > 0
= block `blockSnoc` CmmUnwind [(Sp, unwind_val)]
| otherwise
= block
where unwind_val = cmmOffset dflags (CmmReg spReg) (sm_sp stack)
block = blockJoin (CmmEntry tmp_lbl tscope)
(maybeAddSpAdj dflags sp_off (blockFromList assigs))
( maybeAddSpAdj dflags sp_off
$ maybeAddUnwind
$ blockFromList assigs )
(CmmBranch l)
return (tmp_lbl, [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