From 0f8524da3c0089de35382581653e480fa69ce5d8 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Sun, 18 Feb 2018 23:55:34 +0100 Subject: [PATCH] Ensure memory accesses are exposed before accessing --- crates/wasm-bindgen-cli-support/src/js.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/wasm-bindgen-cli-support/src/js.rs b/crates/wasm-bindgen-cli-support/src/js.rs index b06986a9..3108beb6 100644 --- a/crates/wasm-bindgen-cli-support/src/js.rs +++ b/crates/wasm-bindgen-cli-support/src/js.rs @@ -657,6 +657,7 @@ impl<'a> Context<'a> { } fn expose_get_array_i8_from_wasm(&mut self) { + self.expose_uint8_memory(); if !self.exposed_globals.insert("get_array_i8_from_wasm") { return } @@ -670,6 +671,7 @@ impl<'a> Context<'a> { } fn expose_get_array_u8_from_wasm(&mut self) { + self.expose_uint8_memory(); if !self.exposed_globals.insert("get_array_u8_from_wasm") { return } @@ -683,6 +685,7 @@ impl<'a> Context<'a> { } fn expose_get_array_i16_from_wasm(&mut self) { + self.expose_uint16_memory(); if !self.exposed_globals.insert("get_array_i16_from_wasm") { return } @@ -696,6 +699,7 @@ impl<'a> Context<'a> { } fn expose_get_array_u16_from_wasm(&mut self) { + self.expose_uint16_memory(); if !self.exposed_globals.insert("get_array_u16_from_wasm") { return } @@ -709,6 +713,7 @@ impl<'a> Context<'a> { } fn expose_get_array_i32_from_wasm(&mut self) { + self.expose_uint32_memory(); if !self.exposed_globals.insert("get_array_i32_from_wasm") { return } @@ -722,6 +727,7 @@ impl<'a> Context<'a> { } fn expose_get_array_u32_from_wasm(&mut self) { + self.expose_uint32_memory(); if !self.exposed_globals.insert("get_array_u32_from_wasm") { return }