Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c9bcfe8

Browse files
mralephcommit-bot@chromium.org
authored andcommitted
[vm] Fix byte displacement printing in x86 disassembler
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>
1 parent ded73cd commit c9bcfe8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/vm/compiler/assembler/disassembler_x86.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ int DisassemblerX64::PrintRightOperandHelper(
443443
int scale, index, base;
444444
get_sib(sib, &scale, &index, &base);
445445
int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 2)
446-
: *reinterpret_cast<char*>(modrmp + 2);
446+
: *reinterpret_cast<int8_t*>(modrmp + 2);
447447
if (index == 4 && (base & 7) == 4 && scale == 0 /*times_1*/) {
448448
Print("[%s", NameOfCPURegister(base));
449449
PrintDisp(disp, "]");
@@ -456,7 +456,7 @@ int DisassemblerX64::PrintRightOperandHelper(
456456
} else {
457457
// No sib.
458458
int disp = (mod == 2) ? *reinterpret_cast<int32_t*>(modrmp + 1)
459-
: *reinterpret_cast<char*>(modrmp + 1);
459+
: *reinterpret_cast<int8_t*>(modrmp + 1);
460460
Print("[%s", NameOfCPURegister(rm));
461461
PrintDisp(disp, "]");
462462
return (mod == 2) ? 5 : 2;

0 commit comments

Comments
 (0)