Closed
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.)