diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-02-02 11:32:10 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-02-02 11:32:20 +0300 |
commit | 7e5abd8b79b351ed5b8218fb60860d05760feec1 (patch) | |
tree | aef2b9abc74068d2ef40eecfd38aa5c3710cad94 /darwin_stop_world.c | |
parent | e61b2dd45d6fc6be5b37b993bb032e4fd0835e78 (diff) | |
download | bdwgc-7e5abd8b79b351ed5b8218fb60860d05760feec1.tar.gz |
Always fail if FindTopOfStack(0) is not implemented but called (Darwin)
* darwin_stop_world.c [!DARWIN_DONT_PARSE_STACK] (GC_FindTopOfStack):
Initialize frame local variable first (to stack_start).
* darwin_stop_world.c [!DARWIN_DONT_PARSE_STACK && !POWERPC]
(GC_FindTopOfStack): Call ABORT with the appropriate message (instead
of GC_ASSERT) if stack_start iz zero.
Diffstat (limited to 'darwin_stop_world.c')
-rw-r--r-- | darwin_stop_world.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 37aee97d..aef58c2b 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -55,21 +55,18 @@ typedef struct StackFrame { GC_INNER ptr_t GC_FindTopOfStack(unsigned long stack_start) { - StackFrame *frame; + StackFrame *frame = (StackFrame *)stack_start; -# ifdef POWERPC - if (stack_start == 0) { + if (stack_start == 0) { +# ifdef POWERPC # if CPP_WORDSZ == 32 __asm__ __volatile__ ("lwz %0,0(r1)" : "=r" (frame)); # else __asm__ __volatile__ ("ld %0,0(r1)" : "=r" (frame)); # endif - } else -# else - GC_ASSERT(stack_start != 0); /* not implemented */ -# endif /* !POWERPC */ - /* else */ { - frame = (StackFrame *)stack_start; +# else + ABORT("GC_FindTopOfStack(0) is not implemented"); +# endif } # ifdef DEBUG_THREADS_EXTRA |