Bug 979721 - Don't leak bailout buffer when overrecursion check fails. r=djvj

This commit is contained in:
Jan de Mooij 2014-03-06 11:30:36 +01:00
parent 079b02433f
commit 6c3ab42325

View File

@ -1361,12 +1361,9 @@ jit::BailoutIonToBaseline(JSContext *cx, JitActivation *activation, IonBailoutIt
mozilla::PodCopy(argv, startFrameFormals.begin(), startFrameFormals.length());
}
// Take the reconstructed baseline stack so it doesn't get freed when builder destructs.
BaselineBailoutInfo *info = builder.takeBuffer();
info->numFrames = frameNo + 1;
// Do stack check.
bool overRecursed = false;
BaselineBailoutInfo *info = builder.info();
uint8_t *newsp = info->incomingStack - (info->copyStackTop - info->copyStackBottom);
#ifdef JS_ARM_SIMULATOR
if (Simulator::Current()->overRecursed(uintptr_t(newsp)))
@ -1379,6 +1376,9 @@ jit::BailoutIonToBaseline(JSContext *cx, JitActivation *activation, IonBailoutIt
return BAILOUT_RETURN_OVERRECURSED;
}
// Take the reconstructed baseline stack so it doesn't get freed when builder destructs.
info = builder.takeBuffer();
info->numFrames = frameNo + 1;
info->bailoutKind = bailoutKind;
*bailoutInfo = info;
return BAILOUT_RETURN_OK;