Uh oh!
There was an error while loading. Please reload this page.
[Draft] Limit length of System.Runtime.BigInteger to int.MaxValue-32 bits - #84901
[Draft] Limit length of System.Runtime.BigInteger to int.MaxValue-32 bits#84901speshuric wants to merge 2 commits into
Conversation
- Limit `BigInteger.MaxLength` to `int.MaxValue/32` uints. This is equal to limit length in bits to `int.MaxValue-32 bits` - Fix ctor `BigInteger(ReadOnlySpan<byte>, bool, bool)` to check MaxLength limit - Fix private ctor `BigInteger(ReadOnlySpan<uint>, bool)` to check `MaxLength` limit after trying to conserve space, not before - Fix private ctor `BigInteger(Span<uint>)` to check MaxLength limit after trying to conserve space, not before - Fix obsolete comment in AssertValid() - Fix test `LargeNegativeBigIntegerShiftTest` to respect new limit. fix#84670
ghost
commented
Apr 16, 2023
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsSee discussion in #84670
fix #84670
|
huoyaoyuan
commented
Apr 17, 2023
The overflow guard in |
speshuric
commented
Apr 17, 2023
Thank you for point that! I'll check it. |
tannergooding
commented
May 15, 2023
Uh oh!
There was an error while loading. Please reload this page.
nit: Keep the braces please Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Thank you for your help, there is absolutely no rush from our side. I am going to apply "need author action" label so this PR is not listed on our internal list of PRs awaiting for review. |
ghost
commented
Jul 21, 2023
This pull request has been automatically marked |
speshuric
commented
Aug 4, 2023
I still plan to complete this. |
ghost
commented
Aug 21, 2023
This pull request has been automatically marked |
ghost
commented
Sep 4, 2023
This pull request will now be closed since it had been marked |
See discussion in #84670
BigInteger.MaxLengthtoint.MaxValue/32uints. This is equal to limit length in bits toint.MaxValue-32 bitsBigInteger(ReadOnlySpan<byte>, bool, bool)to check MaxLength limitBigInteger(ReadOnlySpan<uint>, bool)to checkMaxLengthlimit after trying to conserve space, not beforeBigInteger(Span<uint>)to check MaxLength limit after trying to conserve space, not beforeLargeNegativeBigIntegerShiftTestto respect new limit.fix#84670