Bug 1037666 - Add LeaveParseTaskZone call on error path.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 04 Aug 2014 22:04:31 -0400
changeset 197774 e23798c6319137080d9be9708190149833191b0a
parent 197773 36cf6a98d663a59eb03043e62527b120fc876e1d
child 197775 b1fb58e03f0da940fd8b2956d1997528ae624f02
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs1037666
milestone34.0a1
Bug 1037666 - Add LeaveParseTaskZone call on error path.
js/src/vm/HelperThreads.cpp
--- a/js/src/vm/HelperThreads.cpp
+++ b/js/src/vm/HelperThreads.cpp
@@ -730,16 +730,17 @@ GlobalHelperThreadState::finishParseTask
     // remapping below, since we can't GC while that's happening.
     Rooted<GlobalObject*> global(cx, &cx->global()->as<GlobalObject>());
     if (!GlobalObject::ensureConstructor(cx, global, JSProto_Object) ||
         !GlobalObject::ensureConstructor(cx, global, JSProto_Array) ||
         !GlobalObject::ensureConstructor(cx, global, JSProto_Function) ||
         !GlobalObject::ensureConstructor(cx, global, JSProto_RegExp) ||
         !GlobalObject::ensureConstructor(cx, global, JSProto_Iterator))
     {
+        LeaveParseTaskZone(rt, parseTask);
         return nullptr;
     }
 
     LeaveParseTaskZone(rt, parseTask);
 
     // Point the prototypes of any objects in the script's compartment to refer
     // to the corresponding prototype in the new compartment. This will briefly
     // create cross compartment pointers, which will be fixed by the