Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit 6b9c559

Browse files
authored
Merge pull request #379 from bytecodealliance/acf/safer-yield
Make yield methods take `&mut Vmctx`; update semver
2 parents 085146d + 86b00ea commit 6b9c559

File tree

15 files changed

+95
-95
lines changed

15 files changed

+95
-95
lines changed

Cargo.lock

Lines changed: 49 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lucet-module/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lucet-module"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
description = "A structured interface for Lucet modules"
55
homepage = "https://github.com/fastly/lucet"
66
repository = "https://github.com/fastly/lucet"

lucet-objdump/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lucet-objdump"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
description = "Analyze object files emitted by the Lucet compiler"
55
homepage = "https://github.com/fastly/lucet"
66
repository = "https://github.com/fastly/lucet"
@@ -13,7 +13,7 @@ edition = "2018"
1313
goblin="0.0.24"
1414
byteorder="1.2.1"
1515
colored="1.8.0"
16-
lucet-module = { path = "../lucet-module", version = "0.4.2" }
16+
lucet-module = { path = "../lucet-module", version = "0.5.0" }
1717

1818
[package.metadata.deb]
1919
name = "fst-lucet-objdump"

lucet-runtime/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lucet-runtime"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
description = "Pure Rust runtime for Lucet WebAssembly toolchain"
55
homepage = "https://github.com/fastly/lucet"
66
repository = "https://github.com/fastly/lucet"
@@ -11,18 +11,18 @@ edition = "2018"
1111

1212
[dependencies]
1313
libc = "0.2.65"
14-
lucet-runtime-internals = { path = "lucet-runtime-internals", version = "0.4.2" }
15-
lucet-module = { path = "../lucet-module", version = "0.4.2" }
14+
lucet-runtime-internals = { path = "lucet-runtime-internals", version = "0.5.0" }
15+
lucet-module = { path = "../lucet-module", version = "0.5.0" }
1616
num-traits = "0.2"
1717
num-derive = "0.3.0"
1818

1919
[dev-dependencies]
2020
byteorder = "1.2"
2121
failure = "0.1"
2222
lazy_static = "1.1"
23-
lucetc = { path = "../lucetc", version = "0.4.2" }
24-
lucet-runtime-tests = { path = "lucet-runtime-tests", version = "0.4.2" }
25-
lucet-wasi-sdk = { path = "../lucet-wasi-sdk", version = "0.4.2" }
23+
lucetc = { path = "../lucetc", version = "0.5.0" }
24+
lucet-runtime-tests = { path = "lucet-runtime-tests", version = "0.5.0" }
25+
lucet-wasi-sdk = { path = "../lucet-wasi-sdk", version = "0.5.0" }
2626
nix = "0.15"
2727
rayon = "1.0"
2828
tempfile = "3.0"

lucet-runtime/lucet-runtime-internals/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lucet-runtime-internals"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
description = "Pure Rust runtime for Lucet WebAssembly toolchain (internals)"
55
homepage = "https://github.com/fastly/lucet"
66
repository = "https://github.com/fastly/lucet"
@@ -10,8 +10,8 @@ authors = ["Lucet team <lucet@fastly.com>"]
1010
edition = "2018"
1111

1212
[dependencies]
13-
lucet-module = { path = "../../lucet-module", version = "0.4.2" }
14-
lucet-runtime-macros = { path = "../lucet-runtime-macros", version = "0.4.2" }
13+
lucet-module = { path = "../../lucet-module", version = "0.5.0" }
14+
lucet-runtime-macros = { path = "../lucet-runtime-macros", version = "0.5.0" }
1515

1616
bitflags = "1.0"
1717
bincode = "1.1.4"

lucet-runtime/lucet-runtime-internals/src/hostcall_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/// }
2323
/// ```
2424
#[macro_export]
25-
#[deprecated(since = "0.4.2", note = "Use the #[lucet_hostcall] attribute instead")]
25+
#[deprecated(since = "0.5.0", note = "Use the #[lucet_hostcall] attribute instead")]
2626
macro_rules! lucet_hostcalls {
2727
{
2828
$(

lucet-runtime/lucet-runtime-internals/src/vmctx.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub trait VmctxInternal {
7878
///
7979
/// The dynamic type checks used by the other yield methods should make this explicit option
8080
/// type redundant, however this interface is used to avoid exposing a panic to the C API.
81-
fn yield_val_try_val<A: Any + 'static, R: Any + 'static>(&self, val: A) -> Option<R>;
81+
fn yield_val_try_val<A: Any + 'static, R: Any + 'static>(&mut self, val: A) -> Option<R>;
8282
}
8383

8484
impl VmctxInternal for Vmctx {
@@ -105,7 +105,7 @@ impl VmctxInternal for Vmctx {
105105
}
106106
}
107107

108-
fn yield_val_try_val<A: Any + 'static, R: Any + 'static>(&self, val: A) -> Option<R> {
108+
fn yield_val_try_val<A: Any + 'static, R: Any + 'static>(&mut self, val: A) -> Option<R> {
109109
self.yield_impl::<A, R>(val);
110110
self.try_take_resumed_val()
111111
}
@@ -321,7 +321,7 @@ impl Vmctx {
321321
///
322322
/// (The reason for the trailing underscore in the name is that Rust reserves `yield` as a
323323
/// keyword for future use.)
324-
pub fn yield_(&self) {
324+
pub fn yield_(&mut self) {
325325
self.yield_val_expecting_val::<EmptyYieldVal, EmptyYieldVal>(EmptyYieldVal);
326326
}
327327

@@ -332,7 +332,7 @@ impl Vmctx {
332332
/// After suspending, the instance may be resumed by calling
333333
/// [`Instance::resume_with_val()`](../struct.Instance.html#method.resume_with_val) from the
334334
/// host with a value of type `R`.
335-
pub fn yield_expecting_val<R: Any + 'static>(&self) -> R {
335+
pub fn yield_expecting_val<R: Any + 'static>(&mut self) -> R {
336336
self.yield_val_expecting_val::<EmptyYieldVal, R>(EmptyYieldVal)
337337
}
338338

@@ -342,7 +342,7 @@ impl Vmctx {
342342
///
343343
/// After suspending, the instance may be resumed by the host using
344344
/// [`Instance::resume()`](../struct.Instance.html#method.resume).
345-
pub fn yield_val<A: Any + 'static>(&self, val: A) {
345+
pub fn yield_val<A: Any + 'static>(&mut self, val: A) {
346346
self.yield_val_expecting_val::<A, EmptyYieldVal>(val);
347347
}
348348

@@ -353,12 +353,12 @@ impl Vmctx {
353353
/// After suspending, the instance may be resumed by calling
354354
/// [`Instance::resume_with_val()`](../struct.Instance.html#method.resume_with_val) from the
355355
/// host with a value of type `R`.
356-
pub fn yield_val_expecting_val<A: Any + 'static, R: Any + 'static>(&self, val: A) -> R {
356+
pub fn yield_val_expecting_val<A: Any + 'static, R: Any + 'static>(&mut self, val: A) -> R {
357357
self.yield_impl::<A, R>(val);
358358
self.take_resumed_val()
359359
}
360360

361-
fn yield_impl<A: Any + 'static, R: Any + 'static>(&self, val: A) {
361+
fn yield_impl<A: Any + 'static, R: Any + 'static>(&mut self, val: A) {
362362
let inst = unsafe { self.instance_mut() };
363363
let expecting: Box<PhantomData<R>> = Box::new(PhantomData);
364364
inst.state = State::Yielding {

lucet-runtime/lucet-runtime-macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lucet-runtime-macros"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
description = "Macros for the Lucet WebAssembly runtime"
55
homepage = "https://github.com/bytecodealliance/lucet"
66
repository = "https://github.com/bytecodealliance/lucet"

0 commit comments

Comments
 (0)