mirror of
https://github.com/ocornut/imgui.git
synced 2026-09-26 16:05:45 +03:00
Misc: fixed strict aliasing violation in ImHashData(). (#9557)
The SSE4.2 path read the input through an `ImU32` pointer but callers hash floats, pointers and structs. With clang 23 and LTO (such as `-O2 -msse4.2 -flto -fuse-ld=lld`) the float stores in `ImFontAtlasBakedGetId()` were optimized away, so every size of a font got the same `BakedId`.
This commit is contained in:
parent
aa0181478b
commit
3831352fa4
1 changed files with 1 additions and 1 deletions
|
|
@ -2493,7 +2493,7 @@ ImGuiID ImHashData(const void* data_p, size_t data_size, ImGuiID seed)
|
|||
#else
|
||||
while (data + 4 <= data_end)
|
||||
{
|
||||
crc = _mm_crc32_u32(crc, *(ImU32*)data);
|
||||
ImU32 v; memcpy(&v, data, sizeof(v)); crc = _mm_crc32_u32(crc, v);
|
||||
data += 4;
|
||||
}
|
||||
while (data < data_end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue