diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-12-05 08:30:59 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-12-05 08:30:59 +0000 |
| commit | f03bd30854adf16bc30fce18120ef5f31954275e (patch) | |
| tree | 5759e1b3762dd5c08f4bdec0e6b220248d94054f /clang/lib/Sema/SemaExprCXX.cpp | |
| parent | 9ef5775a949d2c78ba01169d0eca962f5d7c1ae7 (diff) | |
| download | bcm5719-llvm-f03bd30854adf16bc30fce18120ef5f31954275e.tar.gz bcm5719-llvm-f03bd30854adf16bc30fce18120ef5f31954275e.zip | |
PR17983: Fix crasher bug in C++1y mode when performing a non-global array
delete on a class which has no array cookie and has no class-specific operator
new.
llvm-svn: 196488
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 95a5cbb20ee..b2f740e8044 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -2233,8 +2233,7 @@ bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD, return true; } - // Look for a global declaration. - Operator = FindUsualDeallocationFunction(StartLoc, true, Name); + Operator = 0; return false; } @@ -2384,7 +2383,7 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal, // Otherwise, the usual operator delete[] should be the // function we just found. - else if (isa<CXXMethodDecl>(OperatorDelete)) + else if (OperatorDelete && isa<CXXMethodDecl>(OperatorDelete)) UsualArrayDeleteWantsSize = (OperatorDelete->getNumParams() == 2); } |

