changeset 50746:2a57a6e6b390

(Fformat): Set abort_on_gc during first scan of format. Reinit FORMAT_START and END before second scan.
author Richard M. Stallman <rms@gnu.org>
date Wed, 30 Apr 2003 12:05:37 +0000
parents fedd03de0f46
children f38d1373681e
files src/editfns.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/editfns.c	Wed Apr 30 12:04:39 2003 +0000
+++ b/src/editfns.c	Wed Apr 30 12:05:37 2003 +0000
@@ -3255,8 +3255,12 @@
   /* We may have to change "%S" to "%s". */
   args[0] = Fcopy_sequence (args[0]);
 
+  /* GC should never happen here, so abort if it does.  */
+  abort_on_gc++;
+
   /* If we start out planning a unibyte result,
-     and later find it has to be multibyte, we jump back to retry.  */
+     then discover it has to be multibyte, we jump back to retry.
+     That can only happen from the first large while loop below.  */
  retry:
 
   format = SDATA (args[0]);
@@ -3456,6 +3460,8 @@
 	total += thissize + 4;
       }
 
+  abort_on_gc--;
+
   /* Now we can no longer jump to retry.
      TOTAL and LONGEST_FORMAT are known for certain.  */
 
@@ -3474,6 +3480,8 @@
 
   /* Scan the format and store result in BUF.  */
   format = SDATA (args[0]);
+  format_start = format;
+  end = format + SBYTES (args[0]);
   maybe_combine_byte = 0;
   while (format != end)
     {