diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-06-22 03:10:20 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-06-22 03:10:20 +0200 |
commit | 29051c1eecc8b567ce68cbf3cc40b7ab5165775c (patch) | |
tree | 3b26d9431bf5eebdbea823346c050a7fdc2efbc8 /src | |
parent | a83d1e6682d63b99d1a83d7a73dc5079cf781b25 (diff) | |
download | ghdl-29051c1eecc8b567ce68cbf3cc40b7ab5165775c.tar.gz ghdl-29051c1eecc8b567ce68cbf3cc40b7ab5165775c.tar.bz2 ghdl-29051c1eecc8b567ce68cbf3cc40b7ab5165775c.zip |
trans-chap8: adjust conditions to pass parameters. Fix #2104
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/translate/trans-chap8.adb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vhdl/translate/trans-chap8.adb b/src/vhdl/translate/trans-chap8.adb index 2b24e3737..05cac2c56 100644 --- a/src/vhdl/translate/trans-chap8.adb +++ b/src/vhdl/translate/trans-chap8.adb @@ -3307,7 +3307,9 @@ package body Trans.Chap8 is -- Set the PARAMS field. Assign_Params_Field (M2E (Mval), Mode_Value); end if; - elsif Formal_Info.Interface_Field (Mode_Value) /= O_Fnode_Null then + elsif Formal_Info.Interface_Decl (Mode_Value) = O_Dnode_Null + and then Formal_Info.Interface_Field (Mode_Value) /= O_Fnode_Null + then Assign_Params_Field (Val, Mode_Value); if Sig /= O_Enode_Null then @@ -3531,8 +3533,13 @@ package body Trans.Chap8 is Get_Association_Interface (El, Inter); Formal_Info : constant Ortho_Info_Acc := Get_Info (Base_Formal); begin - if Formal_Info.Interface_Field (Mode_Value) = O_Fnode_Null then + if Formal_Info.Interface_Decl (Mode_Value) /= O_Dnode_Null then -- Not a PARAMS field. + -- Note: an interface can be both a PARAMS field and an ortho + -- interface. This is the case for functions with nested + -- subprograms. At the start of those functions, the interface + -- is copied. But for a call, the actual must be passed as + -- a value of the interface. if Get_Kind (El) = Iir_Kind_Association_Element_By_Individual then -- Pass the whole data for an individual association. |