Fix bug in ivar align computation.
__builtin_clz takes an unsigned int, it isn't overloaded for different types. This meant that we were computing log2 by counting the leading bits in a 32-bit value and using that result as if it were the number of bits in a 64-bit value. This meant that our alignment values were 2^32 times as big as they should be. This mostly didn't matter, because we then truncated the result to 32 bits and the wrapping gave the correct answer. Unfortunately, this was undefined behaviour and, at sufficiently high optimisation levels, this resulted in the value being optimised away, leading to odd results.main
parent
5585a44574
commit
8db0450dcc
Loading…
Reference in New Issue