diff options
-rw-r--r-- | generic/tclExecute.c | 10 | ||||
-rw-r--r-- | generic/tclListObj.c | 14 |
2 files changed, 8 insertions, 16 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 188eadc..5d29db9 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5076,8 +5076,8 @@ TEBCresume( */ valuePtr = OBJ_AT_TOS; - index = TclGetInt4AtPtr(pc+1); - TRACE(("\"%.30s\" %d => ", O2S(valuePtr), index)); + opnd = TclGetInt4AtPtr(pc+1); + TRACE(("\"%.30s\" %d => ", O2S(valuePtr), opnd)); /* * Get the contents of the list, making sure that it really is a list @@ -5089,11 +5089,9 @@ TEBCresume( goto gotError; } - /* - * Decode end-offset index values. - */ + /* Decode end-offset index values. */ - index = TclIndexDecode(index, objc - 1); + index = TclIndexDecode(opnd, objc - 1); pcAdjustment = 5; lindexFastPath: diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 0d37821..786e1ce 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1145,17 +1145,11 @@ TclLindexList( return TclLindexFlat(interp, listPtr, 1, &argPtr); } - if (indexListCopy->typePtr == &tclListType) { - List *listRepPtr = ListRepPtr(indexListCopy); + { + int indexCount = -1; /* Size of the array of list indices. */ + Tcl_Obj **indices = NULL; /* Array of list indices. */ - listPtr = TclLindexFlat(interp, listPtr, listRepPtr->elemCount, - &listRepPtr->elements); - } else { - int indexCount = -1; /* Size of the array of list indices. */ - Tcl_Obj **indices = NULL; - /* Array of list indices. */ - - Tcl_ListObjGetElements(NULL, indexListCopy, &indexCount, &indices); + TclListObjGetElements(NULL, indexListCopy, &indexCount, &indices); listPtr = TclLindexFlat(interp, listPtr, indexCount, indices); } Tcl_DecrRefCount(indexListCopy); |