summaryrefslogtreecommitdiff
path: root/py/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/parse.c')
-rw-r--r--py/parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/parse.c b/py/parse.c
index 8c51b0349..f7fe30418 100644
--- a/py/parse.c
+++ b/py/parse.c
@@ -417,7 +417,7 @@ STATIC void push_result_token(parser_t *parser, const rule_t *rule) {
pn = mp_parse_node_new_leaf(lex->tok_kind == MP_TOKEN_STRING ? MP_PARSE_NODE_STRING : MP_PARSE_NODE_BYTES, qst);
} else {
// not interned, make a node holding a pointer to the string/bytes object
- mp_obj_t o = mp_obj_new_str_of_type(
+ mp_obj_t o = mp_obj_new_str_copy(
lex->tok_kind == MP_TOKEN_STRING ? &mp_type_str : &mp_type_bytes,
(const byte*)lex->vstr.buf, lex->vstr.len);
pn = make_node_const_object(parser, lex->tok_line, o);