summaryrefslogtreecommitdiffstats
path: root/generic/tclLiteral.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-02-28 17:08:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-02-28 17:08:43 (GMT)
commita91df0f94f811c1780d6248b0ef4b3cf9133b74f (patch)
tree5194f377c644e8dde41bf11a2b5f0c7387f1e569 /generic/tclLiteral.c
parentf64e191a21656662cf0198592bf14af07fe7de0e (diff)
downloadtcl-a91df0f94f811c1780d6248b0ef4b3cf9133b74f.zip
tcl-a91df0f94f811c1780d6248b0ef4b3cf9133b74f.tar.gz
tcl-a91df0f94f811c1780d6248b0ef4b3cf9133b74f.tar.bz2
Revise TclReleaseLiteral() to tolerate a NULL interp argument.
Update callers and revise mistaken comments.
Diffstat (limited to 'generic/tclLiteral.c')
-rw-r--r--generic/tclLiteral.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index 441ea91..2cba18d 100644
--- a/generic/tclLiteral.c
+++ b/generic/tclLiteral.c
@@ -750,11 +750,16 @@ TclReleaseLiteral(
* TclRegisterLiteral. */
{
Interp *iPtr = (Interp *) interp;
- LiteralTable *globalTablePtr = &iPtr->literalTable;
+ LiteralTable *globalTablePtr;
register LiteralEntry *entryPtr, *prevPtr;
const char *bytes;
int length, index;
+ if (iPtr == NULL) {
+ goto done;
+ }
+
+ globalTablePtr = &iPtr->literalTable;
bytes = TclGetStringFromObj(objPtr, &length);
index = (HashString(bytes, length) & globalTablePtr->mask);
@@ -798,6 +803,7 @@ TclReleaseLiteral(
* Remove the reference corresponding to the local literal table entry.
*/
+ done:
Tcl_DecrRefCount(objPtr);
}