Commit 0c644fc
authored
fix up signedness in PyImport_ExtendInittab (#4831)
As a result of 92a3c6f, the compiler complains:
Python/import.c:2311:21: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
if ((i + n + 1) <= PY_SSIZE_T_MAX / sizeof(struct _inittab)) {
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This overflow is extremely unlikely to happen, but let's avoid undefined
behavior anyway.1 parent 9454060 commit 0c644fc
1 file changed
+3
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2291 | 2291 | | |
2292 | 2292 | | |
2293 | 2293 | | |
2294 | | - | |
| 2294 | + | |
2295 | 2295 | | |
2296 | 2296 | | |
2297 | 2297 | | |
| |||
2308 | 2308 | | |
2309 | 2309 | | |
2310 | 2310 | | |
2311 | | - | |
| 2311 | + | |
| 2312 | + | |
2312 | 2313 | | |
2313 | 2314 | | |
2314 | 2315 | | |
2315 | | - | |
2316 | | - | |
2317 | | - | |
2318 | 2316 | | |
2319 | 2317 | | |
2320 | 2318 | | |
| |||
0 commit comments