Skip to content

Build a String from a view by data(), not c_str() - #25

Merged
Force67 merged 2 commits into
devel5from
fix/string-from-view-no-cstr
Sep 27, 2026
Merged

Force67 merged 2 commits into
devel5from
fix/string-from-view-no-cstr

Conversation

@Force67

@Force67 Force67 commented Sep 27, 2026

Copy link
Copy Markdown
Owner

String(const StringRef&) went through the HasStringTraits constructor, which copied via c_str(); a StringRef slice is not null-terminated, so Debug builds trapped (rx's vfs hit it on every mount point). New test ConstructsFromAnUnterminatedSlice; 1052 base tests pass in Debug.

A StringRef satisfies HasStringTraits, so it took the c_str() constructor, and
a slice of a longer string is not null-terminated: debug builds trapped. rx's
vfs hit it on every mount point.
@Force67
Force67 merged commit daed7ca into devel5 Sep 27, 2026
6 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.

1 participant