Skip to content

Commit 0a6ce2d

Browse files
authored
Merge pull request #22619 from aschackmull/unified/compoundassign-fix
Unified: Include short-circuiting compound assignments.
2 parents 764a958 + 404d23f commit 0a6ce2d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

unified/ql/lib/codeql/unified/internal/AstExtra.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private import codeql.unified.internal.NameBindingPlugin
77

88
module Public {
99
/** An assignment, possibly a compound assignment. */
10-
abstract class AssignmentImpl extends BinaryExpr {
10+
abstract private class AssignmentImpl extends BinaryExpr {
1111
/** Gets the target of this assignment. */
1212
abstract Expr getTarget();
1313

@@ -30,7 +30,10 @@ module Public {
3030
final class CompoundAssignExpr extends BinaryExpr, AssignmentImpl {
3131
CompoundAssignExpr() {
3232
this.getOperator().getValue() =
33-
["+=", "-=", "*=", "/=", "%=", "<<=", ">>=", "&=", "|=", "^=", "&+=", "&-=", "&*="]
33+
[
34+
"+=", "-=", "*=", "/=", "%=", "<<=", ">>=", "&=", "|=", "^=", "&+=", "&-=", "&*=", "&&=",
35+
"||=", "??="
36+
]
3437
}
3538

3639
override Expr getTarget() { result = this.getLeft() }

0 commit comments

Comments
 (0)