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

ArrayView construction from empty std::vector asserts #75

Closed
Squareys opened this issue Aug 15, 2019 · 1 comment

Comments

@Squareys
Copy link
Contributor

commented Aug 15, 2019

As mentioned per gitter, the following code asserts on the vectors bounds check:

#include <vector>
#include <Corrade/Containers/ArrayViewStl.h>
//...
std::vector<int> v;
ArrayView<int>(v);

As in line https://github.com/mosra/corrade/blob/master/src/Corrade/Containers/ArrayViewStl.h#L65 it tries to access element 0.

@mosra mosra added this to the 2019.0b milestone Aug 16, 2019

@mosra mosra added this to TODO in Utility via automation Aug 16, 2019

@mosra

This comment has been minimized.

Copy link
Owner

commented Aug 20, 2019

Tests added in b2a6e4b, fixed in ffa67c0. Didn't discover this myself because libstdc++'s data() is never nullptr so it was never blowing up.

Thanks a lot for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2 participants
You can’t perform that action at this time.