summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-07-07 07:48:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-07-07 07:48:53 (GMT)
commit72476cdd50825cebaea367188325e69ea5a8ff40 (patch)
tree52448af5d0bd3975ccd1af4b672ca33a90507530 /generic/tclBasic.c
parent7519883347a28417d8c6d8a3de4460386f66ad29 (diff)
parent0aa3b5113db3c6c750aa4bbcfdb657dec48c0de1 (diff)
downloadtcl-72476cdd50825cebaea367188325e69ea5a8ff40.zip
tcl-72476cdd50825cebaea367188325e69ea5a8ff40.tar.gz
tcl-72476cdd50825cebaea367188325e69ea5a8ff40.tar.bz2
Merge core-8-6-branch:
New tests to demo the remaining flaw in ensemble dispatch revisions. Itcl 4 also demonstrated these [bd7f17bce8] Revise ensemble dispatch to call TclNREvalObjv() which supports the TCL_EVAL_INVOKE Simplify all the Tcl_NRPostProc declarations Create and use a utility Tcl_NRPostProc when decr ref count of values is all that is needed Bugfix [5d7ea04580]. Treat .cmd and .ps1 files are executable on Windows
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index e3ac714..a0b5505 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -128,7 +128,7 @@ static void MathFuncWrongNumArgs(Tcl_Interp *interp, int expected,
int actual, Tcl_Obj *const *objv);
static Tcl_NRPostProc NRCoroutineCallerCallback;
static Tcl_NRPostProc NRCoroutineExitCallback;
-static int NRCommand(ClientData data[], Tcl_Interp *interp, int result);
+static Tcl_NRPostProc NRCommand;
static Tcl_ObjCmdProc OldMathFuncProc;
static void OldMathFuncDeleteProc(ClientData clientData);
@@ -146,7 +146,6 @@ static int TEOV_RunEnterTraces(Tcl_Interp *interp,
Command **cmdPtrPtr, Tcl_Obj *commandPtr, int objc,
Tcl_Obj *const objv[]);
static Tcl_NRPostProc RewindCoroutineCallback;
-static Tcl_NRPostProc TailcallCleanup;
static Tcl_NRPostProc TEOEx_ByteCodeCallback;
static Tcl_NRPostProc TEOEx_ListCallback;
static Tcl_NRPostProc TEOV_Error;
@@ -8372,7 +8371,7 @@ TclNRTailcallEval(
* a now-gone namespace: cleanup and return.
*/
- TailcallCleanup(data, interp, result);
+ Tcl_DecrRefCount(listPtr);
return result;
}
@@ -8381,18 +8380,26 @@ TclNRTailcallEval(
*/
TclMarkTailcall(interp);
- TclNRAddCallback(interp, TailcallCleanup, listPtr, NULL, NULL,NULL);
+ TclNRAddCallback(interp, TclNRReleaseValues, listPtr, NULL, NULL,NULL);
iPtr->lookupNsPtr = (Namespace *) nsPtr;
return TclNREvalObjv(interp, objc-1, objv+1, 0, NULL);
}
-static int
-TailcallCleanup(
+int
+TclNRReleaseValues(
ClientData data[],
Tcl_Interp *interp,
int result)
{
- Tcl_DecrRefCount((Tcl_Obj *) data[0]);
+ int i = 0;
+ while (i < 4) {
+ if (data[i]) {
+ Tcl_DecrRefCount((Tcl_Obj *) data[i]);
+ } else {
+ break;
+ }
+ i++;
+ }
return result;
}