Skip to content

Commit 2318b08

Browse files
committed
alidate the operand passed to is_val_statically_known
1 parent b8246e3 commit 2318b08

File tree

1 file changed

+2
-1
lines changed
  • src/tools/miri/src/shims/intrinsics

1 file changed

+2
-1
lines changed

src/tools/miri/src/shims/intrinsics/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
148148
// ```
149149
// Would not be considered UB, or the other way around (`is_val_statically_known(0)`).
150150
"is_val_statically_known" => {
151-
let [_] = check_arg_count(args)?;
151+
let [arg] = check_arg_count(args)?;
152+
this.validate_operand(arg)?;
152153
let branch: bool = this.machine.rng.get_mut().gen();
153154
this.write_scalar(Scalar::from_bool(branch), dest)?;
154155
}

0 commit comments

Comments
 (0)