From: Piotr Trojanek Date: Fri, 16 Jun 2023 06:34:27 +0000 (+0200) Subject: ada: Improve defense against illegal code in check for infinite loops X-Git-Tag: basepoints/gcc-15~7303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb3bed6018acae828f7a4828678c017c95f695f4;p=thirdparty%2Fgcc.git ada: Improve defense against illegal code in check for infinite loops Fix crash occurring when attribute System'To_Address is used without a WITH clause for package System. gcc/ada/ * sem_warn.adb (Check_Infinite_Loop_Warning): Don't look at the type of actual parameter when it has no type at all, e.g. because the entire subprogram call is illegal. --- diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 5dd7c17d4e29..7ecb4d9c4a67 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -591,7 +591,9 @@ package body Sem_Warn is begin Actual := First_Actual (N); while Present (Actual) loop - if Is_Access_Subprogram_Type (Etype (Actual)) then + if No (Etype (Actual)) + or else Is_Access_Subprogram_Type (Etype (Actual)) + then return Abandon; else Next_Actual (Actual);