Tcl Source Code

Check-in [e7adc1255d]
Login

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

Overview
Comment:Tolerate NULL interps more completely.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: e7adc1255dc3eb70d35921783bdbb7957deadff6
User & Date: dgp 2011-05-05 16:53:56
Context
2011-05-06
07:54
comment fix check-in: c7d2de48fa user: jan.nijtmans tags: core-8-5-branch
2011-05-05
18:28
Stop generating string rep of dict when converting to list. Tolerate NULL interps more completely. check-in: 849162b0bf user: dgp tags: trunk
18:00
Disable all the special case code in place to prevent allocation of a List struct for empty lists as... check-in: cc113f7cfe user: dgp tags: dgp-list-simplify
16:53
Tolerate NULL interps more completely. check-in: e7adc1255d user: dgp tags: core-8-5-branch
16:35
Stop generating string rep of dict when converting to list. check-in: 746b228680 user: dgp tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1
2
3
4
5
6
7
8
9
10
11
2011-05-05  Don Porter  <[email protected]>

	* generic/tclListObj.c:	Stop generating string rep of dict when
	converting to list.

2011-05-03  Don Porter  <[email protected]>

	* generic/tclUtil.c:	Tighten Tcl_SplitList().
	* generic/tclListObj.c:	Tighten SetListFromAny().
	* generic/tclDictObj.c:	Tighten SetDictFromAny().




|







1
2
3
4
5
6
7
8
9
10
11
2011-05-05  Don Porter  <[email protected]>

	* generic/tclListObj.c:	Stop generating string rep of dict when
	converting to list.  Tolerate NULL interps more completely.

2011-05-03  Don Porter  <[email protected]>

	* generic/tclUtil.c:	Tighten Tcl_SplitList().
	* generic/tclListObj.c:	Tighten SetListFromAny().
	* generic/tclDictObj.c:	Tighten SetDictFromAny().

Changes to generic/tclListObj.c.

1396
1397
1398
1399
1400
1401
1402

1403
1404

1405
1406
1407
1408
1409
1410
1411
	    indexArray++;
	    break;
	}
	indexArray++;

	if (index < 0 || index >= elemCount) {
	    /* ...the index points outside the sublist. */

	    Tcl_SetObjResult(interp,
		    Tcl_NewStringObj("list index out of range", -1));

	    break;
	}

	/*
	 * No error conditions.  As long as we're not yet on the last
	 * index, determine the next sublist for the next pass through
	 * the loop, and take steps to make sure it is an unshared copy,







>
|
|
>







1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
	    indexArray++;
	    break;
	}
	indexArray++;

	if (index < 0 || index >= elemCount) {
	    /* ...the index points outside the sublist. */
	    if (interp != NULL) {
		Tcl_SetObjResult(interp,
			Tcl_NewStringObj("list index out of range", -1));
	    }
	    break;
	}

	/*
	 * No error conditions.  As long as we're not yet on the last
	 * index, determine the next sublist for the next pass through
	 * the loop, and take steps to make sure it is an unshared copy,
1553
1554
1555
1556
1557
1558
1559

1560
1561

1562
1563
1564
1565
1566
1567
1568

	if (listPtr->typePtr == &tclDictType) {
	    (void) Tcl_DictObjSize(NULL, listPtr, &length);
	} else {
	    (void) TclGetStringFromObj(listPtr, &length);
	}
	if (!length) {

	    Tcl_SetObjResult(interp,
		    Tcl_NewStringObj("list index out of range", -1));

	    return TCL_ERROR;
	}
	result = SetListFromAny(interp, listPtr);
	if (result != TCL_OK) {
	    return result;
	}
    }







>
|
|
>







1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572

	if (listPtr->typePtr == &tclDictType) {
	    (void) Tcl_DictObjSize(NULL, listPtr, &length);
	} else {
	    (void) TclGetStringFromObj(listPtr, &length);
	}
	if (!length) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp,
			Tcl_NewStringObj("list index out of range", -1));
	    }
	    return TCL_ERROR;
	}
	result = SetListFromAny(interp, listPtr);
	if (result != TCL_OK) {
	    return result;
	}
    }