summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-21 09:28:39 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-21 09:28:39 (GMT)
commite6cf6979cb99a3488a2895f723fb97914397b132 (patch)
tree6b4c3d835846d4c615f17c627e2bd3fc15b4dec3 /generic
parenta69fadd5c0c50f03fb746432bd3234f9a4af1c63 (diff)
parent3b786ffebeb7769d34099ea7064532501dc6aee5 (diff)
downloadtcl-e6cf6979cb99a3488a2895f723fb97914397b132.zip
tcl-e6cf6979cb99a3488a2895f723fb97914397b132.tar.gz
tcl-e6cf6979cb99a3488a2895f723fb97914397b132.tar.bz2
Merge core-8-6-branch. Add more comments to tclLiteral.c, contributed by mr_calvin
Diffstat (limited to 'generic')
-rw-r--r--generic/tclLiteral.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index 49f21f2..7acc9ad 100644
--- a/generic/tclLiteral.c
+++ b/generic/tclLiteral.c
@@ -229,8 +229,7 @@ TclCreateLiteral(
}
/*
- * The literal is new to the interpreter. Add it to the global literal
- * table.
+ * The literal is new to the interpreter.
*/
TclNewObj(objPtr);
@@ -241,8 +240,11 @@ TclCreateLiteral(
TclInitStringRep(objPtr, bytes, length);
}
+ /* Should the new literal be shared globally? */
+
if ((flags & LITERAL_UNSHARED)) {
/*
+ * No, do *not* add it the global literal table
* Make clear, that no global value is returned
*/
if (globalPtrPtr != NULL) {
@@ -251,6 +253,9 @@ TclCreateLiteral(
return objPtr;
}
+ /*
+ * Yes, add it to the global literal table.
+ */
#ifdef TCL_COMPILE_DEBUG
if (LookupLiteralEntry((Tcl_Interp *) iPtr, objPtr) != NULL) {
Tcl_Panic("%s: literal \"%.*s\" found globally but shouldn't be",