Bug 1124018 - Null the allocation site table if initialization fails. r=jonco, a=abillings
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 26 Jan 2015 13:14:34 -0500
changeset 243056 1d3c24b896a1
parent 243055 b57b609d03a7
child 243057 24a8f5ee0ad0
push id4377
push userryanvm@gmail.com
push date2015-01-26 23:19 +0000
treeherdermozilla-beta@1d3c24b896a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco, abillings
bugs1124018
milestone36.0
Bug 1124018 - Null the allocation site table if initialization fails. r=jonco, a=abillings
js/src/jsinfer.cpp
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -2221,16 +2221,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);
     MOZ_ASSERT(!p);
 
     TypeObject *res = nullptr;