aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/libgnat
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2020-04-01 11:46:22 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-15 04:04:37 -0400
commitb85120adbab0723862baed90c0430b39b2d6b938 (patch)
tree2eaaa137d71e38e43aeaad800e7461a8839f8841 /gcc/ada/libgnat
parent63e96d44215b7b86eb2eb754dcf139437e40d850 (diff)
downloadgcc-b85120adbab0723862baed90c0430b39b2d6b938.zip
gcc-b85120adbab0723862baed90c0430b39b2d6b938.tar.gz
gcc-b85120adbab0723862baed90c0430b39b2d6b938.tar.bz2
[Ada] Allow uninitialized values on Big_Positive/Natural
2020-06-15 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-nbnbin.ads (Big_Positive, Big_Natural): Fix predicate.
Diffstat (limited to 'gcc/ada/libgnat')
-rw-r--r--gcc/ada/libgnat/a-nbnbin.ads8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/libgnat/a-nbnbin.ads b/gcc/ada/libgnat/a-nbnbin.ads
index 45a7b6e..581e868 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