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 authored and GitHub committed 2022-08-25 13:18:53 +02:00
1 parent 0fb0ef8c2f
commit 7c465dfe6a
3 files changed
+241 -225

No files matched your search

@@ -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()
);
}