summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorCarl Meyer <carl@oddbird.net>2023-05-09 14:53:19 (GMT)
committerGitHub <noreply@github.com>2023-05-09 14:53:19 (GMT)
commitafe7703744f813adb15719642444b5fd35888d86 (patch)
treebd4aeb37a9b497c35a00f357840715a7f57e8e54 /Python/specialize.c
parent82f789be3b15df5f6660f5fd0c563ad690ee00fb (diff)
downloadcpython-afe7703744f813adb15719642444b5fd35888d86.zip
cpython-afe7703744f813adb15719642444b5fd35888d86.tar.gz
cpython-afe7703744f813adb15719642444b5fd35888d86.tar.bz2
gh-104184: fix building --with-pydebug --enable-pystats (#104217)
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index b1cc661..2ccca3a 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -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) {