emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 ac64fdb: Harden exec_byte_code against redefining


From: Paul Eggert
Subject: [Emacs-diffs] emacs-26 ac64fdb: Harden exec_byte_code against redefining 'error'
Date: Sun, 26 Nov 2017 22:16:56 -0500 (EST)

branch: emacs-26
commit ac64fdb248d791b204cf579f878f8542ded0d067
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Harden exec_byte_code against redefining 'error'
    
    Problem discovered by configuring with --enable-gcc-warnings on
    Ubuntu 17.10 x86-64 with gcc (Ubuntu 7.2.0-8ubuntu3).
    * src/bytecode.c (exec_byte_code): Call the C error function
    instead of the Lisp one, so that the Emacs interpreter does not go
    haywire if the user redefines the Lisp error function.
---
 src/bytecode.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/bytecode.c b/src/bytecode.c
index ebaf3c3..8746568 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1346,10 +1346,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, 
Lisp_Object maxdepth,
          /* Actually this is Bstack_ref with offset 0, but we use Bdup
             for that instead.  */
          /* CASE (Bstack_ref): */
-         call3 (Qerror,
-                build_string ("Invalid byte opcode: op=%s, ptr=%d"),
-                make_number (op),
-                make_number (pc - 1 - bytestr_data));
+         error ("Invalid byte opcode: op=%d, ptr=%"pD"d",
+                op, pc - 1 - bytestr_data);
 
          /* Handy byte-codes for lexical binding.  */
        CASE (Bstack_ref1):



reply via email to

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