/* Specific implementation of the UNPACK intrinsic
- Copyright 2008, 2009, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2021 Free Software Foundation, Inc.
Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
unpack_generic.c by Paul Brook <paul@nowt.org>.
<http://www.gnu.org/licenses/>. */
#include "libgfortran.h"
-#include <stdlib.h>
-#include <assert.h>
#include <string.h>
else
runtime_error ("Funny sized logical array");
+ /* Initialize to avoid -Wmaybe-uninitialized complaints. */
+ rstride[0] = 1;
if (ret->base_addr == NULL)
{
/* The front end has signalled that we need to populate the
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = internal_malloc_size (rs * sizeof (GFC_COMPLEX_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
}
else
{
else
runtime_error ("Funny sized logical array");
+ /* Initialize to avoid -Wmaybe-uninitialized complaints. */
+ rstride[0] = 1;
if (ret->base_addr == NULL)
{
/* The front end has signalled that we need to populate the
rs *= extent[n];
}
ret->offset = 0;
- ret->base_addr = internal_malloc_size (rs * sizeof (GFC_COMPLEX_16));
+ ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
}
else
{