From 6249b33b1f1ad3aaf1a9dea30552b4aab189b741 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 1 Oct 2015 21:43:19 +0200 Subject: trans-chap2.adb: fix uninitialized variable. --- src/vhdl/translate/trans-chap2.adb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb index 8a9f7a0ff..51be1aebf 100644 --- a/src/vhdl/translate/trans-chap2.adb +++ b/src/vhdl/translate/trans-chap2.adb @@ -368,10 +368,13 @@ package body Trans.Chap2 is Get_Kind (Spec) = Iir_Kind_Procedure_Declaration and then Get_Suspend_Flag (Spec); + -- True if the subprogram is translated to a function in ortho. + Is_Ortho_Func : constant Boolean := Is_Subprogram_Ortho_Function (Spec); + Old_Subprogram : Iir; Mark : Id_Mark_Type; Final : Boolean; - Is_Ortho_Func : Boolean; + -- Set for a public method. In this case, the lock must be acquired -- and retained. @@ -596,14 +599,11 @@ package body Trans.Chap2 is -- If finalization is required and if the subprogram is a function, -- create a variable for the result. - if Final or Is_Prot then - Is_Ortho_Func := Is_Subprogram_Ortho_Function (Spec); - if Is_Ortho_Func then - New_Var_Decl - (Info.Subprg_Result, Get_Identifier ("RESULT"), - O_Storage_Local, - Get_Ortho_Type (Get_Return_Type (Spec), Mode_Value)); - end if; + if (Final or Is_Prot) and Is_Ortho_Func then + New_Var_Decl + (Info.Subprg_Result, Get_Identifier ("RESULT"), + O_Storage_Local, + Get_Ortho_Type (Get_Return_Type (Spec), Mode_Value)); end if; -- If finalization is required, create a dummy loop around the -- cgit v1.2.3