Merge pull request #348 from github/rc/3.3

Merge rc/3.3 into main
This commit is contained in:
Arthur Baars
2021-10-13 13:08:55 +02:00
committed by GitHub
7 changed files with 17 additions and 15 deletions

2
codeql

Submodule codeql updated: 65f4ec403f...91b2ee2f10

View File

@@ -293,7 +293,7 @@ class SingletonClass extends ModuleBase, TSingletonClass {
SingletonClass() { this = TSingletonClass(g) }
final override string getAPrimaryQlClass() { result = "ClassDeclaration" }
final override string getAPrimaryQlClass() { result = "SingletonClass" }
/**
* Gets the expression resulting in the object on which the singleton class

View File

@@ -3643,9 +3643,10 @@ private module Subpaths {
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
NodeEx out, AccessPath apout
) {
pathThroughCallable(arg, out, _, apout) and
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
pathIntoCallable(arg, par, _, innercc, sc, _) and
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
unbindConf(arg.getConfiguration()))
}
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
*/
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
arg.getASuccessor() = par and
arg.getASuccessor() = out and
pragma[only_bind_into](arg).getASuccessor() = par and
pragma[only_bind_into](arg).getASuccessor() = out and
subpaths03(arg, p, ret, o, apout) and
par.getNodeEx() = p and
out.getNodeEx() = o and

View File

@@ -3643,9 +3643,10 @@ private module Subpaths {
PathNode arg, ParamNodeEx par, SummaryCtxSome sc, CallContext innercc, ReturnKindExt kind,
NodeEx out, AccessPath apout
) {
pathThroughCallable(arg, out, _, apout) and
pathThroughCallable(arg, out, _, pragma[only_bind_into](apout)) and
pathIntoCallable(arg, par, _, innercc, sc, _) and
paramFlowsThrough(kind, innercc, sc, apout, _, unbindConf(arg.getConfiguration()))
paramFlowsThrough(kind, innercc, sc, pragma[only_bind_into](apout), _,
unbindConf(arg.getConfiguration()))
}
/**
@@ -3690,8 +3691,8 @@ private module Subpaths {
*/
predicate subpaths(PathNode arg, PathNodeImpl par, PathNodeMid ret, PathNodeMid out) {
exists(ParamNodeEx p, NodeEx o, AccessPath apout |
arg.getASuccessor() = par and
arg.getASuccessor() = out and
pragma[only_bind_into](arg).getASuccessor() = par and
pragma[only_bind_into](arg).getASuccessor() = out and
subpaths03(arg, p, ret, o, apout) and
par.getNodeEx() = p and
out.getNodeEx() = o and

View File

@@ -196,12 +196,12 @@ calls/calls.rb:
# 124| getStmt: [ClassDeclaration] MyClass2
# 124| getSuperclassExpr: [MethodCall] call to foo
# 124| getReceiver: [ConstantReadAccess] X
# 128| getStmt: [ClassDeclaration] class << ...
# 128| getStmt: [SingletonClass] class << ...
# 128| getValue: [MethodCall] call to foo
# 128| getReceiver: [Self] self
# 129| getStmt: [MethodCall] call to bar
# 129| getReceiver: [Self] self
# 131| getStmt: [ClassDeclaration] class << ...
# 131| getStmt: [SingletonClass] class << ...
# 131| getValue: [MethodCall] call to foo
# 131| getReceiver: [ConstantReadAccess] X
# 132| getStmt: [MethodCall] call to bar
@@ -735,7 +735,7 @@ modules/classes.rb:
# 40| getAnOperand/getLeftOperand: [LocalVariableAccess] x
# 40| getAnOperand/getRightOperand: [StringLiteral] "hello"
# 40| getComponent: [StringTextComponent] hello
# 41| getStmt: [ClassDeclaration] class << ...
# 41| getStmt: [SingletonClass] class << ...
# 41| getValue: [LocalVariableAccess] x
# 42| getStmt: [Method] length
# 43| getStmt: [MulExpr] ... * ...

View File

@@ -8,7 +8,7 @@ moduleBases
| classes.rb:20:1:37:3 | Wibble | ClassDeclaration |
| classes.rb:32:3:33:5 | ClassInWibble | ClassDeclaration |
| classes.rb:35:3:36:5 | ModuleInWibble | ModuleDeclaration |
| classes.rb:41:1:52:3 | class << ... | ClassDeclaration |
| classes.rb:41:1:52:3 | class << ... | SingletonClass |
| classes.rb:55:1:56:3 | MyClassInGlobalScope | ClassDeclaration |
| modules.rb:1:1:2:3 | Empty | ModuleDeclaration |
| modules.rb:1:1:122:1 | modules.rb | Toplevel |

View File

@@ -1,5 +1,5 @@
singletonClasses
| classes.rb:41:1:52:3 | class << ... | ClassDeclaration | classes.rb:41:10:41:10 | x |
| classes.rb:41:1:52:3 | class << ... | SingletonClass | classes.rb:41:10:41:10 | x |
exprsInSingletonClasses
| classes.rb:41:1:52:3 | class << ... | 0 | classes.rb:42:3:44:5 | length | Method |
| classes.rb:41:1:52:3 | class << ... | 1 | classes.rb:46:3:48:5 | wibble | Method |