From d769538676cb8b26781e89f7ac1cb5dad28aa999 Mon Sep 17 00:00:00 2001 From: mig Date: Thu, 18 Oct 2012 17:38:19 +0000 Subject: * generic/tclBasic.c (TclNRCoroutineObjCmd): insure that numlevels are properly set, fix bug discovered by dkf and reported at http://code.activestate.com/lists/tcl-core/12213/ --- ChangeLog | 6 ++++++ generic/tclBasic.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bafd366..edb7268 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-10-17 Miguel Sofer + + * generic/tclBasic.c (TclNRCoroutineObjCmd): insure that numlevels + are properly set, fix bug discovered by dkf and reported at + http://code.activestate.com/lists/tcl-core/12213/ + 2012-10-16 Donal K. Fellows IMPLEMENTATION OF TIP#405 diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 7c08f2f..3848d5b 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -9028,7 +9028,6 @@ TclNRCoroutineObjCmd( corPtr->running.lineLABCPtr = corPtr->lineLABCPtr; corPtr->stackLevel = NULL; corPtr->auxNumLevels = 0; - iPtr->numLevels--; /* * Create the coro's execEnv, switch to it to push the exit and coro @@ -9047,16 +9046,17 @@ TclNRCoroutineObjCmd( TclNRAddCallback(interp, NRCoroutineExitCallback, corPtr, NULL, NULL, NULL); + /* insure that the command is looked up in the correct namespace */ iPtr->lookupNsPtr = lookupNsPtr; Tcl_NREvalObj(interp, Tcl_NewListObj(objc-2, objv+2), 0); + iPtr->numLevels--; SAVE_CONTEXT(corPtr->running); RESTORE_CONTEXT(corPtr->caller); iPtr->execEnvPtr = corPtr->callerEEPtr; /* - * Now just resume the coroutine. Take care to insure that the command is - * looked up in the correct namespace. + * Now just resume the coroutine. */ TclNRAddCallback(interp, NRCoroutineActivateCallback, corPtr, -- cgit v0.12 From 3d737d62cf9052d88fc73809b3e3104e047f992f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 23 Oct 2012 21:45:51 +0000 Subject: Remove unused TclpLoadFile function. --- ChangeLog | 5 +++++ generic/tclIOUtil.c | 43 ------------------------------------------- generic/tclInt.h | 6 ------ 3 files changed, 5 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3793786..87893c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-10-23 Jan Nijtmans + + * generic/tclInt.h: Remove unused TclpLoadFile function. + * generic/tclIOUtil.c + 2012-10-14 Jan Nijtmans * generic/tclDictObj.c: [Bug 3576509]: tcl::Bgerror crashes with invalid diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 348e7bf..1e600cd 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -3438,49 +3438,6 @@ TclLoadFile( } return TCL_OK; } -/* - * This function used to be in the platform specific directories, but it has - * now been made to work cross-platform - */ - -int -TclpLoadFile( - Tcl_Interp *interp, /* Used for error reporting. */ - Tcl_Obj *pathPtr, /* Name of the file containing the desired - * code (UTF-8). */ - const char *sym1, CONST char *sym2, - /* Names of two functions to look up in the - * file's symbol table. */ - Tcl_PackageInitProc **proc1Ptr, Tcl_PackageInitProc **proc2Ptr, - /* Where to return the addresses corresponding - * to sym1 and sym2. */ - ClientData *clientDataPtr, /* Filled with token for dynamically loaded - * file which will be passed back to - * (*unloadProcPtr)() to unload the file. */ - Tcl_FSUnloadFileProc **unloadProcPtr) - /* Filled with address of Tcl_FSUnloadFileProc - * function which should be used for this - * file. */ -{ - Tcl_LoadHandle handle = NULL; - int res; - - res = TclpDlopen(interp, pathPtr, &handle, unloadProcPtr); - - if (res != TCL_OK) { - return res; - } - - if (handle == NULL) { - return TCL_ERROR; - } - - *clientDataPtr = (ClientData) handle; - - *proc1Ptr = TclpFindSymbol(interp, handle, sym1); - *proc2Ptr = TclpFindSymbol(interp, handle, sym2); - return TCL_OK; -} /* *--------------------------------------------------------------------------- diff --git a/generic/tclInt.h b/generic/tclInt.h index cca9938..3037ddb 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2732,12 +2732,6 @@ MODULE_SCOPE void TclpInitLibraryPath(char **valuePtr, MODULE_SCOPE void TclpInitLock(void); MODULE_SCOPE void TclpInitPlatform(void); MODULE_SCOPE void TclpInitUnlock(void); -MODULE_SCOPE int TclpLoadFile(Tcl_Interp *interp, Tcl_Obj *pathPtr, - const char *sym1, const char *sym2, - Tcl_PackageInitProc **proc1Ptr, - Tcl_PackageInitProc **proc2Ptr, - ClientData *clientDataPtr, - Tcl_FSUnloadFileProc **unloadProcPtr); MODULE_SCOPE Tcl_Obj * TclpObjListVolumes(void); MODULE_SCOPE void TclpMasterLock(void); MODULE_SCOPE void TclpMasterUnlock(void); -- cgit v0.12