Skip to content

Commit ae837d9

Browse files
committed
API graphs: Remove restriction on top-level constants
1 parent 0eaeb3b commit ae837d9

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

ql/src/codeql_ruby/ApiGraphs.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ module API {
270270
or
271271
name = read.getName() and
272272
not exists(resolveScopeExpr(read)) and
273-
not exists(read.getScopeExpr()) and
274-
not exists(read.getValue())
273+
not exists(read.getScopeExpr())
275274
)
276275
or
277276
exists(DataFlow::LocalSourceNode src, DataFlow::LocalSourceNode pred |

ql/test/library-tests/dataflow/api-graphs/test1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Foo::Bar::Baz #$ use=getMember("Foo").getMember("Bar").getMember("Baz")
1414

1515
Const = [1, 2, 3]
16-
Const.each do |c|
16+
Const.each do |c| #$ use=getMember("Const").getReturn("each")
1717
puts c
1818
end
1919

0 commit comments

Comments
 (0)