Blame SOURCES/gdb-vla-intel-04of23-fix.patch

f9426a
Re: [PATCH 04/23] vla: make dynamic fortran arrays functional.
f9426a
https://sourceware.org/ml/gdb-patches/2014-06/msg00570.html
f9426a
f9426a
Index: gdb-7.7.90.20140627/gdb/valarith.c
f9426a
===================================================================
f9426a
--- gdb-7.7.90.20140627.orig/gdb/valarith.c	2014-07-07 20:44:03.136394525 +0200
f9426a
+++ gdb-7.7.90.20140627/gdb/valarith.c	2014-07-07 20:45:41.588536459 +0200
f9426a
@@ -195,10 +195,17 @@ value_subscripted_rvalue (struct value *
f9426a
   struct type *array_type = check_typedef (value_type (array));
f9426a
   struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
f9426a
   unsigned int elt_size = TYPE_LENGTH (elt_type);
f9426a
-  unsigned int elt_offs = longest_to_int (index - lowerbound);
f9426a
+  unsigned int elt_offs;
f9426a
   LONGEST elt_stride = TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type));
f9426a
   struct value *v;
f9426a
 
f9426a
+  if (TYPE_NOT_ASSOCIATED (array_type))
f9426a
+    error (_("no such vector element because not associated"));
f9426a
+  if (TYPE_NOT_ALLOCATED (array_type))
f9426a
+    error (_("no such vector element because not allocated"));
f9426a
+
f9426a
+  elt_offs = longest_to_int (index - lowerbound);
f9426a
+
f9426a
   if (elt_stride > 0)
f9426a
     elt_offs *= elt_stride;
f9426a
   else if (elt_stride < 0)
f9426a
@@ -212,14 +219,7 @@ value_subscripted_rvalue (struct value *
f9426a
 
f9426a
   if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
f9426a
 			     && elt_offs >= TYPE_LENGTH (array_type)))
f9426a
-    {
f9426a
-      if (TYPE_NOT_ASSOCIATED (array_type))
f9426a
-        error (_("no such vector element because not associated"));
f9426a
-      else if (TYPE_NOT_ALLOCATED (array_type))
f9426a
-        error (_("no such vector element because not allocated"));
f9426a
-      else
f9426a
-        error (_("no such vector element"));
f9426a
-    }
f9426a
+    error (_("no such vector element"));
f9426a
 
f9426a
   if (VALUE_LVAL (array) == lval_memory && value_lazy (array))
f9426a
     v = allocate_value_lazy (elt_type);