Skip to content

C++: Support implicit casts better in range analysis#2750

Merged
dbartol merged 4 commits intogithub:masterfrom
criemen:cpp-range-analysis-casts
Feb 5, 2020
Merged

C++: Support implicit casts better in range analysis#2750
dbartol merged 4 commits intogithub:masterfrom
criemen:cpp-range-analysis-casts

Conversation

@criemen
Copy link
Collaborator

@criemen criemen commented Feb 3, 2020

This extends the C++ range analysis by supporting constructs like

int i;
long l;   
if (i < l - 2) {
  sink (i);
}

The bound derived in the if condition is on the value number of the implicitly-to-long converted i.
This PR recovers a bound on i itself.

Depends on #2745, *.expected test changes are missing due to missing tooling.

@criemen criemen requested a review from a team as a code owner February 3, 2020 16:38
Copy link
Contributor

@rdmarsh2 rdmarsh2 left a comment

Choose a reason for hiding this comment

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

Looks good to me. I've added expected test output by pushing to your branch.

@rdmarsh2
Copy link
Contributor

rdmarsh2 commented Feb 3, 2020

@jbj can we get @Cornelius-Riemenschneider a preview codeql version so he can run tests himself?

@dbartol dbartol added the C++ label Feb 5, 2020
Copy link

@dbartol dbartol left a comment

Choose a reason for hiding this comment

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

LGTM

@dbartol dbartol merged commit c53f801 into github:master Feb 5, 2020
@criemen criemen deleted the cpp-range-analysis-casts branch February 6, 2020 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants