fix crashes found through fuzzing (#866)

This commit is contained in:
Techatrix
2022-12-30 23:42:28 +00:00
committed by GitHub
parent c88562ca78
commit f473088b64
6 changed files with 23 additions and 16 deletions

View File

@@ -289,7 +289,7 @@ fn writeNodeTokens(builder: *Builder, maybe_node: ?Ast.Node.Index) WriteTokensEr
const token_tags = tree.tokens.items(.tag);
const node_data = tree.nodes.items(.data);
const main_tokens = tree.nodes.items(.main_token);
if (node == 0 or node > node_data.len) return;
if (node == 0 or node >= node_data.len) return;
var allocator = builder.arena.allocator();