mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
C#: Rename shift assignment expression classes.
This commit is contained in:
@@ -150,8 +150,8 @@ class AssignRemExpr extends AssignArithmeticOperation, @assign_rem_expr {
|
||||
* operation (`AssignAndExpr`), a bitwise-or assignment
|
||||
* operation (`AssignOrExpr`), a bitwise exclusive-or assignment
|
||||
* operation (`AssignXorExpr`), a left-shift assignment
|
||||
* operation (`AssignLShiftExpr`), or a right-shift assignment
|
||||
* operation (`AssignRShiftExpr`).
|
||||
* operation (`AssignLeftShiftExpr`), or a right-shift assignment
|
||||
* operation (`AssignRightShiftExpr`).
|
||||
*/
|
||||
class AssignBitwiseOperation extends AssignOperation, @assign_bitwise_expr { }
|
||||
|
||||
@@ -185,21 +185,27 @@ class AssignXorExpr extends AssignBitwiseOperation, @assign_xor_expr {
|
||||
/**
|
||||
* A left-shift assignment operation, for example `x <<= y`.
|
||||
*/
|
||||
class AssignLShiftExpr extends AssignBitwiseOperation, @assign_lshift_expr {
|
||||
class AssignLeftShiftExpr extends AssignBitwiseOperation, @assign_lshift_expr {
|
||||
override string getOperator() { result = "<<=" }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "AssignLShiftExpr" }
|
||||
override string getAPrimaryQlClass() { result = "AssignLeftShiftExpr" }
|
||||
}
|
||||
|
||||
/** DEPRECATED: Alias for AssignLeftShipExpr. */
|
||||
deprecated class AssignLShiftExpr = AssignLeftShiftExpr;
|
||||
|
||||
/**
|
||||
* A right-shift assignment operation, for example `x >>= y`.
|
||||
*/
|
||||
class AssignRShiftExpr extends AssignBitwiseOperation, @assign_rshift_expr {
|
||||
class AssignRightShiftExpr extends AssignBitwiseOperation, @assign_rshift_expr {
|
||||
override string getOperator() { result = ">>=" }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "AssignRShiftExpr" }
|
||||
override string getAPrimaryQlClass() { result = "AssignRightShiftExpr" }
|
||||
}
|
||||
|
||||
/** DEPRECATED: Alias for AssignRightShiftExpr. */
|
||||
deprecated class AssignRShiftExpr = AssignRightShiftExpr;
|
||||
|
||||
/**
|
||||
* An event assignment. Either an event addition (`AddEventExpr`) or an event
|
||||
* removal (`RemoveEventExpr`).
|
||||
|
||||
@@ -1377,8 +1377,8 @@ class TranslatedAssignOperation extends TranslatedAssignment {
|
||||
|
||||
private Type getConvertedLeftOperandType() {
|
||||
if
|
||||
expr instanceof AssignLShiftExpr or
|
||||
expr instanceof AssignRShiftExpr
|
||||
expr instanceof AssignLeftShiftExpr or
|
||||
expr instanceof AssignRightShiftExpr
|
||||
then result = this.getLeftOperand().getResultType()
|
||||
else
|
||||
// The right operand has already been converted to the type of the op.
|
||||
@@ -1416,9 +1416,9 @@ class TranslatedAssignOperation extends TranslatedAssignment {
|
||||
or
|
||||
expr instanceof AssignXorExpr and result instanceof Opcode::BitXor
|
||||
or
|
||||
expr instanceof AssignLShiftExpr and result instanceof Opcode::ShiftLeft
|
||||
expr instanceof AssignLeftShiftExpr and result instanceof Opcode::ShiftLeft
|
||||
or
|
||||
expr instanceof AssignRShiftExpr and result instanceof Opcode::ShiftRight
|
||||
expr instanceof AssignRightShiftExpr and result instanceof Opcode::ShiftRight
|
||||
}
|
||||
|
||||
override predicate hasInstruction(Opcode opcode, InstructionTag tag, CSharpType resultType) {
|
||||
|
||||
@@ -152,11 +152,11 @@ assignop.cs:
|
||||
# 12| 0: [LocalVariableAccess] access to local variable c
|
||||
# 12| 1: [LocalVariableAccess] access to local variable a
|
||||
# 13| 7: [ExprStmt] ...;
|
||||
# 13| 0: [AssignLShiftExpr] ... <<= ...
|
||||
# 13| 0: [AssignLeftShiftExpr] ... <<= ...
|
||||
# 13| 0: [LocalVariableAccess] access to local variable c
|
||||
# 13| 1: [IntLiteral] 2
|
||||
# 14| 8: [ExprStmt] ...;
|
||||
# 14| 0: [AssignRShiftExpr] ... >>= ...
|
||||
# 14| 0: [AssignRightShiftExpr] ... >>= ...
|
||||
# 14| 0: [LocalVariableAccess] access to local variable c
|
||||
# 14| 1: [IntLiteral] 2
|
||||
# 15| 9: [ExprStmt] ...;
|
||||
|
||||
Reference in New Issue
Block a user