aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authormanny/MADE <nerurkar@made-apps.biz>2013-06-17 14:03:11 +0200
committermanny/MADE <nerurkar@made-apps.biz>2013-06-18 14:00:05 +0200
commitf015eb3da85cae5fd3cad36a17c6633b6cb5ca7b (patch)
tree96ba708a195be439daa6b1778cd7c82cd4f1bb8b /src/jsifier.js
parenta04b53740e3de7cc8b4c4b9d6fd9fd903c0f97aa (diff)
IMPROVED: va_list offset is not hardcoded, added comments
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) + ')';
});