diff options
author | dgp <dgp@users.sourceforge.net> | 2004-10-25 20:24:06 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-10-25 20:24:06 (GMT) |
commit | 2ddf71d5d424c34dfbcc0b9f55cf9baeabbe9e4b (patch) | |
tree | ffc6b697abc55d76757181f5a753ccc2895f2a58 /generic/tclResult.c | |
parent | a982cad7ac7f927864d62b50b62a961526b15852 (diff) | |
download | tcl-2ddf71d5d424c34dfbcc0b9f55cf9baeabbe9e4b.zip tcl-2ddf71d5d424c34dfbcc0b9f55cf9baeabbe9e4b.tar.gz tcl-2ddf71d5d424c34dfbcc0b9f55cf9baeabbe9e4b.tar.bz2 |
* generic/tclExecute.c (IllegalExprOperandType,TclExecuteByteCode):
Removed several DECACHE_INFO/CACHE_INFO pairs that are no longer
needed for protection because routines like Tcl_SetErrorCode() and
Tcl_AddErrorInfo() can no longer re-enter bytecode execution.
* generic/tclResult.c (TclProcessReturn): Bug fix. Be sure that
a missing -errorinfo option when code == TCL_ERROR causes the
errorInfo field to get reset.
* tests/thread.test (thread-4.4): Test depended on a ::errorInfo
value initialized to "". Added code to test to setup that requirement.
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r-- | generic/tclResult.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c index 226af65..196f634 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.20 2004/10/24 22:25:13 dgp Exp $ + * RCS: @(#) $Id: tclResult.c,v 1.21 2004/10/25 20:24:13 dgp Exp $ */ #include "tclInt.h" @@ -1186,14 +1186,15 @@ TclProcessReturn(interp, code, level, returnOpts) } if (code == TCL_ERROR) { + if (iPtr->errorInfo) { + Tcl_DecrRefCount(iPtr->errorInfo); + iPtr->errorInfo = NULL; + } Tcl_DictObjGet(NULL, iPtr->returnOpts, keys[KEY_ERRORINFO], &valuePtr); if (valuePtr != NULL) { int infoLen; (void) Tcl_GetStringFromObj(valuePtr, &infoLen); if (infoLen) { - if (iPtr->errorInfo) { - Tcl_DecrRefCount(iPtr->errorInfo); - } iPtr->errorInfo = valuePtr; Tcl_IncrRefCount(iPtr->errorInfo); iPtr->flags |= ERR_ALREADY_LOGGED; |