aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-context.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth/synth-context.adb')
-rw-r--r--src/synth/synth-context.adb13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/synth/synth-context.adb b/src/synth/synth-context.adb
index 10eb12310..48a362220 100644
--- a/src/synth/synth-context.adb
+++ b/src/synth/synth-context.adb
@@ -160,9 +160,20 @@ package body Synth.Context is
return Inst.Is_Const;
end Get_Instance_Const;
+ function Check_Set_Instance_Const (Inst : Synth_Instance_Acc)
+ return Boolean is
+ begin
+ for I in 1 .. Inst.Elab_Objects loop
+ if Inst.Objects (I).Kind /= Value_Subtype then
+ return False;
+ end if;
+ end loop;
+ return True;
+ end Check_Set_Instance_Const;
+
procedure Set_Instance_Const (Inst : Synth_Instance_Acc; Val : Boolean) is
begin
- pragma Assert (not Val or else Inst.Elab_Objects = 0);
+ pragma Assert (not Val or else Check_Set_Instance_Const (Inst));
Inst.Is_Const := Val;
end Set_Instance_Const;