Skip to content
Snippets Groups Projects
Commit f9c6d53f authored by Simon Marlow's avatar Simon Marlow Committed by Ben Gamari
Browse files

Tag the FUN before making a PAP (#13767)

Pointers to FUNs are not guaranteed to be tagged in general, because
the compiler doesn't always know the arity of a FUN when it needs to
reference it, e.g. with -O0 when the function is in another module.

However, there's one case where we can put the correct tag on a FUN:
when it is referenced by a PAP, because when building the PAP we know
the arity and we can tag the pointer correctly.  The AutoApply code
does this, and the sanity checker checks it, but the interpreter did
not respect this invariant.  This patch fixes it.

Test Plan:
```
(cd ghc && make 2 GhcDebugged=YES)
./inplace/bin/ghc-stage2 --interpreter +RTS -DS
```

Reviewers: niteria, bgamari, austin, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #13767

Differential Revision: https://phabricator.haskell.org/D3680
parent 1a9c3c44
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment