diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-05-21 18:52:03 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-05-21 18:52:03 +0200 |
commit | b1c3d5f907a567f03e4efaecd4728a3ca888bde5 (patch) | |
tree | 4f49c18c7660009ad8a49d0967ceee4ef2156fcb /src | |
parent | f0e742418639c5a3afd58dd601b6dc6b31795d77 (diff) | |
download | ghdl-b1c3d5f907a567f03e4efaecd4728a3ca888bde5.tar.gz ghdl-b1c3d5f907a567f03e4efaecd4728a3ca888bde5.tar.bz2 ghdl-b1c3d5f907a567f03e4efaecd4728a3ca888bde5.zip |
Avoid a crash when a subtype indication is found within an expression.
Fix #351
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/sem_names.adb | 5 |
1 files changed, 5 insertions, 0 deletions
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 |