diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-07-27 16:06:30 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-10-25 15:07:20 +0000 |
commit | a3a6a0a50af2dd257682289703b721ba1b7863ca (patch) | |
tree | 2352435a16edb403fad34d54a2f7a69b94f0c2e8 | |
parent | 9e67eed1efd54d17e863159086048be673e9587e (diff) | |
download | gcc-a3a6a0a50af2dd257682289703b721ba1b7863ca.zip gcc-a3a6a0a50af2dd257682289703b721ba1b7863ca.tar.gz gcc-a3a6a0a50af2dd257682289703b721ba1b7863ca.tar.bz2 |
[Ada] Global contracts on expression functions in Ada.Strings.Superbounded
gcc/ada/
* libgnat/a-strsup.ads (Super_Length, Super_Element,
Super_Slice): Add Global contracts.
-rw-r--r-- | gcc/ada/libgnat/a-strsup.ads | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ada/libgnat/a-strsup.ads b/gcc/ada/libgnat/a-strsup.ads index 7428e9c..ae4339f 100644 --- a/gcc/ada/libgnat/a-strsup.ads +++ b/gcc/ada/libgnat/a-strsup.ads @@ -76,7 +76,8 @@ package Ada.Strings.Superbounded with SPARK_Mode is -- that they can be renamed in Ada.Strings.Bounded.Generic_Bounded_Length. function Super_Length (Source : Super_String) return Natural - is (Source.Current_Length); + is (Source.Current_Length) + with Global => null; -------------------------------------------------------- -- Conversion, Concatenation, and Selection Functions -- @@ -620,7 +621,8 @@ package Ada.Strings.Superbounded with SPARK_Mode is is (if Index <= Source.Current_Length then Source.Data (Index) else raise Index_Error) - with Pre => Index <= Super_Length (Source); + with Pre => Index <= Super_Length (Source), + Global => null; procedure Super_Replace_Element (Source : in out Super_String; @@ -649,8 +651,9 @@ package Ada.Strings.Superbounded with SPARK_Mode is -- get the null string in accordance with normal Ada slice rules. String (Source.Data (Low .. High))) - with Pre => Low - 1 <= Super_Length (Source) - and then High <= Super_Length (Source); + with Pre => Low - 1 <= Super_Length (Source) + and then High <= Super_Length (Source), + Global => null; function Super_Slice (Source : Super_String; |