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)
commit8dac135fc9c8efae2cc3113bc975ab871ff2271f (patch)
treea036d4acb69bc769ac6538fc9b57f9f09cd8e3a6 /generic/tclLiteral.c
parentd84492f3906d20d05b547a4fa90286fe0a59bb37 (diff)
downloadtcl-8dac135fc9c8efae2cc3113bc975ab871ff2271f.zip
tcl-8dac135fc9c8efae2cc3113bc975ab871ff2271f.tar.gz
tcl-8dac135fc9c8efae2cc3113bc975ab871ff2271f.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);