Skip to content

Commit 2568318

Browse files
committed
C#: Sign analysis support for unsigned right shift.
1 parent d06a877 commit 2568318

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/RangeUtils.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,13 @@ module ExprNode {
404404
override TRShiftOp getOp() { any() }
405405
}
406406

407+
/** An unsigned right-shift operation. */
408+
class UnsignedRightShiftExpr extends BinaryOperation {
409+
override CS::UnsignedRightShiftExpr e;
410+
411+
override TURShiftOp getOp() { any() }
412+
}
413+
407414
/** A conditional expression. */
408415
class ConditionalExpr extends ExprNode {
409416
override CS::ConditionalExpr e;

csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ private module Impl {
213213
not e.getExpr() instanceof BitwiseXorExpr and
214214
not e.getExpr() instanceof LeftShiftExpr and
215215
not e.getExpr() instanceof RightShiftExpr and
216+
not e.getExpr() instanceof UnsignedRightShiftExpr and
216217
not e.getExpr() instanceof ConditionalExpr and
217218
not e.getExpr() instanceof RefExpr and
218219
not e.getExpr() instanceof LocalVariableDeclAndInitExpr and

0 commit comments

Comments
 (0)