diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 7 | ||||
-rw-r--r-- | src/library.js | 6 |
2 files changed, 12 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); diff --git a/src/library.js b/src/library.js index c62b6a05..1686fc70 100644 --- a/src/library.js +++ b/src/library.js @@ -4865,7 +4865,13 @@ LibraryManager.library = { llvm_va_start__inline: function(ptr) { // varargs - we received a pointer to the varargs as a final 'extra' parameter called 'varrp' +#if TARGET_X86 return makeSetValue(ptr, 0, 'varrp', 'void*'); +#endif +#if TARGET_LE32 + // 4-word structure: start, current offset + return makeSetValue(ptr, 0, 'varrp', 'void*') + ';' + makeSetValue(ptr, 4, 0, 'void*'); +#endif }, llvm_va_end: function() {}, |