Fix wasm_export_functions when using a return statement (#12107)

When used a return statement before we directly returned from the function which is obviously wrong.
This commit is contained in:
Bastian Köcher
2022-08-25 13:18:53 +02:00
committed by GitHub
parent 0fb0ef8c2f
commit 7c465dfe6a
3 changed files with 241 additions and 225 deletions
@@ -918,3 +918,14 @@ fn unreachable_intrinsic(wasm_method: WasmExecutionMethod) {
error => panic!("unexpected error: {:?}", error),
}
}
test_wasm_execution!(return_value);
fn return_value(wasm_method: WasmExecutionMethod) {
let mut ext = TestExternalities::default();
let mut ext = ext.ext();
assert_eq!(
call_in_wasm("test_return_value", &[], wasm_method, &mut ext).unwrap(),
(1234u64).encode()
);
}