Skip to content

Commit

Permalink
[vm] Fix byte displacement printing in x86 disassembler
Browse files Browse the repository at this point in the history
Use int8_t type instead of char - which does not have a defined signedness.

Change-Id: I14d43419d3e59cea71fb27f15bb1f72e450baca6
Reviewed-on: https://dart-review.googlesource.com/76563
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
  • Loading branch information
mraleph authored and commit-bot@chromium.org committed Sep 25, 2018
1 parent ded73cd commit c9bcfe8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/vm/compiler/assembler/disassembler_x86.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ int DisassemblerX64::PrintRightOperandHelper(
int scale, index, base;
get_sib(sib, &scale, &index, &base);
int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 2)
: *reinterpret_cast<char*>(modrmp + 2);
: *reinterpret_cast<int8_t*>(modrmp + 2);
if (index == 4 && (base & 7) == 4 && scale == 0 /*times_1*/) {
Print("[%s", NameOfCPURegister(base));
PrintDisp(disp, "]");
Expand All @@ -456,7 +456,7 @@ int DisassemblerX64::PrintRightOperandHelper(
} else {
// No sib.
int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 1)
: *reinterpret_cast<char*>(modrmp + 1);
: *reinterpret_cast<int8_t*>(modrmp + 1);
Print("[%s", NameOfCPURegister(rm));
PrintDisp(disp, "]");
return (mod == 2) ? 5 : 2;
Expand Down

0 comments on commit c9bcfe8

Please sign in to comment.