summaryrefslogtreecommitdiffstats
path: root/tests/stack.test
diff options
context:
space:
mode:
authorkennykb <kennykb@noemail.net>2004-05-03 18:01:21 (GMT)
committerkennykb <kennykb@noemail.net>2004-05-03 18:01:21 (GMT)
commite2cfdb87ea77dc5689f3964e406e180a71d0aff6 (patch)
tree4cbee53143faa6b8fca2dc0682d163ad186dc5a5 /tests/stack.test
parent16c16b664d3fd05775ef51a6d06668b1436f408e (diff)
downloadtcl-e2cfdb87ea77dc5689f3964e406e180a71d0aff6.zip
tcl-e2cfdb87ea77dc5689f3964e406e180a71d0aff6.tar.gz
tcl-e2cfdb87ea77dc5689f3964e406e180a71d0aff6.tar.bz2
* win/tclWin32Dll.c (TclpCheckStackSpace):
* tests/stack.test (stack-3.1): Fix for undetected stack overflow in TclReExec on Windows. [Bug 947070] FossilOrigin-Name: 2ac4043c4108813e3595dee5f8da4b8c5520298c
Diffstat (limited to 'tests/stack.test')
-rw-r--r--tests/stack.test32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/stack.test b/tests/stack.test
index 828352b..f5d849b 100644
--- a/tests/stack.test
+++ b/tests/stack.test
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: stack.test,v 1.15 2002/07/29 00:25:49 msofer Exp $
+# RCS: @(#) $Id: stack.test,v 1.15.2.1 2004/05/03 18:01:36 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -55,6 +55,36 @@ test stack-2.1 {maxNestingDepth reached on infinite recursion} {minStack2400} {
set msg
} {too many nested evaluations (infinite loop?)}
+# Make sure that there is enough stack to run regexp even if we're
+# close to the recursion limit. [Bug 947070]
+
+test stack-3.1 {enough room for regexp near recursion limit} \
+ -constraints { win } \
+ -setup {
+ set ::limit [interp recursionlimit {} 10000]
+ set ::depth 0
+ proc a { max } {
+ if { [info level] < $max } {
+ set ::depth [info level]
+ a $max
+ } else {
+ regexp {^ ?} x
+ }
+ }
+ list [catch { a 10001 }]
+ incr depth -3
+ set depth2 $depth
+ } -body {
+ list [catch { a $::depth } result] \
+ $result [expr { $::depth2 - $::depth }]
+ } -cleanup {
+ interp recursionlimit {} $::limit
+ } -result {0 1 1}
+
# cleanup
::tcltest::cleanupTests
return
+
+# Local Variables:
+# mode: tcl
+# End: