https://github.com/python/cpython/commit/c8ee196030b1af7ccf347567e263075ffb1aeee8
commit: c8ee196030b1af7ccf347567e263075ffb1aeee8
branch: main
author: Brandon <[email protected]>
committer: Fidget-Spinner <[email protected]>
date: 2026-03-27T22:50:29+08:00
summary:

gh-146388: Add null check for `sym_new(ctx)` in `make_bottom` (GH-146389)

files:
A 
Misc/NEWS.d/next/Core_and_Builtins/2026-03-26-11-18-45.gh-issue-146388.O0u1c3.rst
M Python/optimizer_symbols.c

diff --git 
a/Misc/NEWS.d/next/Core_and_Builtins/2026-03-26-11-18-45.gh-issue-146388.O0u1c3.rst
 
b/Misc/NEWS.d/next/Core_and_Builtins/2026-03-26-11-18-45.gh-issue-146388.O0u1c3.rst
new file mode 100644
index 00000000000000..7cf5edfe8c6c6f
--- /dev/null
+++ 
b/Misc/NEWS.d/next/Core_and_Builtins/2026-03-26-11-18-45.gh-issue-146388.O0u1c3.rst
@@ -0,0 +1 @@
+Adds a null check to handle when the JIT optimizer runs out of space when 
dealing with contradictions in ``make_bottom``.
diff --git a/Python/optimizer_symbols.c b/Python/optimizer_symbols.c
index 2a8d8c45c588ba..0bc3c5055812c4 100644
--- a/Python/optimizer_symbols.c
+++ b/Python/optimizer_symbols.c
@@ -1684,6 +1684,9 @@ static JitOptSymbol *
 make_bottom(JitOptContext *ctx)
 {
     JitOptSymbol *sym = sym_new(ctx);
+    if (sym == NULL) {
+        return out_of_space(ctx);
+    }
     sym->tag = JIT_SYM_BOTTOM_TAG;
     return sym;
 }

_______________________________________________
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]

Reply via email to