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

Fix the undefined behaviour caused by left shifting of negative values. #16

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

vahancho
Copy link
Owner

@vahancho vahancho commented Oct 2, 2023

Properly handle encoding of the signed values. According to the algorithm (step 3, https://developers.google.com/maps/documentation/utilities/polylinealgorithm) negative values must be calculated using their two's complement.

fixed #15

Properly handle encoding of the signed values. According to the algorithm
(step 3, https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
negative values must be calculated using their two's complement.

fixed #15
@vahancho vahancho self-assigned this Oct 2, 2023
@codecov-commenter
Copy link

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (9bed987) 95.06% compared to head (4533f9c) 94.04%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
- Coverage   95.06%   94.04%   -1.02%     
==========================================
  Files           1        1              
  Lines          81       84       +3     
  Branches       10       11       +1     
==========================================
+ Hits           77       79       +2     
- Partials        4        5       +1     
Files Coverage Δ
src/polylineencoder.h 94.04% <80.00%> (-1.02%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vahancho vahancho merged commit 0182315 into master Oct 5, 2023
4 of 6 checks passed
@vahancho vahancho deleted the left-shift-ub-fix branch October 5, 2023 08:24
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.

Left-shift of negative values undefined
2 participants