diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/iirs_utils.adb | 6 | ||||
-rw-r--r-- | src/vhdl/sem_decls.adb | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/vhdl/iirs_utils.adb b/src/vhdl/iirs_utils.adb index 536238bef..32e52f77f 100644 --- a/src/vhdl/iirs_utils.adb +++ b/src/vhdl/iirs_utils.adb @@ -1571,8 +1571,10 @@ package body Iirs_Utils is Res : Iir; begin Res := Create_Iir (Iir_Kind_Error); - Set_Error_Origin (Res, Orig); - Location_Copy (Res, Orig); + if Orig /= Null_Iir then + Set_Error_Origin (Res, Orig); + Location_Copy (Res, Orig); + end if; return Res; end Create_Error; diff --git a/src/vhdl/sem_decls.adb b/src/vhdl/sem_decls.adb index 5d6e67596..ea89ff2fe 100644 --- a/src/vhdl/sem_decls.adb +++ b/src/vhdl/sem_decls.adb @@ -201,9 +201,14 @@ package body Sem_Decls is -- been freed. A_Type := Get_Subtype_Indication (Inter); if A_Type = Null_Iir then - pragma Assert (Last /= Null_Iir); - A_Type := Get_Type (Last); - Default_Value := Get_Default_Value (Last); + if Last = Null_Iir or else not Get_Has_Identifier_List (Last) then + -- Subtype indication was not parsed. + A_Type := Create_Error_Type (Null_Iir); + Set_Subtype_Indication (Inter, A_Type); + else + A_Type := Get_Type (Last); + Default_Value := Get_Default_Value (Last); + end if; else A_Type := Sem_Subtype_Indication (A_Type); Set_Subtype_Indication (Inter, A_Type); |