From 72ec07268d34d80a637e309fa5ed317ac0d02827 Mon Sep 17 00:00:00 2001 From: thebeing Date: Fri, 27 May 2011 18:06:20 +0000 Subject: [PATCH] Work around GCC error for inline assembly. --- gc_boehm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gc_boehm.c b/gc_boehm.c index 6c1199b..ff12ea2 100644 --- a/gc_boehm.c +++ b/gc_boehm.c @@ -506,10 +506,11 @@ void objc_clear_stack(unsigned long options) // how much stack space is left somehow, but this is not possible to do // portably. int i[1024]; - memset(&i, 0, 1024); + int *addr = &i[0]; + memset(addr, 0, 1024); // Tell the compiler that something that it doesn't know about is touching // this memory, so it shouldn't optimise the allocation and memset away. - __asm__ volatile ("" : : "m"(i) : "memory"); + __asm__ volatile ("" : : "m"(addr) : "memory"); } // FIXME: These are all stub implementations that should be replaced with