https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71674
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2016-06-28 CC| |ebotcazou at gcc dot gnu.org Summary|An exception is thrown on a |missing overflow detection |valid code |in Ada.Strings.Search Ever confirmed|0 |1 --- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- Compiling a-strsea.adb with overflow checking enabled yields: raised CONSTRAINT_ERROR : a-strsea.adb:102 overflow check failed if Mapping'Address = Maps.Identity'Address then while Ind <= Source'Last - PL1 loop if Pattern = Source (Ind .. Ind + PL1) then Num := Num + 1; Ind := Ind + Pattern'Length; else Ind := Ind + 1; <=== 102 end if; end loop;