diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-05-19 06:56:57 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-05-19 06:56:57 +0200 |
commit | f6b20c144bf379f35d9f36476da9e81cc3e7c44b (patch) | |
tree | aa31189ed03d69cc64268c5fc3cc30e46671d94e /src | |
parent | 32fe43a17d6720d67e3f39026ca7342f82839cda (diff) | |
download | ghdl-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')
-rw-r--r-- | src/ortho/oread/ortho_front.adb | 5 |
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; |