Skip to content

Commit 604af4f

Browse files
authored
Merge pull request #10302 from github/rc/3.7
Merge 3.7 into main
2 parents 1178dcb + e8d13d1 commit 604af4f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ruby/ql/lib/codeql/ruby/ast/internal/Module.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,14 @@ private module Cached {
137137
}
138138

139139
cached
140-
Method lookupMethod(Module m, string name) { TMethod(result) = lookupMethodOrConst(m, name) }
140+
Method lookupMethod(Module m, string name) {
141+
// The syntax_suggest library redefines Kernel.require/require_relative.
142+
// Somehow this causes performance issues on ruby/ruby. As a workaround
143+
// we exclude 'require' and 'require_relative'.
144+
// TODO: find the actual cause of the slowdown and fix things properly.
145+
not name = ["require", "require_relative"] and
146+
TMethod(result) = lookupMethodOrConst(m, name)
147+
}
141148

142149
cached
143150
Expr lookupConst(Module m, string name) {

0 commit comments

Comments
 (0)