Commit Graph

1826 Commits

Author SHA1 Message Date
Ralf Jung
dcdd68b936 also indicate abort via new MachineStop variant 2019-12-02 09:13:58 +01:00
Ralf Jung
f3c00a447c use new MachineStop error variant 2019-12-02 09:05:35 +01:00
Ralf Jung
a971b8a2ae fix for GlobalCtxt changes 2019-11-30 12:05:35 +01:00
Ralf Jung
4a4886c0f0 avoid injected_panic_runtime which is going away 2019-11-29 21:37:59 +01:00
Ralf Jung
e5a81c6a2d fix comment 2019-11-29 11:08:27 +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
a04620eb69 only run leak test on clean platforms 2019-11-27 09:13:37 +01:00
Ralf Jung
824328c6d5 adjust for goto_block refactoring 2019-11-27 08:34:15 +01:00
Ralf Jung
5339d541ef cargo-miri: also find Rust sources when being run in a locally built, linked toolchain 2019-11-23 10:33:49 +01:00
Aaron Hill
a328683c4a
Add acos, asin, and atan foreign functions
I copied the tests from the docs pages
2019-11-21 17:33:30 -05:00
Aaron Hill
2176bf6cf0
Fix nits
Co-Authored-By: Ralf Jung <post@ralfj.de>
2019-11-20 13:52:04 -05:00
Aaron Hill
3102129316
Improve return code propagation.
Don't explicitly exit if we reported an evaluation error
2019-11-20 12:43:10 -05:00
Aaron Hill
2532b86a3b
Propagate the return code from the start lang item
Fixes #1064

This ensures that we set the error code properly when a panic unwinds
past `main`.

I'm not sure what the best way to write a test for this is
2019-11-19 17:25:09 -05:00
Aaron Hill
2750f60d4f
Update panic runtime comment 2019-11-19 15:33:14 -05:00
Aaron Hill
e02dc4af4b
Re-add comment 2019-11-19 15:31:37 -05:00
Aaron Hill
8936d67e7f
Delegate to the actual panic runtime crate 2019-11-19 10:11:25 -05: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
5345636f37 use new isize_max method in FS accesses; also check full buffers for validity 2019-11-17 09:54:09 +01:00
bors
9f1aec34e1 Auto merge of #1055 - RalfJung:panic-stub, r=RalfJung
minimal rustup for panic changes

Main patch by @Aaron1011
2019-11-17 08:21:42 +00:00
Ralf Jung
f2c0c44a09 remove some leftovers from the miri-control-attribute days 2019-11-17 09:20:50 +01:00
bors
2bdf163d69 Auto merge of #1053 - RalfJung:clean, r=RalfJung
remove no-longer-needed zero checks
2019-11-14 10:16:51 +00:00
Ralf Jung
c790317eb9 remove no-longer-needed zero checks 2019-11-14 10:30:00 +01:00
Ralf Jung
64244e9a18 do full deref-check before reborrowing 2019-11-14 10:24:02 +01:00
bors
09b0a8a813 Auto merge of #1022 - christianpoveda:fix-fd-access, r=RalfJung
Fix unchecked memory access for files

This PR takes care of two problems:

- It uses `Memory::(read|write)_bytes` to guarantee that memory accesses are checked (Fixes: https://github.com/rust-lang/miri/issues/1007)
- It removes the `(get|remove)_handle_and` methods which were a little bit cumbersome to use. In particular `remove_handle_and`, because we were using it to avoid borrowing issues before the `Evaluator::memory` field was public.

@RalfJung @oli-obk
2019-11-13 22:58:24 +00:00
Christian Poveda
4baef7120a Fix maximum isize value for target 2019-11-13 14:45:00 -05:00
Christian Poveda
edd0157069 Cap count twice 2019-11-13 11:57:20 -05:00
Steven Gu
ca983f5f80 Implments intrinsics::copysignf32 and intrinsics::copysignf64. 2019-11-13 17:41:09 +08:00
Aaron Hill
cf5b53e52f
Rustup for panic changes
This gets Miri working again, but doesn't actually implement unwinding
2019-11-12 19:52:15 -05:00
Ralf Jung
2c55a508e9 rustup 2019-11-11 21:25:57 +01:00
Christian Poveda
6e37f2f3e1 Cap count 2019-11-09 15:15:52 +01:00
Christian Poveda
10b93730d3 Fix merge conflicts 2019-11-09 10:42:45 +01:00
Ralf Jung
37b1190def rustup 2019-11-08 22:07:52 +01:00
Ralf Jung
9ca277f2e9 bump minimal xargo version so that it honors the lockfile 2019-11-08 16:36:57 +01:00
Christian Poveda
4bbaa72dc9 Use TryFrom instead 2019-11-07 20:50:16 +01:00
bors
0740a2040f Auto merge of #1037 - JOE1994:master, r=RalfJung
error code E0080 is no longer printed with MIRI error message

Thanks to help from @bjorn3, @RalfJung, and @oli-obk on issue #1035 , I fixed the miri code so that error code **E0080** is no longer printed out for MIRI evaluation errors. I tested my code in my Linux machine as below.
![image](https://user-images.githubusercontent.com/10286488/68264744-e71e6c80-0017-11ea-9028-f83e19164ea2.png)

Remaining concern is whether the variable name `new_tcx` which I used is misleading or not.

Fixes https://github.com/rust-lang/miri/issues/1035
2019-11-06 13:39:22 +00:00
YOUNGSUK KIM
e5675ab0fc follow-up to review 2019-11-06 08:25:00 -05:00
Ralf Jung
8b0c14f9f6 ptr_offset: handle negative offsets 2019-11-06 10:51:06 +01:00
Ralf Jung
4b9a7d8cff fix error message details 2019-11-06 09:24:26 +01:00
Ralf Jung
9eb4e00f6f refactor ptr_offset_inbounds: it can be reduced to check_ptr_access, after all! 2019-11-06 09:24:26 +01:00
YOUNGSUK KIM
2661295cdf error code E0080 is no longer printed with MIRI error message 2019-11-05 21:56:18 -05:00
Christian Poveda
f910ea135c Avoid using as cast 2019-11-05 16:47:24 -05:00
Christian Poveda
56c5e53553 Handle host's usize correctly 2019-11-04 09:38:21 -05:00
Christian Poveda
d0b4407b25 Fix casts for count check 2019-11-03 10:04:00 -06:00
Ralf Jung
955a26fb08 calling panic_if_uninhabited is not actually UB 2019-11-03 15:39:03 +01:00
bors
4f7171585f Auto merge of #961 - rust-lang:exact_div_reuse, r=RalfJung
Use the upstream `exact_div` implementation

introduced in https://github.com/rust-lang/rust/pull/63810
2019-11-03 09:16:55 +00:00
Ralf Jung
5a5fa15382 style 2019-11-03 10:03:30 +01:00
Oliver Scherer
7a39460e24 Use the upstream exact_div implementation 2019-11-03 09:34:48 +01:00
Ralf Jung
ddb1fc9205 store scalars where appropriate 2019-11-02 11:50:21 +01:00
Ralf Jung
1e0b398cb6 Windows cmdline: avoid accessing allocations directly 2019-11-02 11:48:28 +01:00