aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs-module.c
diff options
context:
space:
mode:
authorPaul Eggert2015-12-20 17:43:42 -0800
committerPaul Eggert2015-12-20 17:44:51 -0800
commite9916d8880561cc06b6cb73bafe7257b93ffbf4c (patch)
treea74f4ca73a26f18e697592d85f8e03dca4a035b1 /src/emacs-module.c
parent6cd051b31c3440486888f417e028554de7542fb0 (diff)
downloademacs-e9916d8880561cc06b6cb73bafe7257b93ffbf4c.tar.gz
emacs-e9916d8880561cc06b6cb73bafe7257b93ffbf4c.zip
Revert some recent emacs-module commentary
Most of the recently-added commentary was incorrect, due to the possibility of stack overflow.
Diffstat (limited to 'src/emacs-module.c')
-rw-r--r--src/emacs-module.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 5d1b4dc8d6a..dca834973bd 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -86,7 +86,7 @@ struct emacs_env_private
86struct emacs_runtime_private 86struct emacs_runtime_private
87{ 87{
88 /* FIXME: Ideally, we would just define "struct emacs_runtime_private" 88 /* FIXME: Ideally, we would just define "struct emacs_runtime_private"
89 * as a synonym of "emacs_env", but I don't know how to do that in C. */ 89 as a synonym of "emacs_env", but I don't know how to do that in C. */
90 emacs_env pub; 90 emacs_env pub;
91}; 91};
92 92
@@ -325,8 +325,7 @@ module_non_local_exit_get (emacs_env *env, emacs_value *sym, emacs_value *data)
325 struct emacs_env_private *p = env->private_members; 325 struct emacs_env_private *p = env->private_members;
326 if (p->pending_non_local_exit != emacs_funcall_exit_return) 326 if (p->pending_non_local_exit != emacs_funcall_exit_return)
327 { 327 {
328 /* FIXME: We cannot call lisp_to_value here because that can 328 /* FIXME: lisp_to_value can exit non-locally. */
329 exit non-locally. */
330 *sym = lisp_to_value (p->non_local_exit_symbol); 329 *sym = lisp_to_value (p->non_local_exit_symbol);
331 *data = lisp_to_value (p->non_local_exit_data); 330 *data = lisp_to_value (p->non_local_exit_data);
332 } 331 }
@@ -436,7 +435,6 @@ module_is_not_nil (emacs_env *env, emacs_value value)
436 check_main_thread (); 435 check_main_thread ();
437 if (module_non_local_exit_check (env) != emacs_funcall_exit_return) 436 if (module_non_local_exit_check (env) != emacs_funcall_exit_return)
438 return false; 437 return false;
439 /* Assume that NILP never exits non-locally. */
440 return ! NILP (value_to_lisp (value)); 438 return ! NILP (value_to_lisp (value));
441} 439}
442 440
@@ -446,7 +444,6 @@ module_eq (emacs_env *env, emacs_value a, emacs_value b)
446 check_main_thread (); 444 check_main_thread ();
447 if (module_non_local_exit_check (env) != emacs_funcall_exit_return) 445 if (module_non_local_exit_check (env) != emacs_funcall_exit_return)
448 return false; 446 return false;
449 /* Assume that EQ never exits non-locally. */
450 return EQ (value_to_lisp (a), value_to_lisp (b)); 447 return EQ (value_to_lisp (a), value_to_lisp (b));
451} 448}
452 449
@@ -893,7 +890,7 @@ value_to_lisp_bits (emacs_value v)
893} 890}
894 891
895/* If V was computed from lisp_to_value (O), then return O. 892/* If V was computed from lisp_to_value (O), then return O.
896 Must never fail or exit non-locally. */ 893 Exits non-locally only if the stack overflows. */
897static Lisp_Object 894static Lisp_Object
898value_to_lisp (emacs_value v) 895value_to_lisp (emacs_value v)
899{ 896{
@@ -923,7 +920,7 @@ enum { HAVE_STRUCT_ATTRIBUTE_ALIGNED = 0 };
923#endif 920#endif
924 921
925/* Convert O to an emacs_value. Allocate storage if needed; this can 922/* Convert O to an emacs_value. Allocate storage if needed; this can
926 signal if memory is exhausted. Must be injective. */ 923 signal if memory is exhausted. Must be an injective function. */
927static emacs_value 924static emacs_value
928lisp_to_value (Lisp_Object o) 925lisp_to_value (Lisp_Object o)
929{ 926{