Silence a debug assertion.
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Aug 2014 22:52:08 +0000 (22:52 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Aug 2014 22:52:08 +0000 (22:52 +0000)
Reviewed by Mark Hahnenberg.

* runtime/JSPropertyNameEnumerator.h:
(JSC::JSPropertyNameEnumerator::cachedStructure):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172181 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSPropertyNameEnumerator.h

index c6ad9ae..f7f2530 100644 (file)
@@ -1,5 +1,14 @@
 2014-08-06  Filip Pizlo  <fpizlo@apple.com>
 
+        Silence a debug assertion.
+
+        Reviewed by Mark Hahnenberg.
+
+        * runtime/JSPropertyNameEnumerator.h:
+        (JSC::JSPropertyNameEnumerator::cachedStructure):
+
+2014-08-06  Filip Pizlo  <fpizlo@apple.com>
+
         Fix 32-bit build.
 
         * jit/JITOpcodes32_64.cpp:
index 9a5a6e3..dc4b7c2 100644 (file)
@@ -68,7 +68,12 @@ public:
     StructureChain* cachedPrototypeChain() const { return m_prototypeChain.get(); }
     void setCachedPrototypeChain(VM& vm, StructureChain* prototypeChain) { return m_prototypeChain.set(vm, this, prototypeChain); }
 
-    Structure* cachedStructure(VM& vm) const { return vm.heap.structureIDTable().get(m_cachedStructureID); }
+    Structure* cachedStructure(VM& vm) const
+    {
+        if (!m_cachedStructureID)
+            return nullptr;
+        return vm.heap.structureIDTable().get(m_cachedStructureID);
+    }
     StructureID cachedStructureID() const { return m_cachedStructureID; }
     uint32_t cachedInlineCapacity() const { return m_cachedInlineCapacity; }
     static ptrdiff_t cachedStructureIDOffset() { return OBJECT_OFFSETOF(JSPropertyNameEnumerator, m_cachedStructureID); }