- Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix init soundness #13472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fix init soundness #13472
Changes from 1 commit
Commits
Show all changes
51 commits Select commit Hold shift + click to select a range
857cc74 Update tests
EnzeXing ef43eb5 Add worklist and refactor definition for ThisRef
liufengyun 5d1fe86 Rename Addr to Ref
liufengyun 7279f73 Refactor: make state explicit
liufengyun 20ff7ca Add constructor to Warm
liufengyun f5651b5 Revert ThisRef to previous version
liufengyun 6763285 Refactor constructor call
liufengyun ab09fd2 Make cache part of state
liufengyun 98f9f7e Handle cache in work list
liufengyun fb0c347 Don't iterate if errors found
liufengyun 69e314e Revert heap changes if cache has changed
liufengyun db11295 Restore cacheResult option for eval
liufengyun 111ac87 Handle callConstructor
liufengyun 29bdb5d Reset Cache.changed after each iteration
liufengyun 0b1b21f Tweak log printing of errors
liufengyun c5daf1d Fix context for init check
liufengyun 4a71470 Introduce global cache which holds fixed point value
liufengyun 375e0e5 Update tests
liufengyun 6188e8e Avoid asInstanceOf in logging
liufengyun 5bdd898 Refactor cache
liufengyun 9ea3624 Cache default value in the input cache
liufengyun d0e71a2 Rename global cache to stable cache
liufengyun fe3930d Better encapsulate Cache.assume
liufengyun 5bd83ae Rename in/out to last/current
liufengyun 2589824 Mark arguments as constructor only
liufengyun 2849052 Add note for tempting but unsound optimization
liufengyun 8a4fe78 Commit cache to stable on error
liufengyun 5b00b1f Make sure the object of a reference assumption value exists
liufengyun 04aa72b Add back arguments to ThisRef
liufengyun ad503fc Populate parameters of Warm objects by reusing init
liufengyun fb3b6ca Make sure the class parameters and outers of warm objects are populated
liufengyun bc98ce8 Use correct trace
liufengyun b27d58b Populate class parameters for warm objects in a heap prepare step
liufengyun 99df102 Try to check warm values immediately
liufengyun 4163fd3 Fix crash: make sure object fresh before calling init
liufengyun 683d537 Be more sensitive for values Warm(outer = ThisRef)
liufengyun ccbb355 Fix non-determinism in test
liufengyun fc76549 Make isPopulatingParams a flag in Warm
liufengyun 191877a Make heap as part of cache
liufengyun f5540f5 Update test
liufengyun a15a06c Add more debugging information
liufengyun 46793f1 Lazily populate warm objects
liufengyun 8bbe384 Add comment
liufengyun dab8181 Fix non-termination
liufengyun 1ab5316 Fix pickling test
liufengyun 1e802c9 Remove unused parameters of ThisRef
liufengyun 8088217 Fix compilation of scodec
liufengyun 6566756 Apply suggestions from code review
liufengyun 15a51d7 Address review comments
liufengyun 7ee58a3 Address review: Add comment to populateParams
liufengyun e905cd5 Fix compilation
liufengyun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add back arguments to ThisRef
- Loading branch information
commit 04aa72bb5f1f76cfa230d070235a0d96019c5732
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the key iteration loop. It would make the overall algorithm more understandable if the code showed more explicitly what an iteration does. The structure I have in mind is something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to clarify whether a "task" means doing all the iterations for a class or doing just one. Currently it's just one iteration but that doesn't fit with the idea of a worklist since it wouldn't be correct to interleave individual iterations for different classes. So I think a "task" should be all of the analysis of a single class.
We don't really need the worklist anymore but I think we should keep it in case we change the design to need it in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we may need it in the future. Currently, we can't remove the worklist, because we only want to traverse the trees once.