diff options
author | dgp <dgp@noemail.net> | 2007-06-05 17:57:04 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2007-06-05 17:57:04 (GMT) |
commit | b433ee13e0cbefc29cc470696b596af7d3152fb6 (patch) | |
tree | baea8961dd7792cf7300ab1799771f4ebdc7ad72 /generic/tclResult.c | |
parent | 0c620b54cb9e2b52d3240393c2b9c6fc86a8c2a0 (diff) | |
download | tcl-b433ee13e0cbefc29cc470696b596af7d3152fb6.zip tcl-b433ee13e0cbefc29cc470696b596af7d3152fb6.tar.gz tcl-b433ee13e0cbefc29cc470696b596af7d3152fb6.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]
FossilOrigin-Name: 00c4f9f27e47ffc8fb55b4ab5eec8314d7b646bf
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r-- | generic/tclResult.c | 19 |
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; } |