Skip to content

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

Merged
vahancho merged 3 commits intomasterfrom
left-shift-ub-fix
Oct 5, 2023
Merged

Fix the undefined behaviour caused by left shifting of negative values.#16
vahancho merged 3 commits intomasterfrom
left-shift-ub-fix

Conversation

@vahancho
Copy link
Copy Markdown
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
Copy Markdown

codecov-commenter commented Oct 2, 2023

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.11%. Comparing base (9bed987) to head (0666f2b).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
src/polylineencoder.h 71.42% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
- Coverage   95.06%   94.11%   -0.95%     
==========================================
  Files           1        1              
  Lines          81       85       +4     
  Branches       10       11       +1     
==========================================
+ Hits           77       80       +3     
- Partials        4        5       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vahancho vahancho merged commit 0182315 into master Oct 5, 2023
@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