1
1

memchecker.h: fix memchecker no-data case

Thanks to @clintonstimpson for reporting the issue.

Fixes open-mpi/ompi#100

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
Jeff Squyres 2016-02-18 10:46:10 -08:00
родитель 142e38cbb2
Коммит 7b73c868d5

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

@ -10,6 +10,7 @@
* and Technology (RIST). All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved.
*
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -100,6 +101,10 @@ static inline int memchecker_call (int (*f)(void *, size_t), const void * addr,
return OMPI_SUCCESS;
}
if ((0 == count) || (0 == datatype->super.size)) {
return OMPI_SUCCESS;
}
if( datatype->super.size == (size_t) (datatype->super.true_ub - datatype->super.true_lb) ) {
/* We have a contiguous type. */
f( (void*)addr , datatype->super.size * count );