aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-11-28 18:59:27 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-07 14:23:19 -0800
commitd618e974df0f4cffe955da1cd3d9657ef91fc481 (patch)
treec3949442f79b043dd785602b1fbcc530e7d8a1c7 /src/parseTools.js
parentb5fbdf8a71688fe65f260e99caa1308146db549a (diff)
only do asm.js heap corrections/guards in funcs phase, to not confused handwritten library code
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 9e0d4f9f..4e1833ae 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -939,7 +939,7 @@ function getHeapOffset(offset, type) {
}
var shifts = Math.log(Runtime.getNativeTypeSize(type))/Math.LN2;
offset = '(' + offset + ')';
- if (ASM_JS) offset = '(' + offset + '&' + memoryMask + ')';
+ if (ASM_JS && phase == 'funcs') offset = '(' + offset + '&' + memoryMask + ')';
if (shifts != 0) {
return '(' + offset + '>>' + shifts + ')';
} else {
@@ -1004,7 +1004,7 @@ function makeGetValue(ptr, pos, type, noNeedFirst, unsigned, ignore, align, noSa
return 'SAFE_HEAP_LOAD(' + offset + ', ' + type + ', ' + (!!unsigned+0) + ', ' + ((!checkSafeHeap() || ignore)|0) + ')';
} else {
var ret = makeGetSlabs(ptr, type, false, unsigned)[0] + '[' + getHeapOffset(offset, type) + ']';
- if (ASM_JS) {
+ if (ASM_JS && phase == 'funcs') {
if (type in Runtime.INT_TYPES) {
ret = ret + '|0';
} else {