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 {...@@ -3219,9 +3219,7 @@ pub fn getAstTree(mod: *Module, root_scope: *Scope.File) !*const ast.Tree {
32193219
3220 const source = try root_scope.getSource(mod);3220 const source = try root_scope.getSource(mod);
32213221
3222 var keep_tree = false;
3223 root_scope.tree = try std.zig.parse(mod.gpa, source);3222 root_scope.tree = try std.zig.parse(mod.gpa, source);
3224 defer if (!keep_tree) root_scope.tree.deinit(mod.gpa);
32253223
3226 const tree = &root_scope.tree;3224 const tree = &root_scope.tree;
32273225
...@@ -3249,7 +3247,6 @@ pub fn getAstTree(mod: *Module, root_scope: *Scope.File) !*const ast.Tree {...@@ -3249,7 +3247,6 @@ pub fn getAstTree(mod: *Module, root_scope: *Scope.File) !*const ast.Tree {
3249 }3247 }
32503248
3251 root_scope.status = .loaded_success;3249 root_scope.status = .loaded_success;
3252 keep_tree = true;
32533250
3254 return tree;3251 return tree;
3255 },3252 },