- Detect unaligned loads #1951.

- Fix issue where aligned bitstructs did not store/load with the given alignment.
This commit is contained in:
Christoffer Lerno
2025-02-10 22:07:15 +01:00
parent 86680279fa
commit 79a4b6855b
11 changed files with 190 additions and 17 deletions

View File

@@ -108,7 +108,7 @@ macro @i(x, y, z) => y ^ (x | ~z);
macro @step(#f, a, b, c, d, ptr, n, t, s)
{
*a += #f(b, c, d) + *(uint *)&ptr[n * 4] + t;
*a += #f(b, c, d) + @unaligned_load(*(uint *)&ptr[n * 4], 2) + t;
*a = (*a << s) | ((*a & 0xffffffff) >> (32 - s));
*a += b;
}