mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Merge pull request #13265 from asgerf/rb/delete-name-clash
Ruby: fix some name clashes between summarized callables
This commit is contained in:
@@ -583,7 +583,8 @@ module Array {
|
||||
|
||||
private class DeleteUnknownSummary extends DeleteSummary {
|
||||
DeleteUnknownSummary() {
|
||||
this = "delete" and
|
||||
// Note: take care to avoid a name clash with the "delete" summary from String.qll
|
||||
this = "delete-unknown-key" and
|
||||
not exists(DataFlow::Content::getKnownElementIndex(mc.getArgument(0)))
|
||||
}
|
||||
|
||||
|
||||
@@ -199,11 +199,13 @@ module Hash {
|
||||
}
|
||||
}
|
||||
|
||||
private class AssocUnknownSummary extends AssocSummary {
|
||||
AssocUnknownSummary() {
|
||||
this = "assoc" and
|
||||
mc.getNumberOfArguments() = 1 and
|
||||
not exists(DataFlow::Content::getKnownElementIndex(mc.getArgument(0)))
|
||||
private class AssocUnknownSummary extends SummarizedCallable {
|
||||
AssocUnknownSummary() { this = "assoc-unknown-arg" }
|
||||
|
||||
override MethodCall getACallSimple() {
|
||||
result.getMethodName() = "assoc" and
|
||||
result.getNumberOfArguments() = 1 and
|
||||
not exists(DataFlow::Content::getKnownElementIndex(result.getArgument(0)))
|
||||
}
|
||||
|
||||
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
|
||||
|
||||
Reference in New Issue
Block a user