summaryrefslogtreecommitdiffstats
path: root/generic
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
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')
-rw-r--r--generic/tclCmdAH.c2
-rw-r--r--generic/tclExecute.c2
-rw-r--r--generic/tclLiteral.c3
-rw-r--r--generic/tclTest.c13
4 files changed, 14 insertions, 6 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c
index 88cc17d..4c299f8 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -1597,7 +1597,7 @@ FileAttrIsOwnedCmd(
Tcl_Obj *const objv[])
{
#ifdef __CYGWIN__
-#define geteuid() (short)(geteuid)()
+#define geteuid() (short)(geteuid)()
#endif
#if !defined(_WIN32)
Tcl_StatBuf buf;
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index e539161..34d92d3 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -3173,7 +3173,7 @@ TEBCresume(
Tcl_Obj *copyPtr = Tcl_NewListObj(objc - opnd + 1, NULL);
Tcl_ListObjAppendElement(NULL, copyPtr, objPtr);
- Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0,
+ Tcl_ListObjReplace(NULL, copyPtr, LIST_MAX, 0,
objc - opnd, objv + opnd);
Tcl_DecrRefCount(objPtr);
objPtr = copyPtr;
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);
diff --git a/generic/tclTest.c b/generic/tclTest.c
index e33d263..b3508f1 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -7449,9 +7449,16 @@ TestInterpResolverCmd(
int idx;
#define RESOLVER_KEY "testInterpResolver"
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "up|down");
- return TCL_ERROR;
+ if ((objc < 2) || (objc > 3)) {
+ Tcl_WrongNumArgs(interp, 1, objv, "up|down ?interp?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ interp = Tcl_GetSlave(interp, Tcl_GetString(objv[2]));
+ if (interp == NULL) {
+ Tcl_AppendResult(interp, "provided interpreter not found", NULL);
+ return TCL_ERROR;
+ }
}
if (Tcl_GetIndexFromObj(interp, objv[1], table, "operation", TCL_EXACT,
&idx) != TCL_OK) {