diff --git a/src/apis/emscripten/mod.rs b/src/apis/emscripten/mod.rs index f1520c9d9..f25b3d718 100644 --- a/src/apis/emscripten/mod.rs +++ b/src/apis/emscripten/mod.rs @@ -355,6 +355,11 @@ pub fn generate_emscripten_env<'a, 'b>() -> ImportObject<&'a str, &'b str> { "nullFunc_iiiiii", ImportValue::Func(nullfunc::nullfunc_iiiiii as _), ); + import_object.set( + "env", + "nullFunc_v", + ImportValue::Func(nullfunc::nullfunc_v as _), + ); import_object.set( "env", "nullFunc_vi", diff --git a/src/apis/emscripten/nullfunc.rs b/src/apis/emscripten/nullfunc.rs index 40351560b..2f6bced33 100644 --- a/src/apis/emscripten/nullfunc.rs +++ b/src/apis/emscripten/nullfunc.rs @@ -26,6 +26,11 @@ pub extern "C" fn nullfunc_iiiiii(_x: u32, _instance: &Instance) { abort_with_message("Invalid function pointer called with signature 'iiiiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); } +pub extern "C" fn nullfunc_v(_x: u32, _instance: &Instance) { + debug!("emscripten::nullfunc_v"); + abort_with_message("Invalid function pointer called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"); +} + pub extern "C" fn nullfunc_vi(_x: u32, _instance: &Instance) { debug!("emscripten::nullfunc_vi"); abort_with_message("Invalid function pointer called with signature 'vi'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)");