<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - False positive on variable value"
href="https://bugs.llvm.org/show_bug.cgi?id=33137">33137</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>False positive on variable value
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>4.0
</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>normal
</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>natale.patriciello@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=18493" name="attach_18493" title="The false positive report">attachment 18493</a> <a href="attachment.cgi?id=18493&action=edit" title="The false positive report">[details]</a></span>
The false positive report
In the source generated by the asn1c compiler, there is the function
der_write_tags. In this, the point 6 is (Assuming 'i' is >= 'tags_count'),
where i is 1. It means that tags_count < 1 (tags_count is an int).
Then, at line 140, there is this cycle:
140 for(i = tags_count - 1; i >= 0; --i) {
where the line (Assuming 'i' is >= 0) is printed two times. Giving the previous
assumption, this is clearly impossible.
I tried to make a small example, but I've failed; it seems that in simple
functions this is well understood by the analyzer.</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>