From 7b73c868d5672d3327ec35f840fc807a49ba083b Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 18 Feb 2016 10:46:10 -0800 Subject: [PATCH] memchecker.h: fix memchecker no-data case Thanks to @clintonstimpson for reporting the issue. Fixes open-mpi/ompi#100 Signed-off-by: Jeff Squyres --- ompi/include/ompi/memchecker.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ompi/include/ompi/memchecker.h b/ompi/include/ompi/memchecker.h index 6ba22e6016..ef59948137 100644 --- a/ompi/include/ompi/memchecker.h +++ b/ompi/include/ompi/memchecker.h @@ -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 );