1
1

Because of r12712, we actually need to allocate one ''more'' item than

the value of __n holds.  This is not a problem in the first case
because sizeof(int) == sizeof(MPI_Flogical), so no alloc is actually
performed (which is most compilers, and why we haven't been bitten by
this yet).  But the second case -- where sizeof(int) !=
sizeof(MPI_Flogical) -- is definitely a problem and needs the "+1" in
the alloc, or Bad Things will happen.

This commit was SVN r12953.

The following SVN revision numbers were found above:
  r12712 --> open-mpi/ompi@3e11c76d4c
Этот коммит содержится в:
Jeff Squyres 2007-01-02 16:16:29 +00:00
родитель 90f5e3fad8
Коммит ea2d49e55d

Просмотреть файл

@ -168,7 +168,7 @@
# define OMPI_SINGLE_INT_2_LOGICAL(a) *a=OMPI_INT_2_LOGICAL(OMPI_LOGICAL_NAME_CONVERT(*a))
# define OMPI_ARRAY_LOGICAL_2_INT(in, n) do { \
int __n = (n) - 1; \
OMPI_ARRAY_LOGICAL_2_INT_ALLOC(in, __n); \
OMPI_ARRAY_LOGICAL_2_INT_ALLOC(in, __n + 1); \
while (__n >= 0) { \
OMPI_LOGICAL_ARRAY_NAME_CONVERT(in)[__n]=OMPI_LOGICAL_2_INT(in[__n]); \
__n--; \
@ -210,7 +210,7 @@
# endif
# define OMPI_ARRAY_LOGICAL_2_INT(in, n) do { \
int __n = (n) - 1; \
OMPI_ARRAY_LOGICAL_2_INT_ALLOC(in, __n); \
OMPI_ARRAY_LOGICAL_2_INT_ALLOC(in, __n + 1); \
while (__n >= 0) { \
OMPI_LOGICAL_ARRAY_NAME_CONVERT(in)[__n]=OMPI_LOGICAL_2_INT(in[__n]); \
__n--; \