mirror of
https://github.com/encounter/bdwgc.git
synced 2026-07-09 18:19:35 -07:00
73ee11a2a9
store a thread's state when compiling against the iOS 7/8 SDK. Without this patch GC_stack_range_for() crashes when running a 32-bit app on iOS 64-bit. The old code passed an arm_thread_state_t and ARM_THREAD_STATE to thread_get_state(). ARM_THREAD_STATE is the same as ARM_UNIFIED_THREAD_STATE on iOS 7/8 and thread_get_state() actually expects an arm_unified_thread_state_t. On iOS 32-bit it looks like thread_get_state() only touches the first bytes corresponding to the size of arm_thread_state_t so no crash there. On iOS 64-bit however it seems thread_get_state() writes to the full arm_unified_thread_state_t which meant it would overflow the stack allocated struct passed to it and mess up other values on the stack leading to a crash later on.