-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C#: Fix CFG for unknown expressions #11
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
calumgrant
commented
Aug 3, 2018
- Fix the CFG for unknown expressions, which were previously excluded from the control flow graph, which could lead to an incomplete graph.
- Add a test for this change, and also test the extraction of initializer-lists with unknown expressions. This test will currently fail on this branch as it tests extractor changes.
8e311a2
to
3658185
Compare
* Returns the `i`th child of an expression, with | ||
* children ranked from 0. | ||
*/ | ||
private ControlFlowElement getRankedExprChild(Expr e, int i) { |
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.
I would change the name to getUnknownExprChild
to match the other helper predicates, and perhaps remove the QL doc.
* Returns the `i`th child of an expression, with | ||
* children ranked from 0. | ||
*/ | ||
private ControlFlowElement getRankedExprChild(Expr e, int i) { |
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.
Change Expr e
to @unknown_expr
, otherwise we will be computing the relation for all expressions, rather than just the unknown expressions.
* have a valid `toString()`. | ||
*/ | ||
class UnknownCall extends MethodCall | ||
{ |
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.
Move brace up.
@@ -0,0 +1,18 @@ | |||
import csharp |
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.
Add a
/**
* @kind graph
* @id cfg
*/
header; then we will be able to see the visualized graph in the IDE.
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.
Should be removed again, sorry.
4c5436e
to
ff44772
Compare
@calumgrant : Should this go into 1.18? |
It should be in sync with the corresponding changes in Semmle/code (https://git.semmle.com/Semmle/code/pull/26692), so yes. I'll rebase, but it will conflict with #163. |
…object initializer lists fixed by the extractor.
ff44772
to
ecb3efb
Compare
Does this need a change note, or doesn't the change affect existing users? |
Java/Kotlin: Enhance 'compilations' support
feat(composite-actions): Fix summary and source queries for composite actions analysis