From 5fcc0022bc751606bd350315bcc2b59cbbdb6969 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 1 Apr 2003 07:18:35 +0000 Subject: * generic/tclExecute.c (INST_RETURN): Bytecompiled [return] failed to reset iPtr->returnCode, causing tests parse-18.17 and parse-18.21 to fail strangely. * tests/parse.test (parse-18.21): Corrected now functioning test. FossilOrigin-Name: 3b44f60bef0d3d886865ffc200e9b2eeeb1bea83 --- ChangeLog | 7 +++++++ generic/tclExecute.c | 3 ++- tests/parse.test | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index eaa05f3..66e7916 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-04-01 Don Porter + + * generic/tclExecute.c (INST_RETURN): Bytecompiled [return] failed + to reset iPtr->returnCode, causing tests parse-18.17 and parse-18.21 + to fail strangely. + * tests/parse.test (parse-18.21): Corrected now functioning test. + 2003-03-31 Don Porter * tests/parse.test (parse-18.*): Coverage tests for the new diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 40e211d..0a54c16 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.96 2003/03/19 16:51:43 dgp Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.97 2003/04/01 07:18:37 dgp Exp $ */ #include "tclInt.h" @@ -1225,6 +1225,7 @@ TclExecuteByteCode(interp, codePtr) #endif switch (*pc) { case INST_RETURN: + iPtr->returnCode = TCL_OK; result = TCL_RETURN; case INST_DONE: if (stackTop <= initStackTop) { diff --git a/tests/parse.test b/tests/parse.test index 69462b2..daecce5 100644 --- a/tests/parse.test +++ b/tests/parse.test @@ -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: parse.test,v 1.13 2003/03/31 23:19:48 dgp Exp $ +# RCS: @(#) $Id: parse.test,v 1.14 2003/04/01 07:18:37 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -808,7 +808,9 @@ test parse-18.20 {Tcl_SubstObj, exception handling} { list [catch {subst {abc,[return foo; expr 1+2; set {} {}{}],def}} msg] $msg } [list 1 "extra characters after close-brace"] test parse-18.21 {Tcl_SubstObj, exception handling} { - subst {abc,[return -code 10 foo; expr 1+2; set {} {}{}],def} + list [catch { + subst {abc,[return -code 10 foo; expr 1+2; set {} {}{}],def} + } msg] $msg } [list 1 "extra characters after close-brace"] # cleanup -- cgit v0.12