about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/interpret/memory.rs
AgeCommit message (Collapse)AuthorLines
2021-09-07Rename rustc_mir to rustc_const_eval.Camille GILLOT-1186/+0
2021-09-07Move the dataflow framework to its own crate.Camille GILLOT-2/+2
2021-07-31CTFE: throw unsupported error when partially overwriting a pointerRalf Jung-4/+11
2021-07-25Miri: santiy check that null pointer can never have an AllocIdRalf Jung-1/+5
2021-07-18miri: better ptr-out-of-bounds errorsRalf Jung-4/+10
2021-07-17Auto merge of #87123 - RalfJung:miri-provenance-overhaul, r=oli-obkbors-190/+222
CTFE/Miri engine Pointer type overhaul This fixes the long-standing problem that we are using `Scalar` as a type to represent pointers that might be integer values (since they point to a ZST). The main problem is that with int-to-ptr casts, there are multiple ways to represent the same pointer as a `Scalar` and it is unclear if "normalization" (i.e., the cast) already happened or not. This leads to ugly methods like `force_mplace_ptr` and `force_op_ptr`. Another problem this solves is that in Miri, it would make a lot more sense to have the `Pointer::offset` field represent the full absolute address (instead of being relative to the `AllocId`). This means we can do ptr-to-int casts without access to any machine state, and it means that the overflow checks on pointer arithmetic are (finally!) accurate. To solve this, the `Pointer` type is made entirely parametric over the provenance, so that we can use `Pointer<AllocId>` inside `Scalar` but use `Pointer<Option<AllocId>>` when accessing memory (where `None` represents the case that we could not figure out an `AllocId`; in that case the `offset` is an absolute address). Moreover, the `Provenance` trait determines if a pointer with a given provenance can be cast to an integer by simply dropping the provenance. I hope this can be read commit-by-commit, but the first commit does the bulk of the work. It introduces some FIXMEs that are resolved later. Fixes https://github.com/rust-lang/miri/issues/841 Miri PR: https://github.com/rust-lang/miri/pull/1851 r? `@oli-obk`
2021-07-16rename assert_matches moduleJane Lusby-1/+1
2021-07-16get rid of incorrect erase_for_fmtRalf Jung-6/+8
2021-07-15make check_ptr_access_align work on function pointer allocationsRalf Jung-6/+12
2021-07-15enable Miri to fix the bytes in an allocation (since ptr offsets have ↵Ralf Jung-44/+37
different meanings there)
2021-07-15adjustions and cleanup to make Miri build againRalf Jung-40/+33
2021-07-15Rollup merge of #86947 - m-ou-se:assert-matches-to-submodule, r=yaahcYuki Okushi-0/+1
Move assert_matches to an inner module Fixes #82913
2021-07-14consistently treat None-tagged pointers as ints; get rid of some deprecated ↵Ralf Jung-2/+3
Scalar methods
2021-07-14CTFE/Miri engine Pointer type overhaul: make Scalar-to-Pointer conversion ↵Ralf Jung-141/+178
infallible This resolves all the problems we had around "normalizing" the representation of a Scalar in case it carries a Pointer value: we can just use Pointer if we want to have a value taht we are sure is already normalized.
2021-07-12remove unnecessary deallocate_local hackRalf Jung-12/+5
2021-07-12remove remaining use of Pointer in Allocation APIRalf Jung-2/+2
2021-07-08Move [debug_]assert_matches to mod {core, std}::assert.Mara Bos-0/+1
2021-07-02Allocation failure in constprop panics right awaySmitty-1/+1
2021-06-29Support allocation failures when interperting MIRSmitty-4/+4
Note that this breaks Miri. Closes #79601
2021-06-27Change miri to use tcx allocated allocations.Charles Lew-4/+0
2021-05-23support creating mutable allocations from byte slicesRalf Jung-1/+3
2021-05-23avoid redundant immutability checkRalf Jung-3/+0
2021-05-23reject deallocation of read-only allocationsRalf Jung-0/+3
2021-05-22CTFE get_alloc_extra_mut: also provide ref to MemoryExtraRalf Jung-2/+3
2021-05-19CTFE Machine: do not expose AllocationRalf Jung-6/+7
2021-05-18add Align::ONE; add methods to access alloc.extraRalf Jung-8/+20
2021-05-18reduce number of allocation lookups during copyRalf Jung-6/+6
2021-05-18CTFE core engine allocation & memory API improvemenetsRalf Jung-86/+252
- make Allocation API offset-based (no more Pointer) - make Memory API higher-level (combine checking for access and getting access into one operation)
2021-05-17Rollup merge of #85412 - RalfJung:c_str, r=oli-obkRalf Jung-75/+0
remove some functions that were only used by Miri and Miri does not need them any more with https://github.com/rust-lang/miri/pull/1805. r? ``@oli-obk``
2021-05-17remove some functions that were only used by MiriRalf Jung-75/+0
2021-05-17remove size field from AllocationRalf Jung-7/+7
2021-05-02Change 'NULL' to 'null'Brent Kerby-5/+5
2021-03-18Remove unwrap_none/expect_none from compiler/.Mara Bos-3/+11
2020-12-03move interpret::MemoryKind::Heap to const evalVishnunarayan K I-5/+0
2020-12-03move intrinsic to CTFE, add FIXMEVishnunarayan K I-0/+1
2020-12-02rename MemoryKind::Heap to ConstHeap; bless testVishnunarayan K I-3/+3
2020-12-01review commentsVishnunarayan K I-2/+2
2020-12-01add const_allocate intrisicVishnunarayan K I-0/+4
2020-09-22Miri: more informative deallocation error messagesRalf Jung-4/+8
2020-09-19Address review commentsOliver Scherer-1/+1
2020-09-19Rename const eval queries to reflect the validation changesOliver Scherer-1/+1
2020-08-30mv compiler to compiler/mark-0/+1028