Commit 7cc57368 authored by ggaren@apple.com's avatar ggaren@apple.com

WeakGCMap should be lazy-finalization-safe

https://bugs.webkit.org/show_bug.cgi?id=87784

Reviewed by Darin Adler.

* runtime/WeakGCMap.h:
(JSC::WeakGCMap::get): Since this is a map of raw WeakImpl pointers, and
not Weak<T>, we need to verify manually that the WeakImpl is live before
we return its payload.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 76be4db0
2012-05-29 Geoffrey Garen <ggaren@apple.com>
WeakGCMap should be lazy-finalization-safe
https://bugs.webkit.org/show_bug.cgi?id=87784
Reviewed by Darin Adler.
* runtime/WeakGCMap.h:
(JSC::WeakGCMap::get): Since this is a map of raw WeakImpl pointers, and
not Weak<T>, we need to verify manually that the WeakImpl is live before
we return its payload.
2012-05-29 Mark Hahnenberg <mhahnenberg@apple.com>
CopiedSpace::doneCopying could start another collection
......
......@@ -69,7 +69,10 @@ public:
ExternalType get(const KeyType& key) const
{
return HandleTypes<MappedType>::getFromSlot(const_cast<JSValue*>(&m_map.get(key)->jsValue()));
WeakImpl* impl = m_map.get(key);
if (!impl || impl->state() != WeakImpl::Live)
return ExternalType();
return HandleTypes<MappedType>::getFromSlot(const_cast<JSValue*>(&impl->jsValue()));
}
void set(JSGlobalData&, const KeyType& key, ExternalType value)
......
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