]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #71610 - divergentdave:InvalidUndefBytes-range, r=RalfJung
authorRalf Jung <post@ralfj.de>
Fri, 22 May 2020 09:32:18 +0000 (11:32 +0200)
committerGitHub <noreply@github.com>
Fri, 22 May 2020 09:32:18 +0000 (11:32 +0200)
commit2059112eb40619d39f89102f832c4450d6b8ffc5
tree8645542cf01b7df8bf848de634845272ab815390
parentc60b675e280fedded8d8487acd051cd342e486f2
parent0148a7f26ce636ac22ac7797dcd7d292c59e8576
Rollup merge of #71610 - divergentdave:InvalidUndefBytes-range, r=RalfJung

InvalidUndefBytes: Track size of undef region used

This PR adds a size to `UndefinedBehaviorInfo::InvalidUndefBytes`, to keep track of how many undefined bytes in a row were accessed, and changes a few methods to pass this information through. This additional information will eventually be used in Miri to improve diagnostics for this UB error. See also rust-lang/miri#1354 for prior discussion.

I expect Miri will break the next time its submodule is updated, due to this change to the `InvalidUndefBytes`. (The current commit for src/tools/miri predates rust-lang/miri#1354, and thus does not try to destructure the `InvalidUndefBytes` variant) I have a corresponding change prepared for that repository.

r? @RalfJung
src/librustc_mir/interpret/validity.rs