mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 09:40:54 +08:00
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
This commit is contained in:
parent
986a8d9011
commit
4c4e9ad2b2
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user