Commit Graph

206 Commits

Author SHA1 Message Date
David Cook
597360f499 Simplify read_timespec error handling 2020-09-07 11:31:28 -05:00
David Cook
33e928c9ca Review comments 2020-09-07 10:54:39 -05:00
David Cook
6d323e1032 Refactor timespec parsing, improve error handling 2020-09-06 18:07:14 -05:00
LeSeulArtichaut
4f2f87b2df Change ty.kind -> ty.kind() 2020-09-04 22:03:45 +02:00
David Cook
a6746ad893 Add comment 2020-09-02 20:58:41 -05:00
David Cook
7a2c6812b9 Per-thread errno storage 2020-09-02 20:57:20 -05:00
Ralf Jung
5657f08bea fs: move isolation handling to inside trait 2020-08-08 15:24:30 +02:00
Philippe Nadon
5161ba346c renamed ScalarMaybeUninit::not_undef to check_init
Related to PR https://github.com/rust-lang/rust/pull/74664
2020-07-26 16:05:20 -06:00
Ralf Jung
7d6aec6887 rustup 2020-07-23 10:40:13 +02:00
Ralf Jung
a9dc2796ca Move get/set_at_offset helpers to global helpers file 2020-06-28 09:23:01 +02:00
Ralf Jung
e063ce2737 rustup; and a bit of UnsafeCell detection refactoring 2020-06-13 11:30:31 +02:00
Ralf Jung
379ac82a1c bump Rust, fix for renames 2020-05-09 10:15:09 +02:00
Chase Albert
4e3d1fee51 Address comments. 2020-05-04 14:24:22 -04:00
Chase Albert
78f329513a Check that shims are called with the correct number of arguments 2020-05-04 13:51:21 -04:00
Vytautas Astrauskas
5224c72403 Move the stack to the evaluator to make Miri compile with the newest Rustc. 2020-04-20 09:19:37 +02:00
Ralf Jung
6ad0187265 rustup for FieldsShape::Primitive 2020-04-17 14:19:26 +02:00
Ralf Jung
9f3383d55d rustup for import changes 2020-04-03 00:05:35 +02:00
Ralf Jung
5ce2466892 fix for FieldPlacement rename 2020-04-02 09:19:56 +02:00
Ralf Jung
f599687f3f adjust for span not being passed around any more 2020-04-02 09:14:17 +02:00
bors
6536f3165e Auto merge of #1290 - RalfJung:rustup, r=RalfJung
Rustup

Also remove ICEing `breakpoint` intrinsic shim.
2020-04-01 17:59:33 +00:00
Ralf Jung
1e3800ffb1 rustup 2020-04-01 19:40:10 +02:00
JOE1994
b3f9e53049 Implement 'GetSystemTimeAsFileTime' shim for Windows 2020-04-01 10:55:26 -04:00
Ralf Jung
8948a29a4c adjust for librustc rename; reduce 'extern crate' to rustc crates 2020-03-30 11:07:32 +02:00
Ralf Jung
5ff7eef2ff rustup; fix for TyLayout rename 2020-03-30 10:23:04 +02:00
JOE1994
fe9ecb50d1 Follow-up to reviews from RalfJung
1. Fix 'fn convert_path_separator' in src/shims/os_str.rs
2. Fix 'fn set_last_error_from_io_error' in src/helpers.rs
3. Minor comment fix for 'fn SetCurrentDirectoryW' in src/shims/env.rs
2020-03-29 11:30:08 -04:00
JOE1994
a481b8f261 partially implement 'set_last_error_from_io_error' for Windows 2020-03-29 11:30:08 -04:00
Ralf Jung
f181e75db2 rustup 2020-03-29 10:01:31 +02:00
bors
7a5e95c9ac Auto merge of #1276 - RalfJung:scalar-precise-sizes, r=RalfJung
Construct Scalar with precise sizes
2020-03-28 18:16:13 +00:00
Ralf Jung
fbbca59de7 avoid Scalar::from_(u)int in favor of giving the size explicitly 2020-03-28 17:35:40 +01:00
bors
ad14b684cc Auto merge of #1275 - JOE1994:move_string_helpers, r=RalfJung
move OsStr helpers to a separate file

Moved OsStr read/write functions from `src/helpers.rs` to `src/shims/os_str.rs`, in order to keep `src/helpers.rs` from bloating too much.
2020-03-28 15:32:16 +00:00
JOE1994
99600ba7a9 move OsStr helpers to a separate file 2020-03-28 10:43:47 -04:00
Ralf Jung
9e39bfbbd9 organize shims and make some only available to libstd as they are incomplete 2020-03-28 11:15:11 +01:00
Ralf Jung
876bded2e8 run Windows TLS dtor function 2020-03-28 10:39:29 +01:00
JOE1994
813d76d948 follow-up to reviews 2020-03-27 07:07:21 -04:00
JOE1994
fc8f88e04e change helper fn 'write_os_str_to_wide_str' 2020-03-27 00:08:27 -04:00
Ralf Jung
81d505670b rustup; get rid of some try_from that are no longer needed 2020-03-26 00:11:50 +01:00
Ralf Jung
e9e04e56fc move path methods together, to the bottom of the string helpers 2020-03-24 09:11:48 +01:00
Ralf Jung
c4e29c8646 convert dir separators on path load/store 2020-03-24 09:11:48 +01:00
Ralf Jung
4ac91384ff route all path reading/writing through central read/write methods 2020-03-24 09:11:47 +01:00
JOE1994
5f9167bdaa helper functions for env_var emulation in Windows 2020-03-23 19:40:22 -04:00
Ralf Jung
2f371774ef fix conditional compilation condition for os_str <-> bytes conversion 2020-03-23 19:43:03 +01:00
Ralf Jung
6dcca62b63 move -Zmiri-disable-isolation hint to help 2020-03-22 19:48:59 +01:00
Ralf Jung
d85f09c4e4 platform -> target 2020-03-22 08:55:39 +01:00
Ralf Jung
681819c8ad getting a path should never fail
we basically treat them as lang items
2020-03-19 08:26:08 +01:00
Ralf Jung
e6e8773272 start messages in lower-case 2020-03-19 08:25:08 +01:00
Ralf Jung
1103a10e2c adjust for error reform 2020-03-19 08:25:08 +01:00
Ralf Jung
8b6af3eacb avoid using unchecked casts or arithmetic 2020-03-17 15:21:43 +01:00
Ralf Jung
88c45f9891 adjust for rustc changes 2020-03-02 13:51:08 +01:00
Ralf Jung
cc1ebd0af6 some formatting 2020-03-01 10:29:05 +01:00
David Cook
ad8c784009 Return length from write_os_str_to_c_str 2020-02-24 19:50:25 -06:00
David Cook
94f611348f Use os_str_length_as_c_str in readdir[64]_r 2020-02-23 15:37:22 -06:00
Ralf Jung
4a9a0a9078 avoid lowercasing platforms 2020-02-23 18:54:08 +01:00
Ralf Jung
5d35548985 helpers.rs cleanup 2020-02-23 18:52:12 +01:00
Christian Poveda
208665836e
panic if target platform is incorrect instead 2020-02-22 09:02:29 -05:00
Christian Poveda
9e9a090026
minor fixes 2020-02-22 02:18:42 -05:00
Christian Poveda
8fe7543191
add helper function for target platform checks 2020-02-19 17:47:34 -05:00
Ralf Jung
ef154df607 pass MPlaceTy by-value, as we usually do 2020-01-30 13:38:49 +01:00
Ralf Jung
23c74449a2 rustup 2020-01-15 19:27:21 +01:00
Yuki Okushi
86ee705cd5 Rustup 2020-01-07 05:13:18 +09:00
Yuki Okushi
ebacb8ae4e Rustup 2020-01-05 15:55:15 -08:00
JOE1994
a4bd68a45f Add helper 'alloc_os_str_as_c_str' and use it in env_var emulation 2019-12-27 20:32:20 -05:00
Ralf Jung
cd12f47af6 make bytes conversion functions private inside read/write functions 2019-12-24 11:46:02 +01:00
Ralf Jung
2db6a3c04d use new try_from methods 2019-12-24 11:43:42 +01:00
Oliver Scherer
7ead530841 Rustfmt all the things 2019-12-23 12:56:23 +01:00
bors
a3ea1cb458 Auto merge of #1101 - christianpoveda:stat-shim, r=RalfJung
Add statx shim for linux target

This is an attempt to fix: https://github.com/rust-lang/miri/issues/999 (for linux only)

Currently there is one problem that I haven't been able to solve. `std::fs::metadata` fails because the creation time is not available even though it is provided in the shim code.

In order to inform the caller that the field was provided, the `stx_flag` field must have the bits of `STATX_BTIME` set (which they are). The creation time is in the `stx_btime` field of the `statx` struct (see [1]). The relevant code in `libstd` is here (probably?): https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/fs.rs#L322

Another important point is that we are just providing the fields that are available in "all" platforms (this is, without using any platform specific traits or so). This can be improved later.

References:
[1] Man page: http://man7.org/linux/man-pages/man2/statx.2.html
[2] libc `statx` struct: https://docs.rs/libc/0.2.63/libc/struct.statx.html

Edit: The problem is that my filesystem is not providing it and I thought all filesystems could provide it. I changed the code so it only provides those dates if they are available. now we are ready to go.

r? @RalfJung @oli-obk
2019-12-22 17:01:53 +00:00
Christian Poveda
b0c7625dd1
add statx shim for linux 2019-12-22 11:46:02 -05:00
Ralf Jung
67151a712d rustup 2019-12-08 10:32:50 +01:00
Ralf Jung
94732aaf7b rename helper methods a bit 2019-12-04 10:43:36 +01:00
Ralf Jung
01f060b6da avoid allocation in read_os_string_from_c_string 2019-12-04 10:16:08 +01:00
Aaron Hill
a418fe9826
Rustup for BodyCache changes 2019-12-02 20:21:03 -05:00
Ralf Jung
b2cddd27bd better span for functions whose frame we push 'manually' 2019-12-02 16:04:31 +01:00
Ralf Jung
b91383b068 implement proper panicking for other MIR assertions
Requires generalizing the call_function helper to arbitrary Immediate arguments
2019-12-02 16:04:31 +01:00
Ralf Jung
fe76d33506 Add and use helper function for calling a machine function and passing it some arguments 2019-11-29 09:23:29 +01:00
Ralf Jung
82374ad9bd comments and slight refactoring 2019-11-19 14:51:08 +01:00
Aaron Hill
08d3fbc76b
Support unwinding after a panic
Fixes #658

This commit adds support for unwinding after a panic. It requires a
companion rustc PR to be merged, in order for the necessary hooks to
work properly.

Currently implemented:
* Selecting between unwind/abort mode based on the rustc Session
* Properly popping off stack frames, unwinding back the caller
* Running 'unwind' blocks in Mir terminators

Not yet implemented:
* 'Abort' terminators

This PR was getting fairly large, so I decided to open it for review without
implementing 'Abort' terminator support. This could either be added on
to this PR, or merged separately.
2019-11-17 08:34:25 -05:00
Ralf Jung
d8a3a1f09c rustup for projection interning 2019-10-26 09:33:24 +02:00
Ralf Jung
c87f106cac update comments and some tweaks 2019-10-24 10:27:14 +02:00
Ralf Jung
cf9340113e rustup: more flexible write_bytes avoids allocations and removes itertools dependency 2019-10-24 10:15:30 +02:00
Christian Poveda
de12cbcb32 Fix documentation 2019-10-23 08:58:25 -05:00
Christian Poveda
fb4cb5bf4a Make size error distinguishable from other errors 2019-10-22 16:57:07 -05:00
Christian Poveda
be415dbeda Use new write_bytes method 2019-10-22 11:44:49 -05:00
Ralf Jung
2690f5948a rustup: fix for write_bytes and new union rules 2019-10-22 10:13:11 +02:00
Christian Poveda
72bd25de83 Fix merge conflicts 2019-10-21 08:49:49 -05:00
Christian Poveda
283a130dda Add docs for the new helper functions 2019-10-20 17:40:21 -05:00
Christian Poveda
9d50c5e758 Small corrections to docs 2019-10-20 07:55:26 -05:00
Christian Poveda
619ccf3834 Rename set_last_error_from_io_result 2019-10-20 07:55:25 -05:00
Christian Poveda
5c3c738c4b Make transformation to OS error explicit 2019-10-20 07:53:56 -05:00
Christian Poveda
338e51aa48 Rename consume_result 2019-10-20 07:53:55 -05:00
Christian Poveda
ed776f67ba Change last_error to a place 2019-10-20 07:42:59 -05:00
Christian Poveda
4232939319 Move last error functions to helpers 2019-10-20 07:42:59 -05:00
Christian Poveda
f7c6e0efbe Do additional bounds checks 2019-10-19 15:49:00 -05:00
Christian Poveda
ab059671cb Change comparison order for clarity 2019-10-19 14:13:49 -05:00
Ralf Jung
e574c77aa2 audit our bounds checks 2019-10-19 12:39:02 +02:00
Christian Poveda
0201cc5587 Fix writing errors 2019-10-18 15:28:06 -05:00
Christian Poveda
85941c7249 Rename write/read os string functions 2019-10-18 09:49:56 -05:00
Christian Poveda
68fec4b3fe Use conditional compilation properly and work with OsStrs instead 2019-10-18 09:49:56 -05:00
Christian Poveda
1241abbec4 Change helper functions to read/write 2019-10-18 09:49:55 -05:00
Christian Poveda
61da8b8428 Add OsString from/to bytes helper functions 2019-10-18 09:47:19 -05:00
Ralf Jung
5481afbaf6 cleanup now that borrow checker knows memory is a field 2019-10-18 11:33:12 +02:00
Yuki Okushi
a353e90eed Use memory field instead of memory() 2019-10-18 11:11:50 +09:00