From b820177e2e0d74458ee1e28a74c7e461c8e41939 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 13 Feb 2020 18:17:51 +0100 Subject: vhdl-sem_expr: avoid a crash on incorrect qualified expr. --- 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 f8950c133..8303a58f9 100644 --- a/src/vhdl/vhdl-sem_expr.adb +++ b/src/vhdl/vhdl-sem_expr.adb @@ -4169,6 +4169,12 @@ package body Vhdl.Sem_Expr is N_Type := Sem_Type_Mark (Get_Type_Mark (Expr)); Set_Type_Mark (Expr, N_Type); N_Type := Get_Type (N_Type); + if N_Type = Null_Iir then + -- Stop now in case of error. It is highly possible that the + -- expression is ambiguous. + return Null_Iir; + end if; + Set_Type (Expr, N_Type); if A_Type /= Null_Iir and then Are_Types_Compatible (A_Type, N_Type) = Not_Compatible -- cgit v1.2.3