aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-08-07 10:18:25 +0200
committerTristan Gingold <tgingold@free.fr>2017-08-16 07:52:15 +0200
commitb32550b2e7e992eac6d4d5a3c6c35451474d3eff (patch)
tree94fb6e6318a942e804ec388d27ec22a37c3c6670 /src/vhdl
parent0879429a561a059813462c6d37bd058d610c9816 (diff)
downloadghdl-b32550b2e7e992eac6d4d5a3c6c35451474d3eff.tar.gz
ghdl-b32550b2e7e992eac6d4d5a3c6c35451474d3eff.tar.bz2
ghdl-b32550b2e7e992eac6d4d5a3c6c35451474d3eff.zip
Avoid crash in overload resolution of selected element.
Fix #397
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/sem_names.adb10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb
index fa8987d1a..0baf6c71d 100644
--- a/src/vhdl/sem_names.adb
+++ b/src/vhdl/sem_names.adb
@@ -1911,7 +1911,6 @@ package body Sem_Names is
R : Iir;
Se : Iir;
begin
- -- FIXME: if not is_expr (sub_name) return.
Name_Type := Get_Type (Sub_Name);
if Kind_In (Name_Type, Iir_Kind_Access_Type_Definition,
Iir_Kind_Access_Subtype_Definition)
@@ -2070,7 +2069,14 @@ package body Sem_Names is
for I in Natural loop
El := Get_Nth_Element (Prefix_List, I);
exit when El = Null_Iir;
- Sem_As_Selected_Element (El);
+ case Get_Kind (El) is
+ when Iir_Kind_Procedure_Declaration =>
+ -- A procedure cannot be the prefix of a selected
+ -- element.
+ null;
+ when others =>
+ Sem_As_Selected_Element (El);
+ end case;
end loop;
end if;
end;