Skip to content
Snippets Groups Projects
Commit 1a835b5d authored by Filipe Cabecinhas's avatar Filipe Cabecinhas
Browse files

Revert "ASan+operator new[]: Fix operator new[] cookie poisoning"

This reverts r321645.

I missed a compiler-rt test that needs updating.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321647 91177308-0d34-0410-b5e6-96231b3b80d8
parent ec6c5b21
No related branches found
No related tags found
No related merge requests found
...@@ -1847,7 +1847,8 @@ Address ItaniumCXXABI::InitializeArrayCookie(CodeGenFunction &CGF, ...@@ -1847,7 +1847,8 @@ Address ItaniumCXXABI::InitializeArrayCookie(CodeGenFunction &CGF,
llvm::Instruction *SI = CGF.Builder.CreateStore(NumElements, NumElementsPtr); llvm::Instruction *SI = CGF.Builder.CreateStore(NumElements, NumElementsPtr);
// Handle the array cookie specially in ASan. // Handle the array cookie specially in ASan.
if (CGM.getLangOpts().Sanitize.has(SanitizerKind::Address) && AS == 0) { if (CGM.getLangOpts().Sanitize.has(SanitizerKind::Address) && AS == 0 &&
expr->getOperatorNew()->isReplaceableGlobalAllocationFunction()) {
// The store to the CookiePtr does not need to be instrumented. // The store to the CookiePtr does not need to be instrumented.
CGM.getSanitizerMetadata()->disableSanitizerForInstruction(SI); CGM.getSanitizerMetadata()->disableSanitizerForInstruction(SI);
llvm::FunctionType *FTy = llvm::FunctionType *FTy =
......
...@@ -7,7 +7,7 @@ namespace std { ...@@ -7,7 +7,7 @@ namespace std {
std::nothrow_t nothrow; std::nothrow_t nothrow;
} }
void *operator new[](size_t, const std::nothrow_t &) throw(); void *operator new[](size_t, const std::nothrow_t &) throw();
void *operator new[](size_t, void *); void *operator new[](size_t, char *);
struct C { struct C {
int x; int x;
...@@ -53,11 +53,3 @@ C *CallPlacementNew() { ...@@ -53,11 +53,3 @@ C *CallPlacementNew() {
} }
// ASAN-LABEL: CallPlacementNew // ASAN-LABEL: CallPlacementNew
// ASAN-NOT: __asan_poison_cxx_array_cookie // ASAN-NOT: __asan_poison_cxx_array_cookie
void *operator new[](size_t n, int);
C *CallNewWithArgs() {
// ASAN-LABEL: CallNewWithArgs
// ASAN: call void @__asan_poison_cxx_array_cookie
return new (123) C[20];
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment