Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/shims/posix/linux/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions tests/run-pass/panic/unsupported_syscall.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 0 deletions tests/run-pass/panic/unsupported_syscall.stderr
Original file line number Diff line number Diff line change
@@ -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