-
Notifications
You must be signed in to change notification settings - Fork 58
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
Missing return value in graph.h (Undefined Behavior?) #77
Comments
Falling off the end of a function, if it has a non void return value, is Undefined Behaviour in C++. This happens in These seem to be copy and past mistake from the corresponding move constructors. Cheers! |
Thanks for the bug report, does adding a |
Thanks for the quick response! I added |
Hello,
while trying to implement an algorithm using your library, I have come across issues when trying to use
std::move
on a symmetric graph, namelybad_alloc
or stack smashing.After running the code with sanitizers (address and undefined), I got the following message:
gbbs/graph.h:150:20: runtime error: execution reached the end of a value-returning function without returning a value
It seems that the move assignments in
graph.h
are missingreturn *this
. This might be undefined behaviour, but I am not sure as I am not too familiar with C++. After addingreturn *this
to the end ofsymmetric_graph& operator=(symmetric_graph&& other) noexcept
, the algorithm ran without crashing.Let me know if you'd like more details regarding when exactly these issues occurred.
Thanks,
Daniel
The text was updated successfully, but these errors were encountered: