From b1c3d5f907a567f03e4efaecd4728a3ca888bde5 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 21 May 2017 18:52:03 +0200 Subject: Avoid a crash when a subtype indication is found within an expression. Fix #351 --- src/vhdl/sem_names.adb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb index 9b1c22050..13e96c4e7 100644 --- a/src/vhdl/sem_names.adb +++ b/src/vhdl/sem_names.adb @@ -1300,6 +1300,11 @@ package body Sem_Names is Error_Msg_Sem (+Actual, "%n cannot be a type conversion operand", +Actual); return Conv; + when Iir_Kind_Range_Expression => + -- Try to nicely handle expression like NAME (A to B). + Error_Msg_Sem + (+Actual, "subtype indication not allowed in an expression"); + return Conv; when others => -- LRM93 7.3.5 -- The type of the operand of a type conversion must be -- cgit v1.2.3