diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-11 15:31:53 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-11 15:31:53 +0200 |
commit | c95e2485645b30aca44f3eed6d8d5e6e83cac2ff (patch) | |
tree | 0276ef3760973d187dd3ef406c0363ab81359c95 /src | |
parent | fde4ca2f9d94225efd650567dcad832ebb39971e (diff) | |
download | ghdl-c95e2485645b30aca44f3eed6d8d5e6e83cac2ff.tar.gz ghdl-c95e2485645b30aca44f3eed6d8d5e6e83cac2ff.tar.bz2 ghdl-c95e2485645b30aca44f3eed6d8d5e6e83cac2ff.zip |
synth-static_proc: handle deallocate for null access. Fix #1212
Diffstat (limited to 'src')
-rw-r--r-- | src/synth/synth-static_proc.adb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/synth/synth-static_proc.adb b/src/synth/synth-static_proc.adb index 60388607b..ab534aa66 100644 --- a/src/synth/synth-static_proc.adb +++ b/src/synth/synth-static_proc.adb @@ -31,9 +31,13 @@ package body Synth.Static_Proc is is Inter : constant Node := Get_Interface_Declaration_Chain (Imp); Param : constant Valtyp := Get_Value (Syn_Inst, Inter); + Val : Heap_Index; begin - Synth.Heap.Synth_Deallocate (Read_Access (Param)); - Write_Access (Param.Val.Mem, Null_Heap_Index); + Val := Read_Access (Param); + if Val /= Null_Heap_Index then + Synth.Heap.Synth_Deallocate (Val); + Write_Access (Param.Val.Mem, Null_Heap_Index); + end if; end Synth_Deallocate; procedure Synth_Static_Procedure (Syn_Inst : Synth_Instance_Acc; |