mirror of
https://github.com/python/cpython.git
synced 2025-10-19 16:03:42 +00:00
gh-137681: Always initialize exception handler for new instruction (#137655)
Always initialize exception handler for new instruction
This commit is contained in:
parent
089a324a42
commit
b78e9c05b6
2 changed files with 47 additions and 42 deletions
|
@ -199,8 +199,10 @@ basicblock_addop(basicblock *b, int opcode, int oparg, location loc)
|
|||
cfg_instr *i = &b->b_instr[off];
|
||||
i->i_opcode = opcode;
|
||||
i->i_oparg = oparg;
|
||||
i->i_target = NULL;
|
||||
i->i_loc = loc;
|
||||
// memory is already zero initialized
|
||||
assert(i->i_target == NULL);
|
||||
assert(i->i_except == NULL);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
@ -1104,6 +1106,7 @@ basicblock_remove_redundant_nops(basicblock *bb) {
|
|||
assert(dest <= bb->b_iused);
|
||||
int num_removed = bb->b_iused - dest;
|
||||
bb->b_iused = dest;
|
||||
memset(&bb->b_instr[dest], 0, sizeof(cfg_instr) * num_removed);
|
||||
return num_removed;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue