From 677e2a7e44b30de000a5a2738b988e521077c567 Mon Sep 17 00:00:00 2001 From: jenglish Date: Sun, 20 Nov 2005 18:23:02 +0000 Subject: Don't set tclStubsPtr to 0 when Tcl_PkgRequireEx() fails [Fix for #1091431 "Tcl_InitStubs failure crashes wish"] FossilOrigin-Name: e9675e462c170b4e7c9e2b4ab4da420cd2bf04a3 --- ChangeLog | 6 ++++++ generic/tclStubLib.c | 12 ++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2838024..0c5ff97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-20 Joe English + + * 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 * tests/trace.test (trace-34.5): [Bug 1047286], added a second diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index c650dac..466a003 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.6 2002/12/04 07:07:59 hobbs Exp $ + * RCS: @(#) $Id: tclStubLib.c,v 1.6.2.1 2005/11/20 18:23:03 jenglish Exp $ */ /* @@ -33,9 +33,6 @@ * 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; @@ -87,7 +84,7 @@ Tcl_InitStubs (interp, version, exact) int exact; { CONST char *actualVersion = NULL; - TclStubs *tmp; + ClientData pkgData = NULL; /* * We can't optimize this check by caching tclStubsPtr because @@ -100,12 +97,11 @@ Tcl_InitStubs (interp, version, exact) return NULL; } - actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, exact, - (ClientData *) &tmp); + 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; -- cgit v0.12