Commit 3acfd3b5 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[wasm] Fix nullptr dereference

Skip code spaces that do not have a far jump table in GetRuntimeStubId.

R=clemensb@chromium.org

Bug: chromium:1116141
Change-Id: Id0fcec691a2729f67750d2da15eea9f521075743
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2366763Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69512}
parent b0224d39
......@@ -1487,7 +1487,8 @@ WasmCode::RuntimeStubId NativeModule::GetRuntimeStubId(Address target) const {
base::MutexGuard guard(&allocation_mutex_);
for (auto& code_space_data : code_space_data_) {
if (code_space_data.far_jump_table->contains(target)) {
if (code_space_data.far_jump_table != nullptr &&
code_space_data.far_jump_table->contains(target)) {
uint32_t offset = static_cast<uint32_t>(
target - code_space_data.far_jump_table->instruction_start());
uint32_t index = JumpTableAssembler::FarJumpSlotOffsetToIndex(offset);
......
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