зеркало из https://github.com/microsoft/clang-1.git
Fix for PR5454: make sure to use the right block as the predecessor in the
generated PHI node for the null check of a new operator. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86738 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
69a2c268db
Коммит
7f1de456fe
|
@ -218,6 +218,7 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
|
||||||
|
|
||||||
if (NullCheckResult) {
|
if (NullCheckResult) {
|
||||||
Builder.CreateBr(NewEnd);
|
Builder.CreateBr(NewEnd);
|
||||||
|
NewNotNull = Builder.GetInsertBlock();
|
||||||
EmitBlock(NewNull);
|
EmitBlock(NewNull);
|
||||||
Builder.CreateBr(NewEnd);
|
Builder.CreateBr(NewEnd);
|
||||||
EmitBlock(NewEnd);
|
EmitBlock(NewEnd);
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
// RUN: clang-cc -emit-llvm-only -verify %s
|
||||||
|
// PR5454
|
||||||
|
|
||||||
|
class X {static void * operator new(unsigned size) throw(); X(int); };
|
||||||
|
int a(), b();
|
||||||
|
void b(int x)
|
||||||
|
{
|
||||||
|
new X(x ? a() : b());
|
||||||
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче