From 404d23fddbe4aef0cb4c41ee01abe7d2f28beecd Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Fri, 18 Sep 2026 11:24:44 +0200 Subject: [PATCH] Unified: Include short-circuiting compound assignments. --- unified/ql/lib/codeql/unified/internal/AstExtra.qll | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unified/ql/lib/codeql/unified/internal/AstExtra.qll b/unified/ql/lib/codeql/unified/internal/AstExtra.qll index 486fb16ad3e5..d08601d8e792 100644 --- a/unified/ql/lib/codeql/unified/internal/AstExtra.qll +++ b/unified/ql/lib/codeql/unified/internal/AstExtra.qll @@ -7,7 +7,7 @@ private import codeql.unified.internal.NameBindingPlugin module Public { /** An assignment, possibly a compound assignment. */ - abstract class AssignmentImpl extends BinaryExpr { + abstract private class AssignmentImpl extends BinaryExpr { /** Gets the target of this assignment. */ abstract Expr getTarget(); @@ -30,7 +30,10 @@ module Public { final class CompoundAssignExpr extends BinaryExpr, AssignmentImpl { CompoundAssignExpr() { this.getOperator().getValue() = - ["+=", "-=", "*=", "/=", "%=", "<<=", ">>=", "&=", "|=", "^=", "&+=", "&-=", "&*="] + [ + "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", "&=", "|=", "^=", "&+=", "&-=", "&*=", "&&=", + "||=", "??=" + ] } override Expr getTarget() { result = this.getLeft() }