5 ms·
The problem is that array bounds are not available in general. If you use global static arrays compilers can indeed insert checks. In other cases the size might
by jstimpfle 8y ago
The problem is that array bounds are not available in general. If you use global static arrays compilers can indeed insert checks. In other cases the size might for example be bounded by a terminator sentinel, or have an implicit size based on other runtime variables, etc.
- MaxBarraclough 8y agoIndeed. To rework the whole ecosystem to enable bounds-checking would be quite a task. External native code that allocates, alloca... not easily done. Not as 'tidy' as Java/.Net where arrays are just somewhat special objects.