summaryrefslogtreecommitdiff
path: root/py/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/parse.c')
-rw-r--r--py/parse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/parse.c b/py/parse.c
index 54be8b97d..1392303e6 100644
--- a/py/parse.c
+++ b/py/parse.c
@@ -1386,6 +1386,7 @@ void mp_parse_tree_clear(mp_parse_tree_t *tree) {
m_del(byte, chunk, sizeof(mp_parse_chunk_t) + chunk->alloc);
chunk = next;
}
+ tree->chunk = NULL; // Avoid dangling pointer that may live on stack
}
#endif // MICROPY_ENABLE_COMPILER