emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master ef66660 02/10: Simplify init_module_assertions


From: Paul Eggert
Subject: [Emacs-diffs] master ef66660 02/10: Simplify init_module_assertions
Date: Thu, 14 Jun 2018 20:15:24 -0400 (EDT)

branch: master
commit ef66660c17d1b164414c46d67ba3494f8a18c8ec
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Simplify init_module_assertions
    
    * src/emacs-module.c (init_module_assertions): Just use NULL
    instead of allocating a dummy on the stack and then using
    eassert.  Practical platforms check for null pointer
    dereferencing nowadays, so this is good enough.
---
 src/emacs-module.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/emacs-module.c b/src/emacs-module.c
index ff575ff..3a24663 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -1167,15 +1167,11 @@ module_handle_throw (emacs_env *env, Lisp_Object 
tag_val)
 void
 init_module_assertions (bool enable)
 {
+  /* If enabling module assertions, use a hidden environment for
+     storing the globals.  This environment is never freed.  */
   module_assertions = enable;
   if (enable)
-    {
-      /* We use a hidden environment for storing the globals.  This
-         environment is never freed.  */
-      emacs_env env;
-      global_env = initialize_environment (&env, &global_env_private);
-      eassert (global_env != &env);
-    }
+    global_env = initialize_environment (NULL, &global_env_private);
 }
 
 static _Noreturn void



reply via email to

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