mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-94438: Handle extended arguments and conditional pops in mark_stacks (GH-95110)
This commit is contained in:
parent
900bfc53cb
commit
e4d3a96a11
3 changed files with 49 additions and 4 deletions
|
@ -319,11 +319,15 @@ mark_stacks(PyCodeObject *code_obj, int len)
|
|||
int64_t target_stack;
|
||||
int j = get_arg(code, i);
|
||||
if (opcode == POP_JUMP_FORWARD_IF_FALSE ||
|
||||
opcode == POP_JUMP_FORWARD_IF_TRUE) {
|
||||
opcode == POP_JUMP_FORWARD_IF_TRUE ||
|
||||
opcode == JUMP_IF_FALSE_OR_POP ||
|
||||
opcode == JUMP_IF_TRUE_OR_POP)
|
||||
{
|
||||
j += i + 1;
|
||||
}
|
||||
else if (opcode == POP_JUMP_BACKWARD_IF_FALSE ||
|
||||
opcode == POP_JUMP_BACKWARD_IF_TRUE) {
|
||||
else {
|
||||
assert(opcode == POP_JUMP_BACKWARD_IF_FALSE ||
|
||||
opcode == POP_JUMP_BACKWARD_IF_TRUE);
|
||||
j = i + 1 - j;
|
||||
}
|
||||
assert(j < len);
|
||||
|
@ -459,7 +463,8 @@ mark_stacks(PyCodeObject *code_obj, int len)
|
|||
}
|
||||
default:
|
||||
{
|
||||
int delta = PyCompile_OpcodeStackEffect(opcode, _Py_OPARG(code[i]));
|
||||
int delta = PyCompile_OpcodeStackEffect(opcode, get_arg(code, i));
|
||||
assert(delta != PY_INVALID_STACK_EFFECT);
|
||||
while (delta < 0) {
|
||||
next_stack = pop_value(next_stack);
|
||||
delta++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue