[cfe-commits] r116917 - /cfe/trunk/lib/Rewrite/RewriteObjC.cpp
jahanian
fjahanian at apple.com
Wed Oct 20 09:09:37 PDT 2010
On Oct 20, 2010, at 1:21 AM, Duncan Sands wrote:
> Author: baldrick
> Date: Wed Oct 20 03:21:16 2010
> New Revision: 116917
>
> URL: http://llvm.org/viewvc/llvm-project?rev=116917&view=rev
> Log:
> 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.
Thanks for noticing this. Potential crash is fixed in r116928.
- Fariborz
>
> Modified:
> cfe/trunk/lib/Rewrite/RewriteObjC.cpp
>
> Modified: cfe/trunk/lib/Rewrite/RewriteObjC.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteObjC.cpp?rev=116917&r1=116916&r2=116917&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Rewrite/RewriteObjC.cpp (original)
> +++ cfe/trunk/lib/Rewrite/RewriteObjC.cpp Wed Oct 20 03:21:16 2010
> @@ -1213,7 +1213,7 @@
> ObjCMethodDecl *OMD = 0;
> QualType Ty;
> Selector Sel;
> - Stmt *Receiver;
> + Stmt *Receiver = 0;
> bool Super = false;
> QualType SuperTy;
> SourceLocation SuperLocation;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list