Skip to content

Commit 73404fd

Browse files
committed
MCA/base: Detect overlapping variable names.
Signed-off-by: Nathan Hjelm <[email protected]>
1 parent e7bea27 commit 73404fd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

opal/mca/base/mca_base_var.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ static int register_variable (const char *project_name, const char *framework_na
12021202
mca_base_var_scope_t scope, int synonym_for,
12031203
void *storage)
12041204
{
1205-
int ret, var_index, group_index;
1205+
int ret, var_index, group_index, tmp;
12061206
mca_base_var_group_t *group;
12071207
mca_base_var_t *var;
12081208

@@ -1337,6 +1337,11 @@ static int register_variable (const char *project_name, const char *framework_na
13371337
}
13381338

13391339
mca_base_var_count++;
1340+
if (0 <= var_find_by_name (var->mbv_full_name, &tmp, 0)) {
1341+
/* XXX --- FIXME: variable overshadows an existing variable. this is difficult to support */
1342+
assert (0);
1343+
}
1344+
13401345
opal_hash_table_set_value_ptr (&mca_base_var_index_hash, var->mbv_full_name, strlen (var->mbv_full_name),
13411346
(void *)(uintptr_t) var_index);
13421347
} else {

0 commit comments

Comments
 (0)