aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vhdl/translate/trans-chap2.adb3
-rw-r--r--src/vhdl/translate/trans-chap4.adb5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb
index fbd04d9b8..81f4fa7a3 100644
--- a/src/vhdl/translate/trans-chap2.adb
+++ b/src/vhdl/translate/trans-chap2.adb
@@ -656,6 +656,9 @@ package body Trans.Chap2 is
Chap4.Elab_Declaration_Chain (Subprg, Final);
+ if not Has_Suspend then
+ Stack2_Release;
+ end if;
-- If finalization is required and if the subprogram is a function,
-- create a variable for the result.
if (Final or Is_Prot) and Is_Ortho_Func then
diff --git a/src/vhdl/translate/trans-chap4.adb b/src/vhdl/translate/trans-chap4.adb
index f32ec0f91..b2011df12 100644
--- a/src/vhdl/translate/trans-chap4.adb
+++ b/src/vhdl/translate/trans-chap4.adb
@@ -2503,7 +2503,10 @@ package body Trans.Chap4 is
--when Iir_Kind_Signal_Declaration =>
-- Chap1.Elab_Signal (Decl);
when Iir_Kind_Variable_Declaration
- | Iir_Kind_Constant_Declaration =>
+ | Iir_Kind_Constant_Declaration =>
+ -- Do not call Open_Temp/Close_Temp, as objects may be created
+ -- using alloca (which has a scope life) or on the secondary
+ -- stack.
Elab_Object (Decl);
if Get_Kind (Get_Type (Decl))
= Iir_Kind_Protected_Type_Declaration