1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vast: fix segfault for fn main() { $compile_warn("WARN") }

This commit is contained in:
Delyan Angelov 2023-06-14 13:59:48 +03:00
parent 23da2128d5
commit cb5d5f8ca5
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -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()