aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/parse.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-14 18:28:38 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-14 18:28:38 +0100
commit9098f5452bfa1ab2b0a49d5aaae905ddf5f28279 (patch)
tree9f73b23c1ee3c350e3ae19c9bfc22cc7f562a79c /src/vhdl/parse.adb
parentd39ab1032e8b0054ff608e70a97d347a5ab362d1 (diff)
downloadghdl-9098f5452bfa1ab2b0a49d5aaae905ddf5f28279.tar.gz
ghdl-9098f5452bfa1ab2b0a49d5aaae905ddf5f28279.tar.bz2
ghdl-9098f5452bfa1ab2b0a49d5aaae905ddf5f28279.zip
parse: strenghten.
Diffstat (limited to 'src/vhdl/parse.adb')
-rw-r--r--src/vhdl/parse.adb9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vhdl/parse.adb b/src/vhdl/parse.adb
index 4333c97fb..5048719de 100644
--- a/src/vhdl/parse.adb
+++ b/src/vhdl/parse.adb
@@ -2758,8 +2758,7 @@ package body Parse is
--
-- NAME is the type_mark when already parsed (in range expression or
-- allocator by type).
- function Parse_Subtype_Indication (Name : Iir := Null_Iir)
- return Iir
+ function Parse_Subtype_Indication (Name : Iir := Null_Iir) return Iir
is
Type_Mark : Iir;
Def: Iir;
@@ -2820,8 +2819,10 @@ package body Parse is
then
-- A subtype needs to be created.
Def := Create_Iir (Iir_Kind_Subtype_Definition);
- Location_Copy (Def, Type_Mark);
- Set_Subtype_Type_Mark (Def, Type_Mark);
+ if Type_Mark /= Null_Iir then
+ Location_Copy (Def, Type_Mark);
+ Set_Subtype_Type_Mark (Def, Type_Mark);
+ end if;
Set_Resolution_Indication (Def, Resolution_Indication);
Set_Tolerance (Def, Tolerance);
else