Skip to content

Instantly share code, notes, and snippets.

@bobergj
Created November 8, 2017 14:05
Show Gist options
  • Save bobergj/db615e08f00c7820532f151b880775b3 to your computer and use it in GitHub Desktop.
Save bobergj/db615e08f00c7820532f151b880775b3 to your computer and use it in GitHub Desktop.
Undefined behaviour in CGAL::internal::vector
// Compile and run as follows:
// $ clang++ main.cpp -I<cgal-and-boost-include-path> -L<cgal-library-path> -lCGAL -fsanitize=undefined
// $ ./a.out
// CGAL/vector.h:75:57: runtime error: reference binding to null pointer of type 'int'
//
#include <CGAL/vector.h>
int main() {
CGAL::internal::vector<int> foo;
std::cout << foo.size() << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment