diff options
author | Tristan Gingold | 2014-01-28 04:22:43 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-01-28 04:22:43 +0100 |
commit | 77d6d3330049b7c2d5ffbea966ed22e933f6827c (patch) | |
tree | d2adbed7b7a64ded1291db53d2f2adb80633d291 /translate | |
parent | 0bee23a463d143cbb140ac4f5978130b097af1f0 (diff) | |
download | ghdl-77d6d3330049b7c2d5ffbea966ed22e933f6827c.tar.gz ghdl-77d6d3330049b7c2d5ffbea966ed22e933f6827c.tar.bz2 ghdl-77d6d3330049b7c2d5ffbea966ed22e933f6827c.zip |
translation: unest: fix mode of by-ref interfaces.
Diffstat (limited to 'translate')
-rw-r--r-- | translate/translation.adb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/translate/translation.adb b/translate/translation.adb index f159231..e9049c9 100644 --- a/translate/translation.adb +++ b/translate/translation.adb @@ -13425,6 +13425,7 @@ package body Translation is declare Subprg_Info : constant Subprg_Info_Acc := Get_Info (Get_Parent (Inter)); + Linter : O_Lnode; begin if Info.Interface_Node = O_Dnode_Null then -- Passed by copy in the RESULT record. @@ -13436,11 +13437,20 @@ package body Translation is else -- Use field in FRAME (instead of direct reference -- to parameter - used to unnest subprograms). - return Lv2M - (New_Selected_Element - (Get_Instance_Ref (Subprg_Info.Subprg_Frame_Type), - Info.Interface_Field), - Type_Info, Kind); + Linter := + New_Selected_Element + (Get_Instance_Ref (Subprg_Info.Subprg_Frame_Type), + Info.Interface_Field); + case Type_Info.Type_Mode is + when Type_Mode_Unknown => + raise Internal_Error; + when Type_Mode_By_Value => + return Lv2M (Linter, Type_Info, Kind); + when Type_Mode_By_Copy + | Type_Mode_By_Ref => + -- Parameter is passed by reference. + return Lp2M (Linter, Type_Info, Kind); + end case; end if; end; else |