diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-10 07:48:19 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-10 07:48:52 +0100 |
commit | cb7a8ebe8d709bbee776988ac68156e07b7e9fca (patch) | |
tree | a4b7891fcab92949c6156ad96c1ec87f4bd8de7b /src | |
parent | f7bc9abfd1c536353eb45c2586e93432060a3eac (diff) | |
download | ghdl-cb7a8ebe8d709bbee776988ac68156e07b7e9fca.tar.gz ghdl-cb7a8ebe8d709bbee776988ac68156e07b7e9fca.tar.bz2 ghdl-cb7a8ebe8d709bbee776988ac68156e07b7e9fca.zip |
synth: also fix #2299
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/synth-vhdl_eval.adb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/synth/synth-vhdl_eval.adb b/src/synth/synth-vhdl_eval.adb index 448b0b96f..ca5f9169c 100644 --- a/src/synth/synth-vhdl_eval.adb +++ b/src/synth/synth-vhdl_eval.adb @@ -2525,15 +2525,18 @@ package body Synth.Vhdl_Eval is end; when Iir_Predefined_Real_To_String_Digits => declare - Str : Grt.To_Strings.String_Real_Format; Last : Natural; Val : Ghdl_F64; Dig : Ghdl_I32; begin Val := Ghdl_F64 (Read_Fp64 (Param1)); Dig := Ghdl_I32 (Read_Discrete (Param2)); - Grt.To_Strings.To_String (Str, Last, Val, Dig); - return String_To_Memtyp (Str (Str'First .. Last), Res_Typ); + declare + Str : String (1 .. 320 + Natural (Dig)); + begin + Grt.To_Strings.To_String (Str, Last, Val, Dig); + return String_To_Memtyp (Str (Str'First .. Last), Res_Typ); + end; end; when Iir_Predefined_Real_To_String_Format => declare |