Commit Graph

48 Commits

Author SHA1 Message Date
Ralf Jung
c1eddbc7fe show int2ptr warning once for each span (but don't duplicate the long help) 2022-06-27 20:50:45 -04:00
Ralf Jung
d9e7a3ae82 typo
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-06-27 09:08:56 -04:00
Ralf Jung
1a5dfbeb7a fmt 2022-06-26 22:36:45 -04:00
Ralf Jung
294ef15adb more int2ptr cast tests, and fix casting of addresses inside dead allocations 2022-06-26 22:19:56 -04:00
Ralf Jung
13d425daeb make permissive provenance and raw-ptr tagging the default 2022-06-26 21:14:42 -04:00
Ralf Jung
4fbb284a99 implement 'delimited' expose tracking so we still detect some UB 2022-06-24 20:05:56 -04:00
Ralf Jung
8d6fdaa024 make the tests pass
(and some formatting)
2022-06-24 18:03:02 -04:00
Ralf Jung
c0f7118342 reorganize exposure code a bit 2022-06-24 16:45:22 -04:00
Ralf Jung
8c42ef1dee enable number validity checking and ptr::invalid checking by default 2022-05-25 16:17:41 +02:00
Ralf Jung
697dca2e0e clean up int2ptr code a bit 2022-05-23 10:03:33 +02:00
carbotaniuman
f7bc441fd3 Initial work on permissive provenance 2022-05-23 09:07:31 +02:00
Ralf Jung
f1023fbdc9 avoid into_pointer_or_addr and into_parts in visit_freeze_sensitive 2022-04-20 08:40:19 -04:00
Ralf Jung
6e1f3cd8ff adjust for MemoryExtra being merged into Machine 2022-04-05 11:11:53 -04:00
Ralf Jung
9af03bf342 add -Zmiri-strict-provenance 2022-04-01 14:10:24 -04:00
Ralf Jung
6a98c64c8b
final tweaks 2021-12-05 20:33:20 -05:00
Tavian Barnes
b0a463334c intptrcast: Never allocate two objects directly adjecent
When two objects directly follow each other in memory, what is the
provenance of an integer cast to a pointer that points directly between
them?  For a zero-size region, it could point into the end of the first
object, or the start of the second.

We can avoid answering this difficult question by simply never
allocating two objects directly beside each other.  This fixes some of
the false positives from #1866.
2021-12-03 17:00:06 -05:00
Ralf Jung
a1233a721d adjust Miri to Pointer type overhaul 2021-07-16 10:10:12 +02:00
Ralf Jung
4e231bab5e format much of Miri 2021-05-16 11:48:28 +02:00
Ralf Jung
31bd77c7d8 bump miri dependencies 2021-04-04 11:48:20 +02:00
Ralf Jung
0a4e8caa8c adjust to canonical_alloc_id removal 2020-07-27 23:32:15 +02:00
Ralf Jung
af5887e869 module organization: move platform-specific code to shims::{posix::{linux, macos}, windows} 2020-06-27 13:22:49 +02:00
Ralf Jung
393165f859 rustup; fix for changed error messages 2020-05-01 14:43:59 +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
Ralf Jung
9f3383d55d rustup for import changes 2020-04-03 00:05:35 +02:00
Ralf Jung
8948a29a4c adjust for librustc rename; reduce 'extern crate' to rustc crates 2020-03-30 11:07:32 +02:00
Ralf Jung
1103a10e2c adjust for error reform 2020-03-19 08:25:08 +01:00
Ralf Jung
92a28f8d8f HashMap -> FxHashMap 2020-03-02 22:36:15 +01:00
Ralf Jung
90327335fc canonicalize alloc ID for ptr-to-int cast 2020-03-02 09:03:08 +01:00
Oliver Scherer
7ead530841 Rustfmt all the things 2019-12-23 12:56:23 +01:00
Ralf Jung
37b1190def rustup 2019-11-08 22:07:52 +01:00
Oliver Scherer
e479ab2640 Rustup 2019-09-06 11:10:24 +02:00
Ralf Jung
8071034b93 fix for error refactoring 2019-08-03 10:25:55 +02:00
Ralf Jung
724cf41eb1 use checked arithmetic in intrptrcast 2019-07-23 23:43:37 +02:00
Ralf Jung
068517ae66 make sure we always have an RNG 2019-07-23 21:38:53 +02:00
Ralf Jung
12b8d4366c avoid integer overflow in ptr-to-int cast 2019-07-03 10:47:28 +02:00
Ralf Jung
c6e4f760a2 allow dangling ptr-to-int casts; use force_bits for ptr comparison 2019-07-03 10:47:28 +02:00
Ralf Jung
e960270662 add some tracing to intptrcast 2019-06-30 21:10:47 +02:00
Ralf Jung
11457a4ad9 fix comparing function pointers with intptrcast 2019-06-30 11:21:31 +02:00
bors
1ec279f290 Auto merge of #801 - RalfJung:num_cpus, r=RalfJung
support num_cpus crate and test that

Also make some magic numbers into proper global constants.
2019-06-30 08:42:25 +00:00
Ralf Jung
0fac868685 support num_cpus and test that 2019-06-29 14:34:08 +02:00
Ralf Jung
c1645f6c65 don't compute residue twice 2019-06-29 14:31:54 +02:00
Ralf Jung
9b66527075 more sensible slack 2019-06-29 14:31:54 +02:00
Ralf Jung
c0b44ca98c tweak inttoptr allocation behavior
- Make `align_addr` not offset by `align` for no reason.
- Add some random slack between allocations to give them the chance to not be aligned.
2019-06-29 14:31:54 +02:00
Ralf Jung
6886864862 ptr-to-int alignment sanity check 2019-06-28 09:12:11 +02:00
Christian Poveda
7fbf8e53a2 Fix alignment of base addresses 2019-06-26 09:08:28 -05:00
Christian Poveda
84cfbb01b7 Reorganize MemoryExtra and AllocExtra structures 2019-06-24 17:18:25 -05:00
Christian Poveda
2861ceb2fa Rename new fields and move rng to MemoryExtra 2019-06-24 10:03:16 -05:00
Christian Poveda
fd3a291db4 Implement intptrcast methods 2019-06-21 14:55:37 -05:00