Ruby: Include more nodes in {Hash,Array}LiteralCfgNode

This commit is contained in:
Tom Hvitved
2023-11-14 13:07:06 +01:00
parent 28a5a1d507
commit 475d8da342
2 changed files with 18 additions and 20 deletions

View File

@@ -960,8 +960,7 @@ module ExprNodes {
exists(ConstantReadAccess array |
array = this.getReceiver().getExpr() and
e.(MethodCall).getMethodName() = "[]" and
array.getName() = "Array" and
array.hasGlobalScope()
array.getModule().getQualifiedName() = "Array"
)
}
}
@@ -975,11 +974,10 @@ module ExprNodes {
override string getAPrimaryQlClass() { result = "HashLiteralCfgNode" }
HashLiteralCfgNode() {
exists(ConstantReadAccess array |
array = this.getReceiver().getExpr() and
exists(ConstantReadAccess hash |
hash = this.getReceiver().getExpr() and
e.(MethodCall).getMethodName() = "[]" and
array.getName() = "Hash" and
array.hasGlobalScope()
hash.getModule().getQualifiedName() = "Hash"
)
}