diff options
| author | Kostya Serebryany <kcc@google.com> | 2011-12-15 22:55:55 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2011-12-15 22:55:55 +0000 |
| commit | 7a9eb49a47058fddaaf1576bc8547696221d9230 (patch) | |
| tree | 6afeb5c4749336998cc3f63011e3669b3187bfbc | |
| parent | 10437fd33649c9dbce4130bbc74cac4a8e12e259 (diff) | |
| download | bcm5719-llvm-7a9eb49a47058fddaaf1576bc8547696221d9230.tar.gz bcm5719-llvm-7a9eb49a47058fddaaf1576bc8547696221d9230.zip | |
[asan] add the name of the module to the description of a global variable. This improves the readability of global-buffer-overflow reports.
llvm-svn: 146698
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index e4f197853ef..4cc57276e6f 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/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( |

