forked from OSchip/llvm-project
Adding a comment to explain r273886 ("Stop unwinding the stack when a close-to-zero PC is found"). NFC.
llvm-svn: 274010
This commit is contained in:
parent
248cfb9752
commit
cdf257f4d8
|
@ -93,6 +93,9 @@ void BufferedStackTrace::FastUnwindStack(uptr pc, uptr bp, uptr stack_top,
|
|||
#else
|
||||
uhwptr pc1 = frame[1];
|
||||
#endif
|
||||
// Let's assume that any pointer in the 0th page (i.e. <0x1000 on i386 and
|
||||
// x86_64) is invalid and stop unwinding here. If we're adding support for
|
||||
// a platform where this isn't true, we need to reconsider this check.
|
||||
if (pc1 < kPageSize)
|
||||
break;
|
||||
if (pc1 != pc) {
|
||||
|
|
|
@ -109,6 +109,9 @@ _Unwind_Reason_Code Unwind_Trace(struct _Unwind_Context *ctx, void *param) {
|
|||
CHECK_LT(arg->stack->size, arg->max_depth);
|
||||
uptr pc = Unwind_GetIP(ctx);
|
||||
const uptr kPageSize = GetPageSizeCached();
|
||||
// Let's assume that any pointer in the 0th page (i.e. <0x1000 on i386 and
|
||||
// x86_64) is invalid and stop unwinding here. If we're adding support for
|
||||
// a platform where this isn't true, we need to reconsider this check.
|
||||
if (pc < kPageSize) return UNWIND_STOP;
|
||||
arg->stack->trace_buffer[arg->stack->size++] = pc;
|
||||
if (arg->stack->size == arg->max_depth) return UNWIND_STOP;
|
||||
|
|
Loading…
Reference in New Issue