summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c3
-rw-r--r--generic/tclExecute.c2
-rw-r--r--generic/tclNamesp.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 669b1ca..1dbd90b 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -9029,6 +9029,7 @@ TclNRYieldToObjCmd(
*/
iPtr->execEnvPtr = corPtr->callerEEPtr;
+ /* Not calling Tcl_IncrRefCount(listPtr) here because listPtr is private */
TclSetTailcall(interp, listPtr);
corPtr->yieldPtr = listPtr;
iPtr->execEnvPtr = corPtr->eePtr;
@@ -9231,8 +9232,8 @@ TclNRCoroutineActivateCallback(
if (corPtr->yieldPtr) {
for (runPtr = TOP_CB(interp); runPtr; runPtr = runPtr->nextPtr) {
if (runPtr->data[1] == corPtr->yieldPtr) {
+ Tcl_DecrRefCount((Tcl_Obj *)runPtr->data[1]);
runPtr->data[1] = NULL;
- Tcl_DecrRefCount(corPtr->yieldPtr);
corPtr->yieldPtr = NULL;
break;
}
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index ee9a4ce..1e23517 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2447,8 +2447,8 @@ TEBCresume(
* 'yieldParameter').
*/
- Tcl_IncrRefCount(valuePtr);
iPtr->execEnvPtr = corPtr->callerEEPtr;
+ Tcl_IncrRefCount(valuePtr);
TclSetTailcall(interp, valuePtr);
corPtr->yieldPtr = valuePtr;
iPtr->execEnvPtr = corPtr->eePtr;
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 1882e0a..65e2a77 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -417,6 +417,8 @@ Tcl_PopCallFrame(
framePtr->nsPtr = NULL;
if (framePtr->tailcallPtr) {
+ /* Reusing the existing reference count from framePtr->tailcallPtr, so
+ * no need to Tcl_IncrRefCount(framePtr->tailcallPtr)*/
TclSetTailcall(interp, framePtr->tailcallPtr);
}
}