Repository navigation
Escape disallowed C0 controls in forced scalar styles - #1508
Closed
himanshu748 wants to merge 1 commit into
Closed
himanshu748 wants to merge 1 commit into
himanshu748 wants to merge 1 commit into
Conversation
himanshu748
marked this pull request as ready for review
October 8, 2026 12:58
Owner
|
👀🤖 |
Collaborator
|
@jbeder : I would like to reject this type of PR. Its a first time contributer which clearly just handed in some AI generated output. The PR text has no polishing and way to much information and I (and believe the same is valid for you) dont have the time to review this. |
Owner
|
Totally reasonable! |
Author
|
Thanks for the feedback. I asked my cloud agent to work on the ByteAsk challenge, and it prepared and opened this PR with my approval. I’m withdrawing it. If you’re open to a revised version, I’m happy to address the concerns and make it easier to review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1506.
Forced
SingleQuotedandLiteralstyles currently accept disallowed C0 control bytes and emit them raw. Reject those bytes during style selection so the existing double-quoted writer escapes them. TAB stays valid in both styles, LF stays valid in Literal, and the existing CR and flow-context fallbacks are preserved. The unsigned-byte comparison keeps UTF-8 bytes from being mistaken for C0 controls.Five tests cover all 29 disallowed C0 values in both styles, exact escaping and length-aware round trips, permitted whitespace and Unicode,
EscapeNonAscii, and Literal in a flow sequence. The regressions fail against the original emitter implementation and pass with this change.Validation on Linux with GCC 14.2:
git diff --checkpass.DEL/C1 and broader Unicode printability are outside this change. Leak detection was disabled because LeakSanitizer cannot run under this container's ptrace restriction. Windows, macOS, and Bazel were not run locally.