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 249433 8f49a2fc3f0ccf0e6149e392df7405427df5affb
parent 249432 a8f82447f9adb78a50db25918ec7dc41bd53d692
child 249434 b314a91c568413197c712f25a8bb4495c1b8b41f
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco, abillings
bugs1124018
milestone37.0a2
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
@@ -2227,16 +2227,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;