Correct check for vtable pointer type (fix Firecracker regression)#279
Merged
adpaco-aws merged 2 commits intomodel-checking:main-153-2021-06-23from Jul 1, 2021
Merged
Conversation
2 tasks
danielsn
reviewed
Jul 1, 2021
Contributor
danielsn
left a comment
There was a problem hiding this comment.
LGTM module the comment
| } else { | ||
| // Assert that the source is not a pointer or is a thin pointer | ||
| assert!(pointee_type(src_mir_type).map_or(true, |p| self.use_thin_pointer(p))); | ||
| // Check that the source is either not a pointer or some other known case |
Contributor
There was a problem hiding this comment.
Not sure what this comment means
chinmaydd
approved these changes
Jul 1, 2021
chinmaydd
left a comment
There was a problem hiding this comment.
Approved, PR was updated as requested
adpaco-aws
approved these changes
Jul 1, 2021
tedinski
pushed a commit
to tedinski/rmc
that referenced
this pull request
Apr 26, 2022
…odel-checking#279) * Correct check for vtable pointer type * Comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 of changes:
Using
is_trait()on a pointee type is an not always a reliable way of checking if a pointer is to a vtable, since it returns false for types with more indirection, such as:&std::sync::Mutex<dyn bus::BusDevice>.Resolved issues:
Resolves #272
Call-outs:
Same commit on #264, will merge.
Testing:
Tested on #264.
No.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.