[SanitizerCoverage] Clang crashes if user declares `__sancov_lowest_stack` variable
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 Reviewers: morehouse Differential Revision: https://reviews.llvm.org/D57633 llvm-svn: 353100
Showing
- llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp 6 additions, 1 deletionllvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
- llvm/test/Instrumentation/SanitizerCoverage/stack-depth-variable-declared-by-user.ll 12 additions, 0 deletions...anitizerCoverage/stack-depth-variable-declared-by-user.ll
Loading
Please register or sign in to comment