mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-93554: Conditional jump opcodes only jump forward (GH-96318)
This commit is contained in:
parent
a91f25577c
commit
4c72517cad
13 changed files with 298 additions and 448 deletions
|
@ -311,25 +311,12 @@ mark_stacks(PyCodeObject *code_obj, int len)
|
|||
switch (opcode) {
|
||||
case JUMP_IF_FALSE_OR_POP:
|
||||
case JUMP_IF_TRUE_OR_POP:
|
||||
case POP_JUMP_FORWARD_IF_FALSE:
|
||||
case POP_JUMP_BACKWARD_IF_FALSE:
|
||||
case POP_JUMP_FORWARD_IF_TRUE:
|
||||
case POP_JUMP_BACKWARD_IF_TRUE:
|
||||
case POP_JUMP_IF_FALSE:
|
||||
case POP_JUMP_IF_TRUE:
|
||||
{
|
||||
int64_t target_stack;
|
||||
int j = get_arg(code, i);
|
||||
if (opcode == POP_JUMP_FORWARD_IF_FALSE ||
|
||||
opcode == POP_JUMP_FORWARD_IF_TRUE ||
|
||||
opcode == JUMP_IF_FALSE_OR_POP ||
|
||||
opcode == JUMP_IF_TRUE_OR_POP)
|
||||
{
|
||||
j += i + 1;
|
||||
}
|
||||
else {
|
||||
assert(opcode == POP_JUMP_BACKWARD_IF_FALSE ||
|
||||
opcode == POP_JUMP_BACKWARD_IF_TRUE);
|
||||
j = i + 1 - j;
|
||||
}
|
||||
j += i + 1;
|
||||
assert(j < len);
|
||||
if (stacks[j] == UNINITIALIZED && j < i) {
|
||||
todo = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue