summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdIL.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-10-28 14:23:25 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-10-28 14:23:25 (GMT)
commite0d5715972ba45f8d23f0349033503b2195b1664 (patch)
treede3ef16c53c4fc75b6df0d0e1880dbffa01042db /generic/tclCmdIL.c
parent84a8c8047b4c22b4b2ff8db0695a568676068ada (diff)
downloadtcl-e0d5715972ba45f8d23f0349033503b2195b1664.zip
tcl-e0d5715972ba45f8d23f0349033503b2195b1664.tar.gz
tcl-e0d5715972ba45f8d23f0349033503b2195b1664.tar.bz2
Add warning commentary making important assumptions explicit.
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r--generic/tclCmdIL.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 02e5812..b303bb6 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -2025,6 +2025,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]);