Skip to content

Commit

Permalink
fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Sep 24, 2024
1 parent ef192ae commit 9564043
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,7 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
// cannot point to itself.
assert(inst->i_target != inst->i_target->b_next);
inst->i_target = inst->i_target->b_next;
i--;
continue;
}
break;
Expand All @@ -1791,6 +1792,7 @@ optimize_basic_block(PyObject *const_cache, basicblock *bb, PyObject *consts)
// cannot point to itself.
assert(inst->i_target != inst->i_target->b_next);
inst->i_target = inst->i_target->b_next;
i--;
continue;
}
break;
Expand Down Expand Up @@ -2411,17 +2413,18 @@ convert_pseudo_conditional_jumps(cfg_builder *g)
assert(i == b->b_iused - 1);
instr->i_opcode = instr->i_opcode == JUMP_IF_FALSE ?
POP_JUMP_IF_FALSE : POP_JUMP_IF_TRUE;
location loc = instr->i_loc;
cfg_instr copy = {
.i_opcode = COPY,
.i_oparg = 1,
.i_loc = instr->i_loc,
.i_loc = loc,
.i_target = NULL,
};
RETURN_IF_ERROR(basicblock_insert_instruction(b, i++, &copy));
cfg_instr to_bool = {
.i_opcode = TO_BOOL,
.i_oparg = 0,
.i_loc = instr->i_loc,
.i_loc = loc,
.i_target = NULL,
};
RETURN_IF_ERROR(basicblock_insert_instruction(b, i++, &to_bool));
Expand Down

0 comments on commit 9564043

Please sign in to comment.