/* Implementation of the FINDLOC intrinsic
- Copyright (C) 2018 Free Software Foundation, Inc.
+ Copyright (C) 2018-2020 Free Software Foundation, Inc.
Contributed by Thomas König <tk@tkoenig.net>
This file is part of the GNU Fortran 95 runtime library (libgfortran).
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype.rank = 1;
retarray->offset = 0;
- retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
+ retarray->base_addr = xmallocarray (rank, sizeof (index_type));
}
else
{
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype.rank = 1;
retarray->offset = 0;
- retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
+ retarray->base_addr = xmallocarray (rank, sizeof (index_type));
}
else
{
index_type * restrict dest;
index_type n;
- if (*mask)
+ if (mask == NULL || *mask)
{
findloc0_r4 (retarray, array, value, back);
return;
GFC_DIMENSION_SET(retarray->dim[0], 0, rank-1, 1);
retarray->dtype.rank = 1;
retarray->offset = 0;
- retarray->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_4));
+ retarray->base_addr = xmallocarray (rank, sizeof (index_type));
}
else if (unlikely (compile_options.bounds_check))
{