<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 --- - scan-build misses escapes of stack addresses"
href="http://llvm.org/bugs/show_bug.cgi?id=16158">16158</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>scan-build misses escapes of stack addresses
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>rrh@newrelic.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>Created <span class=""><a href="attachment.cgi?id=10587" name="attach_10587" title="shows an escape of the same variable, once to a global, the other to a location in heap memory">attachment 10587</a> <a href="attachment.cgi?id=10587&action=edit" title="shows an escape of the same variable, once to a global, the other to a location in heap memory">[details]</a></span>
shows an escape of the same variable, once to a global, the other to a location
in heap memory
scan-build does not complain about escapes (dangling references) of addresses
of automatic variables (eg, stack variables) when those escapes end up in heap
storage. scan-build will, however, complain about dangling references held in
globals.
The attached program shows both kinds of escapes, and scan-build only complains
about one kind of escape:
test_escapes.c:14:27: warning: Address of stack memory associated with local
variable 'x' is still referred to by the global variable
'points_to_expired_frame' upon returning to the caller. This will be a
dangling reference</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>