Commit de516035 authored by Pierre Langlois's avatar Pierre Langlois Committed by Commit Bot

[disassembler] Do not search for literal loads inside constant pools

We try and match literal load instructions in order to print a
relocation info comment. However, we could be doing it while we're
decoding a constant pool. This would cause a DCHECK to fire on Arm64
with full pointers.

Change-Id: I82a523dc5c033f86f41467db75e43419ab87d5ca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2756532Reviewed-by: 's avatarSantiago Aboy Solanes <solanes@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#73429}
parent 96217d35
......@@ -301,7 +301,8 @@ static int DecodeIt(Isolate* isolate, ExternalReferenceEncoder* ref_encoder,
while (pc < end) {
// First decode instruction so that we know its length.
byte* prev_pc = pc;
if (constants > 0) {
bool decoding_constant_pool = constants > 0;
if (decoding_constant_pool) {
SNPrintF(
decode_buffer, "%08x constant",
base::ReadUnalignedValue<int32_t>(reinterpret_cast<Address>(pc)));
......@@ -391,7 +392,11 @@ static int DecodeIt(Isolate* isolate, ExternalReferenceEncoder* ref_encoder,
// If this is a constant pool load and we haven't found any RelocInfo
// already, check if we can find some RelocInfo for the target address in
// the constant pool.
if (pcs.empty() && !code.is_null()) {
// Make sure we're also not currently in the middle of decoding a constant
// pool itself, rather than a contant pool load. Since it can store any
// bytes, a constant could accidentally match with the bit-pattern checked
// by IsInConstantPool() below.
if (pcs.empty() && !code.is_null() && !decoding_constant_pool) {
RelocInfo dummy_rinfo(reinterpret_cast<Address>(prev_pc), RelocInfo::NONE,
0, Code());
if (dummy_rinfo.IsInConstantPool()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment