Index: src/runtime/exception.m ================================================================== --- src/runtime/exception.m +++ src/runtime/exception.m @@ -336,12 +336,18 @@ static uint64_t readValue(uint8_t enc, const uint8_t **ptr) { uint64_t value; - if (enc == DW_EH_PE_aligned) - OBJC_ERROR("DW_EH_PE_aligned is not implemented!"); + if (enc == DW_EH_PE_aligned) { + const uintptr_t *aligned = (const uintptr_t *) + OF_ROUND_UP_POW2(sizeof(void *), (uintptr_t)*ptr); + + *ptr = (const uint8_t *)(aligned + 1); + + return *aligned; + } #define READ(type) \ { \ type tmp; \ memcpy(&tmp, *ptr, sizeof(type)); \ @@ -380,12 +386,12 @@ #ifndef HAVE_ARM_EHABI_EXCEPTIONS static uint64_t resolveValue(uint64_t value, uint8_t enc, const uint8_t *start, uint64_t base) { - if (value == 0) - return 0; + if (value == 0 || enc == DW_EH_PE_aligned) + return value; value += ((enc & 0x70) == DW_EH_PE_pcrel ? (uintptr_t)start : base); if (enc & DW_EH_PE_indirect) value = *(uintptr_t *)(uintptr_t)value;