summaryrefslogtreecommitdiffstats
path: root/generic/tclResult.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-09-30 23:06:47 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-09-30 23:06:47 (GMT)
commita5b7e1af2aad6b044ed0c093d8f4d27f68f1497a (patch)
tree80cd1a43eaad19a6b5ca302dc244897f6602805b /generic/tclResult.c
parent36fd8cc0959204088d97c32156f269faaaca2402 (diff)
downloadtcl-a5b7e1af2aad6b044ed0c093d8f4d27f68f1497a.zip
tcl-a5b7e1af2aad6b044ed0c093d8f4d27f68f1497a.tar.gz
tcl-a5b7e1af2aad6b044ed0c093d8f4d27f68f1497a.tar.bz2
* generic/tclBasic.c (Tcl_AddObjErrorInfo): More re-organization
* generic/tclCmdAH.c (Tcl_ErrorObjCmd): of the management of * generic/tclCmdMZ.c (TclProcessReturn): the errorCode value. * tests/error.test (error-6.4-9): * generic/tclNamespace.c (TclTeardownNamespace): Tcl_Obj-ified * tests/namespace.test (namespace-8.5,6): the save/restore of ::errorInfo and ::errorCode during global namespace teardown. Revised the comment to clarify why this is done, and added tests that will fail if this is not done. * generic/tclResult.c (TclTransferResult): Added safety checks so that unexpected undefined ::errorInfo or ::errorCode will not lead to a segfault. * generic/tclTrace.c (TclCallVarTraces): Save/restore the flag * tests/var.test (var-16.1): values that define part of the interpreter state during variable traces. [Bug 10381021].
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r--generic/tclResult.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 7c15182..9e83796 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclResult.c,v 1.10 2004/09/29 22:17:30 dkf Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.11 2004/09/30 23:06:48 dgp Exp $
*/
#include "tclInt.h"
@@ -1027,13 +1027,17 @@ TclTransferResult(sourceInterp, result, targetInterp)
objPtr = Tcl_GetVar2Ex(sourceInterp, "errorInfo", NULL,
TCL_GLOBAL_ONLY);
- Tcl_SetVar2Ex(targetInterp, "errorInfo", NULL, objPtr,
- TCL_GLOBAL_ONLY);
- ((Interp *) targetInterp)->flags |= ERR_IN_PROGRESS;
+ if (objPtr) {
+ Tcl_SetVar2Ex(targetInterp, "errorInfo", NULL, objPtr,
+ TCL_GLOBAL_ONLY);
+ ((Interp *) targetInterp)->flags |= ERR_IN_PROGRESS;
+ }
objPtr = Tcl_GetVar2Ex(sourceInterp, "errorCode", NULL,
TCL_GLOBAL_ONLY);
- Tcl_SetObjErrorCode(targetInterp, objPtr);
+ if (objPtr) {
+ Tcl_SetObjErrorCode(targetInterp, objPtr);
+ }
}
/* This may need examination for safety */