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

If the only way of triggering spatial memory unsafety in C++ was vector[i] and that operation was defined to always interrupt execution, then yes, C++ would be considered memory safe. But that is not the case.

The equivalent of vector[i] in Rust is Vex::get_unchecked, which is marked as unsafe, not the default that people reach for normally.



We are, however, talking in this subthread about the compiler inserting bounds checks and (incorrectly) calling the process "static checking".

I refuted that point by pointing out that the same process, if done manually in C++, would not be considered "static analysis that provides memory safety for array access".




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

Search: