diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-01-10 13:32:04 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-05-07 09:55:58 +0200 |
commit | c6b06faa3ccb2b12b80ee682d3f22a7f5aa9ddd3 (patch) | |
tree | b02df80883e23eb4515e940f78b40ac97e9dc597 /gcc/ada/lib.ads | |
parent | cf14e7c1db2f20d9dbcc8c3efdebe549ec5eec80 (diff) | |
download | gcc-c6b06faa3ccb2b12b80ee682d3f22a7f5aa9ddd3.zip gcc-c6b06faa3ccb2b12b80ee682d3f22a7f5aa9ddd3.tar.gz gcc-c6b06faa3ccb2b12b80ee682d3f22a7f5aa9ddd3.tar.bz2 |
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/lib.ads')
-rw-r--r-- | gcc/ada/lib.ads | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ada/lib.ads b/gcc/ada/lib.ads index ee06cde..93ff1b1 100644 --- a/gcc/ada/lib.ads +++ b/gcc/ada/lib.ads @@ -463,8 +463,8 @@ package Lib is function No_Elab_Code_All (U : Unit_Number_Type) return Boolean; function OA_Setting (U : Unit_Number_Type) return Character; function Primary_Stack_Count - (U : Unit_Number_Type) return Int; - function Sec_Stack_Count (U : Unit_Number_Type) return Int; + (U : Unit_Number_Type) return Nat; + function Sec_Stack_Count (U : Unit_Number_Type) return Nat; function Source_Index (U : Unit_Number_Type) return Source_File_Index; function Unit_File_Name (U : Unit_Number_Type) return File_Name_Type; function Unit_Name (U : Unit_Number_Type) return Unit_Name_Type; @@ -686,11 +686,11 @@ package Lib is -- source unit, the criterion being that Get_Source_Unit yields the -- same value for each argument. - procedure Increment_Primary_Stack_Count (Increment : Int); + procedure Increment_Primary_Stack_Count (Increment : Nat); -- Increment the Primary_Stack_Count field for the current unit by -- Increment. - procedure Increment_Sec_Stack_Count (Increment : Int); + procedure Increment_Sec_Stack_Count (Increment : Nat); -- Increment the Sec_Stack_Count field for the current unit by Increment function Increment_Serial_Number return Nat; @@ -861,8 +861,8 @@ private Ident_String : Node_Id; Main_Priority : Int; Main_CPU : Int; - Primary_Stack_Count : Int; - Sec_Stack_Count : Int; + Primary_Stack_Count : Nat; + Sec_Stack_Count : Nat; Serial_Number : Nat; Version : Word; Error_Location : Source_Ptr; |