summaryrefslogtreecommitdiffstats
path: root/generic/tclAssembly.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2018-03-06 20:27:39 (GMT)
committerdgp <dgp@users.sourceforge.net>2018-03-06 20:27:39 (GMT)
commit596e89b17d16efdca4d428cf91667142cc1336f3 (patch)
tree40cad72ad3026082c5977cbd7e2693ab8c090aed /generic/tclAssembly.c
parent847a048c18e68af9dd1140e12e922544b4fb25c6 (diff)
downloadtcl-596e89b17d16efdca4d428cf91667142cc1336f3.zip
tcl-596e89b17d16efdca4d428cf91667142cc1336f3.tar.gz
tcl-596e89b17d16efdca4d428cf91667142cc1336f3.tar.bz2
Have assembler use same index value parser as the bytecode compiler.
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;
}