Skip to content
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

Merged
merged 4 commits into from
Feb 16, 2024
Merged

Conversation

Tim-Pohlmann
Copy link
Contributor

@Tim-Pohlmann Tim-Pohlmann commented Feb 14, 2024

Part of #8695

@Tim-Pohlmann Tim-Pohlmann added Type: False Negative Rule is NOT triggered when it should be. Area: CFG/SE CFG and SE related issues. Area: VB.NET VB.NET rules related issues. Area: C# C# rules related issues. labels Feb 14, 2024
@Tim-Pohlmann Tim-Pohlmann marked this pull request as draft February 14, 2024 15:15
@Tim-Pohlmann Tim-Pohlmann removed Type: False Negative Rule is NOT triggered when it should be. Area: CFG/SE CFG and SE related issues. Area: VB.NET VB.NET rules related issues. Area: C# C# rules related issues. labels Feb 14, 2024
Copy link
Contributor

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.

BinaryOperatorKind.ExclusiveOr => NumberConstraint.From(CalculateXorMin(left, right), CalculateXorMax(left, right)),
_ => null
};
isInLoop

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)

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?

@Tim-Pohlmann Tim-Pohlmann marked this pull request as ready for review February 15, 2024 16:41
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@Tim-Pohlmann Tim-Pohlmann merged commit 5d6b781 into master Feb 16, 2024
28 checks passed
@Tim-Pohlmann Tim-Pohlmann deleted the Tim/Arithmetics branch February 16, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants