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

Add support for UNSIGNED_RIGHT_SHIFT. #303

Merged
merged 4 commits into from Apr 8, 2019
Merged

Conversation

lazaroclapp
Copy link
Collaborator

Adding switch support and running on our internal code base revealed the need for supporting this.

Copy link
Collaborator

@msridhar msridhar left a comment

Choose a reason for hiding this comment

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

Nit on the test

@@ -809,4 +809,12 @@ static void testTwoParamIter() {
s.hashCode();
}
}

static int testNoCrashOnShifts(int n) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this really test the relevant code path? I think you need to have some kind of unboxing going on. E.g., make the method return Integer and return an unsigned right shift expression

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The original example is just a shift inside a switch, for an int instance field. But you are right, this test doesn't actually trigger that path. Fixing it now, the new version does fail when I remove the added line in NullAway.java :)

@lazaroclapp lazaroclapp merged commit d2d84b0 into master Apr 8, 2019
@lazaroclapp lazaroclapp deleted the lazaro_unsigned_shift branch April 8, 2019 17:46
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.

None yet

2 participants