+2010-01-25 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_aggr.adb (Resolve_Array_Aggregate): If the bounds in a choice
+ have errors, do not continue resolution of the aggregate.
+ * sem_eval.adb (Eval_Indexed_Component): Do not attempt to evaluate if
+ the array type indicates an error.
+
+2010-01-25 Bob Duff <duff@adacore.com>
+
+ * sinfo.ads: Minor comment fixes.
+
2010-01-25 Bob Duff <duff@adacore.com>
* exp_ch4.adb, exp_aggr.adb: Minor comment fixes and code clean up.
and then Compile_Time_Known_Value (Choices_Low)
and then Compile_Time_Known_Value (Choices_High)
then
+
+ -- If the bounds have semantic errors, do not attempt
+ -- further resolution to prevent cascaded errors..
+
+ if Error_Posted (Choices_Low)
+ or else Error_Posted (Choices_High)
+ then
+ return False;
+ end if;
+
declare
ALo : constant Node_Id := Expr_Value_E (Aggr_Low);
AHi : constant Node_Id := Expr_Value_E (Aggr_High);
-- are error cases where this is not the case), then see if we
-- can do a constant evaluation of the array reference.
- if Is_Array_Type (Atyp) then
+ if Is_Array_Type (Atyp)
+ and then Atyp /= Any_Composite
+ then
if Ekind (Atyp) = E_String_Literal_Subtype then
Lbd := String_Literal_Low_Bound (Atyp);
else
-- issues. Used to inhibit multiple redundant messages.
-- Aggregate_Bounds (Node3-Sem)
- -- Present in array N_Aggregate nodes. If the aggregate contains
- -- component associations this field points to an N_Range node whose
- -- bounds give the lowest and highest discrete choice values. If the
- -- named aggregate contains a dynamic or null choice this field is empty.
- -- If the aggregate contains positional elements this field points to an
- -- N_Integer_Literal node giving the number of positional elements. Note
- -- that if the aggregate contains positional elements and an other choice
- -- the N_Integer_Literal only accounts for the number of positional
- -- elements.
+ -- Present in array N_Aggregate nodes. If the bounds of the aggregate are
+ -- known at compile time, this field points to an N_Range node with those
+ -- bounds. Otherwise Empty.
-- All_Others (Flag11-Sem)
-- Present in an N_Others_Choice node. This flag is set for an others
-- are not met, then the front end must translate the aggregate into
-- an appropriate set of assignments into a temporary.
- -- Note: for the record aggregate case, gigi/gcc can handle all cases
- -- of record aggregates, including those for packed, and rep-claused
+ -- Note: for the record aggregate case, gigi/gcc can handle all cases of
+ -- record aggregates, including those for packed, and rep-claused
-- records, and also variant records, providing that there are no
- -- variable length fields whose size is not known at runtime, and
+ -- variable length fields whose size is not known at compile time, and
-- providing that the aggregate is presented in fully named form.
----------------------------------------------