[PATCH] D49589: [UBSan] Strengthen pointer checks in 'new' expressions

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 23 01:48:02 PDT 2018


sepavloff added a comment.

In https://reviews.llvm.org/D49589#1171279, @ikudrin wrote:

> Did you consider dividing the patch into two separate changes to solve the two described issues independently?


The both tow issues have the same cause: the check is genereated too late. Now it is generated during contructor generation. For arrays it means that every array element gets its own check. For types like vectors with required alignment it means no check at all, because technically such type do not have a constructor. If the check is generated earlier, while processing 'new' expression, both the problems are solved. But in this case we need to inform `EmitCXXConstructorCall` that the checks are already generated, because this function may be called in cases other than 'new' expression.


Repository:
  rC Clang

https://reviews.llvm.org/D49589





More information about the cfe-commits mailing list