mirror of
https://github.com/github/codeql.git
synced 2026-02-20 08:53:49 +01:00
Add local flow step for parenthesized expressions
This commit is contained in:
@@ -249,6 +249,11 @@ module ExprNodes {
|
||||
final ExprCfgNode getExpr(int n) { e.hasCfgChild(e.getExpr(n), this, result) }
|
||||
}
|
||||
|
||||
/** A control-flow node that wraps an `ExprSequence` AST expression. */
|
||||
class ParenthesizedExprCfgNode extends ExprSequenceCfgNode {
|
||||
ParenthesizedExprCfgNode() { this.getExpr() instanceof ParenthesizedExpr }
|
||||
}
|
||||
|
||||
/** A control-flow node that wraps a `VariableReadAccess` AST expression. */
|
||||
class VariableReadAccessCfgNode extends ExprCfgNode {
|
||||
override VariableReadAccess e;
|
||||
|
||||
@@ -124,6 +124,9 @@ private module Cached {
|
||||
exists(Ssa::Definition def | LocalFlow::localSsaFlowStep(def, nodeFrom, nodeTo))
|
||||
or
|
||||
nodeFrom.asExpr() = nodeTo.asExpr().(CfgNodes::ExprNodes::AssignExprCfgNode).getRhs()
|
||||
or
|
||||
nodeFrom.asExpr() =
|
||||
nodeTo.asExpr().(CfgNodes::ExprNodes::ParenthesizedExprCfgNode).getLastExpr()
|
||||
}
|
||||
|
||||
cached
|
||||
|
||||
Reference in New Issue
Block a user