summaryrefslogtreecommitdiff
path: root/gcc/ada/a-rbtgbo.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-30 17:17:33 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-30 17:17:33 +0200
commita18e3d62790873a98c07b098647a7002a24a1690 (patch)
tree0642edd4a753596c880abaf39ba029b60bd63cc9 /gcc/ada/a-rbtgbo.adb
parent1ebc2612da88cbb87faed5106329fd03831e0ebc (diff)
downloadgcc-a18e3d62790873a98c07b098647a7002a24a1690.tar.gz
[multiple changes]
2014-07-30 Ed Schonberg <schonberg@adacore.com> * a-crdlli.ads: Place declaration of Empty_List after full type declaration for Curosr, to prevent freezing error. 2014-07-30 Robert Dewar <dewar@adacore.com> * get_targ.adb: Minor code reorganization. * prj-proc.adb, prj-proc.ads, get_targ.ads, sem_ch6.adb: Minor reformatting. 2014-07-30 Ed Schonberg <schonberg@adacore.com> * a-cbhase.adb: a-cbhase.adb (Insert): Raise Constraint_Error, not Program_Error, when attempting to remove an element not in the set. This is the given semantics for all set containers. 2014-07-30 Ed Schonberg <schonberg@adacore.com> * a-rbtgbo.adb: -rbtgbo.adb (Delete_Node_Sans_Free): If element is not present in tree return rather than violating an assertion. Constraint_Error will be raised in the caller if element is not in the container. From-SVN: r213300
Diffstat (limited to 'gcc/ada/a-rbtgbo.adb')
-rw-r--r--gcc/ada/a-rbtgbo.adb9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ada/a-rbtgbo.adb b/gcc/ada/a-rbtgbo.adb
index ddf3fe2262a..d3b54d64695 100644
--- a/gcc/ada/a-rbtgbo.adb
+++ b/gcc/ada/a-rbtgbo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2013, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -196,7 +196,6 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
X, Y : Count_Type;
Z : constant Count_Type := Node;
- pragma Assert (Z /= 0);
N : Nodes_Type renames Tree.Nodes;
@@ -206,6 +205,12 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is
"attempt to tamper with cursors (container is busy)";
end if;
+ -- If node is not present, return. Exception will be raised in caller.
+
+ if Z = 0 then
+ return;
+ end if;
+
pragma Assert (Tree.Length > 0);
pragma Assert (Tree.Root /= 0);
pragma Assert (Tree.First /= 0);