From f6b20c144bf379f35d9f36476da9e81cc3e7c44b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 19 May 2021 06:56:57 +0200 Subject: ortho_front: use array subtype element if indexing an array subtype. --- src/ortho/oread/ortho_front.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3