summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-11-01 23:19:20 +0000
committerRichard M. Stallman <rms@gnu.org>1999-11-01 23:19:20 +0000
commit15934ffa0e165d784d2b306fe6649ef41ed06773 (patch)
treef70cce8e604fb7fa9e2d34c482bfa8b2478f1600 /src/eval.c
parent4742f5240c0f7446cd15eb9d34e5a4e376e6d1ad (diff)
downloademacs-15934ffa0e165d784d2b306fe6649ef41ed06773.tar.gz
[DEBUG_GCPRO] (gcpro_level): New variable.
(init_eval) [DEBUG_GCPRO]: Initialize it. (unwind_to_catch) [DEBUG_GCPRO]: Set gcpro_level from remaining gcprolist.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 59150df232a..4245f72c0ed 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -85,6 +85,11 @@ struct catchtag
struct catchtag *catchlist;
+#ifdef DEBUG_GCPRO
+/* Count levels of GCPRO to detect failure to UNGCPRO. */
+int gcpro_level;
+#endif
+
Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun;
Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag;
Lisp_Object Qmocklisp_arguments, Vmocklisp_arguments, Qmocklisp;
@@ -185,6 +190,7 @@ init_eval ()
Vquit_flag = Qnil;
debug_on_next_call = 0;
lisp_eval_depth = 0;
+ gcpro_level = 0;
/* This is less than the initial value of num_nonmacro_input_events. */
when_entered_debugger = -1;
}
@@ -967,6 +973,12 @@ unwind_to_catch (catch, value)
while (! last_time);
gcprolist = catch->gcpro;
+#ifdef DEBUG_GCPRO
+ if (gcprolist != 0)
+ gcpro_level = gcprolist->level + 1;
+ else
+ gcpro_level = 0;
+#endif
backtrace_list = catch->backlist;
lisp_eval_depth = catch->lisp_eval_depth;