<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div><br>It is defined extern const Int 32.<br><br> BRs</div><div><div>
<div>Howard Ling </div>
<div>*****************************************************</div>
<div> </div>
<div>E-mail: <a href="mailto:linghuan713@126.com">linghuan713@126.com</a></div>
<div> </div>
<div>*****************************************************</div></div></div><div id="divNeteaseMailCard"></div><div></div>ÔÚ 2013-08-03 09:12:56£¬"Jordan Rose" <jordan_rose@apple.com> дµÀ£º<br> <blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" id="isReplyContent"><br><div><div>On Aug 2, 2013, at 4:08 , Á軶 <<a href="mailto:linghuan713@126.com">linghuan713@126.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height: 1.7; font-family: arial; font-size: 14px;"><div>HI, all :</div><div>Our developers says that if set NULL to the pointer ,it can be used after released , is it right ? Following the the code which is </div><div>reported by scan-build and the type is used after release , <strong>can anyone tell me how to fix the bug ?</strong></div><div><strong>Or is it the false positive ? </strong> please see the attathed .c file for the detail which is start line 896, end line 942.</div><div> Thanks all . </div></div></blockquote></div><br><div>The false positive comes from this line:</div><div><br></div><div><table style="width: 3446px; color: rgb(0, 0, 0); line-height: 1.2em; font-family: monospace, monospace; font-size: 13px; border-collapse: collapse;" class="code"><tbody><tr><td style="padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 3px; border-left-style: solid; white-space: pre;" class="line"> <span style="color: blue;" class="keyword">if</span>(JCE_SUCCESS != ret) { <span style="color: blue;" class="keyword">return</span> <span style="color: rgb(139, 0, 139); position: relative; background-color: rgb(255, 250, 205);" class="macro">NULL</span>; }</td></tr><tr></tr></tbody></table><br></div><div>For some reason, we think that ret == JCE_SUCCESS when the allocation fails, but the path clearly shows JCE_MALLOC_ERROR being returned. So now the only question is, why does the analyzer think JCE_MALLOC_ERROR and JCE_SUCCESS can be the same thing? Are they defined as "extern Int32" instead of constants?</div><div><br></div><div>Jordan</div></blockquote></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>