Skip to content

Commit b3d8254

Browse files
committed
Fix zeroindexing on token positions
1 parent 35ca1a5 commit b3d8254

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/AsmParser/LLLexer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,14 @@ lltok::Kind LLLexer::LexToken() {
207207
// exclusive
208208
std::tie(PrevTokEndLineNum, PrevTokEndColNum) =
209209
SM.getLineAndColumn(SMLoc::getFromPointer(CurPtr));
210+
--PrevTokEndLineNum;
211+
--PrevTokEndColNum;
210212
while (true) {
211213
TokStart = CurPtr;
212214
std::tie(CurTokLineNum, CurTokColNum) =
213215
SM.getLineAndColumn(SMLoc::getFromPointer(CurPtr));
216+
--CurTokLineNum;
217+
--CurTokColNum;
214218
int CurChar = getNextChar();
215219

216220
switch (CurChar) {

0 commit comments

Comments
 (0)