1 parent e7b8b13 commit 7dd1d6aCopy full SHA for 7dd1d6a
1 file changed
lib/utils/pyexec.c
@@ -90,6 +90,8 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
90
qstr source_name = lex->source_name;
91
mp_parse_tree_t parse_tree = mp_parse(lex, input_kind);
92
module_fun = mp_compile(&parse_tree, source_name, MP_EMIT_OPT_NONE, exec_flags & EXEC_FLAG_IS_REPL);
93
+ // Clear the parse tree because it has a heap pointer we don't need anymore.
94
+ *((uint32_t volatile*) &parse_tree.chunk) = 0;
95
#else
96
mp_raise_msg(&mp_type_RuntimeError, "script compilation not supported");
97
#endif
0 commit comments