mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
StringInterpolationComponentCfgNode extends ExprNodes::StmtSequenceCfgNode
This commit is contained in:
@@ -118,11 +118,6 @@ class StringComponentCfgNode extends AstCfgNode {
|
||||
StringComponentCfgNode() { this.getNode() instanceof StringComponent }
|
||||
}
|
||||
|
||||
/** A control-flow node that wraps a `StringInterpolationComponent` AST expression. */
|
||||
class StringInterpolationComponentCfgNode extends StringComponentCfgNode {
|
||||
StringInterpolationComponentCfgNode() { this.getNode() instanceof StringInterpolationComponent }
|
||||
}
|
||||
|
||||
private Expr desugar(Expr n) {
|
||||
result = n.getDesugared()
|
||||
or
|
||||
@@ -341,6 +336,11 @@ module ExprNodes {
|
||||
final override VariableReadAccess getExpr() { result = ExprCfgNode.super.getExpr() }
|
||||
}
|
||||
|
||||
/** A control-flow node that wraps a `StringInterpolationComponent` AST expression. */
|
||||
class StringInterpolationComponentCfgNode extends ExprNodes::StmtSequenceCfgNode {
|
||||
StringInterpolationComponentCfgNode() { this.getNode() instanceof StringInterpolationComponent }
|
||||
}
|
||||
|
||||
private class StringlikeLiteralChildMapping extends ExprChildMapping, StringlikeLiteral {
|
||||
override predicate relevantChild(Expr e) { e = this.getComponent(_) }
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ predicate defaultAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nod
|
||||
// string interpolation of `nodeFrom` into `nodeTo`
|
||||
exists(
|
||||
CfgNodes::ExprNodes::StringlikeLiteralCfgNode lit,
|
||||
CfgNodes::StringInterpolationComponentCfgNode sic
|
||||
CfgNodes::ExprNodes::StringInterpolationComponentCfgNode sic
|
||||
|
|
||||
lit = nodeTo.asExpr() and
|
||||
sic = lit.getAComponent() and
|
||||
|
||||
Reference in New Issue
Block a user