Source/WebCore: REGRESSION (r113233): fast/canvas/webgl/array-message-passing.html crashing on Lion and Snow Leopard bots.
https://bugs.webkit.org/show_bug.cgi?id=83427.
Due to incorrect merge by me when landing r113233, call to find got replaces with call to add in
checking for duplicates in ObjectPool when serializing.

Reviewed by Dean Jackson.

Covered by existing tests.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::checkForDuplicate):

LayoutTests: REGRESSION (r113233): fast/canvas/webgl/array-message-passing.html crashing on Lion and Snow Leopard bots.
https://bugs.webkit.org/show_bug.cgi?id=83427.
Bug fixed, unskipping tests.

Reviewed by Dean Jackson.

* platform/mac/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
index 316408b..5d2d51d 100644
--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -392,13 +392,13 @@
     bool checkForDuplicate(JSObject* object)
     {
         // Record object for graph reconstruction
-        ObjectPool::AddResult addResult = m_objectPool.add(object, m_objectPool.size());
+        ObjectPool::const_iterator found = m_objectPool.find(object);
 
         // Handle duplicate references
-        if (!addResult.isNewEntry) {
+        if (found != m_objectPool.end()) {
             write(ObjectReferenceTag);
-            ASSERT(static_cast<int32_t>(addResult.iterator->second) < m_objectPool.size());
-            writeObjectIndex(addResult.iterator->second);
+            ASSERT(static_cast<int32_t>(found->second) < m_objectPool.size());
+            writeObjectIndex(found->second);
             return true;
         }