summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-07-06 07:21:59 (GMT)
committerGitHub <noreply@github.com>2022-07-06 07:21:59 (GMT)
commitb22f9d6e8cd9ef15e4898a1d3f2e52ade26a0594 (patch)
treecc1de9f3fe41b991bfc52d782d97b73d895fe19b /Objects
parent5f4a16b2913ac84ccaab95b50dd4b0e7fbc58ec2 (diff)
downloadcpython-b22f9d6e8cd9ef15e4898a1d3f2e52ade26a0594.zip
cpython-b22f9d6e8cd9ef15e4898a1d3f2e52ade26a0594.tar.gz
cpython-b22f9d6e8cd9ef15e4898a1d3f2e52ade26a0594.tar.bz2
[3.11] gh-94438: in frameobject's mark_stacks switch, the PUSH_EXC_INFO and POP_EXCEPT cases are no longer reachable (GH-94582) (GH-94595)
(cherry picked from commit 50b9a7762f06335277d9962edc8d39498601a4e4) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Diffstat (limited to 'Objects')
-rw-r--r--Objects/frameobject.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index cb822a1..7811336 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -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);
@@ -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: