Skip to content

Commit

Permalink
[3.11] gh-94438: in frameobject's mark_stacks switch, the PUSH_EXC_IN…
Browse files Browse the repository at this point in the history
…FO and POP_EXCEPT cases are no longer reachable (GH-94582) (GH-94595)

(cherry picked from commit 50b9a77)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
  • Loading branch information
iritkatriel authored Jul 6, 2022
1 parent 5f4a16b commit b22f9d6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,6 @@ mark_stacks(PyCodeObject *code_obj, int len)
stacks[i+1] = next_stack;
break;
}
case POP_EXCEPT:
next_stack = pop_value(pop_value(pop_value(next_stack)));
stacks[i+1] = next_stack;
break;
case SEND:
j = get_arg(code, i) + i + 1;
assert(j < len);
Expand Down Expand Up @@ -304,10 +300,16 @@ mark_stacks(PyCodeObject *code_obj, int len)
stacks[i+1] = next_stack;
break;
case PUSH_EXC_INFO:
next_stack = push_value(next_stack, Except);
next_stack = push_value(next_stack, Except);
next_stack = push_value(next_stack, Except);
stacks[i+1] = next_stack;
case POP_EXCEPT:
/* These instructions only appear in exception handlers, which
* skip this switch ever since the move to zero-cost exceptions
* (their stack remains UNINITIALIZED because nothing sets it).
*
* Note that explain_incompatible_stack interprets an
* UNINITIALIZED stack as belonging to an exception handler.
*/
Py_UNREACHABLE();
break;
case RETURN_VALUE:
case RAISE_VARARGS:
case RERAISE:
Expand Down

0 comments on commit b22f9d6

Please sign in to comment.