Add emscripten nullfunc_v (#65)

This commit is contained in:
Brandon Fish 2018-12-17 21:21:15 -06:00 committed by Lachlan Sneff
parent 93f8cdfc81
commit ac87344013
2 changed files with 10 additions and 0 deletions

View File

@ -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",

View File

@ -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)");