gh-132732: JIT: Only allow compact ints in pure evaluation (GH-136040)
This commit is contained in:
@@ -206,9 +206,11 @@ _Py_uop_sym_is_safe_const(JitOptContext *ctx, JitOptRef sym)
|
|||||||
if (const_val == NULL) {
|
if (const_val == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (_PyLong_CheckExactAndCompact(const_val)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
PyTypeObject *typ = Py_TYPE(const_val);
|
PyTypeObject *typ = Py_TYPE(const_val);
|
||||||
return (typ == &PyLong_Type) ||
|
return (typ == &PyUnicode_Type) ||
|
||||||
(typ == &PyUnicode_Type) ||
|
|
||||||
(typ == &PyFloat_Type) ||
|
(typ == &PyFloat_Type) ||
|
||||||
(typ == &PyTuple_Type) ||
|
(typ == &PyTuple_Type) ||
|
||||||
(typ == &PyBool_Type);
|
(typ == &PyBool_Type);
|
||||||
|
|||||||
Reference in New Issue
Block a user