Commit 090f9b77 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Extend checking of {WasmCode} relocation info.

This extends the validity checking of relocation information from only
non-anonymous {WasmCode} objects to all (even anonymous) such objects,
including code being copied in from the garbage-collected heap.

R=jgruber@chromium.org

Change-Id: Icbc842ad819f4471cc11d3d19bbde1d192731569
Reviewed-on: https://chromium-review.googlesource.com/1073284Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53383}
parent aa6ce3ee
......@@ -279,7 +279,7 @@ void WasmCode::Validate() const {
break;
case RelocInfo::EMBEDDED_OBJECT: {
HeapObject* o = it.rinfo()->target_object();
DCHECK(o->IsUndefined(o->GetIsolate()));
DCHECK(o->IsUndefined(o->GetIsolate()) || o->IsCode());
break;
}
default:
......@@ -449,6 +449,7 @@ WasmCode* NativeModule::AddOwnedCode(
Assembler::FlushICache(ret->instructions().start(),
ret->instructions().size());
}
ret->Validate();
return ret;
}
......@@ -612,7 +613,6 @@ WasmCode* NativeModule::AddCode(
// made while iterating over the RelocInfo above.
Assembler::FlushICache(ret->instructions().start(),
ret->instructions().size());
ret->Validate();
return ret;
}
......
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