diff --git a/Modules/_sre/sre.c b/Modules/_sre/sre.c index e33034086481c2..0c656b47991c2f 100644 --- a/Modules/_sre/sre.c +++ b/Modules/_sre/sre.c @@ -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; }