]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/maxloc1_16_s4.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / maxloc1_16_s4.c
index dce5c890376578bdcdc9da0da4604bdc846dbf05..0f94b7b61c1befee364fafe880b2a7ce140f5e5f 100644 (file)
@@ -241,6 +241,16 @@ mmaxloc1_16_s4 (gfc_array_i16 * const restrict retarray,
   index_type mdelta;
   int mask_kind;
 
+  if (mask == NULL)
+    {
+#ifdef HAVE_BACK_ARG
+      maxloc1_16_s4 (retarray, array, pdim, back, string_len);
+#else
+      maxloc1_16_s4 (retarray, array, pdim, string_len);
+#endif
+      return;
+    }
+
   dim = (*pdim) - 1;
   rank = GFC_DESCRIPTOR_RANK (array) - 1;
 
@@ -436,7 +446,7 @@ smaxloc1_16_s4 (gfc_array_i16 * const restrict retarray,
   index_type dim;
 
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
 #ifdef HAVE_BACK_ARG
       maxloc1_16_s4 (retarray, array, pdim, back, string_len);