mirror of https://github.com/python/cpython.git
[3.13] gh-120155: Add assertion to sre.c match_getindex() (GH-120402) (#120409)
gh-120155: Add assertion to sre.c match_getindex() (GH-120402)
Add an assertion to help static analyzers to detect that i*2 cannot
overflow.
(cherry picked from commit 42b25dd61f
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
91c4444d22
commit
e04809299f
|
@ -2217,6 +2217,8 @@ match_getindex(MatchObject* self, PyObject* index)
|
|||
return -1;
|
||||
}
|
||||
|
||||
// Check that i*2 cannot overflow to make static analyzers happy
|
||||
assert(i <= SRE_MAXGROUPS);
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue