Fixed integer overflow in semantic_tokens.Builder.handleComments

This commit is contained in:
Alexandros Naskos
2021-05-03 15:36:29 +03:00
parent ab8c65eeda
commit 91643c04c9
3 changed files with 6 additions and 4 deletions

View File

@@ -136,6 +136,9 @@ const Builder = struct {
/// Highlight normal comments and doc comments.
fn handleComments(self: *Builder, from: usize, to: usize) !void {
if (from == to) return;
std.debug.assert(from < to);
const source = self.handle.tree.source;
var i: usize = from;