aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-21 10:17:52 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-29 13:01:58 -0700
commitc2816fad68242e8e85a731d32527115673fb9422 (patch)
tree192cd801103732d90c8e383d0f368f149ed97010 /src/jsifier.js
parentec9707170f4e6c8f016c2e2ea27a53abf1326410 (diff)
implement le32 varargs as a struct with two fields: a start and an offset
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index a2ed7f92..acb0332b 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1296,7 +1296,12 @@ function JSify(data, functionsOnly, givenFunctions) {
}
});
makeFuncLineActor('va_arg', function(item) {
- return makeGetValue(item.value.ident, 0, item.type);
+ assert(TARGET_LE32);
+ var ident = item.value.ident;
+ var move = Runtime.getNativeTypeSize(item.type);
+ return '(tempInt=' + makeGetValue(ident, 4, '*') + ',' +
+ makeSetValue(ident, 4, 'tempInt + ' + move, '*') + ',' +
+ makeGetValue(makeGetValue(ident, 0, '*'), 'tempInt', item.type) + ')';
});
makeFuncLineActor('mathop', processMathop);