summaryrefslogtreecommitdiffstats
path: root/generic/tclVar.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-03-18 16:52:05 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-03-18 16:52:05 (GMT)
commitc108da9362a1f3ad12bd7e73ad6524e9991762f3 (patch)
treeeabee9727a668f27214ae4d28f70691ebd3ca046 /generic/tclVar.c
parentf958d7ae6277ff54eb419844904bdde05383b732 (diff)
downloadtcl-c108da9362a1f3ad12bd7e73ad6524e9991762f3.zip
tcl-c108da9362a1f3ad12bd7e73ad6524e9991762f3.tar.gz
tcl-c108da9362a1f3ad12bd7e73ad6524e9991762f3.tar.bz2
* generic/tclVar.c (TclLookupSimpleVar): Shift all calls to
Tcl_SetErrorCode() out of TclLookupSimpleVar and onto its callers, where control with TCL_LEAVE_ERR_MSG flag is more easily handled. [Bug 2689307]
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r--generic/tclVar.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 0af352c..e61e06e 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.176 2009/02/10 23:08:57 nijtmans Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.177 2009/03/18 16:52:20 dgp Exp $
*/
#include "tclInt.h"
@@ -972,13 +972,9 @@ TclLookupSimpleVar(
flags, &varNsPtr, &dummy1Ptr, &dummy2Ptr, &tail);
if (varNsPtr == NULL) {
*errMsgPtr = badNamespace;
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
- NULL);
return NULL;
} else if (tail == NULL) {
*errMsgPtr = missingName;
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME",
- NULL);
return NULL;
}
if (tail != varName) {
@@ -1001,7 +997,6 @@ TclLookupSimpleVar(
}
} else { /* Var wasn't found and not to create it. */
*errMsgPtr = noSuchVar;
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", NULL);
return NULL;
}
}
@@ -1038,7 +1033,6 @@ TclLookupSimpleVar(
}
if (varPtr == NULL) {
*errMsgPtr = noSuchVar;
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", NULL);
}
}
}
@@ -3621,6 +3615,7 @@ TclPtrObjMakeUpvar(
myFlags|AVOID_RESOLVERS, /* create */ 1, &errMsg, &index);
if (varPtr == NULL) {
TclObjVarErrMsg(interp, myNamePtr, NULL, "create", errMsg, -1);
+ Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", NULL);
return TCL_ERROR;
}
}