Skip to content

Commit 6a18aa4

Browse files
authored
Merge pull request #348 from github/rc/3.3
Merge rc/3.3 into main
2 parents 7a0437f + 287046e commit 6a18aa4

File tree

7 files changed

+17
-15
lines changed

7 files changed

+17
-15
lines changed

codeql

Submodule codeql updated 380 files

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class SingletonClass extends ModuleBase, TSingletonClass {
293293

294294
SingletonClass() { this = TSingletonClass(g) }
295295

296-
final override string getAPrimaryQlClass() { result = "ClassDeclaration" }
296+
final override string getAPrimaryQlClass() { result = "SingletonClass" }
297297

298298
/**
299299
* Gets the expression resulting in the object on which the singleton class

ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,9 +3643,10 @@ private module Subpaths {
36433643
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
36443644
NodeEx out, AccessPath apout
36453645
) {
3646-
pathThroughCallable(arg, out, _, apout) and
3646+
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
36473647
pathIntoCallable(arg, par, _, innercc, sc, _) and
3648-
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
3648+
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
3649+
unbindConf(arg.getConfiguration()))
36493650
}
36503651

36513652
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
36903691
*/
36913692
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
36923693
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
3693-
arg.getASuccessor() = par and
3694-
arg.getASuccessor() = out and
3694+
pragma[only_bind_into](arg).getASuccessor() = par and
3695+
pragma[only_bind_into](arg).getASuccessor() = out and
36953696
subpaths03(arg, p, ret, o, apout) and
36963697
par.getNodeEx() = p and
36973698
out.getNodeEx() = o and

ql/test/library-tests/ast/Ast.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ calls/calls.rb:
196196
# 124| getStmt: [ClassDeclaration] MyClass2
197197
# 124| getSuperclassExpr: [MethodCall] call to foo
198198
# 124| getReceiver: [ConstantReadAccess] X
199-
# 128| getStmt: [ClassDeclaration] class << ...
199+
# 128| getStmt: [SingletonClass] class << ...
200200
# 128| getValue: [MethodCall] call to foo
201201
# 128| getReceiver: [Self] self
202202
# 129| getStmt: [MethodCall] call to bar
203203
# 129| getReceiver: [Self] self
204-
# 131| getStmt: [ClassDeclaration] class << ...
204+
# 131| getStmt: [SingletonClass] class << ...
205205
# 131| getValue: [MethodCall] call to foo
206206
# 131| getReceiver: [ConstantReadAccess] X
207207
# 132| getStmt: [MethodCall] call to bar
@@ -735,7 +735,7 @@ modules/classes.rb:
735735
# 40| getAnOperand/getLeftOperand: [LocalVariableAccess] x
736736
# 40| getAnOperand/getRightOperand: [StringLiteral] "hello"
737737
# 40| getComponent: [StringTextComponent] hello
738-
# 41| getStmt: [ClassDeclaration] class << ...
738+
# 41| getStmt: [SingletonClass] class << ...
739739
# 41| getValue: [LocalVariableAccess] x
740740
# 42| getStmt: [Method] length
741741
# 43| getStmt: [MulExpr] ... * ...

ql/test/library-tests/ast/modules/module_base.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ moduleBases
88
| classes.rb:20:1:37:3 | Wibble | ClassDeclaration |
99
| classes.rb:32:3:33:5 | ClassInWibble | ClassDeclaration |
1010
| classes.rb:35:3:36:5 | ModuleInWibble | ModuleDeclaration |
11-
| classes.rb:41:1:52:3 | class << ... | ClassDeclaration |
11+
| classes.rb:41:1:52:3 | class << ... | SingletonClass |
1212
| classes.rb:55:1:56:3 | MyClassInGlobalScope | ClassDeclaration |
1313
| modules.rb:1:1:2:3 | Empty | ModuleDeclaration |
1414
| modules.rb:1:1:122:1 | modules.rb | Toplevel |

ql/test/library-tests/ast/modules/singleton_classes.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
singletonClasses
2-
| classes.rb:41:1:52:3 | class << ... | ClassDeclaration | classes.rb:41:10:41:10 | x |
2+
| classes.rb:41:1:52:3 | class << ... | SingletonClass | classes.rb:41:10:41:10 | x |
33
exprsInSingletonClasses
44
| classes.rb:41:1:52:3 | class << ... | 0 | classes.rb:42:3:44:5 | length | Method |
55
| classes.rb:41:1:52:3 | class << ... | 1 | classes.rb:46:3:48:5 | wibble | Method |

0 commit comments

Comments
 (0)