]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/maxloc0_8_r4.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / maxloc0_8_r4.c
index 755a513a03eaa1d5d6e0b175c3e1d003db3b59cb..1a4671cc25f970a42522b28797ea51a687383861 100644 (file)
@@ -198,6 +198,13 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
   index_type n;
   int mask_kind;
 
+
+  if (mask == NULL)
+    {
+      maxloc0_8_r4 (retarray, array, back);
+      return;
+    }
+
   rank = GFC_DESCRIPTOR_RANK (array);
   if (rank <= 0)
     runtime_error ("Rank of array needs to be > 0");
@@ -369,7 +376,7 @@ smaxloc0_8_r4 (gfc_array_i8 * const restrict retarray,
   index_type n;
   GFC_INTEGER_8 *dest;
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
       maxloc0_8_r4 (retarray, array, back);
       return;