<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 30.03.2013 1:01, Jordan Rose wrote:<br>
</div>
<blockquote
cite="mid:523C81FC-9CDB-48AE-B253-2C6067A909FA@apple.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<br>
<div>
<div>On Mar 29, 2013, at 13:50 , Anna Zaks <<a
moz-do-not-send="true" href="mailto:ganna@apple.com">ganna@apple.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-family: Helvetica; font-size: 12px;
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;">
<div><br class="Apple-interchange-newline">
On Mar 29, 2013, at 11:57 AM, Anton Yartsev <<a
moz-do-not-send="true"
href="mailto:anton.yartsev@gmail.com">anton.yartsev@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div text="#000000" bgcolor="#FFFFFF"
style="letter-spacing: 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;">
<div class="moz-cite-prefix">On 29.03.2013 22:04, Anna
Zaks wrote:<br>
</div>
<blockquote
cite="mid:2EFF8687-A4B9-4750-AEDD-718D8F4ED633@apple.com"
type="cite"><br>
<div>
<div>On Mar 28, 2013, at 5:42 PM, Anton Yartsev <<a
moz-do-not-send="true"
href="mailto:anton.yartsev@gmail.com">anton.yartsev@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="letter-spacing: 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;">
<blockquote type="cite">
<blockquote type="cite">Evolved one more
problem to solve: if overloaded standard
operator new is defined and is called as a
function, then it is not recognized as
overloaded operator for some reason. Tests
testOpNewArray() and testOpNew() in
NewDelete-custom.cpp cover these issue.<br>
</blockquote>
<br>
You can check if it has to do with
redeclarations of the allocator function, but
I wouldn't expect that. Definitely something
we need to fix before putting out another
open-source checker build.<br>
</blockquote>
Addressed the issue. Actually the problem is
caused by the fact, that overloaded operator new
was inlined and has not been processed by
checkPostStmt(const CallExpr) at all as it skips
inlined calls.<br>
What Is the reason for skipping inline calls?<br>
<br>
</div>
</blockquote>
<br>
The idea is that if a function has been inlined, it
will be modeled through inlining where we will know
exactly what it does. </div>
<div><br>
</div>
<div>It is unclear if we should enforce the
malloc/free, new/delete rules on inlined functions.
For example, in this case, if someone overloaded the
operator new, do we want to ensure that delete was
called on the object regardless of what new's custom
implementation is?</div>
</blockquote>
It seems to me that if we just simply handle inline
functions without analyzing the implementation</div>
</blockquote>
<div><br>
</div>
<div>Currently, C.wasInlined() == true means that we did
analyze the implementation.</div>
<br>
<blockquote type="cite">
<div text="#000000" bgcolor="#FFFFFF"
style="letter-spacing: 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;">it'll give less
false-positives then false-negatives if we just skip
them as most malloc/new functions are expected to
allocate memory. Or I haven't got something?<br>
</div>
</blockquote>
<div><br>
</div>
The implementation could be more precise in telling you what
happened (did the function allocate memory or not).</div>
<div style="font-family: Helvetica; font-size: 12px;
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;">You'd
get less false negatives if you just do not track regions
allocated by inlined functions - less tracking -> less
bug reports -> less false positives. No? However, you
might miss real bugs(have false negatives).</div>
</blockquote>
</div>
</blockquote>
I just wanted to say, that we likely to miss more real bugs if we
stay conservative then get false-positives if we handle inline
cases. Sorry for confusing :)<br>
<br>
<blockquote
cite="mid:523C81FC-9CDB-48AE-B253-2C6067A909FA@apple.com"
type="cite">
<div>
<blockquote type="cite">
<div style="font-family: Helvetica; font-size: 12px;
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;"><br>
</div>
<div style="font-family: Helvetica; font-size: 12px;
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;">Said
that, I do not think that the current decision is supported
by real world examples, as it should be….</div>
</blockquote>
<br>
</div>
<div>I agree with Anna: for now, we should be conservative and not
track things that come out of a custom definition of the global
operator new. We can revisit this later, since it's <i>usually</i> the
case that they should still be deleted, but for now let's keep
this behavior. You can change your test cases to just not
include the definition of the global operators, which matches
both libc++ and libstdc++.</div>
</blockquote>
<blockquote
cite="mid:523C81FC-9CDB-48AE-B253-2C6067A909FA@apple.com"
type="cite">
<div>Sorry for not noticing this sooner, which would have saved
you a little runaround.</div>
</blockquote>
<blockquote
cite="mid:523C81FC-9CDB-48AE-B253-2C6067A909FA@apple.com"
type="cite">
<div><br>
</div>
<div>Jordan</div>
<br>
</blockquote>
Committed as r178388.<br>
<br>
<pre class="moz-signature" cols="72">--
Anton</pre>
</body>
</html>