Skip to content

Commit

Permalink
Rust: Fix CompoundAssignmentExpr charpred
Browse files Browse the repository at this point in the history
  • Loading branch information
hvitved committed Oct 4, 2024
1 parent a9cf33c commit 50c2d10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rust/ql/lib/codeql/rust/elements/AssignmentOperation.qll
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ final class AssignmentExpr extends AssignmentOperationImpl {
final class CompoundAssignmentExpr extends AssignmentOperationImpl {
private string operator;

CompoundAssignmentExpr() { this.getOperatorName().regexpCapture("(.)=", 1) = operator }
CompoundAssignmentExpr() {
this.getOperatorName().regexpCapture("(\\+|-|\\*|/|%|&|\\||\\^|<<|>>)=", 1) = operator
}

/**
* Gets the operator of this compound assignment expression.
Expand Down

0 comments on commit 50c2d10

Please sign in to comment.