summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorKen Jin <kenjin@python.org>2022-06-16 14:02:07 (GMT)
committerGitHub <noreply@github.com>2022-06-16 14:02:07 (GMT)
commitab45c1dde0e46603342f751552f06b8deb294832 (patch)
tree1f44759763beb45e7e5ff4cff7852d184c438f62 /Python/specialize.c
parentd5be9a5dff6d86a531417d95fa5ee5297fc81b5c (diff)
downloadcpython-ab45c1dde0e46603342f751552f06b8deb294832.zip
cpython-ab45c1dde0e46603342f751552f06b8deb294832.tar.gz
cpython-ab45c1dde0e46603342f751552f06b8deb294832.tar.bz2
Fix BINARY_SUBSCR_GETITEM stats (GH-93903)
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index a3be97d..24fbe2f 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -1212,7 +1212,8 @@ _Py_Specialize_BinarySubscr(
write_u32(cache->type_version, cls->tp_version_tag);
int version = _PyFunction_GetVersionForCurrentState(func);
if (version == 0 || version != (uint16_t)version) {
- SPECIALIZATION_FAIL(BINARY_SUBSCR, SPEC_FAIL_OUT_OF_VERSIONS);
+ SPECIALIZATION_FAIL(BINARY_SUBSCR, version == 0 ?
+ SPEC_FAIL_OUT_OF_VERSIONS : SPEC_FAIL_OUT_OF_RANGE);
goto fail;
}
cache->func_version = version;