Skip to content

Commit 011666b

Browse files
authored
Fix description and improve predicate name of VarWrite.
1 parent ede1758 commit 011666b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,7 +1850,7 @@ class VarWrite extends VarAccess {
18501850
VarWrite() { this.isVarWrite() }
18511851

18521852
/**
1853-
* Gets the right-hand side of the assignment that executes this variable write.
1853+
* Gets a source of the assignment that executes this variable write.
18541854
*
18551855
* For assignments using the `=` operator, the source expression
18561856
* is simply the RHS of the assignment.
@@ -1859,7 +1859,10 @@ class VarWrite extends VarAccess {
18591859
* (such as (`+=`), both the RHS and the LHS of the compound assignment
18601860
* are source expressions of the assignment.
18611861
*/
1862-
Expr getRhs() { exists(Assignment e | e.getDest() = this and e.getSource() = result) }
1862+
Expr getASource() { exists(Assignment e | e.getDest() = this and e.getSource() = result) }
1863+
1864+
/** DEPRECATED: (Inaccurately-named) alias for `getASource` */
1865+
deprecated Expr getRhs() { result = this.getASource() }
18631866
}
18641867

18651868
/** DEPRECATED: Alias for `VarWrite`. */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ predicate interpretInputSpecific(string c, InterpretNode mid, InterpretNode n) {
333333
exists(FieldWrite fw |
334334
c = "" and
335335
fw.getField() = mid.asElement() and
336-
n.asNode().asExpr() = fw.getRhs()
336+
n.asNode().asExpr() = fw.getASource()
337337
)
338338
}
339339

0 commit comments

Comments
 (0)