Bug 932530 - Check return of getType in more places; r=djvj

--HG--
extra : rebase_source : 58f83c065dd227ba14243891da6b12a6d610765c
This commit is contained in:
Terrence Cole 2013-11-05 10:03:24 -08:00
parent 3eb838cbbb
commit 6b2b9a1e43
2 changed files with 9 additions and 1 deletions

View File

@ -4730,8 +4730,10 @@ DoSetElemFallback(JSContext *cx, BaselineFrame *frame, ICSetElem_Fallback *stub,
if (CanOptimizeDenseSetElem(cx, obj, index.toInt32(), oldShape, oldCapacity, oldInitLength,
&addingCase, &protoDepth))
{
RootedTypeObject type(cx, obj->getType(cx));
RootedShape shape(cx, obj->lastProperty());
RootedTypeObject type(cx, obj->getType(cx));
if (!type)
return false;
if (addingCase && !DenseSetElemStubExists(cx, ICStub::SetElem_DenseAdd, stub, obj)) {
IonSpew(IonSpew_BaselineIC,
@ -9328,6 +9330,9 @@ ICUpdatedStub *
ICSetProp_Native::Compiler::getStub(ICStubSpace *space)
{
RootedTypeObject type(cx, obj_->getType(cx));
if (!type)
return nullptr;
RootedShape shape(cx, obj_->lastProperty());
ICUpdatedStub *stub = ICSetProp_Native::New(space, getStubCode(), type, shape, offset_);
if (!stub || !stub->initUpdatingChain(cx, space))

View File

@ -4951,6 +4951,9 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler {
ICUpdatedStub *getStubSpecific(ICStubSpace *space, const AutoShapeVector *shapes)
{
RootedTypeObject type(cx, obj_->getType(cx));
if (!type)
return nullptr;
RootedShape newShape(cx, obj_->lastProperty());
return ICSetProp_NativeAddImpl<ProtoChainDepth>::New(