<html>
<head>
<base href="https://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 --- - Spurious use after free warning when using %p"
href="https://llvm.org/bugs/show_bug.cgi?id=26451">26451</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Spurious use after free warning when using %p
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</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>sitsofe@yahoo.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Depends on</th>
<td>26221
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=15814" name="attach_15814" title="C program that demonstrates spurious use after free warning">attachment 15814</a> <a href="attachment.cgi?id=15814&action=edit" title="C program that demonstrates spurious use after free warning">[details]</a></span>
C program that demonstrates spurious use after free warning
Description of the problem:
Code that prints the address of a pointer after the memory has been freed
triggers a "Use of memory after it is freed" warning even though the pointer
itself is not dereferenced.
Steps to reproduce:
1. Compile the attached C program using
scan-build cc -O1 spurious-printf-use-after-free.c -c
Expected results:
No warnings.
Actual results:
# scan-build: Using '/usr/bin/clang' for static analysis
spurious-printf-use-after-free.c:11:2: warning: Use of memory after it is freed
printf("%p\n", (void *)p);
^~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Additional information:
This problem was identified by Barry Davis of StorMagic.
Version information:
llvm-3.7.0-3.fc23.x86_64
clang version 3.7.0 (tags/RELEASE_370/final)
Target: x86_64-redhat-linux-gnu
Thread model: posix</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>