Skip to content

Commit e31e8b9

Browse files
author
Ralph Castain
authored
Merge pull request #3751 from rhc54/topic/size
Correctly transfer size_t data fields
2 parents 7b0653a + ef56c7d commit e31e8b9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

opal/mca/pmix/ext2x/pmix2x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ void ext2x_value_load(pmix_value_t *v,
685685
break;
686686
case OPAL_SIZE:
687687
v->type = PMIX_SIZE;
688-
v->data.size = (size_t)kv->data.size;
688+
memcpy(&(v->data.size), &kv->data.size, sizeof(size_t));
689689
break;
690690
case OPAL_PID:
691691
v->type = PMIX_PID;
@@ -856,7 +856,7 @@ int ext2x_value_unload(opal_value_t *kv,
856856
break;
857857
case PMIX_SIZE:
858858
kv->type = OPAL_SIZE;
859-
kv->data.size = (int)v->data.size;
859+
memcpy(&kv->data.size, &(v->data.size), sizeof(size_t));
860860
break;
861861
case PMIX_PID:
862862
kv->type = OPAL_PID;

opal/mca/pmix/pmix2x/pmix2x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ void pmix2x_value_load(pmix_value_t *v,
685685
break;
686686
case OPAL_SIZE:
687687
v->type = PMIX_SIZE;
688-
v->data.size = (size_t)kv->data.size;
688+
memcpy(&(v->data.size), &kv->data.size, sizeof(size_t));
689689
break;
690690
case OPAL_PID:
691691
v->type = PMIX_PID;
@@ -856,7 +856,7 @@ int pmix2x_value_unload(opal_value_t *kv,
856856
break;
857857
case PMIX_SIZE:
858858
kv->type = OPAL_SIZE;
859-
kv->data.size = (int)v->data.size;
859+
memcpy(&kv->data.size, &(v->data.size), sizeof(size_t));
860860
break;
861861
case PMIX_PID:
862862
kv->type = OPAL_PID;

0 commit comments

Comments
 (0)