From 2c3b78b1259502ece606f7f687fa504f496d294c Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Tue, 28 Jan 2025 14:29:14 -0500 Subject: [PATCH] Try fixing the failure `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. --- src/asm/lexer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/asm/lexer.cpp b/src/asm/lexer.cpp index 0911273ad..3027baf7d 100644 --- a/src/asm/lexer.cpp +++ b/src/asm/lexer.cpp @@ -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() {