[compiler-rt] r186837 - [sanitizer] Change strip_path_prefix flag behavior.

Sergey Matveev earthdok at google.com
Mon Jul 22 09:14:39 PDT 2013


Author: smatveev
Date: Mon Jul 22 11:14:38 2013
New Revision: 186837

URL: http://llvm.org/viewvc/llvm-project?rev=186837&view=rev
Log:
[sanitizer] Change strip_path_prefix flag behavior.

Previously (in tools other than TSan) the entire prefix of the path had to mach
the argument. With this change, only some suffix of the prefix has to match.
This is the same way this flag works in TSan.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc?rev=186837&r1=186836&r2=186837&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc Mon Jul 22 11:14:38 2013
@@ -20,8 +20,9 @@ namespace __sanitizer {
 const char *StripPathPrefix(const char *filepath,
                             const char *strip_file_prefix) {
   if (filepath == 0) return 0;
-  if (filepath == internal_strstr(filepath, strip_file_prefix))
-    return filepath + internal_strlen(strip_file_prefix);
+  const char *prefix_beg = internal_strstr(filepath, strip_file_prefix);
+  if (prefix_beg)
+    return prefix_beg + internal_strlen(strip_file_prefix);
   return filepath;
 }
 





More information about the llvm-commits mailing list