diff options
Diffstat (limited to 'libgfortran/generated/spread_r4.c')
-rw-r--r-- | libgfortran/generated/spread_r4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libgfortran/generated/spread_r4.c b/libgfortran/generated/spread_r4.c index faa619e882b..a3f9b48a693 100644 --- a/libgfortran/generated/spread_r4.c +++ b/libgfortran/generated/spread_r4.c @@ -102,8 +102,8 @@ spread_r4 (gfc_array_r4 *ret, const gfc_array_r4 *source, } ret->offset = 0; - /* xmalloc allocates a single byte for zero size. */ - ret->base_addr = xmalloc (rs * sizeof(GFC_REAL_4)); + /* xmallocarray allocates a single byte for zero size. */ + ret->base_addr = xmallocarray (rs, sizeof(GFC_REAL_4)); if (rs <= 0) return; } @@ -245,7 +245,7 @@ spread_scalar_r4 (gfc_array_r4 *ret, const GFC_REAL_4 *source, if (ret->base_addr == NULL) { - ret->base_addr = xmalloc (ncopies * sizeof (GFC_REAL_4)); + ret->base_addr = xmallocarray (ncopies, sizeof (GFC_REAL_4)); ret->offset = 0; GFC_DIMENSION_SET(ret->dim[0], 0, ncopies, sizeof (GFC_REAL_4)); } |