diff options
| author | Philipp Stephani <phst@google.com> | 2015-12-20 21:10:03 +0200 |
|---|---|---|
| committer | Eli Zaretskii <eliz@gnu.org> | 2015-12-20 21:10:03 +0200 |
| commit | 4851616b4d2e14cdf970b9029f0d4b00083a08f5 (patch) | |
| tree | eaadb154c9e7517cb1bd9af15c362eb628cc53be /src/emacs-module.c | |
| parent | f55c0f0c501bb343b68dd41b4fd30a2534bf78db (diff) | |
| download | emacs-4851616b4d2e14cdf970b9029f0d4b00083a08f5.tar.gz | |
Improve commentary for emacs-module.c
* src/lisp.h: Document emacs-module.c assumptions about EQ and NILP.
* src/emacs-module.c (module_non_local_exit_get): Document that we
cannot use the current implementation.
(module_is_not_nil, module_eq): Document assumptions about EQ and
NILP.
Diffstat (limited to 'src/emacs-module.c')
| -rw-r--r-- | src/emacs-module.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c index ee976440985..5d1b4dc8d6a 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -325,6 +325,8 @@ module_non_local_exit_get (emacs_env *env, emacs_value *sym, emacs_value *data) struct emacs_env_private *p = env->private_members; if (p->pending_non_local_exit != emacs_funcall_exit_return) { + /* FIXME: We cannot call lisp_to_value here because that can + exit non-locally. */ *sym = lisp_to_value (p->non_local_exit_symbol); *data = lisp_to_value (p->non_local_exit_data); } @@ -434,6 +436,7 @@ module_is_not_nil (emacs_env *env, emacs_value value) check_main_thread (); if (module_non_local_exit_check (env) != emacs_funcall_exit_return) return false; + /* Assume that NILP never exits non-locally. */ return ! NILP (value_to_lisp (value)); } @@ -443,6 +446,7 @@ module_eq (emacs_env *env, emacs_value a, emacs_value b) check_main_thread (); if (module_non_local_exit_check (env) != emacs_funcall_exit_return) return false; + /* Assume that EQ never exits non-locally. */ return EQ (value_to_lisp (a), value_to_lisp (b)); } @@ -889,7 +893,7 @@ value_to_lisp_bits (emacs_value v) } /* If V was computed from lisp_to_value (O), then return O. - Never fails. */ + Must never fail or exit non-locally. */ static Lisp_Object value_to_lisp (emacs_value v) { @@ -919,7 +923,7 @@ enum { HAVE_STRUCT_ATTRIBUTE_ALIGNED = 0 }; #endif /* Convert O to an emacs_value. Allocate storage if needed; this can - signal if memory is exhausted. */ + signal if memory is exhausted. Must be injective. */ static emacs_value lisp_to_value (Lisp_Object o) { |
