mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Avoid SIGBUS error in the MD5 implementation on ARMv7 (armhf)
Encountered in the test-suite run. This is just a workaround; the implementation needs to be reworked/replaced to accommodate alignment-sensitive architectures.
This commit is contained in:
parent
eab11c247c
commit
4050c645ac
1 changed files with 7 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2010 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -56,7 +56,13 @@ void MD5::UpdateRest(const u8* data, size_t len)
|
|||
// Process whole chunks of the input
|
||||
while (len >= CHUNK_SIZE)
|
||||
{
|
||||
#if defined(__ARM_ARCH_7A__)
|
||||
// Avoid SIGBUS on alignment-sensitive architecture
|
||||
memcpy(m_Buf, data, CHUNK_SIZE);
|
||||
Transform((const u32*)m_Buf);
|
||||
#else
|
||||
Transform((const u32*)data); // assumes little-endian; ignores alignment
|
||||
#endif
|
||||
data += CHUNK_SIZE;
|
||||
len -= CHUNK_SIZE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue