Skip to content

Fix negative column handling in CharStream - #17247

Open
woniush wants to merge 1 commit into
argotorg:developfrom
woniush:fix/charstream-negative-column
Open

woniush wants to merge 1 commit into
argotorg:developfrom
woniush:fix/charstream-negative-column

Conversation

@woniush

@woniush woniush commented Nov 19, 2026 •

Copy link
Copy Markdown

Description

Reject negative column values in CharStream::translateLineColumnToPosition() before converting the column to size_t.

For "ABC\nDEF", (line=1, column=-1) currently returns position 3 because the unsigned addition wraps around. Negative values are invalid according to the LineColumn documentation. This PR adds a regression test for that case.

The affected function body was compiled and checked before and after the change: the result changed from 3 to std::nullopt. The full soltest suite was not run locally because Boost headers and initialized submodules are unavailable in this checkout.

Checklist

AI Disclosure

  • No AI tools were used

Signed-off-by: woniush <woniushan@yeah.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant