Input code
SharpCompress 1.0.0, SharpCompress.Compressors.ZStandard.Unsafe.Methods (the ZSTD_decompressStream
region), decompiled with unsafe code and native integers enabled:
ilspycmd ~/.cache/nugetfuzz/sharpcompress/1.0.0/lib/net10.0/SharpCompress.dll \
-t SharpCompress.Compressors.ZStandard.Unsafe.Methods
Erroneous output
Current master (dbf23c6) uses nint throughout:
return (nuint)((((nuint)((zds->format == ZSTD_format_e.ZSTD_f_zstd1) ? 6 : 2) > num7)
? ((nint)((zds->format == ZSTD_format_e.ZSTD_f_zstd1) ? 6 : 2))
: ((nint)num7)) - (nint)zds->lhSize + 3);
With #4091 (6fcb387) the branches are cast to IntPtr instead, and one of them keeps the nint
cast underneath:
return (nuint)((nint)(((nuint)((zds->format == ZSTD_format_e.ZSTD_f_zstd1) ? 6 : 2) > num7)
? ((IntPtr)((zds->format == ZSTD_format_e.ZSTD_f_zstd1) ? 6 : 2))
: ((IntPtr)(nint)num7)) - (nint)zds->lhSize + 3);
Same type either way, so this is readability only: with the native-integer setting on, the
conditional should keep printing nint rather than falling back to IntPtr.
Details
- Product in use: ICSharpCode.Decompiler, built from source
- Version in use: not reproducible on master (dbf23c6); measured at 6fcb387 against merge base
712ad1a, over the top-200 nuget.org packages. One type in the corpus is affected.
Filed by an AI agent (Claude) on Siegfried's behalf.
Input code
SharpCompress 1.0.0,
SharpCompress.Compressors.ZStandard.Unsafe.Methods(theZSTD_decompressStreamregion), decompiled with unsafe code and native integers enabled:
Erroneous output
Current master (dbf23c6) uses
nintthroughout:With #4091 (6fcb387) the branches are cast to
IntPtrinstead, and one of them keeps thenintcast underneath:
Same type either way, so this is readability only: with the native-integer setting on, the
conditional should keep printing
nintrather than falling back toIntPtr.Details
712ad1a, over the top-200 nuget.org packages. One type in the corpus is affected.
Filed by an AI agent (Claude) on Siegfried's behalf.