aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-06-04 04:02:12 +0200
committerTristan Gingold <tgingold@free.fr>2020-06-04 13:39:10 +0200
commit53276df143b43ac3d8be5bb95e3ae9f1ba7f3e81 (patch)
treeeacf458b8918cd74f3f4da2f9672430c3a5c6f58 /src/vhdl/translate
parentd88cded3e8a07fb871d762cd18e12f13e4ef4ad1 (diff)
downloadghdl-53276df143b43ac3d8be5bb95e3ae9f1ba7f3e81.tar.gz
ghdl-53276df143b43ac3d8be5bb95e3ae9f1ba7f3e81.tar.bz2
ghdl-53276df143b43ac3d8be5bb95e3ae9f1ba7f3e81.zip
trans-chap8: handle accesses like scalar in return statement.
So that stack2 is released if needed.
Diffstat (limited to 'src/vhdl/translate')
-rw-r--r--src/vhdl/translate/trans-chap8.adb14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb
index 35654ca95..db60ab086 100644
--- a/src/vhdl/translate/trans-chap8.adb
+++ b/src/vhdl/translate/trans-chap8.adb
@@ -210,8 +210,11 @@ package body Trans.Chap8 is
Ret_Type := Get_Return_Type (Chap2.Current_Subprogram);
Ret_Info := Get_Info (Ret_Type);
case Ret_Info.Type_Mode is
- when Type_Mode_Scalar =>
+ when Type_Mode_Scalar
+ | Type_Mode_Acc
+ | Type_Mode_Bounds_Acc =>
-- * if the return type is scalar, simply returns.
+ -- * access: no range.
declare
V : O_Dnode;
R : O_Enode;
@@ -233,15 +236,6 @@ package body Trans.Chap8 is
Gen_Return_Value (R);
end if;
end;
- when Type_Mode_Acc
- | Type_Mode_Bounds_Acc =>
- -- * access: no range.
- declare
- Res : O_Enode;
- begin
- Res := Chap7.Translate_Expression (Expr, Ret_Type);
- Gen_Return_Value (Res);
- end;
when Type_Mode_Unbounded_Array
| Type_Mode_Unbounded_Record =>
-- * if the return type is unconstrained: allocate an area from