StringInterpolationComponentCfgNode extends ExprNodes::StmtSequenceCfgNode

This commit is contained in:
Alex Ford
2021-06-24 14:58:36 +01:00
parent a4a8f17a54
commit 1f5a5181b9
2 changed files with 6 additions and 6 deletions

View File

@@ -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(_) }
}

View File

@@ -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