[cfe-commits] r169908 - in /cfe/trunk: lib/AST/ASTContext.cpp test/CodeGenObjC/block-byref-variable-layout.m
Fariborz Jahanian
fjahanian at apple.com
Tue Dec 11 11:58:01 PST 2012
Author: fjahanian
Date: Tue Dec 11 13:58:01 2012
New Revision: 169908
URL: http://llvm.org/viewvc/llvm-project?rev=169908&view=rev
Log:
objective-C blocks: Check for record type when deciding if
byref variable requires extended layout info. to prevent
a crash involving arrays declared __block. // rdar://12787751
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
cfe/trunk/test/CodeGenObjC/block-byref-variable-layout.m
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=169908&r1=169907&r2=169908&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Dec 11 13:58:01 2012
@@ -4413,7 +4413,7 @@
return false;
HasByrefExtendedLayout = false;
- if (Ty->isAggregateType()) {
+ if (Ty->isRecordType()) {
HasByrefExtendedLayout = true;
LifeTime = Qualifiers::OCL_None;
}
Modified: cfe/trunk/test/CodeGenObjC/block-byref-variable-layout.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/block-byref-variable-layout.m?rev=169908&r1=169907&r2=169908&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/block-byref-variable-layout.m (original)
+++ cfe/trunk/test/CodeGenObjC/block-byref-variable-layout.m Tue Dec 11 13:58:01 2012
@@ -40,3 +40,10 @@
};
c();
}
+
+// rdar://12787751
+typedef char mds_path_t[1024];
+void directVolumePerfWaitForStoreState()
+{
+ __block mds_path_t path;
+}
More information about the cfe-commits
mailing list