Fix func_calls to not pass NULL but WASM_EMPTY_VEC

This commit is contained in:
Mark McCaskey
2020-10-19 14:50:39 -07:00
parent 6d326233f7
commit c5df8cfd9e
3 changed files with 10 additions and 6 deletions

View File

@@ -171,7 +171,10 @@ int main(int argc, char* argv[]) {
print_wasmer_error(); print_wasmer_error();
return -1; return -1;
} }
own wasm_trap_t* trap = wasm_func_call(start_function, NULL, NULL);
wasm_val_vec_t args = WASM_EMPTY_VEC;
wasm_val_vec_t results = WASM_EMPTY_VEC;
own wasm_trap_t* trap = wasm_func_call(start_function, &args, &results);
if (trap) { if (trap) {
fprintf(stderr, "Trap is not NULL: TODO:\n"); fprintf(stderr, "Trap is not NULL: TODO:\n");
return -1; return -1;

View File

@@ -115,7 +115,7 @@ fn run_c_compile(
#[test] #[test]
fn object_file_engine_works() -> anyhow::Result<()> { fn object_file_engine_works() -> anyhow::Result<()> {
let temp_dir = tempfile::tempdir()?; let temp_dir = tempfile::tempdir().context("Making a temp dir")?;
let operating_dir: PathBuf = temp_dir.path().to_owned(); let operating_dir: PathBuf = temp_dir.path().to_owned();
let wasm_path = operating_dir.join(object_file_engine_test_wasm_path()); let wasm_path = operating_dir.join(object_file_engine_test_wasm_path());

View File

@@ -60,7 +60,6 @@ int main() {
wasm_extern_vec_t imports; wasm_extern_vec_t imports;
wasm_extern_vec_new_uninitialized(&imports, import_types.size); wasm_extern_vec_new_uninitialized(&imports, import_types.size);
wasm_importtype_vec_delete(&import_types); wasm_importtype_vec_delete(&import_types);
bool get_imports_result = wasi_get_imports(store, module, wasi_env, &imports); bool get_imports_result = wasi_get_imports(store, module, wasi_env, &imports);
@@ -89,13 +88,15 @@ int main() {
} }
fflush(stdout); fflush(stdout);
own wasm_trap_t* trap = wasm_func_call(start_function, NULL, NULL);
wasm_val_vec_t args = WASM_EMPTY_VEC;
wasm_val_vec_t results = WASM_EMPTY_VEC;
own wasm_trap_t* trap = wasm_func_call(start_function, &args, &results);
if (trap) { if (trap) {
fprintf(stderr, "Trap is not NULL: TODO:\n"); fprintf(stderr, "Trap is not NULL: TODO:\n");
return -1; return -1;
} }
wasm_extern_vec_delete(&imports);
wasm_instance_delete(instance); wasm_instance_delete(instance);
wasm_module_delete(module); wasm_module_delete(module);
wasm_store_delete(store); wasm_store_delete(store);