Skip to content

Commit 99b4e84

Browse files
Use alternative format (#111444)
1 parent 62d433f commit 99b4e84

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/coreclr/ildasm/dasm.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr,
19141914
for(n=0; n < numElements; n++)
19151915
{
19161916
if(n) appendStr(out," ");
1917-
sprintf_s(str, 64, "%.*g", 8, (double)(*((float*)dataPtr)));
1917+
sprintf_s(str, 64, "%#.8g", (double)(*((float*)dataPtr)));
19181918
float df = (float)atof(str);
19191919
// Must compare as underlying bytes, not floating point otherwise optimizer will
19201920
// try to enregister and compare 80-bit precision number with 32-bit precision number!!!!
@@ -1933,7 +1933,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr,
19331933
{
19341934
if(n) appendStr(out," ");
19351935
char *pch;
1936-
sprintf_s(str, 64, "%.*g", 17, *((double*)dataPtr));
1936+
sprintf_s(str, 64, "%#.17g", *((double*)dataPtr));
19371937
double df = strtod(str, &pch);
19381938
// Must compare as underlying bytes, not floating point otherwise optimizer will
19391939
// try to enregister and compare 80-bit precision number with 64-bit precision number!!!!
@@ -2605,7 +2605,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void
26052605
case ELEMENT_TYPE_R4:
26062606
{
26072607
char szf[32];
2608-
sprintf_s(szf, 32, "%.*g", 8, (double)MDDV.m_fltValue);
2608+
sprintf_s(szf, 32, "%#.8g", (double)MDDV.m_fltValue);
26092609
float df = (float)atof(szf);
26102610
// Must compare as underlying bytes, not floating point otherwise optimizer will
26112611
// try to enregister and compare 80-bit precision number with 32-bit precision number!!!!
@@ -2619,7 +2619,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void
26192619
case ELEMENT_TYPE_R8:
26202620
{
26212621
char szf[32], *pch;
2622-
sprintf_s(szf, 32, "%.*g", 17, MDDV.m_dblValue);
2622+
sprintf_s(szf, 32, "%#.17g", MDDV.m_dblValue);
26232623
double df = strtod(szf, &pch); //atof(szf);
26242624
szf[31]=0;
26252625
// Must compare as underlying bytes, not floating point otherwise optimizer will

0 commit comments

Comments
 (0)