[compiler-rt] r222000 - [sanitizer] Extend a comment in SlowUnwind.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Fri Nov 14 07:13:23 PST 2014


Author: eugenis
Date: Fri Nov 14 09:13:23 2014
New Revision: 222000

URL: http://llvm.org/viewvc/llvm-project?rev=222000&view=rev
Log:
[sanitizer] Extend a comment in SlowUnwind.

This better explains a change in r221520.

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

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc?rev=222000&r1=221999&r2=222000&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc Fri Nov 14 09:13:23 2014
@@ -115,7 +115,12 @@ void BufferedStackTrace::SlowUnwindStack
   _Unwind_Backtrace(Unwind_Trace, &arg);
   // We need to pop a few frames so that pc is on top.
   uptr to_pop = LocatePcInTrace(pc);
-  // trace_buffer[0] belongs to the current function so we always pop it.
+  // trace_buffer[0] belongs to the current function so we always pop it,
+  // unless there is only 1 frame in the stack trace (1 frame is always better
+  // than 0!).
+  // 1-frame stacks don't normally happen, but this depends on the actual
+  // unwinder implementation (libgcc, libunwind, etc) which is outside of our
+  // control.
   if (to_pop == 0 && size > 1)
     to_pop = 1;
   PopStackFrames(to_pop);





More information about the llvm-commits mailing list