summaryrefslogtreecommitdiff
path: root/src/emacs-module.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-06-14 15:59:08 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-06-14 17:13:38 -0700
commitef66660c17d1b164414c46d67ba3494f8a18c8ec (patch)
tree93ad3c5740b777a0f38e6137a1bb4e1f1e7c2306 /src/emacs-module.c
parent30d393f9118035ec5d12917252bc4339c771a539 (diff)
downloademacs-ef66660c17d1b164414c46d67ba3494f8a18c8ec.tar.gz
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.
Diffstat (limited to 'src/emacs-module.c')
-rw-r--r--src/emacs-module.c10
1 files 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