aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2008-05-27 10:49:47 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-05-27 10:49:47 +0200
commit4c4e9ad2b2fd7277af83f62cef018e4f90115e41 (patch)
tree4098b2932f5f1fa7f6f52961730c2ae8b9d751c3 /gcc
parent986a8d9011564b90d14a972af1d78dea4eaa95c8 (diff)
downloadgcc-4c4e9ad2b2fd7277af83f62cef018e4f90115e41.zip
gcc-4c4e9ad2b2fd7277af83f62cef018e4f90115e41.tar.gz
gcc-4c4e9ad2b2fd7277af83f62cef018e4f90115e41.tar.bz2
sem_attr.adb: add guard to previous patch.
2008-05-27 Ed Schonberg <schonberg@adacore.com> * sem_attr.adb: add guard to previous patch. From-SVN: r135977
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_attr.adb12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 768cdf6..0cb2ace 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -5234,6 +5234,7 @@ package body Sem_Attr is
-- subtype then get the type from the initial value. If the value has
-- been expanded into assignments, there is no expression and the
-- attribute reference remains dynamic.
+
-- We could do better here and retrieve the type ???
if Ekind (P_Entity) = E_Constant
@@ -8094,9 +8095,10 @@ package body Sem_Attr is
-- the slice is non-null. That is because a null slice can have
-- an out of bounds index value.
- -- Right now, gigi blows up if given 'Address on a slice, and
- -- this covers up that bug in one case, but the bug is likely
- -- still there in the cases not transformed by this code ???
+ -- Right now, gigi blows up if given 'Address on a slice as a
+ -- result of some incorrect freeze nodes generated by the front
+ -- end, and this covers up that bug in one case, but the bug is
+ -- likely still there in the cases not handled by this code ???
-- It's not clear what 'Address *should* return for a null
-- slice with out of bounds indexes, this might be worth an ARG
@@ -8127,7 +8129,9 @@ package body Sem_Attr is
Prefix => (New_Occurrence_Of (Entity (D), Loc)),
Attribute_Name => Name_First);
- elsif Not_Null_Range (Low_Bound (D), High_Bound (D)) then
+ elsif Nkind (D) = N_Range
+ and then Not_Null_Range (Low_Bound (D), High_Bound (D))
+ then
Lo := Low_Bound (D);
else