Skip to content

Commit d24c507

Browse files
committed
Move private helper method out of module
1 parent a119b99 commit d24c507

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

java/ql/lib/semmle/code/java/frameworks/SnakeYaml.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ class Yaml extends RefType {
2828
Yaml() { this.getAnAncestor().hasQualifiedName("org.yaml.snakeyaml", "Yaml") }
2929
}
3030

31+
private DataFlow::ExprNode yamlClassInstanceExprArgument(ClassInstanceExpr cie) {
32+
cie.getConstructedType() instanceof Yaml and
33+
result.getExpr() = cie.getArgument(0)
34+
}
35+
3136
private module SafeYamlConstructionFlowConfig implements DataFlow::ConfigSig {
3237
predicate isSource(DataFlow::Node src) { src.asExpr() instanceof SafeSnakeYamlConstruction }
3338

3439
predicate isSink(DataFlow::Node sink) { sink = yamlClassInstanceExprArgument(_) }
3540

36-
additional DataFlow::ExprNode yamlClassInstanceExprArgument(ClassInstanceExpr cie) {
37-
cie.getConstructedType() instanceof Yaml and
38-
result.getExpr() = cie.getArgument(0)
39-
}
40-
4141
additional ClassInstanceExpr getSafeYaml() {
4242
SafeYamlConstructionFlow::flowTo(yamlClassInstanceExprArgument(result))
4343
}

0 commit comments

Comments
 (0)