Skip to content

Commit ee7970a

Browse files
committed
Ruby: treat String as a builtin
1 parent db58e33 commit ee7970a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ private string builtin() {
66
result =
77
[
88
"Object", "Kernel", "BasicObject", "Class", "Module", "NilClass", "FalseClass", "TrueClass",
9-
"Numeric", "Integer", "Float", "Rational", "Complex", "Array", "Hash", "Symbol", "Proc"
9+
"Numeric", "Integer", "Float", "Rational", "Complex", "Array", "Hash", "String", "Symbol",
10+
"Proc",
1011
]
1112
}
1213

@@ -41,7 +42,10 @@ private module Cached {
4142
Module getSuperClass(Module cls) {
4243
cls = TResolved("Object") and result = TResolved("BasicObject")
4344
or
44-
cls = TResolved(["Module", "Numeric", "Array", "Hash", "FalseClass", "TrueClass", "NilClass"]) and
45+
cls =
46+
TResolved([
47+
"Module", "Numeric", "Array", "Hash", "FalseClass", "TrueClass", "NilClass", "String"
48+
]) and
4549
result = TResolved("Object")
4650
or
4751
cls = TResolved(["Integer", "Float", "Rational", "Complex"]) and

0 commit comments

Comments
 (0)