aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-10 16:11:08 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-10 16:11:08 +0100
commitf2da5e23513a67e282a60ac5df689eb9dbe65938 (patch)
tree3d0bd4c3d62dda880186081f68678f2e329f36c6
parent8f35f3dc75e039479965218e7c6e1e34a4d8ff93 (diff)
downloadghdl-f2da5e23513a67e282a60ac5df689eb9dbe65938.tar.gz
ghdl-f2da5e23513a67e282a60ac5df689eb9dbe65938.tar.bz2
ghdl-f2da5e23513a67e282a60ac5df689eb9dbe65938.zip
vhdl: avoid a crash on invalid actual conversion in association.
Fix #691
-rw-r--r--src/vhdl/sem_assocs.adb5
-rw-r--r--src/vhdl/sem_names.adb4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/vhdl/sem_assocs.adb b/src/vhdl/sem_assocs.adb
index 971962288..299242a2f 100644
--- a/src/vhdl/sem_assocs.adb
+++ b/src/vhdl/sem_assocs.adb
@@ -1828,6 +1828,11 @@ package body Sem_Assocs is
null;
end case;
+ if Actual = Null_Iir then
+ Match := Fully_Compatible;
+ return;
+ end if;
+
-- There could be an ambiguity between a conversion and a normal
-- actual expression. Check if the new actual is an object and
-- if the object is of the corresponding class.
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb
index b6150b8bb..033762bd5 100644
--- a/src/vhdl/sem_names.adb
+++ b/src/vhdl/sem_names.adb
@@ -2587,8 +2587,8 @@ package body Sem_Names is
Assoc_Chain := Get_Association_Chain (Name);
Actual := Get_One_Actual (Assoc_Chain);
- if Kind_In (Prefix, Iir_Kind_Type_Declaration,
- Iir_Kind_Subtype_Declaration)
+ if Kind_In (Prefix,
+ Iir_Kind_Type_Declaration, Iir_Kind_Subtype_Declaration)
then
-- A type conversion. The prefix is a type mark.
declare