On 05/29/2012 06:00 PM, Florian Weimer wrote:
This patch flags operator new on variably modified types as an error.
If this is acceptable, this will simplify the implementation of the
C++11 requirement to throw std::bad_array_new_length instead of
allocating a memory region which is too short.

It turns out that the patch is not good enough.  Apparently, people write

  new (T[n])

instead of

  new T[n]

from time to time. This is ill-formed (for variable n), and is currently accepted silently. We even have test suite coverage for this.

I'll try to warn about this case and make the transformation to the proper operator new[] call.

--
Florian Weimer / Red Hat Product Security Team

Reply via email to