On 1/29/19 6:38 AM, Nicholas Wilson wrote:
On Tuesday, 29 January 2019 at 08:35:11 UTC, Manu wrote:
4. "Under DIP 1016, a call with any T[] will silently "succeed"  by
converting the slice to void[]"  <--  Do you mean "... with any T[] rvalue ..."? What would be the aim of that call? Can you suggest a particularly sinister construction?

I _think_ what is meant is:

void[] allocate(size_t size);
bool reallocate(ref void[] b, size_t s);
void deallocate(ref void[]);

T[] arr = allocate(42);
arr.reallocate(8192); // reallocates a temporary as T[] is cast to void
arr.deallocate(); // double free

Affirmative. (Just wrote about the same in another post). Thanks very much.

Andrei

Reply via email to