Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ def func():
INTERPRETER_FRAME = '10PhcP'
else:
INTERPRETER_FRAME = '9PhcP'
check(x, size('3PiccPP' + INTERPRETER_FRAME + 'P'))
check(x, size('3PiccPP' + INTERPRETER_FRAME + 'PP'))
# function
def func(): pass
check(func, size('16Pi'))
Expand All @@ -1641,7 +1641,7 @@ def bar(cls):
check(bar, size('PP'))
# generator
def get_gen(): yield 1
check(get_gen(), size('6P4c' + INTERPRETER_FRAME + 'P'))
check(get_gen(), size('6P4c' + INTERPRETER_FRAME + 'PP'))
# iterator
check(iter('abc'), size('lP'))
# callable-iterator
Expand Down
2 changes: 1 addition & 1 deletion Programs/test_frozenmain.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,11 @@ optimize_and_assemble_code_unit(struct compiler_unit *u, PyObject *const_cache,
goto error;
}

/* Reserve an extra word on the stack to ensure there is space for uops to
pass at least one item on the stack to a subsequent uop.
*/
stackdepth++;

/** Assembly **/
co = _PyAssemble_MakeCodeObject(&u->u_metadata, const_cache, consts,
stackdepth, &optimized_instrs, nlocalsplus,
Expand Down
Loading