From: Duncan Sands Date: Wed, 20 Oct 2010 08:21:16 +0000 (+0000) Subject: GCC 4.4 warns that Receiver may be used uninitialized in this function. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54bd4577762228fdca4367dbc3af5e13e7f21389;p=clang GCC 4.4 warns that Receiver may be used uninitialized in this function. As far as I can see, gcc is right to think this! The following change will cause a nice segfault rather than undefined behaviour if this case occurs. Someone who understands what this code is supposed to do should probably take a proper look. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116917 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index 0e81df72c5..eac652c103 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -1213,7 +1213,7 @@ Stmt *RewriteObjC::RewritePropertyOrImplicitSetter(BinaryOperator *BinOp, Expr * ObjCMethodDecl *OMD = 0; QualType Ty; Selector Sel; - Stmt *Receiver; + Stmt *Receiver = 0; bool Super = false; QualType SuperTy; SourceLocation SuperLocation;