Skip to content

Commit 519a247

Browse files
committed
[wasm64] Fix makeHEAPView for addresses over 4gb
This enables all the cubegeom tests to pass
1 parent fa57899 commit 519a247

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,8 @@ jobs:
829829
browser64_4gb.test_html5_webgl_create_context*
830830
browser64_4gb.test_sdl_image
831831
browser64_4gb.test_wasm_worker*
832+
browser64_4gb.test_cube_explosion
833+
browser64_4gb.test_cubegeom_*
832834
"
833835
test-browser-firefox:
834836
executor: bionic

src/parseTools.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,16 @@ function makeSetValueImpl(ptr, pos, value, type) {
429429
function makeHEAPView(which, start, end) {
430430
const size = parseInt(which.replace('U', '').replace('F', '')) / 8;
431431
const shift = Math.log2(size);
432-
const mod = size == 1 ? '' : (CAN_ADDRESS_2GB || MEMORY64) ? ('>>>' + shift) : ('>>' + shift);
432+
let mod = '';
433+
if (size != 1) {
434+
if (MEMORY64) {
435+
mod = '/' + size;
436+
} else if (CAN_ADDRESS_2GB) {
437+
mod = '>>>' + shift;
438+
} else {
439+
mod = '>>' + shift;
440+
}
441+
}
433442
return `HEAP${which}.subarray((${start})${mod}, (${end})${mod})`;
434443
}
435444

0 commit comments

Comments
 (0)