<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 7, 2014 at 4:03 AM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com" target="_blank">eugeni.stepanov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: eugenis<br>
Date: Fri Nov 7 06:03:07 2014<br>
New Revision: 221520<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=221520&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=221520&view=rev</a><br>
Log:<br>
[sanitizer] Never remove the last frame off the stack trace.<br></blockquote><div><br></div><div>Test case? I'm also not quite sure what this is doing - why are we popping/ignoring frames exactly?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It can only make it worse.<br>
<br>
Modified:<br>
compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc?rev=221520&r1=221519&r2=221520&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc?rev=221520&r1=221519&r2=221520&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc Fri Nov 7 06:03:07 2014<br>
@@ -116,7 +116,7 @@ void BufferedStackTrace::SlowUnwindStack<br>
// We need to pop a few frames so that pc is on top.<br>
uptr to_pop = LocatePcInTrace(pc);<br>
// trace_buffer[0] belongs to the current function so we always pop it.<br>
- if (to_pop == 0)<br>
+ if (to_pop == 0 && size > 1)<br>
to_pop = 1;<br>
PopStackFrames(to_pop);<br>
trace_buffer[0] = pc;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>