diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-07-04 06:09:07 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-07-04 06:09:07 +0200 |
commit | cf98ab2583ddf5d1f0315f3273cc5751f8495a42 (patch) | |
tree | db3d6df93f78fb10af9c508b8d953965697cdfec /src | |
parent | b0519a4bbb226f92737c14094ffe4326448eba1c (diff) | |
download | ghdl-cf98ab2583ddf5d1f0315f3273cc5751f8495a42.tar.gz ghdl-cf98ab2583ddf5d1f0315f3273cc5751f8495a42.tar.bz2 ghdl-cf98ab2583ddf5d1f0315f3273cc5751f8495a42.zip |
synth: emit an error for non-constant bounds.
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/synth-expr.adb | 4 |
1 files changed, 4 insertions, 0 deletions
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 => |