-- 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
-- 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
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