From 3f83338c31520c0537477839bf3550a43650927f Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 3 Oct 2019 18:45:24 +0200 Subject: synth-context: slightly relax assertion. --- src/synth/synth-context.adb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3