Tcl Source Code

Check-in [92e1b73cd8]
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:Reduce the "clever" factor. (Fine line between clever and stupid.)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-db36fa5122
Files: files | file ages | folders
SHA3-256: 92e1b73cd88ffc769e4c00e59f9f9c14d93671af0d6e2b3fe107db229406ca66
User & Date: dgp 2018-03-08 02:28:49
Context
2018-03-08
17:26
Rollback the stealth change to [lreplace a 1 1] in Tcl 8.6.6. [409ea17e37]. Scratch rewrite of the [... check-in: a765812bfc user: dgp tags: bug-db36fa5122
02:28
Reduce the "clever" factor. (Fine line between clever and stupid.) check-in: 92e1b73cd8 user: dgp tags: bug-db36fa5122
2018-03-07
21:45
Streamline index decoding in INST_STR_RANGE_IMM execution. check-in: bb66d42b7b user: dgp tags: bug-db36fa5122
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclExecute.c.

5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
....
5089
5090
5091
5092
5093
5094
5095

5096

5097
5098
5099
5100
5101
5102
5103
				 * stream */

	/*
	 * Pop the list and get the index.
	 */

	valuePtr = OBJ_AT_TOS;
	opnd = TclGetInt4AtPtr(pc+1);
	TRACE(("\"%.30s\" %d => ", O2S(valuePtr), opnd));

	/*
	 * Get the contents of the list, making sure that it really is a list
	 * in the process.
	 */

	if (TclListObjGetElements(interp, valuePtr, &objc, &objv) != TCL_OK) {
................................................................................
	    goto gotError;
	}

	/*
	 * Decode end-offset index values.
	 */


	index = opnd + (opnd <= TCL_INDEX_END)*(objc - 1 - TCL_INDEX_END);

	pcAdjustment = 5;

    lindexFastPath:
	if (index >= 0 && index < objc) {
	    objResultPtr = objv[index];
	} else {
	    TclNewObj(objResultPtr);






|
|







 







>
|
>







5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
....
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
				 * stream */

	/*
	 * Pop the list and get the index.
	 */

	valuePtr = OBJ_AT_TOS;
	index = TclGetInt4AtPtr(pc+1);
	TRACE(("\"%.30s\" %d => ", O2S(valuePtr), index));

	/*
	 * Get the contents of the list, making sure that it really is a list
	 * in the process.
	 */

	if (TclListObjGetElements(interp, valuePtr, &objc, &objv) != TCL_OK) {
................................................................................
	    goto gotError;
	}

	/*
	 * Decode end-offset index values.
	 */

	if (index <= TCL_INDEX_END) {
	    index += (objc - 1 - TCL_INDEX_END);
	}
	pcAdjustment = 5;

    lindexFastPath:
	if (index >= 0 && index < objc) {
	    objResultPtr = objv[index];
	} else {
	    TclNewObj(objResultPtr);