Tcl Source Code

Check-in [9642b8388f]
Login

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

Overview
Comment:Have assembler use same index value parser as the bytecode compiler.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | bug-db36fa5122
Files: files | file ages | folders
SHA3-256: 9642b8388fe4e5dae324482d06096a4cfa3aaacba91bd5a978ebb9eb330050ae
User & Date: dgp 2018-03-06 20:27:39.596
Context
2018-03-06
20:59
rework error handling to keep test suite happy. check-in: 6723fc3cc9 user: dgp tags: bug-db36fa5122
20:27
Have assembler use same index value parser as the bytecode compiler. check-in: 9642b8388f user: dgp tags: bug-db36fa5122
20:09
New internal routine TclGetEndOffsetFromObj. check-in: 0adb97c70d user: dgp tags: bug-db36fa5122
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/tclAssembly.c.
2244
2245
2246
2247
2248
2249
2250
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
    CompileEnv* envPtr = assemEnvPtr->envPtr;
				/* Compilation environment */
    Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
				/* Tcl interpreter */
    Tcl_Token* tokenPtr = *tokenPtrPtr;
				/* INOUT: Pointer to the next token in the
				 * source code */
    Tcl_Obj* intObj;		/* Integer from the source code */
    int status;			/* Tcl status return */

    /*
     * Extract the next token as a string.
     */

    if (GetNextOperand(assemEnvPtr, tokenPtrPtr, &intObj) != TCL_OK) {
	return TCL_ERROR;
    }

    /*
     * Convert to an integer, advance to the next token and return.
     */

    status = TclGetIntForIndex(interp, intObj, -2, result);
    Tcl_DecrRefCount(intObj);
    *tokenPtrPtr = TokenAfter(tokenPtr);





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







<
<
<
<
<
<
<
<
<
<




|
<
<

>
>
>
>
>







2244
2245
2246
2247
2248
2249
2250










2251
2252
2253
2254
2255


2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
    CompileEnv* envPtr = assemEnvPtr->envPtr;
				/* Compilation environment */
    Tcl_Interp* interp = (Tcl_Interp*) envPtr->iPtr;
				/* Tcl interpreter */
    Tcl_Token* tokenPtr = *tokenPtrPtr;
				/* INOUT: Pointer to the next token in the
				 * source code */











    /*
     * Convert to an integer, advance to the next token and return.
     */
    int status = TclGetIndexFromToken(tokenPtr, result);


    *tokenPtrPtr = TokenAfter(tokenPtr);
    if (status == TCL_ERROR && interp) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"unsupported index value: \"%.*s\"", tokenPtr->size,
		tokenPtr->start));
    }
    return status;
}

/*
 *-----------------------------------------------------------------------------
 *
 * FindLocalVar --