diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-02-08 16:25:28 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-02-08 16:26:28 +0100 |
commit | 8190bc00f74dea581d410a26c4b884e15c07aa1b (patch) | |
tree | 0f3a8f488f9a9f69da67b0d893d453ca88998d5c | |
parent | 41b8812dad8f9c78fb7dd652843b7a8855b0fb92 (diff) | |
download | ghdl-8190bc00f74dea581d410a26c4b884e15c07aa1b.tar.gz ghdl-8190bc00f74dea581d410a26c4b884e15c07aa1b.tar.bz2 ghdl-8190bc00f74dea581d410a26c4b884e15c07aa1b.zip |
synth: do not handle null-vectors for to_hstring.
For #2338
-rw-r--r-- | src/synth/synth-vhdl_eval.adb | 16 | ||||
-rw-r--r-- | src/synth/synth-vhdl_expr.adb | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/synth/synth-vhdl_eval.adb b/src/synth/synth-vhdl_eval.adb index 23bb3dac8..2cc70bd52 100644 --- a/src/synth/synth-vhdl_eval.adb +++ b/src/synth/synth-vhdl_eval.adb @@ -2872,13 +2872,29 @@ package body Synth.Vhdl_Eval is when Iir_Predefined_Ieee_1164_To_Hstring | Iir_Predefined_Ieee_Numeric_Std_To_Hstring_Uns => + if Param1.Typ.Abound.Len = 0 then + Error_Msg_Synth + (Inst, Expr, "to_hstring fails with a null-vector"); + end if; return Eval_Logic_Vector_To_String (Param1, Res_Typ, False, 4); when Iir_Predefined_Ieee_Numeric_Std_To_Hstring_Sgn => + if Param1.Typ.Abound.Len = 0 then + Error_Msg_Synth + (Inst, Expr, "to_hstring fails with a null-vector"); + end if; return Eval_Logic_Vector_To_String (Param1, Res_Typ, True, 4); when Iir_Predefined_Ieee_1164_To_Ostring | Iir_Predefined_Ieee_Numeric_Std_To_Ostring_Uns => + if Param1.Typ.Abound.Len = 0 then + Error_Msg_Synth + (Inst, Expr, "to_ostring fails with a null-vector"); + end if; return Eval_Logic_Vector_To_String (Param1, Res_Typ, False, 3); when Iir_Predefined_Ieee_Numeric_Std_To_Ostring_Sgn => + if Param1.Typ.Abound.Len = 0 then + Error_Msg_Synth + (Inst, Expr, "to_ostring fails with a null-vector"); + end if; return Eval_Logic_Vector_To_String (Param1, Res_Typ, True, 3); when Iir_Predefined_Ieee_Numeric_Std_Max_Uns_Uns => diff --git a/src/synth/synth-vhdl_expr.adb b/src/synth/synth-vhdl_expr.adb index 6433fa616..1531c3b7a 100644 --- a/src/synth/synth-vhdl_expr.adb +++ b/src/synth/synth-vhdl_expr.adb @@ -2309,7 +2309,8 @@ package body Synth.Vhdl_Expr is -- Propagate error. return No_Valtyp; end if; - if Base.Val.Kind = Value_Signal + if (Base.Val.Kind = Value_Signal + or else Base.Val.Kind = Value_Sig_Val) and then Hook_Signal_Expr /= null then Base := Hook_Signal_Expr (Base); |