[compiler-rt] r201325 - [sanitizer] Fix off-by-one-line in SEGV reports on Android.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Feb 13 05:32:25 PST 2014


Author: eugenis
Date: Thu Feb 13 07:32:24 2014
New Revision: 201325

URL: http://llvm.org/viewvc/llvm-project?rev=201325&view=rev
Log:
[sanitizer] Fix off-by-one-line in SEGV reports on Android.

This will be covered by null_deref.cc test (requires one more fix to pass).

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

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc?rev=201325&r1=201324&r2=201325&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc Thu Feb 13 07:32:24 2014
@@ -258,8 +258,10 @@ void StackTrace::SlowUnwindStackWithCont
   if (res < 0) return;
   CHECK((uptr)res <= kStackTraceMax);
 
+  // +2 compensate for libcorkscrew unwinder returning addresses of call
+  // instructions instead of raw return addresses.
   for (sptr i = 0; i < res; ++i)
-    trace[size++] = frames[i].absolute_pc;
+    trace[size++] = frames[i].absolute_pc + 2;
 }
 
 #endif  // !SANITIZER_GO





More information about the llvm-commits mailing list