From 49167cfb56845554946e5f04aae9cced23936aa0 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 16 Oct 2022 06:45:09 +0200 Subject: vhdl-sem_expr.adb: avoid crash after error on aggregate. Fix #2218 --- src/vhdl/vhdl-sem_expr.adb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb index b4218d076..3f4d7890b 100644 --- a/src/vhdl/vhdl-sem_expr.adb +++ b/src/vhdl/vhdl-sem_expr.adb @@ -4778,8 +4778,14 @@ package body Vhdl.Sem_Expr is procedure Check_Read_Aggregate (Aggr : Iir) is + Atype : constant Iir := Get_Type (Aggr); Choice : Iir; begin + if Atype /= Null_Iir and then Is_Error (Atype) then + -- No check in case of error. + return; + end if; + Choice := Get_Association_Choices_Chain (Aggr); while Choice /= Null_Iir loop case Iir_Kinds_Choice (Get_Kind (Choice)) is -- cgit v1.2.3