aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-05-20 21:33:45 +0200
committerTristan Gingold <tgingold@free.fr>2015-05-20 21:33:45 +0200
commit338d9cce77d60cb34cf02c6cab9ceb4a2918938f (patch)
tree7902a2299cc37f5b2b94b7982ef2375c3afdcb7b
parente83033f53ffe78b0d3698a6bcf9c61824f97abc8 (diff)
downloadghdl-338d9cce77d60cb34cf02c6cab9ceb4a2918938f.tar.gz
ghdl-338d9cce77d60cb34cf02c6cab9ceb4a2918938f.tar.bz2
ghdl-338d9cce77d60cb34cf02c6cab9ceb4a2918938f.zip
Fix staticness of array attributes.
-rw-r--r--src/vhdl/evaluation.adb7
-rw-r--r--src/vhdl/sem_names.adb8
2 files changed, 3 insertions, 12 deletions
diff --git a/src/vhdl/evaluation.adb b/src/vhdl/evaluation.adb
index 627ec8bd1..b1adbbcf6 100644
--- a/src/vhdl/evaluation.adb
+++ b/src/vhdl/evaluation.adb
@@ -1486,12 +1486,9 @@ package body Evaluation is
| Iir_Kind_Subtype_Declaration
| Iir_Kind_Type_Declaration
| Iir_Kind_Implicit_Dereference
- | Iir_Kind_Function_Call =>
+ | Iir_Kind_Function_Call
+ | Iir_Kind_Attribute_Value =>
Prefix_Type := Get_Type (Prefix);
- when Iir_Kind_Attribute_Value =>
- -- The type of the attribute declaration may be unconstrained.
- Prefix_Type := Get_Type
- (Get_Expression (Get_Attribute_Specification (Prefix)));
when Iir_Kinds_Subtype_Definition =>
Prefix_Type := Prefix;
when Iir_Kinds_Denoting_Name =>
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb
index 571bc7c1e..897abef5e 100644
--- a/src/vhdl/sem_names.adb
+++ b/src/vhdl/sem_names.adb
@@ -885,7 +885,6 @@ package body Sem_Names is
Index_Type : Iir;
Prefix : Iir;
Prefix_Name : Iir;
- Staticness : Iir_Staticness;
begin
-- LRM93 14.1
-- Parameter: A locally static expression of type universal_integer, the
@@ -986,12 +985,7 @@ package body Sem_Names is
-- A globally static array subtype is a constrained array subtype
-- formed by imposing on an unconstrained array type a globally static
-- index constraint.
- Staticness := Get_Type_Staticness (Prefix_Type);
- if Is_Type_Name (Prefix_Name) = Null_Iir then
- Staticness := Iir_Staticness'Max (Staticness,
- Get_Expr_Staticness (Prefix));
- end if;
- Set_Expr_Staticness (Attr, Staticness);
+ Set_Expr_Staticness (Attr, Get_Type_Staticness (Prefix_Type));
end Finish_Sem_Array_Attribute;
procedure Finish_Sem_Scalar_Type_Attribute