Skip to content

Commit afe7703

Browse files
authored
gh-104184: fix building --with-pydebug --enable-pystats (#104217)
1 parent 82f789b commit afe7703

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Python/specialize.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ _Py_Specialize_StoreSubscr(PyObject *container, PyObject *sub, _Py_CODEUNIT *ins
14551455
goto fail;
14561456
}
14571457
if (PyObject_CheckBuffer(container)) {
1458-
if (PyLong_CheckExact(sub) && (((size_t)Py_SIZE(sub)) > 1)) {
1458+
if (PyLong_CheckExact(sub) && (!_PyLong_IsNonNegativeCompact((PyLongObject *)sub))) {
14591459
SPECIALIZATION_FAIL(STORE_SUBSCR, SPEC_FAIL_OUT_OF_RANGE);
14601460
}
14611461
else if (strcmp(container_type->tp_name, "array.array") == 0) {

0 commit comments

Comments
 (0)