]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/findloc0_i2.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / findloc0_i2.c
index 712262fc8ba1afa9e3f03ea4e5644c8394122941..273248cba792040abb9fa44bded08dcfcea04945 100644 (file)
@@ -57,7 +57,7 @@ findloc0_i2 (gfc_array_index_type * const restrict retarray,
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
-      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
+      retarray->base_addr = xmallocarray (rank, sizeof (index_type));
     }
   else
     {
@@ -196,7 +196,7 @@ mfindloc0_i2 (gfc_array_index_type * const restrict retarray,
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
-      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
+      retarray->base_addr = xmallocarray (rank, sizeof (index_type));
     }
   else
     {
@@ -342,7 +342,7 @@ sfindloc0_i2 (gfc_array_index_type * const restrict retarray,
   index_type * restrict dest;
   index_type n;
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
       findloc0_i2 (retarray, array, value, back);
       return;
@@ -358,7 +358,7 @@ sfindloc0_i2 (gfc_array_index_type * const restrict retarray,
       GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
       retarray->dtype.rank = 1;
       retarray->offset = 0;
-      retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
+      retarray->base_addr = xmallocarray (rank, sizeof (index_type));
     }
   else if (unlikely (compile_options.bounds_check))
     {