summaryrefslogtreecommitdiffstats
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorDonghee Na <donghee.na@python.org>2024-02-14 17:00:50 (GMT)
committerGitHub <noreply@github.com>2024-02-14 17:00:50 (GMT)
commita2d4281415e67c62f91363376db97eb66a9fb716 (patch)
treea70679c72f7c89af35614c6e1258c4507bd741a8 /Python/executor_cases.c.h
parent4b2d1786ccf913bc80ff571c32b196be1543ca54 (diff)
downloadcpython-a2d4281415e67c62f91363376db97eb66a9fb716.zip
cpython-a2d4281415e67c62f91363376db97eb66a9fb716.tar.gz
cpython-a2d4281415e67c62f91363376db97eb66a9fb716.tar.bz2
gh-112087: Make __sizeof__ and listiter_{len, next} to be threadsafe (gh-114843)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 58d2383..7a0e0e4 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -2201,8 +2201,7 @@
_PyListIterObject *it = (_PyListIterObject *)iter;
assert(Py_TYPE(iter) == &PyListIter_Type);
PyListObject *seq = it->it_seq;
- if (seq == NULL) goto deoptimize;
- if (it->it_index >= PyList_GET_SIZE(seq)) goto deoptimize;
+ if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) goto deoptimize;
break;
}