Bug 855526 - Don't assert on busted asm.js modules with more than 3 arguments. r=luke.

--HG--
extra : rebase_source : 3d168e2bded38f499d563f00d0dcc245aa9d1a02
This commit is contained in:
Nicholas Nethercote 2013-04-01 15:05:49 -07:00
parent 3f24ad16b6
commit 3df8590983
2 changed files with 16 additions and 8 deletions

View File

@ -395,20 +395,15 @@ HandleDynamicLinkFailure(JSContext *cx, CallArgs args, AsmJSModule &module, Hand
// Call the function we just recompiled.
unsigned argc = args.length();
JS_ASSERT(argc <= 3);
InvokeArgsGuard args2;
if (!cx->stack.pushInvokeArgs(cx, args.length(), &args2))
if (!cx->stack.pushInvokeArgs(cx, argc, &args2))
return false;
args2.setCallee(ObjectValue(*fun));
args2.setThis(args.thisv());
if (argc > 0)
args2[0] = args[0];
if (argc > 1)
args2[1] = args[1];
if (argc > 2)
args2[2] = args[2];
for (unsigned i = 0; i < argc; i++)
args2[i] = args[i];
if (!Invoke(cx, args2))
return false;

View File

@ -0,0 +1,13 @@
// Don't assert.
try {
eval('\
function asmModule(g, foreign, heap) {\
"use asm";\
let HEAP8 = new g.Int8Array(heap);\
function f() { return 17; } \
return {f: f};\
}\
let m = asmModule("", "", 1, "");\
');
} catch (ex) {
}