-
Notifications
You must be signed in to change notification settings - Fork 333
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
Spot potential UB #371
Labels
Milestone
Comments
Running across the usual academic/ad-hoc benchmarks, the error reported above is the only one we get. |
For what it's worth, I also did a few checks raising no error with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using GCC Undefined Behavior Sanitizer (enable by compiling with
-fsanitize=undefined
) on an instance of the Solomon benchmark results in:Because there is no break in input, the mentioned line:
vroom/src/structures/vroom/tw_route.cpp
Line 453 in b5dd59d
defines a reference to the first element of an empty vector. In that case, the surrounding loop is designed in such a way that this reference is not actually used when the vector is empty, but this is still UB all right.
We should:
No really sure how to go for that last point because setting
-fsanitize=undefined
slows down things to such a degree that it is totally not practically usable in dev mode.The text was updated successfully, but these errors were encountered: