authorgravatar for jacoblevgw@gmail.comJacob G-W <jacoblevgw@gmail.com> 2021-04-06 19:56:54-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-08 23:17:36-07:00
log0f105ea3249068441a94c0e783b3ca27a06a783b
treeff7d8a7ae182e7c6c62ddaf93843f7d19eb20d75
parent99ec511c4c62d22c88a57395e169948140c5b712

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.

1 files changed, 0 insertions(+), 3 deletions(-)

src/Module.zig-3
......@@ -3219,9 +3219,7 @@ pub fn getAstTree(mod: *Module, root_scope: *Scope.File) !*const ast.Tree {
32193219
32203220 const source = try root_scope.getSource(mod);
32213221
3222 var keep_tree = false;
32233222 root_scope.tree = try std.zig.parse(mod.gpa, source);
3224 defer if (!keep_tree) root_scope.tree.deinit(mod.gpa);
32253223
32263224 const tree = &root_scope.tree;
32273225
......@@ -3249,7 +3247,6 @@ pub fn getAstTree(mod: *Module, root_scope: *Scope.File) !*const ast.Tree {
32493247 }
32503248
32513249 root_scope.status = .loaded_success;
3252 keep_tree = true;
32533250
32543251 return tree;
32553252 },