diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2022-03-16 11:59:28 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2022-03-16 11:59:28 +0000 |
| commit | d9ca4eb4d655f31f3bf672a56c4390190d85d841 (patch) | |
| tree | 2df7feab961aeb149921ad8d19f80aca705d1914 | |
| parent | 5534c031b3aae616af442703a71e6aa6951452d7 (diff) | |
Add nil check on ast.walk
| -rw-r--r-- | core/odin/ast/walk.odin | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/odin/ast/walk.odin b/core/odin/ast/walk.odin index 7241d283f..b4eaf8140 100644 --- a/core/odin/ast/walk.odin +++ b/core/odin/ast/walk.odin @@ -52,8 +52,11 @@ walk :: proc(v: ^Visitor, node: ^Node) { } } - v := v + if v == nil || node == nil { + return + } + if v = v->visit(node); v == nil { return } |