diff options
author | Tristan Gingold | 2015-10-01 21:43:19 +0200 |
---|---|---|
committer | Tristan Gingold | 2015-10-01 21:43:19 +0200 |
commit | 6249b33b1f1ad3aaf1a9dea30552b4aab189b741 (patch) | |
tree | ac7a92d4d8731a6a2dd146a9aefbeb66cbe9231c /src/vhdl/translate/trans-chap2.adb | |
parent | 0bf4bb4bd306c1f038aa5cb9c96cdb83d7846f87 (diff) | |
download | ghdl-6249b33b1f1ad3aaf1a9dea30552b4aab189b741.tar.gz ghdl-6249b33b1f1ad3aaf1a9dea30552b4aab189b741.tar.bz2 ghdl-6249b33b1f1ad3aaf1a9dea30552b4aab189b741.zip |
trans-chap2.adb: fix uninitialized variable.
Diffstat (limited to 'src/vhdl/translate/trans-chap2.adb')
-rw-r--r-- | src/vhdl/translate/trans-chap2.adb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb index 8a9f7a0..51be1ae 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 |