2008-09-15 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Sep 2008 10:02:56 +0000 (10:02 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Sep 2008 10:02:56 +0000 (10:02 +0000)
        Reviewed by Cameron Zwarich.

        - fix JSC test failures introduced by fix for 20849

        * kjs/PropertyMap.cpp:
        (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.

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

JavaScriptCore/ChangeLog
JavaScriptCore/kjs/PropertyMap.cpp

index 44c4fb1d81b74590000c102be542aa88599cfc09..2fe2fee4f817ab3bdcad48c4f9e509cdf7370ecb 100644 (file)
@@ -1,3 +1,12 @@
+2008-09-15  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Cameron Zwarich.
+        
+        - fix JSC test failures introduced by fix for 20849
+
+        * kjs/PropertyMap.cpp:
+        (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
+
 2008-09-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
 
         Reviewed by Maciej Stachowiak.
index 00b1ec7b9e919072174d89664d84da5431bcc5f4..d69fb9025b0cfffa4911e543ce19444317432157 100644 (file)
@@ -508,8 +508,10 @@ void PropertyMap::getEnumerablePropertyNames(Vector<UString::Rep*>& propertyName
             *p++ = &m_table->entries()[i];
     }
 
+    size_t enumerableCount = p - sortedEnumerables.data();
     // Sort the entries by index.
-    qsort(sortedEnumerables.data(), p - sortedEnumerables.data(), sizeof(Entry*), comparePropertyMapEntryIndices);
+    qsort(sortedEnumerables.data(), enumerableCount, sizeof(Entry*), comparePropertyMapEntryIndices);
+    sortedEnumerables.resize(enumerableCount);
 
     // Put the keys of the sorted entries into the list.
     propertyNames.reserveCapacity(sortedEnumerables.size());