mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
C#: Fix merge conflicts.
This commit is contained in:
@@ -950,6 +950,7 @@ module ControlFlow {
|
||||
not this instanceof CastExpr and
|
||||
not this instanceof AnonymousFunctionExpr and
|
||||
not this instanceof DelegateCall and
|
||||
not this instanceof @unknown_expr and
|
||||
result = this.getChild(i)
|
||||
or
|
||||
this = any(ExtensionMethodCall emc |
|
||||
@@ -967,6 +968,8 @@ module ControlFlow {
|
||||
result = getCastExprChild(this, i)
|
||||
or
|
||||
result = this.(DelegateCall).getChild(i - 1)
|
||||
or
|
||||
result = getUnknownExprChild(this, i)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1001,6 +1004,13 @@ module ControlFlow {
|
||||
i = 0 and result = ae.getExpr()
|
||||
}
|
||||
|
||||
private ControlFlowElement getUnknownExprChild(@unknown_expr e, int i) {
|
||||
exists(int c |
|
||||
result = e.(Expr).getChild(c) |
|
||||
c = rank[i+1](int j | exists(e.(Expr).getChild(j)))
|
||||
)
|
||||
}
|
||||
|
||||
private ControlFlowElement getCastExprChild(CastExpr ce, int i) {
|
||||
// The type access at index 1 is not evaluated at run-time
|
||||
i = 0 and result = ce.getExpr()
|
||||
|
||||
@@ -6,13 +6,12 @@ import semmle.code.csharp.controlflow.ControlFlowGraph
|
||||
* The purpose of this is to ensure that all MethodCall expressions
|
||||
* have a valid `toString()`.
|
||||
*/
|
||||
class UnknownCall extends MethodCall
|
||||
{
|
||||
class UnknownCall extends MethodCall {
|
||||
UnknownCall() { not exists(this.getTarget()) }
|
||||
|
||||
override string toString() { result = "Call to unknown method" }
|
||||
}
|
||||
|
||||
query predicate edges(ControlFlowNode n1, ControlFlowNode n2) {
|
||||
query predicate edges(ControlFlow::Node n1, ControlFlow::Node n2) {
|
||||
n2 = n1.getASuccessor()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user