Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <vector>
- int main()
- {
- size_t uint_max = static_cast<size_t>(-1);
- std::vector<char> v;
- v.reserve(uint_max);
- }
- Warning: silly arg (-1) to __builtin_new()
- new/new[] failed and should throw an exception, but Valgrind
- cannot throw exceptions and so is aborting instead. Sorry.
- at 0x40192BC: VALGRIND_PRINTF_BACKTRACE (valgrind.h:319)
- by 0x401C823: operator new(unsigned) (vg_replace_malloc.c:164)
- by 0x80487BF: std::vector<char, std::allocator<char> >::reserve(unsigned) new_allocator.h:92)
- by 0x804874D: main (vg.cxx:6)
- MYAPP_UNIT_TESTS_DISABLED="NEW_MINUS_ONE,FLY_TO_MOON,DEREF_NULL" valgrind myapp
- bool unit_test_enabled(const char *testname);
Add Comment
Please, Sign In to add comment