3 ms·
> If you define out-of-bounds writes to lead to memory corruption, your compiled code doesn't get any slower. Yes, it does, because some optimizations now beco
by pcwalton 9y ago
> If you define out-of-bounds writes to lead to memory corruption, your compiled code doesn't get any slower.
Yes, it does, because some optimizations now become invalid. For example, a compiler would no longer allowed to delete a provably out-of-bounds write. This happens all the time.
I don't think there's a lot of practical value in changing the definition of some kinds of undefined behavior to "memory corruption" (however defined) in the first place.