diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-21 09:28:39 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-09-21 09:28:39 (GMT) |
commit | e6cf6979cb99a3488a2895f723fb97914397b132 (patch) | |
tree | 6b4c3d835846d4c615f17c627e2bd3fc15b4dec3 /generic/tclLiteral.c | |
parent | a69fadd5c0c50f03fb746432bd3234f9a4af1c63 (diff) | |
parent | 3b786ffebeb7769d34099ea7064532501dc6aee5 (diff) | |
download | tcl-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/tclLiteral.c')
-rw-r--r-- | generic/tclLiteral.c | 9 |
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", |