From: Vibhav Pant Date: Thu, 19 Jan 2017 13:05:46 +0000 (+0530) Subject: Add type checking for Bswitch, when enabled at compile time. X-Git-Tag: emacs-26.0.90~883 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=522f16dac945eee351cefb066af40f0d1a683f38;p=emacs.git Add type checking for Bswitch, when enabled at compile time. * src/bytecode.c: (exec_byte_code) If BYTE_CODE_SAFE is enabled at compile time, use CHECK_TYPE to verify that the jump table is a hash table. --- diff --git a/src/bytecode.c b/src/bytecode.c index fc434a2812f..f4540e94c9c 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1417,6 +1417,9 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, { Lisp_Object jmp_table = POP; Lisp_Object v1 = POP; +#ifdef BYTE_CODE_SAFE + CHECK_TYPE (HASH_TABLE_P (jmp_table), Qhash_table_p, jmp_table); +#endif struct Lisp_Hash_Table *h = XHASH_TABLE(jmp_table); ptrdiff_t i = hash_lookup(h, v1, NULL); if (i >= 0) {