aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-20 20:04:39 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-20 20:04:39 -0800
commit684b00a029cd0713c04bae8af4c500b4647a2edd (patch)
tree642fcb7a07942356b9448fb72c88f19115937cf9 /src
parent909c747f4f3eb56ba4423d2848cd5b0b301067c8 (diff)
fix varargs by pointer in asm
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js2
-rw-r--r--src/modules.js3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 31efc3f7..727fb41d 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1395,7 +1395,7 @@ function JSify(data, functionsOnly, givenFunctions) {
if (byPointer || ASM_JS) returnType = type.split(' ')[0];
if (byPointer) {
- var sig = Functions.getSignature(returnType, argsTypes);
+ var sig = Functions.getSignature(returnType, argsTypes, hasVarArgs);
if (ASM_JS) {
assert(returnType.search(/\("'\[,/) == -1); // XXX need isFunctionType(type, out)
callIdent = '(' + callIdent + ')&{{{ FTM_' + sig + ' }}}'; // the function table mask is set in emscripten.py
diff --git a/src/modules.js b/src/modules.js
index 3a0bf626..e7779b94 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -228,13 +228,14 @@ var Functions = {
blockAddresses: {}, // maps functions to a map of block labels to label ids
- getSignature: function(returnType, argTypes) {
+ getSignature: function(returnType, argTypes, hasVarArgs) {
var sig = returnType == 'void' ? 'v' : (isIntImplemented(returnType) ? 'i' : 'f');
for (var i = 0; i < argTypes.length; i++) {
var type = argTypes[i];
if (!type) break; // varargs
sig += isIntImplemented(type) ? (getBits(type) == 64 ? 'ii' : 'i') : 'f'; // legalized i64s will be i32s
}
+ if (hasVarArgs) sig += 'i';
return sig;
},