https://github.com/python/cpython/commit/310125eb9d303046046d4f11a5fce5dede9c2fe8 commit: 310125eb9d303046046d4f11a5fce5dede9c2fe8 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: iritkatriel <[email protected]> date: 2026-06-09T21:13:40+01:00 summary:
[3.13] gh-151112: Fix double free in `assemble_init` when out of memory (GH-151142) (#151207) gh-151112: Fix double free in `assemble_init` when out of memory (GH-151142) (cherry picked from commit 580499177ca91477b53b4a40afcec7d3370265b0) Co-authored-by: Stan Ulbrych <[email protected]> files: A Misc/NEWS.d/next/Core_and_Builtins/2026-06-09-12-24-35.gh-issue-151112.4RKCkD.rst M Python/assemble.c diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-06-09-12-24-35.gh-issue-151112.4RKCkD.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-06-09-12-24-35.gh-issue-151112.4RKCkD.rst new file mode 100644 index 00000000000000..93ee5c8cf1914b --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-06-09-12-24-35.gh-issue-151112.4RKCkD.rst @@ -0,0 +1 @@ +Fix a crash in the compiler that could occur when running out of memory. diff --git a/Python/assemble.c b/Python/assemble.c index 35453277dd84d1..288d786461b31d 100644 --- a/Python/assemble.c +++ b/Python/assemble.c @@ -80,9 +80,9 @@ assemble_init(struct assembler *a, int firstlineno) } return SUCCESS; error: - Py_XDECREF(a->a_bytecode); - Py_XDECREF(a->a_linetable); - Py_XDECREF(a->a_except_table); + Py_CLEAR(a->a_bytecode); + Py_CLEAR(a->a_linetable); + Py_CLEAR(a->a_except_table); return ERROR; } _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
