offsets: fix integer overflow
This commit is contained in:
parent
39b0f50bda
commit
f5b4fc2aea
@ -81,7 +81,7 @@ pub fn tokenRelativeLocation(tree: *std.zig.ast.Tree, start_index: usize, token:
|
|||||||
const token_start = token_loc.start;
|
const token_start = token_loc.start;
|
||||||
const source = tree.source[start_index..];
|
const source = tree.source[start_index..];
|
||||||
var i: usize = 0;
|
var i: usize = 0;
|
||||||
while (i < token_start - start_index) {
|
while (i + start_index < token_start) {
|
||||||
const c = source[i];
|
const c = source[i];
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
loc.line += 1;
|
loc.line += 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user