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