emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114515: * bytecode.c (exec_byte_code): Use some mor


From: Paul Eggert
Subject: [Emacs-diffs] trunk r114515: * bytecode.c (exec_byte_code): Use some more volatile variables
Date: Fri, 04 Oct 2013 06:51:59 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114515
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Thu 2013-10-03 23:51:50 -0700
message:
  * bytecode.c (exec_byte_code): Use some more volatile variables
  
  to work around local variables getting clobbered by longjmp.
  Port to pre-C99, which doesn't allow decls after stmts.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/bytecode.c                 bytecode.c-20091113204419-o5vbwnq5f7feedwu-257
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-10-03 16:16:31 +0000
+++ b/src/ChangeLog     2013-10-04 06:51:50 +0000
@@ -1,3 +1,9 @@
+2013-10-04  Paul Eggert  <address@hidden>
+
+       * bytecode.c (exec_byte_code): Use some more volatile variables
+       to work around local variables getting clobbered by longjmp.
+       Port to pre-C99, which doesn't allow decls after stmts.
+
 2013-10-03  Paul Eggert  <address@hidden>
 
        * lisp.h (eassert): Assume that COND is true when optimizing.

=== modified file 'src/bytecode.c'
--- a/src/bytecode.c    2013-10-03 04:58:56 +0000
+++ b/src/bytecode.c    2013-10-04 06:51:50 +0000
@@ -332,7 +332,7 @@
 
 /* A list of currently active byte-code execution value stacks.
    Fbyte_code adds an entry to the head of this list before it starts
-   processing byte-code, and it removed the entry again when it is
+   processing byte-code, and it removes the entry again when it is
    done.  Signaling an error truncates the list analogous to
    gcprolist.  */
 
@@ -501,19 +501,22 @@
                Lisp_Object args_template, ptrdiff_t nargs, Lisp_Object *args)
 {
   ptrdiff_t count = SPECPDL_INDEX ();
+  ptrdiff_t volatile count_volatile;
 #ifdef BYTE_CODE_METER
-  int this_op = 0;
+  int volatile this_op = 0;
   int prev_op;
 #endif
   int op;
   /* Lisp_Object v1, v2; */
   Lisp_Object *vectorp;
+  Lisp_Object *volatile vectorp_volatile;
 #ifdef BYTE_CODE_SAFE
-  ptrdiff_t const_length;
-  Lisp_Object *stacke;
-  ptrdiff_t bytestr_length;
+  ptrdiff_t volatile const_length;
+  Lisp_Object *volatile stacke;
+  ptrdiff_t volatile bytestr_length;
 #endif
   struct byte_stack stack;
+  struct byte_stack volatile stack_volatile;
   Lisp_Object *top;
   Lisp_Object result;
   enum handlertype type;
@@ -1119,16 +1122,25 @@
            PUSH_HANDLER (c, tag, type);
            c->bytecode_dest = dest;
            c->bytecode_top = top;
+           count_volatile = count;
+           stack_volatile = stack;
+           vectorp_volatile = vectorp;
+
            if (sys_setjmp (c->jmp))
              {
                struct handler *c = handlerlist;
+               int dest;
                top = c->bytecode_top;
-               int dest = c->bytecode_dest;
+               dest = c->bytecode_dest;
                handlerlist = c->next;
                PUSH (c->val);
                CHECK_RANGE (dest);
+               stack = stack_volatile;
                stack.pc = stack.byte_string_start + dest;
              }
+
+           count = count_volatile;
+           vectorp = vectorp_volatile;
            NEXT;
          }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]