[sanitizer_common] Fix StripFunctionName() on Windows
authorMarco Elver <elver@google.com>
Thu, 25 May 2023 11:04:43 +0000 (13:04 +0200)
committerMarco Elver <elver@google.com>
Thu, 25 May 2023 11:19:07 +0000 (13:19 +0200)
Also implement StripFunctionName() on Windows to properly strip
interceptor prefixes.

Reported-by: https://lab.llvm.org/buildbot#builders/127/builds/48810
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cpp

index 2285ad8..1096d21 100644 (file)
@@ -32,6 +32,9 @@ const char *StripFunctionName(const char *function) {
   if (SANITIZER_APPLE) {
     if (const char *s = try_strip("wrap_"))
       return s;
+  } else if (SANITIZER_WINDOWS) {
+    if (const char *s = try_strip("__asan_wrap_"))
+      return s;
   } else {
     if (const char *s = try_strip("__interceptor_"))
       return s;