diff options
| author | bors <bors@rust-lang.org> | 2024-06-21 09:44:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-21 09:44:08 +0000 |
| commit | 4be2c66c424e576f5aeb9714ff7ccc9f257fa244 (patch) | |
| tree | b9d5c8c7a446aaddd6bbd662bf4ad888ce673daa /src/tools/miri/tests | |
| parent | be307ca809d02d875fa37517ced434b8a00ffcc9 (diff) | |
| parent | c7413154e1bfef6ec75157c589db0303e75bec30 (diff) | |
| download | rust-4be2c66c424e576f5aeb9714ff7ccc9f257fa244.tar.gz rust-4be2c66c424e576f5aeb9714ff7ccc9f257fa244.zip | |
Auto merge of #3689 - adwinwhite:lseek64, r=RalfJung
Fix ICE caused by seeking past `i64::MAX` Make Miri behave the same as standard library on file seeking offset. Fixes #3680.
Diffstat (limited to 'src/tools/miri/tests')
| -rw-r--r-- | src/tools/miri/tests/pass/issues/issue-miri-3680.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tools/miri/tests/pass/issues/issue-miri-3680.rs b/src/tools/miri/tests/pass/issues/issue-miri-3680.rs new file mode 100644 index 00000000000..55b896c91ad --- /dev/null +++ b/src/tools/miri/tests/pass/issues/issue-miri-3680.rs @@ -0,0 +1,21 @@ +//@ignore-target-windows: File handling is not implemented yet +//@compile-flags: -Zmiri-disable-isolation + +use std::fs::remove_file; +use std::io::{ErrorKind, Seek}; + +#[path = "../../utils/mod.rs"] +mod utils; + +fn main() { + let path = utils::prepare("miri_test_fs_seek_i64_max_plus_1.txt"); + + let mut f = std::fs::File::create(&path).unwrap(); + let error = f.seek(std::io::SeekFrom::Start(i64::MAX as u64 + 1)).unwrap_err(); + + // It should be error due to negative offset. + assert_eq!(error.kind(), ErrorKind::InvalidInput); + + // Cleanup + remove_file(&path).unwrap(); +} |
