mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
C#: Autoformat.
This commit is contained in:
@@ -75,7 +75,6 @@ private class ConstructorCall extends Call {
|
||||
/** An explicit upcast. */
|
||||
class ExplicitUpcast extends ExplicitCast {
|
||||
ValueOrRefType src;
|
||||
|
||||
ValueOrRefType dest;
|
||||
|
||||
ExplicitUpcast() {
|
||||
|
||||
@@ -19,7 +19,6 @@ import semmle.code.csharp.commons.ComparisonTest
|
||||
/** A comparison of an index variable with the length of an array. */
|
||||
class IndexGuard extends ComparisonTest {
|
||||
VariableAccess indexAccess;
|
||||
|
||||
Variable array;
|
||||
|
||||
IndexGuard() {
|
||||
|
||||
@@ -30,11 +30,8 @@ class NestedForConditions extends SC::StructuralComparisonConfiguration {
|
||||
/** A nested `for` statement that shares the same iteration variable as an outer `for` statement. */
|
||||
class NestedForLoopSameVariable extends ForStmt {
|
||||
ForStmt outer;
|
||||
|
||||
Variable iteration;
|
||||
|
||||
MutatorOperation innerUpdate;
|
||||
|
||||
MutatorOperation outerUpdate;
|
||||
|
||||
NestedForLoopSameVariable() {
|
||||
|
||||
@@ -6,7 +6,6 @@ import csharp
|
||||
*/
|
||||
class Package extends XMLElement {
|
||||
string name;
|
||||
|
||||
Version version;
|
||||
|
||||
Package() {
|
||||
|
||||
@@ -28,6 +28,7 @@ private module Cached {
|
||||
forex(Throw ex | ex = m.getImplementation().getAnInstruction() | t = ex.getExpr().getType())
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
pragma[noinline]
|
||||
|
||||
@@ -204,6 +204,7 @@ module DefUse {
|
||||
exists(VariableUpdate vu | def = vu.getSource() | variableUpdateUse(target, vu, use))
|
||||
}
|
||||
}
|
||||
|
||||
private import DefUse
|
||||
|
||||
abstract library class VariableUpdate extends Instruction {
|
||||
|
||||
@@ -85,9 +85,7 @@ class Method extends DotNet::Callable, Element, Member, TypeContainer, DataFlowN
|
||||
|
||||
override Location getLocation() { result = Element.super.getLocation() }
|
||||
|
||||
override Location getALocation() {
|
||||
cil_method_location(this.getSourceDeclaration(), result)
|
||||
}
|
||||
override Location getALocation() { cil_method_location(this.getSourceDeclaration(), result) }
|
||||
|
||||
override Parameter getRawParameter(int n) { cil_parameter(result, this, n, _) }
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ private module Cached {
|
||||
exists(mi.getAnInstruction())
|
||||
}
|
||||
}
|
||||
|
||||
private import Cached
|
||||
|
||||
predicate assemblyIsStub = assemblyIsStubImpl/1;
|
||||
|
||||
@@ -57,9 +57,7 @@ class Type extends DotNet::Type, Declaration, TypeContainer, @cil_type {
|
||||
qualifier = this.getParent().getQualifiedName()
|
||||
}
|
||||
|
||||
override Location getALocation() {
|
||||
cil_type_location(this.getSourceDeclaration(), result)
|
||||
}
|
||||
override Location getALocation() { cil_type_location(this.getSourceDeclaration(), result) }
|
||||
|
||||
/** Holds if this type is a class. */
|
||||
predicate isClass() { cil_class(this) }
|
||||
|
||||
@@ -175,7 +175,6 @@ private newtype TAnnotatedType =
|
||||
/** A type with additional information. */
|
||||
class AnnotatedType extends TAnnotatedType {
|
||||
Type type;
|
||||
|
||||
Annotations::TypeAnnotations annotations;
|
||||
|
||||
AnnotatedType() { this = TAnnotatedTypeNullability(type, annotations) }
|
||||
|
||||
@@ -154,7 +154,6 @@ class AssignableWrite extends AssignableAccess {
|
||||
*/
|
||||
private class RefArg extends AssignableAccess {
|
||||
private Expr call;
|
||||
|
||||
private int position;
|
||||
|
||||
RefArg() {
|
||||
@@ -379,8 +378,10 @@ module AssignableInternal {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
}
|
||||
|
||||
private import AssignableInternal
|
||||
|
||||
/**
|
||||
@@ -526,7 +527,6 @@ module AssignableDefinitions {
|
||||
*/
|
||||
class TupleAssignmentDefinition extends AssignableDefinition, TTupleAssignmentDefinition {
|
||||
AssignExpr ae;
|
||||
|
||||
Expr leaf;
|
||||
|
||||
TupleAssignmentDefinition() { this = TTupleAssignmentDefinition(ae, leaf) }
|
||||
|
||||
@@ -372,4 +372,5 @@ private module Cached {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
@@ -949,7 +949,6 @@ class TupleType extends ValueType, @tuple_type {
|
||||
*/
|
||||
class TypeMention extends @type_mention {
|
||||
Type type;
|
||||
|
||||
@type_mention_parent parent;
|
||||
|
||||
TypeMention() { type_mention(this, getTypeRef(type), parent) }
|
||||
|
||||
@@ -208,7 +208,6 @@ class VSTestAssertNonNullMethod extends AssertNonNullMethod {
|
||||
/** A method that forwards to another assertion method. */
|
||||
class ForwarderAssertMethod extends AssertMethod {
|
||||
Assertion a;
|
||||
|
||||
Parameter p;
|
||||
|
||||
ForwarderAssertMethod() {
|
||||
|
||||
@@ -9,13 +9,9 @@ class Diagnostic extends @diagnostic {
|
||||
Compilation getCompilation() { diagnostic_for(this, result, _, _) }
|
||||
|
||||
int severity;
|
||||
|
||||
string tag;
|
||||
|
||||
string message;
|
||||
|
||||
string fullMessage;
|
||||
|
||||
Location location;
|
||||
|
||||
Diagnostic() { diagnostics(this, severity, tag, message, fullMessage, location) }
|
||||
@@ -67,15 +63,10 @@ class CompilerError extends Diagnostic {
|
||||
/** A message from an extractor. */
|
||||
class ExtractorMessage extends @extractor_message {
|
||||
int severity;
|
||||
|
||||
string origin;
|
||||
|
||||
string text;
|
||||
|
||||
string element;
|
||||
|
||||
string stackTrace;
|
||||
|
||||
Location location;
|
||||
|
||||
ExtractorMessage() {
|
||||
|
||||
@@ -338,6 +338,7 @@ private module Internal {
|
||||
predicate bbIPostDominates(BasicBlock dom, BasicBlock bb) =
|
||||
idominance(exitBB/1, predBB/2)(_, dom, bb)
|
||||
}
|
||||
|
||||
private import Internal
|
||||
|
||||
/**
|
||||
|
||||
@@ -282,7 +282,6 @@ module ControlFlow {
|
||||
*/
|
||||
class ElementNode extends Node, TElementNode {
|
||||
private Splits splits;
|
||||
|
||||
private ControlFlowElement cfe;
|
||||
|
||||
ElementNode() { this = TElementNode(cfe, splits) }
|
||||
@@ -1891,6 +1890,7 @@ module ControlFlow {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Successor
|
||||
|
||||
cached
|
||||
@@ -1954,6 +1954,7 @@ module ControlFlow {
|
||||
cached
|
||||
ControlFlowElement getAControlFlowExitNode(ControlFlowElement cfe) { result = last(cfe, _) }
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
/** A control flow element that is split into multiple control flow nodes. */
|
||||
@@ -1961,5 +1962,6 @@ module ControlFlow {
|
||||
SplitControlFlowElement() { strictcount(this.getAControlFlowNode()) > 1 }
|
||||
}
|
||||
}
|
||||
|
||||
private import Internal
|
||||
}
|
||||
|
||||
@@ -194,6 +194,7 @@ module AbstractValues {
|
||||
override string toString() { if this.isEmpty() then result = "empty" else result = "non-empty" }
|
||||
}
|
||||
}
|
||||
|
||||
private import AbstractValues
|
||||
|
||||
/**
|
||||
@@ -480,9 +481,7 @@ private AssignableAccess getATrackedAccess(Ssa::Definition def, ControlFlow::Nod
|
||||
*/
|
||||
class GuardedExpr extends AccessOrCallExpr {
|
||||
private Guard g;
|
||||
|
||||
private AccessOrCallExpr sub0;
|
||||
|
||||
private AbstractValue v0;
|
||||
|
||||
GuardedExpr() { isGuardedByExpr(this, g, sub0, v0) }
|
||||
@@ -545,9 +544,7 @@ class GuardedExpr extends AccessOrCallExpr {
|
||||
*/
|
||||
class GuardedControlFlowNode extends ControlFlow::Nodes::ElementNode {
|
||||
private Guard g;
|
||||
|
||||
private AccessOrCallExpr sub0;
|
||||
|
||||
private AbstractValue v0;
|
||||
|
||||
GuardedControlFlowNode() { g.controlsNode(this, sub0, v0) }
|
||||
@@ -597,9 +594,7 @@ class GuardedControlFlowNode extends ControlFlow::Nodes::ElementNode {
|
||||
*/
|
||||
class GuardedDataFlowNode extends DataFlow::ExprNode {
|
||||
private Guard g;
|
||||
|
||||
private AccessOrCallExpr sub0;
|
||||
|
||||
private AbstractValue v0;
|
||||
|
||||
GuardedDataFlowNode() {
|
||||
@@ -1455,8 +1450,10 @@ module Internal {
|
||||
).getARead()
|
||||
}
|
||||
}
|
||||
|
||||
import CachedWithCFG
|
||||
}
|
||||
|
||||
import PreCFG
|
||||
|
||||
/**
|
||||
@@ -1576,6 +1573,7 @@ module Internal {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
/**
|
||||
@@ -1612,4 +1610,5 @@ module Internal {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private import Internal
|
||||
|
||||
@@ -659,7 +659,6 @@ class BreakNormalCompletion extends NormalCompletion, TBreakNormalCompletion {
|
||||
*/
|
||||
class NestedCompletion extends Completion, TNestedCompletion {
|
||||
private NormalCompletion inner;
|
||||
|
||||
private Completion outer;
|
||||
|
||||
NestedCompletion() { this = TNestedCompletion(inner, outer) }
|
||||
|
||||
@@ -74,6 +74,7 @@ private module Cached {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private import Cached
|
||||
|
||||
/**
|
||||
@@ -902,7 +903,6 @@ module BooleanSplitting {
|
||||
*/
|
||||
class BooleanSplitImpl extends SplitImpl, TBooleanSplit {
|
||||
private BooleanSplitSubKind kind;
|
||||
|
||||
private boolean branch;
|
||||
|
||||
BooleanSplitImpl() { this = TBooleanSplit(kind, branch) }
|
||||
@@ -1393,6 +1393,7 @@ private module SuccSplits {
|
||||
case2(pred, predSplits, succ, succSplits, c)
|
||||
}
|
||||
}
|
||||
|
||||
import SuccSplits
|
||||
|
||||
/** Provides logic for calculating reachable control flow nodes. */
|
||||
|
||||
@@ -66,7 +66,6 @@ class NonDelegateCallArgumentCallContext extends ArgumentCallContext, TArgNonDel
|
||||
/** An argument of a delegate call. */
|
||||
class DelegateCallArgumentCallContext extends ArgumentCallContext, TArgDelegateCallContext {
|
||||
DelegateCall dc;
|
||||
|
||||
int arg;
|
||||
|
||||
DelegateCallArgumentCallContext() { this = TArgDelegateCallContext(dc, arg) }
|
||||
@@ -93,7 +92,6 @@ class DelegateCallArgumentCallContext extends ArgumentCallContext, TArgDelegateC
|
||||
class DelegateArgumentToLibraryCallableArgumentContext extends ArgumentCallContext,
|
||||
TDelegateToLibraryCallableArgCallContext {
|
||||
Expr delegate;
|
||||
|
||||
int arg;
|
||||
|
||||
DelegateArgumentToLibraryCallableArgumentContext() {
|
||||
|
||||
@@ -111,6 +111,7 @@ private module Cached {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
/** An unbound callable. */
|
||||
|
||||
@@ -345,11 +345,8 @@ abstract class PathNode extends TPathNode {
|
||||
|
||||
private class SourcePathNode extends PathNode, TSourcePathNode {
|
||||
private Ssa::Definition def;
|
||||
|
||||
private string msg;
|
||||
|
||||
private Element reason;
|
||||
|
||||
private boolean isNullArgument;
|
||||
|
||||
SourcePathNode() { this = TSourcePathNode(def, msg, reason, isNullArgument) }
|
||||
@@ -385,7 +382,6 @@ private class SourcePathNode extends PathNode, TSourcePathNode {
|
||||
|
||||
private class InternalPathNode extends PathNode, TInternalPathNode {
|
||||
private Ssa::Definition def;
|
||||
|
||||
private BasicBlock bb;
|
||||
|
||||
InternalPathNode() { this = TInternalPathNode(def, bb) }
|
||||
@@ -405,11 +401,8 @@ private class InternalPathNode extends PathNode, TInternalPathNode {
|
||||
|
||||
private class SinkPathNode extends PathNode, TSinkPathNode {
|
||||
private Ssa::Definition def;
|
||||
|
||||
private BasicBlock bb;
|
||||
|
||||
private int i;
|
||||
|
||||
private Dereference d;
|
||||
|
||||
SinkPathNode() { this = TSinkPathNode(def, bb, i, d) }
|
||||
|
||||
@@ -76,6 +76,7 @@ module Ssa {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
/**
|
||||
@@ -359,6 +360,7 @@ module Ssa {
|
||||
exists(int rnk | rnk = refRank(bb, i, v, Write(_)) | liveAtRank(bb, i, v, rnk, rk))
|
||||
}
|
||||
}
|
||||
|
||||
private import SourceVariableImpl
|
||||
|
||||
/**
|
||||
@@ -490,6 +492,7 @@ module Ssa {
|
||||
override string toString() { result = getQualifier() + "." + getAssignable() }
|
||||
}
|
||||
}
|
||||
|
||||
private import SourceVariables
|
||||
|
||||
private module TrackedVariablesImpl {
|
||||
@@ -536,6 +539,7 @@ module Ssa {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private import TrackedVariablesImpl
|
||||
|
||||
/**
|
||||
@@ -874,8 +878,10 @@ module Ssa {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
}
|
||||
|
||||
private import SsaDefReaches
|
||||
|
||||
/**
|
||||
@@ -1339,6 +1345,7 @@ module Ssa {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private import FieldOrPropsImpl
|
||||
|
||||
/**
|
||||
@@ -1538,6 +1545,7 @@ module Ssa {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private import CapturedVariableImpl
|
||||
|
||||
/**
|
||||
@@ -1797,6 +1805,7 @@ module Ssa {
|
||||
liveAfterWriteCapturedIn(bb, i, v, _, _, _)
|
||||
}
|
||||
}
|
||||
|
||||
private import CapturedVariableLivenessImpl
|
||||
|
||||
cached
|
||||
@@ -1955,6 +1964,7 @@ module Ssa {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private import SsaImpl
|
||||
|
||||
private string getSplitString(Definition def) {
|
||||
@@ -2289,7 +2299,6 @@ module Ssa {
|
||||
*/
|
||||
class ExplicitDefinition extends Definition, TSsaExplicitDef {
|
||||
TrackedVar tv;
|
||||
|
||||
AssignableDefinition ad;
|
||||
|
||||
ExplicitDefinition() { this = TSsaExplicitDef(tv, ad, _, _) }
|
||||
|
||||
@@ -227,6 +227,7 @@ private module Cached {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
predicate viableCallable = viableImpl/1;
|
||||
@@ -321,7 +322,6 @@ abstract class DataFlowCall extends TDataFlowCall {
|
||||
/** A non-delegate C# call relevant for data flow. */
|
||||
class NonDelegateDataFlowCall extends DataFlowCall, TNonDelegateCall {
|
||||
private ControlFlow::Nodes::ElementNode cfn;
|
||||
|
||||
private DispatchCall dc;
|
||||
|
||||
NonDelegateDataFlowCall() { this = TNonDelegateCall(cfn, dc) }
|
||||
@@ -352,7 +352,6 @@ abstract class DelegateDataFlowCall extends DataFlowCall {
|
||||
/** An explicit delegate call relevant for data flow. */
|
||||
class ExplicitDelegateDataFlowCall extends DelegateDataFlowCall, TExplicitDelegateCall {
|
||||
private ControlFlow::Nodes::ElementNode cfn;
|
||||
|
||||
private DelegateCall dc;
|
||||
|
||||
ExplicitDelegateDataFlowCall() { this = TExplicitDelegateCall(cfn, dc) }
|
||||
@@ -379,7 +378,6 @@ class ExplicitDelegateDataFlowCall extends DelegateDataFlowCall, TExplicitDelega
|
||||
*/
|
||||
class ImplicitDelegateDataFlowCall extends DelegateDataFlowCall, TImplicitDelegateCall {
|
||||
private ControlFlow::Nodes::ElementNode cfn;
|
||||
|
||||
private DelegateArgumentToLibraryCallable arg;
|
||||
|
||||
ImplicitDelegateDataFlowCall() { this = TImplicitDelegateCall(cfn, arg) }
|
||||
|
||||
@@ -1613,11 +1613,8 @@ module PathGraph {
|
||||
*/
|
||||
private class PathNodeMid extends PathNode, TPathNodeMid {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeMid() { this = TPathNodeMid(node, cc, ap, config) }
|
||||
@@ -1680,7 +1677,6 @@ private class PathNodeSource extends PathNodeMid {
|
||||
*/
|
||||
private class PathNodeSink extends PathNode, TPathNodeSink {
|
||||
Node node;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeSink() { this = TPathNodeSink(node, config) }
|
||||
@@ -2093,11 +2089,8 @@ private module FlowExploration {
|
||||
|
||||
private class PartialPathNodePriv extends PartialPathNode {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PartialPathNodePriv() { this = TPartialPathNodeMk(node, cc, ap, config) }
|
||||
@@ -2358,6 +2351,7 @@ private module FlowExploration {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import FlowExploration
|
||||
|
||||
private predicate partialFlow(
|
||||
|
||||
@@ -1613,11 +1613,8 @@ module PathGraph {
|
||||
*/
|
||||
private class PathNodeMid extends PathNode, TPathNodeMid {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeMid() { this = TPathNodeMid(node, cc, ap, config) }
|
||||
@@ -1680,7 +1677,6 @@ private class PathNodeSource extends PathNodeMid {
|
||||
*/
|
||||
private class PathNodeSink extends PathNode, TPathNodeSink {
|
||||
Node node;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeSink() { this = TPathNodeSink(node, config) }
|
||||
@@ -2093,11 +2089,8 @@ private module FlowExploration {
|
||||
|
||||
private class PartialPathNodePriv extends PartialPathNode {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PartialPathNodePriv() { this = TPartialPathNodeMk(node, cc, ap, config) }
|
||||
@@ -2358,6 +2351,7 @@ private module FlowExploration {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import FlowExploration
|
||||
|
||||
private predicate partialFlow(
|
||||
|
||||
@@ -1613,11 +1613,8 @@ module PathGraph {
|
||||
*/
|
||||
private class PathNodeMid extends PathNode, TPathNodeMid {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeMid() { this = TPathNodeMid(node, cc, ap, config) }
|
||||
@@ -1680,7 +1677,6 @@ private class PathNodeSource extends PathNodeMid {
|
||||
*/
|
||||
private class PathNodeSink extends PathNode, TPathNodeSink {
|
||||
Node node;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeSink() { this = TPathNodeSink(node, config) }
|
||||
@@ -2093,11 +2089,8 @@ private module FlowExploration {
|
||||
|
||||
private class PartialPathNodePriv extends PartialPathNode {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PartialPathNodePriv() { this = TPartialPathNodeMk(node, cc, ap, config) }
|
||||
@@ -2358,6 +2351,7 @@ private module FlowExploration {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import FlowExploration
|
||||
|
||||
private predicate partialFlow(
|
||||
|
||||
@@ -1613,11 +1613,8 @@ module PathGraph {
|
||||
*/
|
||||
private class PathNodeMid extends PathNode, TPathNodeMid {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeMid() { this = TPathNodeMid(node, cc, ap, config) }
|
||||
@@ -1680,7 +1677,6 @@ private class PathNodeSource extends PathNodeMid {
|
||||
*/
|
||||
private class PathNodeSink extends PathNode, TPathNodeSink {
|
||||
Node node;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeSink() { this = TPathNodeSink(node, config) }
|
||||
@@ -2093,11 +2089,8 @@ private module FlowExploration {
|
||||
|
||||
private class PartialPathNodePriv extends PartialPathNode {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PartialPathNodePriv() { this = TPartialPathNodeMk(node, cc, ap, config) }
|
||||
@@ -2358,6 +2351,7 @@ private module FlowExploration {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import FlowExploration
|
||||
|
||||
private predicate partialFlow(
|
||||
|
||||
@@ -1613,11 +1613,8 @@ module PathGraph {
|
||||
*/
|
||||
private class PathNodeMid extends PathNode, TPathNodeMid {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeMid() { this = TPathNodeMid(node, cc, ap, config) }
|
||||
@@ -1680,7 +1677,6 @@ private class PathNodeSource extends PathNodeMid {
|
||||
*/
|
||||
private class PathNodeSink extends PathNode, TPathNodeSink {
|
||||
Node node;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PathNodeSink() { this = TPathNodeSink(node, config) }
|
||||
@@ -2093,11 +2089,8 @@ private module FlowExploration {
|
||||
|
||||
private class PartialPathNodePriv extends PartialPathNode {
|
||||
Node node;
|
||||
|
||||
CallContext cc;
|
||||
|
||||
AccessPath ap;
|
||||
|
||||
Configuration config;
|
||||
|
||||
PartialPathNodePriv() { this = TPartialPathNodeMk(node, cc, ap, config) }
|
||||
@@ -2358,6 +2351,7 @@ private module FlowExploration {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import FlowExploration
|
||||
|
||||
private predicate partialFlow(
|
||||
|
||||
@@ -363,6 +363,7 @@ private module ImplCommon {
|
||||
newtype TReturnPosition =
|
||||
TReturnPosition0(DataFlowCallable c, ReturnKind kind) { returnPosition(_, c, kind) }
|
||||
}
|
||||
|
||||
import ImplCommon
|
||||
|
||||
pragma[noinline]
|
||||
@@ -418,7 +419,6 @@ class CallContextReturn extends CallContext, TReturn {
|
||||
/** A callable tagged with a relevant return kind. */
|
||||
class ReturnPosition extends TReturnPosition0 {
|
||||
private DataFlowCallable c;
|
||||
|
||||
private ReturnKind kind;
|
||||
|
||||
ReturnPosition() { this = TReturnPosition0(c, kind) }
|
||||
|
||||
@@ -269,7 +269,6 @@ module LocalFlow {
|
||||
/** An argument of a C# call. */
|
||||
private class Argument extends Expr {
|
||||
private Expr call;
|
||||
|
||||
private int arg;
|
||||
|
||||
Argument() {
|
||||
@@ -442,6 +441,7 @@ private module Cached {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
/** An SSA definition, viewed as a node in a data flow graph. */
|
||||
@@ -589,6 +589,7 @@ private module ParameterNodes {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private import ImplicitCapturedParameterNodeImpl
|
||||
|
||||
/**
|
||||
@@ -622,6 +623,7 @@ private module ParameterNodes {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import ParameterNodes
|
||||
|
||||
/** A data flow node that represents a call argument. */
|
||||
@@ -753,7 +755,6 @@ private module ArgumentNodes {
|
||||
*/
|
||||
class ImplicitCapturedArgumentNode extends ArgumentNode, TImplicitCapturedArgumentNode {
|
||||
private LocalScopeVariable v;
|
||||
|
||||
private ControlFlow::Nodes::ElementNode cfn;
|
||||
|
||||
ImplicitCapturedArgumentNode() { this = TImplicitCapturedArgumentNode(cfn, v) }
|
||||
@@ -824,6 +825,7 @@ private module ArgumentNodes {
|
||||
override string toString() { result = "malloc" }
|
||||
}
|
||||
}
|
||||
|
||||
import ArgumentNodes
|
||||
|
||||
/** A data flow node that represents a value returned by a callable. */
|
||||
@@ -937,6 +939,7 @@ private module ReturnNodes {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import ReturnNodes
|
||||
|
||||
/** A data flow node that represents the output of a call. */
|
||||
@@ -1017,7 +1020,6 @@ private module OutNodes {
|
||||
*/
|
||||
class ImplicitDelegateOutNode extends OutNode, TImplicitDelegateOutNode {
|
||||
private ControlFlow::Nodes::ElementNode cfn;
|
||||
|
||||
private ControlFlow::Nodes::ElementNode call;
|
||||
|
||||
ImplicitDelegateOutNode() { this = TImplicitDelegateOutNode(cfn, call) }
|
||||
@@ -1045,6 +1047,7 @@ private module OutNodes {
|
||||
override string toString() { result = "[output] " + cfn }
|
||||
}
|
||||
}
|
||||
|
||||
import OutNodes
|
||||
|
||||
private class FlowThroughLibraryCallableOutRefConfiguration extends ControlFlowReachabilityConfiguration {
|
||||
@@ -1146,9 +1149,7 @@ private predicate hasNonlocalValue(FieldLikeRead flr) {
|
||||
/** A write to a static field/property. */
|
||||
private class StaticFieldLikeJumpNode extends NonLocalJumpNode, ExprNode {
|
||||
FieldLike fl;
|
||||
|
||||
FieldLikeRead flr;
|
||||
|
||||
ExprNode succ;
|
||||
|
||||
StaticFieldLikeJumpNode() {
|
||||
@@ -1301,6 +1302,7 @@ private module PostUpdateNodes {
|
||||
override string toString() { result = "[post] " + cfn.toString() }
|
||||
}
|
||||
}
|
||||
|
||||
private import PostUpdateNodes
|
||||
|
||||
/** A node that performs a type cast. */
|
||||
|
||||
@@ -103,7 +103,6 @@ library class DelegateCallExpr extends DelegateFlowSink {
|
||||
/** A delegate expression that is passed as the argument to a library callable. */
|
||||
library class DelegateArgumentToLibraryCallable extends Expr {
|
||||
DelegateType dt;
|
||||
|
||||
Call call;
|
||||
|
||||
DelegateArgumentToLibraryCallable() {
|
||||
|
||||
@@ -170,4 +170,5 @@ module Cached {
|
||||
flowThroughLibraryCallableOutRef(_, nodeFrom, nodeTo, false)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
@@ -91,6 +91,7 @@ private module Internal {
|
||||
result = dc.(DispatchCallImpl).getADynamicTarget()
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
/**
|
||||
@@ -384,6 +385,7 @@ private module Internal {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private import SimpleTypeDataFlow
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,7 +76,6 @@ DefaultEdge defaultEdge() { result = TDefaultEdge() }
|
||||
*/
|
||||
class CaseEdge extends EdgeKind, TCaseEdge {
|
||||
string minValue;
|
||||
|
||||
string maxValue;
|
||||
|
||||
CaseEdge() { this = TCaseEdge(minValue, maxValue) }
|
||||
|
||||
@@ -59,7 +59,6 @@ abstract class IRVariable extends TIRVariable {
|
||||
*/
|
||||
class IRUserVariable extends IRVariable, TIRUserVariable {
|
||||
Language::Variable var;
|
||||
|
||||
Language::Type type;
|
||||
|
||||
IRUserVariable() { this = TIRUserVariable(var, type, func) }
|
||||
@@ -110,9 +109,7 @@ IRTempVariable getIRTempVariable(Language::AST ast, TempVariableTag tag) {
|
||||
|
||||
class IRTempVariable extends IRVariable, IRAutomaticVariable, TIRTempVariable {
|
||||
Language::AST ast;
|
||||
|
||||
TempVariableTag tag;
|
||||
|
||||
Language::Type type;
|
||||
|
||||
IRTempVariable() { this = TIRTempVariable(func, ast, tag, type) }
|
||||
|
||||
@@ -922,7 +922,6 @@ class ConvertInstruction extends UnaryInstruction {
|
||||
*/
|
||||
class InheritanceConversionInstruction extends UnaryInstruction {
|
||||
Language::Class baseClass;
|
||||
|
||||
Language::Class derivedClass;
|
||||
|
||||
InheritanceConversionInstruction() {
|
||||
|
||||
@@ -196,9 +196,7 @@ class MemoryOperand extends Operand {
|
||||
*/
|
||||
class NonPhiOperand extends Operand {
|
||||
Instruction useInstr;
|
||||
|
||||
Instruction defInstr;
|
||||
|
||||
OperandTag tag;
|
||||
|
||||
NonPhiOperand() {
|
||||
@@ -231,7 +229,6 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
|
||||
|
||||
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
|
||||
override MemoryOperandTag tag;
|
||||
|
||||
Overlap overlap;
|
||||
|
||||
NonPhiMemoryOperand() { this = TNonPhiMemoryOperand(useInstr, tag, defInstr, overlap) }
|
||||
@@ -359,7 +356,6 @@ class ThisArgumentOperand extends ArgumentOperand {
|
||||
*/
|
||||
class PositionalArgumentOperand extends ArgumentOperand {
|
||||
override PositionalArgumentOperandTag tag;
|
||||
|
||||
int argIndex;
|
||||
|
||||
PositionalArgumentOperand() { argIndex = tag.getArgIndex() }
|
||||
@@ -413,11 +409,8 @@ class SideEffectOperand extends TypedOperand {
|
||||
*/
|
||||
class PhiInputOperand extends MemoryOperand, TPhiOperand {
|
||||
PhiInstruction useInstr;
|
||||
|
||||
Instruction defInstr;
|
||||
|
||||
IRBlock predecessorBlock;
|
||||
|
||||
Overlap overlap;
|
||||
|
||||
PhiInputOperand() { this = TPhiOperand(useInstr, defInstr, predecessorBlock, overlap) }
|
||||
|
||||
@@ -16,6 +16,7 @@ TranslatedElement getInstructionTranslatedElement(Instruction instruction) {
|
||||
}
|
||||
|
||||
InstructionTag getInstructionTag(Instruction instruction) { instruction = MkInstruction(_, result) }
|
||||
|
||||
import Cached
|
||||
|
||||
cached
|
||||
@@ -304,6 +305,7 @@ private module Cached {
|
||||
cached
|
||||
Language::BuiltInOperation getInstructionBuiltInOperation(Instruction instr) { none() }
|
||||
}
|
||||
|
||||
import CachedForDebugging
|
||||
|
||||
cached
|
||||
|
||||
@@ -29,7 +29,6 @@ class BuiltInOperation extends TBuiltInOperation {
|
||||
|
||||
class ClassDerivation extends MkClassDerivation {
|
||||
Class baseClass;
|
||||
|
||||
Class derivedClass;
|
||||
|
||||
ClassDerivation() { this = MkClassDerivation(baseClass, derivedClass) }
|
||||
|
||||
@@ -166,9 +166,7 @@ module HardcodedCredentials {
|
||||
*/
|
||||
class HardcodedCredentialsSinkExpr extends Sink {
|
||||
private string description;
|
||||
|
||||
private Element supplementaryElement;
|
||||
|
||||
private string sinkName;
|
||||
|
||||
HardcodedCredentialsSinkExpr() {
|
||||
|
||||
Reference in New Issue
Block a user