Skip to content

Fix OOB errors in the lexer#8734

Merged
tlively merged 1 commit into
mainfrom
fix-8732
May 20, 2026
Merged

Fix OOB errors in the lexer#8734
tlively merged 1 commit into
mainfrom
fix-8732

Conversation

@tlively
Copy link
Copy Markdown
Member

@tlively tlively commented May 20, 2026

Fix an OOB string_view access that was just trying to get a one-past-the-end pointer. Fix two locations where we could have been peeking empty input.

Fixes #8732.

Fix an OOB string_view access that was just trying to get a one-past-the-end pointer. Fix two locations where we could have been peeking empty input.

Fixes #8732.
@tlively tlively requested a review from a team as a code owner May 20, 2026 18:52
@tlively tlively requested review from stevenfontanella and removed request for a team May 20, 2026 18:52
Comment thread src/parser/lexer.h
if (empty()) {
return NoSign;
}
auto c = peek();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make peek return optional so that future callers know to check if they hit the end of the buffer?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I did that in #8737 as a follow-up because the diff for that change swamps the diff for fixing these bugs.

@sertonix
Copy link
Copy Markdown
Contributor

Fixes the tests in my case

@tlively tlively merged commit f3e1008 into main May 20, 2026
16 checks passed
@tlively tlively deleted the fix-8732 branch May 20, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

glibcxx assertion in test suite since lexter simplification

3 participants