summaryrefslogtreecommitdiffstats
path: root/generic/tclResult.c
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2004-09-30 22:45:10 (GMT)
committerdgp <dgp@noemail.net>2004-09-30 22:45:10 (GMT)
commit2cb38e6e79ef5d2760f7b897648ae7b8ffeee57b (patch)
tree6b2ec1f6f1ea65672138439c60138372dcf4414c /generic/tclResult.c
parent8291cf950336e22ab1d7c2e2213f57ef90103054 (diff)
downloadtcl-2cb38e6e79ef5d2760f7b897648ae7b8ffeee57b.zip
tcl-2cb38e6e79ef5d2760f7b897648ae7b8ffeee57b.tar.gz
tcl-2cb38e6e79ef5d2760f7b897648ae7b8ffeee57b.tar.bz2
* 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/tclVar.c (CallVarTraces): Save/restore the flag * tests/var.test (var-16.1): values that define part of the interpreter state during variable traces. [Bug 10381021]. FossilOrigin-Name: 713215081c3559112c57e6af56df08a98faa82e1
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r--generic/tclResult.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 9cfbd63..badaf89 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.5.2.1 2003/07/16 21:25:07 hobbs Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.5.2.2 2004/09/30 22:45:15 dgp Exp $
*/
#include "tclInt.h"
@@ -1029,15 +1029,18 @@ TclTransferResult(sourceInterp, result, targetInterp)
objPtr = Tcl_GetVar2Ex(sourceInterp, "errorInfo", NULL,
TCL_GLOBAL_ONLY);
- Tcl_SetVar2Ex(targetInterp, "errorInfo", NULL, objPtr,
- TCL_GLOBAL_ONLY);
+ 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_SetVar2Ex(targetInterp, "errorCode", NULL, objPtr,
- TCL_GLOBAL_ONLY);
+ if (objPtr) {
+ Tcl_SetObjErrorCode(targetInterp, objPtr);
+ }
- ((Interp *) targetInterp)->flags |= (ERR_IN_PROGRESS | ERROR_CODE_SET);
}
((Interp *) targetInterp)->returnCode = ((Interp *) sourceInterp)->returnCode;