aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-05-11 07:14:28 +0200
committerTristan Gingold <tgingold@free.fr>2019-05-11 18:13:37 +0200
commit58b3b8a09770e36e36d2d6f870dac2df00457b14 (patch)
treee671f95806d50bd13d691fa803ad195895c53409
parentb9fc5a0bbc41deebb736bc216ce97da835f72d1a (diff)
downloadghdl-58b3b8a09770e36e36d2d6f870dac2df00457b14.tar.gz
ghdl-58b3b8a09770e36e36d2d6f870dac2df00457b14.tar.bz2
ghdl-58b3b8a09770e36e36d2d6f870dac2df00457b14.zip
vhdl: adjust aggregate staticness if not constrained. Fix #817
-rw-r--r--src/vhdl/vhdl-sem_expr.adb6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb
index 8f8333cec..2c977a52b 100644
--- a/src/vhdl/vhdl-sem_expr.adb
+++ b/src/vhdl/vhdl-sem_expr.adb
@@ -3809,6 +3809,12 @@ package body Vhdl.Sem_Expr is
Set_Aggregate_Expand_Flag (Aggr, False);
end if;
else
+ -- If the array is not constrained, expression cannot be more
+ -- static than the type. In particular, if the type is not
+ -- constrained, the expression cannot be locally static.
+ Set_Expr_Staticness (Aggr, Min (Get_Type_Staticness (Aggr_Type),
+ Get_Expr_Staticness (Aggr)));
+
-- Free unused indexes subtype.
for I in Infos'Range loop
declare