-
Notifications
You must be signed in to change notification settings - Fork 390
Closed
Labels
A-shimsArea: This affects the external function shimsArea: This affects the external function shimsC-bugCategory: This is a bug.Category: This is a bug.E-good-first-issueA good way to start contributing, mentoring is availableA good way to start contributing, mentoring is availableI-ICEImpact: makes Miri crash with some ICEImpact: makes Miri crash with some ICEI-misses-UBImpact: makes Miri miss UB, i.e., a false negative (with default settings)Impact: makes Miri miss UB, i.e., a false negative (with default settings)
Description
Basically all our shims look something like this:
let _attr_place = this.deref_operand(args[0])?;
let addr_place = this.deref_operand(args[1])?;
let size_place = this.deref_operand(args[2])?;
This code will ICE if the user passes fewer than 3 arguments, and it will silently "just work" if the user passes more than 3 arguments. To mitigate this, I propose we add a helper function check_arg_count
or so that we call for each and every shim (foreign items and intrinsics) to raise an appropriate error (UB seems right) in case the number of arguments is wrong.
(libstd-only shims that check this.frame().instance
do not need checking.)
Metadata
Metadata
Assignees
Labels
A-shimsArea: This affects the external function shimsArea: This affects the external function shimsC-bugCategory: This is a bug.Category: This is a bug.E-good-first-issueA good way to start contributing, mentoring is availableA good way to start contributing, mentoring is availableI-ICEImpact: makes Miri crash with some ICEImpact: makes Miri crash with some ICEI-misses-UBImpact: makes Miri miss UB, i.e., a false negative (with default settings)Impact: makes Miri miss UB, i.e., a false negative (with default settings)