emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4ff1fb8eb4 08/14: Move a runtime interpreter check to debug mode


From: Mattias Engdegård
Subject: master 4ff1fb8eb4 08/14: Move a runtime interpreter check to debug mode
Date: Mon, 24 Jan 2022 05:42:37 -0500 (EST)

branch: master
commit 4ff1fb8eb475a540c094878db1811797e2ca2368
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    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.
---
 src/bytecode.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/bytecode.c b/src/bytecode.c
index 8e0f3d3e4b..75f1a6b43e 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -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 ();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]