From 8d9e85b5baf784727ecefaecda68716e03ec884e Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Wed, 26 Feb 2020 04:40:09 +0300 Subject: Import QtWebKit commit bf94215feb57ddf9ce364bc6953eec8cd1387c3d Change-Id: Ifc9d2e79e39fbfdd21bd40ede609c7696d2efe62 Reviewed-by: Konstantin Tokarev --- Source/JavaScriptCore/heap/WeakInlines.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Source/JavaScriptCore') diff --git a/Source/JavaScriptCore/heap/WeakInlines.h b/Source/JavaScriptCore/heap/WeakInlines.h index 4653a9f8c..d5bd2ea2f 100644 --- a/Source/JavaScriptCore/heap/WeakInlines.h +++ b/Source/JavaScriptCore/heap/WeakInlines.h @@ -73,20 +73,23 @@ template inline auto Weak::operator=(Weak&& other) -> Weak& template inline T* Weak::operator->() const { ASSERT(m_impl && m_impl->state() == WeakImpl::Live); - return jsCast(m_impl->jsValue().asCell()); + // We can't use jsCast here since we could be called in a finalizer. + return static_cast(m_impl->jsValue().asCell()); } template inline T& Weak::operator*() const { ASSERT(m_impl && m_impl->state() == WeakImpl::Live); - return *jsCast(m_impl->jsValue().asCell()); + // We can't use jsCast here since we could be called in a finalizer. + return *static_cast(m_impl->jsValue().asCell()); } template inline T* Weak::get() const { if (!m_impl || m_impl->state() != WeakImpl::Live) - return 0; - return jsCast(m_impl->jsValue().asCell()); + return nullptr; + // We can't use jsCast here since we could be called in a finalizer. + return static_cast(m_impl->jsValue().asCell()); } template inline bool Weak::was(T* other) const -- cgit v1.2.1