Skip to content

Commit 73bcb1d

Browse files
authored
Use alternative format (#111254)
1 parent cea112c commit 73bcb1d

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!!!!
@@ -2608,7 +2608,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void
26082608
case ELEMENT_TYPE_R4:
26092609
{
26102610
char szf[32];
2611-
sprintf_s(szf, 32, "%.*g", 8, (double)MDDV.m_fltValue);
2611+
sprintf_s(szf, 32, "%#.8g", (double)MDDV.m_fltValue);
26122612
float df = (float)atof(szf);
26132613
// Must compare as underlying bytes, not floating point otherwise optimizer will
26142614
// try to enregister and compare 80-bit precision number with 32-bit precision number!!!!
@@ -2622,7 +2622,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void
26222622
case ELEMENT_TYPE_R8:
26232623
{
26242624
char szf[32], *pch;
2625-
sprintf_s(szf, 32, "%.*g", 17, MDDV.m_dblValue);
2625+
sprintf_s(szf, 32, "%#.17g", MDDV.m_dblValue);
26262626
double df = strtod(szf, &pch); //atof(szf);
26272627
szf[31]=0;
26282628
// Must compare as underlying bytes, not floating point otherwise optimizer will

0 commit comments

Comments
 (0)