Skip to content

Commit

Permalink
vast: fix segfault for fn main() { $compile_warn("WARN") }
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Jun 14, 2023
1 parent 23da212 commit cb5d5f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/tools/vast/vast.v
Expand Up @@ -300,8 +300,11 @@ fn (t Tree) mod(node ast.Module) &Node {
return obj
}

fn (t Tree) scope(scope ast.Scope) &Node {
fn (t Tree) scope(scope &ast.Scope) &Node {
mut obj := new_object()
if unsafe { scope == nil } {
return obj
}
obj.add_terse('ast_type', t.string_node('Scope'))
obj.add_terse('parent', t.string_node(ptr_str(scope.parent)))
children_arr := new_array()
Expand Down

0 comments on commit cb5d5f8

Please sign in to comment.