summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2009-03-21 03:43:53 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2009-03-21 03:43:53 (GMT)
commit4ff9be7699dc5b15cd2272692d62e89432866d64 (patch)
treee8eb405ce3cc2c78da76dcf2b42729c819463893 /generic
parentb694e6b4fab8a3ac24df527d0ce9d9089c215316 (diff)
downloadtcl-4ff9be7699dc5b15cd2272692d62e89432866d64.zip
tcl-4ff9be7699dc5b15cd2272692d62e89432866d64.tar.gz
tcl-4ff9be7699dc5b15cd2272692d62e89432866d64.tar.bz2
* generic/tclExecute.c: fix both test and code for tailcall
* tests/tailcall.test: from within a compiled [eval] body.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 5e8b1a7..56bace2 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.430 2009/03/20 14:43:27 dgp Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.431 2009/03/21 03:43:53 msofer Exp $
*/
#include "tclInt.h"
@@ -1992,6 +1992,14 @@ TclExecuteByteCode(
/*NRE_ASSERT(iPtr->cmdFramePtr == bcFramePtr);*/
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
+ /*
+ * If the CallFrame is marked as tailcalling, keep tailcalling
+ */
+
+ if (iPtr->varFramePtr->tailcallPtr) {
+ goto abnormalReturn;
+ }
+
if (iPtr->execEnvPtr->rewind) {
result = TCL_ERROR;
goto abnormalReturn;