diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-12 00:42:52 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-12 00:42:52 +0000 |
commit | 15c96696150cc76a28e4aa51a109ef68476c3b5a (patch) | |
tree | 3b7d919d22ad549c245c88ad1f2d0b176a4c2068 /clang/lib/CodeGen/CGDecl.cpp | |
parent | fc31efe95a9a220fb1a3f7a7dd8109fd2441d196 (diff) | |
download | llvm-15c96696150cc76a28e4aa51a109ef68476c3b5a.zip llvm-15c96696150cc76a28e4aa51a109ef68476c3b5a.tar.gz llvm-15c96696150cc76a28e4aa51a109ef68476c3b5a.tar.bz2 |
[ASan] Collect unmangled names of global variables in Clang to print them in error reports.
Currently ASan instrumentation pass creates a string with global name
for each instrumented global (to include global names in the error report). Global
name is already mangled at this point, and we may not be able to demangle it
at runtime (e.g. there is no __cxa_demangle on Android).
Instead, create a string with fully qualified global name in Clang, and pass it
to ASan instrumentation pass in llvm.asan.globals metadata. If there is no metadata
for some global, ASan will use the original algorithm.
This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=264.
llvm-svn: 212872
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 9bd61d7..91f8041 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -345,7 +345,7 @@ void CodeGenFunction::EmitStaticVarDecl(const VarDecl &D, DMEntry = castedAddr; CGM.setStaticLocalDeclAddress(&D, castedAddr); - CGM.reportGlobalToASan(var, D.getLocation()); + CGM.reportGlobalToASan(var, D); // Emit global variable debug descriptor for static vars. CGDebugInfo *DI = getDebugInfo(); |