diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-07-14 12:35:19 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-07-14 12:35:19 (GMT) |
commit | a41449f1cd90f78d0810898baea3568d4adabf39 (patch) | |
tree | 16328e4632f085e2aa7cb7de284cff5069d204f1 /generic/tclInterp.c | |
parent | 7c405a789e8e6b94cd18659c9994db418d92ad73 (diff) | |
download | tcl-a41449f1cd90f78d0810898baea3568d4adabf39.zip tcl-a41449f1cd90f78d0810898baea3568d4adabf39.tar.gz tcl-a41449f1cd90f78d0810898baea3568d4adabf39.tar.bz2 |
First shot at TIP #625 for Tcl 9.0.
Mark lrepeat-1.8 as 'knownBug', that's OK for now.
Diffstat (limited to 'generic/tclInterp.c')
-rw-r--r-- | generic/tclInterp.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c index d368829..589b0da 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -1829,7 +1829,7 @@ AliasNRCmd( int prefc, cmdc, i; Tcl_Obj **prefv, **cmdv; Tcl_Obj *listPtr; - List *listRep; + ListRep listRep; int flags = TCL_EVAL_INVOKE; /* @@ -1841,14 +1841,19 @@ AliasNRCmd( prefv = &aliasPtr->objPtr; cmdc = prefc + objc - 1; + /* TODO - encapsulate this into tclListObj.c */ listPtr = Tcl_NewListObj(cmdc, NULL); - listRep = ListRepPtr(listPtr); - listRep->elemCount = cmdc; - cmdv = listRep->elements; + ListObjGetRep(listPtr, &listRep); + cmdv = ListRepElementsBase(&listRep); + listRep.storePtr->numUsed = cmdc; + if (listRep.spanPtr) { + listRep.spanPtr->spanStart = listRep.storePtr->firstUsed; + listRep.spanPtr->spanLength = listRep.storePtr->numUsed; + } prefv = &aliasPtr->objPtr; - memcpy(cmdv, prefv, (prefc * sizeof(Tcl_Obj *))); - memcpy(cmdv+prefc, objv+1, ((objc-1) * sizeof(Tcl_Obj *))); + memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *)); + memcpy(cmdv+prefc, objv+1, (objc-1) * sizeof(Tcl_Obj *)); for (i=0; i<cmdc; i++) { Tcl_IncrRefCount(cmdv[i]); |