From: Dan Nicolaescu <dann@ics.uci.edu>
To: 4643@emacsbugs.donarmstrong.com
Subject: bug#4643: two different definitions for catchlist in eval.c and alloc.c
Date: Wed, 7 Oct 2009 01:32:00 -0700 (PDT) [thread overview]
Message-ID: <200910070832.n978W0Zi003116@godzilla.ics.uci.edu> (raw)
In-Reply-To: <200910051618.n95GIX0i012545@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Mon, 5 Oct 2009 09:18:33 -0700 (PDT)")
Here's a patch that fixes this problem by moving the definition in a
separate file included in both places.
OK to check in?
Index: src/Makefile.in
===================================================================
RCS file: /cvsroot/emacs/emacs/src/Makefile.in,v
retrieving revision 1.450
diff -u -3 -p -r1.450 Makefile.in
--- src/Makefile.in 26 Sep 2009 19:49:17 -0000 1.450
+++ src/Makefile.in 7 Oct 2009 08:26:06 -0000
@@ -1231,14 +1231,14 @@ xsmfns.o: xsmfns.c $(config_h) systime.h
/* The files of Lisp proper */
alloc.o: alloc.c process.h frame.h window.h buffer.h puresize.h syssignal.h keyboard.h \
- blockinput.h atimer.h systime.h character.h dispextern.h $(config_h) \
+ blockinput.h atimer.h systime.h character.h dispextern.h catchtag.h $(config_h) \
$(INTERVALS_H)
bytecode.o: bytecode.c buffer.h syntax.h character.h window.h dispextern.h \
frame.h xterm.h $(config_h)
data.o: data.c buffer.h puresize.h character.h syssignal.h keyboard.h frame.h \
termhooks.h $(config_h)
eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \
- dispextern.h $(config_h)
+ dispextern.h catchtag.h $(config_h)
floatfns.o: floatfns.c syssignal.h $(config_h)
fns.o: fns.c commands.h $(config_h) frame.h buffer.h character.h keyboard.h \
keymap.h frame.h window.h dispextern.h $(INTERVALS_H) coding.h md5.h \
Index: src/alloc.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/alloc.c,v
retrieving revision 1.449
diff -u -3 -p -r1.449 alloc.c
--- src/alloc.c 25 Aug 2009 06:03:09 -0000 1.449
+++ src/alloc.c 7 Oct 2009 08:26:08 -0000
@@ -56,6 +56,7 @@ along with GNU Emacs. If not, see <http
#include "syssignal.h"
#include "termhooks.h" /* For struct terminal. */
#include <setjmp.h>
+#include "catchtag.h"
/* GC_MALLOC_CHECK defined means perform validity checks of malloc'd
memory. Can do this only if using gmalloc.c. */
@@ -4939,13 +4940,6 @@ staticpro (varaddress)
abort ();
}
-struct catchtag
-{
- Lisp_Object tag;
- Lisp_Object val;
- struct catchtag *next;
-};
-
\f
/***********************************************************************
Protection from GC
Index: src/eval.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/eval.c,v
retrieving revision 1.315
diff -u -3 -p -r1.315 eval.c
--- src/eval.c 1 Oct 2009 17:47:44 -0000 1.315
+++ src/eval.c 7 Oct 2009 08:26:08 -0000
@@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <http
#include "keyboard.h"
#include "dispextern.h"
#include <setjmp.h>
+#include "catchtag.h"
#if HAVE_X_WINDOWS
#include "xterm.h"
@@ -49,41 +50,6 @@ struct backtrace
struct backtrace *backtrace_list;
-/* This structure helps implement the `catch' and `throw' control
- structure. A struct catchtag contains all the information needed
- to restore the state of the interpreter after a non-local jump.
-
- Handlers for error conditions (represented by `struct handler'
- structures) just point to a catch tag to do the cleanup required
- for their jumps.
-
- catchtag structures are chained together in the C calling stack;
- the `next' member points to the next outer catchtag.
-
- A call like (throw TAG VAL) searches for a catchtag whose `tag'
- member is TAG, and then unbinds to it. The `val' member is used to
- hold VAL while the stack is unwound; `val' is returned as the value
- of the catch form.
-
- All the other members are concerned with restoring the interpreter
- state. */
-
-struct catchtag
-{
- Lisp_Object tag;
- Lisp_Object val;
- struct catchtag *next;
- struct gcpro *gcpro;
- jmp_buf jmp;
- struct backtrace *backlist;
- struct handler *handlerlist;
- int lisp_eval_depth;
- int pdlcount;
- int poll_suppress_count;
- int interrupt_input_blocked;
- struct byte_stack *byte_stack;
-};
-
struct catchtag *catchlist;
#ifdef DEBUG_GCPRO
--- /dev/null 2009-08-21 19:23:04.524086726 -0700
+++ src/catchtag.h 2009-10-07 01:11:39.784950000 -0700
@@ -0,0 +1,57 @@
+/* Structure for implementing the `catch' and `throw' control structure.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef CATCHTAG_H
+#define CATCHTAG_H
+
+/* This structure helps implement the `catch' and `throw' control
+ structure. A struct catchtag contains all the information needed
+ to restore the state of the interpreter after a non-local jump.
+
+ Handlers for error conditions (represented by `struct handler'
+ structures) just point to a catch tag to do the cleanup required
+ for their jumps.
+
+ catchtag structures are chained together in the C calling stack;
+ the `next' member points to the next outer catchtag.
+
+ A call like (throw TAG VAL) searches for a catchtag whose `tag'
+ member is TAG, and then unbinds to it. The `val' member is used to
+ hold VAL while the stack is unwound; `val' is returned as the value
+ of the catch form.
+
+ All the other members are concerned with restoring the interpreter
+ state. */
+
+struct catchtag
+{
+ Lisp_Object tag;
+ Lisp_Object val;
+ struct catchtag *next;
+ struct gcpro *gcpro;
+ jmp_buf jmp;
+ struct backtrace *backlist;
+ struct handler *handlerlist;
+ int lisp_eval_depth;
+ int pdlcount;
+ int poll_suppress_count;
+ int interrupt_input_blocked;
+ struct byte_stack *byte_stack;
+};
+
+#endif /* CATCHTAG_H */
next prev parent reply other threads:[~2009-10-07 8:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200910190430.n9J4UFNE012243@godzilla.ics.uci.edu>
2009-10-05 16:18 ` bug#4643: two different definitions for handlerlist and catchlist in eval.c and alloc.c Dan Nicolaescu
2009-10-07 8:32 ` Dan Nicolaescu [this message]
2009-10-14 6:38 ` bug#4643: two different definitions for " Dan Nicolaescu
2009-10-14 13:45 ` Stefan Monnier
2009-10-14 18:09 ` Dan Nicolaescu
2009-10-15 3:14 ` Stefan Monnier
2009-10-15 3:44 ` Dan Nicolaescu
2009-10-15 12:59 ` Stefan Monnier
2009-10-19 4:40 ` bug#4643: marked as done (two different definitions for handlerlist and catchlist in eval.c and alloc.c) Emacs bug Tracking System
2009-10-19 15:55 bug#4643: two different definitions for catchlist in eval.c and alloc.c Adrian Robert
2009-10-19 16:58 ` Dan Nicolaescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200910070832.n978W0Zi003116@godzilla.ics.uci.edu \
--to=dann@ics.uci.edu \
--cc=4643@emacsbugs.donarmstrong.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.