Revision: 4555 Author: [email protected] Date: Fri Apr 30 05:22:02 2010 Log: 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 Review URL: http://codereview.chromium.org/1701021 http://code.google.com/p/v8/source/detail?r=4555 Modified: /branches/2.1/src/runtime.cc /branches/2.1/src/version.cc ======================================= --- /branches/2.1/src/runtime.cc Tue Apr 27 06:03:24 2010 +++ /branches/2.1/src/runtime.cc Fri Apr 30 05:22:02 2010 @@ -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); } ======================================= --- /branches/2.1/src/version.cc Fri Apr 30 02:21:54 2010 +++ /branches/2.1/src/version.cc Fri Apr 30 05:22:02 2010 @@ -35,7 +35,7 @@ #define MAJOR_VERSION 2 #define MINOR_VERSION 1 #define BUILD_NUMBER 10 -#define PATCH_LEVEL 12 +#define PATCH_LEVEL 13 #define CANDIDATE_VERSION false // Define SONAME to have the SCons build the put a specific SONAME into the -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
