diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp index 2ec60e4c123d5e..1fa95b4ebee19a 100644 --- a/libunwind/src/UnwindCursor.hpp +++ b/libunwind/src/UnwindCursor.hpp @@ -230,8 +230,8 @@ void DwarfFDECache::iterateCacheEntries(void (*func)( } #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) - -#define arrayoffsetof(type, index, field) ((size_t)(&((type *)0)[index].field)) +#define arrayoffsetof(type, index, field) \ + (sizeof(type) * (index) + offsetof(type, field)) #if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND) template class UnwindSectionHeader {