Commit f5a5a778 authored by Mircea Trofin's avatar Mircea Trofin Committed by Commit Bot

Fix VirtualMemory::Free in presence of lsan

Adding lsan root unregistration when Free-ing VirtualMemory.

Bug: chromium:787976
Change-Id: I0ef32b4324ff6d7b6192d7e5616081766a0e51a8
Reviewed-on: https://chromium-review.googlesource.com/786995Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49609}
parent 5a88950c
......@@ -176,6 +176,9 @@ void VirtualMemory::Free() {
size_t size = size_;
CHECK(InVM(address, size));
Reset();
#if defined(LEAK_SANITIZER)
__lsan_unregister_root_region(address, size);
#endif
CHECK(base::OS::Free(address, size));
}
......
......@@ -151,8 +151,6 @@ TEST_F(DisjointAllocationPoolTest, MergingSkipLargerSrcWithGap) {
CheckLooksLike(a, {{10, 15}, {20, 35}, {36, 40}});
}
// TODO(chromium:787976): remove conditional compilation when bug is fixed
#if !LEAK_SANITIZER
class WasmCodeManagerTest : public TestWithIsolate {
public:
using NativeModulePtr = std::unique_ptr<NativeModule>;
......@@ -387,7 +385,6 @@ TEST_F(WasmCodeManagerTest, LookupWorksAfterRewrite) {
CHECK_EQ(code1_1, manager.LookupCode(code1_1->instructions().start()));
}
}
#endif
} // namespace wasm_heap_unittest
} // namespace wasm
......
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