Skip to content

Java: Add support for additional nodes, read steps, and store steps for QL models and model ThreadLocal.initialValue #14297

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 3 commits into from
Sep 26, 2023

Conversation

aschackmull
Copy link
Contributor

In #14268 I temporarily removed an additional step in a flow configuration for ThreadLocal.initialValue. This PR adds the step as a general purpose step applicable for all flow configurations. In order to do so we need support for adding additional store steps, so I added that capability along with read steps for symmetry. We also need an additional data flow node as an intermediate stepping stone between the store step and the jump step, so I added support for adding additional data flow nodes as well in the first commit. In the end I decided I might as well just use the existing node for the instance parameter, as that has the proper type, but I think we might as well keep the option of adding data flow nodes for any future use-cases.

With these new extension points, it should be easier to add precise field-based QL models for the cases that fall outside the capabilities of MaD.

@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Sep 22, 2023
@aschackmull aschackmull requested a review from a team as a code owner September 22, 2023 11:43
@github-actions github-actions bot added the Java label Sep 22, 2023
Copy link
Contributor

@atorralba atorralba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, although I'd have liked to see some example of AdditionalDataFlowNode/AdditionalNode being used.

@@ -133,6 +135,8 @@ module Public {
result = this.(CaptureNode).getTypeImpl()
or
result = this.(FieldValueNode).getField().getType()
or
result instanceof TypeObject and this instanceof AdditionalNode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess instanceof TypeObject is the most restrictive assumption we can make about result in this case, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I was thinking about whether the additional-node extension point ought to include some option to set the type, but that's probably just an unnecessary complication, since type strengthening will pick up a stronger type quickly from the surrounding nodes.

@aschackmull
Copy link
Contributor Author

although I'd have liked to see some example of AdditionalDataFlowNode/AdditionalNode being used

Yeah, as I noted above, I ended up not using those, but felt that they were nice to have anyway.

@aschackmull aschackmull merged commit e6d832c into github:main Sep 26, 2023
@aschackmull aschackmull deleted the java/additional-steps-and-nodes branch September 26, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants