Skip to content

Commit

Permalink
Try fixing the failure
Browse files Browse the repository at this point in the history
`Expansion::advance()` can increase its offset beyond the size,
so I don't think this assumption was valid in the first place;
`BufferedContent::advance()` should be able to as well.
  • Loading branch information
Rangi42 committed Jan 28, 2025
1 parent ac52554 commit 2c3b78b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/asm/lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,9 @@ void BufferedContent::advance() {
if (offset == std::size(buf)) {
offset = 0; // Wrap around if necessary
}
assume(size > 0);
size--;
if (size > 0) {
size--;
}
}

void BufferedContent::refill() {
Expand Down

0 comments on commit 2c3b78b

Please sign in to comment.