-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SE Loops: Addition for same sign operands #8760
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of comments.
...rc/SonarAnalyzer.Common/SymbolicExecution/Roslyn/OperationProcessors/ArithmeticCalculator.cs
Show resolved
Hide resolved
BinaryOperatorKind.ExclusiveOr => NumberConstraint.From(CalculateXorMin(left, right), CalculateXorMax(left, right)), | ||
_ => null | ||
}; | ||
isInLoop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write this with if (isInLoop)
, I don't think the ternary helps here, it's a bit too big.
@@ -1737,6 +1742,79 @@ void ForLoop_ZeroOrOneExecutions() | |||
} | |||
} | |||
|
|||
class LoopVariableTracking | |||
{ | |||
void InitializationInLoop(bool condition) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you add any testcases for double-negative, or did I miss it?
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Quality Gate passedIssues Measures |
Part of #8695