Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@isaacbrodsky
Copy link
Collaborator

This protects against a particular instance of signed integer overflow that would have occurred in ijkNormalize.

@coveralls
Copy link

coveralls commented Oct 6, 2022

Coverage Status

Coverage increased (+0.006%) to 99.046% when pulling e9453c1 on isaacbrodsky:localijtocell-overflow into 9f25b3f on uber:master.

int ijkDistance(const CoordIJK *a, const CoordIJK *b);
void ijkToIj(const CoordIJK *ijk, CoordIJ *ij);
void ijToIjk(const CoordIJ *ij, CoordIJK *ijk);
H3Error ijToIjk(const CoordIJ *ij, CoordIJK *ijk);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes me suspicious that we may need something similar for ijkToIj or the cube functions as well, might be worth adding tests.

Copy link
Collaborator Author

@isaacbrodsky isaacbrodsky Oct 6, 2022

Choose a reason for hiding this comment

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

I am not sure if ijkToIj can be overflowed assuming that the input coordinates are all non-negative. We would need to be comfortable with that function only being called with IJK+ coordinates, of course.

@isaacbrodsky
Copy link
Collaborator Author

I don't think my original test was correct (coverage decreased) and I updated. TBD if coverage is complete on the new test.

@isaacbrodsky isaacbrodsky merged commit fdda899 into uber:master Oct 10, 2022
@isaacbrodsky isaacbrodsky deleted the localijtocell-overflow branch October 10, 2022 17:41
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.

4 participants