summaryrefslogtreecommitdiffstats
path: root/tests/reg.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-12-18 11:23:11 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-12-18 11:23:11 (GMT)
commitfdc0ebcebdabf8d44d0fb97275444ef980028f66 (patch)
tree136091002ef147caa5d9a01bf9cc8ea9be25baf5 /tests/reg.test
parenta5dd9045b97811ec0ab14334094c710878cd6083 (diff)
downloadtcl-fdc0ebcebdabf8d44d0fb97275444ef980028f66.zip
tcl-fdc0ebcebdabf8d44d0fb97275444ef980028f66.tar.gz
tcl-fdc0ebcebdabf8d44d0fb97275444ef980028f66.tar.bz2
Fixes for problems created when processing regular expressions that
generate very large automata. An enormous number of thanks to Will Drewry <wad@google.com>, Tavis Ormandy <taviso@google.com>, and Tom Lane <tgl@sss.pgh.pa.us> from the Postgresql crowd for their help in tracking these problems down. [Bug 1810264]
Diffstat (limited to 'tests/reg.test')
-rw-r--r--tests/reg.test15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/reg.test b/tests/reg.test
index 8994fdc..2abe7b6 100644
--- a/tests/reg.test
+++ b/tests/reg.test
@@ -9,7 +9,7 @@
#
# Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
#
-# RCS: @(#) $Id: reg.test,v 1.16.2.3 2004/11/27 05:44:13 dgp Exp $
+# RCS: @(#) $Id: reg.test,v 1.16.2.4 2007/12/18 11:23:16 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -1130,6 +1130,19 @@ test reg-33.11 {Bug 840258} {
"TQ\r\n.?<5000267>Test already stopped\r\n" {} tmp
} 1
+test reg-33.12 {Bug 1810264 - bad read} {
+ regexp {\3161573148} {\3161573148}
+} 0
+test reg-33.13 {Bug 1810264 - infinite loop} {
+ regexp {($|^)*} {x}
+} 1
+test reg-33.14 {Bug 1810264 - super-expensive expression} {
+ set start [clock seconds]
+ regexp {(x{200}){200}$y} {x}
+ set time [expr {[clock seconds] - $start}]
+ expr {$time < 5 ? "ok" : "Complex RE took $time seconds - bad!"}
+} ok
+
# cleanup
::tcltest::cleanupTests
return