]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/maxloc0_16_i16.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / maxloc0_16_i16.c
index f3cfd9deb9292e1b9040e02469ec51ba0b59511d..8de56ac65d019cf43882a64625d49b3e118db1fc 100644 (file)
@@ -198,6 +198,13 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray,
   index_type n;
   int mask_kind;
 
+
+  if (mask == NULL)
+    {
+      maxloc0_16_i16 (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_16_i16 (gfc_array_i16 * const restrict retarray,
   index_type n;
   GFC_INTEGER_16 *dest;
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
       maxloc0_16_i16 (retarray, array, back);
       return;