Skip to content

Commit 3e8f257

Browse files
vtjnashJeffBezanson
authored andcommitted
small fix to simplify interpreter-stacktraces PR (#34089)
If we hit an uninitialized frame (probably meaning an async signal), previously this would have fallen into an infinite loop, instead of continuing past it. Refactor to fix that.
1 parent 14250f7 commit 3e8f257

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/stackwalk.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ static jl_gcframe_t *is_enter_interpreter_frame(jl_gcframe_t **ppgcstack, uintpt
3434
jl_gcframe_t *prev = pgcstack->prev;
3535
if (pgcstack->nroots & 2) { // tagged frame
3636
uintptr_t frame_fp = ((uintptr_t*)pgcstack)[-1];
37-
if (frame_fp == 0)
38-
continue; // frame wasn't fully initialized yet
39-
if (frame_fp >= sp)
40-
break; // stack grows down, so frame pointer is monotonically increasing
41-
*ppgcstack = prev;
42-
return pgcstack;
37+
if (frame_fp != 0) { // check that frame was fully initialized
38+
if (frame_fp >= sp)
39+
break; // stack grows down, so frame pointer is monotonically increasing
40+
*ppgcstack = prev;
41+
return pgcstack;
42+
}
4343
}
4444
*ppgcstack = pgcstack = prev;
4545
}

0 commit comments

Comments
 (0)