Skip to content

Conversation

@DHowett
Copy link
Member

@DHowett DHowett commented Mar 24, 2021

This commit clarifies some things inside WriteCharsLegacy by adding
comments and renaming parameter and enum names. It does not change any
logic.

WC_ECHO was used extensively to mean only one thing: whether to print
a control character like \x18 (Ctrl+X) as ^X. It's been
renamed to make that abundantly clear.

DHowett added 2 commits March 24, 2021 14:59
WC_ECHO only gates whether a control character Ctrl+X is rendered as
"^X" or acted upon.
@DHowett DHowett requested review from miniksa and zadjii-msft March 24, 2021 20:01
Comment on lines +524 to +527
// WCL-NOTE: We should never hit this.
// WCL-NOTE: 1. Normal characters are handled via the early check for IS_GLYPH_CHAR
// WCL-NOTE: 2. Control characters are handled via the CtrlChar label (if WC_PRINTABLE_CONTROL_CHARS is on)
// WCL-NOTE: And if they are control characters they will trigger the C1_CNTRL check above.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was observed by fuzzing for ~10 minutes with WC_PRINTABLE_CONTROL_CHARS on or off.

@DHowett
Copy link
Member Author

DHowett commented Mar 24, 2021

Since @j4james has touched this code, this mention is advisory.

I've been fuzzing WriteCharsLegacy and using it as a way to generate inputs that satisfy every branch in this function. 😁

Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff. Normally I'd nag for GH: ID for the bits that are now documented as known wrong... but there's honestly no point. So let's do this.

@DHowett
Copy link
Member Author

DHowett commented Mar 24, 2021

The SA failure is a checkout failure, not a build failure. This passes SA as it it does not change any code.

@DHowett DHowett merged commit da1e1a6 into main Mar 24, 2021
@DHowett DHowett deleted the dev/duhowett/wcl-comments branch March 24, 2021 21:26
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.

4 participants