aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorPaul Eggert2017-11-26 19:15:14 -0800
committerPaul Eggert2017-11-26 19:16:47 -0800
commitac64fdb248d791b204cf579f878f8542ded0d067 (patch)
tree64bf9c2453b2cbec09d372ccdbd8aead9e508f99 /src/bytecode.c
parent700f74e4c8d1b33cdf96dab9586dc41ebccaba7d (diff)
downloademacs-ac64fdb248d791b204cf579f878f8542ded0d067.tar.gz
emacs-ac64fdb248d791b204cf579f878f8542ded0d067.zip
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.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index ebaf3c3a7fc..8746568f166 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,
1346 /* Actually this is Bstack_ref with offset 0, but we use Bdup 1346 /* Actually this is Bstack_ref with offset 0, but we use Bdup
1347 for that instead. */ 1347 for that instead. */
1348 /* CASE (Bstack_ref): */ 1348 /* CASE (Bstack_ref): */
1349 call3 (Qerror, 1349 error ("Invalid byte opcode: op=%d, ptr=%"pD"d",
1350 build_string ("Invalid byte opcode: op=%s, ptr=%d"), 1350 op, pc - 1 - bytestr_data);
1351 make_number (op),
1352 make_number (pc - 1 - bytestr_data));
1353 1351
1354 /* Handy byte-codes for lexical binding. */ 1352 /* Handy byte-codes for lexical binding. */
1355 CASE (Bstack_ref1): 1353 CASE (Bstack_ref1):