From a36013f090b1cc9c6684afee28546d8a28c7637e Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Sun, 27 Dec 2015 15:38:28 +0100 Subject: [PATCH] Fix the offsets in the ARM block trampoline. --- block_trampolines.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block_trampolines.S b/block_trampolines.S index 1ea96a8..add0e7f 100644 --- a/block_trampolines.S +++ b/block_trampolines.S @@ -104,14 +104,14 @@ CDECL(__objc_block_trampoline_end_sret): CDECL(__objc_block_trampoline): sub r12, pc, #4096 mov r1, r0 // Move self over _cmd - ldr r0, [r12, #-4] // Load the block pointer over self - ldr pc, [r12] // Jump to the block function + ldr r0, [r12, #-8] // Load the block pointer over self + ldr pc, [r12, #-4] // Jump to the block function CDECL(__objc_block_trampoline_end): CDECL(__objc_block_trampoline_sret): sub r12, pc, #4096 mov r2, r1 // Move self over _cmd - ldr r0, [r12, #-4] // Load the block pointer over self - ldr pc, [r12] // Jump to the block function + ldr r1, [r12, #-8] // Load the block pointer over self + ldr pc, [r12, #-4] // Jump to the block function CDECL(__objc_block_trampoline_end_sret): #else #warning imp_implementationWithBlock() not implemented for your architecture