]> granicus.if.org Git - clang/commitdiff
GCC 4.4 warns that Receiver may be used uninitialized in this function.
authorDuncan Sands <baldrick@free.fr>
Wed, 20 Oct 2010 08:21:16 +0000 (08:21 +0000)
committerDuncan Sands <baldrick@free.fr>
Wed, 20 Oct 2010 08:21:16 +0000 (08:21 +0000)
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

lib/Rewrite/RewriteObjC.cpp

index 0e81df72c595e7a2c14c6a9169fa77d9c96bb9d3..eac652c10329a830a75c14fa14e75b6220529ddb 100644 (file)
@@ -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;