diff options
Diffstat (limited to 'libgfortran/generated/reshape_r8.c')
-rw-r--r-- | libgfortran/generated/reshape_r8.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libgfortran/generated/reshape_r8.c b/libgfortran/generated/reshape_r8.c index 9700a586104..08888a8ad8e 100644 --- a/libgfortran/generated/reshape_r8.c +++ b/libgfortran/generated/reshape_r8.c @@ -111,11 +111,11 @@ reshape_r8 (gfc_array_r8 * const restrict ret, ret->offset = 0; if (unlikely (rs < 1)) - alloc_size = 1; + alloc_size = 0; else - alloc_size = rs * sizeof (GFC_REAL_8); + alloc_size = rs; - ret->base_addr = xmalloc (alloc_size); + ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8)); ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim; } |