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.