fix: "f..o.o;" crashes the server (#629)

this is a fix for #381 and a hack for #409
(related, get triggered by "f..o.o;")
This commit is contained in:
nullptrdevs
2022-09-07 10:14:11 -07:00
committed by GitHub
parent aa81d83136
commit 6269eef776
5 changed files with 30 additions and 6 deletions

View File

@@ -854,7 +854,7 @@ fn writeNodeTokens(builder: *Builder, arena: *std.heap.ArenaAllocator, store: *D
.field_access => {
const data = node_data[node];
if (data.rhs == 0) return;
const rhs_str = tree.tokenSlice(data.rhs);
const rhs_str = ast.tokenSlice(tree, data.rhs) catch return;
try await @asyncCall(child_frame, {}, writeNodeTokens, .{ builder, arena, store, data.lhs });