aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-10-03 18:45:24 +0200
committerTristan Gingold <tgingold@free.fr>2019-10-03 18:45:24 +0200
commit3f83338c31520c0537477839bf3550a43650927f (patch)
tree4919dfca4e9137e4bb71102972d19ad6016aaf24 /src
parent47cb9e6bf3aacb35a4a3d1cd035eddce7038e2b5 (diff)
downloadghdl-3f83338c31520c0537477839bf3550a43650927f.tar.gz
ghdl-3f83338c31520c0537477839bf3550a43650927f.tar.bz2
ghdl-3f83338c31520c0537477839bf3550a43650927f.zip
synth-context: slightly relax assertion.
Diffstat (limited to 'src')
-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;