Index: Source/platform/scheduler/CancellableTaskFactory.cpp |
diff --git a/Source/platform/scheduler/CancellableTaskFactory.cpp b/Source/platform/scheduler/CancellableTaskFactory.cpp |
index 87027119e635018ae91ce74982b213b780fa0d68..ad461afa77cb7386e0c377367207945fd0d89276 100644 |
--- a/Source/platform/scheduler/CancellableTaskFactory.cpp |
+++ b/Source/platform/scheduler/CancellableTaskFactory.cpp |
@@ -21,11 +21,16 @@ WebThread::Task* CancellableTaskFactory::cancelAndCreate() |
return new CancellableTask(m_weakPtrFactory.createWeakPtr()); |
} |
+NO_LAZY_SWEEP_SANITIZE_ADDRESS |
void CancellableTaskFactory::CancellableTask::run() |
{ |
- if (m_weakPtr.get()) { |
- Closure* closure = m_weakPtr->m_closure.get(); |
- m_weakPtr->m_weakPtrFactory.revokeAll(); |
+ if (CancellableTaskFactory* taskFactory = m_weakPtr.get()) { |
+#if defined(ADDRESS_SANITIZER) |
+ if (taskFactory->m_unpoisonBeforeUpdate) |
+ ASAN_UNPOISON_MEMORY_REGION(reinterpret_cast<unsigned char*>(taskFactory), sizeof(CancellableTaskFactory)); |
+#endif |
+ Closure* closure = taskFactory->m_closure.get(); |
+ taskFactory->m_weakPtrFactory.revokeAll(); |
(*closure)(); |
} |
} |