<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:gonzalo.gadeschi@gmail.com" title="Gonzalo BG <gonzalo.gadeschi@gmail.com>"> <span class="fn">Gonzalo BG</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - std::memcpy with incorrect align attribute on arguments introduces undefined behavior"
href="https://bugs.llvm.org/show_bug.cgi?id=49708">bug 49708</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>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>INVALID
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - std::memcpy with incorrect align attribute on arguments introduces undefined behavior"
href="https://bugs.llvm.org/show_bug.cgi?id=49708#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - std::memcpy with incorrect align attribute on arguments introduces undefined behavior"
href="https://bugs.llvm.org/show_bug.cgi?id=49708">bug 49708</a>
from <span class="vcard"><a class="email" href="mailto:gonzalo.gadeschi@gmail.com" title="Gonzalo BG <gonzalo.gadeschi@gmail.com>"> <span class="fn">Gonzalo BG</span></a>
</span></b>
<pre>I hope this makes it clearer. The above example is equivalent to:
char h(char* ptr) {
ptr = (char*)(int*)ptr;
return *ptr;
}
<span class="quote">> A pointer to an integer is 4-byte aligned:</span >
A load through a pointer to an integer can assume 4-byte alignment.
In the functions f, g, and h that I've shown, there are no such loads anywhere.
h loads through a char*, and f loads through an unsigned char* inside
std::memcpy according to the memcpy spec.</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>