Fix WriteCompressedInt32 endianness on big-endian hosts - #517
Merged
Conversation
Member
Member
|
can you please send an upstream PR to jbevain/cecil as well? thanks |
medhatiwari
force-pushed
the
fix-compressed-int32-be
branch
4 times, most recently
from
September 1, 2026 06:29
5e08e58 to
49cd6f9
Compare
This was referenced Sep 1, 2026
Author
yeah done here |
This was referenced Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cecil’s WriteUInt16/WriteUInt32 are always little-endian. WriteCompressedInt32 copied SRM’s IsLittleEndian check, so on big-endian it writes swapped compressed ints into portable PDBs.
That landed in dotnet/cecil via #505 (608fac6, originally jbevain/cecil#958) and flowed into the VMR in [dotnet/dotnet#8250](dotnet/dotnet#8250. Native s390x VMR Mono then fails in ILLink while trimming System.Runtime (IL1012, ArgumentNullException / document).
Always ReverseEndianness before those writes. Round-trip tests do not catch this on little-endian, the new test asserts spec bytes (-100 → BF39, -9076 → DFFFB919).
cc: @tmds