Re:Borrow Checking, RC, GC, and Eleven Other Memory Safety A...
by mgaunard on Friday December 20, 2024 @06:59AM
(#42470374)
It takes a lot more for a program to be correct than having valid bit patterns.
To begin with, the whole point of classes is to maintain invariants. Guaranteeing that a location in memory matches the valid bit patterns of its members is far from sufficient.
If you have an array of objects of the same type and you just pick the wrong one, then the data still has to be a valid bit pattern. Yes it might still be a security bug, but it's much less likely because you aren't completely subverting the language.
Surely you don't think all bugs are the same because they are all bugs?