diff options
author | dkf <dkf@noemail.net> | 2007-12-18 11:23:10 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2007-12-18 11:23:10 (GMT) |
commit | 733967b9c986c82a4208c50327809f1f3a5e5f32 (patch) | |
tree | 136091002ef147caa5d9a01bf9cc8ea9be25baf5 /tests/reg.test | |
parent | e287b3ed726105a5f6cc8825e4da7a512c898148 (diff) | |
download | tcl-733967b9c986c82a4208c50327809f1f3a5e5f32.zip tcl-733967b9c986c82a4208c50327809f1f3a5e5f32.tar.gz tcl-733967b9c986c82a4208c50327809f1f3a5e5f32.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]
FossilOrigin-Name: 6badb872f2f638bddf3185973137b30dd8389b29
Diffstat (limited to 'tests/reg.test')
-rw-r--r-- | tests/reg.test | 15 |
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 |