Check arg count

Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
Smittyvb 2021-03-05 07:16:50 -05:00 committed by GitHub
parent 26e97ec54f
commit 8d43d727f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -655,6 +655,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
"try" => return this.handle_try(args, dest, ret),
"breakpoint" => {
let &[] = check_arg_count(args)?;
// normally this would raise a SIGTRAP, which aborts if no debugger is connected
throw_machine_stop!(TerminationInfo::Abort("Trace/breakpoint trap".to_string()))
}