зеркало из https://github.com/microsoft/clang-1.git
When emitting l-values for bool non-__block decl references, make a pointer
using the memory type; fixes an assert. Fixes rdar://problem/8605032 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117610 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
b14eed0ed4
Коммит
46ec70e2e6
|
@ -611,7 +611,7 @@ llvm::Value *CodeGenFunction::GetAddrOfBlockDecl(const ValueDecl *VD,
|
|||
if (VD->getType()->isReferenceType())
|
||||
V = Builder.CreateLoad(V);
|
||||
} else {
|
||||
const llvm::Type *Ty = CGM.getTypes().ConvertType(VD->getType());
|
||||
const llvm::Type *Ty = CGM.getTypes().ConvertTypeForMem(VD->getType());
|
||||
Ty = llvm::PointerType::get(Ty, 0);
|
||||
V = Builder.CreateBitCast(V, Ty);
|
||||
if (VD->getType()->isReferenceType())
|
||||
|
|
|
@ -33,3 +33,10 @@ typedef double ftype(double);
|
|||
ftype ^test2 = ^ftype {
|
||||
return 0;
|
||||
};
|
||||
|
||||
// rdar://problem/8605032
|
||||
void f3_helper(void (^)(void));
|
||||
void f3() {
|
||||
_Bool b = 0;
|
||||
f3_helper(^{ if (b) {} });
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче