diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2004-10-28 17:21:18 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2004-10-28 17:21:18 (GMT) |
commit | 151836cea1737631c005e07ca9a26e7641ff009d (patch) | |
tree | 090220d9e325f851fb03102f9a4042735591871d /tests/execute.test | |
parent | 56606ac70dec0e61009ec6ef2da57193abc0c33b (diff) | |
download | tcl-151836cea1737631c005e07ca9a26e7641ff009d.zip tcl-151836cea1737631c005e07ca9a26e7641ff009d.tar.gz tcl-151836cea1737631c005e07ca9a26e7641ff009d.tar.bz2 |
fix for execution stack corruption [Bug 1055676]. Credit dgp for detective
work and fix.
Diffstat (limited to 'tests/execute.test')
-rw-r--r-- | tests/execute.test | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/execute.test b/tests/execute.test index 9075b28..0f02e01 100644 --- a/tests/execute.test +++ b/tests/execute.test @@ -14,7 +14,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: execute.test,v 1.18 2004/05/25 17:17:38 dgp Exp $ +# RCS: @(#) $Id: execute.test,v 1.19 2004/10/28 17:21:25 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -739,6 +739,28 @@ test execute-8.2 {Stack restoration} -body { interp recursionlimit {} $limit } -result {too many nested evaluations (infinite loop?)} +test execute-8.3 {Stack restoration} -body { + # Test for [Bug #1055676], correct restoration + # of the stack top after the epoch is bumped and + # the stack is grown in a call from a nested evaluation + set arglst [string repeat "a " 1000] + proc f {args} "f $arglst" + proc run {} { + # bump the interp's epoch + rename ::set ::dummy + rename ::dummy ::set + catch f msg + set msg + } + run + } -setup { + # Avoid crashes when system stack size is limited (thread-enabled!) + set limit [interp recursionlimit {}] + interp recursionlimit {} 100 + } -cleanup { + interp recursionlimit {} $limit + } -result {too many nested evaluations (infinite loop?)} + # cleanup if {[info commands testobj] != {}} { testobj freeallvars |