3 ms·
If you 1) Know the base address of the array. 2) Know the offset of the element(s) you're passing 2a) Know the declared length ( or other upper limit for the
by ArkyBeagle 10y ago
If you
1) Know the base address of the array.
2) Know the offset of the element(s) you're passing
2a) Know the declared length ( or other upper limit for the array ).
then you need never refer to any element of an array that doesn't exist.
- jblow 10y agoThat's not the problem. The problem is any other live pointer could point into that array, for all the compiler knows. Unless the array was generated locally and never aliased, then if you ever call through some set of procedures that the compiler doesn't have complete visibility into, then it is possible that that code generates a pointer into that array and then uses it. The compiler has to be VERY conservative.