Locations in the codegen where we assume pointers tagged with certain values?

Ben Gamari ben at smart-cactus.org
Sat Apr 27 13:51:14 UTC 2019


Ömer Sinan Ağacan <omeragacan at gmail.com> writes:

> Hi all,
>
> I'm trying to find all places in the code generator where we assume that a
> pointer is tagged with a certain value. A generated code for this looks like
> this:
>
>     mov    0x6(%rbx),%rax
>
> This moves payload[0] of the closure in %rbx to %rax, but it assumes that %rbx
> is tagged with 2 so it does 0x6(%rbx) instead of 0x8(%rbx).
>
> Anyone know where I should be looking at?
>
I would start by looking at uses of tagForCon, lfDynTag and mkTaggedObjectLoad.

Also, did you check that the tag we apply to the closure pointer matches
the tag that the info table defines?

Cheers,

- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20190427/6a51ae44/attachment.sig>


More information about the ghc-devs mailing list