Commit 4c4e9ad2 by Ed Schonberg Committed by Arnaud Charlet

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
parent 986a8d90
...@@ -5234,6 +5234,7 @@ package body Sem_Attr is ...@@ -5234,6 +5234,7 @@ package body Sem_Attr is
-- subtype then get the type from the initial value. If the value has -- subtype then get the type from the initial value. If the value has
-- been expanded into assignments, there is no expression and the -- been expanded into assignments, there is no expression and the
-- attribute reference remains dynamic. -- attribute reference remains dynamic.
-- We could do better here and retrieve the type ??? -- We could do better here and retrieve the type ???
if Ekind (P_Entity) = E_Constant if Ekind (P_Entity) = E_Constant
...@@ -8094,9 +8095,10 @@ package body Sem_Attr is ...@@ -8094,9 +8095,10 @@ package body Sem_Attr is
-- the slice is non-null. That is because a null slice can have -- the slice is non-null. That is because a null slice can have
-- an out of bounds index value. -- an out of bounds index value.
-- Right now, gigi blows up if given 'Address on a slice, and -- Right now, gigi blows up if given 'Address on a slice as a
-- this covers up that bug in one case, but the bug is likely -- result of some incorrect freeze nodes generated by the front
-- still there in the cases not transformed by this code ??? -- 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 -- It's not clear what 'Address *should* return for a null
-- slice with out of bounds indexes, this might be worth an ARG -- slice with out of bounds indexes, this might be worth an ARG
...@@ -8127,7 +8129,9 @@ package body Sem_Attr is ...@@ -8127,7 +8129,9 @@ package body Sem_Attr is
Prefix => (New_Occurrence_Of (Entity (D), Loc)), Prefix => (New_Occurrence_Of (Entity (D), Loc)),
Attribute_Name => Name_First); 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); Lo := Low_Bound (D);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment