diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2022-09-01 20:36:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 20:36:47 (GMT) |
commit | 4c72517cada147b215cf30ff8dac70ea0f08f1e0 (patch) | |
tree | 1012522409ed719a8d8ba0b5eab4e5f3bce77bd6 /Objects | |
parent | a91f25577c71ab8797a4b42f22c43bbaffc2604d (diff) | |
download | cpython-4c72517cada147b215cf30ff8dac70ea0f08f1e0.zip cpython-4c72517cada147b215cf30ff8dac70ea0f08f1e0.tar.gz cpython-4c72517cada147b215cf30ff8dac70ea0f08f1e0.tar.bz2 |
gh-93554: Conditional jump opcodes only jump forward (GH-96318)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/frameobject.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index d2647bd..2e37779 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -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; |