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

Fix dereferencing zeroth element of empty vector #97

Conversation

pbatko-ge
Copy link

This is undefined behavior. In MSVC results in failed assertion in debug build.

Note: std::vector::data is available since C++11. If you want to support pre-C++11 standards, this changes should be rewritten.

@pbatko-ge pbatko-ge force-pushed the fix-dereferencing-zeroth-element-of-empty-vector branch from fc424cf to 521a339 Compare April 19, 2024 06:32
@eichelberg
Copy link
Member

A (simpler) fix that does not require C++11 was committed today as commit #169030f5a.

@eichelberg eichelberg closed this May 17, 2024
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