diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-13 14:26:38 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-13 14:26:38 -0800 |
commit | aa45fda1f29089fffae10909021bf013a175e239 (patch) | |
tree | 06ac12576a375f83681a4393be9267dce2c157b9 | |
parent | 99b2aeb2cd09cf7d1b78e4b3fb06335c9b6816ac (diff) |
ensure tempDoublePtr is properly aligned
-rw-r--r-- | src/preamble.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/preamble.js b/src/preamble.js index 78a718e2..f7952781 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -700,7 +700,8 @@ STACK_ROOT = STACKTOP = Runtime.alignMemory(1); STACK_MAX = TOTAL_STACK; // we lose a little stack here, but TOTAL_STACK is nice and round so use that as the max #if USE_TYPED_ARRAYS == 2 -var tempDoublePtr = allocate(8, 'i8', ALLOC_STACK); +var tempDoublePtr = Runtime.alignMemory(allocate(12, 'i8', ALLOC_STACK), 8); +assert(tempDoublePtr % 8 == 0); function copyTempFloat(ptr) { // functions, because inlining this code is increases code size too much HEAP8[tempDoublePtr] = HEAP8[ptr]; HEAP8[tempDoublePtr+1] = HEAP8[ptr+1]; |