-
Notifications
You must be signed in to change notification settings - Fork 64
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
Introduce AssignExpression
to support multiple assignments
#1105
Conversation
7cc4405
to
d1dc827
Compare
AssignStatement
AssignStatement
AssignStatement
to support multiple assignments
d1dc827
to
764efd2
Compare
AssignStatement
to support multiple assignmentsAssignExpression
to support multiple assignments
AssignExpression
to support multiple assignmentsAssignExpression
to support multiple assignments
9c63b9c
to
f0851ce
Compare
7c30414
to
83f3b65
Compare
cpg-analysis/src/main/kotlin/de/fraunhofer/aisec/cpg/analysis/ValueEvaluator.kt
Show resolved
Hide resolved
...ore/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/AssignExpression.kt
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/HasInitializer.kt
Show resolved
Hide resolved
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'm surprised that there's no change necessary to the ControlFlowSensitiveDFGPass
.
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/declarations/VariableDeclaration.kt
Outdated
Show resolved
Hide resolved
...ore/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/AssignExpression.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/types/TupleType.kt
Show resolved
Hide resolved
99aac98
to
3e59d28
Compare
9c54b66
to
a3b5c69
Compare
This adds a new statement class, called `AssignStatement` as well as `TupleType`.
a3b5c69
to
9ba037f
Compare
Kudos, SonarCloud Quality Gate passed! |
To be honest, I have just not touched that yet, because for me this pass is black voodoo magic. There are some checks in the pass for |
Ok, I guess I should look at it but we can do that in a separate PR. I just realized that we should probably also change the |
Yes that would be good; I would only offer the |
This adds a new statement class, called
AssignExpression
as well asTupleType
.The
AssignExpression
holds a list oflhs
andrhs
for the respective values on the left and right side. Furthermore, it contains a list ofdeclarations
, since some languages can declare variables in an assignment-like statement (either implicitly or explicitly). The recommended way to fill these declarations are in an extra pass that runs after all language frontends have been executed.