aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-05-19 06:56:57 +0200
committerTristan Gingold <tgingold@free.fr>2021-05-19 06:56:57 +0200
commitf6b20c144bf379f35d9f36476da9e81cc3e7c44b (patch)
treeaa31189ed03d69cc64268c5fc3cc30e46671d94e /src/ortho
parent32fe43a17d6720d67e3f39026ca7342f82839cda (diff)
downloadghdl-f6b20c144bf379f35d9f36476da9e81cc3e7c44b.tar.gz
ghdl-f6b20c144bf379f35d9f36476da9e81cc3e7c44b.tar.bz2
ghdl-f6b20c144bf379f35d9f36476da9e81cc3e7c44b.zip
ortho_front: use array subtype element if indexing an array subtype.
Diffstat (limited to 'src/ortho')
-rw-r--r--src/ortho/oread/ortho_front.adb5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ortho/oread/ortho_front.adb b/src/ortho/oread/ortho_front.adb
index 2e08b7ab0..e6bf6b6a3 100644
--- a/src/ortho/oread/ortho_front.adb
+++ b/src/ortho/oread/ortho_front.adb
@@ -2114,13 +2114,16 @@ package body Ortho_Front is
declare
V : O_Enode;
Bt : Node_Acc;
+ El_Type : Node_Acc;
Res_Type : Node_Acc;
begin
Next_Token;
if N_Type.Kind = Type_Subarray then
Bt := N_Type.Subarray_Base;
+ El_Type := N_Type.Subarray_El;
else
Bt := N_Type;
+ El_Type := N_Type.Array_Element;
end if;
if Bt.Kind /= Type_Array then
Parse_Error ("type of prefix is not an array");
@@ -2131,7 +2134,7 @@ package body Ortho_Front is
Next_Token;
else
N := New_Indexed_Element (N, V);
- N_Type := Bt.Array_Element;
+ N_Type := El_Type;
end if;
Expect (Tok_Right_Brack);
Next_Token;