summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-06-28 02:58:15 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-06-28 02:58:15 (GMT)
commitd896ae28d39cbaeb363e3b84c58c26e31bd0c56d (patch)
treec714ff80e261977e24bcb902ee1b6b45566ecdf6 /generic
parent7924f4a694c43ca8fe4260041d090795b0791a96 (diff)
downloadtcl-d896ae28d39cbaeb363e3b84c58c26e31bd0c56d.zip
tcl-d896ae28d39cbaeb363e3b84c58c26e31bd0c56d.tar.gz
tcl-d896ae28d39cbaeb363e3b84c58c26e31bd0c56d.tar.bz2
More elimination of error message litter to fix [Bug 20a81392ec].
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompCmdsSZ.c3
-rw-r--r--generic/tclCompile.c8
-rw-r--r--generic/tclExecute.c18
3 files changed, 10 insertions, 19 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index 855dd8f..026b214 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -748,6 +748,9 @@ TclSubstCompile(
Tcl_InterpState state = NULL;
TclSubstParse(interp, bytes, numBytes, flags, &parse, &state);
+ if (state != NULL) {
+ Tcl_ResetResult(interp);
+ }
/*
* Tricky point! If the first token does not result in a *guaranteed* push
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 5a8524c..1f72aa7 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -2058,14 +2058,6 @@ TclCompileScript(
* from the script.
*/
- /* TODO: Figure out when/why we need this */
-#if 0
-if (Tcl_GetStringResult(interp)[0] != '\0') {
- fprintf(stdout, "INIT: '%s'\n", Tcl_GetStringResult(interp));
- fflush(stdout);
-}
-#endif
- Tcl_ResetResult(interp);
while (numBytes > 0) {
Tcl_Parse parse;
const char *next;
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index d3a0d32..37bf072 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -1426,17 +1426,12 @@ Tcl_NRExprObj(
Tcl_Obj *resultPtr)
{
ByteCode *codePtr;
+ Tcl_InterpState state = Tcl_SaveInterpState(interp, TCL_OK);
- /* TODO: consider saving whole state? */
- Tcl_Obj *saveObjPtr = Tcl_GetObjResult(interp);
-
- Tcl_IncrRefCount(saveObjPtr);
-
+ Tcl_ResetResult(interp);
codePtr = CompileExprObj(interp, objPtr);
- /* TODO: Confirm reset not required? */
- /*Tcl_ResetResult(interp);*/
- Tcl_NRAddCallback(interp, ExprObjCallback, saveObjPtr, resultPtr,
+ Tcl_NRAddCallback(interp, ExprObjCallback, state, resultPtr,
NULL, NULL);
return TclNRExecuteByteCode(interp, codePtr);
}
@@ -1447,14 +1442,15 @@ ExprObjCallback(
Tcl_Interp *interp,
int result)
{
- Tcl_Obj *saveObjPtr = data[0];
+ Tcl_InterpState state = data[0];
Tcl_Obj *resultPtr = data[1];
if (result == TCL_OK) {
TclSetDuplicateObj(resultPtr, Tcl_GetObjResult(interp));
- Tcl_SetObjResult(interp, saveObjPtr);
+ (void) Tcl_RestoreInterpState(interp, state);
+ } else {
+ Tcl_DiscardInterpState(state);
}
- TclDecrRefCount(saveObjPtr);
return result;
}