<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Patch looks good with couple of minors.<div>Provide a note where receiver/argument has been declared.</div><div>Place CheckObjCCircularContainer(Result) right after <span style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px;">checkRetainCycles</span><span style="font-family: Menlo; font-size: 11px;">(Result).</span></div><div><span style="font-family: Menlo; font-size: 11px;"><br></span></div><div><span style="font-family: Menlo; font-size: 11px;">- Fariborz</span></div><div><span style="font-family: Menlo; font-size: 11px;"><br></span></div><div><br><div><div>On Mar 2, 2015, at 1:28 PM, Alexey Denisov <<a href="mailto:1101.debian@gmail.com">1101.debian@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">The patch adds new warning to prevent user from creating 'circular containers'.<br>Mutable collections from NSFoundation allows user to add collection to itself, e.g.:<br><br>NSMutableArray *a = [NSMutableArray new];<br>[a addObject:a];<br><br>The code above leads to really weird behaviour (crashes, 'endless' recursion) and retain cycles (collection retains itself) and it's really hard to debug and fix.<br>This which is really hard to debug in a real application.<br><br>Patch checks the following collections: NSMutableArray, NSMutableDictionary, NSMutableSet, NSMutableOrderedSet, NSCountedSet.<br><br>P.S. any suggestions for better wordings and methods/warning names - are welcome.<br><br><a href="http://reviews.llvm.org/D8014">http://reviews.llvm.org/D8014</a><br><br>Files:<br>  include/clang/AST/NSAPI.h<br>  include/clang/Basic/DiagnosticSemaKinds.td<br>  include/clang/Sema/Sema.h<br>  lib/AST/NSAPI.cpp<br>  lib/Sema/SemaChecking.cpp<br>  lib/Sema/SemaExprObjC.cpp<br>  test/SemaObjC/circular-container.m<br><br>EMAIL PREFERENCES<br>  http://reviews.llvm.org/settings/panel/emailpreferences/<br><span><D8014.21034.patch></span>_______________________________________________<br>cfe-commits mailing list<br>cfe-commits@cs.uiuc.edu<br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></blockquote></div><br></div></body></html>