summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2023-01-27 19:15:09 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2023-01-27 19:15:09 (GMT)
commit7f87f0f8ea86cf01682eb02e4fa8c313dc6ef4ef (patch)
tree81be27915cd7df508366c56efea412e306fef09e /generic
parent0318ff75d91a0c0ad84a7738939a99c4567ddc3b (diff)
downloadtcl-7f87f0f8ea86cf01682eb02e4fa8c313dc6ef4ef.zip
tcl-7f87f0f8ea86cf01682eb02e4fa8c313dc6ef4ef.tar.gz
tcl-7f87f0f8ea86cf01682eb02e4fa8c313dc6ef4ef.tar.bz2
Add some comments and tidy code.
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 bea5996..cdaf6fe 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -9716,6 +9716,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;
@@ -9918,8 +9919,8 @@ TclNRCoroutineActivateCallback(
if (corPtr->yieldPtr) {
for (runPtr = TOP_CB(interp); runPtr; runPtr = runPtr->nextPtr) {
if (runPtr->data[1] == corPtr->yieldPtr) {
+ Tcl_DecrRefCount(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 ec144a2..7ee5471 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2503,8 +2503,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 6269bbe..5a2979e 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);
}
}