Skip to content

Commit 88d2e25

Browse files
committed
Ruby: Rename LambdaSelfParameterNode to LambdaSelfReferenceNode
1 parent a06a9ff commit 88d2e25

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module RubyDataFlow implements InputSig {
1717
import Private
1818
import Public
1919

20-
// includes `LambdaSelfParameterNode`, which is not part of the public API
20+
// includes `LambdaSelfReferenceNode`, which is not part of the public API
2121
class ParameterNode = Private::ParameterNodeImpl;
2222

2323
predicate isParameterNode(ParameterNode p, DataFlowCallable c, ParameterPosition pos) {

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ module VariableCapture {
375375
or
376376
result.(Flow::ParameterNode).getParameter().getParameterNode() = n
377377
or
378-
result.(Flow::ThisParameterNode).getCallable() = n.(LambdaSelfParameterNode).getCallable()
378+
result.(Flow::ThisParameterNode).getCallable() = n.(LambdaSelfReferenceNode).getCallable()
379379
}
380380

381381
predicate storeStep(Node node1, Content::CapturedVariableContent c, Node node2) {
@@ -443,7 +443,7 @@ private module Cached {
443443
p instanceof SplatParameter
444444
} or
445445
TSelfParameterNode(MethodBase m) or
446-
TLambdaSelfParameterNode(Callable c) { lambdaCreationExpr(_, _, c) } or
446+
TLambdaSelfReferenceNode(Callable c) { lambdaCreationExpr(_, _, c) } or
447447
TBlockParameterNode(MethodBase m) or
448448
TSynthHashSplatParameterNode(DataFlowCallable c) {
449449
isParameterNode(_, c, any(ParameterPosition p | p.isKeyword(_)))
@@ -696,7 +696,7 @@ predicate nodeIsHidden(Node n) {
696696
or
697697
n instanceof SynthSplatParameterElementNode
698698
or
699-
n instanceof LambdaSelfParameterNode
699+
n instanceof LambdaSelfReferenceNode
700700
or
701701
n instanceof CaptureNode
702702
}
@@ -892,10 +892,10 @@ private module ParameterNodes {
892892
* "lambda self" from "normal self", as lambdas may also access outer `self`
893893
* variables (through variable capture).
894894
*/
895-
class LambdaSelfParameterNode extends ParameterNodeImpl, TLambdaSelfParameterNode {
895+
class LambdaSelfReferenceNode extends ParameterNodeImpl, TLambdaSelfReferenceNode {
896896
private Callable callable;
897897

898-
LambdaSelfParameterNode() { this = TLambdaSelfParameterNode(callable) }
898+
LambdaSelfReferenceNode() { this = TLambdaSelfReferenceNode(callable) }
899899

900900
final Callable getCallable() { result = callable }
901901

@@ -1674,7 +1674,7 @@ predicate expectsContent(Node n, ContentSet c) {
16741674
}
16751675

16761676
private newtype TDataFlowType =
1677-
TLambdaDataFlowType(Callable c) { c = any(LambdaSelfParameterNode n).getCallable() } or
1677+
TLambdaDataFlowType(Callable c) { c = any(LambdaSelfReferenceNode n).getCallable() } or
16781678
TUnknownDataFlowType()
16791679

16801680
class DataFlowType extends TDataFlowType {
@@ -1695,14 +1695,14 @@ private predicate mustHaveLambdaType(CfgNodes::ExprCfgNode e, Callable c) {
16951695

16961696
/** Gets the type of `n` used for type pruning. */
16971697
DataFlowType getNodeType(Node n) {
1698-
result = TLambdaDataFlowType(n.(LambdaSelfParameterNode).getCallable())
1698+
result = TLambdaDataFlowType(n.(LambdaSelfReferenceNode).getCallable())
16991699
or
17001700
exists(Callable c |
17011701
mustHaveLambdaType(n.asExpr(), c) and
17021702
result = TLambdaDataFlowType(c)
17031703
)
17041704
or
1705-
not n instanceof LambdaSelfParameterNode and
1705+
not n instanceof LambdaSelfReferenceNode and
17061706
not mustHaveLambdaType(n.asExpr(), _) and
17071707
result = TUnknownDataFlowType()
17081708
}

ruby/ql/lib/codeql/ruby/frameworks/Sinatra.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ module Sinatra {
285285
}
286286

287287
/** Holds if `n` is a `self` parameter belonging to block `b`. */
288-
private predicate blockSelfParameterNode(DataFlowPrivate::LambdaSelfParameterNode n, Block b) {
288+
private predicate blockSelfParameterNode(DataFlowPrivate::LambdaSelfReferenceNode n, Block b) {
289289
n.getCallable() = b
290290
}
291291
}

0 commit comments

Comments
 (0)