aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2010-12-15 20:52:08 -0800
committerAlon Zakai <azakai@mozilla.com>2010-12-15 20:52:08 -0800
commit3939368ad428f86e0d21674e13c7ff684c2cfb3c (patch)
tree42e08891cb5f259937184a62a1a9a59c36d195fe /src/jsifier.js
parent8783a09b1d0a02a378406b9d879818a6c02a6358 (diff)
misc fixes and improvements - thanks go to tuba
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 90b155e7..1d1b35df 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -349,9 +349,6 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions) {
if (true) { // TODO: optimize away when not needed
func.JS += ' var __label__;\n';
}
- if (func.hasVarArgs) {
- func.JS += ' var __numArgs__ = ' + func.paramIdents.length + ';\n';
- }
if (func.hasPhi) {
func.JS += ' var __lastLabel__ = null;\n';
}
@@ -909,8 +906,8 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions) {
function makeFunctionCall(ident, params, funcData) {
// Special cases
if (ident == '_llvm_va_start') {
- // varargs - we received a pointer to the varargs as a final parameter
- var data = 'arguments[__numArgs__]';
+ // varargs - we received a pointer to the varargs as a final 'extra' parameter
+ var data = 'arguments[arguments.callee.length]';
if (SAFE_HEAP) {
return 'SAFE_HEAP_STORE(' + params[0].ident + ', ' + data + ', null)';
} else {