Skip to content

Commit fb3060d

Browse files
committed
Java: Minor fixup for SSA AdjacentUsesImpl::varBlockReaches
This should not change anything in regards to correctness overall -- what we really care about is `varBlockStep`, and that checks `varOccursInBlock(v, b2)`. However, the comment is a bit easier to read together with the code now (and probably also gives slightly smaller predicate result size).
1 parent f716f96 commit fb3060d

File tree

1 file changed

+3
-1
lines changed
  • java/ql/src/semmle/code/java/dataflow

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,9 @@ private module SsaImpl {
779779
* between `b1` and `b2`.
780780
*/
781781
private predicate varBlockReaches(TrackedVar v, BasicBlock b1, BasicBlock b2) {
782-
varOccursInBlock(v, b1) and b2 = b1.getABBSuccessor()
782+
varOccursInBlock(v, b1) and
783+
b2 = b1.getABBSuccessor() and
784+
blockPrecedesVar(v, b2)
783785
or
784786
exists(BasicBlock mid |
785787
varBlockReaches(v, b1, mid) and

0 commit comments

Comments
 (0)