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

@@ -22,7 +22,7 @@ pub const inlay_hints_max_inline_children = 12;
/// checks whether node is inside the range
fn isNodeInRange(tree: Ast, node: Ast.Node.Index, range: types.Range) bool {
const endLocation = tree.tokenLocation(0, tree.lastToken(node));
const endLocation = tree.tokenLocation(0, ast.lastToken(tree, node));
if (endLocation.line < range.start.line) return false;
const beginLocation = tree.tokenLocation(0, tree.firstToken(node));