Requesting a port to the branch: this was breaking bootstrap from recent versions of gcc.<br><br><div class="gmail_quote">On Sun, Apr 29, 2012 at 5:16 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rsmith<br>
Date: Sun Apr 29 19:16:51 2012<br>
New Revision: 155803<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=155803&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=155803&view=rev</a><br>
Log:<br>
PR11926 + duplicates: Fix crash in -Wuninitialized when using a compiler like<br>
g++4.7, which reuses stack space allocated for temporaries. CFGElement::getAs<br>
returns a suitably-cast version of 'this'. Patch by Markus Trippelsdorf!<br>
<br>
No test: this code has the same observable behavior as the old code when built<br>
with most compilers, and the tests were already failing when built with a<br>
compiler for which this produced a broken binary.<br>
<br>
Modified:<br>
    cfe/trunk/lib/Analysis/UninitializedValues.cpp<br>
<br>
Modified: cfe/trunk/lib/Analysis/UninitializedValues.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/UninitializedValues.cpp?rev=155803&r1=155802&r2=155803&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/UninitializedValues.cpp?rev=155803&r1=155802&r2=155803&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Analysis/UninitializedValues.cpp (original)<br>
+++ cfe/trunk/lib/Analysis/UninitializedValues.cpp Sun Apr 29 19:16:51 2012<br>
@@ -168,7 +168,8 @@<br>
   if (block->empty())<br>
     return 0;<br>
<br>
-  const CFGStmt *cstmt = block->front().getAs<CFGStmt>();<br>
+  CFGElement front = block->front();<br>
+  const CFGStmt *cstmt = front.getAs<CFGStmt>();<br>
   if (!cstmt)<br>
     return 0;<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br>