Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 873582e

Browse files
committed
Merge pull request #968 from jsquyres/pr/v2.0.0/type-attr-fix
v2.0.0: fix MPI_TYPE_SET_ATTR with NULL value
2 parents b763687 + 4465687 commit 873582e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ompi/mpi/c/type_set_attr.c

Lines changed: 6 additions & 8 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,
@@ -48,14 +48,12 @@ int MPI_Type_set_attr (MPI_Datatype type,
4848
memchecker_datatype(type);
4949
);
5050

51-
if (MPI_PARAM_CHECK) {
52-
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
53-
if (NULL == type || MPI_DATATYPE_NULL == type) {
54-
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
55-
} else if (NULL == attribute_val) {
56-
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
51+
if (MPI_PARAM_CHECK) {
52+
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
53+
if (NULL == type || MPI_DATATYPE_NULL == type) {
54+
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
55+
}
5756
}
58-
}
5957

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

0 commit comments

Comments
 (0)