Skip to content

Commit f8c0c6f

Browse files
authored
Merge pull request #7 from aschackmull/java/shared-ssa-fixes
Some fixes to #16900
2 parents 9f3a577 + 97db4c1 commit f8c0c6f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

java/ql/lib/semmle/code/java/dataflow/SSA.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,10 @@ class SsaImplicitUpdate extends SsaUpdate {
228228
}
229229

230230
private predicate hasExplicitQualifierUpdate() {
231-
exists(SsaExplicitUpdate qdef, BasicBlock bb, int i |
231+
exists(SsaUpdate qdef, BasicBlock bb, int i |
232232
qdef.definesAt(this.getSourceVariable().getQualifier(), bb, i) and
233-
this.definesAt(_, bb, i)
233+
this.definesAt(_, bb, i) and
234+
not qdef instanceof SsaUncertainImplicitUpdate
234235
)
235236
}
236237

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private module TrackedVariablesImpl {
4444
}
4545

4646
/** Holds if `f` is accessed more than once or inside a loop. */
47-
predicate multiAccessed(SsaSourceField f) { loopAccessed(f) or 1 < numberOfAccesses(f) }
47+
private predicate multiAccessed(SsaSourceField f) { loopAccessed(f) or 1 < numberOfAccesses(f) }
4848

4949
/**
5050
* Holds if `f` is a field that is interesting as a basis for SSA.
@@ -619,13 +619,12 @@ private module Cached {
619619
useReaches(use, mid, sameVarMid) and
620620
DataFlowIntegration::localFlowStep(_, mid, node, _)
621621
|
622-
// flow into phi input node
623-
mid instanceof DataFlowIntegration::SsaInputNode and
624-
sameVar = false
625-
or
626-
// flow into definition
627622
exists(Impl::DefinitionExt def |
623+
// flow into definition
628624
def = mid.(DataFlowIntegration::SsaDefinitionExtNode).getDefinitionExt()
625+
or
626+
// flow into phi input node
627+
def = mid.(DataFlowIntegration::SsaInputNode).getDefinitionExt()
629628
|
630629
if def instanceof Impl::PhiReadNode then sameVar = sameVarMid else sameVar = false
631630
)

0 commit comments

Comments
 (0)