diff options
author | Alexander Potapenko <glider@google.com> | 2014-03-20 10:48:34 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2014-03-20 10:48:34 +0000 |
commit | d68ef1a8d725ef8890dbd8ef7a7f202b735e02b1 (patch) | |
tree | 3f79272a2083fcac69d4e0b53eb70dc36388e5f5 /lib/Transforms/Instrumentation | |
parent | 37fb9b959107ba084e097bd14347aa900e5234a4 (diff) | |
download | llvm-d68ef1a8d725ef8890dbd8ef7a7f202b735e02b1.tar.gz llvm-d68ef1a8d725ef8890dbd8ef7a7f202b735e02b1.tar.bz2 llvm-d68ef1a8d725ef8890dbd8ef7a7f202b735e02b1.tar.xz |
[ASan] Do not instrument globals from the llvm.metadata section.
Fixes https://code.google.com/p/address-sanitizer/issues/detail?id=279.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r-- | lib/Transforms/Instrumentation/AddressSanitizer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 5c35cc8faf..a19e1f7063 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -927,6 +927,8 @@ bool AddressSanitizerModule::ShouldInstrumentGlobal(GlobalVariable *G) { DEBUG(dbgs() << "Ignoring a cstring literal: " << *G << "\n"); return false; } + // Globals from llvm.metadata aren't emitted, do not instrument them. + if (Section == "llvm.metadata") return false; } return true; |