summaryrefslogtreecommitdiffstats
path: root/generic/tclStubInit.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-03-21 03:24:08 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-03-21 03:24:08 (GMT)
commit7397eb21b5546e2f2db642b3a7fda20d24bfd70b (patch)
treef4ee1218e335a50e9e0bf7a9228ad49a9ba38649 /generic/tclStubInit.c
parent3e6b1cd7c58db82bcfccf38659be021a9fc2e816 (diff)
downloadtcl-7397eb21b5546e2f2db642b3a7fda20d24bfd70b.zip
tcl-7397eb21b5546e2f2db642b3a7fda20d24bfd70b.tar.gz
tcl-7397eb21b5546e2f2db642b3a7fda20d24bfd70b.tar.bz2
* generic/tclInt.h (tclOriginalNotifier):
* generic/tclStubInit.c (tclOriginalNotifier): * mac/tclMacNotify.c (Tcl_SetTimer,Tcl_WaitForEvent): * unix/tclUnixNotfy.c (Tcl_SetTimer,Tcl_WaitForEvent, Tcl_CreateFileHandler,Tcl_DeleteFileHandler): * win/tclWinNotify.c (Tcl_SetTimer,Tcl_WaitForEvent): Some linkers apparently use a different representation for a pointer to a function within the same compilation unit and a pointer to a function in a different compilation unit. This causes checks like those in the original notifier procedures to fall into infinite loops. The fix is to store pointers to the original notifier procedures in a struct defined in the same compilation unit as the stubs tables, and compare against those values. [Bug 707174]
Diffstat (limited to 'generic/tclStubInit.c')
-rw-r--r--generic/tclStubInit.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index f303e0a..f70c479 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStubInit.c,v 1.79 2003/02/18 02:25:45 hobbs Exp $
+ * RCS: @(#) $Id: tclStubInit.c,v 1.79.2.1 2003/03/21 03:24:08 dgp Exp $
*/
#include "tclInt.h"
@@ -37,6 +37,29 @@
#endif
/*
+ * Keep a record of the original Notifier procedures, created in the
+ * same compilation unit as the stub tables so we can later do reliable,
+ * portable comparisons to see whether a Tcl_SetNotifier() call swapped
+ * new routines into the stub table.
+ */
+
+Tcl_NotifierProcs tclOriginalNotifier = {
+ Tcl_SetTimer,
+ Tcl_WaitForEvent,
+#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
+ Tcl_CreateFileHandler,
+ Tcl_DeleteFileHandler,
+#else
+ NULL,
+ NULL,
+#endif
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+/*
* WARNING: The contents of this file is automatically generated by the
* tools/genStubs.tcl script. Any modifications to the function declarations
* below should be made in the generic/tcl.decls script.