From ef66660c17d1b164414c46d67ba3494f8a18c8ec Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 14 Jun 2018 15:59:08 -0700 Subject: [PATCH] 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 ff575ff44df..3a246637990 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 -- 2.39.2