[wasm] More checking of internal references in {WasmCode}.

R=clemensh@chromium.org

Change-Id: If9cf209b26978ad11dc2cf9c01b92c40bcba1a49
Reviewed-on: https://chromium-review.googlesource.com/1109826
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53931}
This commit is contained in:
Michael Starzinger 2018-06-21 14:33:18 +02:00 committed by Commit Bot
parent 11926e6ecc
commit aa6f40d25b

View File

@ -183,12 +183,16 @@ void WasmCode::Validate() const {
CHECK_EQ(target, code->instruction_start());
break;
}
case RelocInfo::INTERNAL_REFERENCE:
case RelocInfo::INTERNAL_REFERENCE_ENCODED: {
Address target = it.rinfo()->target_internal_reference();
CHECK(contains(target));
break;
}
case RelocInfo::WASM_CODE_TABLE_ENTRY:
case RelocInfo::WASM_CALL:
case RelocInfo::JS_TO_WASM_CALL:
case RelocInfo::EXTERNAL_REFERENCE:
case RelocInfo::INTERNAL_REFERENCE:
case RelocInfo::INTERNAL_REFERENCE_ENCODED:
case RelocInfo::OFF_HEAP_TARGET:
case RelocInfo::COMMENT:
case RelocInfo::CONST_POOL: