From 202c3319a28c029d6971dccea92f92425c5e8067 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 22 Feb 2020 08:04:16 -0800 Subject: [PATCH] Restore runtime check for invalid tag MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/data.c (wrong_type_argument): Restore check that the object’s tag is valid, since invalid tags exist again. * src/lisp.h (Lisp_Type_Unused0): New constant. --- src/data.c | 10 ++-------- src/lisp.h | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/data.c b/src/data.c index fae9cee7db1..460cb9330c0 100644 --- a/src/data.c +++ b/src/data.c @@ -143,15 +143,9 @@ wrong_length_argument (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) } AVOID -wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value) +wrong_type_argument (Lisp_Object predicate, Lisp_Object value) { - /* If VALUE is not even a valid Lisp object, we'd want to abort here - where we can get a backtrace showing where it came from. We used - to try and do that by checking the tagbits, but nowadays all - tagbits are potentially valid. */ - /* if ((unsigned int) XTYPE (value) >= Lisp_Type_Limit) - * emacs_abort (); */ - + eassert (!TAGGEDP (value, Lisp_Type_Unused0)); xsignal2 (Qwrong_type_argument, predicate, value); } diff --git a/src/lisp.h b/src/lisp.h index 0bd375658e2..a379977d353 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -481,6 +481,7 @@ enum Lisp_Type Lisp_Symbol = 0, /* Type 1 is currently unused. */ + Lisp_Type_Unused0 = 1, /* Fixnum. XFIXNUM (obj) is the integer value. */ Lisp_Int0 = 2, -- 2.39.2