From: Paul Eggert Date: Sat, 22 Feb 2020 16:04:16 +0000 (-0800) Subject: Restore runtime check for invalid tag X-Git-Tag: emacs-28.0.90~7850 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=202c3319a28c029d6971dccea92f92425c5e8067;p=emacs.git Restore runtime check for invalid tag * 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. --- 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,