diff options
author | dgp <dgp@users.sourceforge.net> | 2016-10-28 14:26:18 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-10-28 14:26:18 (GMT) |
commit | 597d65b1e9b9c0c40782bc5ee8b372bf4bb6b995 (patch) | |
tree | e183241921d34e3324be13c516af04a7c16a6c44 /generic/tclCmdIL.c | |
parent | d758de074e41af0de8b114e30401f19d5eeb3c6c (diff) | |
parent | e0d5715972ba45f8d23f0349033503b2195b1664 (diff) | |
download | tcl-597d65b1e9b9c0c40782bc5ee8b372bf4bb6b995.zip tcl-597d65b1e9b9c0c40782bc5ee8b372bf4bb6b995.tar.gz tcl-597d65b1e9b9c0c40782bc5ee8b372bf4bb6b995.tar.bz2 |
Add warning commentary making important assumptions explicit.
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 0a1b4fe..9fbb0ad 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]); |