summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-28 13:40:10 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-28 13:40:10 +0000
commit0ff60170e3fcff61235dd5f5eb4af1f86dd6b5a1 (patch)
tree2005618d777beac7c1ca73bb5c371b1b383c3f49 /gcc/ada
parentbc33bf0a85524d92307c3cc052c6dfa0f7e83bce (diff)
downloadgcc-0ff60170e3fcff61235dd5f5eb4af1f86dd6b5a1.tar.gz
2010-01-28 Vincent Celier <celier@adacore.com>
* prj-attr-pm.adb (Add_Attribute): Do nothing if To_Package is Unknown_Package. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156318 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/prj-attr-pm.adb28
2 files changed, 20 insertions, 13 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 848eb336ed6..15aa111932e 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-28 Vincent Celier <celier@adacore.com>
+
+ * prj-attr-pm.adb (Add_Attribute): Do nothing if To_Package is
+ Unknown_Package.
+
2010-01-28 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Minor correction
diff --git a/gcc/ada/prj-attr-pm.adb b/gcc/ada/prj-attr-pm.adb
index ef843c05b5b..9b75c0526e4 100644
--- a/gcc/ada/prj-attr-pm.adb
+++ b/gcc/ada/prj-attr-pm.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2004-2008, Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2010, 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- --
@@ -35,19 +35,21 @@ package body Prj.Attr.PM is
Attribute_Node : out Attribute_Node_Id)
is
begin
- -- Only add the attribute if the package is already defined
+ -- Only add attribute if package is already defined and is not unknown
+
+ if To_Package /= Empty_Package and then
+ To_Package /= Unknown_Package
+ then
+ Attrs.Append (
+ (Name => Attribute_Name,
+ Var_Kind => Undefined,
+ Optional_Index => False,
+ Attr_Kind => Unknown,
+ Read_Only => False,
+ Others_Allowed => False,
+ Next =>
+ Package_Attributes.Table (To_Package.Value).First_Attribute));
- if To_Package /= Empty_Package then
- Attrs.Increment_Last;
- Attrs.Table (Attrs.Last) :=
- (Name => Attribute_Name,
- Var_Kind => Undefined,
- Optional_Index => False,
- Attr_Kind => Unknown,
- Read_Only => False,
- Others_Allowed => False,
- Next =>
- Package_Attributes.Table (To_Package.Value).First_Attribute);
Package_Attributes.Table (To_Package.Value).First_Attribute :=
Attrs.Last;
Attribute_Node := (Value => Attrs.Last);