From bcfbea02ee83e182bc3cdcfc85f37aa4d758af3f Mon Sep 17 00:00:00 2001 From: Tian Gao Date: Fri, 17 Mar 2023 19:31:30 -0700 Subject: [PATCH 1/2] Set stacktop to -1 after trace entry --- Python/ceval_macros.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/ceval_macros.h b/Python/ceval_macros.h index d7a8f0beeec872..d37e381c95c4a5 100644 --- a/Python/ceval_macros.h +++ b/Python/ceval_macros.h @@ -310,6 +310,7 @@ GETITEM(PyObject *v, Py_ssize_t i) { _PyFrame_SetStackPointer(frame, stack_pointer); \ int err = trace_function_entry(tstate, frame); \ stack_pointer = _PyFrame_GetStackPointer(frame); \ + frame->stacktop = -1; \ if (err) { \ goto error; \ } \ From 92e80523c130429660e007b8eeb87b4df189cfa0 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 18 Mar 2023 02:36:39 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2023-03-18-02-36-39.gh-issue-101975.HwMR1d.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-03-18-02-36-39.gh-issue-101975.HwMR1d.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-03-18-02-36-39.gh-issue-101975.HwMR1d.rst b/Misc/NEWS.d/next/Core and Builtins/2023-03-18-02-36-39.gh-issue-101975.HwMR1d.rst new file mode 100644 index 00000000000000..28c9a8465180db --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-03-18-02-36-39.gh-issue-101975.HwMR1d.rst @@ -0,0 +1 @@ +Fixed ``stacktop`` value on tracing entries to avoid corruption on garbage collection.