[Sanitizer] Try to fix infinite loop in frame pointer unwinder
Using > instead of >= ensures that each frame deref makes progress and that we eventually terminate. Issue: https://code.google.com/p/address-sanitizer/issues/detail?id=162 llvm-svn: 175661
This commit is contained in:
parent
b19337fbe4
commit
15f2d1f4be
|
@ -131,8 +131,9 @@ void StackTrace::FastUnwindStack(uptr pc, uptr bp,
|
||||||
CHECK(size == 0 && trace[0] == pc);
|
CHECK(size == 0 && trace[0] == pc);
|
||||||
size = 1;
|
size = 1;
|
||||||
uhwptr *frame = (uhwptr *)bp;
|
uhwptr *frame = (uhwptr *)bp;
|
||||||
uhwptr *prev_frame = frame;
|
uhwptr *prev_frame = frame - 1;
|
||||||
while (frame >= prev_frame &&
|
// Avoid infinite loop when frame == frame[0] by using frame > prev_frame.
|
||||||
|
while (frame > prev_frame &&
|
||||||
frame < (uhwptr *)stack_top - 2 &&
|
frame < (uhwptr *)stack_top - 2 &&
|
||||||
frame > (uhwptr *)stack_bottom &&
|
frame > (uhwptr *)stack_bottom &&
|
||||||
size < max_size) {
|
size < max_size) {
|
||||||
|
|
Loading…
Reference in New Issue