mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
FractionApprox rejects inputs above 0x7FFFFFFF because they cannot be stored as a fraction, but the check was one-sided while the sign is stripped right after it. A large negative value therefore reached the continued-fraction loop and overflowed the terms it accumulates. ICSharpCode.Decompiler is built with CheckForOverflowUnderflow, so that aborted decompilation of the whole member instead of wrapping. Found by fuzzing nuget.org; reproduces on MathNet.Numerics, whose constants reach the approximation through their ratio to PI. Assisted-by: Claude:claude-opus-5[1m]:Claude Codepull/3956/head
2 changed files with 9 additions and 1 deletions
Loading…
Reference in new issue