aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-02-01 17:17:43 +0100
committerTristan Gingold <tgingold@free.fr>2020-02-01 17:17:43 +0100
commit6ed3a69222597c8660d8d9ad9da1e06c3d11474f (patch)
treedd655d00ef9e0b6149799fbcf0f301ec1063513e /src/vhdl
parentf0d2cb1cb5c01f460a72051735a129063690574b (diff)
downloadghdl-6ed3a69222597c8660d8d9ad9da1e06c3d11474f.tar.gz
ghdl-6ed3a69222597c8660d8d9ad9da1e06c3d11474f.tar.bz2
ghdl-6ed3a69222597c8660d8d9ad9da1e06c3d11474f.zip
vhdl-sem_assocs: check that interface of function conv is a constant.
Fix #1123
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/vhdl-sem_assocs.adb15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-sem_assocs.adb b/src/vhdl/vhdl-sem_assocs.adb
index 47f45c380..74faad959 100644
--- a/src/vhdl/vhdl-sem_assocs.adb
+++ b/src/vhdl/vhdl-sem_assocs.adb
@@ -1325,10 +1325,23 @@ package body Vhdl.Sem_Assocs is
if Is_Valid_Conversion (Conv, Res_Base_Type, Param_Base_Type) then
Res := Conv;
else
- Res := Null_Iir;
Error_Msg_Sem (+Loc, "conversion function or type does not match");
+ return Null_Iir;
end if;
end if;
+
+ if Get_Kind (Res) = Iir_Kind_Function_Call then
+ declare
+ Imp : constant Iir := Get_Implementation (Res);
+ Inter : constant Iir := Get_Interface_Declaration_Chain (Imp);
+ begin
+ if Get_Kind (Inter) /= Iir_Kind_Interface_Constant_Declaration then
+ Error_Msg_Sem
+ (+Loc, "interface of function must be a constant interface");
+ end if;
+ end;
+ end if;
+
return Res;
end Extract_Conversion;