aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bytecode.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 7c73696a99a..38a1d3a0d5d 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -256,7 +256,20 @@ Lisp_Object Qbytecode;
256 256
257#define MAYBE_GC() \ 257#define MAYBE_GC() \
258 if (consing_since_gc > gc_cons_threshold) \ 258 if (consing_since_gc > gc_cons_threshold) \
259 Fgarbage_collect (); 259 { \
260 Fgarbage_collect (); \
261 HANDLE_RELOCATION (); \
262 } \
263 else
264
265/* Relocate BYTESTR if there has been a GC recently. */
266#define HANDLE_RELOCATION() \
267 if (! EQ (string_saved, bytestr)) \
268 { \
269 pc = pc - XSTRING (string_saved)->data + XSTRING (bytestr)->data; \
270 string_saved = bytestr; \
271 } \
272 else
260 273
261/* Check for jumping out of range. */ 274/* Check for jumping out of range. */
262#define CHECK_RANGE(ARG) \ 275#define CHECK_RANGE(ARG) \
@@ -323,11 +336,8 @@ If the third argument is incorrect, Emacs may crash.")
323 pc - XSTRING (string_saved)->data); 336 pc - XSTRING (string_saved)->data);
324#endif 337#endif
325 338
326 if (! EQ (string_saved, bytestr)) 339 /* Update BYTESTR if we had a garbage collection. */
327 { 340 HANDLE_RELOCATION ();
328 pc = pc - XSTRING (string_saved)->data + XSTRING (bytestr)->data;
329 string_saved = bytestr;
330 }
331 341
332#ifdef BYTE_CODE_METER 342#ifdef BYTE_CODE_METER
333 prev_op = this_op; 343 prev_op = this_op;