This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Fix crash when emitting symbol tables with GC
ClosedPublic

Authored by smeenai on Jun 12 2018, 1:31 PM.

Details

Summary

When running with linker GC (-opt:ref), defined imported symbols that
are referenced but then dropped by GC end up with their Location
member being nullptr, which means getChunk() returns nullptr for them
and attempting to call getChunk()->getOutputSection() causes a crash
from the nullptr dereference. Check for getChunk() being nullptr and
bail out early to avoid the crash.

Diff Detail

Repository
rL LLVM

Event Timeline

smeenai created this revision.Jun 12 2018, 1:31 PM
ruiu accepted this revision.Jun 12 2018, 1:37 PM

LGTM

This revision is now accepted and ready to land.Jun 12 2018, 1:37 PM
This revision was automatically updated to reflect the committed changes.