-
Notifications
You must be signed in to change notification settings - Fork 697
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
Odin undefined behaviour: handle case when xedgeuse is not initialized #3020
Conversation
@dgearhart I have not ideas how to test it as this variable isn't visible outside |
Actually I have question - the way its written currently, nothing really sets Previously, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment, more for my clarification
The caller does set the "pointer"(i.e pointer to boost::optional<TripLeg_Use> xedge_use;
// xedgeuse is a valid variable so &xedgeuse != nullptr
GetStraightestTraversableIntersectingEdgeTurnDegree(...,..., &xedge_use); Check out the difference with the following piece of code boost::optional<TripLeg_Use>* xedge_use = nulltpr;
GetStraightestTraversableIntersectingEdgeTurnDegree(...,..., xedge_use); // xedgeuse is null obviously |
Yup, makes sense. Thanks for the explanation! 👍 |
@merkispavel I would at least run RAD (master vs. branch) with the following files:
|
I RAD-tested the changes 🟢 |
Issue
There real world cases when xedge is not initialized after
GetStraightestTraversableIntersectingEdgeTurnDegree
call, i.e if the list is intersecting edge_size = 0valhalla/src/odin/enhancedtrippath.cc
Line 1736 in ce8ab9d
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?