diff --git a/Modules/_sre/sre.c b/Modules/_sre/sre.c index 8ef35d0658c703..6d9843bb76d791 100644 --- a/Modules/_sre/sre.c +++ b/Modules/_sre/sre.c @@ -2167,6 +2167,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; }