Skip to content

Return false for non-whitespace Unicode code points - #305

Merged
marzer merged 1 commit into
marzer:masterfrom
94xhn:fix/unicode-horizontal-whitespace-unreachable
Jul 21, 2026
Merged

Return false for non-whitespace Unicode code points#305
marzer merged 1 commit into
marzer:masterfrom
94xhn:fix/unicode-horizontal-whitespace-unreachable

Conversation

@94xhn

@94xhn 94xhn commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #295.

The horizontal-whitespace lookup can reach its default case for code points that are not whitespace. Return false there, matching the existing explicit cases, so parsing reports an input error normally.

  • Read CONTRIBUTING.md
  • Added regression cases
  • Regenerated toml.hpp
  • Rebuilt and ran tests with GCC 15.2 on Windows (55 test cases, 47782 assertions with LC_ALL=C)
  • Updated documentation (not needed)

The generated horizontal-whitespace lookup can reach its default branch for code points that are not whitespace. Returning false matches the explicit cases and allows the parser to report the input error normally. The regression covers both reported input sequences through the public parser.

Constraint: toml.hpp must be regenerated from changes under include/
Rejected: Preserve TOML_UNREACHABLE in the default branch | the branch is reachable for non-whitespace code points
Confidence: high
Scope-risk: narrow
Directive: Regenerate toml.hpp whenever the source headers change
Tested: GCC 15 static Meson build; 55 Catch2 cases / 47782 assertions with LC_ALL=C; source and single-header public API regression
Not-tested: Non-C Windows locale variants are unavailable locally; official single-header CI wrapper requires a missing py Python 3 launcher
@marzer

marzer commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Nice, thanks!

@marzer
marzer merged commit 1e8829b into marzer:master Jul 21, 2026
15 checks passed
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.

Malformed UTF-8 input triggers undefined behavior in unicode_autogenerated.hpp

2 participants