@@ -67,7 +67,7 @@ class AssignExpr extends Assignment, @simple_assign_expr {
6767 * (`AssignArithmeticOperation`), a bitwise assignment operation
6868 * (`AssignBitwiseOperation`), or an event assignment (`AddOrRemoveEventExpr`).
6969 */
70- class AssignOperation extends Assignment , @assign_op_expr {
70+ class AssignOperation extends Assignment , OperatorCall , @assign_op_expr {
7171 override string getOperator ( ) { none ( ) }
7272
7373 /**
@@ -79,7 +79,7 @@ class AssignOperation extends Assignment, @assign_op_expr {
7979 * If an expanded version exists, then it is used in the control
8080 * flow graph.
8181 */
82- AssignExpr getExpandedAssignment ( ) { expr_parent ( result , 2 , this ) }
82+ AssignExpr getExpandedAssignment ( ) { none ( ) }
8383
8484 /**
8585 * Holds if this assignment operation has an expanded version.
@@ -92,6 +92,16 @@ class AssignOperation extends Assignment, @assign_op_expr {
9292 */
9393 predicate hasExpandedAssignment ( ) { exists ( this .getExpandedAssignment ( ) ) }
9494
95+ override Expr getLeftOperand ( ) { result = this .getChild ( 0 ) }
96+
97+ override Expr getRightOperand ( ) { result = this .getChild ( 1 ) }
98+
99+ /** Gets the left operand of this assignment. */
100+ override Expr getLValue ( ) { result = this .getChild ( 0 ) }
101+
102+ /** Gets the right operand of this assignment. */
103+ override Expr getRValue ( ) { result = this .getChild ( 1 ) }
104+
95105 override string toString ( ) { result = "... " + this .getOperator ( ) + " ..." }
96106}
97107
@@ -219,8 +229,9 @@ class AssignUnsighedRightShiftExpr extends AssignBitwiseOperation, @assign_urshi
219229 * removal (`RemoveEventExpr`).
220230 */
221231class AddOrRemoveEventExpr extends AssignOperation , @assign_event_expr {
232+ // TODO: We need to handle such cases differently as there is no underlying operatorcall.
222233 /** Gets the event targeted by this event assignment. */
223- Event getTarget ( ) { result = this .getLValue ( ) .getTarget ( ) }
234+ Event getTargetEvent ( ) { result = this .getLValue ( ) .getTarget ( ) }
224235
225236 override EventAccess getLValue ( ) { result = this .getChild ( 1 ) }
226237
0 commit comments