diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll index 330e59567f2..2d1b7c3a115 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll @@ -961,8 +961,10 @@ predicate recordDataFlowCallSite(DataFlowCall call, DataFlowCallable callable) { /** * A `Node` at which a cast can occur such that the type should be checked. */ -class CastingNode extends Node { +class CastingNode instanceof Node { CastingNode() { castingNode(this) } + + string toString() { result = super.toString() } } private predicate readStepWithTypes( @@ -1110,9 +1112,11 @@ LocalCallContext getLocalCallContext(CallContext ctx, DataFlowCallable callable) * The value of a parameter at function entry, viewed as a node in a data * flow graph. */ -class ParamNode extends Node { +class ParamNode instanceof Node { ParamNode() { parameterNode(this, _, _) } + string toString() { result = super.toString() } + /** * Holds if this node is the parameter of callable `c` at the specified * position. @@ -1121,9 +1125,11 @@ class ParamNode extends Node { } /** A data-flow node that represents a call argument. */ -class ArgNode extends Node { +class ArgNode instanceof Node { ArgNode() { argumentNode(this, _, _) } + string toString() { result = super.toString() } + /** Holds if this argument occurs at the given position in the given call. */ final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { argumentNode(this, call, pos) @@ -1134,9 +1140,11 @@ class ArgNode extends Node { * A node from which flow can return to the caller. This is either a regular * `ReturnNode` or a `PostUpdateNode` corresponding to the value of a parameter. */ -class ReturnNodeExt extends Node { +class ReturnNodeExt instanceof Node { ReturnNodeExt() { returnNodeExt(this, _) } + string toString() { result = super.toString() } + /** Gets the kind of this returned value. */ ReturnKindExt getKind() { returnNodeExt(this, result) } } @@ -1145,8 +1153,10 @@ class ReturnNodeExt extends Node { * A node to which data can flow from a call. Either an ordinary out node * or a post-update node associated with a call argument. */ -class OutNodeExt extends Node { +class OutNodeExt instanceof Node { OutNodeExt() { outNodeExt(this) } + + string toString() { result = super.toString() } } /** diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll index 330e59567f2..2d1b7c3a115 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll @@ -961,8 +961,10 @@ predicate recordDataFlowCallSite(DataFlowCall call, DataFlowCallable callable) { /** * A `Node` at which a cast can occur such that the type should be checked. */ -class CastingNode extends Node { +class CastingNode instanceof Node { CastingNode() { castingNode(this) } + + string toString() { result = super.toString() } } private predicate readStepWithTypes( @@ -1110,9 +1112,11 @@ LocalCallContext getLocalCallContext(CallContext ctx, DataFlowCallable callable) * The value of a parameter at function entry, viewed as a node in a data * flow graph. */ -class ParamNode extends Node { +class ParamNode instanceof Node { ParamNode() { parameterNode(this, _, _) } + string toString() { result = super.toString() } + /** * Holds if this node is the parameter of callable `c` at the specified * position. @@ -1121,9 +1125,11 @@ class ParamNode extends Node { } /** A data-flow node that represents a call argument. */ -class ArgNode extends Node { +class ArgNode instanceof Node { ArgNode() { argumentNode(this, _, _) } + string toString() { result = super.toString() } + /** Holds if this argument occurs at the given position in the given call. */ final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { argumentNode(this, call, pos) @@ -1134,9 +1140,11 @@ class ArgNode extends Node { * A node from which flow can return to the caller. This is either a regular * `ReturnNode` or a `PostUpdateNode` corresponding to the value of a parameter. */ -class ReturnNodeExt extends Node { +class ReturnNodeExt instanceof Node { ReturnNodeExt() { returnNodeExt(this, _) } + string toString() { result = super.toString() } + /** Gets the kind of this returned value. */ ReturnKindExt getKind() { returnNodeExt(this, result) } } @@ -1145,8 +1153,10 @@ class ReturnNodeExt extends Node { * A node to which data can flow from a call. Either an ordinary out node * or a post-update node associated with a call argument. */ -class OutNodeExt extends Node { +class OutNodeExt instanceof Node { OutNodeExt() { outNodeExt(this) } + + string toString() { result = super.toString() } } /** diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll index 330e59567f2..2d1b7c3a115 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplCommon.qll @@ -961,8 +961,10 @@ predicate recordDataFlowCallSite(DataFlowCall call, DataFlowCallable callable) { /** * A `Node` at which a cast can occur such that the type should be checked. */ -class CastingNode extends Node { +class CastingNode instanceof Node { CastingNode() { castingNode(this) } + + string toString() { result = super.toString() } } private predicate readStepWithTypes( @@ -1110,9 +1112,11 @@ LocalCallContext getLocalCallContext(CallContext ctx, DataFlowCallable callable) * The value of a parameter at function entry, viewed as a node in a data * flow graph. */ -class ParamNode extends Node { +class ParamNode instanceof Node { ParamNode() { parameterNode(this, _, _) } + string toString() { result = super.toString() } + /** * Holds if this node is the parameter of callable `c` at the specified * position. @@ -1121,9 +1125,11 @@ class ParamNode extends Node { } /** A data-flow node that represents a call argument. */ -class ArgNode extends Node { +class ArgNode instanceof Node { ArgNode() { argumentNode(this, _, _) } + string toString() { result = super.toString() } + /** Holds if this argument occurs at the given position in the given call. */ final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { argumentNode(this, call, pos) @@ -1134,9 +1140,11 @@ class ArgNode extends Node { * A node from which flow can return to the caller. This is either a regular * `ReturnNode` or a `PostUpdateNode` corresponding to the value of a parameter. */ -class ReturnNodeExt extends Node { +class ReturnNodeExt instanceof Node { ReturnNodeExt() { returnNodeExt(this, _) } + string toString() { result = super.toString() } + /** Gets the kind of this returned value. */ ReturnKindExt getKind() { returnNodeExt(this, result) } } @@ -1145,8 +1153,10 @@ class ReturnNodeExt extends Node { * A node to which data can flow from a call. Either an ordinary out node * or a post-update node associated with a call argument. */ -class OutNodeExt extends Node { +class OutNodeExt instanceof Node { OutNodeExt() { outNodeExt(this) } + + string toString() { result = super.toString() } } /** diff --git a/go/ql/lib/semmle/go/dataflow/internal/DataFlowImplCommon.qll b/go/ql/lib/semmle/go/dataflow/internal/DataFlowImplCommon.qll index 330e59567f2..2d1b7c3a115 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/DataFlowImplCommon.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/DataFlowImplCommon.qll @@ -961,8 +961,10 @@ predicate recordDataFlowCallSite(DataFlowCall call, DataFlowCallable callable) { /** * A `Node` at which a cast can occur such that the type should be checked. */ -class CastingNode extends Node { +class CastingNode instanceof Node { CastingNode() { castingNode(this) } + + string toString() { result = super.toString() } } private predicate readStepWithTypes( @@ -1110,9 +1112,11 @@ LocalCallContext getLocalCallContext(CallContext ctx, DataFlowCallable callable) * The value of a parameter at function entry, viewed as a node in a data * flow graph. */ -class ParamNode extends Node { +class ParamNode instanceof Node { ParamNode() { parameterNode(this, _, _) } + string toString() { result = super.toString() } + /** * Holds if this node is the parameter of callable `c` at the specified * position. @@ -1121,9 +1125,11 @@ class ParamNode extends Node { } /** A data-flow node that represents a call argument. */ -class ArgNode extends Node { +class ArgNode instanceof Node { ArgNode() { argumentNode(this, _, _) } + string toString() { result = super.toString() } + /** Holds if this argument occurs at the given position in the given call. */ final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { argumentNode(this, call, pos) @@ -1134,9 +1140,11 @@ class ArgNode extends Node { * A node from which flow can return to the caller. This is either a regular * `ReturnNode` or a `PostUpdateNode` corresponding to the value of a parameter. */ -class ReturnNodeExt extends Node { +class ReturnNodeExt instanceof Node { ReturnNodeExt() { returnNodeExt(this, _) } + string toString() { result = super.toString() } + /** Gets the kind of this returned value. */ ReturnKindExt getKind() { returnNodeExt(this, result) } } @@ -1145,8 +1153,10 @@ class ReturnNodeExt extends Node { * A node to which data can flow from a call. Either an ordinary out node * or a post-update node associated with a call argument. */ -class OutNodeExt extends Node { +class OutNodeExt instanceof Node { OutNodeExt() { outNodeExt(this) } + + string toString() { result = super.toString() } } /** diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll index 330e59567f2..2d1b7c3a115 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplCommon.qll @@ -961,8 +961,10 @@ predicate recordDataFlowCallSite(DataFlowCall call, DataFlowCallable callable) { /** * A `Node` at which a cast can occur such that the type should be checked. */ -class CastingNode extends Node { +class CastingNode instanceof Node { CastingNode() { castingNode(this) } + + string toString() { result = super.toString() } } private predicate readStepWithTypes( @@ -1110,9 +1112,11 @@ LocalCallContext getLocalCallContext(CallContext ctx, DataFlowCallable callable) * The value of a parameter at function entry, viewed as a node in a data * flow graph. */ -class ParamNode extends Node { +class ParamNode instanceof Node { ParamNode() { parameterNode(this, _, _) } + string toString() { result = super.toString() } + /** * Holds if this node is the parameter of callable `c` at the specified * position. @@ -1121,9 +1125,11 @@ class ParamNode extends Node { } /** A data-flow node that represents a call argument. */ -class ArgNode extends Node { +class ArgNode instanceof Node { ArgNode() { argumentNode(this, _, _) } + string toString() { result = super.toString() } + /** Holds if this argument occurs at the given position in the given call. */ final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { argumentNode(this, call, pos) @@ -1134,9 +1140,11 @@ class ArgNode extends Node { * A node from which flow can return to the caller. This is either a regular * `ReturnNode` or a `PostUpdateNode` corresponding to the value of a parameter. */ -class ReturnNodeExt extends Node { +class ReturnNodeExt instanceof Node { ReturnNodeExt() { returnNodeExt(this, _) } + string toString() { result = super.toString() } + /** Gets the kind of this returned value. */ ReturnKindExt getKind() { returnNodeExt(this, result) } } @@ -1145,8 +1153,10 @@ class ReturnNodeExt extends Node { * A node to which data can flow from a call. Either an ordinary out node * or a post-update node associated with a call argument. */ -class OutNodeExt extends Node { +class OutNodeExt instanceof Node { OutNodeExt() { outNodeExt(this) } + + string toString() { result = super.toString() } } /** diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplCommon.qll b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplCommon.qll index 330e59567f2..2d1b7c3a115 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplCommon.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplCommon.qll @@ -961,8 +961,10 @@ predicate recordDataFlowCallSite(DataFlowCall call, DataFlowCallable callable) { /** * A `Node` at which a cast can occur such that the type should be checked. */ -class CastingNode extends Node { +class CastingNode instanceof Node { CastingNode() { castingNode(this) } + + string toString() { result = super.toString() } } private predicate readStepWithTypes( @@ -1110,9 +1112,11 @@ LocalCallContext getLocalCallContext(CallContext ctx, DataFlowCallable callable) * The value of a parameter at function entry, viewed as a node in a data * flow graph. */ -class ParamNode extends Node { +class ParamNode instanceof Node { ParamNode() { parameterNode(this, _, _) } + string toString() { result = super.toString() } + /** * Holds if this node is the parameter of callable `c` at the specified * position. @@ -1121,9 +1125,11 @@ class ParamNode extends Node { } /** A data-flow node that represents a call argument. */ -class ArgNode extends Node { +class ArgNode instanceof Node { ArgNode() { argumentNode(this, _, _) } + string toString() { result = super.toString() } + /** Holds if this argument occurs at the given position in the given call. */ final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { argumentNode(this, call, pos) @@ -1134,9 +1140,11 @@ class ArgNode extends Node { * A node from which flow can return to the caller. This is either a regular * `ReturnNode` or a `PostUpdateNode` corresponding to the value of a parameter. */ -class ReturnNodeExt extends Node { +class ReturnNodeExt instanceof Node { ReturnNodeExt() { returnNodeExt(this, _) } + string toString() { result = super.toString() } + /** Gets the kind of this returned value. */ ReturnKindExt getKind() { returnNodeExt(this, result) } } @@ -1145,8 +1153,10 @@ class ReturnNodeExt extends Node { * A node to which data can flow from a call. Either an ordinary out node * or a post-update node associated with a call argument. */ -class OutNodeExt extends Node { +class OutNodeExt instanceof Node { OutNodeExt() { outNodeExt(this) } + + string toString() { result = super.toString() } } /** diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll index 330e59567f2..2d1b7c3a115 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplCommon.qll @@ -961,8 +961,10 @@ predicate recordDataFlowCallSite(DataFlowCall call, DataFlowCallable callable) { /** * A `Node` at which a cast can occur such that the type should be checked. */ -class CastingNode extends Node { +class CastingNode instanceof Node { CastingNode() { castingNode(this) } + + string toString() { result = super.toString() } } private predicate readStepWithTypes( @@ -1110,9 +1112,11 @@ LocalCallContext getLocalCallContext(CallContext ctx, DataFlowCallable callable) * The value of a parameter at function entry, viewed as a node in a data * flow graph. */ -class ParamNode extends Node { +class ParamNode instanceof Node { ParamNode() { parameterNode(this, _, _) } + string toString() { result = super.toString() } + /** * Holds if this node is the parameter of callable `c` at the specified * position. @@ -1121,9 +1125,11 @@ class ParamNode extends Node { } /** A data-flow node that represents a call argument. */ -class ArgNode extends Node { +class ArgNode instanceof Node { ArgNode() { argumentNode(this, _, _) } + string toString() { result = super.toString() } + /** Holds if this argument occurs at the given position in the given call. */ final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { argumentNode(this, call, pos) @@ -1134,9 +1140,11 @@ class ArgNode extends Node { * A node from which flow can return to the caller. This is either a regular * `ReturnNode` or a `PostUpdateNode` corresponding to the value of a parameter. */ -class ReturnNodeExt extends Node { +class ReturnNodeExt instanceof Node { ReturnNodeExt() { returnNodeExt(this, _) } + string toString() { result = super.toString() } + /** Gets the kind of this returned value. */ ReturnKindExt getKind() { returnNodeExt(this, result) } } @@ -1145,8 +1153,10 @@ class ReturnNodeExt extends Node { * A node to which data can flow from a call. Either an ordinary out node * or a post-update node associated with a call argument. */ -class OutNodeExt extends Node { +class OutNodeExt instanceof Node { OutNodeExt() { outNodeExt(this) } + + string toString() { result = super.toString() } } /** diff --git a/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll b/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll index 330e59567f2..2d1b7c3a115 100644 --- a/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll +++ b/swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImplCommon.qll @@ -961,8 +961,10 @@ predicate recordDataFlowCallSite(DataFlowCall call, DataFlowCallable callable) { /** * A `Node` at which a cast can occur such that the type should be checked. */ -class CastingNode extends Node { +class CastingNode instanceof Node { CastingNode() { castingNode(this) } + + string toString() { result = super.toString() } } private predicate readStepWithTypes( @@ -1110,9 +1112,11 @@ LocalCallContext getLocalCallContext(CallContext ctx, DataFlowCallable callable) * The value of a parameter at function entry, viewed as a node in a data * flow graph. */ -class ParamNode extends Node { +class ParamNode instanceof Node { ParamNode() { parameterNode(this, _, _) } + string toString() { result = super.toString() } + /** * Holds if this node is the parameter of callable `c` at the specified * position. @@ -1121,9 +1125,11 @@ class ParamNode extends Node { } /** A data-flow node that represents a call argument. */ -class ArgNode extends Node { +class ArgNode instanceof Node { ArgNode() { argumentNode(this, _, _) } + string toString() { result = super.toString() } + /** Holds if this argument occurs at the given position in the given call. */ final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { argumentNode(this, call, pos) @@ -1134,9 +1140,11 @@ class ArgNode extends Node { * A node from which flow can return to the caller. This is either a regular * `ReturnNode` or a `PostUpdateNode` corresponding to the value of a parameter. */ -class ReturnNodeExt extends Node { +class ReturnNodeExt instanceof Node { ReturnNodeExt() { returnNodeExt(this, _) } + string toString() { result = super.toString() } + /** Gets the kind of this returned value. */ ReturnKindExt getKind() { returnNodeExt(this, result) } } @@ -1145,8 +1153,10 @@ class ReturnNodeExt extends Node { * A node to which data can flow from a call. Either an ordinary out node * or a post-update node associated with a call argument. */ -class OutNodeExt extends Node { +class OutNodeExt instanceof Node { OutNodeExt() { outNodeExt(this) } + + string toString() { result = super.toString() } } /**