1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/27b87c12a3ab/
Changeset:   27b87c12a3ab
User:        kehoea
Date:        2017-12-29 10:50:19+00:00
Summary:     Avoid begin_gc_forbidden(), end_gc_forbidden(), doprnt.c
src/ChangeLog addition:
2017-12-29  Aidan Kehoe  <kehoea(a)parhasard.net>
	* doprnt.c (emacs_vsprintf_string):
	* doprnt.c (emacs_vasprintf):
	There is no need to forbid GC in these functions, the resizing
	buffer output stream cannot GC and continue, nor can
	write_fmt_string_lisp_va().
	Jerry James just showed a backtrace where forbidding GC here
	actually caused XEmacs to crash, early in startup when
	specpdl_size was unitialised and begin_gc_forbidden() did an
	infinite loop.
Affected #:  2 files
diff -r 24f04bada33d560caea25b9f26471e885d17c1a9 -r
27b87c12a3aba5014f70dcb1b0ebb884c302f6fe src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
+2017-12-29  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* doprnt.c (emacs_vsprintf_string):
+	* doprnt.c (emacs_vasprintf):
+	There is no need to forbid GC in these functions, the resizing
+	buffer output stream cannot GC and continue, nor can
+	write_fmt_string_lisp_va().
+	Jerry James just showed a backtrace where forbidding GC here
+	actually caused XEmacs to crash, early in startup when
+	specpdl_size was unitialised and begin_gc_forbidden() did an
+	infinite loop.
+
 2017-12-29  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* print.c (output_string):
diff -r 24f04bada33d560caea25b9f26471e885d17c1a9 -r
27b87c12a3aba5014f70dcb1b0ebb884c302f6fe src/doprnt.c
--- a/src/doprnt.c
+++ b/src/doprnt.c
@@ -3125,17 +3125,15 @@
 
 /* vsprintf()-like replacement. Arguments are interpreted as C
    objects--doubles, char *s, EMACS_INTs, etc. Returns a Lisp string.  Data
-   from Lisp strings is OK because we explicitly inhibit GC. */
+   from Lisp strings is OK because we cannot GC. */
 Lisp_Object
 emacs_vsprintf_string (const CIbyte *format, va_list vargs)
 {
   Lisp_Object stream = make_resizing_buffer_output_stream (), obj;
-  int count = begin_gc_forbidden ();
 
   write_fmt_string_va (stream, format, vargs);
   obj = resizing_buffer_to_lisp_string (XLSTREAM (stream));
   Lstream_delete (XLSTREAM (stream));
-  end_gc_forbidden (count);
 
   return obj;
 }
@@ -3157,14 +3155,13 @@
 
 /* vasprintf() implementation. Arguments are interpreted as C
    objects--doubles, char *s, EMACS_INTs, etc.  Data from Lisp strings is OK
-   because we explicitly inhibit GC.  Returns length (not including the
+   because we cannot GC.  Returns length (not including the
    terminating zero). Stores a pointer to be freed with free() into
    *RETVAL_OUT. */
 Bytecount
 emacs_vasprintf (Ibyte **retval_out, const CIbyte *format, va_list vargs)
 {
   Lisp_Object stream = make_resizing_buffer_output_stream ();
-  int count = begin_gc_forbidden ();
   Bytecount len;
 
   write_fmt_string_va (stream, format, vargs);
@@ -3176,8 +3173,6 @@
   (*retval_out)[len] = '\0';
   Lstream_delete (XLSTREAM (stream));
 
-  end_gc_forbidden (count);
-
   return len;
 }
Repository URL: 
https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from 
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.