From: Paul Eggert Date: Thu, 14 Jun 2018 22:59:08 +0000 (-0700) Subject: Simplify init_module_assertions X-Git-Tag: emacs-27.0.90~4861 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef66660c17d1b164414c46d67ba3494f8a18c8ec;p=emacs.git 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. --- 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