Tcl Source Code

Check-in [df82243aa5]
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix Namespace reference counting error in TclRenameCommand.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-e593adf103-core-8
Files: files | file ages | folders
SHA3-256: df82243aa575d357bf18f27d9c714313acbb0f5b99874ec7879741e1b83d5b52
User & Date: pooryorick 2018-05-21 20:19:40
Context
2018-05-26
04:16
Move refCount management of lookupNsPtr out of "resolve:/goto resolve" block. check-in: 8d4c3590c5 user: pooryorick tags: bug-e593adf103-core-8
2018-05-21
20:19
Fix Namespace reference counting error in TclRenameCommand. check-in: df82243aa5 user: pooryorick tags: bug-e593adf103-core-8
10:02
merge core-8-branch check-in: 70e385378b user: pooryorick tags: bug-e593adf103-core-8
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclBasic.c.

2705
2706
2707
2708
2709
2710
2711
2712

2713
2714
2715
2716
2717
2718
2719
    if (result != TCL_OK) {
	Tcl_DeleteHashEntry(cmdPtr->hPtr);
	cmdPtr->hPtr = oldHPtr;
	/* reference count was already incremented above */
	cmdPtr->nsPtr = cmdNsPtr;
	goto done;
    } else {
	cmdPtr->nsPtr->refCount++;

    }

    /*
     * The list of command exported from the namespace might have changed.
     * However, we do not need to recompute this just yet; next time we need
     * the info will be soon enough. These might refer to the same variable,
     * but that's no big deal.






|
>







2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
    if (result != TCL_OK) {
	Tcl_DeleteHashEntry(cmdPtr->hPtr);
	cmdPtr->hPtr = oldHPtr;
	/* reference count was already incremented above */
	cmdPtr->nsPtr = cmdNsPtr;
	goto done;
    } else {
	newNsPtr->refCount++;
	TclNsDecrRefCount(cmdNsPtr);
    }

    /*
     * The list of command exported from the namespace might have changed.
     * However, we do not need to recompute this just yet; next time we need
     * the info will be soon enough. These might refer to the same variable,
     * but that's no big deal.