Skip to content

Commit 2187994

Browse files
committed
Ruby: Prevent infinite recursion in module resolution library
1 parent 7e644d8 commit 2187994

File tree

7 files changed

+315
-182
lines changed

7 files changed

+315
-182
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)