fix: Prevent arithmetic overflow in ByteCount factory methods - #3677
fix: Prevent arithmetic overflow in ByteCount factory methods#3677wasim-builds wants to merge 4 commits into
Conversation
|
Thanks @Lukasa! I've just added the tests covering both negative values and overflow conditions to prove they behave sensibly. |
99fceda to
1a92618
Compare
|
Rebased onto latest |
Yes, they should. |
|
Yes, I can confirm that negative values work correctly! The implementation supports negative numbers, properly handles underflows by clamping to |
|
There are still formatting issues it seems, can you run the formatter? |
|
I've gone ahead and fixed the remaining formatting issues (there was some trailing whitespace left over in the test file) and pushed the update. Let me know if everything looks good to go now! |
Head branch was pushed to by a user without write access
9444841 to
e03ab8e
Compare
|
Thanks @glbrntt! I've addressed the formatting suggestions — fixed the missing blank line before |
|
@glbrntt Could you let me know which specific formatting issues remain? I fixed the blank lines before the test functions. Unfortunately I don't have Swift available locally to run the formatter — is there a specific check I'm missing in the diff? Happy to fix right away! |
|
@Lukasa Friendly ping - I have added tests covering negative values and overflow conditions for all ByteCount factory methods (in the latest commit). Could you take another look when you get a chance? |
18c7efe to
107c060
Compare
26e5b2f to
85c5d28
Compare
Fixes #2877