aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.ads
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2024-01-10 13:32:04 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-07 09:55:58 +0200
commitc6b06faa3ccb2b12b80ee682d3f22a7f5aa9ddd3 (patch)
treeb02df80883e23eb4515e940f78b40ac97e9dc597 /gcc/ada/sem_util.ads
parentcf14e7c1db2f20d9dbcc8c3efdebe549ec5eec80 (diff)
ada: Prevent calculation of negative stack counts
Negative numbers of stack counts have no meaning. gcc/ada/ * lib.ads, lib.adb (Primary_Stack_Count, Sec_Stack_Count, Increment_Primary_Stack_Count, Increment_Sec_Stack_Count, Unit_Record): Stack counts are never negative. * ali.ads (Unit_Record): Likewise. * bindgen.adb (Num_Primary_Stacks, Num_Sec_Stacks): Likewise. * exp_ch3.adb (Count_Default_Sized_Task_Stacks): Likewise. * sem_util.ads, sem_util.adb (Number_Of_Elements_In_Array): Likewise.
Diffstat (limited to 'gcc/ada/sem_util.ads')
-rw-r--r--gcc/ada/sem_util.ads2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index db02d39fdee..83e824b3838 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -2785,7 +2785,7 @@ package Sem_Util is
-- 2) N is a comparison operator, one of the operands is null, and the
-- type of the other operand is a descendant of System.Address.
- function Number_Of_Elements_In_Array (T : Entity_Id) return Int;
+ function Number_Of_Elements_In_Array (T : Entity_Id) return Nat;
-- Returns the number of elements in the array T if the index bounds of T
-- is known at compile time. If the bounds are not known at compile time,
-- the function returns the value zero.