<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/120709>120709</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc] Suspected strict aliasing violation in string_length_wide_read
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Voultapher
</td>
</tr>
</table>
<pre>
The following code in libc:
https://github.com/llvm/llvm-project/blob/b41240be6b9e58687011b2bd1b942c6625cbb5ad/libc/src/string/string_utils.h#L65
invokes what I understand to be strict aliasing UB. I think block reads would have to go through `memcpy`/`__builtin_memcpy` which can then be optimized by the compiler as appropriate.
Tagging @michaelrj-google.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUkk1v3CwQxz8NvoxiYYyxffDhiaKVIj23pr2uAM-aSbCxAO8q_fQVmzQ99FQJMbxoXv76_XVKtGyIE-seWfdU6SO7EKcf4fBZ7w5jZcL8Pr04hEvwPtxoW8CGGYE28GQsa_9jvCyX857KTZyYOC2U3WFqG1YmTt5ff4eHPYZXtJmJk_HBlCAbIblBZUbsBjX0vGmMMHNjRimsUqKzxnR6LgVKP3FK8b7nSNvydTgfmXyqHRPt_6r7GIm2a3jDBDenMzzDsc0YU9bbDDmAQSiZNoP2pFPR9f2xhmfIjrY3MD7YN4io5wS3cPgZnL5iSVwCZBfDsThgiq-42v2dKV50K34-m4N8pu389QE3R9aB1Rtkh1tpHPZMK_3EGcx7eQQb1p08RtAJ9L7HsEfSGesPHS96Wcp8TPKVrNPo4-vDEsLisa7mqZ3HdtQVTk3fSjWMspeVm7BXg9ScC9ujukijWtPZ8dLazlx6y21Fk-BCNkLwhjdNI2vJh34YhBWohFCtZZLjqsnXBVwd4lJRSgdOjeA9HyuvDfp0N44QH2hEsVCc7qDNsSQmuaeU058KmbK_m-2e0D3BtyPtaDPOf9G4UvA6U9iK1T4he9yW7M43mvFc2FRH9NM_O-8uIzFx-lRyncSvAAAA__8pwP9a">