diff options
author | pooryorick <com.digitalsmarties@pooryorick.com> | 2023-01-27 19:15:09 (GMT) |
---|---|---|
committer | pooryorick <com.digitalsmarties@pooryorick.com> | 2023-01-27 19:15:09 (GMT) |
commit | 7f87f0f8ea86cf01682eb02e4fa8c313dc6ef4ef (patch) | |
tree | 81be27915cd7df508366c56efea412e306fef09e /generic | |
parent | 0318ff75d91a0c0ad84a7738939a99c4567ddc3b (diff) | |
download | tcl-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.c | 3 | ||||
-rw-r--r-- | generic/tclExecute.c | 2 | ||||
-rw-r--r-- | generic/tclNamesp.c | 2 |
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); } } |