summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--iirs.ads2
-rw-r--r--sem_stmts.adb25
2 files changed, 19 insertions, 8 deletions
diff --git a/iirs.ads b/iirs.ads
index f3964ee..9e940b5 100644
--- a/iirs.ads
+++ b/iirs.ads
@@ -628,7 +628,7 @@ package Iirs is
--
-- Get/Set_Identifier (Field3)
--
- -- Set the entity of an architecture.
+ -- Entity declaration for the architecture.
-- Before the semantic pass, it can be a name.
-- Get/Set_Entity (Field4)
--
diff --git a/sem_stmts.adb b/sem_stmts.adb
index 33071ab..77e5ac4 100644
--- a/sem_stmts.adb
+++ b/sem_stmts.adb
@@ -464,13 +464,24 @@ package body Sem_Stmts is
Ok := True;
-- Find the signal.
Target := Get_Target (Stmt);
- Target := Sem_Expression (Target, Sig_Type);
- if Target /= Null_Iir then
- Set_Target (Stmt, Target);
- Check_Target (Stmt, Target);
- Sem_Types.Set_Type_Has_Signal (Get_Type (Target));
- else
+
+ if Sig_Type = Null_Iir
+ and then Get_Kind (Target) = Iir_Kind_Aggregate
+ then
+ -- Do not try to analyze an aggregate if its type is unknown.
+ -- A target cannot be a qualified type and its type should be
+ -- determine by the context (LRM93 7.3.2 Aggregates).
Ok := False;
+ else
+ -- Analyze the target
+ Target := Sem_Expression (Target, Sig_Type);
+ if Target /= Null_Iir then
+ Set_Target (Stmt, Target);
+ Check_Target (Stmt, Target);
+ Sem_Types.Set_Type_Has_Signal (Get_Type (Target));
+ else
+ Ok := False;
+ end if;
end if;
Expr := Get_Reject_Time_Expression (Stmt);
@@ -517,7 +528,7 @@ package body Sem_Stmts is
and then Waveform_Type = Null_Iir
then
Error_Msg_Sem
- ("type of waveform is unknown, use type qualifier", Expr);
+ ("type of waveform is unknown, use qualified type", Expr);
else
Expr := Sem_Expression (Expr, Waveform_Type);
if Expr /= Null_Iir then