diff options
| author | jacob gw <jacoblevgw@gmail.com> | 2021-04-06 19:56:54 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-04-08 23:17:36 -0700 |
| commit | 0f105ea3249068441a94c0e783b3ca27a06a783b (patch) | |
| tree | ff7d8a7ae182e7c6c62ddaf93843f7d19eb20d75 /src/Module.zig | |
| parent | 99ec511c4c62d22c88a57395e169948140c5b712 (diff) | |
| download | zig-0f105ea3249068441a94c0e783b3ca27a06a783b.tar.gz zig-0f105ea3249068441a94c0e783b3ca27a06a783b.zip | |
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.
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 3 |
1 files changed, 0 insertions, 3 deletions
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; }, |
