[PATCH] D77099: Exit unwinding early when at the top of the stack and additional info won't be found.
Sterling Augustine via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 30 15:51:39 PDT 2020
saugustine created this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
saugustine added reviewers: jgorbe, mstorsjo, compnerd, miyuki, mclow.lists.
This patch follows libgcc's lead: When the return-address register is
zero, there won't be additional stack frames to examine, or gather
information about. Exit before spending time looking for something
known not to be found.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77099
Files:
libunwind/src/UnwindCursor.hpp
Index: libunwind/src/UnwindCursor.hpp
===================================================================
--- libunwind/src/UnwindCursor.hpp
+++ libunwind/src/UnwindCursor.hpp
@@ -1848,6 +1848,12 @@
pc &= (pint_t)~0x1;
#endif
+ // Exit early if at the top of the stack.
+ if (pc == 0) {
+ _unwindInfoMissing = true;
+ return;
+ }
+
// If the last line of a function is a "throw" the compiler sometimes
// emits no instructions after the call to __cxa_throw. This means
// the return address is actually the start of the next function.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77099.253720.patch
Type: text/x-patch
Size: 560 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200330/19cdced6/attachment-0001.bin>
More information about the llvm-commits
mailing list