Is taking a pointer to the interior of a contiguously-laid-out array, then shortening the length of the array and dereferencing that now-dangling pointer, a spatial or temporal memory safety violation? Seems to me that the distinction gets very blurred in this case.
Conversation
Replying to
How do you "shorten the length of the array"? This seems like a problematic operation for a language to have.
1
Supporting shrink to fit for a dynamic array isn't more problematic than supporting the fundamental append operation. Growing / shrinking aren't much different.
You're interpreting array as the C meaning of array rather than as a generic term which in this case is referring to a dynamic array, i.e. a layer on top of malloc/realloc/free with a separate length/capacity where growing/shrinking capacity invalidates references into it.
1
Show replies

