summaryrefslogtreecommitdiffstats
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-16 08:33:46 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-16 08:33:46 +0000
commitf4281cbb9a297d1d5224db53113f9f091e206e5d (patch)
treeba3c3dc841581c38264e379a9a4794c44aa3b1f7 /gcc/ada
parent01b34824d636187f81948cca15fce00e91c4df52 (diff)
downloadppe42-gcc-f4281cbb9a297d1d5224db53113f9f091e206e5d.tar.gz
ppe42-gcc-f4281cbb9a297d1d5224db53113f9f091e206e5d.zip
2005-06-14 Robert Dewar <dewar@adacore.com>
* atree.adb: (Elist*): Protect against uninitialized field git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101026 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/atree.adb93
1 files changed, 72 insertions, 21 deletions
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb
index f2266343971..a194aa15c6e 100644
--- a/gcc/ada/atree.adb
+++ b/gcc/ada/atree.adb
@@ -2886,72 +2886,124 @@ package body Atree is
end List14;
function Elist2 (N : Node_Id) return Elist_Id is
+ pragma Assert (N in Nodes.First .. Nodes.Last);
+ Value : constant Union_Id := Nodes.Table (N).Field2;
begin
- return Elist_Id (Nodes.Table (N).Field2);
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist2;
function Elist3 (N : Node_Id) return Elist_Id is
+ pragma Assert (N in Nodes.First .. Nodes.Last);
+ Value : constant Union_Id := Nodes.Table (N).Field3;
begin
- return Elist_Id (Nodes.Table (N).Field3);
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist3;
function Elist4 (N : Node_Id) return Elist_Id is
+ pragma Assert (N in Nodes.First .. Nodes.Last);
+ Value : constant Union_Id := Nodes.Table (N).Field4;
begin
- return Elist_Id (Nodes.Table (N).Field4);
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist4;
function Elist8 (N : Node_Id) return Elist_Id is
- begin
pragma Assert (Nkind (N) in N_Entity);
- return Elist_Id (Nodes.Table (N + 1).Field8);
+ Value : constant Union_Id := Nodes.Table (N + 1).Field8;
+ begin
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist8;
function Elist13 (N : Node_Id) return Elist_Id is
- begin
pragma Assert (Nkind (N) in N_Entity);
- return Elist_Id (Nodes.Table (N + 2).Field6);
+ Value : constant Union_Id := Nodes.Table (N + 2).Field6;
+ begin
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist13;
function Elist15 (N : Node_Id) return Elist_Id is
- begin
pragma Assert (Nkind (N) in N_Entity);
- return Elist_Id (Nodes.Table (N + 2).Field8);
+ Value : constant Union_Id := Nodes.Table (N + 2).Field8;
+ begin
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist15;
function Elist16 (N : Node_Id) return Elist_Id is
+ pragma Assert (Nkind (N) in N_Entity);
Value : constant Union_Id := Nodes.Table (N + 2).Field9;
-
begin
- pragma Assert (Nkind (N) in N_Entity);
if Value = 0 then
return No_Elist;
else
- return Elist_Id (Nodes.Table (N + 2).Field9);
+ return Elist_Id (Value);
end if;
end Elist16;
function Elist18 (N : Node_Id) return Elist_Id is
- begin
pragma Assert (Nkind (N) in N_Entity);
- return Elist_Id (Nodes.Table (N + 2).Field11);
+ Value : constant Union_Id := Nodes.Table (N + 2).Field11;
+ begin
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist18;
function Elist21 (N : Node_Id) return Elist_Id is
- begin
pragma Assert (Nkind (N) in N_Entity);
- return Elist_Id (Nodes.Table (N + 3).Field8);
+ Value : constant Union_Id := Nodes.Table (N + 3).Field8;
+ begin
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist21;
function Elist23 (N : Node_Id) return Elist_Id is
- begin
pragma Assert (Nkind (N) in N_Entity);
- return Elist_Id (Nodes.Table (N + 3).Field10);
+ Value : constant Union_Id := Nodes.Table (N + 3).Field10;
+ begin
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist23;
function Elist24 (N : Node_Id) return Elist_Id is
- begin
pragma Assert (Nkind (N) in N_Entity);
- return Elist_Id (Nodes.Table (N + 4).Field6);
+ Value : constant Union_Id := Nodes.Table (N + 4).Field6;
+ begin
+ if Value = 0 then
+ return No_Elist;
+ else
+ return Elist_Id (Value);
+ end if;
end Elist24;
function Name1 (N : Node_Id) return Name_Id is
@@ -3019,7 +3071,6 @@ package body Atree is
function Uint8 (N : Node_Id) return Uint is
pragma Assert (Nkind (N) in N_Entity);
U : constant Union_Id := Nodes.Table (N + 1).Field8;
-
begin
if U = 0 then
return Uint_0;
OpenPOWER on IntegriCloud