diff --git a/lang/ast/iterate.c b/lang/ast/iterate.c index 1248409..2c95801 100644 --- a/lang/ast/iterate.c +++ b/lang/ast/iterate.c @@ -15,6 +15,11 @@ enum ivy_status ivy_ast_node_iterate( struct ivy_ast_node_iterator_entry *it_entry = b_unbox(struct ivy_ast_node_iterator_entry, entry, it_entry); node = b_unbox(struct ivy_ast_node, it_entry, n_it); + if (!node) { + /* this should never happen. */ + return IVY_ERR_INTERNAL_FAILURE; + } + enum ivy_status status = callback(node, it); if (status != IVY_OK) { return status;