<div dir="ltr"><span style="font-size:12.800000190734863px">Hi Hans,</span><div style="font-size:12.800000190734863px"><div><br></div><div>Would it be possible to merge this for 4.0?</div></div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">Cheers,</div><div style="font-size:12.800000190734863px">Alex</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 February 2017 at 17:37, Alex Lorenz via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: arphaman<br>
Date: Wed Feb 1 11:37:28 2017<br>
New Revision: 293787<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=293787&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=293787&view=rev</a><br>
Log:<br>
[CodeGen][ObjC] Avoid asserting on block pointer types in<br>
isPointerZeroInitializable<br>
<br>
rdar://30111891<br>
<br>
Added:<br>
cfe/trunk/test/CodeGenObjC/<wbr>block-ptr-type-crash.m<br>
Modified:<br>
cfe/trunk/lib/CodeGen/<wbr>CodeGenTypes.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/<wbr>CodeGenTypes.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.cpp?rev=293787&r1=293786&r2=293787&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/CodeGen/<wbr>CodeGenTypes.cpp?rev=293787&<wbr>r1=293786&r2=293787&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/CodeGen/<wbr>CodeGenTypes.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/<wbr>CodeGenTypes.cpp Wed Feb 1 11:37:28 2017<br>
@@ -738,7 +738,7 @@ CodeGenTypes::<wbr>getCGRecordLayout(const Re<br>
}<br>
<br>
bool CodeGenTypes::<wbr>isPointerZeroInitializable(<wbr>QualType T) {<br>
- assert (T->isAnyPointerType() && "Invalid type");<br>
+ assert((T->isAnyPointerType() || T->isBlockPointerType()) && "Invalid type");<br>
return isZeroInitializable(T);<br>
}<br>
<br>
<br>
Added: cfe/trunk/test/CodeGenObjC/<wbr>block-ptr-type-crash.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/block-ptr-type-crash.m?rev=293787&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>CodeGenObjC/block-ptr-type-<wbr>crash.m?rev=293787&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGenObjC/<wbr>block-ptr-type-crash.m (added)<br>
+++ cfe/trunk/test/CodeGenObjC/<wbr>block-ptr-type-crash.m Wed Feb 1 11:37:28 2017<br>
@@ -0,0 +1,28 @@<br>
+// RUN: %clang_cc1 -Wno-objc-root-class -fblocks -o /dev/null -triple x86_64-- -emit-llvm %s<br>
+// REQUIRES: asserts<br>
+// Verify there is no assertion.<br>
+<br>
+// rdar://30111891<br>
+<br>
+typedef unsigned long long uint64_t;<br>
+typedef enum AnEnum : uint64_t AnEnum;<br>
+enum AnEnum: uint64_t {<br>
+ AnEnumA<br>
+};<br>
+<br>
+typedef void (^BlockType)();<br>
+@interface MyClass<br>
+@end<br>
+@implementation MyClass<br>
+- (void)_doStuff {<br>
+ struct {<br>
+ int identifier;<br>
+ AnEnum type;<br>
+ BlockType handler;<br>
+ } var = {<br>
+ "hello",<br>
+ AnEnumA,<br>
+ ((void *)0)<br>
+ };<br>
+}<br>
+@end<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>