aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-stmts.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-01 20:35:00 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-01 20:35:00 +0200
commit1c59818d0a07f10781abb565e7941e0a3411926f (patch)
treeb9cea65b45ceff8d01948412ae72085deeae8d7b /src/synth/synth-stmts.adb
parentc675324384a2c1b6904e73bf0ed58687479fb351 (diff)
downloadghdl-1c59818d0a07f10781abb565e7941e0a3411926f.tar.gz
ghdl-1c59818d0a07f10781abb565e7941e0a3411926f.tar.bz2
ghdl-1c59818d0a07f10781abb565e7941e0a3411926f.zip
synth: destroy iterator after for-loop.
Diffstat (limited to 'src/synth/synth-stmts.adb')
-rw-r--r--src/synth/synth-stmts.adb12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/synth/synth-stmts.adb b/src/synth/synth-stmts.adb
index c83c44b56..33d198d9f 100644
--- a/src/synth/synth-stmts.adb
+++ b/src/synth/synth-stmts.adb
@@ -901,9 +901,14 @@ package body Synth.Stmts is
Iterator : constant Node := Get_Parameter_Specification (Stmt);
Stmts : constant Node := Get_Sequential_Statement_Chain (Stmt);
It_Rng : Value_Acc;
+ It_Type : Node;
Val : Value_Acc;
begin
- Synth_Declaration_Type (Syn_Inst, Iterator);
+ It_Type := Get_Declaration_Type (Iterator);
+ if It_Type /= Null_Node then
+ Synth_Subtype_Indication (Syn_Inst, It_Type);
+ end if;
+
-- Initial value.
It_Rng := Get_Value (Syn_Inst, Get_Type (Iterator));
Val := Create_Value_Discrete (It_Rng.Rng.Left);
@@ -918,7 +923,10 @@ package body Synth.Stmts is
Val.Scal := Val.Scal - 1;
end case;
end loop;
- -- Destroy ?
+ Destroy_Object (Syn_Inst, Iterator);
+ if It_Type /= Null_Node then
+ Destroy_Object (Syn_Inst, It_Type);
+ end if;
end Synth_For_Loop_Statement;
procedure Synth_Sequential_Statements