summaryrefslogtreecommitdiffstats
path: root/generic/tclResult.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-06-05 17:57:05 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-06-05 17:57:05 (GMT)
commit0ce2a2cb2fb98447e3060196f2415dd267330e0d (patch)
treebaea8961dd7792cf7300ab1799771f4ebdc7ad72 /generic/tclResult.c
parent68919c24042c4dd2b585f557d98d6bea70fa1cf4 (diff)
downloadtcl-0ce2a2cb2fb98447e3060196f2415dd267330e0d.zip
tcl-0ce2a2cb2fb98447e3060196f2415dd267330e0d.tar.gz
tcl-0ce2a2cb2fb98447e3060196f2415dd267330e0d.tar.bz2
* generic/tclBasic.c: Added interp flag value ERR_LEGACY_COPY to
* generic/tclInt.h: control the timing with which the global * generic/tclNamesp.c: variables ::errorCode and ::errorInfo get * generic/tclProc.c: updated after an error. This keeps more * generic/tclResult.c: precise compatibility with Tcl 8.4. * tests/result.test (result-6.2): [Bug 1649062]
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r--generic/tclResult.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 9512989..c77e634 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.36 2007/04/20 06:10:58 kennykb Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.37 2007/06/05 17:57:08 dgp Exp $
*/
#include "tclInt.h"
@@ -906,15 +906,19 @@ Tcl_ResetResult(
iPtr->resultSpace[0] = 0;
if (iPtr->errorCode) {
/* Legacy support */
- Tcl_ObjSetVar2(interp, iPtr->ecVar, NULL,
- iPtr->errorCode, TCL_GLOBAL_ONLY);
+ if (iPtr->flags & ERR_LEGACY_COPY) {
+ Tcl_ObjSetVar2(interp, iPtr->ecVar, NULL,
+ iPtr->errorCode, TCL_GLOBAL_ONLY);
+ }
Tcl_DecrRefCount(iPtr->errorCode);
iPtr->errorCode = NULL;
}
if (iPtr->errorInfo) {
/* Legacy support */
- Tcl_ObjSetVar2(interp, iPtr->eiVar, NULL,
- iPtr->errorInfo, TCL_GLOBAL_ONLY);
+ if (iPtr->flags & ERR_LEGACY_COPY) {
+ Tcl_ObjSetVar2(interp, iPtr->eiVar, NULL,
+ iPtr->errorInfo, TCL_GLOBAL_ONLY);
+ }
Tcl_DecrRefCount(iPtr->errorInfo);
iPtr->errorInfo = NULL;
}
@@ -924,7 +928,7 @@ Tcl_ResetResult(
Tcl_DecrRefCount(iPtr->returnOpts);
iPtr->returnOpts = NULL;
}
- iPtr->flags &= ~ERR_ALREADY_LOGGED;
+ iPtr->flags &= ~(ERR_ALREADY_LOGGED | ERR_LEGACY_COPY);
}
/*
@@ -1237,6 +1241,9 @@ TclProcessReturn(
iPtr->returnCode = code;
return TCL_RETURN;
}
+ if (code == TCL_ERROR) {
+ iPtr->flags |= ERR_LEGACY_COPY;
+ }
return code;
}