summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorNicky <nicky.dasmijn@posteo.nl>2024-04-10 21:02:40 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2025-03-11 03:21:43 +0200
commitf7e7903105f7df053bf259542553cefc6a9a6b27 (patch)
treeb544f7177e83e43e1ed0aba80f772aa7c31c3412 /etc
parenta925b178b0f5f1ec78b982945f9b4785b565c101 (diff)
Fix ASAN errors from LLVector4a::memcpyNonAliased16
Found by running with -fsanitze=thread Suggestion to avoid accessing invalid memory: In both cases memory will be allocated by can be accessed beyond bounds. In LLPolyMesh it can be off by at least one (+x%2). Though I am not even sure if even in best case it always will be a multiple of 16. In LLViewerJointMesh::updateFaceData the code tries to account for padding by, but the allocation in LLPolyMeshSharedData::allocateVertexData is done without any padding. Thus the sizes must not match. Replacing the calls with memcpy as a quick fix to see if the error goes away fixed address sanitzer complaining. It is up to debate if memcpy is a good replacement. LLVector4a::memcpyNonAliased16 was invented for performance. But on the other hand one could argue that nowadays every stdlib maintainer will very heavily optmize functions like memcpy themselves and could take advantage of CPU features the old LL implementation does not take into account. AVX comes to mind. In any case did I not measure any of this.
Diffstat (limited to 'etc')
0 files changed, 0 insertions, 0 deletions