diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-11-30 11:03:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 11:03:30 (GMT) |
commit | 07ebd46f9e55ed2f18c5ea2a79ec5054bc26b915 (patch) | |
tree | cfa482ec8e6e8f5dd4b77804a668235aa1ae9ccf /Python | |
parent | 7eeea13403882af63a71226433c9a13b80c22564 (diff) | |
download | cpython-07ebd46f9e55ed2f18c5ea2a79ec5054bc26b915.zip cpython-07ebd46f9e55ed2f18c5ea2a79ec5054bc26b915.tar.gz cpython-07ebd46f9e55ed2f18c5ea2a79ec5054bc26b915.tar.bz2 |
gh-112519: Make it possible to specify instruction flags for pseudo instructions in bytecodes.c (#112520)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bytecodes.c | 6 | ||||
-rw-r--r-- | Python/flowgraph.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 2e5f6c8..2075c19 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -2831,15 +2831,15 @@ dummy_func( ERROR_IF(res == NULL, error); } - pseudo(SETUP_FINALLY) = { + pseudo(SETUP_FINALLY, (HAS_ARG)) = { NOP, }; - pseudo(SETUP_CLEANUP) = { + pseudo(SETUP_CLEANUP, (HAS_ARG)) = { NOP, }; - pseudo(SETUP_WITH) = { + pseudo(SETUP_WITH, (HAS_ARG)) = { NOP, }; diff --git a/Python/flowgraph.c b/Python/flowgraph.c index 87401e1..fe63208 100644 --- a/Python/flowgraph.c +++ b/Python/flowgraph.c @@ -97,6 +97,7 @@ static const jump_target_label NO_LABEL = {-1}; static inline int is_block_push(cfg_instr *i) { + assert(OPCODE_HAS_ARG(i->i_opcode) || !IS_BLOCK_PUSH_OPCODE(i->i_opcode)); return IS_BLOCK_PUSH_OPCODE(i->i_opcode); } @@ -2239,7 +2240,6 @@ convert_pseudo_ops(basicblock *entryblock) for (int i = 0; i < b->b_iused; i++) { cfg_instr *instr = &b->b_instr[i]; if (is_block_push(instr) || instr->i_opcode == POP_BLOCK) { - assert(SAME_OPCODE_METADATA(instr->i_opcode, NOP)); INSTR_SET_OP0(instr, NOP); } else if (instr->i_opcode == LOAD_CLOSURE) { |