8000 gh-132732: JIT: Only allow compact ints in pure evaluation (GH-136040) · python/cpython@c419af9 · GitHub
[go: up one dir, main page]

Skip to content

Commit c419af9

Browse files
gh-132732: JIT: Only allow compact ints in pure evaluation (GH-136040)
1 parent 0e5d096 commit c419af9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/optimizer_symbols.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,11 @@ _Py_uop_sym_is_safe_const(JitOptContext *ctx, JitOptRef sym)
206206
if (const_val == NULL) {
207207
return false;
208208
}
209+
if (_PyLong_CheckExactAndCompact(const_val)) {
210+
return true;
211+
}
209212
PyTypeObject *typ = Py_TYPE(const_val);
210-
return (typ == &PyLong_Type) ||
211-
(typ == &PyUnicode_Type) ||
213+
return (typ == &PyUnicode_Type) ||
212214
(typ == &PyFloat_Type) ||
213215
(typ == &PyTuple_Type) ||
214216
(typ == &PyBool_Type);

0 commit comments

Comments
 (0)
0