aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-sem_expr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-06-09 07:51:42 +0200
committerTristan Gingold <tgingold@free.fr>2020-06-09 18:31:59 +0200
commit640a95e42afd5ad5709624291be42cb5453332e8 (patch)
tree4bcc575c70b089e8042b07f9f00b0bde098c4b17 /src/vhdl/vhdl-sem_expr.adb
parent1ac7c2afafbd21879c0074aabeeecfe2d9eb3dfa (diff)
downloadghdl-640a95e42afd5ad5709624291be42cb5453332e8.tar.gz
ghdl-640a95e42afd5ad5709624291be42cb5453332e8.tar.bz2
ghdl-640a95e42afd5ad5709624291be42cb5453332e8.zip
vhdl: handle aggregates in choices. Fix #1360
Diffstat (limited to 'src/vhdl/vhdl-sem_expr.adb')
-rw-r--r--src/vhdl/vhdl-sem_expr.adb7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb
index 4294e71c2..a801afdbe 100644
--- a/src/vhdl/vhdl-sem_expr.adb
+++ b/src/vhdl/vhdl-sem_expr.adb
@@ -2315,6 +2315,13 @@ package body Vhdl.Sem_Expr is
return;
end if;
+ -- If the choice is an aggregate (which could be static in vhdl08),
+ -- transform it into a simple aggregate to ease the comparisons.
+ if Get_Kind (Expr) = Iir_Kind_Aggregate then
+ Expr := Eval_String_Literal (Expr);
+ Set_Choice_Expression (Choice, Expr);
+ end if;
+
Choice_Len := Eval_Discrete_Type_Length
(Get_String_Type_Bound_Type (Get_Type (Expr)));
if Sel_Length = -1 then