summaryrefslogtreecommitdiffstats
path: root/generic/tclAssembly.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclAssembly.c')
-rw-r--r--generic/tclAssembly.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index 120fd9a..273a012 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -2248,24 +2248,17 @@ GetListIndexOperand(
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);
+ 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;
}