Only fasttrack applys where the arguments array has the same lengths as the expected arguments of the called function (456494, r=brendan).

This commit is contained in:
Andreas Gal 2008-09-24 16:45:27 -07:00
Родитель a73af6a1d4
Коммит 663c1017db
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -4927,8 +4927,10 @@ TraceRecorder::record_JSOP_CALL()
if (!FUN_INTERPRETED(tfun))
ABORT_TRACE("can't trace Function.prototype.apply(native_function, arguments)");
// We can only fasttrack applys where the argument array we pass in has the
// same length (fp->argc) as the number of arguments the function expects (tfun->nargs).
argc = fp->argc;
if (tfun->nargs != argc)
if (tfun->nargs != argc || fp->fun->nargs != argc)
ABORT_TRACE("can't trace Function.prototype.apply(scripted_function, arguments)");
jsval* sp = fp->regs->sp - 4;