]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/maxloc0_16_s4.c
re PR fortran/82995 (Segmentation fault passing optional argument to intrinsic sum...
[thirdparty/gcc.git] / libgfortran / generated / maxloc0_16_s4.c
index dc16503aec0dd31026a43ca1dfadc1517218b866..b26fb68c3e06a64e8beaeee8e6c12f4fb120210f 100644 (file)
@@ -174,6 +174,16 @@ mmaxloc0_16_s4 (gfc_array_i16 * const restrict retarray,
   index_type n;
   int mask_kind;
 
+  if (mask == NULL)
+    {
+#ifdef HAVE_BACK_ARG    
+      maxloc0_16_s4 (retarray, array, back, len);
+#else
+      maxloc0_16_s4 (retarray, array, len);
+#endif
+      return;
+    }
+
   rank = GFC_DESCRIPTOR_RANK (array);
   if (rank <= 0)
     runtime_error ("Rank of array needs to be > 0");
@@ -304,7 +314,7 @@ smaxloc0_16_s4 (gfc_array_i16 * const restrict retarray,
   index_type n;
   GFC_INTEGER_16 *dest;
 
-  if (*mask)
+  if (mask == NULL || *mask)
     {
 #ifdef HAVE_BACK_ARG    
       maxloc0_16_s4 (retarray, array, back, len);