mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
GH-118095: Handle RETURN_GENERATOR
in tier 2 (GH-118180)
This commit is contained in:
parent
10bb90ed49
commit
f180b31e76
16 changed files with 143 additions and 81 deletions
|
@ -651,6 +651,28 @@ dummy_func(void) {
|
|||
}
|
||||
}
|
||||
|
||||
op(_RETURN_GENERATOR, ( -- res)) {
|
||||
SYNC_SP();
|
||||
ctx->frame->stack_pointer = stack_pointer;
|
||||
frame_pop(ctx);
|
||||
stack_pointer = ctx->frame->stack_pointer;
|
||||
OUT_OF_SPACE_IF_NULL(res = sym_new_unknown(ctx));
|
||||
|
||||
/* Stack space handling */
|
||||
assert(corresponding_check_stack == NULL);
|
||||
assert(co != NULL);
|
||||
int framesize = co->co_framesize;
|
||||
assert(framesize > 0);
|
||||
assert(framesize <= curr_space);
|
||||
curr_space -= framesize;
|
||||
|
||||
co = get_code(this_instr);
|
||||
if (co == NULL) {
|
||||
// might be impossible, but bailing is still safe
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
op(_CHECK_STACK_SPACE, ( --)) {
|
||||
assert(corresponding_check_stack == NULL);
|
||||
corresponding_check_stack = this_instr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue