You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix __align_allocation_size for awkward char sizes
The ASan failure in CI complained that a buffer had been allocated as
7 chars (in the case where sizeof(char_type)==5) and freed as only 6.
That's because the test was running in a configuration with
__endian_factor==2, and __align_allocation_size is supposed to always
return an even number in that situation, and it wasn't.
Fixed by introducing a new more careful code path for non-power-of-2
char sizes, and also adjusting the caller so that it actually
remembers the value it got back from __align_allocation_size, to pass
the same value to free later.
(I'm also suspicious of the __allocate_at_least call, which isn't
using the returned count field. That too might be odd, which would
stop us from storing it in the __long size field. At the moment this
isn't failing because __allocate_at_least never allocates more than
it's asked to.)
0 commit comments