<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">> No. I meant add expected-note which will point to the declaration as part of the diagnostic.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Got it. New patch attached.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">> You mean you cannot add it after checkRetainCycles(Result); as in:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I can, but then it would be skipped for non-arc code, which still has this problem (not retain cycle, but ‘corruption’ at runtime).</div> <div id="bloop_sign_1425480471465657088" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>AlexDenisov</div><div style="font-family:helvetica,arial;font-size:13px">Software Engineer, <a href="http://alexdenisov.github.io"><span style="color: rgb(0, 0, 0);">http://alexdenisov.github.io</span></a></div></div> <br><p style="color:#000;">On 3 Mar 2015 at 22:27:09, jahanian (<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div><div>



<title></title>



<br>
<div>
<div>On Mar 3, 2015, at 12:33 PM, AlexDenisov <<a href="mailto:1101.debian@gmail.com">1101.debian@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
> Provide a note where receiver/argument has been
declared.</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">Do
you mean ‘add comments’?</div>
</div>
</blockquote>
<div><br></div>
No. I meant add expected-note which will point to the declaration
as part of the diagnostic.</div>
<div><br>
<blockquote type="cite">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
> Place CheckObjCCircularContainer(Result) right after
checkRetainCycles(Result).</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">It
still causes weird behaviour even without ARC. Of course there is
no retain cycle anymore, but app still hangs with
recursion/crash.</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
</div>
</blockquote>
<div><br></div>
You mean you cannot add it 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><font face="Menlo"><span style="font-size: 11px;">as
in:</span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div>
<div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(49, 89, 93);">
checkRetainCycles<span style="color: #000000">(Result);</span></div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(49, 89, 93);">
<span style="font-family: Helvetica, Arial; font-size: 13px;">CheckObjCCircularContainer(Result)
;</span></div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(49, 89, 93);">
<span style="font-family: Helvetica, Arial; font-size: 13px;"><br></span></div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(49, 89, 93);">
<div style="margin: 0px;"><span style="color: #bb2ca2">if</span>
(!isImplicit && Method) {</div>
<div style="margin: 0px;">      <span style="color: #bb2ca2">if</span> (<span style="color: #bb2ca2">const</span> <span style="color: #4f8187">ObjCPropertyDecl</span> *Prop =
Method->findPropertyDecl()) {</div>
<div style="margin: 0px;">        <span style="color: #bb2ca2">bool</span> IsWeak =</div>
<div style="margin: 0px;"><span style="color: #000000"> 
       
Prop-></span>getPropertyAttributes<span style="color: #000000">() &</span> <span style="color: #4f8187">ObjCPropertyDecl</span><span style="color: #000000">::</span>OBJC_PR_weak<span style="color: #000000">;</span></div>
<div style="margin: 0px;">        <span style="color: #bb2ca2">if</span> (!IsWeak &&
Sel.isUnarySelector())</div>
<div style="margin: 0px;">          IsWeak
= ReturnType.getObjCLifetime() & <span style="color: #4f8187">Qualifiers</span>::OCL_Weak;</div>
<div style="margin: 0px;">        <span style="color: #bb2ca2">if</span> (IsWeak &&</div>
<div style="margin: 0px;">           
!Diags.isIgnored(diag::warn_arc_repeated_use_of_weak,
LBracLoc))</div>
<div style="margin: 0px;">         
getCurFunction()->recordUseOfWeak(Result, Prop);</div>
<div style="margin: 0px;">      }</div>
<div style="margin: 0px;">    }</div>
<div style="margin: 0px;">  }</div>
<div style="margin: 0px;"><br></div>
<p style="margin: 0px; min-height: 13px;"> <span style="color: rgb(187, 44, 162);">return</span>
MaybeBindToTemporary<span style="color: rgb(0, 0, 0);">(Result);</span></p>
<p style="margin: 0px; min-height: 13px;">}</p>
<p style="margin: 0px; min-height: 13px;"> <br class="webkit-block-placeholder"></p>
<div><br></div>
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(49, 89, 93);">
<span style="color: #000000"><br></span></div>
<blockquote type="cite">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_customfont" style="margin: 0px;"><span style="font-family: Helvetica, Arial; font-size: 13px;">><span class="Apple-converted-space"> </span></span>This patch does not
address the general case of same expression used as receiver and
addObject argument.</div>
<div id="bloop_customfont" style="margin: 0px;">> Is this
something that you care enough to address?</div>
<div id="bloop_customfont" style="margin: 0px;">Do you mean
something like ’[self.array addObject:self.array]’?</div>
<div id="bloop_customfont" style="margin: 0px;">If so, then it
doesn’t really makes sense, because we can’t ensure that returned
objects are the same, there’ll be false positives.</div>
</div>
</blockquote>
<div><br></div>
Ok,</div>
<div>- Fariborz</div>
<div><br>
<blockquote type="cite">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_sign_1425414448608411136" class="bloop_sign">
<div style="font-family: helvetica, arial; font-size: 13px;">
-- <br>
AlexDenisov</div>
<div style="font-family: helvetica, arial; font-size: 13px;">
Software Engineer, <a href="http://alexdenisov.github.io/"><span style="">http://alexdenisov.github.io</span></a></div>
</div>
<br>
<p style="">On 3 Mar 2015 at 20:46:15, jahanian (<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>) wrote:</p>
<blockquote type="cite" class="clean_bq"><span><br></span>
<div>
<div><span>On Mar 3, 2015, at 11:02 AM, jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>>
wrote:</span></div>
<span><br class="Apple-interchange-newline"></span>
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span>Patch looks good with couple of minors.</span>
<div><span>Provide a note where receiver/argument has been
declared.</span></div>
<div><span>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></span></div>
</div>
</blockquote>
<div><br></div>
This patch does not address the general case of same expression
used as receiver and addObject argument.
<div>Is this something that you care enough to address? Need not be
in this patch though.</div>
<div><br></div>
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<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>
</blockquote>
</div>
<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">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></blockquote>
</div>
</blockquote>
</div>
<br>


</div></div></span></blockquote></body></html>