lang: ast: add nullptr check to ivy_ast_node_iterate
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user