aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-05-02 15:36:38 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-05-02 15:36:38 -0700
commitd415b4145dd771c937b7295c22d01716428cb3dc (patch)
tree267af40747b033eff687fc9e604e521a49fbc7d9
parent6b5e7e290190ea604d9f3761d8f7e13781cea36a (diff)
ensure floats in varargs
-rw-r--r--src/jsifier.js1
-rwxr-xr-xtests/runner.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index cdfc024e..24fded72 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1404,6 +1404,7 @@ function JSify(data, functionsOnly, givenFunctions) {
varargs.map(function(arg, i) {
var type = varargsTypes[i];
if (type == 0) return null;
+ arg = asmEnsureFloat(arg, type);
var ret;
assert(offset % Runtime.STACK_ALIGN == 0); // varargs must be aligned
if (!varargsByVals[i]) {
diff --git a/tests/runner.py b/tests/runner.py
index 073075e3..86a2da0c 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -4157,7 +4157,7 @@ def process(filename):
int maxxi = getMaxi(6, 2, 5, 21, 4, -10, 19);
printf("maxxi:%d*\\n", maxxi);
- double maxxD = getMaxD(6, (double)2.1, (double)5.1, (double)22.1, (double)4.1, (double)-10.1, (double)19.1);
+ double maxxD = getMaxD(6, (double)2.1, (double)5.1, (double)22.1, (double)4.1, (double)-10.1, (double)19.1, (double)2);
printf("maxxD:%.2f*\\n", (float)maxxD);
// And, as a function pointer