-
Notifications
You must be signed in to change notification settings - Fork 391
Closed
Labels
A-shimsArea: This affects the external function shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-first-issueA good way to start contributing, mentoring is availableA good way to start contributing, mentoring is available
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);
};
}
Metadata
Metadata
Assignees
Labels
A-shimsArea: This affects the external function shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementE-good-first-issueA good way to start contributing, mentoring is availableA good way to start contributing, mentoring is available