alidate the operand passed to is_val_statically_known
This commit is contained in:
parent
b8246e3847
commit
2318b0825c
@ -148,7 +148,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
||||
// ```
|
||||
// Would not be considered UB, or the other way around (`is_val_statically_known(0)`).
|
||||
"is_val_statically_known" => {
|
||||
let [_] = check_arg_count(args)?;
|
||||
let [arg] = check_arg_count(args)?;
|
||||
this.validate_operand(arg)?;
|
||||
let branch: bool = this.machine.rng.get_mut().gen();
|
||||
this.write_scalar(Scalar::from_bool(branch), dest)?;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user