diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2013-01-03 14:07:24 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2013-01-03 14:07:24 (GMT) |
| commit | 830a18d4d8114998c98667bceaa37e2f084503ff (patch) | |
| tree | 54dad526f36acf29f43fabc0987a1a640026950d /generic/tclStubLib.c | |
| parent | bc87bbb4d9b94ea5b2716adde55d18f632b82768 (diff) | |
| parent | ec27f9439e22b89d891eda22d06f2840aafbcb10 (diff) | |
| download | tcl-830a18d4d8114998c98667bceaa37e2f084503ff.zip tcl-830a18d4d8114998c98667bceaa37e2f084503ff.tar.gz tcl-830a18d4d8114998c98667bceaa37e2f084503ff.tar.bz2 | |
merge main dev branch
Diffstat (limited to 'generic/tclStubLib.c')
| -rw-r--r-- | generic/tclStubLib.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index a9d0f02..859cbf9 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -23,22 +23,8 @@ const TclPlatStubs *tclPlatStubsPtr = NULL; const TclIntStubs *tclIntStubsPtr = NULL; const TclIntPlatStubs *tclIntPlatStubsPtr = NULL; -static const TclStubs * -HasStubSupport( - Tcl_Interp *interp) -{ - Interp *iPtr = (Interp *) interp; - - if (iPtr->stubTable && (iPtr->stubTable->magic == TCL_STUB_MAGIC)) { - return iPtr->stubTable; - } - iPtr->result = (char *) "interpreter uses an incompatible stubs mechanism"; - iPtr->freeProc = TCL_STATIC; - return NULL; -} - /* - * Use our own isdigit to avoid linking to libc on windows + * Use our own isDigit to avoid linking to libc on windows */ static int isDigit(const int c) @@ -70,9 +56,10 @@ Tcl_InitStubs( const char *version, int exact) { + Interp *iPtr = (Interp *) interp; const char *actualVersion = NULL; ClientData pkgData = NULL; - const TclStubs *stubsPtr; + const TclStubs *stubsPtr = iPtr->stubTable; /* * We can't optimize this check by caching tclStubsPtr because that @@ -80,8 +67,9 @@ Tcl_InitStubs( * times. [Bug 615304] */ - stubsPtr = HasStubSupport(interp); - if (!stubsPtr) { + if (!stubsPtr || (stubsPtr->magic != TCL_STUB_MAGIC)) { + iPtr->result = "interpreter uses an incompatible stubs mechanism"; + iPtr->freeProc = TCL_STATIC; return NULL; } |
