diff gcc/ada/sem_dim.adb @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line diff
--- a/gcc/ada/sem_dim.adb	Fri Oct 27 22:46:09 2017 +0900
+++ b/gcc/ada/sem_dim.adb	Thu Oct 25 07:37:49 2018 +0900
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2011-2017, Free Software Foundation, Inc.         --
+--          Copyright (C) 2011-2018, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -903,13 +903,13 @@
       Choice       : Node_Id;
       Dim_Aggr     : Node_Id;
       Dim_Symbol   : Node_Id;
-      Dim_Symbols  : Symbol_Array := No_Symbols;
-      Dim_System   : System_Type  := Null_System;
-      Position     : Nat := 0;
+      Dim_Symbols  : Symbol_Array       := No_Symbols;
+      Dim_System   : System_Type        := Null_System;
+      Position     : Dimension_Position := Invalid_Position;
       Unit_Name    : Node_Id;
-      Unit_Names   : Name_Array   := No_Names;
+      Unit_Names   : Name_Array         := No_Names;
       Unit_Symbol  : Node_Id;
-      Unit_Symbols : Symbol_Array := No_Symbols;
+      Unit_Symbols : Symbol_Array       := No_Symbols;
 
       Errors_Count : Nat;
       --  Errors_Count is a count of errors detected by the compiler so far
@@ -949,13 +949,13 @@
       Dim_Aggr     := First (Expressions (Aggr));
       Errors_Count := Serious_Errors_Detected;
       while Present (Dim_Aggr) loop
-         Position := Position + 1;
-
-         if Position > High_Position_Bound then
+         if Position = High_Position_Bound then
             Error_Msg_N ("too many dimensions in system", Aggr);
             exit;
          end if;
 
+         Position := Position + 1;
+
          if Nkind (Dim_Aggr) /= N_Aggregate then
             Error_Msg_N ("aggregate expected", Dim_Aggr);
 
@@ -1558,7 +1558,7 @@
             --  For relational operations, only dimension checking is
             --  performed (no propagation). If one operand is the result
             --  of constant folding the dimensions may have been lost
-            --  in a tree copy, so assume that pre-analysis has verified
+            --  in a tree copy, so assume that preanalysis has verified
             --  that dimensions are correct.
 
             elsif N_Kind in N_Op_Compare then