summaryrefslogtreecommitdiff
path: root/lib/asan/asan_report.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-09-16 15:45:06 +0000
committerAlexey Samsonov <samsonov@google.com>2013-09-16 15:45:06 +0000
commit22e21b044c9337a2fa921f268b7d221c693ad78b (patch)
treebc1fb237584b973044de1a43e86c6685258cb71b /lib/asan/asan_report.cc
parent7bb2f9b27ee0210f25b009fb5597383b334dc01e (diff)
downloadcompiler-rt-22e21b044c9337a2fa921f268b7d221c693ad78b.tar.gz
compiler-rt-22e21b044c9337a2fa921f268b7d221c693ad78b.tar.bz2
compiler-rt-22e21b044c9337a2fa921f268b7d221c693ad78b.tar.xz
[ASan] Check that getSymbolizer() is defined. Turn magic mapping constants into named variables
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190787 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_report.cc')
-rw-r--r--lib/asan/asan_report.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/asan/asan_report.cc b/lib/asan/asan_report.cc
index 0706e61f..55a9a4ef 100644
--- a/lib/asan/asan_report.cc
+++ b/lib/asan/asan_report.cc
@@ -180,8 +180,9 @@ static bool IsASCII(unsigned char c) {
static const char *MaybeDemangleGlobalName(const char *name) {
// We can spoil names of globals with C linkage, so use an heuristic
// approach to check if the name should be demangled.
- return (name[0] == '_' && name[1] == 'Z') ? getSymbolizer()->Demangle(name)
- : name;
+ return (name[0] == '_' && name[1] == 'Z' && &getSymbolizer)
+ ? getSymbolizer()->Demangle(name)
+ : name;
}
// Check if the global is a zero-terminated ASCII string. If so, print it.
@@ -543,7 +544,7 @@ class ScopedInErrorReport {
static void ReportSummary(const char *error_type, StackTrace *stack) {
if (!stack->size) return;
- if (getSymbolizer()->IsAvailable()) {
+ if (&getSymbolizer && getSymbolizer()->IsAvailable()) {
AddressInfo ai;
// Currently, we include the first stack frame into the report summary.
// Maybe sometimes we need to choose another frame (e.g. skip memcpy/etc).