diff options
| author | Paul Eggert | 2018-06-14 15:59:08 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-06-14 17:13:38 -0700 |
| commit | ef66660c17d1b164414c46d67ba3494f8a18c8ec (patch) | |
| tree | 93ad3c5740b777a0f38e6137a1bb4e1f1e7c2306 /src | |
| parent | 30d393f9118035ec5d12917252bc4339c771a539 (diff) | |
| download | emacs-ef66660c17d1b164414c46d67ba3494f8a18c8ec.tar.gz emacs-ef66660c17d1b164414c46d67ba3494f8a18c8ec.zip | |
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')
| -rw-r--r-- | src/emacs-module.c | 10 |
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) | |||
| 1167 | void | 1167 | void |
| 1168 | init_module_assertions (bool enable) | 1168 | init_module_assertions (bool enable) |
| 1169 | { | 1169 | { |
| 1170 | /* If enabling module assertions, use a hidden environment for | ||
| 1171 | storing the globals. This environment is never freed. */ | ||
| 1170 | module_assertions = enable; | 1172 | module_assertions = enable; |
| 1171 | if (enable) | 1173 | if (enable) |
| 1172 | { | 1174 | global_env = initialize_environment (NULL, &global_env_private); |
| 1173 | /* We use a hidden environment for storing the globals. This | ||
| 1174 | environment is never freed. */ | ||
| 1175 | emacs_env env; | ||
| 1176 | global_env = initialize_environment (&env, &global_env_private); | ||
| 1177 | eassert (global_env != &env); | ||
| 1178 | } | ||
| 1179 | } | 1175 | } |
| 1180 | 1176 | ||
| 1181 | static _Noreturn void | 1177 | static _Noreturn void |