<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 --- - UBSan: emit checks that use ASan shadow to detect pointers past the last array element"
href="http://llvm.org/bugs/show_bug.cgi?id=19811">19811</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>UBSan: emit checks that use ASan shadow to detect pointers past the last array element
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>glider@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>kcc@google.com, llvmbugs@cs.uiuc.edu, nlewycky@google.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Per §5.7 ¶5 of the C++11 Standard an pointer into array P[N] cannot point past
P + N (although P + N does not belong to the array).
The idea is to make UBSan check operations on array pointer variables to make
sure they're pointing into the arrays or one element past the end of the
arrays. For the following pointer operations:
P = P + diff
P = P - diff
if (P ? Q) {} // for !=, ==, >, <, >=, <= comparisons
the frontend should emit calls to a function that makes the following check
based on ASan shadow:
if P is not close to 0 {
if P is not addressable {
if P-1 is not addressable {
report error;
}
}
}
return;</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>