Skip to content

Commit c600d8a

Browse files
committed
FIX: Key words of MAP normalized to SET-WORDS
Fixes: metaeducation/rebol-issues#2354
1 parent 5973f48 commit c600d8a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/core/t-map.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,16 @@
229229
}
230230

231231
// Create new entry:
232-
Append_Val(series, key);
232+
// append key
233+
if(ANY_WORD(key) && VAL_TYPE(key) != REB_SET_WORD) {
234+
// Normalize the KEY (word) to be a SET-WORD
235+
REBVAL *set = Append_Value(series);
236+
*set = *key;
237+
VAL_SET(set, REB_SET_WORD);
238+
} else {
239+
Append_Val(series, key);
240+
}
241+
// append value
233242
Append_Val(series, val); // no Copy_Series_Value(val) on strings
234243

235244
return (hashes[hash] = series->tail/2);

0 commit comments

Comments
 (0)