1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 02:31:03 -08:00

Move a runtime interpreter check to debug mode

* src/bytecode.c (exec_byte_code): Perform bytecode unwinding error
check only when building with debugging (NDEBUG not defined, checking
enabled, or BYTE_CODE_SAFE enabled).  This improves speed in several
ways.
This commit is contained in:
Mattias Engdegård 2022-01-02 11:15:41 +01:00
parent b3377e67a7
commit 4ff1fb8eb4

View file

@ -1564,15 +1564,17 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
exit:
eassert (SDATA (bytestr) == bytestr_data);
/* Binds and unbinds are supposed to be compiled balanced. */
#if BYTE_CODE_SAFE || !defined NDEBUG
if (SPECPDL_INDEX () != count)
{
/* Binds and unbinds are supposed to be compiled balanced. */
if (SPECPDL_INDEX () > count)
unbind_to (count, Qnil);
error ("binding stack not balanced (serious byte compiler bug)");
}
#endif
/* The byte code should have been properly pinned. */
eassert (SDATA (bytestr) == bytestr_data);
Lisp_Object result = TOP;
SAFE_FREE ();