Commit 11d01041 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Fix race in LookupNativeModule method.

R=clemensh@chromium.org
TEST=mjsunit/wasm/data-segments
BUG=v8:7424,v8:8009

Change-Id: I6578b77f69d0d56d7f824486acd4c150e4d20ad0
Reviewed-on: https://chromium-review.googlesource.com/1160224Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54859}
parent c2ee9c6a
...@@ -965,6 +965,7 @@ WasmCode* WasmCodeManager::GetCodeFromStartAddress(Address pc) const { ...@@ -965,6 +965,7 @@ WasmCode* WasmCodeManager::GetCodeFromStartAddress(Address pc) const {
} }
NativeModule* WasmCodeManager::LookupNativeModule(Address pc) const { NativeModule* WasmCodeManager::LookupNativeModule(Address pc) const {
base::LockGuard<base::Mutex> lock(&native_modules_mutex_);
if (lookup_map_.empty()) return nullptr; if (lookup_map_.empty()) return nullptr;
auto iter = lookup_map_.upper_bound(pc); auto iter = lookup_map_.upper_bound(pc);
......
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