summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2010-08-30 14:02:09 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2010-08-30 14:02:09 (GMT)
commit2af0652a1208ff8714ab22a714c0b7e78eb15569 (patch)
tree5b8a101944274a127a5d4ca47620a73473d4569b /generic/tclNamesp.c
parent032b83a9791f959f924d7b63e708c3bd5d3a626b (diff)
downloadtcl-2af0652a1208ff8714ab22a714c0b7e78eb15569.zip
tcl-2af0652a1208ff8714ab22a714c0b7e78eb15569.tar.gz
tcl-2af0652a1208ff8714ab22a714c0b7e78eb15569.tar.bz2
* generic/tclBasic.c: New implementation for [tailcall]:
* generic/tclCmdAH.c: it now schedules the command and returns * generic/tclCmdMZ.c: TCL_RETURN. This fixes all issues with * generic/tclExecute.c: [catch] and [try] - [Bug 3046594], * generic/tclInt.h: [Bug 3047235] and [Bug 3048771]. Thanks * generic/tclNamesp.c: dgp for exploring the dark corners. * tests/tailcall.test: More thorough testing is required.
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 5bd3c24..6961fd5 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -22,7 +22,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.211 2010/08/18 22:33:27 msofer Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.212 2010/08/30 14:02:10 msofer Exp $
*/
#include "tclInt.h"
@@ -313,18 +313,7 @@ Tcl_PushCallFrame(
framePtr->compiledLocals = NULL;
framePtr->clientData = NULL;
framePtr->localCachePtr = NULL;
-
- /*
- * Record the top of the callback stack, so that tailcall can identify
- * the spot where to splice the new command.
- */
-
- if (iPtr->execEnvPtr) {
- framePtr->wherePtr = TOP_CB(interp);
- } else {
- framePtr->wherePtr = NULL;
- }
-
+ framePtr->tailcallPtr = NULL;
/*
* Push the new call frame onto the interpreter's stack of procedure call
@@ -403,6 +392,10 @@ Tcl_PopCallFrame(
Tcl_DeleteNamespace((Tcl_Namespace *) nsPtr);
}
framePtr->nsPtr = NULL;
+
+ if (framePtr->tailcallPtr) {
+ TclSpliceTailcall(interp, framePtr->tailcallPtr);
+ }
}
/*