Skip to content

Commit

Permalink
Add updates from feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Sep 3, 2020
1 parent db1ee4c commit b407144
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog

## **[Unreleased]**
- [#1590](https://github.com/wasmerio/wasmer/pull/1590) Fix soundness issue in API on vm::Global
- [#1590](https://github.com/wasmerio/wasmer/pull/1590) Fix soundness issue in API of vm::Global
- [#1566](https://github.com/wasmerio/wasmer/pull/1566) Add support for opening special Unix files to the WASI FS

## TODO: 1.0.0-alpha1.0
Expand Down
6 changes: 3 additions & 3 deletions lib/vm/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ impl Global {
unsafe {
let definition = &*self.vm_global_definition.get();
match self.ty().ty {
Type::I32 => Value::from(*definition.as_i32()),
Type::I64 => Value::from(*definition.as_i64()),
Type::I32 => Value::I32(*definition.as_i32()),
Type::I64 => Value::I64(*definition.as_i64()),
Type::F32 => Value::F32(*definition.as_f32()),
Type::F64 => Value::F64(*definition.as_f64()),
Type::V128 => Value::V128(*definition.as_u128()),
Expand Down Expand Up @@ -104,7 +104,7 @@ impl Global {
/// The caller should also ensure that this global is synchronized. Otherwise, use
/// `set` instead.
pub unsafe fn set_unchecked<T>(&self, val: Value<T>) -> Result<(), GlobalError> {
// ideally we'd use atomics here
// ideally we'd use atomics for the global value rather than needing to lock it
let definition = &mut *self.vm_global_definition.get();
match val {
Value::I32(i) => *definition.as_i32_mut() = i,
Expand Down

0 comments on commit b407144

Please sign in to comment.