Closed
Description
Our shims for missing extern
functions now all check that the right number of arguments is being passed. However, they should also check that the right ABI is used.
To do this, probably first librustc_mir needs to be changed to even propagate this information to Miri's find_mir_or_eval_fn
.
The goal is to reject buggy code like this:
fn main() {
extern "Rust" { // should be "C"!
fn malloc(size: usize) -> *mut std::ffi::c_void;
}
unsafe {
let _ = malloc(0);
};
}