Tcl Source Code

Check-in [bf0cba159d]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

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

Overview
Comment:Update reference counts for searchptr->name.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | tip-421
Files: files | file ages | folders
SHA3-256:bf0cba159d34edc66ddf20b3a83deff86e559485612b42f0e0f2f3b950903acd
User & Date: bll 2018-04-16 13:47:19
Context
2018-04-16
13:47
Update reference counts for searchptr->name. Closed-Leaf check-in: bf0cba159d user: bll tags: tip-421
2018-04-11
12:45
merge 8.7 check-in: 43e01830a9 user: dgp tags: tip-421
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclVar.c.

3093
3094
3095
3096
3097
3098
3099

3100
3101
3102
3103
3104
3105
3106
....
3357
3358
3359
3360
3361
3362
3363

3364
3365
3366
3367
3368
3369
3370
	searchPtr->id = ((ArraySearch *) Tcl_GetHashValue(hPtr))->id + 1;
	searchPtr->nextPtr = Tcl_GetHashValue(hPtr);
    }
    searchPtr->nextEntry = VarHashFirstEntry(varPtr->value.tablePtr,
	    &searchPtr->search);
    Tcl_SetHashValue(hPtr, searchPtr);
    searchPtr->name = Tcl_ObjPrintf("s-%d-%s", searchPtr->id, TclGetString(arrayNameObj));

}

int
ArrayObjNext(
    Tcl_Interp *interp,
    Var *varPtr,                /* array */
    ArraySearch *searchPtr,
................................................................................

  arrayfordone:
    /* if the search was terminated by an array change, the
     * VAR_SEARCH_ACTIVE flag will no longer be set
     */
    if (done != TCL_ERROR) {
      ArrayDoneSearch (iPtr, varPtr, searchPtr);

      ckfree(searchPtr);
    }

    TclDecrRefCount(keyVarObj);
    TclDecrRefCount(valueVarObj);
    TclDecrRefCount(scriptObj);
    return result;







>







 







>







3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
....
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
	searchPtr->id = ((ArraySearch *) Tcl_GetHashValue(hPtr))->id + 1;
	searchPtr->nextPtr = Tcl_GetHashValue(hPtr);
    }
    searchPtr->nextEntry = VarHashFirstEntry(varPtr->value.tablePtr,
	    &searchPtr->search);
    Tcl_SetHashValue(hPtr, searchPtr);
    searchPtr->name = Tcl_ObjPrintf("s-%d-%s", searchPtr->id, TclGetString(arrayNameObj));
    Tcl_IncrRefCount(searchPtr->name);
}

int
ArrayObjNext(
    Tcl_Interp *interp,
    Var *varPtr,                /* array */
    ArraySearch *searchPtr,
................................................................................

  arrayfordone:
    /* if the search was terminated by an array change, the
     * VAR_SEARCH_ACTIVE flag will no longer be set
     */
    if (done != TCL_ERROR) {
      ArrayDoneSearch (iPtr, varPtr, searchPtr);
      Tcl_DecrRefCount(searchPtr->name);
      ckfree(searchPtr);
    }

    TclDecrRefCount(keyVarObj);
    TclDecrRefCount(valueVarObj);
    TclDecrRefCount(scriptObj);
    return result;