summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2015-11-13 20:47:29 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2015-11-13 20:47:29 +0000
commitb3d951765ae9be108e3b8f6e8223a5fe8eeb1939 (patch)
tree1affd30a7da5948e470354b03de207cf2ef79213 /lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
parent693df74a1a33541d4e2a97b5c4ee38c4289ca11e (diff)
[tsan] Don't demangle names not starting with "_Z"
I noticed that when a symbol is named just "x", it gets demangled to "long long". On POSIX, AFAIK, mangled names always start with "_Z", so lets just require that. Differential Revision: http://reviews.llvm.org/D14637 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc b/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
index a19b0a678..c4bc9b8d9 100644
--- a/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
+++ b/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
@@ -48,6 +48,9 @@ namespace __sanitizer {
// Attempts to demangle the name via __cxa_demangle from __cxxabiv1.
const char *DemangleCXXABI(const char *name) {
+ if (name[0] != '_' || name[1] != 'Z')
+ return name;
+
// FIXME: __cxa_demangle aggressively insists on allocating memory.
// There's not much we can do about that, short of providing our
// own demangler (libc++abi's implementation could be adapted so that