Bug 1222675 - Handle OOM properly in ObjectGroup::addDefiniteProperties. r=bhackett

--HG--
extra : rebase_source : 856e14caf6e46226423be2ab5ccb967b68728c9a
This commit is contained in:
Jan de Mooij 2016-01-27 13:42:08 +01:00
parent 1c3e9791a8
commit b68da81498

View File

@ -2679,7 +2679,11 @@ ObjectGroup::addDefiniteProperties(ExclusiveContext* cx, Shape* shape)
MOZ_ASSERT_IF(shape->slot() >= shape->numFixedSlots(), MOZ_ASSERT_IF(shape->slot() >= shape->numFixedSlots(),
shape->numFixedSlots() == NativeObject::MAX_FIXED_SLOTS); shape->numFixedSlots() == NativeObject::MAX_FIXED_SLOTS);
TypeSet* types = getProperty(cx, nullptr, id); TypeSet* types = getProperty(cx, nullptr, id);
if (types && types->canSetDefinite(shape->slot())) if (!types) {
MOZ_ASSERT(unknownProperties());
return;
}
if (types->canSetDefinite(shape->slot()))
types->setDefinite(shape->slot()); types->setDefinite(shape->slot());
} }