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

Merged
Fantoom merged 2 commits from master into master 2022-09-29 16:05:07 -05:00
Fantoom commented 2022-08-12 16:42:47 -05:00 (Migrated from github.com)

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

Instruction.ToString() uses the culture of the current thread, which can be problematic for converting doubles and floats to a string.
ForNeVeR (Migrated from github.com) requested changes 2022-08-16 15:15:32 -05:00
ForNeVeR (Migrated from github.com) commented 2022-08-16 15:15:28 -05:00

This is just a string, right? No need to convert a string into the invariant culture.

This is just a string, right? No need to convert a string into the invariant culture.
ForNeVeR commented 2022-08-16 15:15:56 -05:00 (Migrated from github.com)

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.

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.
Fantoom (Migrated from github.com) reviewed 2022-08-16 15:45:46 -05:00
Fantoom (Migrated from github.com) commented 2022-08-16 15:45:46 -05:00

Did not notice that. Thanks!

Did not notice that. Thanks!
ForNeVeR (Migrated from github.com) approved these changes 2022-08-17 11:51:38 -05:00
jbevain commented 2022-09-29 16:04:53 -05:00 (Migrated from github.com)

Looking good, thank you!

Looking good, thank you!
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!870
No description provided.