[PATCH] D35265: [libunwind] Handle .ARM.exidx tables without sentinel last entry
Momchil Velikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 19 08:43:05 PDT 2017
chill updated this revision to Diff 107311.
chill marked an inline comment as done.
chill added a comment.
Addressed the comments above.
https://reviews.llvm.org/D35265
Files:
src/UnwindCursor.hpp
Index: src/UnwindCursor.hpp
===================================================================
--- src/UnwindCursor.hpp
+++ src/UnwindCursor.hpp
@@ -744,14 +744,21 @@
EHABISectionIterator<A>::begin(_addressSpace, sects);
EHABISectionIterator<A> end =
EHABISectionIterator<A>::end(_addressSpace, sects);
+ if (begin == end)
+ return false;
EHABISectionIterator<A> itNextPC = std::upper_bound(begin, end, pc);
- if (itNextPC == begin || itNextPC == end)
+ if (itNextPC == begin)
return false;
EHABISectionIterator<A> itThisPC = itNextPC - 1;
pint_t thisPC = itThisPC.functionAddress();
- pint_t nextPC = itNextPC.functionAddress();
+ // If an exception is thrown from a function, corresponding to the last entry
+ // in the table, we don't really know the function extent and have to choose a
+ // value for nextPC. Choosing max() will allow the range check during trace to
+ // succeed.
+ pint_t nextPC = (itNextPC == end) ? std::numeric_limits<pint_t>::max()
+ : itNextPC.functionAddress();
pint_t indexDataAddr = itThisPC.dataAddress();
if (indexDataAddr == 0)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35265.107311.patch
Type: text/x-patch
Size: 1153 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170719/0912df27/attachment.bin>
More information about the llvm-commits
mailing list