Skip to content

Commit 50c2d10

Browse files
committed
Rust: Fix CompoundAssignmentExpr charpred
1 parent a9cf33c commit 50c2d10

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rust/ql/lib/codeql/rust/elements/AssignmentOperation.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ final class AssignmentExpr extends AssignmentOperationImpl {
3838
final class CompoundAssignmentExpr extends AssignmentOperationImpl {
3939
private string operator;
4040

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

4345
/**
4446
* Gets the operator of this compound assignment expression.

0 commit comments

Comments
 (0)