Commit 60a3f11f authored by David Feuer's avatar David Feuer Committed by David Feuer

Fix pointer tagging mistake

f9c6d53f led to #14036. The
problem turned out to be rather simple: the `obj` pointer was
being tagged using `obj + arity`. Because this is C, that's done
with *pointer arithmetic*, which is not at all what we want. Add
appropriate casts.

Reviewers: austin, bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14036

Differential Revision: https://phabricator.haskell.org/D3983
parent 4ec4ca99
......@@ -429,7 +429,9 @@ eval_obj:
// https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/HaskellExecution/PointerTagging
tagged_obj =
newEmptyPAP(cap,
arity <= TAG_MASK ? obj + arity : obj,
arity <= TAG_MASK
? (StgClosure *) ((intptr_t) obj + arity)
: obj,
arity);
}
#endif
......
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