Commits
Dave Abrahams committed 40e9a0f8598
[stdlib] Fix memory safety with evil collections A collection whose count changes between traversals could cause a memory safety problem, as we would measure the collection in one pass and assume that it was the same length when actually initializing array elements. Fix that by always using the initial measurement, which corresponds exactly to allocated memory. If the collection wants to trap because we've gone past its new bounds, that's fine. If it doesn't, at least we haven't done anything unsafe. Swift SVN r22152