diff --git a/lib/c-api/examples/features.c b/lib/c-api/examples/features.c index b9f01258b5e..48290143a61 100644 --- a/lib/c-api/examples/features.c +++ b/lib/c-api/examples/features.c @@ -40,8 +40,8 @@ int main(int argc, const char* argv[]) { printf("Instantiating module...\n"); wasm_extern_vec_t imports = WASM_EMPTY_VEC; - wasm_trap_t* traps = NULL; - wasm_instance_t* instance = wasm_instance_new(store, module, &imports,&traps); + wasm_trap_t* trap = NULL; + wasm_instance_t* instance = wasm_instance_new(store, module, &imports,&trap); if (!instance) { printf("> Error instantiating module!\n"); diff --git a/lib/c-api/src/wasm_c_api/externals/mod.rs b/lib/c-api/src/wasm_c_api/externals/mod.rs index ca1cb279762..0a701db1c78 100644 --- a/lib/c-api/src/wasm_c_api/externals/mod.rs +++ b/lib/c-api/src/wasm_c_api/externals/mod.rs @@ -275,9 +275,9 @@ mod tests { assert(module); wasm_extern_vec_t imports = WASM_EMPTY_VEC; - wasm_trap_t* traps = NULL; + wasm_trap_t* trap = NULL; - wasm_instance_t* instance = wasm_instance_new(store, module, &imports, &traps); + wasm_instance_t* instance = wasm_instance_new(store, module, &imports, &trap); assert(instance); wasm_extern_vec_t exports; diff --git a/lib/c-api/src/wasm_c_api/instance.rs b/lib/c-api/src/wasm_c_api/instance.rs index 0774c6ae43a..2a6833c8df8 100644 --- a/lib/c-api/src/wasm_c_api/instance.rs +++ b/lib/c-api/src/wasm_c_api/instance.rs @@ -25,7 +25,7 @@ pub struct wasm_instance_t { /// 2. Runtime errors that happen when running the module `start` /// function. /// -/// Failures are stored in the `traps` argument; the program doesn't +/// The failure is stored in the `trap` argument; the program doesn't /// panic. /// /// # Notes @@ -41,7 +41,7 @@ pub unsafe extern "C" fn wasm_instance_new( _store: Option<&wasm_store_t>, module: Option<&wasm_module_t>, imports: Option<&wasm_extern_vec_t>, - traps: *mut *mut wasm_trap_t, + trap: *mut *mut wasm_trap_t, ) -> Option> { let module = module?; let imports = imports?; @@ -68,7 +68,7 @@ pub unsafe extern "C" fn wasm_instance_new( Err(InstantiationError::Start(runtime_error)) => { let trap: Box = Box::new(runtime_error.into()); - *traps = Box::into_raw(trap); + *trap = Box::into_raw(trap); return None; } @@ -124,9 +124,9 @@ pub unsafe extern "C" fn wasm_instance_delete(_instance: Option