diff options
author | msofer <msofer@noemail.net> | 2001-04-07 03:15:37 (GMT) |
---|---|---|
committer | msofer <msofer@noemail.net> | 2001-04-07 03:15:37 (GMT) |
commit | d465fb11c8b76dd61d74c231c8fb58a672d18834 (patch) | |
tree | 873bc5f90dbb128c2fdeff5fee278e6b6a11e1ee /tests | |
parent | 712f170522c688162508dd2aea4f03729407adc5 (diff) | |
download | tcl-d465fb11c8b76dd61d74c231c8fb58a672d18834.zip tcl-d465fb11c8b76dd61d74c231c8fb58a672d18834.tar.gz tcl-d465fb11c8b76dd61d74c231c8fb58a672d18834.tar.bz2 |
Avoid panic when there are extra items in the tcl stack
[Bug #406709, Patch #414470]
FossilOrigin-Name: 37a039f67315fb84f09ca672b738e91067fd0648
Diffstat (limited to 'tests')
-rw-r--r-- | tests/foreach.test | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/foreach.test b/tests/foreach.test index 4b2a9da..d753fe5 100644 --- a/tests/foreach.test +++ b/tests/foreach.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: foreach.test,v 1.6 2000/04/10 17:18:59 ericm Exp $ +# RCS: @(#) $Id: foreach.test,v 1.7 2001/04/07 03:17:24 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -210,6 +210,15 @@ test foreach-5.4 {break tests} { catch {break foo} msg set msg } {wrong # args: should be "break"} +# Check for bug #406709 +test foreach-5.5 {break tests} { + proc a {} { + set a 1 + foreach b b {list [concat a; break]; incr a} + incr a + } + a +} {2} # Test for incorrect "double evaluation" semantics |