summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cihama.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-09 17:16:22 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-09 17:16:22 +0000
commit136d479bb4214ff4edeb12e64ccb6bd6bb79a894 (patch)
tree3d8042f676028733216495b35bc6bac0d717a751 /gcc/ada/a-cihama.adb
parent2ec38781061e5b5a86351d133c1badf125b1ef21 (diff)
downloadgcc-136d479bb4214ff4edeb12e64ccb6bd6bb79a894.tar.gz
2005-12-05 Matthew Heaney <heaney@adacore.com>
* a-convec.adb (Merge): Added assertions to check whether vector params are sorted. * a-coinve.adb (Merge): Added assertions to check whether vector params are sorted. * a-cohama.ads (Cursor'Write): raises Program_Error per latest AI-302 draft. (Cursor'Read): raises PE * a-cohama.adb (Insert.New_Node): Uses box-style syntax to init elem to its default value. * a-cihama.adb: Manually check whether cursor's key and elem are non-null * a-cidlli.ads, a-cidlli.adb (Splice): Changed param name and param mode (Merge): Assert that target and source lists are in order (Swap): Declare non-const temporaries, to pass to Splice * a-cdlili.ads: (Splice): Changed param name and param mode * a-cdlili.adb: (Splice): Changed param name and param mode (Merge): Assert that target and source lists are in order (Swap): Declare non-const temporaries, to pass to Splice * a-ciorma.ads, a-coorma.ads: (Read): declare Stream param as not null (Write): declare Stream param as not null * a-ciorma.adb, a-coorma.adb: All explicit raise statements now include an exception message. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-cihama.adb')
-rw-r--r--gcc/ada/a-cihama.adb46
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc/ada/a-cihama.adb b/gcc/ada/a-cihama.adb
index 3836f7eb035..3a78e8eab0d 100644
--- a/gcc/ada/a-cihama.adb
+++ b/gcc/ada/a-cihama.adb
@@ -237,6 +237,10 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
raise Constraint_Error;
end if;
+ if Position.Node.Element = null then
+ raise Program_Error;
+ end if;
+
return Position.Node.Element.all;
end Element;
@@ -267,6 +271,12 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
raise Constraint_Error;
end if;
+ if Left.Node.Key = null
+ or else Right.Node.Key = null
+ then
+ raise Program_Error;
+ end if;
+
return Equivalent_Keys (Left.Node.Key.all, Right.Node.Key.all);
end Equivalent_Keys;
@@ -281,6 +291,10 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
raise Constraint_Error;
end if;
+ if Left.Node.Key = null then
+ raise Program_Error;
+ end if;
+
return Equivalent_Keys (Left.Node.Key.all, Right);
end Equivalent_Keys;
@@ -295,6 +309,10 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
raise Constraint_Error;
end if;
+ if Right.Node.Key = null then
+ raise Program_Error;
+ end if;
+
return Equivalent_Keys (Left, Right.Node.Key.all);
end Equivalent_Keys;
@@ -595,6 +613,10 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
raise Constraint_Error;
end if;
+ if Position.Node.Key = null then
+ raise Program_Error;
+ end if;
+
return Position.Node.Key.all;
end Key;
@@ -641,6 +663,12 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
return No_Element;
end if;
+ if Position.Node.Key = null
+ or else Position.Node.Element = null
+ then
+ raise Program_Error;
+ end if;
+
declare
HT : Hash_Table_Type renames Position.Container.HT;
Node : constant Node_Access := HT_Ops.Next (HT, Position.Node);
@@ -670,6 +698,12 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
raise Constraint_Error;
end if;
+ if Position.Node.Key = null
+ or else Position.Node.Element = null
+ then
+ raise Program_Error;
+ end if;
+
declare
M : Map renames Position.Container.all;
HT : Hash_Table_Type renames M.HT'Unrestricted_Access.all;
@@ -807,6 +841,12 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
raise Constraint_Error;
end if;
+ if Position.Node.Key = null
+ or else Position.Node.Element = null
+ then
+ raise Program_Error;
+ end if;
+
if Position.Container /= Container'Unrestricted_Access then
raise Program_Error;
end if;
@@ -862,6 +902,12 @@ package body Ada.Containers.Indefinite_Hashed_Maps is
raise Constraint_Error;
end if;
+ if Position.Node.Key = null
+ or else Position.Node.Element = null
+ then
+ raise Program_Error;
+ end if;
+
if Position.Container /= Container'Unrestricted_Access then
raise Program_Error;
end if;