Skip to content

Fix StringRef comparisons with embedded nulls - #3259

Open
yss25 wants to merge 1 commit into
catchorg:develfrom
yss25:codex/fix-stringref-embedded-null-comparison
Open

yss25 wants to merge 1 commit into
catchorg:develfrom
yss25:codex/fix-stringref-embedded-null-comparison

Conversation

@yss25

@yss25 yss25 commented Dec 2, 2026 •

Copy link
Copy Markdown

Description

StringRef ordering stops at an embedded null, while equality compares all bytes. A std::set therefore treats "a\0b"_sr and "a\0c"_sr as the same key. Use memcmp so ordering and equality agree.

The regression fails before the fix. StringRef tests and all 82 basic-tests CTest entries pass on Windows x64, MSVC 19.44, C++14 Debug.

GitHub Issues

No linked issue.

Codex assisted with investigation, implementation, and local testing.

@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.43%. Comparing base (35d9807) to head (b97528c).

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #3259   +/-   ##
=======================================
  Coverage   91.43%   91.43%           
=======================================
  Files         205      205           
  Lines        9108     9108           
=======================================
  Hits         8327     8327           
  Misses        781      781           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant