This is an archive of the discontinued LLVM Phabricator instance.

[SanitizerCoverage] Clang crashes if user declares `__sancov_lowest_stack` variable
ClosedPublic

Authored by yln on Feb 1 2019, 5:53 PM.

Details

Summary

If the user declares or defines __sancov_lowest_stack with an
unexpected type, then getOrInsertGlobal inserts a bitcast and the
following cast fails:

Constant *SanCovLowestStackConstant =
       M.getOrInsertGlobal(SanCovLowestStackName, IntptrTy);
SanCovLowestStack = cast<GlobalVariable>(SanCovLowestStackConstant);

This variable is a SanitizerCoverage implementation detail and the user
should generally never have a need to access it, so we emit an error
now.

rdar://problem/44143130

Diff Detail

Repository
rL LLVM

Event Timeline

yln created this revision.Feb 1 2019, 5:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2019, 5:53 PM
yln added a project: Restricted Project.
This revision is now accepted and ready to land.Feb 4 2019, 9:03 AM
This revision was automatically updated to reflect the committed changes.