-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Serialize negative constants according to the operand type #118814
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
Changes from 3 commits
9a24051
3831af7
4686534
98ce373
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12644,18 +12644,27 @@ void emitter::emitDispConstant(const instrDesc* id, bool skipComma) const | |
} | ||
} | ||
|
||
if ((val > -1000) && (val < 1000)) | ||
switch (id->idOpSize()) | ||
{ | ||
printf("%d", (int)val); | ||
} | ||
else if ((val > 0) || (val < -0xFFFFFF)) | ||
{ | ||
printf("0x%zX", (ssize_t)val); | ||
} | ||
else | ||
{ | ||
// (val < 0) | ||
printf("-0x%zX", (ssize_t)-val); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The below code will never print negative values anymore. I do not think we want that to change. FWIW, the jit disasm is a power user scenario for curious users only. It is not meant to be full fidelity/correct assembly output, and in various cases the produced disassembly will not be fully faithful. That is expected. |
||
case EA_1BYTE: | ||
printf("0x%X", static_cast<uint8_t>(val)); | ||
break; | ||
|
||
case EA_2BYTE: | ||
printf("0x%X", static_cast<uint16_t>(val)); | ||
break; | ||
|
||
case EA_4BYTE: | ||
printf("0x%X", static_cast<uint32_t>(val)); | ||
break; | ||
|
||
case EA_8BYTE: | ||
printf("0x%X", static_cast<uint64_t>(val)); | ||
break; | ||
|
||
default: | ||
printf("0x%zX", (size_t)val); | ||
break; | ||
} | ||
|
||
emitDispCommentForHandle(cnsVal.cnsVal, id->idDebugOnlyInfo()->idMemCookie, id->idDebugOnlyInfo()->idFlags); | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were printing decimal here not hex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes! Good catch. Fixed.