[PATCH] [clang/asan] call __asan_poison_cxx_array_cookie after operator new[]

Richard Smith richard at metafoo.co.uk
Mon Aug 25 16:10:06 PDT 2014


================
Comment at: lib/CodeGen/ItaniumCXXABI.cpp:1480
@@ +1479,3 @@
+  llvm::Instruction *SI = CGF.Builder.CreateStore(NumElements, NumElementsPtr);
+  if (CGM.getLangOpts().Sanitize.Address && expr->getNumPlacementArgs() == 0) {
+    CGM.getSanitizerMetadata()->disableSanitizerForInstruction(SI);
----------------
Use `expr->getOperatorNew()->isReplaceableGlobalAllocationFunction()` here, so that you also sanitize `new (std::nothrow) X[n]`.

http://reviews.llvm.org/D4774






More information about the cfe-commits mailing list