From f2da5e23513a67e282a60ac5df689eb9dbe65938 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 10 Nov 2018 16:11:08 +0100 Subject: vhdl: avoid a crash on invalid actual conversion in association. Fix #691 --- src/vhdl/sem_assocs.adb | 5 +++++ src/vhdl/sem_names.adb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3