-
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 1 commit
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 |
---|---|---|
|
@@ -12648,10 +12648,35 @@ void emitter::emitDispConstant(const instrDesc* id, bool skipComma) const | |
{ | ||
printf("%d", (int)val); | ||
} | ||
else if ((val > 0) || (val < -0xFFFFFF)) | ||
else if (val > 0) | ||
{ | ||
printf("0x%zX", (ssize_t)val); | ||
} | ||
else if (val < -0xFFFFFF) | ||
{ | ||
switch (id->idOpSize()) | ||
{ | ||
case EA_1BYTE: | ||
printf("0x%X", static_cast<int8_t>(val)); | ||
break; | ||
|
||
case EA_2BYTE: | ||
printf("0x%X", static_cast<int16_t>(val)); | ||
break; | ||
|
||
case EA_4BYTE: | ||
printf("0x%X", static_cast<int32_t>(val)); | ||
break; | ||
|
||
case EA_8BYTE: | ||
printf("0x%X", static_cast<int64_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. This is not correct if I think you can use 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. Thanks for catching that! I had missed that |
||
break; | ||
|
||
default: | ||
printf("0x%zX", (ssize_t)val); | ||
break; | ||
} | ||
} | ||
else | ||
{ | ||
// (val < 0) | ||
|
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.