Skip to content

Commit

Permalink
pythongh-118926: Spill deferred references to stack in cases generator (
Browse files Browse the repository at this point in the history
python#122748)

This automatically spills the results from `_PyStackRef_FromPyObjectNew`
to the in-memory stack so that the deferred references are visible to
the GC before we make any possibly escaping call.

Co-authored-by: Ken Jin <kenjin@python.org>
  • Loading branch information
colesbury and Fidget-Spinner committed Aug 7, 2024
1 parent 967a4f1 commit 3e753c6
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ dummy_func(
"no locals found");
ERROR_IF(true, error);
}
locals = PyStackRef_FromPyObjectNew(l);;
locals = PyStackRef_FromPyObjectNew(l);
}

inst(LOAD_FROM_DICT_OR_GLOBALS, (mod_or_class_dict -- v)) {
Expand Down
34 changes: 17 additions & 17 deletions Python/executor_cases.c.h

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

40 changes: 23 additions & 17 deletions Python/generated_cases.c.h

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

Loading

0 comments on commit 3e753c6

Please sign in to comment.