aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-03-17 12:37:08 +0100
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:12:06 -0300
commitf05959ca094129ebad9105aeadc537588bcaa0bb (patch)
tree37133852fa0333dbcad709267435f53b278855ed
parentb9b445ffe9086ee784d3d3b4f0c4fa15b0c905d8 (diff)
downloadgcc-f05959ca094129ebad9105aeadc537588bcaa0bb.zip
gcc-f05959ca094129ebad9105aeadc537588bcaa0bb.tar.gz
gcc-f05959ca094129ebad9105aeadc537588bcaa0bb.tar.bz2
[Ada] Refine type for sorting case-choices tables
2020-06-11 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_aggr.adb (Case_Table_Type): Change index type from Nat to Pos.
-rw-r--r--gcc/ada/sem_aggr.adb10
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 5d56fd7..9ef0eb8 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -85,9 +85,8 @@ package body Sem_Aggr is
-- The node of the choice
end record;
- type Case_Table_Type is array (Nat range <>) of Case_Bounds;
- -- Table type used by Check_Case_Choices procedure. Entry zero is not
- -- used (reserved for the sort). Real entries start at one.
+ type Case_Table_Type is array (Pos range <>) of Case_Bounds;
+ -- Table type used by Check_Case_Choices procedure
-----------------------
-- Local Subprograms --
@@ -1827,9 +1826,8 @@ package body Sem_Aggr is
-- if a choice in an aggregate is a subtype indication these
-- denote the lowest and highest values of the subtype
- Table : Case_Table_Type (0 .. Case_Table_Size);
- -- Used to sort all the different choice values. Entry zero is
- -- reserved for sorting purposes.
+ Table : Case_Table_Type (1 .. Case_Table_Size);
+ -- Used to sort all the different choice values
Single_Choice : Boolean;
-- Set to true every time there is a single discrete choice in a