New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop throwing exception when writing 0 length buffers #32277
Conversation
See also my comment at #31299 (comment). You may be leaving some performance on the floor given the current method implementations. |
Hi @GrabYourPitchforks. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Thanks @GrabYourPitchforks, I created #32284 to track that separately. |
* Stop throwing exception when writing 0 length buffers Fixes: #31299 * Leverage runtime checks & add test https://github.com/dotnet/runtime/blob/7938f9d9fadc3952d792329be602668bef124f23/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs#L159
* Stop throwing exception when writing 0 length buffers Fixes: #31299 * Leverage runtime checks & add test https://github.com/dotnet/runtime/blob/7938f9d9fadc3952d792329be602668bef124f23/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs#L159
## Description Update guard logic to permit writing 0 length buffers. This can happen in certain globalized scenarios (ex. `¿` with Portugese) where the first char needs to be encoded. Patch #31299 for 5.0 by cherry-picking the #32277 squash commit. ## Customer Impact Writing 0-length char buffers leads to an ArgumentOutOfRangeException. This may occur in a globalization context with certain chars such as `¿`. #31299 (comment) Also impacts Orchard: #31299 (comment) ## Regression? - [ ] Yes - [x] No [If yes, specify the version the behavior has regressed from] ## Risk - [ ] High - [ ] Medium - [x] Low Low risk as we've just updated the logic slightly to permit 0 length buffers. ## Verification - [x] Manual (required) - [x] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [x] N/A Addresses #31299
## Description Update guard logic to permit writing 0 length buffers. This can happen in certain globalized scenarios (ex. `¿` with Portugese) where the first char needs to be encoded. Patch #31299 for 3.1 by cherry-picking the #32277 squash commit. ## Customer Impact Writing 0-length char buffers leads to an ArgumentOutOfRangeException. This may occur in a globalization context with certain chars such as `¿`. #31299 (comment) Also impacts Orchard: #31299 (comment) ## Regression? - [ ] Yes - [x] No [If yes, specify the version the behavior has regressed from] ## Risk - [ ] High - [ ] Medium - [x] Low Low risk as we've just updated the logic slightly to permit 0 length buffers. ## Verification - [x] Manual (required) - [x] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [x] N/A Addresses #31299
Fixes: #31299