aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-vhdl_oper.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-10 21:54:42 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-10 21:54:42 +0100
commit944405539cc4b79476b6ccf1a5726fb4505306b2 (patch)
tree900856ab94aa24a893a1d6080121f3da5ae70b9a /src/synth/synth-vhdl_oper.adb
parentd321ec7a8a3aae1463cf22d68d13ac9a1c951caf (diff)
downloadghdl-944405539cc4b79476b6ccf1a5726fb4505306b2.tar.gz
ghdl-944405539cc4b79476b6ccf1a5726fb4505306b2.tar.bz2
ghdl-944405539cc4b79476b6ccf1a5726fb4505306b2.zip
synth: fix memory allocation in predefined function calls
Diffstat (limited to 'src/synth/synth-vhdl_oper.adb')
-rw-r--r--src/synth/synth-vhdl_oper.adb3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/synth/synth-vhdl_oper.adb b/src/synth/synth-vhdl_oper.adb
index 22ef709aa..9063e84c4 100644
--- a/src/synth/synth-vhdl_oper.adb
+++ b/src/synth/synth-vhdl_oper.adb
@@ -2255,8 +2255,11 @@ package body Synth.Vhdl_Oper is
Mt := Eval_Static_Predefined_Function_Call
(Syn_Inst, Param1, Param2, Res_Typ, Expr);
+
if Mt /= Null_Memtyp then
Res := Create_Value_Memtyp (Mt);
+ -- Protect deallocation.
+ Res.Typ := Unshare_Type_Expr (Res.Typ, Res_Typ);
else
Res := No_Valtyp;
end if;