<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Add option to assume pointer is nullable when accessing unilaterally"
href="http://llvm.org/bugs/show_bug.cgi?id=18627">18627</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Add option to assume pointer is nullable when accessing unilaterally
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>kremenek@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>czchen@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Hi,
For the following code, static analyzer does not report potential error when x
is null.
void func(char *x)
{
strlen(x);
}
I know static analyzer is designed to assume x is non-null due to access
unilaterally because it trusts programmer. However, the problem is in large
legacy code base, programmer might not clearly know the precondition of a
function, or they might take faulty precondition. In these cases, assuming
programmer know what they do is probability not good to find this kind of
problem.
I wonder, is it possible to add a checker for directing pass pointer to nonnull
parameter without assert or if so that we can check for this kind of issue?
Thanks.
Regards,
ChangZhuo</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>