diff --git a/src/arm/disasm-arm.cc b/src/arm/disasm-arm.cc index 0c6ef132f8..d93e56ed38 100644 --- a/src/arm/disasm-arm.cc +++ b/src/arm/disasm-arm.cc @@ -685,8 +685,9 @@ int Decoder::FormatOption(Instruction* instr, const char* format) { return -1; } } - out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%p", - static_cast(addr)); + out_buffer_pos_ += + SNPrintF(out_buffer_ + out_buffer_pos_, "0x%08" PRIxPTR, + reinterpret_cast(addr)); return 1; } case 'S': diff --git a/test/cctest/test-disasm-arm.cc b/test/cctest/test-disasm-arm.cc index 877ae6665f..5d8da1b471 100644 --- a/test/cctest/test-disasm-arm.cc +++ b/test/cctest/test-disasm-arm.cc @@ -1511,12 +1511,13 @@ static void TestLoadLiteral(byte* buffer, Assembler* assm, bool* failure, const char *expected_string_template = (offset >= 0) ? - "e59f0%03x ldr r0, [pc, #+%d] (addr %p)" : - "e51f0%03x ldr r0, [pc, #%d] (addr %p)"; + "e59f0%03x ldr r0, [pc, #+%d] (addr 0x%08" PRIxPTR ")" : + "e51f0%03x ldr r0, [pc, #%d] (addr 0x%08" PRIxPTR ")"; char expected_string[80]; snprintf(expected_string, sizeof(expected_string), expected_string_template, - abs(offset), offset, - progcounter + Instruction::kPcLoadDelta + offset); + abs(offset), offset, + reinterpret_cast( + progcounter + Instruction::kPcLoadDelta + offset)); if (!DisassembleAndCompare(progcounter, kRawString, expected_string)) { *failure = true; }