diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-18 23:25:55 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-18 23:25:55 -0700 |
commit | ce03a34d97b1afa3b7abd88d04bbbaffe346f1d9 (patch) | |
tree | 3b355032ee402a595954f703558a7dc84b7a55cf /src/wasm-js.cpp | |
parent | 4a7080b8dc98422b63dc5db3245029d3f689de15 (diff) | |
parent | 50c94e3e9fb6cdf043c7841d73299ee8be5d2cbd (diff) | |
download | binaryen-ce03a34d97b1afa3b7abd88d04bbbaffe346f1d9.tar.gz binaryen-ce03a34d97b1afa3b7abd88d04bbbaffe346f1d9.tar.bz2 binaryen-ce03a34d97b1afa3b7abd88d04bbbaffe346f1d9.zip |
Merge pull request #526 from WebAssembly/spec-test-update
Spec test updates, and many validation fixes
Diffstat (limited to 'src/wasm-js.cpp')
-rw-r--r-- | src/wasm-js.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/wasm-js.cpp b/src/wasm-js.cpp index ea1883072..87059f9be 100644 --- a/src/wasm-js.cpp +++ b/src/wasm-js.cpp @@ -91,7 +91,7 @@ extern "C" void EMSCRIPTEN_KEEPALIVE load_asm2wasm(char *input) { auto& global = pair.second; if (!global.import) continue; // non-imports are initialized to zero in the typed array anyhow, so nothing to do here double value = EM_ASM_DOUBLE({ return Module['lookupImport'](Pointer_stringify($0), Pointer_stringify($1)) }, global.module.str, global.base.str); - unsigned address = global.address; + uint32_t address = global.address; switch (global.type) { case i32: EM_ASM_({ Module['info'].parent['HEAP32'][$0 >> 2] = $1 }, address, value); break; case f32: EM_ASM_({ Module['info'].parent['HEAPF32'][$0 >> 2] = $1 }, address, value); break; @@ -196,7 +196,7 @@ extern "C" void EMSCRIPTEN_KEEPALIVE instantiate() { var source = Module['HEAP8'].subarray($1, $1 + $2); var target = new Int8Array(Module['outside']['newBuffer']); target.set(source, $0); - }, segment.offset, &segment.data[0], segment.data.size()); + }, (uint32_t)segment.offset, &segment.data[0], segment.data.size()); } } @@ -236,7 +236,8 @@ extern "C" void EMSCRIPTEN_KEEPALIVE instantiate() { } } - Literal load(Load* load, Address addr) override { + Literal load(Load* load, Address address) override { + uint32_t addr = address; if (load->align < load->bytes || (addr & (load->bytes-1))) { int64_t out64; double ret = EM_ASM_DOUBLE({ @@ -325,7 +326,8 @@ extern "C" void EMSCRIPTEN_KEEPALIVE instantiate() { } } - void store(Store* store_, Address addr, Literal value) override { + void store(Store* store_, Address address, Literal value) override { + uint32_t addr = address; // support int64 stores if (value.type == WasmType::i64) { Store fake = *store_; |