]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/findloc0_s1.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / findloc0_s1.c
index 3b0f9b07349af572d1691579a5bd704a9a7b0659..e42c44a1914e88cd7f986120f623d3796c216a03 100644 (file)
@@ -58,7 +58,7 @@ findloc0_s1 (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
     {
@@ -199,7 +199,7 @@ mfindloc0_s1 (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
     {
@@ -347,7 +347,7 @@ sfindloc0_s1 (gfc_array_index_type * const restrict retarray,
   index_type * restrict dest;
   index_type n;
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
       findloc0_s1 (retarray, array, value, back, len_array, len_value);
       return;
@@ -363,7 +363,7 @@ sfindloc0_s1 (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))
     {