diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowPrivate.qll index 986197bb0cee..7767b644cbd5 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowPrivate.qll @@ -219,15 +219,13 @@ class DataFlowExpr = Expr; class DataFlowType = Type; /** A function call relevant for data flow. */ -class DataFlowCall extends Expr { - DataFlowCall() { this instanceof Call } - +class DataFlowCall extends Expr instanceof Call { /** * Gets the nth argument for this call. * * The range of `n` is from `0` to `getNumberOfArguments() - 1`. */ - Expr getArgument(int n) { result = this.(Call).getArgument(n) } + Expr getArgument(int n) { result = super.getArgument(n) } /** Gets the data flow node corresponding to this call. */ ExprNode getNode() { result.getExpr() = this } diff --git a/cpp/ql/src/AlertSuppression.ql b/cpp/ql/src/AlertSuppression.ql index 7239398e8c11..9a3983ed515d 100644 --- a/cpp/ql/src/AlertSuppression.ql +++ b/cpp/ql/src/AlertSuppression.ql @@ -60,9 +60,7 @@ class SuppressionComment extends Comment { /** * The scope of an alert suppression comment. */ -class SuppressionScope extends ElementBase { - SuppressionScope() { this instanceof SuppressionComment } - +class SuppressionScope extends ElementBase instanceof SuppressionComment { /** * Holds if this element is at the specified location. * The location spans column `startcolumn` of line `startline` to @@ -73,7 +71,7 @@ class SuppressionScope extends ElementBase { predicate hasLocationInfo( string filepath, int startline, int startcolumn, int endline, int endcolumn ) { - this.(SuppressionComment).covers(filepath, startline, startcolumn, endline, endcolumn) + super.covers(filepath, startline, startcolumn, endline, endcolumn) } } diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll index d75afd20b6ca..6776025d1721 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll @@ -940,13 +940,9 @@ private module ParameterNodes { import ParameterNodes /** A data-flow node that represents a call argument. */ -class ArgumentNode extends Node { - ArgumentNode() { this instanceof ArgumentNodeImpl } - +class ArgumentNode extends Node instanceof ArgumentNodeImpl { /** Holds if this argument occurs at the given position in the given call. */ - final predicate argumentOf(DataFlowCall call, int pos) { - this.(ArgumentNodeImpl).argumentOf(call, pos) - } + final predicate argumentOf(DataFlowCall call, int pos) { super.argumentOf(call, pos) } } abstract private class ArgumentNodeImpl extends Node { diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPublic.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPublic.qll index 562869039516..fa99d518bbdb 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPublic.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPublic.qll @@ -98,9 +98,7 @@ class ExprNode extends Node, TExprNode_ { * The value of a parameter at function entry, viewed as a node in a data * flow graph. */ -class ParameterNode extends Node { - ParameterNode() { this instanceof ParameterNodeImpl } - +class ParameterNode extends Node instanceof ParameterNodeImpl { /** Gets the parameter corresponding to this node, if any. */ DotNet::Parameter getParameter() { exists(DataFlowCallable c, int i | this.isParameterOf(c, i) and result = c.getParameter(i)) @@ -110,9 +108,7 @@ class ParameterNode extends Node { * Holds if this node is the parameter of callable `c` at the specified * (zero-based) position. */ - predicate isParameterOf(DataFlowCallable c, int i) { - this.(ParameterNodeImpl).isParameterOf(c, i) - } + predicate isParameterOf(DataFlowCallable c, int i) { super.isParameterOf(c, i) } } /** A definition, viewed as a node in a data flow graph. */ diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/RangeUtils.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/RangeUtils.qll index 2f8e93a4b750..f007ba939e8f 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/RangeUtils.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/RangeUtils.qll @@ -89,14 +89,12 @@ private module Impl { } /** An expression whose value may control the execution of another element. */ - class Guard extends Expr { - Guard() { this instanceof G::Guard } - + class Guard extends Expr instanceof G::Guard { /** * Holds if basic block `bb` is guarded by this guard having value `v`. */ predicate controlsBasicBlock(ControlFlow::BasicBlock bb, G::AbstractValue v) { - this.(G::Guard).controlsBasicBlock(bb, v) + super.controlsBasicBlock(bb, v) } /** @@ -108,7 +106,7 @@ private module Impl { exists(Expr e1_, Expr e2_ | e1 = unique(ExprNode cfn | hasChild(this, e1_, _, cfn) | cfn) and e2 = unique(ExprNode cfn | hasChild(this, e2_, _, cfn) | cfn) and - this.(G::Guard).isEquality(e1_, e2_, polarity) + super.isEquality(e1_, e2_, polarity) ) } }