<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-2022-jp"><base href="x-msg://934/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 15, 2013, at 10:59 , Dennis Cote <<a href="mailto:DennisC@harding.ca">DennisC@harding.ca</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-CA" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Hi,<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I have a case where the static analyzer produced a false positive report of a null pointer dereference. I am reporting this because it seems to indicate an error in the logic of the checker. It has assumed two different values for the same variable at different points along the path is used to generate the report.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I have copied the relevant section of the HTML report below. At step 1 it assumes Cept_configuration is not null. At step 15 it assumes the same variable is now null (i.e. in contradiction to its previous assumption). This variable is not modified by the code between these two points. The reported error at step 18 is a direct result of the incorrect assumption at step 15.</div></div></div></blockquote></div><br><div>Hi, Dennis. Your HTML got pretty mangled in my mail client, but I would guess your problem is that Cept_configuration is a global variable. Because of this, the analyzer can't actually be sure that none of the functions you call between step 1 and step 15 aren't going to modify it. It looks like you can't just make the global variable const, so you'll probably have to introduce a local variable to let the analyzer know what's going on.</div><div><br></div><div>We've had reports like this before, but until we have some notion of function summaries / whole-program analysis, we're not going to be able to do much here. And that's a big project, so...well, don't hold your breath.</div><div><br></div><div>Jordan</div></body></html>