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