aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-18 18:23:03 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-18 18:23:03 -0700
commit86462ba6a0fa81eec03afc32ee74ffa91928e004 (patch)
tree00b313771cf5340ce267dc764ead7fbb911ff11a /src/jsifier.js
parentf144ebdbd829a9223e50d7858d7ba79e43030875 (diff)
parent819ccd4914ba1f5db1c21829cb4615886829f26e (diff)
Merge pull request #1301 from Manny-MADE/va_lists_fix
BUGFIX: lists cannot be copied as "llvm_va_copy" was broken, didn't copy list offset
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index faef88d5..88b9d9f6 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1310,8 +1310,10 @@ function JSify(data, functionsOnly, givenFunctions) {
assert(TARGET_LE32);
var ident = item.value.ident;
var move = Runtime.STACK_ALIGN;
- return '(tempInt=' + makeGetValue(ident, 4, '*') + ',' +
- makeSetValue(ident, 4, 'tempInt + ' + move, '*') + ',' +
+
+ // store current list offset in tempInt, advance list offset by STACK_ALIGN, return list entry stored at tempInt
+ return '(tempInt=' + makeGetValue(ident, Runtime.QUANTUM_SIZE, '*') + ',' +
+ makeSetValue(ident, Runtime.QUANTUM_SIZE, 'tempInt + ' + move, '*') + ',' +
makeGetValue(makeGetValue(ident, 0, '*'), 'tempInt', item.type) + ')';
});