From 596e89b17d16efdca4d428cf91667142cc1336f3 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 6 Mar 2018 20:27:39 +0000 Subject: Have assembler use same index value parser as the bytecode compiler. --- generic/tclAssembly.c | 19 ++++++------------- 1 file 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; } -- cgit v0.12