jbevain / cecil

Cecil is a library to inspect, modify and create .NET programs and libraries.
MIT License
2.77k stars 630 forks source link

InvariantCulture for operand to string conversion in Instruction.ToString() #870

Closed Fantoom closed 2 years ago

Fantoom commented 2 years ago

Instruction.ToString() uses the culture of the current thread, which can be problematic for converting doubles and floats to a string.

ForNeVeR commented 2 years ago

For context: we're writing a C compiler using Cecil, and hit the issue while dumping the methods' IL code and comparing it in the compiler unit tests (one contributor had a locale that uses different number format, and broke the tests). So, I agree that these changes should be made.

jbevain commented 2 years ago

Looking good, thank you!