rename null func

This commit is contained in:
Mackenzie Clark
2019-03-27 08:36:41 -07:00
parent d65a5dfe57
commit 8b861d01db

View File

@ -713,7 +713,7 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
}; };
for null_func_name in globals.null_func_names.iter() { for null_func_name in globals.null_func_names.iter() {
env_ns.insert(null_func_name.as_str(), Func::new(nullfunc_x).to_export()); env_ns.insert(null_func_name.as_str(), Func::new(nullfunc).to_export());
} }
let import_object: ImportObject = imports! { let import_object: ImportObject = imports! {
@ -735,7 +735,7 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
import_object import_object
} }
pub fn nullfunc_x(ctx: &mut Ctx, _x: u32) { pub fn nullfunc(ctx: &mut Ctx, _x: u32) {
use crate::process::abort_with_message; use crate::process::abort_with_message;
debug!("emscripten::nullfunc_i {}", _x); debug!("emscripten::nullfunc_i {}", _x);
abort_with_message(ctx, "Invalid function pointer called with signature 'i'. 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)"); abort_with_message(ctx, "Invalid function pointer called with signature 'i'. 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)");