Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I literally didn't know that vector<T>::operator[] doesn't do index checking for me. I've written some C++ code in Python extensions where I use vector<T> to simplify from (T* arg, int arg_length) which I now find out could randomly segfault.

Blergh. This stuff is why I use Python (with snippets of C for speed): when I do something stupid, I get an error message and line numbers, not a faceless segfault (+even when I get a C segfault, I can still get the python stack back with faulthandler..)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: