]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/m4/eoshift1.m4
Introduce xmallocarray, an overflow checking variant of xmalloc.
[thirdparty/gcc.git] / libgfortran / m4 / eoshift1.m4
index c373afe4b6b2a780ad42227c76937d703a5bc074..df785ecdc20f7f4281c03fd4cc83cc688a089ee6 100644 (file)
@@ -106,8 +106,8 @@ eoshift1 (gfc_array_char * const restrict ret,
          GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
 
         }
-      /* xmalloc allocates a single byte for zero size.  */
-      ret->base_addr = xmalloc (size * arraysize);
+      /* xmallocarray allocates a single byte for zero size.  */
+      ret->base_addr = xmallocarray (arraysize, size);
 
     }
   else if (unlikely (compile_options.bounds_check))