Always fail if FindTopOfStack(0) is not implemented but called (Darwin)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 2 Feb 2018 08:32:10 +0000 (11:32 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 2 Feb 2018 08:32:20 +0000 (11:32 +0300)
* 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.

darwin_stop_world.c

index 37aee97..aef58c2 100644 (file)
@@ -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