Skip to content

Commit

Permalink
gh-104184: fix building --with-pydebug --enable-pystats (#104217)
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm authored May 9, 2023
1 parent 82f789b commit afe7703
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ _Py_Specialize_StoreSubscr(PyObject *container, PyObject *sub, _Py_CODEUNIT *ins
goto fail;
}
if (PyObject_CheckBuffer(container)) {
if (PyLong_CheckExact(sub) && (((size_t)Py_SIZE(sub)) > 1)) {
if (PyLong_CheckExact(sub) && (!_PyLong_IsNonNegativeCompact((PyLongObject *)sub))) {
SPECIALIZATION_FAIL(STORE_SUBSCR, SPEC_FAIL_OUT_OF_RANGE);
}
else if (strcmp(container_type->tp_name, "array.array") == 0) {
Expand Down

0 comments on commit afe7703

Please sign in to comment.