GH-128533: Add NOT_TAKEN instruction after bytecode optimization. (GH-128554)

This commit is contained in:
Mark Shannon 2025-01-06 22:01:07 +00:00 committed by GitHub
parent b6c919b674
commit 2434fd2d50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 127 additions and 139 deletions

View file

@ -406,13 +406,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
assert(IS_JUMP_TARGET_LABEL(target));
assert(OPCODE_HAS_JUMP(opcode) || IS_BLOCK_PUSH_OPCODE(opcode));
assert(!IS_ASSEMBLER_OPCODE(opcode));
if (_PyInstructionSequence_Addop(seq, opcode, target.id, loc) != SUCCESS) {
return ERROR;
}
if (IS_CONDITIONAL_JUMP_OPCODE(opcode)) {
return _PyInstructionSequence_Addop(seq, NOT_TAKEN, 0, NO_LOCATION);
}
return SUCCESS;
return _PyInstructionSequence_Addop(seq, opcode, target.id, loc);
}
#define ADDOP_JUMP(C, LOC, OP, O) \