Skip to content

C++: Support nested field flow#1772

Merged
geoffw0 merged 1 commit into
github:masterfrom
jbj:ast-field-flow-nested
Sep 3, 2019
Merged

C++: Support nested field flow#1772
geoffw0 merged 1 commit into
github:masterfrom
jbj:ast-field-flow-nested

Conversation

@jbj

@jbj jbj commented Aug 20, 2019

Copy link
Copy Markdown
Contributor

This is the C/C++ side of #1766.

@jbj jbj added the C++ label Aug 20, 2019
@jbj jbj requested a review from a team as a code owner August 20, 2019 08:09
@jbj jbj force-pushed the ast-field-flow-nested branch from 84e6243 to da49e24 Compare August 23, 2019 07:19
@jbj

jbj commented Aug 29, 2019

Copy link
Copy Markdown
Contributor Author

The FPs introduced in this PR are an artifact of the test being a bit artificial. They are fixed by #1797, which is under consideration in Copenhagen.

exists(PartialDefinition pd |
node = pd.getSubBasicBlockStart() and
fa = pd.getDefinedExpr()
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm struggling with this as the comments explaining PartialDefinitions are rather minimal. Perhaps we could talk through an example?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, I understand what's going on now.

// path somewhere in the search. That makes the library conclude that there
// could be flow to `b.f.a_` even when the flow was actually to `b.f.b_`.
sink(b.f.a()); // flow [FALSE POSITIVE through `b2.f.setB` and `b3.f.setB`]
sink(b.f.b()); // flow [FALSE POSITIVE through `b1.f.setA` and `b3.f.setA`]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice to have a test case where the changes do get the correct result.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When we discussed this, @jbj pointed out that there are correct results on these lines as well as false positive results (and he expects future changes to eliminate the FPs here).

geoffw0
geoffw0 previously approved these changes Sep 2, 2019

@geoffw0 geoffw0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

exists(PartialDefinition pd |
node = pd.getSubBasicBlockStart() and
fa = pd.getDefinedExpr()
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, I understand what's going on now.

// path somewhere in the search. That makes the library conclude that there
// could be flow to `b.f.a_` even when the flow was actually to `b.f.b_`.
sink(b.f.a()); // flow [FALSE POSITIVE through `b2.f.setB` and `b3.f.setB`]
sink(b.f.b()); // flow [FALSE POSITIVE through `b1.f.setA` and `b3.f.setA`]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When we discussed this, @jbj pointed out that there are correct results on these lines as well as false positive results (and he expects future changes to eliminate the FPs here).

@geoffw0

geoffw0 commented Sep 2, 2019

Copy link
Copy Markdown
Contributor

There's now a conflict, other than this I'm ready to merge this PR.

This is the C/C++ side of PR github#1766.

@geoffw0 geoffw0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 still.

@geoffw0 geoffw0 merged commit d092905 into github:master Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants