Reviewers: Kasper Lund,

Message:
Kasper,

may you have a look?

Anthony, Mads, that goes to 2.1's head and thus to Chrome 5.

Description:
Bring 4554 to the 2.1 branch.

Use ScopedVector instead of dynamically allocated array.

This ensures that it'll be released on any control path leaving
the function thanks to desctuctor semantics.

BUG=42925


Please review this at http://codereview.chromium.org/1701021/show

SVN Base: http://v8.googlecode.com/svn/branches/2.1/

Affected files:
  M     src/runtime.cc


Index: src/runtime.cc
===================================================================
--- src/runtime.cc      (revision 4554)
+++ src/runtime.cc      (working copy)
@@ -4118,7 +4118,7 @@
   int length = LocalPrototypeChainLength(*obj);

   // Find the number of local properties for each of the objects.
-  int* local_property_count = NewArray<int>(length);
+  ScopedVector<int> local_property_count(length);
   int total_property_count = 0;
   Handle<JSObject> jsproto = obj;
   for (int i = 0; i < length; i++) {
@@ -4171,7 +4171,6 @@
     }
   }

-  DeleteArray(local_property_count);
   return *Factory::NewJSArrayWithElements(names);
 }



--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to