CLabel: Catch #11155 during C-- pretty-printing
ClosedPublic

Authored by bgamari on May 17 2016, 5:08 AM.

Details

Summary

In Trac #11555 we ended up generating references to the non-existence
stg_ap_0_upd. Here we add asserts to verify that we don't generate
references to non-existent selector or application symbols.

It would likely also make sense to add further asserts during code
generation, so we can catch the issue even closer to its source.

Test Plan

Validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bgamari retitled this revision from to CLabel: Catch #11155 during C-- pretty-printing.May 17 2016, 5:08 AM
bgamari updated this object.
bgamari edited the test plan for this revision. (Show Details)
bgamari added a reviewer: ezyang.
bgamari updated the Trac tickets for this revision.
simonmar accepted this revision.May 17 2016, 6:52 AM
This revision is now accepted and ready to land.May 17 2016, 6:52 AM

Great, thanks. Unfortunately, the asserts will get optimized away in the production compiler so it won't be that helpful for people who stumble across this in the while but it will be helpful when debugging, I suppose.

"ezyang (Edward Z. Yang)" <noreply@phabricator.haskell.org> writes:

Indeed; I think that's okay though. Moreover, it makes the invariant clearer.

This revision was automatically updated to reflect the committed changes.
In D2230#64585, @ezyang wrote:

Great, thanks. Unfortunately, the asserts will get optimized away in the production compiler so it won't be that helpful for people who stumble across this in the while but it will be helpful when debugging, I suppose.

Right. I wonder if a pprPanic would not be more appropriate here. The check seems to be rather cheap.