aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-sem_expr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-07-28 18:32:47 +0200
committerTristan Gingold <tgingold@free.fr>2022-07-28 18:32:47 +0200
commita6bccff01ac66453be5914df80efc1d7271df678 (patch)
tree7bae3220bfa7133896ec9dbde207487dd86281d9 /src/vhdl/vhdl-sem_expr.adb
parentdb4e5f25c05abaa2fbd11c02c89fb00441769f84 (diff)
downloadghdl-a6bccff01ac66453be5914df80efc1d7271df678.tar.gz
ghdl-a6bccff01ac66453be5914df80efc1d7271df678.tar.bz2
ghdl-a6bccff01ac66453be5914df80efc1d7271df678.zip
vhdl: check read for attribute parameter and aggregates. Fix #2148
Diffstat (limited to 'src/vhdl/vhdl-sem_expr.adb')
-rw-r--r--src/vhdl/vhdl-sem_expr.adb22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb
index 8a7ea0d89..d4a8ef84e 100644
--- a/src/vhdl/vhdl-sem_expr.adb
+++ b/src/vhdl/vhdl-sem_expr.adb
@@ -4752,10 +4752,26 @@ package body Vhdl.Sem_Expr is
procedure Check_Read_Aggregate (Aggr : Iir)
is
- pragma Unreferenced (Aggr);
+ Choice : Iir;
begin
- -- FIXME: todo.
- null;
+ Choice := Get_Association_Choices_Chain (Aggr);
+ while Choice /= Null_Iir loop
+ case Iir_Kinds_Choice (Get_Kind (Choice)) is
+ when Iir_Kind_Choice_By_Range =>
+ -- Already checked while analyzing the range.
+ null;
+ when Iir_Kind_Choice_By_Expression =>
+ Check_Read (Get_Choice_Expression (Choice));
+ when Iir_Kind_Choice_By_Others
+ | Iir_Kind_Choice_By_Name
+ | Iir_Kind_Choice_By_None =>
+ -- Nothing to check.
+ null;
+ end case;
+ Check_Read (Get_Associated_Expr (Choice));
+
+ Choice := Get_Chain (Choice);
+ end loop;
end Check_Read_Aggregate;
-- Check EXPR can be read.