[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/byte-switch 522f16d 2/2: Add type checking for Bsw
From: |
Vibhav Pant |
Subject: |
[Emacs-diffs] feature/byte-switch 522f16d 2/2: Add type checking for Bswitch, when enabled at compile time. |
Date: |
Thu, 19 Jan 2017 13:15:29 +0000 (UTC) |
branch: feature/byte-switch
commit 522f16dac945eee351cefb066af40f0d1a683f38
Author: Vibhav Pant <address@hidden>
Commit: Vibhav Pant <address@hidden>
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.
---
src/bytecode.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/bytecode.c b/src/bytecode.c
index fc434a2..f4540e9 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) {