4 ms·
You're making a lot of assumptions: 1. Those type checks will be too slow 2. The compiler will choose to follow declarations for untrusted code 3. The de
by sedachv 16y ago
You're making a lot of assumptions:
1. Those type checks will be too slow
2. The compiler will choose to follow declarations for untrusted code
3. The declarations will lead to bugs on some inputs
4. Those bugs will be exploitable
5. Somehow those exploits will be worse than what's currently the case with C
99% of C exploits are string/buffer overflows. Bounds checking is not expensive, especially when your arrays carry around their size information. You can enable it in many current C compilers. W^X is an attempt to put something resembling bounds checking into the hardware.
I honestly don't understand the people that argue bounds checking is too slow. How many times do you have to make the same mistake to realize that what you're doing is wrong? It's just idiotic.