aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
},