Skip to content

Conversation

@aschackmull
Copy link
Contributor

Fix in response to #20741 (comment)

Copilot AI review requested due to automatic review settings November 21, 2025 11:55
@aschackmull aschackmull requested a review from a team as a code owner November 21, 2025 11:55
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Nov 21, 2025
@github-actions github-actions bot added the Java label Nov 21, 2025
Copilot finished reviewing on behalf of aschackmull November 21, 2025 11:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the constantIntegerExpr predicate in the Java range analysis utilities to recognize long literals that fit within the integer range. The change addresses feedback from a previous pull request by adding support for LongLiteral values that can be safely converted to int.

Key Changes

  • Added a new disjunct to the constantIntegerExpr predicate to handle LongLiteral expressions whose values fit in an int

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@owen-mc owen-mc left a comment

Choose a reason for hiding this comment

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

I see that string.toInt() has no value if the value is outside of the range of an int, so this seems good. I have confirmed that this fixes the case that prompted this PR.

@aschackmull aschackmull merged commit b1ed72d into github:main Nov 21, 2025
25 checks passed
@aschackmull aschackmull deleted the java/rangeanalysis-longliterals branch November 21, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants