Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix culture-dependent ToString in illink tests #96172

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Mono.Cecil;
Expand Down Expand Up @@ -628,13 +629,13 @@ static string FormatInstruction (Instruction instr)

case Code.Ldc_R4:
if (instr.Operand is float fvalue)
return $"{instr.OpCode.ToString ()} {fvalue.ToString ()}";
return $"{instr.OpCode.ToString ()} {fvalue.ToString (CultureInfo.InvariantCulture)}";

throw new NotImplementedException (instr.Operand.GetType ().ToString ());

case Code.Ldc_R8:
if (instr.Operand is double dvalue)
return $"{instr.OpCode.ToString ()} {dvalue.ToString ()}";
return $"{instr.OpCode.ToString ()} {dvalue.ToString (CultureInfo.InvariantCulture)}";

throw new NotImplementedException (instr.Operand.GetType ().ToString ());

Expand Down
Loading