diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-11-21 08:20:50 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-11-21 08:20:50 +0100 |
commit | 0ce499a09bc3403114d9a1ac8989f29790a64967 (patch) | |
tree | c896a08daa0b48482e2f72861ec48c490ec1c12e /src/synth | |
parent | 29b56efcbdaea0002b4f71e229ee44c1ebe75a08 (diff) | |
download | ghdl-0ce499a09bc3403114d9a1ac8989f29790a64967.tar.gz ghdl-0ce499a09bc3403114d9a1ac8989f29790a64967.tar.bz2 ghdl-0ce499a09bc3403114d9a1ac8989f29790a64967.zip |
synth-vhdl_expr: emit an error if use of a signal during elaboration. Fix #1920
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-vhdl_expr.adb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/synth/synth-vhdl_expr.adb b/src/synth/synth-vhdl_expr.adb index 0d8899465..ee691d8f5 100644 --- a/src/synth/synth-vhdl_expr.adb +++ b/src/synth/synth-vhdl_expr.adb @@ -2171,6 +2171,13 @@ package body Synth.Vhdl_Expr is Res : Valtyp; begin Res := Synth_Name (Syn_Inst, Expr); + if Res.Val /= null + and then Res.Val.Kind = Value_Signal + then + Error_Msg_Synth + (+Expr, "cannot use signal value during elaboration"); + return No_Valtyp; + end if; if Res.Typ /= null and then Res.Typ.W = 0 and then Res.Val.Kind /= Value_Memory then |