<div class="gmail_quote">W dniu 3 listopada 2010 18:56 użytkownik Ted Kremenek <span dir="ltr"><<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>></span> napisał:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Marcin,<br>
<br>
I think these are great ideas.  Comments inline.<br>
<div class="im"><br>
On Nov 3, 2010, at 3:04 AM, Marcin Świderski <<a href="mailto:marcin.sfider@gmail.com">marcin.sfider@gmail.com</a>> wrote:<br>
<br>
> I'm going to add some checks for C++ that will check for:<br>
> - uninitialized object members,<br>
<br>
</div>This seems like a path-sensitive check that requires inter-procedural analysis of constructor calls.<br>
<div class="im"> </div></blockquote><div>Why the inter-procedural analysis of constructor calls? We can safly assume that constructor initializes all members, and then require the same from the analyzed constructor.</div>
<div><br></div><div>And what is the current support for inter-procedural analysis?</div><meta charset="utf-8"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">
> - problems in ctors derived from order of initialization,<br>
<br>
</div>Another path-sensitive check.  What do you mean by "problems"?<br></blockquote><div><br></div><div>In general, situations when order of evaluation of some side-effects in initializers is different in source code then in reality. Such situation can be errornous. We can of course provide a check for initializers ordered differently then members, but this does not</div>
<div>solve the problem. After ordering initializers we loose information about probable intentions of the programmer (assuming the intentions to be invalid).</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"><br>
> - absence of virtual destructor when needed,<br>
> - virtual method calls in ctors/dtors,<br>
> - some const-correctness.<br>
<br>
</div>It's not clear to me that these are path-sensitive checks, or even require flow analysis.<br>
<div class="im"><br></div></blockquote><div>For virtual calls we could probably use path-sensitive engine for:</div><div>- Checking when method is called on /this/. Should be trival most of the time, but if someone will use method returning /this/ for silencing compiler warnings in initialization list it stops to be trivial,</div>
<div>- Inter-procedural analysis.</div><div><br></div><div>Rest can be done on AST alright.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">

><br>
> I'll try to use the path-sensitive engine for some of them, extending it in the process, but I'm not sure if I'll make it. I'm doing this for my masters thesis and don't have much time, so I will be able to share my work probably in a month or so. If someone want to work on C++ in the path-sensitive engine during this time I'll contribute just the checks.<br>

<br>
</div>The constructor checking is probably the most interesting, but probably the hardest to do.  It also requires the most amount of new pieces working.<br>
<br>
The good thing about the analyzer is that, unlike the compiler, you can skip analyzing entire swaths of code (if the engine isn't ready) and still find bugs.</blockquote></div><br>