Skip to content

Commit 0592c8b

Browse files
committed
Ruby: avoid name clash for "assoc" summary
1 parent 50a7b21 commit 0592c8b

File tree

1 file changed

+7
-5
lines changed
  • ruby/ql/lib/codeql/ruby/frameworks/core

1 file changed

+7
-5
lines changed

ruby/ql/lib/codeql/ruby/frameworks/core/Hash.qll

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,13 @@ module Hash {
199199
}
200200
}
201201

202-
private class AssocUnknownSummary extends AssocSummary {
203-
AssocUnknownSummary() {
204-
this = "assoc" and
205-
mc.getNumberOfArguments() = 1 and
206-
not exists(DataFlow::Content::getKnownElementIndex(mc.getArgument(0)))
202+
private class AssocUnknownSummary extends SummarizedCallable {
203+
AssocUnknownSummary() { this = "assoc-unknown-arg" }
204+
205+
override MethodCall getACallSimple() {
206+
result.getMethodName() = "assoc" and
207+
result.getNumberOfArguments() = 1 and
208+
not exists(DataFlow::Content::getKnownElementIndex(result.getArgument(0)))
207209
}
208210

209211
override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {

0 commit comments

Comments
 (0)