2 ms·
Yes memory safe languages would absolutely help here. In Rust you would get a compile time error about the destination variable not living long enough. This so
by IshKebab 2y ago
Yes memory safe languages would absolutely help here. In Rust you would get a compile time error about the destination variable not living long enough.
This sort of stuff is why any productivity arguments for C++ over Rust are bullshit. Sure you spend a little more time writing lifetime annotations, but in return you avoid spending 5 days debugging one memory corruption bug.
- ryao 2y agoThis is not a memory corruption bug. It is an undefined behavior bug and it also affected Rust until 1.81.0 as per comments from others: https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html#abort-on-uncaught-panics-in-extern-c-functions https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html#abort...