| 1 | Upstream status: https://github.com/gnustep/libobjc2/pull/429
|
| 2 | and https://github.com/gnustep/libobjc2/pull/352
|
| 3 |
|
| 4 | Fixes test compilation and crashes on i686-linux with newer clang.
|
| 5 |
|
| 6 | From e4b159a815bb9ee22e4aaee40b57119f0b380a31 Mon Sep 17 00:00:00 2001
|
| 7 | From: Dariqq <[email protected]>
|
| 8 | Date: Thu, 8 Oct 2026 10:02:26 +0000
|
| 9 | Subject: [PATCH] Use caller-saved register in x86-32 block trampoline.
|
| 10 |
|
| 11 | Replace ebx register with ecx. This fixes crashes on x86-32 when
|
| 12 | optimisations are enabled.
|
| 13 |
|
| 14 | Co-authored-by: David Chisnall <[email protected]>
|
| 15 | ---
|
| 16 | block_trampolines.S | 8 ++++----
|
| 17 | 1 file changed, 4 insertions(+), 4 deletions(-)
|
| 18 |
|
| 19 | diff --git a/block_trampolines.S b/block_trampolines.S
|
| 20 | index 2f9f11b..a2d0677 100644
|
| 21 | |
| 22 | |
| 23 | @@ -60,10 +60,10 @@
|
| 24 | call 1f # Store the instruction pointer on the stack
|
| 25 | 1:
|
| 26 | pop %eax # Load the old instruction pointer
|
| 27 | - mov \arg0(%esp), %ebx # Load the self parameter
|
| 28 | - mov %ebx, \arg1(%esp) # Store self as the second argument
|
| 29 | - mov -0x1005(%eax), %ebx # Load the block pointer to %ebx
|
| 30 | - mov %ebx, \arg0(%esp) # Store the block pointer in the first argument
|
| 31 | + mov \arg0(%esp), %ecx # Load the self parameter
|
| 32 | + mov %ecx, \arg1(%esp) # Store self as the second argument
|
| 33 | + mov -0x1005(%eax), %ecx # Load the block pointer to %ecx
|
| 34 | + mov %ecx, \arg0(%esp) # Store the block pointer in the first argument
|
| 35 | jmp *-0x1001(%eax) # Call the block function
|
| 36 | .endm
|
| 37 | // All arguments on i386 are passed on the stack. These values are stack
|
| 38 | --
|
| 39 | 2.54.0
|
| 40 |
|
| 41 | From 0548300e2f1cc4752965b6d1fe3c0de122a7fffe Mon Sep 17 00:00:00 2001
|
| 42 | From: Hugo Melder <[email protected]>
|
| 43 | Date: Wed, 1 Oct 2025 12:43:53 +0200
|
| 44 | Subject: [PATCH 3/3] Test/FastPathAlloc: fix compilation error
|
| 45 |
|
| 46 | ---
|
| 47 | Test/FastPathAlloc.m | 2 +-
|
| 48 | 1 file changed, 1 insertion(+), 1 deletion(-)
|
| 49 |
|
| 50 | diff --git a/Test/FastPathAlloc.m b/Test/FastPathAlloc.m
|
| 51 | index 340a8dd3..f1eb6244 100644
|
| 52 | |
| 53 | |
| 54 | @@ -96,7 +96,7 @@ + (instancetype)alloc
|
| 55 | @implementation ShouldInitSubclassed
|
| 56 | + (instancetype) alloc
|
| 57 | {
|
| 58 | - return [ShouldInit alloc];
|
| 59 | + return (ShouldInitSubclassed *)[ShouldInit alloc];
|
| 60 | }
|
| 61 | @end
|
| 62 |
|