From 19331670460f82e0e82eac35db5a9e85e8b05171 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Sun, 27 Dec 2015 15:38:03 +0100 Subject: [PATCH] Copy (retain) blocks when they are used as IMPs. --- block_to_imp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block_to_imp.c b/block_to_imp.c index e6c771f..1ad3211 100644 --- a/block_to_imp.c +++ b/block_to_imp.c @@ -149,6 +149,7 @@ IMP imp_implementationWithBlock(void *block) // If we don't have a trampoline intrinsic for this architecture, return a // null IMP. if (0 >= trampolineSize) { return 0; } + block = Block_copy(block); // Allocate some trampolines if this is the first time that we need to do this. if (*setptr == NULL) {