Fixed Context references

This commit is contained in:
Syrus Akbary
2023-02-10 16:06:47 -08:00
parent c3576e1b3f
commit c9e18e8d57
4 changed files with 5 additions and 5 deletions

View File

@@ -424,7 +424,7 @@ impl Function {
} }
if !arg.is_from_store(store) { if !arg.is_from_store(store) {
return Err(RuntimeError::new( return Err(RuntimeError::new(
"cross-`Context` values are not supported", "cross-`Store` values are not supported",
)); ));
} }
*slot = arg.as_raw(store); *slot = arg.as_raw(store);

View File

@@ -61,7 +61,7 @@ impl Global {
) -> Result<Self, RuntimeError> { ) -> Result<Self, RuntimeError> {
if !val.is_from_store(store) { if !val.is_from_store(store) {
return Err(RuntimeError::new( return Err(RuntimeError::new(
"cross-`Context` values are not supported", "cross-`Store` values are not supported",
)); ));
} }
let global = VMGlobal::new(GlobalType { let global = VMGlobal::new(GlobalType {
@@ -165,7 +165,7 @@ impl Global {
pub fn set(&self, store: &mut impl AsStoreMut, val: Value) -> Result<(), RuntimeError> { pub fn set(&self, store: &mut impl AsStoreMut, val: Value) -> Result<(), RuntimeError> {
if !val.is_from_store(store) { if !val.is_from_store(store) {
return Err(RuntimeError::new( return Err(RuntimeError::new(
"cross-`Context` values are not supported", "cross-`Store` values are not supported",
)); ));
} }
if self.ty(store).mutability != Mutability::Var { if self.ty(store).mutability != Mutability::Var {

View File

@@ -156,7 +156,7 @@ impl Table {
) -> Result<(), RuntimeError> { ) -> Result<(), RuntimeError> {
if dst_table.handle.store_id() != src_table.handle.store_id() { if dst_table.handle.store_id() != src_table.handle.store_id() {
return Err(RuntimeError::new( return Err(RuntimeError::new(
"cross-`Context` table copies are not supported", "cross-`Store` table copies are not supported",
)); ));
} }
let store = store; let store = store;

View File

@@ -78,7 +78,7 @@ macro_rules! impl_native_traits {
// Ensure all parameters come from the same context. // Ensure all parameters come from the same context.
if $(!FromToNativeWasmType::is_from_store(&$x, store) ||)* false { if $(!FromToNativeWasmType::is_from_store(&$x, store) ||)* false {
return Err(RuntimeError::new( return Err(RuntimeError::new(
"cross-`Context` values are not supported", "cross-`Store` values are not supported",
)); ));
} }
// TODO: when `const fn` related features mature more, we can declare a single array // TODO: when `const fn` related features mature more, we can declare a single array