summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2005-11-20 18:33:17 (GMT)
committerjenglish <jenglish@flightlab.com>2005-11-20 18:33:17 (GMT)
commit0dfe0c9693046ad3717fbbe2682c80d0e0633cce (patch)
tree17e3ec3f8a7d4b729da085b559e7fee0aed8f1ee
parentb4d32ce24806c04ec6f66a41be1e1e8419f3e25f (diff)
downloadtcl-0dfe0c9693046ad3717fbbe2682c80d0e0633cce.zip
tcl-0dfe0c9693046ad3717fbbe2682c80d0e0633cce.tar.gz
tcl-0dfe0c9693046ad3717fbbe2682c80d0e0633cce.tar.bz2
Don't set tclStubsPtr to 0 when Tcl_PkgRequireEx() fails
[Fix for #1091431 "Tcl_InitStubs failure crashes wish"]
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclStubLib.c28
2 files changed, 10 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a807f2..608bef5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-11-20 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/tclStubLib.c: Don't set tclStubsPtr to 0 when
+ Tcl_PkgRequireEx() fails [Fix for #1091431 "Tcl_InitStubs failure
+ crashes wish"]
+
2005-11-18 Miguel Sofer <msofer@users.sf.net>
* tests/trace.test (trace-34.5): [Bug 1047286], added a second
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c
index 369a73a..98b3255 100644
--- a/generic/tclStubLib.c
+++ b/generic/tclStubLib.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStubLib.c,v 1.9 2005/11/02 14:51:05 dkf Exp $
+ * RCS: @(#) $Id: tclStubLib.c,v 1.10 2005/11/20 18:33:17 jenglish Exp $
*/
/*
@@ -32,16 +32,11 @@
* functions should be built as non-exported symbols.
*/
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLEXPORT
-
TclStubs *tclStubsPtr = NULL;
TclPlatStubs *tclPlatStubsPtr = NULL;
TclIntStubs *tclIntStubsPtr = NULL;
TclIntPlatStubs *tclIntPlatStubsPtr = NULL;
-static TclStubs * HasStubSupport(Tcl_Interp *interp);
-
static TclStubs *
HasStubSupport(
Tcl_Interp *interp)
@@ -87,8 +82,7 @@ Tcl_InitStubs(
int exact)
{
CONST char *actualVersion = NULL;
- TclStubs *tmp;
- TclStubs **tmpp;
+ ClientData pkgData = NULL;
/*
* We can't optimize this check by caching tclStubsPtr because that
@@ -101,17 +95,11 @@ Tcl_InitStubs(
return NULL;
}
- /*
- * This is needed to satisfy GCC 3.3's strict aliasing rules.
- */
-
- tmpp = &tmp;
- actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, exact,
- (ClientData *) tmpp);
+ actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, exact, &pkgData);
if (actualVersion == NULL) {
- tclStubsPtr = NULL;
return NULL;
}
+ tclStubsPtr = (TclStubs*)pkgData;
if (tclStubsPtr->hooks) {
tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;
@@ -125,11 +113,3 @@ Tcl_InitStubs(
return actualVersion;
}
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 4
- * fill-column: 78
- * End:
- */