summaryrefslogtreecommitdiffstats
path: root/generic/tclLiteral.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-05 13:55:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-05 13:55:00 (GMT)
commitcf8c1e7bdc508039a61423810bd40fd90482b885 (patch)
treea036d4acb69bc769ac6538fc9b57f9f09cd8e3a6 /generic/tclLiteral.c
parent3b2cb79ab18e9506dfb66e2786a7ee04dd30a780 (diff)
downloadtcl-cf8c1e7bdc508039a61423810bd40fd90482b885.zip
tcl-cf8c1e7bdc508039a61423810bd40fd90482b885.tar.gz
tcl-cf8c1e7bdc508039a61423810bd40fd90482b885.tar.bz2
Allow additional optional "interp" argument for testinterpresolver command. Not used yet in any test-case.
Protect panic in tclLiteral.c for possible null-pointer access. (cherry-picked from Gustaf Neuman's interpresolver patch). Eliminate some unecessary spacing.
Diffstat (limited to 'generic/tclLiteral.c')
-rw-r--r--generic/tclLiteral.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index 03200ca..26c21db 100644
--- a/generic/tclLiteral.c
+++ b/generic/tclLiteral.c
@@ -431,12 +431,13 @@ TclRegisterLiteral(
* Is it in the interpreter's global literal table? If not, create it.
*/
+ globalPtr = NULL;
objPtr = TclCreateLiteral(iPtr, bytes, length, hash, &new, nsPtr, flags,
&globalPtr);
objIndex = AddLocalLiteralEntry(envPtr, objPtr, localHash);
#ifdef TCL_COMPILE_DEBUG
- if (globalPtr->refCount < 1) {
+ if (globalPtr != NULL && globalPtr->refCount < 1) {
Tcl_Panic("%s: global literal \"%.*s\" had bad refCount %d",
"TclRegisterLiteral", (length>60? 60 : length), bytes,
globalPtr->refCount);