diff options
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/bytecodes.c | 1 | ||||
| -rw-r--r-- | Python/compile.c | 6 | ||||
| -rw-r--r-- | Python/generated_cases.c.h | 1 | ||||
| -rw-r--r-- | Python/opcode_metadata.h | 2 |
4 files changed, 4 insertions, 6 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 47bbe1a..ac54791 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -720,7 +720,6 @@ dummy_func( // NOTE: It's important that YIELD_VALUE never raises an exception! // The compiler treats any exception raised here as a failed close() // or throw() call. - assert(oparg == STACK_LEVEL()); assert(frame != &entry_frame); PyGenObject *gen = _PyFrame_GetGenerator(frame); gen->gi_frame_state = FRAME_SUSPENDED; diff --git a/Python/compile.c b/Python/compile.c index ce714dc..9fc997c 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -7162,9 +7162,6 @@ stackdepth(basicblock *entryblock, int code_flags) next = NULL; break; } - if (instr->i_opcode == YIELD_VALUE) { - instr->i_oparg = depth; - } } if (next != NULL) { assert(BB_HAS_FALLTHROUGH(b)); @@ -7332,6 +7329,9 @@ label_exception_targets(basicblock *entryblock) { } } else { + if (instr->i_opcode == YIELD_VALUE) { + instr->i_oparg = except_stack->depth; + } instr->i_except = handler; } } diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index c1eb400..5dcc8ee 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -919,7 +919,6 @@ // NOTE: It's important that YIELD_VALUE never raises an exception! // The compiler treats any exception raised here as a failed close() // or throw() call. - assert(oparg == STACK_LEVEL()); assert(frame != &entry_frame); PyGenObject *gen = _PyFrame_GetGenerator(frame); gen->gi_frame_state = FRAME_SUSPENDED; diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h index 3ceaca8..1fb0acc 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -59,7 +59,7 @@ static const struct { [GET_ANEXT] = { 1, 2, DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX }, [GET_AWAITABLE] = { 1, 1, DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IB }, [SEND] = { -1, -1, DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IB }, - [YIELD_VALUE] = { 1, 1, DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IB }, + [YIELD_VALUE] = { 1, 1, DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX }, [POP_EXCEPT] = { 1, 0, DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX }, [RERAISE] = { -1, -1, DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IB }, [PREP_RERAISE_STAR] = { 2, 1, DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX }, |
