Chromium Code Reviews| Index: base/debug/stack_trace.cc |
| diff --git a/base/debug/stack_trace.cc b/base/debug/stack_trace.cc |
| index 94ff7d0755ab50a650ebcee9dfbe05ab287972b2..6c3940456e9f79969fd16ddf4a93af4cdd4307ea 100644 |
| --- a/base/debug/stack_trace.cc |
| +++ b/base/debug/stack_trace.cc |
| @@ -111,12 +111,13 @@ bool IsStackFrameValid(uintptr_t fp, uintptr_t prev_fp, uintptr_t stack_end) { |
| // Check alignment. |
| if (fp & (sizeof(uintptr_t) - 1)) return false; |
| + // A PC that is too small means we've gone off the end of the stack. |
| + if (GetStackFramePC(fp) < 32768) |
|
Mark Mentovai
2017/02/15 21:05:57
You could go even bigger. On x86_64, you’ll genera
erikchen
2017/02/15 21:52:45
Also, this is run on all plaforms.
Wez
2017/02/15 22:38:22
Maybe use a kConstant here, so we can define it to
erikchen
2017/02/15 22:52:24
Done.
|
| + return false; |
| + |
| if (stack_end) { |
| // Both fp[0] and fp[1] must be within the stack. |
| if (fp > stack_end - 2 * sizeof(uintptr_t)) return false; |
| - |
| - // Additional check to filter out false positives. |
| - if (GetStackFramePC(fp) < 32768) return false; |
| } |
| return true; |