From 1905f35a1e64a23b1e34a5fc46db09a1b0bda684 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Wed, 21 Jan 2015 15:53:43 +0100 Subject: [PATCH] hwloc: bitmap: fix a corner case in hwloc_bitmap_isincluded() with infinite sets If super_set contains more allocated ulongs than sub_set, we did not check the last ulongs. We would return true instead of false when sub_set is infinite while the last ulongs in super_set are not full. This fixes tests/hwloc_bitmap_compare_inclusion on some platforms. (cherry picked from commit open-mpi/hwloc@299e6e846f1d00930607d5d6d120174024f576e7) Signed-off-by: Jeff Squyres --- opal/mca/hwloc/hwloc191/hwloc/src/bitmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opal/mca/hwloc/hwloc191/hwloc/src/bitmap.c b/opal/mca/hwloc/hwloc191/hwloc/src/bitmap.c index 39f4dbfe3a..2fc3b831e3 100644 --- a/opal/mca/hwloc/hwloc191/hwloc/src/bitmap.c +++ b/opal/mca/hwloc/hwloc191/hwloc/src/bitmap.c @@ -1,6 +1,6 @@ /* * Copyright © 2009 CNRS - * Copyright © 2009-2011 inria. All rights reserved. + * Copyright © 2009-2015 Inria. All rights reserved. * Copyright © 2009-2011 Université Bordeaux 1 * Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. @@ -903,7 +903,7 @@ int hwloc_bitmap_isincluded (const struct hwloc_bitmap_s *sub_set, const struct HWLOC__BITMAP_CHECK(sub_set); HWLOC__BITMAP_CHECK(super_set); - for(i=0; iulongs_count; i++) + for(i=0; iulongs_count || iulongs_count; i++) if (HWLOC_SUBBITMAP_READULONG(super_set, i) != (HWLOC_SUBBITMAP_READULONG(super_set, i) | HWLOC_SUBBITMAP_READULONG(sub_set, i))) return 0;