From 00e384d9d1ce5896198c3e817d6162a4eccfd693 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 1 Nov 2019 19:03:20 +0100 Subject: netlists-expands: use a safe walk. --- src/synth/netlists-expands.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/synth/netlists-expands.adb b/src/synth/netlists-expands.adb index a759e08f3..365f9ab4a 100644 --- a/src/synth/netlists-expands.adb +++ b/src/synth/netlists-expands.adb @@ -340,10 +340,12 @@ package body Netlists.Expands is procedure Expand_Gates (Ctxt : Context_Acc; M : Module) is Inst : Instance; + Ninst : Instance; begin Inst := Get_First_Instance (M); while Inst /= No_Instance loop -- Walk all the instances of M: + Ninst := Get_Next_Instance (Inst); case Get_Id (Inst) is when Id_Dyn_Extract => Expand_Dyn_Extract (Ctxt, Inst); @@ -355,7 +357,7 @@ package body Netlists.Expands is null; end case; - Inst := Get_Next_Instance (Inst); + Inst := Ninst; end loop; end Expand_Gates; end Netlists.Expands; -- cgit v1.2.3