diff options
| author | Konstantin Tokarev <annulen@yandex.ru> | 2020-02-26 04:40:09 +0300 |
|---|---|---|
| committer | Konstantin Tokarev <annulen@yandex.ru> | 2020-02-26 04:41:40 +0300 |
| commit | 8d9e85b5baf784727ecefaecda68716e03ec884e (patch) | |
| tree | 37785846b69c9f0b8361175c413e07dc3f542a2f /Source/JavaScriptCore | |
| parent | cd875b317ba9ef63f946d2a07b7e67c1e05f93ac (diff) | |
| download | qtwebkit-8d9e85b5baf784727ecefaecda68716e03ec884e.tar.gz | |
Import QtWebKit commit bf94215feb57ddf9ce364bc6953eec8cd1387c3d
Change-Id: Ifc9d2e79e39fbfdd21bd40ede609c7696d2efe62
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/JavaScriptCore')
| -rw-r--r-- | Source/JavaScriptCore/heap/WeakInlines.h | 11 |
1 files changed, 7 insertions, 4 deletions
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<typename T> inline auto Weak<T>::operator=(Weak&& other) -> Weak& template<typename T> inline T* Weak<T>::operator->() const { ASSERT(m_impl && m_impl->state() == WeakImpl::Live); - return jsCast<T*>(m_impl->jsValue().asCell()); + // We can't use jsCast here since we could be called in a finalizer. + return static_cast<T*>(m_impl->jsValue().asCell()); } template<typename T> inline T& Weak<T>::operator*() const { ASSERT(m_impl && m_impl->state() == WeakImpl::Live); - return *jsCast<T*>(m_impl->jsValue().asCell()); + // We can't use jsCast here since we could be called in a finalizer. + return *static_cast<T*>(m_impl->jsValue().asCell()); } template<typename T> inline T* Weak<T>::get() const { if (!m_impl || m_impl->state() != WeakImpl::Live) - return 0; - return jsCast<T*>(m_impl->jsValue().asCell()); + return nullptr; + // We can't use jsCast here since we could be called in a finalizer. + return static_cast<T*>(m_impl->jsValue().asCell()); } template<typename T> inline bool Weak<T>::was(T* other) const |
