/* Special implementation of the SPREAD intrinsic
- Copyright (C) 2008-2014 Free Software Foundation, Inc.
+ Copyright (C) 2008-2015 Free Software Foundation, Inc.
Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
spread_generic.c written by Paul Brook <paul@nowt.org>
}
ret->offset = 0;
- /* xmalloc allocates a single byte for zero size. */
- ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_8));
+ /* xmallocarray allocates a single byte for zero size. */
+ ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_8));
if (rs <= 0)
return;
}
if (ret->base_addr == NULL)
{
- ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_8));
+ ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_8));
ret->offset = 0;
GFC_DIMENSION_SET(ret->dim[0], 0, ncopies - 1, 1);
}