From 8c760da83af8346558894259c0c25c12ec013931 Mon Sep 17 00:00:00 2001 From: Mark McCaskey Date: Fri, 17 Jan 2020 15:10:16 -0800 Subject: [PATCH] Require that imported functions must be `Send` --- CHANGELOG.md | 2 ++ lib/runtime-core/src/typed_func.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a848cb6871a..80e0171af9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## **[Unreleased]** +- [#1161](https://github.com/wasmerio/wasmer/pull/1161) Require imported functions to be `Send`. This is a breaking change that fixes a soundness issue in the API. + ## 0.13.1 - 2020-01-16 - Fix bug in wapm related to the `package.wasmer_extra_flags` entry in the manifest diff --git a/lib/runtime-core/src/typed_func.rs b/lib/runtime-core/src/typed_func.rs index 9de9d40e2e3..f0c22c31d1b 100644 --- a/lib/runtime-core/src/typed_func.rs +++ b/lib/runtime-core/src/typed_func.rs @@ -430,7 +430,7 @@ macro_rules! impl_traits { $( $x: WasmExternType, )* Rets: WasmTypeList, Trap: TrapEarly, - FN: Fn(&mut vm::Ctx $( , $x )*) -> Trap + 'static, + FN: Fn(&mut vm::Ctx $( , $x )*) -> Trap + 'static + Send, { #[allow(non_snake_case)] fn to_raw(self) -> (NonNull, Option>) { @@ -545,7 +545,7 @@ macro_rules! impl_traits { $( $x: WasmExternType, )* Rets: WasmTypeList, Trap: TrapEarly, - FN: Fn($( $x, )*) -> Trap + 'static, + FN: Fn($( $x, )*) -> Trap + 'static + Send, { #[allow(non_snake_case)] fn to_raw(self) -> (NonNull, Option>) {