]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/maxloc1_16_r10.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / maxloc1_16_r10.c
index b610133bf6b3a23667c5b195eeb5c2187a374964..dc5e27c46316da027a5530c0488b91748f448127 100644 (file)
@@ -248,6 +248,16 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
   index_type mdelta;
   int mask_kind;
 
+  if (mask == NULL)
+    {
+#ifdef HAVE_BACK_ARG
+      maxloc1_16_r10 (retarray, array, pdim, back);
+#else
+      maxloc1_16_r10 (retarray, array, pdim);
+#endif
+      return;
+    }
+
   dim = (*pdim) - 1;
   rank = GFC_DESCRIPTOR_RANK (array) - 1;
 
@@ -470,7 +480,7 @@ smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
   index_type dim;
 
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
 #ifdef HAVE_BACK_ARG
       maxloc1_16_r10 (retarray, array, pdim, back);