From: Ed Schonberg Date: Tue, 27 May 2008 08:49:47 +0000 (+0200) Subject: sem_attr.adb: add guard to previous patch. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c4e9ad2b2fd7277af83f62cef018e4f90115e41;p=gcc.git sem_attr.adb: add guard to previous patch. 2008-05-27 Ed Schonberg * sem_attr.adb: add guard to previous patch. From-SVN: r135977 --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 768cdf63ee4..0cb2ace755e 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