Skip to content

Commit 187a68b

Browse files
committed
Ruby: Add flow summary for Hash#keys
1 parent e895f96 commit 187a68b

File tree

1 file changed

+10
-0
lines changed
  • ruby/ql/lib/codeql/ruby/frameworks/core

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,3 +523,13 @@ private class ValuesSummary extends SimpleSummarizedCallable {
523523
preservesValue = true
524524
}
525525
}
526+
527+
private class KeysSummary extends SimpleSummarizedCallable {
528+
KeysSummary() { this = "keys" }
529+
530+
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
531+
input = "Argument[self].Element[any]" and
532+
output = "ReturnValue.Element[?]" and
533+
preservesValue = true
534+
}
535+
}

0 commit comments

Comments
 (0)