From: Arnaud Charlet Date: Wed, 1 Apr 2020 15:46:22 +0000 (-0400) Subject: [Ada] Allow uninitialized values on Big_Positive/Natural X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b85120adbab0723862baed90c0430b39b2d6b938;p=gcc.git [Ada] Allow uninitialized values on Big_Positive/Natural 2020-06-15 Arnaud Charlet gcc/ada/ * libgnat/a-nbnbin.ads (Big_Positive, Big_Natural): Fix predicate. --- diff --git a/gcc/ada/libgnat/a-nbnbin.ads b/gcc/ada/libgnat/a-nbnbin.ads index 45a7b6e64eb..581e868b899 100644 --- a/gcc/ada/libgnat/a-nbnbin.ads +++ b/gcc/ada/libgnat/a-nbnbin.ads @@ -46,11 +46,15 @@ is function To_Big_Integer (Arg : Integer) return Big_Integer; subtype Big_Positive is Big_Integer - with Dynamic_Predicate => Big_Positive > To_Big_Integer (0), + with Dynamic_Predicate => + (if Is_Valid (Big_Positive) + then Big_Positive > To_Big_Integer (0)), Predicate_Failure => (raise Constraint_Error); subtype Big_Natural is Big_Integer - with Dynamic_Predicate => Big_Natural >= To_Big_Integer (0), + with Dynamic_Predicate => + (if Is_Valid (Big_Natural) + then Big_Natural >= To_Big_Integer (0)), Predicate_Failure => (raise Constraint_Error); function In_Range (Arg, Low, High : Big_Integer) return Boolean is