diff --git a/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected b/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected index 9c967eb3d989..8045226ace43 100644 --- a/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected +++ b/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected @@ -271,10 +271,6 @@ ql/java/ql/src/external/MostlyDuplicateMethod.ql ql/java/ql/src/external/MostlySimilarFile.ql ql/java/ql/src/filters/ClassifyFiles.ql ql/java/ql/src/meta/frameworks/Coverage.ql -ql/java/ql/src/meta/ssa/AmbiguousToString.ql -ql/java/ql/src/meta/ssa/TooFewPhiInputs.ql -ql/java/ql/src/meta/ssa/UncertainDefWithoutPrior.ql -ql/java/ql/src/meta/ssa/UseWithoutUniqueSsaVariable.ql ql/java/ql/src/utils/modelconverter/ExtractNeutrals.ql ql/java/ql/src/utils/modelconverter/ExtractSinks.ql ql/java/ql/src/utils/modelconverter/ExtractSources.ql diff --git a/java/ql/src/meta/ssa/AmbiguousToString.ql b/java/ql/src/meta/ssa/AmbiguousToString.ql deleted file mode 100644 index 817685cf6097..000000000000 --- a/java/ql/src/meta/ssa/AmbiguousToString.ql +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @name An SSA variable without a unique 'toString()' - * @description An ambiguous 'toString()' indicates overlap in the defining - * sub-classes of 'SsaVariable'. - * @kind problem - * @problem.severity error - * @id java/consistency/non-unique-ssa-tostring - * @tags consistency - */ - -import java -import semmle.code.java.dataflow.SSA - -predicate noToString(SsaVariable v) { not exists(v.toString()) } - -predicate multipleToString(SsaVariable v) { 1 < count(v.toString()) } - -from SsaVariable ssa, ControlFlowNode n, Variable v, string problem -where - ( - noToString(ssa) and problem = "SSA variable without 'toString()' for " - or - multipleToString(ssa) and problem = "SSA variable with multiple 'toString()' results for " - ) and - n = ssa.getCfgNode() and - v = ssa.getSourceVariable().getVariable() -select n, problem + v diff --git a/java/ql/src/meta/ssa/TooFewPhiInputs.ql b/java/ql/src/meta/ssa/TooFewPhiInputs.ql deleted file mode 100644 index 3bf75a91856c..000000000000 --- a/java/ql/src/meta/ssa/TooFewPhiInputs.ql +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @name A phi node without two or more inputs - * @description A phi node should have at least two inputs. - * @kind problem - * @problem.severity error - * @id java/consistency/too-few-phi-inputs - * @tags consistency - */ - -import java -import semmle.code.java.dataflow.SSA - -from SsaPhiNode phi, int inputs -where - inputs = count(SsaVariable v | v = phi.getAPhiInput()) and - inputs < 2 -select phi, "Phi node for " + phi.getSourceVariable() + " has only " + inputs + " inputs." diff --git a/java/ql/src/meta/ssa/UncertainDefWithoutPrior.ql b/java/ql/src/meta/ssa/UncertainDefWithoutPrior.ql deleted file mode 100644 index 1979c218ac2a..000000000000 --- a/java/ql/src/meta/ssa/UncertainDefWithoutPrior.ql +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @name An uncertain SSA update without a prior definition - * @description An uncertain SSA update may retain its previous value - * and should therefore have a prior definition. - * @kind problem - * @problem.severity error - * @id java/consistency/uncertain-ssa-update-without-prior-def - * @tags consistency - */ - -import java -import semmle.code.java.dataflow.SSA - -predicate live(SsaVariable v) { - exists(v.getAUse()) - or - exists(SsaPhiNode phi | live(phi) and phi.getAPhiInput() = v) - or - exists(SsaUncertainImplicitUpdate upd | live(upd) and upd.getPriorDef() = v) -} - -from SsaUncertainImplicitUpdate upd -where - live(upd) and - not exists(upd.getPriorDef()) -select upd, "No prior definition of " + upd diff --git a/java/ql/src/meta/ssa/UseWithoutUniqueSsaVariable.ql b/java/ql/src/meta/ssa/UseWithoutUniqueSsaVariable.ql deleted file mode 100644 index 76f6ee37fb1c..000000000000 --- a/java/ql/src/meta/ssa/UseWithoutUniqueSsaVariable.ql +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @name A variable use without a unique SSA variable - * @description Every variable use that is sufficiently trackable - * should have a unique associated SSA variable. - * @kind problem - * @problem.severity error - * @id java/consistency/use-without-unique-ssa-variable - * @tags consistency - */ - -import java -import semmle.code.java.dataflow.SSA - -class SsaConvertibleReadAccess extends VarRead { - SsaConvertibleReadAccess() { - this.getEnclosingCallable().getBody().getBasicBlock().getASuccessor*() = this.getBasicBlock() and - ( - not exists(this.getQualifier()) - or - this.getVariable() instanceof LocalScopeVariable - or - this.getVariable().(Field).isStatic() - or - exists(Expr q | q = this.getQualifier() | - q instanceof ThisAccess or - q instanceof SuperAccess or - q instanceof SsaConvertibleReadAccess - ) - ) - } -} - -predicate accessWithoutSourceVariable(SsaConvertibleReadAccess va) { - not exists(SsaSourceVariable v | v.getAnAccess() = va) -} - -predicate readAccessWithoutSsaVariable(SsaConvertibleReadAccess va) { - not exists(SsaVariable v | v.getAUse() = va) -} - -predicate readAccessWithAmbiguousSsaVariable(SsaConvertibleReadAccess va) { - 1 < strictcount(SsaVariable v | v.getAUse() = va) -} - -from SsaConvertibleReadAccess va, string problem -where - accessWithoutSourceVariable(va) and problem = "No source variable" - or - readAccessWithoutSsaVariable(va) and problem = "No SSA variable" - or - readAccessWithAmbiguousSsaVariable(va) and problem = "Multiple SSA variables" -select va, problem