Remix.run Logo
ameliaquining 5 days ago

IIUC even single-threaded Zig programs built with ReleaseSafe are not guaranteed to be free of memory corruption vulnerabilities; for example, dereferencing a pointer to a local variable that's no longer alive is undefined behavior in all optimization modes.

skeezyboy 4 days ago | parent [-]

well just dont do it then

ameliaquining 4 days ago | parent [-]

That's also the standard advice in C and C++, and yet, people screw it up frequently enough to merit a CWE category: https://cwe.mitre.org/data/definitions/562.html