summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold2015-10-01 21:43:19 +0200
committerTristan Gingold2015-10-01 21:43:19 +0200
commit16e6c614b6916c42bc47ad9dfee5d6cb70922d6f (patch)
tree709295d3488ff79678f6992db3d0429d7b4700ff
parentf6d7e8c9b4746ea50a8c10892e3d28ce8d1020cb (diff)
downloadghdl-16e6c614b6916c42bc47ad9dfee5d6cb70922d6f.tar.gz
ghdl-16e6c614b6916c42bc47ad9dfee5d6cb70922d6f.tar.bz2
ghdl-16e6c614b6916c42bc47ad9dfee5d6cb70922d6f.zip
trans-chap2.adb: fix uninitialized variable.
-rw-r--r--src/vhdl/translate/trans-chap2.adb18
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