]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/maxloc0_4_i2.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / maxloc0_4_i2.c
index dd9e6783558895a8e9020b1aea2b60033a4320e5..1c973a07d8851a1106fc0648f7ea8414e724eb58 100644 (file)
@@ -198,6 +198,13 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray,
   index_type n;
   int mask_kind;
 
+
+  if (mask == NULL)
+    {
+      maxloc0_4_i2 (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_4_i2 (gfc_array_i4 * const restrict retarray,
   index_type n;
   GFC_INTEGER_4 *dest;
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
       maxloc0_4_i2 (retarray, array, back);
       return;