diff options
author | Ken Jin <kenjin@python.org> | 2024-06-20 15:55:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 15:55:20 (GMT) |
commit | 7c7aa5a99cce256ff726654038092a333a1f0531 (patch) | |
tree | 5965d6c59fcec54f7f9511c7bb71ff22ac81488e /Python/optimizer_bytecodes.c | |
parent | b8fd80f91b980598cb378dba224cdb595b132fb4 (diff) | |
download | cpython-7c7aa5a99cce256ff726654038092a333a1f0531.zip cpython-7c7aa5a99cce256ff726654038092a333a1f0531.tar.gz cpython-7c7aa5a99cce256ff726654038092a333a1f0531.tar.bz2 |
[3.13] gh-119258: Backport optimizer frame fixes in GH-119365 (GH-120699)
(cherry picked from commit 55402d3)
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r-- | Python/optimizer_bytecodes.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index 2d61fa3..690c9b8 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -616,17 +616,12 @@ dummy_func(void) { argcount++; } - _Py_UopsSymbol **localsplus_start = ctx->n_consumed; - int n_locals_already_filled = 0; - // Can determine statically, so we interleave the new locals - // and make the current stack the new locals. - // This also sets up for true call inlining. + if (sym_is_null(self_or_null) || sym_is_not_null(self_or_null)) { - localsplus_start = args; - n_locals_already_filled = argcount; + OUT_OF_SPACE_IF_NULL(new_frame = frame_new(ctx, co, 0, args, argcount)); + } else { + OUT_OF_SPACE_IF_NULL(new_frame = frame_new(ctx, co, 0, NULL, 0)); } - OUT_OF_SPACE_IF_NULL(new_frame = - frame_new(ctx, co, localsplus_start, n_locals_already_filled, 0)); } op(_PY_FRAME_GENERAL, (callable, self_or_null, args[oparg] -- new_frame: _Py_UOpsAbstractFrame *)) { |