aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-08-15 06:41:48 +0200
committerTristan Gingold <tgingold@free.fr>2018-08-15 06:42:53 +0200
commit1335093885b3c416b70e3baccace84f01d9e7bb3 (patch)
tree832447defe45368d13c4b5194a064c9c2ee16d90 /src/vhdl
parenta458fd128b05cbe6c0343c2da3d10b9a57bb5756 (diff)
downloadghdl-1335093885b3c416b70e3baccace84f01d9e7bb3.tar.gz
ghdl-1335093885b3c416b70e3baccace84f01d9e7bb3.tar.bz2
ghdl-1335093885b3c416b70e3baccace84f01d9e7bb3.zip
sem_simple_range_expression: improve error handling. Fix #632
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/sem_expr.adb16
1 files changed, 14 insertions, 2 deletions
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);