Skip to content

Commit 9efd9e0

Browse files
committed
pythongh-94438: in frameobject's mark_stacks switch, the PUSH_EXC_INFO and POP_EXCEPT cases are no longer reachable
1 parent 2b8ed4d commit 9efd9e0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Objects/frameobject.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,6 @@ mark_stacks(PyCodeObject *code_obj, int len)
256256
stacks[i+1] = next_stack;
257257
break;
258258
}
259-
case POP_EXCEPT:
260-
next_stack = pop_value(pop_value(pop_value(next_stack)));
261-
stacks[i+1] = next_stack;
262-
break;
263259
case SEND:
264260
j = get_arg(code, i) + i + 1;
265261
assert(j < len);
@@ -304,10 +300,12 @@ mark_stacks(PyCodeObject *code_obj, int len)
304300
stacks[i+1] = next_stack;
305301
break;
306302
case PUSH_EXC_INFO:
307-
next_stack = push_value(next_stack, Except);
308-
next_stack = push_value(next_stack, Except);
309-
next_stack = push_value(next_stack, Except);
310-
stacks[i+1] = next_stack;
303+
case POP_EXCEPT:
304+
/* These instructions only appear in exception handlers, which
305+
* skip this switch ever since the move to zero-cost exceptions
306+
* (their stack remains UNINITIALIZED because nothing sets it).
307+
*/
308+
Py_UNREACHABLE();
311309
case RETURN_VALUE:
312310
case RAISE_VARARGS:
313311
case RERAISE:

0 commit comments

Comments
 (0)