From 0f105ea3249068441a94c0e783b3ca27a06a783b Mon Sep 17 00:00:00 2001 From: jacob gw Date: Tue, 6 Apr 2021 19:56:54 -0400 Subject: 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. --- src/Module.zig | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/Module.zig') diff --git a/src/Module.zig b/src/Module.zig index 933917d948..3c17a52cc8 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -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; }, -- cgit v1.2.3