From 1335093885b3c416b70e3baccace84f01d9e7bb3 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 15 Aug 2018 06:41:48 +0200 Subject: sem_simple_range_expression: improve error handling. Fix #632 --- src/vhdl/sem_expr.adb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb index 5fa1e91c3..89acf1afe 100644 --- a/src/vhdl/sem_expr.adb +++ b/src/vhdl/sem_expr.adb @@ -530,8 +530,20 @@ package body Sem_Expr is Left := Sem_Expression_Ov (Left, Base_Type); if Left = Null_Iir or else Right = Null_Iir then - -- Error. - return Null_Iir; + if A_Type /= Null_Iir then + -- Can continue with the error. + if Left = Null_Iir then + Left := Create_Error_Expr + (Get_Left_Limit_Expr (Expr), A_Type); + end if; + if Right = Null_Iir then + Right := Create_Error_Expr + (Get_Right_Limit_Expr (Expr), A_Type); + end if; + else + -- Error. + return Null_Iir; + end if; end if; Left_Type := Get_Type (Left); -- cgit v1.2.3