diff options
Diffstat (limited to 'libgfortran/generated/spread_i1.c')
-rw-r--r-- | libgfortran/generated/spread_i1.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libgfortran/generated/spread_i1.c b/libgfortran/generated/spread_i1.c index e002c14..111c4cc 100644 --- a/libgfortran/generated/spread_i1.c +++ b/libgfortran/generated/spread_i1.c @@ -100,13 +100,11 @@ spread_i1 (gfc_array_i1 *ret, const gfc_array_i1 *source, GFC_DIMENSION_SET(ret->dim[n], 0, ub, stride); } ret->offset = 0; - if (rs > 0) - ret->data = internal_malloc_size (rs * sizeof(GFC_INTEGER_1)); - else - { - ret->data = internal_malloc_size (1); - return; - } + + /* internal_malloc_size allocates a single byte for zero size. */ + ret->data = internal_malloc_size (rs * sizeof(GFC_INTEGER_1)); + if (rs <= 0) + return; } else { |