Bug 881608 - OdinMonkey: handle Type::Unknown when checking call args (r=bbouvier)
authorLuke Wagner <luke@mozilla.com>
Tue, 11 Jun 2013 09:53:53 -0700
changeset 146165 acda9f185e0babd06fd88fb9ffcb61f5ee5c99db
parent 146164 0cb01583448b23c7b99e538a6db3c45b395588db
child 146166 7e69e102a432581678426e51f11f8aac1f23a251
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs881608
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 881608 - OdinMonkey: handle Type::Unknown when checking call args (r=bbouvier)
js/src/ion/AsmJS.cpp
js/src/jit-test/tests/asm.js/testFFI.js
--- a/js/src/ion/AsmJS.cpp
+++ b/js/src/ion/AsmJS.cpp
@@ -3397,18 +3397,18 @@ CheckCallArgs(FunctionCompiler &f, Parse
 
     ParseNode *argNode = CallArgList(callNode);
     for (unsigned i = 0; i < CallArgListLength(callNode); i++, argNode = NextNode(argNode)) {
         MDefinition *argDef;
         Type argType;
         if (!CheckExpr(f, argNode, use, &argDef, &argType))
             return false;
 
-        if (argType.isVoid())
-            return f.fail(argNode, "void is not a valid argument type");
+        if (argType.toMIRType() == MIRType_None)
+            return f.failf(argNode, "%s is not a valid argument type", argType.toChars());
 
         if (!f.passArg(argDef, argType, args))
             return false;
     }
 
     f.finishCallArgs(args);
     return true;
 }
--- a/js/src/jit-test/tests/asm.js/testFFI.js
+++ b/js/src/jit-test/tests/asm.js/testFFI.js
@@ -25,16 +25,18 @@ assertAsmTypeFail('glob', 'imp', USE_ASM
 assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { var i = 0; return (i + inc)|0 } return f');
 assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { inc = 0 } return f');
 assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { return (inc() + 1)|0 } return f');
 assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { return +((inc()|0) + 1.1) } return f');
 assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { return +(inc() + 1.1) } return f');
 assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { return (+inc() + 1)|0 } return f');
 assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { var i = 0; inc(i>>>0) } return f');
 assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { return inc(); return } return f');
+assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { inc(inc()) } return f');
+assertAsmTypeFail('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { g(inc()) } function g() {} return f');
 
 assertAsmLinkFail(asmCompile('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { return inc()|0 } return f'), null, {});
 assertAsmLinkFail(asmCompile('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { return inc()|0 } return f'), null, {inc:0});
 assertAsmLinkFail(asmCompile('glob', 'imp', USE_ASM + 'var inc=imp.inc; function f() { return inc()|0 } return f'), null, {inc:{}});
 
 assertEq(asmLink(asmCompile('glob', 'imp', USE_ASM + 'var inc=imp.inc; function g() { inc() } return g'), null, imp)(), undefined);
 assertEq(counter, 1);