Commit 9180df19 authored by Simon Marlow's avatar Simon Marlow

Fix offset calculation in __stg_gc_fun

Summary:
We were not treating the offset as a signed field in this rare case,
so it would blow up if the offset was negative.

Test Plan: Looked at the assembly

Reviewers: austin, bgamari, rwbarton

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1042
parent a07898e4
......@@ -405,8 +405,9 @@ __stg_gc_fun /* explicit stack */
if (type == ARG_GEN_BIG) {
#ifdef TABLES_NEXT_TO_CODE
// bitmap field holds an offset
size = StgLargeBitmap_size( StgFunInfoExtra_bitmap(info)
+ %GET_ENTRY(UNTAG(R1)) /* ### */ );
size = StgLargeBitmap_size(
TO_W_(StgFunInfoExtraRev_bitmap_offset(info))
+ %GET_ENTRY(UNTAG(R1)) /* ### */ );
#else
size = StgLargeBitmap_size( StgFunInfoExtra_bitmap(info) );
#endif
......
......@@ -568,6 +568,7 @@ wanteds = concat
,structField C "StgFunInfoExtraRev" "fun_type"
,structFieldH Both "StgFunInfoExtraRev" "arity"
,structField_ C "StgFunInfoExtraRev_bitmap" "StgFunInfoExtraRev" "b.bitmap"
,structField_ C "StgFunInfoExtraRev_bitmap_offset" "StgFunInfoExtraRev" "b.bitmap_offset"
,structField C "StgLargeBitmap" "size"
,fieldOffset C "StgLargeBitmap" "bitmap"
......
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