changeset 16815:9e0f59154164

(HANDLE_RELOCATION): New macro. (MAYBE_GC): Call HANDLE_RELOCATION. Swallow following semicolon. (Fbyte_code): Use HANDLE_RELOCATION.
author Richard M. Stallman <rms@gnu.org>
date Thu, 02 Jan 1997 20:50:51 +0000
parents fdda5e6e6fe8
children 9bdccdf9388b
files src/bytecode.c
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/bytecode.c	Thu Jan 02 20:49:15 1997 +0000
+++ b/src/bytecode.c	Thu Jan 02 20:50:51 1997 +0000
@@ -256,7 +256,20 @@
 
 #define MAYBE_GC()				\
   if (consing_since_gc > gc_cons_threshold)	\
-    Fgarbage_collect ();
+    {						\
+      Fgarbage_collect ();			\
+      HANDLE_RELOCATION ();			\
+    }						\
+  else
+
+/* Relocate BYTESTR if there has been a GC recently.  */
+#define HANDLE_RELOCATION()						\
+  if (! EQ (string_saved, bytestr))					\
+    {									\
+      pc = pc - XSTRING (string_saved)->data + XSTRING (bytestr)->data;	\
+      string_saved = bytestr;						\
+    }									\
+  else
 
 /* Check for jumping out of range.  */
 #define CHECK_RANGE(ARG)			\
@@ -323,11 +336,8 @@
 	       pc - XSTRING (string_saved)->data);
 #endif
 
-      if (! EQ (string_saved, bytestr))
-	{
-	  pc = pc - XSTRING (string_saved)->data + XSTRING (bytestr)->data;
-	  string_saved = bytestr;
-	}
+      /* Update BYTESTR if we had a garbage collection.  */
+      HANDLE_RELOCATION ();
 
 #ifdef BYTE_CODE_METER
       prev_op = this_op;