Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c4f0868
Java: Move SSA entry defs to index -1.
aschackmull Oct 21, 2025
f2181ec
Java: Get rid of untracked SSA definitions.
aschackmull Oct 21, 2025
374c772
Java: Remove getAFirstUse in BaseSSA.
aschackmull Oct 21, 2025
79b2f21
SSA: Fix phi defs.
aschackmull Oct 27, 2025
289d337
SSA: Improve toString.
aschackmull Oct 27, 2025
551944b
Java: Add VariableWrite class.
aschackmull Oct 24, 2025
942dc2b
Java: Replace BaseSSA class wrappers with shared code.
aschackmull Oct 23, 2025
d5708fd
Java: Instantiate shared SSA wrappers for main SSA.
aschackmull Nov 5, 2025
154f077
Java: Simplify instantiation of Guards and ControlFlowReachability.
aschackmull Nov 6, 2025
99aa033
Java: Replace usages of isParameterDefinition.
aschackmull Nov 6, 2025
07e6356
Java: Replace getAFirstUse with top-level predicate.
aschackmull Nov 7, 2025
483b2d8
Java: Replace uses of SsaExplicitUpdate.
aschackmull Nov 7, 2025
06df5c0
Java: Introduce SsaCapturedDefinition and replace uses of getAnUltima…
aschackmull Nov 7, 2025
3e43c53
Java: Update some qldoc deprecation notices.
aschackmull Nov 7, 2025
35caede
Java: Replace SsaPhiNode with SsaPhiDefinition.
aschackmull Nov 7, 2025
f4b9efc
Java: Replace getAUse with getARead.
aschackmull Nov 7, 2025
8594ae0
Java: Replace remaining SsaImplicitInit.
aschackmull Nov 7, 2025
f0bd034
Java: Replace usages of SsaVariable.
aschackmull Nov 7, 2025
ee5d65e
Java: Update toString for implicit writes.
aschackmull Nov 7, 2025
5849d85
Java: Deprecate two more SSA classes.
aschackmull Nov 7, 2025
95ac61d
Java: Drop caching of deprecated predicates.
aschackmull Oct 27, 2025
e059ded
Java: Accept toString changes in qltest.
aschackmull Nov 6, 2025
109a5eb
Java: Accept qltest changes due to dropped UntrackedDef.
aschackmull Nov 6, 2025
437ca58
Java: Add change note.
aschackmull Nov 7, 2025
4a58a01
Java: Reinstate useless null check results for fields that are no lon…
aschackmull Nov 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions java/ql/lib/semmle/code/java/dataflow/SSA.qll
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ module;

import java
private import internal.SsaImpl
import internal.SsaImpl::Ssa as Ssa

Check warning

Code scanning / CodeQL

Names only differing by case Warning

Ssa is only different by casing from SSA that is used elsewhere for modules.
import Ssa

/**
* A fully qualified variable in the context of a `Callable` in which it is
Expand Down
32 changes: 30 additions & 2 deletions java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private predicate uncertainVariableUpdateImpl(TrackedVar v, ControlFlowNode n, B
predicate uncertainVariableUpdate(TrackedVar v, ControlFlowNode n, BasicBlock b, int i) =
forceLocal(uncertainVariableUpdateImpl/4)(v, n, b, i)

private module SsaInput implements SsaImplCommon::InputSig<Location, BasicBlock> {
private module SsaImplInput implements SsaImplCommon::InputSig<Location, BasicBlock> {
class SourceVariable = SsaSourceVariable;

/**
Expand Down Expand Up @@ -206,7 +206,35 @@ private module SsaInput implements SsaImplCommon::InputSig<Location, BasicBlock>
}
}

import SsaImplCommon::Make<Location, Cfg, SsaInput> as Impl
import SsaImplCommon::Make<Location, Cfg, SsaImplInput> as Impl

private module SsaInput implements Impl::SsaInputSig {
private import java as J

class Expr = J::Expr;

class Parameter = J::Parameter;

class VariableWrite = J::VariableWrite;

predicate explicitWrite(VariableWrite w, BasicBlock bb, int i, SsaSourceVariable v) {
exists(VariableUpdate upd |
upd = w.asExpr() and
certainVariableUpdate(v, upd.getControlFlowNode(), bb, i) and
getDestVar(upd) = v
)
or
exists(Parameter p, Callable c |
c = p.getCallable() and
v = TLocalVar(c, p) and
w.isParameterInit(p) and
c.getBody().getBasicBlock() = bb and
i = -1
)
}
}

module Ssa = Impl::MakeSsa<SsaInput>;

Check warning

Code scanning / CodeQL

Names only differing by case Warning

Ssa is only different by casing from SSA that is used elsewhere for modules.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question: Did you check that the cached stages are collapsed?


final class Definition = Impl::Definition;

Expand Down