diff src/alloc.c @ 4933:77e3b19bd245

merge
author Ben Wing <ben@xemacs.org>
date Sun, 24 Jan 2010 22:06:20 -0600
parents ae81a2c00f4f
children 6ef8256a020a 714f7c9fabb1
line wrap: on
line diff
--- a/src/alloc.c	Sun Jan 24 19:56:31 2010 +0000
+++ b/src/alloc.c	Sun Jan 24 22:06:20 2010 -0600
@@ -1,7 +1,7 @@
 /* Storage allocation and gc for XEmacs Lisp interpreter.
    Copyright (C) 1985-1998 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -3117,6 +3117,14 @@
   const struct lrecord_implementation *implementation
     = LHEADER_IMPLEMENTATION (lheader);
 
+  /* If we try to debug-print during GC, we'll likely get a crash on the
+     following assert (called from Lstream_delete(), from prin1_to_string()).
+     Instead, just don't do anything.  Worst comes to worst, we have a
+     small memory leak -- and programs being debugged usually won't be
+     super long-lived afterwards, anyway. */
+  if (gc_in_progress && in_debug_print)
+    return;
+
   /* Finalizer methods may try to free objects within them, which typically
      won't be marked and thus are scheduled for demolition.  Putting them
      on the free list would be very bad, as we'd have xfree()d memory in