[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
This commit is contained in:
@@ -1015,8 +1015,10 @@ public:
|
||||
return SanitizerBL;
|
||||
}
|
||||
|
||||
void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
|
||||
void reportGlobalToASan(llvm::GlobalVariable *GV, const VarDecl &D,
|
||||
bool IsDynInit = false);
|
||||
void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
|
||||
StringRef Name, bool IsDynInit = false);
|
||||
|
||||
void addDeferredVTable(const CXXRecordDecl *RD) {
|
||||
DeferredVTables.push_back(RD);
|
||||
|
||||
Reference in New Issue
Block a user