aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-07-10 20:51:22 +0200
committerTristan Gingold <tgingold@free.fr>2019-07-10 20:51:22 +0200
commite24abb5093365dfc578a154d9b89d84ca145a4fe (patch)
tree6b5026a3cf8b93ef5f78a2f7af2eb9c988b7355c
parent258dce0685f3353c4515398aae683e86c0d91b55 (diff)
downloadghdl-e24abb5093365dfc578a154d9b89d84ca145a4fe.tar.gz
ghdl-e24abb5093365dfc578a154d9b89d84ca145a4fe.tar.bz2
ghdl-e24abb5093365dfc578a154d9b89d84ca145a4fe.zip
synth: do not crash on use of std_logic_1164 2008.
-rw-r--r--src/synth/synth-decls.adb8
-rw-r--r--src/vhdl/vhdl-annotations.adb14
2 files changed, 10 insertions, 12 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb
index e819ac116..add870a11 100644
--- a/src/synth/synth-decls.adb
+++ b/src/synth/synth-decls.adb
@@ -113,8 +113,10 @@ package body Synth.Decls is
-- The elaboration of an index constraint consists of the
-- declaration of each of the discrete ranges in the index
-- constraint in some order that is not defined by the language.
- Synth_Anonymous_Subtype_Indication
- (Syn_Inst, Get_Element_Subtype (Atype));
+ if Get_Array_Element_Constraint (Atype) /= Null_Node then
+ Synth_Subtype_Indication
+ (Syn_Inst, Get_Element_Subtype (Atype));
+ end if;
declare
St_Indexes : constant Iir_Flist :=
Get_Index_Subtype_List (Atype);
@@ -159,6 +161,8 @@ package body Synth.Decls is
Synth_Subtype_Indication (Syn_Inst, Atype);
end Synth_Anonymous_Subtype_Indication;
+ pragma Unreferenced (Synth_Anonymous_Subtype_Indication);
+
function Get_Declaration_Type (Decl : Node) return Node
is
Ind : constant Node := Get_Subtype_Indication (Decl);
diff --git a/src/vhdl/vhdl-annotations.adb b/src/vhdl/vhdl-annotations.adb
index 1d9792948..077c66e99 100644
--- a/src/vhdl/vhdl-annotations.adb
+++ b/src/vhdl/vhdl-annotations.adb
@@ -359,16 +359,10 @@ package body Vhdl.Annotations is
Annotate_Anonymous_Type_Definition (Block_Info, El);
when Iir_Kind_Array_Subtype_Definition =>
- declare
- El_Type : constant Iir := Get_Element_Subtype (Def);
- Bel_Type : constant Iir :=
- Get_Element_Subtype (Get_Base_Type (Def));
- begin
- if El_Type /= Bel_Type then
- Annotate_Anonymous_Type_Definition
- (Block_Info, Get_Element_Subtype (Def));
- end if;
- end;
+ if Get_Array_Element_Constraint (Def) /= Null_Node then
+ Annotate_Type_Definition
+ (Block_Info, Get_Element_Subtype (Def));
+ end if;
if Flag_Synthesis then
-- For the bounds.
Create_Object_Info (Block_Info, Def);