From cf98ab2583ddf5d1f0315f3273cc5751f8495a42 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 4 Jul 2019 06:09:07 +0200 Subject: synth: emit an error for non-constant bounds. --- src/synth/synth-expr.adb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 96c77d13a..ad05921bb 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -384,6 +384,10 @@ package body Synth.Expr is | Iir_Kind_Enumeration_Subtype_Definition | Iir_Kind_Physical_Type_Definition | Iir_Kind_Physical_Subtype_Definition => + if not (Is_Const (L) and Is_Const (R)) then + Error_Msg_Synth (+Rng, "limits of range are not constant"); + return null; + end if; Res := Create_Value_Range ((Get_Direction (Rng), L.Scal, R.Scal)); when Iir_Kind_Floating_Type_Definition | Iir_Kind_Floating_Subtype_Definition => -- cgit v1.2.3