Fix WriteCompressedInt32 logic by using the same code as in System.Reflection.Metadata #958

Merged
simonferquel merged 2 commits from simon/fix-sequence-points-unity into master 2024-08-22 11:03:35 -05:00
simonferquel commented 2024-08-22 07:25:57 -05:00 (Migrated from github.com)

Note: the implementation in SRM uses methods that are not available in netfx 4.0. To make the code work with all platforms supported by Mono.Cecil, I extracted the required methods.

While working on a Unity codebase, we found out a case where Mono.Cecil would generate invalid sequence points.
After digging, it seems the root issue is in the implementation of WriteCompressedInt32.
The provided test fails with the original implementation, while it succeeds with the SRM implementation in this PR.

Note: the implementation in SRM uses methods that are not available in netfx 4.0. To make the code work with all platforms supported by Mono.Cecil, I extracted the required methods. While working on a Unity codebase, we found out a case where Mono.Cecil would generate invalid sequence points. After digging, it seems the root issue is in the implementation of WriteCompressedInt32. The provided test fails with the original implementation, while it succeeds with the SRM implementation in this PR.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-jbevain/cecil!958
No description provided.