Author: chromatic
Date: Tue Aug  5 20:13:03 2008
New Revision: 30047

Modified:
   trunk/include/parrot/interpreter.h
   trunk/src/inter_run.c

Log:
[src] Fixed a segfault during global destruction of runloop jump points in
optimized builds; the runloop pointers passed to
really_destroy_runloop_jump_points may be NULL, so the compiler has to know
about that so as not to optimize away the checks.

Modified: trunk/include/parrot/interpreter.h
==============================================================================
--- trunk/include/parrot/interpreter.h  (original)
+++ trunk/include/parrot/interpreter.h  Tue Aug  5 20:13:03 2008
@@ -710,8 +710,8 @@
 void destroy_runloop_jump_points(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-void really_destroy_runloop_jump_points(ARGIN(Parrot_runloop *jump_point))
-        __attribute__nonnull__(1);
+void really_destroy_runloop_jump_points(
+    ARGIN_NULLOK(Parrot_runloop *jump_point));
 
 void runops(PARROT_INTERP, size_t offs)
         __attribute__nonnull__(1);

Modified: trunk/src/inter_run.c
==============================================================================
--- trunk/src/inter_run.c       (original)
+++ trunk/src/inter_run.c       Tue Aug  5 20:13:03 2008
@@ -681,9 +681,9 @@
 */
 
 void
-really_destroy_runloop_jump_points(ARGIN(Parrot_runloop *jump_point))
+really_destroy_runloop_jump_points(ARGIN_NULLOK(Parrot_runloop *jump_point))
 {
-    while (jump_point != NULL) {
+    while (jump_point) {
         Parrot_runloop * const prev = jump_point->prev;
         mem_sys_free(jump_point);
         jump_point = prev;

Reply via email to