Commit Graph

4283 Commits

Author SHA1 Message Date
bors
26baf87e43 Auto merge of #1348 - RalfJung:raw-addr-of-align, r=RalfJung
Stacked Borrows: alignment does not matter

Fixes https://github.com/rust-lang/miri/issues/1339
Requires https://github.com/rust-lang/rust/pull/71280
2020-04-22 21:44:14 +00:00
Ralf Jung
4b9abdaa50 rustup 2020-04-22 23:43:54 +02:00
Ralf Jung
270adbc7c6 Stacked Borrows: alignment does not matter 2020-04-22 23:32:19 +02:00
bors
f844eb2fe8 Auto merge of #1353 - divergentdave:file-set-len, r=RalfJung
Implement ftruncate64/ftruncate for File::set_len

This adds a shim for `ftruncate64` (on Linux) or `ftruncate` (on macOS) to enable support for `File::set_len`, and includes a test.
2020-04-22 21:10:01 +00:00
David Cook
f49839ac30 Add comment 2020-04-22 07:09:20 -05:00
David Cook
54897f66f8 Implement ftruncate64/ftruncate for File::set_len 2020-04-21 21:17:54 -05:00
bors
8d9db57a0d Auto merge of #1335 - vakaras:add-threads-noop, r=RalfJung
Move the stack to the evaluator. (no-op PR for 70598)

The changes to Miri to make it to compile with Rustc PR https://github.com/rust-lang/rust/pull/70598.
2020-04-20 08:39:29 +00:00
Ralf Jung
7406c1224b adjust for asm -> llvm_asm rename 2020-04-20 10:38:38 +02:00
Ralf Jung
73772fede6 adjust for Weak::as_raw -> as_ptr rename 2020-04-20 10:04:17 +02:00
Ralf Jung
5d2c8358f8 rustup 2020-04-20 09:33:34 +02:00
Vytautas Astrauskas
192fd3d97e Move stack and stack_mut implementation in Machine to match their position in the trait. 2020-04-20 09:19:37 +02: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
bors
763782aa08 Auto merge of #1342 - divergentdave:pause-instruction, r=RalfJung
Handle std::sync::atomic::spin_loop_hint()

This PR adds support for `std::sync::atomic::spin_loop_hint()` by implementing the `llvm.x86.sse2.pause` intrinsic when the target is x86-based. It appears this is the first LLVM intrinsic in foreign_items, so I added a couple match blocks to handle it or fall through to the different OS-specific methods. I added a basic smoke test to `tests/run-pass/sync.rs`. I came across this by way of `crossbeam::utils::Backoff::spin()`, FWIW.
2020-04-19 14:53:02 +00:00
David Cook
547a4cc920 Review comments 2020-04-19 09:22:40 -05:00
bors
4155fb610f Auto merge of #1351 - RalfJung:float-test-source, r=RalfJung
note source of float cast test values, and some more UB tests
2020-04-19 07:37:25 +00:00
Ralf Jung
70c828b761 test some more extreme cast cases 2020-04-19 09:34:54 +02:00
Ralf Jung
fbf47d1784 note source of test values 2020-04-19 09:21:00 +02:00
David Cook
7b69a6271e Add support for std:🧵:yield_now 2020-04-18 19:31:02 -05:00
David Cook
11cd87e457 Flip matching 2020-04-18 19:16:52 -05:00
bors
fac9d22375 Auto merge of #1349 - RalfJung:machine-layouts, r=RalfJung
use pre-computed layouts some more
2020-04-18 15:55:41 +00:00
Ralf Jung
14f50b34a3 use pre-computed layouts some more 2020-04-18 17:54:26 +02:00
bors
d1ae77f967 Auto merge of #1347 - RalfJung:float-cast-test, r=RalfJung
rename test_cast -> test_both_cast to make purpose clearer
2020-04-18 11:08:24 +00:00
Ralf Jung
699685c07c rename test_cast -> test_both_cast to make purpose clearer 2020-04-18 13:07:50 +02:00
bors
45113eb6a4 Auto merge of #1325 - RalfJung:float_to_int_unchecked, r=RalfJung
implement float_to_int_unchecked

@hanna-kruppe would be great if you could have a look at this.

`float.rs` tests legal casts. `test_cast` checks that both `as` casts and unchecked casts work (i.e., these are not saturating). The `compile-fail` tests should ensure that illegal casts via the intrinsic are detected as such.

Fixes https://github.com/rust-lang/miri/issues/1264
2020-04-18 08:13:24 +00:00
Ralf Jung
bb38ab4340 use u128::MAX symbolic name 2020-04-18 10:11:45 +02:00
bors
72667b58b8 Auto merge of #1346 - RalfJung:dyn-layout-test, r=RalfJung
Test that we enforce dynamic layout properties (not just static ones of sized prefix)
2020-04-18 07:16:35 +00:00
Ralf Jung
0345ee42da some UB gets masked by optimizations 2020-04-18 09:15:59 +02:00
Ralf Jung
c6ab27577b test that we check dynamic actual size of object 2020-04-18 02:06:36 +02:00
Ralf Jung
521e77d712 test that we properly check dynamic alignment 2020-04-17 20:43:54 +02:00
bors
216e686cc6 Auto merge of #1344 - RalfJung:rustup, r=RalfJung
rustup for FieldsShape::Primitive
2020-04-17 12:20:03 +00:00
Ralf Jung
6ad0187265 rustup for FieldsShape::Primitive 2020-04-17 14:19:26 +02:00
bors
562d602422 Auto merge of #1343 - RalfJung:derive-packed, r=RalfJung
test #[derive] on packed struct
2020-04-17 09:05:56 +00:00
Ralf Jung
6a81014ae9 test #[derive] on packed struct 2020-04-17 11:04:48 +02:00
David Cook
57c7119315 Handle std::sync::atomic::spin_loop_hint() 2020-04-16 23:24:57 -05:00
bors
9b4af73eb0 Auto merge of #1341 - RalfJung:force-ptr-everywhere, r=oli-obk
ReadBytesAsPointer is always supported

Cc @oli-obk
2020-04-16 19:07:08 +00:00
Ralf Jung
ff3b382b14 ReadBytesAsPointer is always supported 2020-04-16 18:36:03 +02:00
bors
d481e0818c Auto merge of #1338 - RalfJung:test-cleanup, r=RalfJung
Cleanup some run-pass tests
2020-04-16 07:46:57 +00:00
Ralf Jung
3e3613f2e2 merge packed_static and packed_struct 2020-04-16 09:33:22 +02:00
Ralf Jung
974f9c3023 avoid test-wide allowance of unused/dead code 2020-04-16 09:25:12 +02:00
Ralf Jung
b0fe99e81d consolidate ptr tests in fewer files 2020-04-16 09:06:21 +02:00
bors
5c823a1ec1 Auto merge of #1337 - RalfJung:intrinsic-tests, r=RalfJung
test some so-far untested intrinsics
2020-04-15 16:09:40 +00:00
Ralf Jung
07c696e27e test some so-far untested intrinsics 2020-04-15 18:00:16 +02:00
bors
b6fca87d66 Auto merge of #1334 - KrishnaSannasi:track-dealloc, r=RalfJung
add deallocation tracking

fixes #1314
2020-04-15 15:48:07 +00:00
Ozaren
b77968e8bd
added deallocation tracking 2020-04-15 11:29:35 -04:00
bors
e4eceba7d3 Auto merge of #1336 - RalfJung:instance-sanity, r=RalfJung
tighten Instance sanity check

Let's see if we can get away with this...
2020-04-15 11:34:34 +00:00
Ralf Jung
a85dab42ea tighten Instance sanity check 2020-04-15 13:13:17 +02:00
bors
fbea3e57f3 Auto merge of #1330 - RalfJung:retag-return-place, r=RalfJung
retag return place

@eddyb suggested that return places should be treated like unique references for Stacked Borrows. That is implemented by this patch, but it is unfortunately quite the hack because otherwise we are retagging *references*, not places.

@eddyb does this roughly correspond to what you had in mind? (Except for whatever it is you think should happen with argument passing, which is a much bigger issue.) Also, do you think there is any way we can *test* this?

Needs https://github.com/rust-lang/rust/pull/71100 to land.
2020-04-15 10:41:13 +00:00
Ralf Jung
3548dcf8cc rustup 2020-04-15 12:39:28 +02:00
Ralf Jung
0805b4bf2e retag return places 2020-04-15 12:39:19 +02:00
Ralf Jung
90d71cd13f adjust for frame hook changes 2020-04-15 12:33:52 +02:00