<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:george.burgess.iv@gmail.com" title="George Burgess <george.burgess.iv@gmail.com>"> <span class="fn">George Burgess</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - __builtin_object_size is not consistently conservative with C++ inheritance"
href="https://llvm.org/bugs/show_bug.cgi?id=26741">bug 26741</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>ASSIGNED
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>WONTFIX
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - __builtin_object_size is not consistently conservative with C++ inheritance"
href="https://llvm.org/bugs/show_bug.cgi?id=26741#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WONTFIX - __builtin_object_size is not consistently conservative with C++ inheritance"
href="https://llvm.org/bugs/show_bug.cgi?id=26741">bug 26741</a>
from <span class="vcard"><a class="email" href="mailto:george.burgess.iv@gmail.com" title="George Burgess <george.burgess.iv@gmail.com>"> <span class="fn">George Burgess</span></a>
</span></b>
<pre>So, I abandoned the revision for a few reasons:
- Having this detection would reduce our accuracy
- GCC 4.8 acts just as we do, and there hasn't seemed to be a problem with that
yet
- There's a reasonably straightforward workaround if you do encounter this
behavior [1] (...and I doubt it would be encountered often)
If you strongly disagree, feel free to reopen this bug+code review. :)
[1] -
void test3() {
struct A { int i; char buf[1]; };
struct B : A {};
struct C { int i; B bs[1]; } *c;
// Delegates to @llvm.objectsize on trunk, because you've casted to an A*.
gi = __builtin_object_size(&((A*)&c->bs)->buf[0], 1);
}</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>