Skip to content

Commit 3bc6247

Browse files
authored
Merge pull request #7378 from hvitved/ruby/module-infinite-loop
Ruby: Prevent infinite recursion in module resolution library
2 parents 7e644d8 + c6696ad commit 3bc6247

File tree

15 files changed

+518
-184
lines changed

15 files changed

+518
-184
lines changed

ruby/ql/lib/codeql/ruby/ApiGraphs.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ module API {
244244
MkUse(DataFlow::Node nd) { isUse(nd) }
245245

246246
private string resolveTopLevel(ConstantReadAccess read) {
247-
TResolved(result) = resolveScopeExpr(read) and
247+
TResolved(result) = resolveConstantReadAccess(read) and
248248
not result.matches("%::%")
249249
}
250250

ruby/ql/lib/codeql/ruby/ast/Constant.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class ConstantReadAccess extends ConstantAccess {
136136
this.hasGlobalScope() and
137137
result = lookupConst(TResolved("Object"), this.getName())
138138
or
139-
result = lookupConst(resolveScopeExpr(this.getScopeExpr()), this.getName())
139+
result = lookupConst(resolveConstantReadAccess(this.getScopeExpr()), this.getName())
140140
}
141141

142142
override string getValueText() { result = this.getValue().getValueText() }

0 commit comments

Comments
 (0)