diff --git a/java/ql/lib/semmle/code/java/dataflow/DefUse.qll b/java/ql/lib/semmle/code/java/dataflow/DefUse.qll index a93f2e30b46..ea4df94d6c1 100644 --- a/java/ql/lib/semmle/code/java/dataflow/DefUse.qll +++ b/java/ql/lib/semmle/code/java/dataflow/DefUse.qll @@ -47,6 +47,6 @@ predicate defUsePair(VariableUpdate def, VarRead use) { */ predicate parameterDefUsePair(Parameter p, VarRead use) { exists(SsaVariable v | - v.getAUse() = use and v.getAnUltimateDefinition().(SsaImplicitInit).isParameterDefinition(p) + v.getAUse() = use and v.getAnUltimateDefinition().(SsaParameterInit).getParameter() = p ) } diff --git a/java/ql/lib/semmle/code/java/dataflow/Nullness.qll b/java/ql/lib/semmle/code/java/dataflow/Nullness.qll index ff93b8d64ee..7802dc9d280 100644 --- a/java/ql/lib/semmle/code/java/dataflow/Nullness.qll +++ b/java/ql/lib/semmle/code/java/dataflow/Nullness.qll @@ -156,7 +156,7 @@ private predicate varMaybeNull(SsaVariable v, ControlFlowNode node, string msg, or // A parameter might be null if there is a null argument somewhere. exists(Parameter p, Expr arg | - v.(SsaImplicitInit).isParameterDefinition(p) and + v.(SsaParameterInit).getParameter() = p and node = v.getCfgNode() and p.getAnArgument() = arg and reason = arg and diff --git a/java/ql/lib/semmle/code/java/dataflow/SSA.qll b/java/ql/lib/semmle/code/java/dataflow/SSA.qll index 4c7372998c2..94f48bf8dc0 100644 --- a/java/ql/lib/semmle/code/java/dataflow/SSA.qll +++ b/java/ql/lib/semmle/code/java/dataflow/SSA.qll @@ -317,6 +317,8 @@ class SsaImplicitInit extends SsaVariable instanceof WriteDefinition { predicate captures(SsaVariable capturedvar) { captures(this, capturedvar) } /** + * DEPRECATED: Use `SsaParameterInit::getParameter()` instead. + * * Holds if the SSA variable is a parameter defined by its initial value in the callable. */ predicate isParameterDefinition(Parameter p) { diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll index 674c2380a5f..5dfa83f6f7e 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowNodes.qll @@ -46,7 +46,7 @@ module SsaFlow { or exists(Parameter p | n = TExplicitParameterNode(p) and - result.(Impl::WriteDefSourceNode).getDefinition().(SsaImplicitInit).isParameterDefinition(p) + result.(Impl::WriteDefSourceNode).getDefinition().(SsaParameterInit).getParameter() = p ) or ssaDefAssigns(result.(Impl::WriteDefSourceNode).getDefinition(), n.asExpr()) diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll index 1721569e45a..83021f2b7f1 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll @@ -551,15 +551,15 @@ private class ConstantBooleanArgumentNode extends ArgumentNode, ExprNode { */ predicate isUnreachableInCall(NodeRegion nr, DataFlowCall call) { exists( - ExplicitParameterNode paramNode, ConstantBooleanArgumentNode arg, SsaImplicitInit param, + ExplicitParameterNode paramNode, ConstantBooleanArgumentNode arg, SsaParameterInit param, Guard guard | // get constant bool argument and parameter for this call viableParamArg(call, pragma[only_bind_into](paramNode), arg) and // get the ssa variable definition for this parameter - param.isParameterDefinition(paramNode.getParameter()) and + param.getParameter() = paramNode.getParameter() and // which is used in a guard - param.getAUse() = guard and + param.getARead() = guard and // which controls `n` with the opposite value of `arg` guard .controls(nr, diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll index 17870093ca2..438c3f336d7 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll @@ -669,7 +669,7 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu Expr getARead(Definition def) { result = getAUse(def) } predicate ssaDefHasSource(WriteDefinition def) { - def instanceof SsaExplicitUpdate or def.(SsaImplicitInit).isParameterDefinition(_) + def instanceof SsaExplicitUpdate or def instanceof SsaParameterInit } predicate allowFlowIntoUncertainDef(UncertainWriteDefinition def) { diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll index 6363b8f7ed3..85fbde65684 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll @@ -273,7 +273,7 @@ private module Impl { } /** Holds if the variable underlying the implicit SSA variable `v` is not a field. */ - predicate nonFieldImplicitSsaDefinition(SsaImplicitInit v) { v.isParameterDefinition(_) } + predicate nonFieldImplicitSsaDefinition(SsaParameterInit v) { any() } /** Returned an expression that is assigned to `f`. */ Expr getAssignedValueToField(Field f) { diff --git a/java/ql/lib/semmle/code/java/frameworks/InputStream.qll b/java/ql/lib/semmle/code/java/frameworks/InputStream.qll index f6097e8c449..979e1587244 100644 --- a/java/ql/lib/semmle/code/java/frameworks/InputStream.qll +++ b/java/ql/lib/semmle/code/java/frameworks/InputStream.qll @@ -57,7 +57,7 @@ private class InputStreamWrapperCapturedLocalStep extends AdditionalTaintStep { | n1.asExpr() = captured.(SsaExplicitUpdate).getDefiningExpr().(VariableAssign).getSource() or - captured.(SsaImplicitInit).isParameterDefinition(n1.asParameter()) + captured.(SsaParameterInit).getParameter() = n1.asParameter() ) } }