Merged
Conversation
e9fe31c to
af091c1
Compare
af091c1 to
fad94db
Compare
fad94db to
6159e1c
Compare
6159e1c to
db92901
Compare
64d4e23 to
7800907
Compare
aibaars
reviewed
May 19, 2022
Contributor
aibaars
left a comment
There was a problem hiding this comment.
Looks good to me. Could you add some more QLdoc to the flow summaries?
aibaars
reviewed
May 20, 2022
Contributor
aibaars
left a comment
There was a problem hiding this comment.
This looks great to me. A minor nit: I think it would be clearer to use more informative field names for the ConstantValues that represent an array index or hash key.
Is the slowdown in performance within expectations?
aibaars
previously approved these changes
May 24, 2022
nickrolfe
reviewed
May 24, 2022
Co-authored-by: Nick Rolfe <nickrolfe@github.com>
84ee88a to
1ae8087
Compare
Contributor
Author
|
Rebased to resolve merge conflict. |
nickrolfe
approved these changes
May 24, 2022
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.
This PR is the culmination of a lot of preparatory work (#7750, #7677, #7914, #8641, #8786, #8870, #8898, #8938) required for precisely tracking data-flow through hashes in Ruby. The bulk of the work of this PR is about adding flow summaries (and tests) for the members of the Hash class. For some of the summaries, the method names overlap with existing summaries for the Array class, and for those we have adjusted existing summaries to account for hashes.
For example, the (simplified) original flow summary for the
delete_ifmethod wasIt has now been generalized to account for (a) for hashes, the value goes into the second parameter of the block, (b) only array indices may get shifted, all other known indices (such as symbols) will not:
Note that if we are tracking a precise integer index (
Element(0..)), then we assume that it will be an array, and hence conservatively convert the index to be unknown, although that wouldn't be the case if it was a known integer key in a hash.