]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoReduce the chance of accidentally calling functions in CTFE
Oliver Schneider [Fri, 28 Jul 2017 07:52:19 +0000 (09:52 +0200)]
Reduce the chance of accidentally calling functions in CTFE

previously miri had a check for const fn and other cases that
CTFE requires. Instead the function call is completely
processed inside the machine. This allows CTFE to have full
control over what is called and miri to not have useless
CTFE-checks in normal mode.

6 years agoMove the `global_item` function to the `EvalContext`
Oliver Schneider [Thu, 27 Jul 2017 10:02:16 +0000 (12:02 +0200)]
Move the `global_item` function to the `EvalContext`

6 years agoRename `const_eval::Evaluator` to `CompileTimeFunctionEvaluator`
Oliver Schneider [Tue, 25 Jul 2017 13:22:52 +0000 (15:22 +0200)]
Rename `const_eval::Evaluator` to `CompileTimeFunctionEvaluator`

6 years agoMove more non-CTFE operations to the Machine
Oliver Schneider [Tue, 25 Jul 2017 09:32:48 +0000 (11:32 +0200)]
Move more non-CTFE operations to the Machine

6 years agoSplit "new" miri crate into modules
Oliver Schneider [Mon, 24 Jul 2017 13:19:32 +0000 (15:19 +0200)]
Split "new" miri crate into modules

6 years agoImplement the first machine function
Oliver Schneider [Fri, 21 Jul 2017 15:25:30 +0000 (17:25 +0200)]
Implement the first machine function

6 years agoSplit up miri into the librustc_mir and bin parts
Oliver Schneider [Fri, 21 Jul 2017 11:39:06 +0000 (13:39 +0200)]
Split up miri into the librustc_mir and bin parts

6 years agoMerge pull request #277 from RalfJung/nightly
Ralf Jung [Tue, 1 Aug 2017 00:14:38 +0000 (17:14 -0700)]
Merge pull request #277 from RalfJung/nightly

fix for latest nightly

6 years agofix for latest nightly
Ralf Jung [Mon, 31 Jul 2017 23:53:53 +0000 (16:53 -0700)]
fix for latest nightly

6 years agoMerge pull request #274 from RalfJung/packed2
Oliver Schneider [Mon, 31 Jul 2017 10:41:29 +0000 (12:41 +0200)]
Merge pull request #274 from RalfJung/packed2

make force_allocation handle packed ByValPair

6 years agoremove some commented-out tracing
Ralf Jung [Sat, 29 Jul 2017 02:44:03 +0000 (19:44 -0700)]
remove some commented-out tracing

6 years agoavoid anonymous bool
Ralf Jung [Sat, 29 Jul 2017 02:43:05 +0000 (19:43 -0700)]
avoid anonymous bool

6 years agouse Cell for memory's aligned flag to avoid infecting interfaces with 'fake' mutability
Ralf Jung [Thu, 27 Jul 2017 16:14:04 +0000 (09:14 -0700)]
use Cell for memory's aligned flag to avoid infecting interfaces with 'fake' mutability

7 years agomake force_allocation handle packed ByValPair
Ralf Jung [Thu, 27 Jul 2017 06:43:13 +0000 (23:43 -0700)]
make force_allocation handle packed ByValPair

7 years agoMerge pull request #272 from oli-obk/mir-validate
Oliver Schneider [Wed, 26 Jul 2017 21:37:52 +0000 (23:37 +0200)]
Merge pull request #272 from oli-obk/mir-validate

Mir validate

7 years agodisable validation code so that it all compiles against current nightly
Ralf Jung [Wed, 26 Jul 2017 18:27:40 +0000 (11:27 -0700)]
disable validation code so that it all compiles against current nightly

7 years agowhitelist some more methods
Ralf Jung [Wed, 26 Jul 2017 18:10:47 +0000 (11:10 -0700)]
whitelist some more methods

7 years agoMerge pull request #273 from RalfJung/ref
Oliver Schneider [Wed, 26 Jul 2017 05:46:39 +0000 (07:46 +0200)]
Merge pull request #273 from RalfJung/ref

Test that &* of a dangling (and even unaligned) ptr is okay

7 years agomove undef-check-on-release-validation out, to catch more cases
Ralf Jung [Wed, 26 Jul 2017 01:15:43 +0000 (18:15 -0700)]
move undef-check-on-release-validation out, to catch more cases

7 years agocheck mutable UnsafeCell; hack for AtomicBool::get_mut
Ralf Jung [Wed, 26 Jul 2017 00:10:05 +0000 (17:10 -0700)]
check mutable UnsafeCell; hack for AtomicBool::get_mut

7 years agomore hacks to make test cases pass
Ralf Jung [Tue, 25 Jul 2017 05:42:05 +0000 (22:42 -0700)]
more hacks to make test cases pass

7 years agoTest that &* of a dangling (and even unaligned) ptr is okay
Ralf Jung [Wed, 26 Jul 2017 00:02:57 +0000 (17:02 -0700)]
Test that &* of a dangling (and even unaligned) ptr is okay

7 years agowhitelist things so that more tests pass
Ralf Jung [Mon, 24 Jul 2017 21:17:58 +0000 (14:17 -0700)]
whitelist things so that more tests pass

7 years agosuspend lvalues, not locks. refactor memory locking.
Ralf Jung [Thu, 20 Jul 2017 02:45:25 +0000 (19:45 -0700)]
suspend lvalues, not locks. refactor memory locking.

Due to this, we are back down to 88 tests

7 years agomake LockInfo non-Copy
Ralf Jung [Tue, 18 Jul 2017 23:43:37 +0000 (16:43 -0700)]
make LockInfo non-Copy

7 years agofix checks when releasing write locks (101)
Ralf Jung [Fri, 14 Jul 2017 18:06:29 +0000 (11:06 -0700)]
fix checks when releasing write locks (101)

7 years agowe don't have to set the frame on every step
Ralf Jung [Fri, 14 Jul 2017 17:15:55 +0000 (10:15 -0700)]
we don't have to set the frame on every step

7 years agohandle type of function definitions (98)
Ralf Jung [Fri, 14 Jul 2017 16:05:10 +0000 (09:05 -0700)]
handle type of function definitions (98)

7 years agowe need to normalize associated types also deep in the hierarchy (89)
Ralf Jung [Fri, 14 Jul 2017 06:42:18 +0000 (23:42 -0700)]
we need to normalize associated types also deep in the hierarchy (89)

7 years agoHandle trait objects. Only very superficial checking of the vtable for now. (88)
Ralf Jung [Fri, 14 Jul 2017 06:34:08 +0000 (23:34 -0700)]
Handle trait objects.  Only very superficial checking of the vtable for now. (88)

7 years agonits. also, rustc now emits released for drop. (72)
Ralf Jung [Fri, 14 Jul 2017 06:02:51 +0000 (23:02 -0700)]
nits. also, rustc now emits released for drop. (72)

7 years agoexempt UnsafeCell from checks (69)
Ralf Jung [Fri, 14 Jul 2017 05:00:11 +0000 (22:00 -0700)]
exempt UnsafeCell from checks (69)

7 years agomove validation to its own file
Ralf Jung [Fri, 14 Jul 2017 04:57:13 +0000 (21:57 -0700)]
move validation to its own file

7 years agowe have to permit deallocation memory for which we hold a read lock (67)
Ralf Jung [Fri, 14 Jul 2017 03:50:16 +0000 (20:50 -0700)]
we have to permit deallocation memory for which we hold a read lock (67)

7 years agofix handling univariant enums (62)
Ralf Jung [Fri, 14 Jul 2017 03:39:49 +0000 (20:39 -0700)]
fix handling univariant enums (62)

7 years agopermit locking constant memory (60)
Ralf Jung [Fri, 14 Jul 2017 03:33:06 +0000 (20:33 -0700)]
permit locking constant memory (60)

7 years agofn ptrs and never were accidentally disabled (55)
Ralf Jung [Fri, 14 Jul 2017 03:28:00 +0000 (20:28 -0700)]
fn ptrs and never were accidentally disabled (55)

7 years agofix normalizing associated types. this brings us up to 52 passing tests!
Ralf Jung [Fri, 14 Jul 2017 03:23:11 +0000 (20:23 -0700)]
fix normalizing associated types. this brings us up to 52 passing tests!

7 years agohandle array types
Ralf Jung [Fri, 14 Jul 2017 03:22:51 +0000 (20:22 -0700)]
handle array types

7 years agoRe-do the way locking is done during verification
Ralf Jung [Fri, 14 Jul 2017 03:08:35 +0000 (20:08 -0700)]
Re-do the way locking is done during verification

We now lock at the "leaves" on the types, rather than locking at references.
In particular, Validate for sth. of non-reference lvalue will also lock the "outer" memory.
Also change the way we release write locks, and some refactoring in the memory.

7 years agofor references, validate alignment and handle ZSTs
Ralf Jung [Fri, 14 Jul 2017 00:38:31 +0000 (17:38 -0700)]
for references, validate alignment and handle ZSTs

7 years agovalidate TyClosure, TyTuple, TyNever
Ralf Jung [Fri, 14 Jul 2017 00:25:38 +0000 (17:25 -0700)]
validate TyClosure, TyTuple, TyNever

7 years agovarious small fixes and tracing
Ralf Jung [Thu, 13 Jul 2017 23:48:29 +0000 (16:48 -0700)]
various small fixes and tracing

7 years agoAlso release locks on ReleaseValidation and EndRegion
Ralf Jung [Thu, 13 Jul 2017 21:05:45 +0000 (14:05 -0700)]
Also release locks on ReleaseValidation and EndRegion

7 years agofix release_lock_until to no longer remove inactive locks
Ralf Jung [Fri, 23 Jun 2017 04:42:46 +0000 (21:42 -0700)]
fix release_lock_until to no longer remove inactive locks

7 years agoavoid downcasting for enum variants without further fields
Ralf Jung [Tue, 20 Jun 2017 06:49:57 +0000 (23:49 -0700)]
avoid downcasting for enum variants without further fields

7 years agovalidate boxes
Ralf Jung [Tue, 20 Jun 2017 06:39:18 +0000 (23:39 -0700)]
validate boxes

7 years agoimplement checking for ADTs
Ralf Jung [Tue, 20 Jun 2017 06:27:25 +0000 (23:27 -0700)]
implement checking for ADTs

7 years agoimplement stub validity check for basic types (bool, int, float); acquire locks for...
Ralf Jung [Tue, 20 Jun 2017 04:18:43 +0000 (21:18 -0700)]
implement stub validity check for basic types (bool, int, float); acquire locks for references

7 years agoimplement acquiring and releasing locks
Ralf Jung [Mon, 19 Jun 2017 21:56:05 +0000 (14:56 -0700)]
implement acquiring and releasing locks

7 years agoadd locking data structures and lock checks
Ralf Jung [Sat, 17 Jun 2017 00:58:18 +0000 (17:58 -0700)]
add locking data structures and lock checks

This brings back some of the memory range ideas that were deleted with the packed refactoring.

7 years agoupdate for rustc changes: treat new MIR commands as NOP
Ralf Jung [Fri, 16 Jun 2017 22:50:59 +0000 (15:50 -0700)]
update for rustc changes: treat new MIR commands as NOP

7 years agoMerge pull request #267 from RalfJung/cast
Oliver Schneider [Mon, 24 Jul 2017 09:31:25 +0000 (11:31 +0200)]
Merge pull request #267 from RalfJung/cast

Fix ptr-int-casts

7 years agoPass `HasDataLayout` instead of the data layout itself
Oliver Schneider [Mon, 24 Jul 2017 07:56:02 +0000 (09:56 +0200)]
Pass `HasDataLayout` instead of the data layout itself

7 years agoUse rustc traits instead of our own
Oliver Schneider [Sun, 23 Jul 2017 13:00:22 +0000 (15:00 +0200)]
Use rustc traits instead of our own

7 years agomove pointer truncation to a common method in memory.rs
Ralf Jung [Sat, 22 Jul 2017 18:28:14 +0000 (11:28 -0700)]
move pointer truncation to a common method in memory.rs

7 years agoMerge pull request #269 from oli-obk/cleanups
Oliver Schneider [Sat, 22 Jul 2017 07:52:47 +0000 (09:52 +0200)]
Merge pull request #269 from oli-obk/cleanups

Remove unused `IntoValTyPair` hack

7 years agofix nits
Ralf Jung [Sat, 22 Jul 2017 03:02:44 +0000 (20:02 -0700)]
fix nits

7 years agorefactor casting code to more clearly handle pointers
Ralf Jung [Thu, 20 Jul 2017 21:03:02 +0000 (14:03 -0700)]
refactor casting code to more clearly handle pointers

7 years agofix casting integers to pointers
Ralf Jung [Thu, 20 Jul 2017 20:52:58 +0000 (13:52 -0700)]
fix casting integers to pointers

7 years agoRemove unused `IntoValTyPair` hack
Oliver Schneider [Fri, 21 Jul 2017 12:59:58 +0000 (14:59 +0200)]
Remove unused `IntoValTyPair` hack

7 years agoMerge pull request #258 from oli-obk/upstream
Oliver Schneider [Fri, 21 Jul 2017 10:32:45 +0000 (12:32 +0200)]
Merge pull request #258 from oli-obk/upstream

Prep miri repository for rustc merger

7 years agoPrep miri repository for rustc merger
Oliver Schneider [Wed, 19 Jul 2017 15:28:46 +0000 (17:28 +0200)]
Prep miri repository for rustc merger

7 years agoMerge pull request #266 from RalfJung/align
Oliver Schneider [Fri, 21 Jul 2017 07:46:50 +0000 (09:46 +0200)]
Merge pull request #266 from RalfJung/align

Always test alignment in memory.rs

7 years agoalways test alignment in memory.rs
Ralf Jung [Thu, 20 Jul 2017 20:20:33 +0000 (13:20 -0700)]
always test alignment in memory.rs

7 years agoMerge pull request #265 from oli-obk/optimize_prime
Oliver Schneider [Thu, 20 Jul 2017 20:08:02 +0000 (22:08 +0200)]
Merge pull request #265 from oli-obk/optimize_prime

Also test optimized MIR

7 years agoAlso test optimized MIR
Oliver Schneider [Thu, 20 Jul 2017 14:05:14 +0000 (16:05 +0200)]
Also test optimized MIR

7 years agoMerge pull request #264 from oli-obk/paths
Oliver Schneider [Thu, 20 Jul 2017 18:00:19 +0000 (20:00 +0200)]
Merge pull request #264 from oli-obk/paths

Reduce the usage of global paths

7 years agoReduce the usage of global paths
Oliver Schneider [Thu, 20 Jul 2017 14:40:57 +0000 (16:40 +0200)]
Reduce the usage of global paths

7 years agoMerge pull request #260 from RalfJung/tests
Oliver Schneider [Thu, 20 Jul 2017 14:07:08 +0000 (16:07 +0200)]
Merge pull request #260 from RalfJung/tests

Split up test suite

7 years agoMerge pull request #262 from RalfJung/never
Eduard-Mihai Burtescu [Thu, 20 Jul 2017 12:13:21 +0000 (15:13 +0300)]
Merge pull request #262 from RalfJung/never

remove ad-hoc 'never' type check in read_lvalue

7 years agoMove rustc tests from tests to a binary, since they are only run manually anyway
Oliver Schneider [Thu, 20 Jul 2017 11:11:40 +0000 (13:11 +0200)]
Move rustc tests from tests to a binary, since they are only run manually anyway

7 years agoMerge pull request #259 from RalfJung/ref-validate
Oliver Schneider [Thu, 20 Jul 2017 05:09:52 +0000 (07:09 +0200)]
Merge pull request #259 from RalfJung/ref-validate

No longer check aligment and non-NULLness on `&`

7 years agoremove ad-hoc 'never' type check in read_lvalue
Ralf Jung [Thu, 20 Jul 2017 03:32:51 +0000 (20:32 -0700)]
remove ad-hoc 'never' type check in read_lvalue

7 years agoadd test for misaligned pointer loads
Ralf Jung [Thu, 20 Jul 2017 03:26:30 +0000 (20:26 -0700)]
add test for misaligned pointer loads

7 years agofix checking alignment of pointer loads
Ralf Jung [Thu, 20 Jul 2017 03:24:09 +0000 (20:24 -0700)]
fix checking alignment of pointer loads

7 years agofix a warning
Ralf Jung [Wed, 19 Jul 2017 20:31:21 +0000 (13:31 -0700)]
fix a warning

7 years agosplit up the test suite
Ralf Jung [Wed, 19 Jul 2017 19:52:20 +0000 (12:52 -0700)]
split up the test suite

7 years agoenable test code that passes just fine
Ralf Jung [Wed, 19 Jul 2017 18:38:15 +0000 (11:38 -0700)]
enable test code that passes just fine

7 years agoDon't pretend that casts to bool are a thing
Ralf Jung [Wed, 19 Jul 2017 18:35:06 +0000 (11:35 -0700)]
Don't pretend that casts to bool are a thing

7 years agoNo longer check aligment and non-NULLness on `&`
Ralf Jung [Wed, 19 Jul 2017 18:28:35 +0000 (11:28 -0700)]
No longer check aligment and non-NULLness on `&`

This breaks creating unaligned raw pointers via `&packed.field as *const _`, which needs to be legal.
Also it doesn't seem like LLVM still relies on this, see
* https://github.com/solson/miri/issues/244#issuecomment-315563640
* https://internals.rust-lang.org/t/rules-for-alignment-and-non-nullness-of-references/5430/16

We probably want to handle this invariant like the others that validation is concerned with, and only
check it on function boundaries for now.

7 years agoMerge pull request #257 from oli-obk/cleanups
Oliver Schneider [Wed, 19 Jul 2017 09:40:43 +0000 (11:40 +0200)]
Merge pull request #257 from oli-obk/cleanups

Export types and functions needed by priroda

7 years agoExport types and functions needed by priroda
Oliver Schneider [Wed, 19 Jul 2017 09:06:07 +0000 (11:06 +0200)]
Export types and functions needed by priroda

7 years agoMerge pull request #254 from RalfJung/dangling
Oliver Schneider [Tue, 18 Jul 2017 21:34:09 +0000 (23:34 +0200)]
Merge pull request #254 from RalfJung/dangling

Remove reundant dangling checks in {r,d}eallocate

7 years agoMerge pull request #255 from RalfJung/float
Scott Olson [Tue, 18 Jul 2017 21:16:42 +0000 (14:16 -0700)]
Merge pull request #255 from RalfJung/float

use libstd methods for floating-point <-> bytes conversion

7 years agouse libstd methods for floating-point <-> bytes conversion
Ralf Jung [Tue, 18 Jul 2017 20:56:01 +0000 (13:56 -0700)]
use libstd methods for floating-point <-> bytes conversion

7 years agoremove reundant dangling checks in {r,d}eallocate
Ralf Jung [Tue, 18 Jul 2017 20:50:54 +0000 (13:50 -0700)]
remove reundant dangling checks in {r,d}eallocate

7 years agoMerge pull request #245 from oli-obk/funky_allocs
Oliver Schneider [Tue, 18 Jul 2017 12:09:15 +0000 (14:09 +0200)]
Merge pull request #245 from oli-obk/funky_allocs

Ensure that it is not possible to explicitly free stack memory

7 years agoMerge pull request #249 from RalfJung/lvalue
Oliver Schneider [Fri, 14 Jul 2017 19:28:06 +0000 (21:28 +0200)]
Merge pull request #249 from RalfJung/lvalue

lvalue: refactoring to permit applying a mir projection to a miri lvalue

7 years agolvalue: refactoring to permit applying a mir projection to a miri lvalue
Ralf Jung [Tue, 20 Jun 2017 03:13:26 +0000 (20:13 -0700)]
lvalue: refactoring to permit applying a mir projection to a miri lvalue

7 years agoAdd a comment explaining the static "local" during `deallocate_local`
Oliver Schneider [Fri, 14 Jul 2017 15:46:28 +0000 (17:46 +0200)]
Add a comment explaining the static "local" during `deallocate_local`

7 years agoFix static mutation tests
Oliver Schneider [Thu, 13 Jul 2017 17:10:14 +0000 (19:10 +0200)]
Fix static mutation tests

7 years agoRemove duplicate test
Oliver Schneider [Thu, 13 Jul 2017 15:25:27 +0000 (17:25 +0200)]
Remove duplicate test

7 years agoUse enum instead of boolean
Oliver Schneider [Thu, 13 Jul 2017 15:25:17 +0000 (17:25 +0200)]
Use enum instead of boolean

7 years agoClarify documentation
Oliver Schneider [Thu, 13 Jul 2017 14:58:36 +0000 (16:58 +0200)]
Clarify documentation

7 years agoEnsure that it is not possible to explicitly free stack memory
Oliver Schneider [Wed, 12 Jul 2017 12:51:47 +0000 (14:51 +0200)]
Ensure that it is not possible to explicitly free stack memory

7 years agoMerge pull request #247 from RalfJung/packed
Oliver Schneider [Fri, 14 Jul 2017 06:30:30 +0000 (08:30 +0200)]
Merge pull request #247 from RalfJung/packed

Re-do packed memory accesses

7 years agopacked structs: test unsize coercions
Ralf Jung [Thu, 13 Jul 2017 21:18:26 +0000 (14:18 -0700)]
packed structs: test unsize coercions

7 years agoMerge pull request #243 from solson/magic_numbers
Oliver Schneider [Thu, 13 Jul 2017 20:07:02 +0000 (22:07 +0200)]
Merge pull request #243 from solson/magic_numbers

Get rid of magic numbers

7 years agouse closures to ensure proper bracketing of unaligned accesses
Ralf Jung [Thu, 13 Jul 2017 17:29:11 +0000 (10:29 -0700)]
use closures to ensure proper bracketing of unaligned accesses