From 2efee206687fae7c8812cf7e094808a6cd733d5b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 28 Sep 2022 06:50:57 +0200 Subject: simul: fix handling of labels in next/exit statements --- src/simul/simul-vhdl_simul.adb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/simul/simul-vhdl_simul.adb b/src/simul/simul-vhdl_simul.adb index 95048757b..cba9520c4 100644 --- a/src/simul/simul-vhdl_simul.adb +++ b/src/simul/simul-vhdl_simul.adb @@ -24,7 +24,7 @@ with Utils_IO; with Vhdl.Types; with Vhdl.Errors; -with Vhdl.Utils; +with Vhdl.Utils; use Vhdl.Utils; with Vhdl.Std_Package; with Vhdl.Ieee.Std_Logic_1164; with Vhdl.Sem_Inst; @@ -1092,8 +1092,13 @@ package body Simul.Vhdl_Simul is when Iir_Kind_Exit_Statement => if Execute_Condition (Inst, Get_Condition (Stmt)) then declare - Label : constant Node := Get_Loop_Label (Stmt); + Label : Node; begin + Label := Get_Loop_Label (Stmt); + if Label /= Null_Node then + Label := Get_Named_Entity (Label); + end if; + loop Stmt := Get_Parent (Stmt); case Get_Kind (Stmt) is @@ -1116,8 +1121,13 @@ package body Simul.Vhdl_Simul is when Iir_Kind_Next_Statement => if Execute_Condition (Inst, Get_Condition (Stmt)) then declare - Label : constant Node := Get_Loop_Label (Stmt); + Label : Node; begin + Label := Get_Loop_Label (Stmt); + if Label /= Null_Node then + Label := Get_Named_Entity (Label); + end if; + loop Stmt := Get_Parent (Stmt); case Get_Kind (Stmt) is @@ -1557,7 +1567,6 @@ package body Simul.Vhdl_Simul is return Boolean is use Vhdl.Types; - use Vhdl.Utils; use PSL.Nodes; begin case Get_Kind (Expr) is -- cgit v1.2.3