* inftarg.c (child_thread_alive): New function to see if a
[deliverable/binutils-gdb.git] / gdb / valops.c
index a476ddc2bb80833061756502a0b63849bcbfe74a..ea0a3437b0004c7b7a31ad1c33a02c89d1dc3fbc 100644 (file)
@@ -140,6 +140,8 @@ value_cast (type, arg2)
       int new_length = val_length / TYPE_LENGTH (element_type);
       if (val_length % TYPE_LENGTH (element_type) != 0)
        warning("array element type size does not divide object size in cast");
+      /* FIXME-type-allocation: need a way to free this type when we are
+        done with it.  */
       range_type = create_range_type ((struct type *) NULL,
                                      TYPE_TARGET_TYPE (range_type),
                                      low_bound, new_length + low_bound - 1);
@@ -151,9 +153,9 @@ value_cast (type, arg2)
   if (current_language->c_style_arrays
       && (VALUE_REPEATED (arg2)
          || TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_ARRAY))
-    arg2 = value_coerce_array (arg2);                                  \
+    arg2 = value_coerce_array (arg2);
 
-  if (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_FUNC)                   \
+  if (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_FUNC)
     arg2 = value_coerce_function (arg2);
 
   COERCE_VARYING_ARRAY (arg2);
@@ -606,6 +608,8 @@ value_repeat (arg1, count)
     error ("Only values in memory can be extended with '@'.");
   if (count < 1)
     error ("Invalid number %d of repetitions.", count);
+  if (VALUE_REPEATED (arg1))
+    error ("Cannot create artificial arrays of artificial arrays.");
 
   val = allocate_repeat_value (VALUE_TYPE (arg1), count);
 
@@ -2054,6 +2058,7 @@ value_slice (array, lowbound, length)
      value_ptr array;
      int lowbound, length;
 {
+  COERCE_VARYING_ARRAY (array);
   if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_BITSTRING)
     error ("not implemented - bitstring slice");
   if (TYPE_CODE (VALUE_TYPE (array)) != TYPE_CODE_ARRAY
@@ -2071,6 +2076,8 @@ value_slice (array, lowbound, length)
       if (lowbound < lowerbound || length < 0
          || lowbound + length - 1 > upperbound)
        error ("slice out of range");
+      /* FIXME-type-allocation: need a way to free this type when we are
+        done with it.  */
       slice_range_type = create_range_type ((struct type*) NULL,
                                            TYPE_TARGET_TYPE (range_type),
                                            lowerbound,
This page took 0.024938 seconds and 4 git commands to generate.