-
Notifications
You must be signed in to change notification settings - Fork 1.9k
JavaScript: Replace all uses of tracked nodes with type tracking. #1163
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
Conversation
…cking. This is sufficient since we are not doing summarisation.
6ae98ae to
c50067b
Compare
asger-semmle
left a comment
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.
LGTM overall
I was a bit sad to a see the style is different from the one I've been using and tried to advocate in a few places. Of course, that was just a style I made up and we haven't agreed upon as a team, but I think it's worth picking a one style and sticking with it. The differences between the two styles are currently:
- What I have called
t2is here calleds,prev, ornext. - What I have called
refis here calledflowsToSourceNode. - What I phrased as "with
tsummarising the data flow path" (although usually omitted) is here phrased as "with type tracking info stored int".
Apart from the flowsToSourceNode change I wouldn't mind adopting the same style. If you're happy with these choices, could you update the qldoc and test cases in library-tests/TypeTracking to reflect this?
About caching: my intention was the StepSummary::{step, append, prepend} would be cached, and track and backtrack would be pragma[inline]. It was reassuring to see you arrived at something similar, although I think we can still get more by caching step. We'd need to find a way to cache both step and a reordered copy of step for use in backtrack, though that's something we can investigate later.
| * | ||
| * Examples include arguments to the CommonJS `require` function or AMD dependency arguments. | ||
| */ | ||
| abstract class PathExprCandidate extends Expr { |
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.
Could you confirm that the import graph is unchanged?
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.
Oh, good idea. It'll require rebuilding some snapshots, but seems worth doing.
Yeah, I found myself preferring I don't think there was any good reason for me changing the description of |
|
Naming suggestions addressed; running the import graph comparison now. |
6141e35 to
3e16d16
Compare
asger-semmle
left a comment
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.
Thanks for the update. Let's wait for the import graph check, but otherwise LGTM now.
|
No changes to |
|
Good enough for me |
This has turned into a fairly big PR, with three layers of commits (which I'd be happy to submit as separate PRs if desired):
TypeTrackerandTypeBackTrackerfor details.Performance is pretty awesome (internal link). The new results on NodeGoat look like (seeded) true positives; the regexp injection on semmle-express-test is, I think, a false positive that is unrelated to this PR (we assume every call to
matchwith the right arity does regexp matching); and the remote-property injection results are harmless (the object into which the properties are injected has anullprototype).