5.9: [MoveOnlyAddressChecker] Fix representation for reinit'd fields. #66947
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description: Fix a class of miscompiles in the move-only address checker.
The move-only address checker records which instructions reinitialize ranges of fields of a move-only value. Previously, it recorded instructions which reinitialized and the reinitialized fields via a map from instructions to ranges of fields of the value. But a single instruction can reinitialize non-contiguous fields of the value being checked.
The fix is to change the the value stored corresponding to an instruction to have enough information to store all the non-contiguous fields of the value that it uses. Here, the representation of a bit vector is implemented.
Risk: Low. The change is straightforward and similar in spirit to #66738 .
Scope: Narrow. This only affects move-only types.
Original PR: #66945
Reviewed By: Andrew Trick ( @atrick )
Testing: Added test that the move-only address checker previously miscompiled.
Resolves: rdar://111356251