Bug 866888 part 3 - Fix bailout overrecursion check. r=djvj

This commit is contained in:
Jan de Mooij 2013-07-23 09:23:40 +02:00
parent ec0d5ce176
commit 6732c0fc47
2 changed files with 7 additions and 8 deletions

View File

@ -1243,10 +1243,12 @@ ion::BailoutIonToBaseline(JSContext *cx, JitActivation *activation, IonBailoutIt
// Do stack check.
bool overRecursed = false;
JS_CHECK_RECURSION_WITH_EXTRA_DONT_REPORT(cx, info->copyStackTop - info->copyStackBottom,
overRecursed = true);
if (overRecursed)
uint8_t *newsp = info->incomingStack - (info->copyStackTop - info->copyStackBottom);
JS_CHECK_RECURSION_WITH_SP_DONT_REPORT(cx, newsp, overRecursed = true);
if (overRecursed) {
IonSpew(IonSpew_BaselineBailouts, " Overrecursion check failed!");
return BAILOUT_RETURN_OVERRECURSED;
}
info->bailoutKind = bailoutKind;
*bailoutInfo = info;

View File

@ -638,12 +638,9 @@ GetNativeStackLimit(JSContext *cx)
} \
JS_END_MACRO
#define JS_CHECK_RECURSION_WITH_EXTRA_DONT_REPORT(cx, extra, onerror) \
#define JS_CHECK_RECURSION_WITH_SP_DONT_REPORT(cx, sp, onerror) \
JS_BEGIN_MACRO \
uint8_t stackDummy_; \
if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), \
&stackDummy_ - (extra))) \
{ \
if (!JS_CHECK_STACK_SIZE(js::GetNativeStackLimit(cx), sp)) { \
onerror; \
} \
JS_END_MACRO