about summary refs log tree commit diff
path: root/src/librustc_mir/interpret
AgeCommit message (Collapse)AuthorLines
2019-07-04Rollup merge of #62173 - RalfJung:miri-interp, r=oli-obkMazdak Farrokhzad-53/+53
rename InterpretCx -> InterpCx That's more consistent with InterpResult and InterpError. r? @oli-obk
2019-07-01miri realloc: do not require giving old size+alignRalf Jung-6/+9
2019-07-01forward read_c_str method from Memory to AllocRalf Jung-0/+10
2019-06-29Replace error by bug macroChristian Poveda-1/+1
2019-06-29Simplify control flowChristian Poveda-12/+7
2019-06-29Remove default bound for Machine::MemoryExtraChristian Poveda-1/+1
2019-06-29Add MemoryExtra in InterpretCx constructor paramsChristian Poveda-4/+9
2019-06-29Use pointer size as the source sizeChristian Poveda-16/+3
2019-06-28Reorganize code for readabilty and fixed problem with type sizesChristian Poveda-19/+28
2019-06-27rename InterpretCx -> InterpCxRalf Jung-53/+53
That's more consistent with InterpResult and InterpError.
2019-06-26Use force_bits when casting from a pointerChristian Poveda-6/+23
2019-06-25Rollup merge of #62096 - spastorino:impl-place-from, r=oli-obk,CentrilMazdak Farrokhzad-1/+1
Implement From<Local> for Place and PlaceBase r? @oli-obk More tiny bits of Place 2.0 moved into master
2019-06-25Rollup merge of #61814 - varkor:uninhabited-const-61744, r=oli-obkMazdak Farrokhzad-6/+4
Fix an ICE with uninhabited consts Fixes https://github.com/rust-lang/rust/issues/61744. r? @oli-obk
2019-06-25Implement From<Local> for Place and PlaceBaseSantiago Pastorino-1/+1
2019-06-25Auto merge of #62094 - oli-obk:zst_intern, r=eddybbors-12/+14
Don't ICE on mutable zst slices fixes #62045
2019-06-25Fix an ICE with uninhabited constsvarkor-6/+4
2019-06-24Auto merge of #62081 - RalfJung:miri-pointer-checks, r=oli-obkbors-162/+211
Refactor miri pointer checks Centralize bounds, alignment and NULL checking for memory accesses in one function: `memory.check_ptr_access`. That function also takes care of converting a `Scalar` to a `Pointer`, should that be needed. Not all accesses need that though: if the access has size 0, `None` is returned. Everyone accessing memory based on a `Scalar` should use this method to get the `Pointer` they need. All operations on the `Allocation` work on `Pointer` inputs and expect all the checks to have happened (and will ICE if the bounds are violated). The operations on `Memory` work on `Scalar` inputs and do the checks themselves. The only other public method to check pointers is `memory.ptr_may_be_null`, which is needed in a few places. No need for `check_align` or similar methods. That makes the public API surface much easier to use and harder to mis-use. This should be largely no-functional-change, except that ZST accesses to a "true" pointer that is dangling or out-of-bounds are now considered UB. This is to be conservative wrt. whatever LLVM might be doing. While I am at it, this also removes the assumption that the vtable part of a `dyn Trait`-fat-pointer is a `Pointer` (as opposed to a pointer cast to an integer, stored as raw bits). r? @oli-obk
2019-06-24Don't ICE on mutable zst slicesOliver Scherer-7/+13
2019-06-24Simplify vtable interningOliver Scherer-6/+2
2019-06-24Auto merge of #62012 - wesleywiser:const_prop_use_ecx, r=oli-obkbors-4/+9
Use ecx for const-prop local storage r? @oli-obk
2019-06-23expand commentRalf Jung-1/+2
2019-06-23deduplicate some codeRalf Jung-17/+15
2019-06-23make code more symmetricRalf Jung-3/+5
2019-06-23comment tweaks, better validation errors, update UI testsRalf Jung-23/+33
2019-06-23clean up internals of pointer checks; make get_size_and_align also check for ↵Ralf Jung-89/+66
fn allocations
2019-06-23Centralize bounds, alignment and NULL checking for memory accesses in one ↵Ralf Jung-102/+163
function: memory.check_ptr_access That function also takes care of converting a Scalar to a Pointer, should that be needed. Not all accesses need that though: if the access has size 0, None is returned. Everyone accessing memory based on a Scalar should use this method to get the Pointer they need. All operations on the Allocation work on Pointer inputs and expect all the checks to have happened (and will ICE if the bounds are violated). The operations on Memory work on Scalar inputs and do the checks themselves. The only other public method to check pointers is memory.ptr_may_be_null, which is needed in a few places. With this, we can make all the other methods (tests for a pointer being in-bounds and checking alignment) private helper methods, used to implement the two public methods. That maks the public API surface much easier to use and harder to mis-use. While I am at it, this also removes the assumption that the vtable part of a `dyn Trait`-fat-pointer is a `Pointer` (as opposed to a pointer cast to an integer, stored as raw bits).
2019-06-22Deny explicit_outlives_requirements in the compilerMatthew Jasper-1/+1
2019-06-22Rollup merge of #61984 - ljedrz:more_node_id_pruning, r=ZoxcMazdak Farrokhzad-1/+1
More NodeId pruning Just another round of the `HirId`ification initiative. r? @Zoxc
2019-06-21Auto merge of #61959 - oli-obk:const_field_ice, r=eddybbors-2/+3
Fix a hash collision issue on the `const_field` query fixes #61530
2019-06-20[const-prop] Move local storage into a `Frame` on `InterpCx`Wesley Wiser-4/+9
This moves us closer to just using `InterpCx` for interpretation.
2019-06-20Fix merge issuesChristian Poveda-138/+481
2019-06-20Updated tag methods for consistencyChristian Poveda-9/+9
2019-06-20Replace MemoryExtra by Memory in intptrcast methodsChristian Poveda-9/+8
2019-06-20rustc_mir: support type parameters by printing them as `_`.Eduard-Mihai Burtescu-21/+26
2019-06-20rename hir::map::get_by_hir_id to getljedrz-1/+1
2019-06-19Change `ByRef` to a struct variant to clarify its fields via namesOliver Scherer-1/+1
2019-06-19Remove the `AllocId` from `ByRef` valuesOliver Scherer-2/+3
`ByRef` const values have no identity beyond their value, we should not treat them as having identity. The `AllocId` often differed between equal constants, because of the way that the miri-engine evaluates constants.
2019-06-19Remove now-unnecessary lifetimeOliver Scherer-1/+1
2019-06-19More FIXMEsOliver Scherer-0/+1
2019-06-19Weave the alignment through `ByRef`Oliver Scherer-16/+3
2019-06-19Outright ignore any alignment in `const_field`Oliver Scherer-4/+2
2019-06-19Elaborate some more on what mutability field means whatOliver Scherer-0/+8
2019-06-19Update to `TyCtxt` lifetime changesOliver Scherer-10/+10
2019-06-19Fix typoOliver Scherer-1/+1
2019-06-19The future is nowOliver Scherer-4/+0
2019-06-19s/intern/intern_shallow/Oliver Scherer-4/+5
2019-06-19Merge `StaticMut` and `Static` logicOliver Scherer-6/+6
2019-06-19Fix rebase falloutOliver Scherer-7/+7
2019-06-19Elaborate on why we don't look at frozennessOliver Scherer-0/+2
2019-06-19Don't ICE when pattern matching packed structsOliver Scherer-1/+18