summaryrefslogtreecommitdiff
path: root/src/vhdl/sem_names.adb
diff options
context:
space:
mode:
authorTristan Gingold2015-05-12 20:49:21 +0200
committerTristan Gingold2015-05-12 20:49:21 +0200
commitcc2542a4207fdf47ce93c5476679011f037a7dac (patch)
tree96a080e9bdc8d9d191e8fb440dcf8e1a4723b6a1 /src/vhdl/sem_names.adb
parentcf227d317d561ab39327a12cf7c9b2a24daf72aa (diff)
downloadghdl-cc2542a4207fdf47ce93c5476679011f037a7dac.tar.gz
ghdl-cc2542a4207fdf47ce93c5476679011f037a7dac.tar.bz2
ghdl-cc2542a4207fdf47ce93c5476679011f037a7dac.zip
Fix crash after call to function without enough parameters.
Fix ticket 56.
Diffstat (limited to 'src/vhdl/sem_names.adb')
-rw-r--r--src/vhdl/sem_names.adb6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb
index e74a0f3..fe2b0e0 100644
--- a/src/vhdl/sem_names.adb
+++ b/src/vhdl/sem_names.adb
@@ -3584,9 +3584,7 @@ package body Sem_Names is
when Iir_Kind_Function_Declaration =>
if Maybe_Function_Call (Expr) then
Expr := Sem_As_Function_Call (Res, Expr, Null_Iir);
- if Get_Kind (Expr) /= Iir_Kind_Function_Call then
- raise Internal_Error;
- end if;
+ pragma Assert (Get_Kind (Expr) = Iir_Kind_Function_Call);
Finish_Sem_Function_Call (Expr, Res);
return Expr;
else
@@ -3594,6 +3592,8 @@ package body Sem_Names is
(Disp_Node (Expr) & " requires parameters", Res);
Set_Type (Res, Get_Type (Expr));
Set_Expr_Staticness (Res, None);
+ Set_Named_Entity
+ (Res, Create_Error_Expr (Expr, Get_Type (Expr)));
return Res;
end if;
when others =>