aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2011-12-15 22:55:55 +0000
committerKostya Serebryany <kcc@google.com>2011-12-15 22:55:55 +0000
commita4b2b1d8fbb84b0b6fac5abce21a2a5c5e907282 (patch)
tree68a479e68619baa7100ea170238480e90e4764a5 /lib/Transforms
parentd239ff67f210094c205be7e57332948caecf6a24 (diff)
[asan] add the name of the module to the description of a global variable. This improves the readability of global-buffer-overflow reports.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146698 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Instrumentation/AddressSanitizer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index e4f197853e..4cc57276e6 100644
--- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -521,7 +521,11 @@ bool AddressSanitizer::insertGlobalRedzones(Module &M) {
NewTy, G->getInitializer(),
Constant::getNullValue(RightRedZoneTy), NULL);
- GlobalVariable *Name = createPrivateGlobalForString(M, G->getName());
+ SmallString<2048> DescriptionOfGlobal = G->getName();
+ DescriptionOfGlobal += " (";
+ DescriptionOfGlobal += M.getModuleIdentifier();
+ DescriptionOfGlobal += ")";
+ GlobalVariable *Name = createPrivateGlobalForString(M, DescriptionOfGlobal);
// Create a new global variable with enough space for a redzone.
GlobalVariable *NewGlobal = new GlobalVariable(