Skip to content

Commit e6ba282

Browse files
committed
C#: Revert a few changes
1 parent 5d14093 commit e6ba282

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowDispatch.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class NonDelegateDataFlowCall extends DataFlowCall, TNonDelegateCall {
334334

335335
override DataFlow::ExprNode getNode() { result.getControlFlowNode() = cfn }
336336

337-
override DotNet::Callable getEnclosingCallable() { result = cfn.getEnclosingCallable() }
337+
override Callable getEnclosingCallable() { result = cfn.getEnclosingCallable() }
338338

339339
override string toString() { result = cfn.toString() }
340340

@@ -365,7 +365,7 @@ class ExplicitDelegateDataFlowCall extends DelegateDataFlowCall, TExplicitDelega
365365

366366
override DataFlow::ExprNode getNode() { result.getControlFlowNode() = cfn }
367367

368-
override DotNet::Callable getEnclosingCallable() { result = cfn.getEnclosingCallable() }
368+
override Callable getEnclosingCallable() { result = cfn.getEnclosingCallable() }
369369

370370
override string toString() { result = cfn.toString() }
371371

@@ -404,7 +404,7 @@ class ImplicitDelegateDataFlowCall extends DelegateDataFlowCall, TImplicitDelega
404404

405405
override ImplicitDelegateOutNode getNode() { result.getControlFlowNode() = cfn }
406406

407-
override DotNet::Callable getEnclosingCallable() { result = cfn.getEnclosingCallable() }
407+
override Callable getEnclosingCallable() { result = cfn.getEnclosingCallable() }
408408

409409
override string toString() { result = "[implicit call] " + cfn.toString() }
410410

@@ -421,13 +421,13 @@ class TransitiveCapturedDataFlowCall extends DataFlowCall, TTransitiveCapturedCa
421421

422422
TransitiveCapturedDataFlowCall() { this = TTransitiveCapturedCall(cfn) }
423423

424-
override DotNet::Callable getARuntimeTarget() { transitiveCapturedCallTarget(cfn, result) }
424+
override Callable getARuntimeTarget() { transitiveCapturedCallTarget(cfn, result) }
425425

426426
override ControlFlow::Nodes::ElementNode getControlFlowNode() { result = cfn }
427427

428428
override DataFlow::ExprNode getNode() { none() }
429429

430-
override DotNet::Callable getEnclosingCallable() { result = cfn.getEnclosingCallable() }
430+
override Callable getEnclosingCallable() { result = cfn.getEnclosingCallable() }
431431

432432
override string toString() { result = "[transitive] " + cfn.toString() }
433433

@@ -449,7 +449,7 @@ class CilDataFlowCall extends DataFlowCall, TCilCall {
449449

450450
override DataFlow::ExprNode getNode() { result.getExpr() = call }
451451

452-
override DotNet::Callable getEnclosingCallable() { result = call.getEnclosingCallable() }
452+
override CIL::Callable getEnclosingCallable() { result = call.getEnclosingCallable() }
453453

454454
override string toString() { result = call.toString() }
455455

csharp/ql/src/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ private import semmle.code.csharp.frameworks.NHibernate
1717
private module ThisFlow {
1818
private class BasicBlock = ControlFlow::BasicBlock;
1919

20-
/** Holds if the `i`th node `n` of basic block `bb` is a `this` access. */
21-
private predicate thisAccess(Node n, BasicBlock bb, int i) {
22-
bb.getNode(i) = any(ControlFlow::Nodes::EntryNode en |
23-
n.(InstanceParameterNode).getCallable() = en.getEnclosingCallable()
24-
)
20+
/** Holds if `n` is a `this` access at control flow node `cfn`. */
21+
private predicate thisAccess(Node n, ControlFlow::Node cfn) {
22+
n.(InstanceParameterNode).getCallable() = cfn.(ControlFlow::Nodes::EntryNode).getCallable()
2523
or
26-
n.asExprAtNode(bb.getNode(i)) = any(Expr e | e instanceof ThisAccess or e instanceof BaseAccess)
24+
n.asExprAtNode(cfn) = any(Expr e | e instanceof ThisAccess or e instanceof BaseAccess)
2725
}
2826

27+
private predicate thisAccess(Node n, BasicBlock bb, int i) { thisAccess(n, bb.getNode(i)) }
28+
2929
private predicate thisRank(Node n, BasicBlock bb, int rankix) {
3030
exists(int i |
3131
i = rank[rankix](int j | thisAccess(_, bb, j)) and
@@ -470,16 +470,16 @@ private module ParameterNodes {
470470

471471
/** An implicit instance (`this`) parameter. */
472472
class InstanceParameterNode extends ParameterNode, TInstanceParameterNode {
473-
private DataFlowCallable callable;
473+
private Callable callable;
474474

475475
InstanceParameterNode() { this = TInstanceParameterNode(callable) }
476476

477477
/** Gets the callable containing this implicit instance parameter. */
478-
DataFlowCallable getCallable() { result = callable }
478+
Callable getCallable() { result = callable }
479479

480480
override predicate isParameterOf(DataFlowCallable c, int pos) { callable = c and pos = -1 }
481481

482-
override DataFlowCallable getEnclosingCallable() { result = callable }
482+
override Callable getEnclosingCallable() { result = callable }
483483

484484
override Type getType() { result = callable.getDeclaringType() }
485485

@@ -511,7 +511,7 @@ private module ParameterNodes {
511511
i = parameter.getPosition() + c.getNumberOfParameters()
512512
}
513513

514-
override DotNet::Callable getEnclosingCallable() {
514+
override Callable getEnclosingCallable() {
515515
result = this.getUnderlyingNode().getEnclosingCallable()
516516
}
517517

@@ -852,7 +852,7 @@ private module ReturnNodes {
852852

853853
override YieldReturnKind getKind() { any() }
854854

855-
override DotNet::Callable getEnclosingCallable() {
855+
override Callable getEnclosingCallable() {
856856
result = this.getUnderlyingNode().getEnclosingCallable()
857857
}
858858

0 commit comments

Comments
 (0)