Tcl Source Code

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

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

Overview
Comment:Newer utility routine is more suitable.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-db36fa5122
Files: files | file ages | folders
SHA3-256: b864232e485f905c731d2b39b85e82dfb933ded71b8f5ef5593b80e9f5a888cd
User & Date: dgp 2018-03-09 20:46:54
Context
2018-03-09
20:58
merge 8.6 check-in: c6324a5f20 user: dgp tags: bug-db36fa5122
20:46
Newer utility routine is more suitable. check-in: b864232e48 user: dgp tags: bug-db36fa5122
20:34
Update the command compilers and bytecode execution engine to use new machinery. check-in: 4d0f21f455 user: dgp tags: bug-db36fa5122
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclAssembly.c.

2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273


2274
2275
2276
2277
2278
2279
2280
    Tcl_Obj *value;
    int status;

    /* General operand validity check */
    if (GetNextOperand(assemEnvPtr, tokenPtrPtr, &value) != TCL_OK) {
	return TCL_ERROR;
    }
    Tcl_DecrRefCount(value);
     
    /* Convert to an integer, advance to the next token and return. */
    /*
     * NOTE: Indexing a list with an index before it yields the
     * same result as indexing after it, and might be more easily portable
     * when list size limits grow.
     */
    status = TclGetIndexFromToken(tokenPtr, TCL_INDEX_BEFORE,
	    TCL_INDEX_BEFORE, result);
    *tokenPtrPtr = TokenAfter(tokenPtr);
    if (status == TCL_ERROR && interp) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%.*s\"",
		tokenPtr->size, tokenPtr->start));
	Tcl_SetErrorCode(interp, "TCL", "ASSEM", "BADINDEX", NULL);
    }


    return status;
}
 
/*
 *-----------------------------------------------------------------------------
 *
 * FindLocalVar --






<







|
|
<
<
<
<
<
|
>
>







2251
2252
2253
2254
2255
2256
2257

2258
2259
2260
2261
2262
2263
2264
2265
2266





2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
    Tcl_Obj *value;
    int status;

    /* General operand validity check */
    if (GetNextOperand(assemEnvPtr, tokenPtrPtr, &value) != TCL_OK) {
	return TCL_ERROR;
    }

     
    /* Convert to an integer, advance to the next token and return. */
    /*
     * NOTE: Indexing a list with an index before it yields the
     * same result as indexing after it, and might be more easily portable
     * when list size limits grow.
     */
    status = TclIndexEncode(interp, value,
	    TCL_INDEX_BEFORE,TCL_INDEX_BEFORE, result);






    Tcl_DecrRefCount(value);
    *tokenPtrPtr = TokenAfter(tokenPtr);
    return status;
}
 
/*
 *-----------------------------------------------------------------------------
 *
 * FindLocalVar --