Bug 656490 - Fix direct-eval assert (r=dmandelin)

This commit is contained in:
Luke Wagner 2011-05-26 17:23:21 -07:00
parent 2299c54162
commit bf3e38e9d2
3 changed files with 6 additions and 2 deletions

View File

@ -0,0 +1,4 @@
// |jit-test| debug
function f() { eval(''); }
trap(f, 6, '');
f();

View File

@ -1285,7 +1285,7 @@ DirectEval(JSContext *cx, const CallArgs &call)
StackFrame *caller = cx->fp();
JS_ASSERT(caller->isScriptFrame());
JS_ASSERT(IsBuiltinEvalForScope(&caller->scopeChain(), call.calleev()));
JS_ASSERT(*cx->regs().pc == JSOP_EVAL);
JS_ASSERT(js_GetOpcode(cx, cx->fp()->script(), cx->regs().pc) == JSOP_EVAL);
AutoFunctionCallProbe callProbe(cx, call.callee().getFunctionPrivate(), caller->script());

View File

@ -102,7 +102,7 @@ inline const char *
CurrentScriptFileAndLine(JSContext *cx, uintN *linenop, LineOption opt)
{
if (opt == CALLED_FROM_JSOP_EVAL) {
JS_ASSERT(*cx->regs().pc == JSOP_EVAL);
JS_ASSERT(js_GetOpcode(cx, cx->fp()->script(), cx->regs().pc) == JSOP_EVAL);
JS_ASSERT(*(cx->regs().pc + JSOP_EVAL_LENGTH) == JSOP_LINENO);
*linenop = GET_UINT16(cx->regs().pc + JSOP_EVAL_LENGTH);
return cx->fp()->script()->filename;