From 317b196ae4552f23e31accd6e10a11e2903f9b31 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 23 Dec 2018 21:00:42 +0100 Subject: parse/sem: be more tolerant of parse errors. --- src/vhdl/sem_expr.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/vhdl/sem_expr.adb') diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb index e49cfcf8f..a9448940a 100644 --- a/src/vhdl/sem_expr.adb +++ b/src/vhdl/sem_expr.adb @@ -4028,6 +4028,10 @@ package body Sem_Expr is when others => Error_Kind ("sem_physical_literal", Lit); end case; + if Is_Error (Unit_Name) then + return Create_Error_Expr (Res, Error_Mark); + end if; + Unit_Name := Sem_Denoting_Name (Unit_Name); Unit := Get_Named_Entity (Unit_Name); if Get_Kind (Unit) /= Iir_Kind_Unit_Declaration then @@ -4944,7 +4948,7 @@ package body Sem_Expr is Result_Type : Iir; Expr_Type : Iir; begin - if Expr = Null_Iir then + if Is_Error (Expr) then return; end if; -- cgit v1.2.3