aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-22 13:41:34 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-29 13:02:00 -0700
commit049f78e0aaec83d9a0b5ec5bdf209d5c895b489a (patch)
treef33586898abe6addfce70ad96cd1ca8105b63559
parent5eb7cf382f79086d9d6d62ee97e65cc7adc50a2b (diff)
fix varargs alignment in le32
-rw-r--r--src/jsifier.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 1cb6308d..c82d284a 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1400,11 +1400,11 @@ function JSify(data, functionsOnly, givenFunctions) {
var type = varargsTypes[i];
if (type == 0) return null;
var ret;
+ assert(offset % Runtime.STACK_ALIGN == 0); // varargs must be aligned
if (!varargsByVals[i]) {
ret = makeSetValue(getFastValue('tempInt', '+', offset), 0, arg, type, null, null, QUANTUM_SIZE, null, ',');
- offset += Runtime.getNativeFieldSize(type);
+ offset += Runtime.alignMemory(Runtime.getNativeFieldSize(type), Runtime.STACK_ALIGN);
} else {
- assert(offset % Runtime.STACK_ALIGN == 0); // varargs must be aligned
var size = calcAllocatedSize(removeAllPointing(type));
ret = makeCopyValues(getFastValue('tempInt', '+', offset), arg, size, null, null, varargsByVals[i], ',');
offset += Runtime.forceAlign(size, Runtime.STACK_ALIGN);