Skip to content

Commit 93678e5

Browse files
committed
Ruby: fix name of super calls in singleton methods
1 parent 5de8934 commit 93678e5

File tree

1 file changed

+5
-3
lines changed
  • ruby/ql/lib/codeql/ruby/ast/internal

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,15 @@ private Ruby::AstNode getSuperParent(Ruby::Super sup) {
121121
result = sup
122122
or
123123
result = getSuperParent(sup).getParent() and
124-
not result instanceof Ruby::Method
124+
not result instanceof Ruby::Method and
125+
not result instanceof Ruby::SingletonMethod
125126
}
126127

127128
private string getSuperMethodName(Ruby::Super sup) {
128-
exists(Ruby::Method meth |
129-
meth = getSuperParent(sup).getParent() and
129+
exists(Ruby::AstNode meth | meth = getSuperParent(sup).getParent() |
130130
result = any(Method c | toGenerated(c) = meth).getName()
131+
or
132+
result = any(SingletonMethod c | toGenerated(c) = meth).getName()
131133
)
132134
}
133135

0 commit comments

Comments
 (0)