]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/intrinsics/cshift0.c
Introduce xmallocarray, an overflow checking variant of xmalloc.
[thirdparty/gcc.git] / libgfortran / intrinsics / cshift0.c
index 12f8289274ac5ac2afa32a4f276bc7095b50e844..f983754f16a5f328d7016e6bc4b059fb6644c63b 100644 (file)
@@ -79,8 +79,8 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array,
          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))
     {