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