Skip to content

Commit c37a166

Browse files
committed
Java: Replace remaining SsaImplicitInit.
1 parent a175b3b commit c37a166

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,9 @@ predicate hasNonlocalValue(FieldRead fr) {
102102
not exists(SsaDefinition v | v.getARead() = fr)
103103
or
104104
exists(SsaDefinition v, SsaDefinition def |
105-
v.getARead() = fr and def = v.getAnUltimateDefinition()
106-
|
107-
def instanceof SsaImplicitInit or
108-
def instanceof SsaImplicitUpdate
105+
v.getARead() = fr and
106+
def = v.getAnUltimateDefinition() and
107+
def instanceof SsaImplicitWrite
109108
)
110109
}
111110

java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,9 @@ private module Cached {
510510

511511
/** Holds if `init` is a closure variable that captures the value of `capturedvar`. */
512512
cached
513-
predicate captures(SsaImplicitInit init, SsaVariable capturedvar) {
513+
predicate captures(SsaImplicitEntryDefinition init, SsaVariable capturedvar) {
514514
exists(BasicBlock bb, int i |
515-
Impl::ssaDefReachesRead(_, capturedvar, bb, i) and
515+
Ssa::ssaDefReachesUncertainRead(_, capturedvar, bb, i) and
516516
variableCapture(capturedvar.getSourceVariable(), init.getSourceVariable(), bb, i)
517517
)
518518
}

java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,8 @@ private module Impl {
267267
}
268268

269269
/** Gets the variable underlying the implicit SSA variable `v`. */
270-
Variable getImplicitSsaDeclaration(SsaVariable v) {
271-
result = v.(SsaImplicitUpdate).getSourceVariable().getVariable() or
272-
result = v.(SsaImplicitInit).getSourceVariable().getVariable()
270+
Variable getImplicitSsaDeclaration(SsaDefinition v) {
271+
result = v.(SsaImplicitWrite).getSourceVariable().getVariable()
273272
}
274273

275274
/** Holds if the variable underlying the implicit SSA variable `v` is not a field. */

0 commit comments

Comments
 (0)