Tcl Source Code

Artifact [f365be4fd7]
Login

Artifact f365be4fd7cac837c17b3b9fe26c89a2920ade28:

Attachment "2038069.patch" to ticket [2038069fff] added by dgp 2008-08-05 22:40:35.
Index: generic/tclExecute.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclExecute.c,v
retrieving revision 1.397
diff -u -r1.397 tclExecute.c
--- generic/tclExecute.c	4 Aug 2008 18:32:29 -0000	1.397
+++ generic/tclExecute.c	5 Aug 2008 15:32:30 -0000
@@ -2712,7 +2712,8 @@
 
 	    DECACHE_STACK_INFO();
 
-	    result = TclNREvalObjv(interp, objc, objv, TCL_EVAL_NOERR, NULL);
+	    result = TclNREvalObjv(interp, objc, objv,
+		    (*pc == INST_EVAL_STK) ? 0 : TCL_EVAL_NOERR, NULL);
 	    result = TclNRRunCallbacks(interp, result, bottomPtr->rootPtr, 1);
 	    CACHE_STACK_INFO();
 
Index: tests/execute.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/execute.test,v
retrieving revision 1.28
diff -u -r1.28 execute.test
--- tests/execute.test	4 Aug 2008 04:49:24 -0000	1.28
+++ tests/execute.test	5 Aug 2008 15:32:30 -0000
@@ -958,6 +958,21 @@
     rename FOO {}
 } -result {}
 
+test execute-8.5 {Bug 2038069} -setup {
+    proc demo {} {
+	catch [list error FOO] m o
+	return $o
+    }
+} -body {
+    demo
+} -cleanup {
+    rename demo {}
+} -result {-code 1 -level 0 -errorcode NONE -errorinfo {FOO
+    while executing
+"error FOO"
+    invoked from within
+"catch [list error FOO] m o"} -errorline 2}
+
 test execute-9.1 {Interp result resetting [Bug 1522803]} {
     set c 0
     catch {