mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
stage2: fix bug where a parser error would break errors
A parser error would deinit the tree, but the tree is needed for the node locations. This removes the offending code written before node locations.
This commit is contained in:
parent
99ec511c4c
commit
0f105ea324
@ -3219,9 +3219,7 @@ pub fn getAstTree(mod: *Module, root_scope: *Scope.File) !*const ast.Tree {
|
||||
|
||||
const source = try root_scope.getSource(mod);
|
||||
|
||||
var keep_tree = false;
|
||||
root_scope.tree = try std.zig.parse(mod.gpa, source);
|
||||
defer if (!keep_tree) root_scope.tree.deinit(mod.gpa);
|
||||
|
||||
const tree = &root_scope.tree;
|
||||
|
||||
@ -3249,7 +3247,6 @@ pub fn getAstTree(mod: *Module, root_scope: *Scope.File) !*const ast.Tree {
|
||||
}
|
||||
|
||||
root_scope.status = .loaded_success;
|
||||
keep_tree = true;
|
||||
|
||||
return tree;
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user