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

Avoid undefined behaviour in zigzag with negative inputs #153

Closed
wants to merge 1 commit into from

Conversation

Algunenano
Copy link
Member

Output from sanitizer before changes:

Running test 'test_zigzag' in suite 'varint'.                                                                                                                                                                                    
varint.c:170:14: runtime error: left shift of negative value -1
varint.c:175:14: runtime error: left shift of negative value -1
varint.c:180:14: runtime error: left shift of negative value -127

Changes in unzigzag weren't really necessary but I wanted to keep the branchless check as in zigzag.
Also, please let me know if you would rather have the (X ? Y : Z) in the same line

@Algunenano
Copy link
Member Author

Trac issue: https://trac.osgeo.org/postgis/ticket/3882

@pramsey
Copy link
Member

pramsey commented Oct 10, 2017

Committed

@pramsey pramsey closed this Oct 10, 2017
@Algunenano Algunenano deleted the zigzag branch November 15, 2019 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants