1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-26 17:17:39 +01:00

Account for possible unaligned access.

This commit is contained in:
Konstantin Belousov 2010-04-21 15:18:02 +03:00
parent 74677edb23
commit 4454413242
2 changed files with 3 additions and 3 deletions

View file

@ -88,7 +88,7 @@ validate_mem (unw_word_t addr)
{
int i, victim;
#ifdef HAVE_MINCORE
char mvec[1];
char mvec[2]; /* Unaligned access may cross page boundary */
#endif
addr = PAGE_START(addr);

View file

@ -87,7 +87,7 @@ validate_mem (unw_word_t addr)
{
int i, victim;
#ifdef HAVE_MINCORE
char mvec[1];
char mvec[2]; /* Unaligned access may cross page boundary */
#endif
addr = PAGE_START(addr);
@ -102,7 +102,7 @@ validate_mem (unw_word_t addr)
}
#ifdef HAVE_MINCORE
if (mincore ((void *) addr, 1, mvec) == -1)
if (mincore ((void *) addr, sizeof (unw_word_t), mvec) == -1)
#else
if (msync ((void *) addr, 1, MS_ASYNC) == -1)
#endif