summaryrefslogtreecommitdiffstats
path: root/generic/tclLiteral.c
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)
commit8d3c0c2e8152a4ce95d5f96680dca034fcfa0b6b (patch)
tree6b4c3d835846d4c615f17c627e2bd3fc15b4dec3 /generic/tclLiteral.c
parente7e4c74b7fb66e778876342cd605a50caee31646 (diff)
parent3adfe07f74e75d5e64032044c4a5bfa611777e44 (diff)
downloadtcl-8d3c0c2e8152a4ce95d5f96680dca034fcfa0b6b.zip
tcl-8d3c0c2e8152a4ce95d5f96680dca034fcfa0b6b.tar.gz
tcl-8d3c0c2e8152a4ce95d5f96680dca034fcfa0b6b.tar.bz2
Merge core-8-6-branch. Add more comments to tclLiteral.c, contributed by mr_calvin
Diffstat (limited to 'generic/tclLiteral.c')
-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",