mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
[ASan] Don't instrument load/stores with !nosanitize metadata.
This is used to avoid instrumentation of instructions added by UBSan in Clang frontend (see r213291). This fixes PR20085. Reviewed in http://reviews.llvm.org/D4544. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213292 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -655,6 +655,9 @@ void AddressSanitizer::instrumentMemIntrinsic(MemIntrinsic *MI) {
|
||||
// and set IsWrite/Alignment. Otherwise return NULL.
|
||||
static Value *isInterestingMemoryAccess(Instruction *I, bool *IsWrite,
|
||||
unsigned *Alignment) {
|
||||
// Skip memory accesses inserted by another instrumentation.
|
||||
if (I->getMetadata("nosanitize"))
|
||||
return nullptr;
|
||||
if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
|
||||
if (!ClInstrumentReads) return nullptr;
|
||||
*IsWrite = false;
|
||||
|
Reference in New Issue
Block a user