Bug 1124018 - Null the allocation site table if initialization fails. r=jonco, a=bajaj
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 26 Jan 2015 13:14:34 -0500
changeset 204433 4048cc627fdf58ec2cb3935482046c0bf6b33832
parent 204432 5f14fa8d51ec7d8d47dd5fbe9e7af50051c12e96
child 204449 a3c1b4e768b0a148e7759f071a08f2247dd4a84f
push id636
push userryanvm@gmail.com
push dateThu, 29 Jan 2015 03:04:29 +0000
treeherdermozilla-b2g32_v2_0@4048cc627fdf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco, bajaj
bugs1124018
milestone32.0
Bug 1124018 - Null the allocation site table if initialization fails. r=jonco, a=bajaj
js/src/jsinfer.cpp
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -2049,16 +2049,17 @@ TypeObject *
 TypeCompartment::addAllocationSiteTypeObject(JSContext *cx, AllocationSiteKey key)
 {
     AutoEnterAnalysis enter(cx);
 
     if (!allocationSiteTable) {
         allocationSiteTable = cx->new_<AllocationSiteTable>();
         if (!allocationSiteTable || !allocationSiteTable->init()) {
             js_delete(allocationSiteTable);
+            allocationSiteTable = nullptr;
             return nullptr;
         }
     }
 
     AllocationSiteTable::AddPtr p = allocationSiteTable->lookupForAdd(key);
     JS_ASSERT(!p);
 
     TypeObject *res = nullptr;