Attachment "aspect-singleton-list-738900.patch" to
ticket [738900ffff]
added by
aspect
2016-08-19 13:10:47.
Index: generic/tclListObj.c
==================================================================
--- generic/tclListObj.c
+++ generic/tclListObj.c
@@ -1865,10 +1865,38 @@
*elemPtrs++ = valuePtr;
Tcl_IncrRefCount(keyPtr);
Tcl_IncrRefCount(valuePtr);
Tcl_DictObjNext(&search, &keyPtr, &valuePtr, &done);
}
+
+ } else if ((objPtr->typePtr == &tclIntType)
+#ifndef TCL_WIDE_INT_IS_LONG
+ || (objPtr->typePtr == &tclWideIntType)
+#endif
+ || (objPtr->typePtr == &tclBooleanType)
+ || (objPtr->typePtr == &tclDoubleType)
+ || (objPtr->typePtr == &tclBignumType)
+ || (objPtr->typePtr == &tclEndOffsetType)
+/* || (objPtr->typePtr == &tclOneWordHashKeyType) ?? */
+ ) {
+
+ Tcl_Obj *newElem;
+ /*
+ * create a new list consisting of only one element,
+ * which is the original object
+ */
+
+ listRepPtr = AttemptNewList(interp, 1, NULL);
+ if (listRepPtr == NULL) {
+ return TCL_ERROR;
+ }
+ listRepPtr->elemCount = 1;
+ newElem = Tcl_DuplicateObj(objPtr);
+ elemPtrs = &listRepPtr->elements;
+ elemPtrs[0] = newElem;
+ Tcl_IncrRefCount(newElem);
+
} else {
int estCount, length;
const char *limit, *nextElem = TclGetStringFromObj(objPtr, &length);
/*