diff options
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r-- | generic/tclCmdIL.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 7420538..bb3c9b7 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2179,6 +2179,14 @@ Tcl_JoinObjCmd( resObjPtr = Tcl_NewObj(); for (i = 0; i < listLen; i++) { if (i > 0) { + + /* + * NOTE: This code is relying on Tcl_AppendObjToObj() **NOT** + * to shimmer joinObjPtr. If it did, then the case where + * objv[1] and objv[2] are the same value would not be safe. + * Accessing elemPtrs would crash. + */ + Tcl_AppendObjToObj(resObjPtr, joinObjPtr); } Tcl_AppendObjToObj(resObjPtr, elemPtrs[i]); |