summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-10-28 14:27:59 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-10-28 14:27:59 (GMT)
commitb8ffbb14c402859e6eaa944b9559fb7a9d16b7fb (patch)
tree91dfd482cf979d51bf3be729dc624b83b1f7ac37 /generic
parentaa3b1573387624a3ea8723fbe59c5095628c6a3d (diff)
parent39dbbd57afa9eb16a87d11e0048867107c052de8 (diff)
downloadtcl-b8ffbb14c402859e6eaa944b9559fb7a9d16b7fb.zip
tcl-b8ffbb14c402859e6eaa944b9559fb7a9d16b7fb.tar.gz
tcl-b8ffbb14c402859e6eaa944b9559fb7a9d16b7fb.tar.bz2
Add warning commentary making important assumptions explicit.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdIL.c8
-rw-r--r--generic/tclStringObj.c2
2 files changed, 10 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]);
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index e878167..fefb014 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -1182,6 +1182,8 @@ Tcl_AppendUnicodeToObj(
* Side effects:
* The string rep of appendObjPtr is appended to the string
* representation of objPtr.
+ * IMPORTANT: This routine does not and MUST NOT shimmer appendObjPtr.
+ * Callers are counting on that.
*
*----------------------------------------------------------------------
*/