Fix the wrong EmulateByNameResult::NotSupported in syscall shim
This commit is contained in:
parent
83dd2d7b1f
commit
4f3718ef85
3 changed files with 15 additions and 1 deletions
|
|
@ -185,7 +185,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
}
|
||||
id => {
|
||||
this.handle_unsupported(format!("can't execute syscall with ID {}", id))?;
|
||||
return Ok(EmulateByNameResult::NotSupported);
|
||||
return Ok(EmulateByNameResult::AlreadyJumped);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
tests/run-pass/panic/unsupported_syscall.rs
Normal file
12
tests/run-pass/panic/unsupported_syscall.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// ignore-windows: No libc on Windows
|
||||
// ignore-macos: `syscall` is not supported on macOS
|
||||
// compile-flags: -Zmiri-panic-on-unsupported
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate libc;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
libc::syscall(0);
|
||||
}
|
||||
}
|
||||
2
tests/run-pass/panic/unsupported_syscall.stderr
Normal file
2
tests/run-pass/panic/unsupported_syscall.stderr
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
thread 'main' panicked at 'unsupported Miri functionality: can't execute syscall with ID 0', $DIR/unsupported_syscall.rs:10:9
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
Loading…
Add table
Add a link
Reference in a new issue