Skip to content

Commit d363092

Browse files
author
rhc54
committed
Merge pull request open-mpi#969 from jsquyres/pr/v1.10/type-attr-fix
v1.10: Fix MPI_TYPE_SET_ATTR with NULL value
2 parents 92a9667 + f659d80 commit d363092

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

ompi/mpi/c/type_set_attr.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5-
* Copyright (c) 2004-2005 The University of Tennessee and The University
5+
* Copyright (c) 2004-2016 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
88
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
@@ -46,17 +46,15 @@ int MPI_Type_set_attr (MPI_Datatype type,
4646
MEMCHECKER(
4747
memchecker_datatype(type);
4848
);
49-
50-
if (MPI_PARAM_CHECK) {
51-
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
52-
if (NULL == type || MPI_DATATYPE_NULL == type) {
53-
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
54-
} else if (NULL == attribute_val) {
55-
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
49+
50+
if (MPI_PARAM_CHECK) {
51+
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
52+
if (NULL == type || MPI_DATATYPE_NULL == type) {
53+
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
54+
}
5655
}
57-
}
5856

59-
OPAL_CR_ENTER_LIBRARY();
57+
OPAL_CR_ENTER_LIBRARY();
6058

6159
ret = ompi_attr_set_c(TYPE_ATTR, type, &type->d_keyhash,
6260
type_keyval, attribute_val, false);

0 commit comments

Comments
 (0)