diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-30 10:20:19 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-30 10:20:19 (GMT) |
commit | e3135827263e4945deb81a0ea513a26b6cab5c67 (patch) | |
tree | 0e33017f032004aab9bd2f9e55828eb511c83323 /tests/bigdata.test | |
parent | ef51b5aacdb05bb3e9120129f0c50ae3b31bf915 (diff) | |
parent | 6c973cf9a204f96f3350a7908067f2707e130afb (diff) | |
download | tcl-e3135827263e4945deb81a0ea513a26b6cab5c67.zip tcl-e3135827263e4945deb81a0ea513a26b6cab5c67.tar.gz tcl-e3135827263e4945deb81a0ea513a26b6cab5c67.tar.bz2 |
Fix [27b3ce2997] - check INT_MAX limit on script length
Diffstat (limited to 'tests/bigdata.test')
-rw-r--r-- | tests/bigdata.test | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/bigdata.test b/tests/bigdata.test index ccd34af..6ecf4a0 100644 --- a/tests/bigdata.test +++ b/tests/bigdata.test @@ -116,6 +116,26 @@ set ::bigLengths(patlenmultiple) [bigPatlenMultiple $::bigLengths(intmax)] set ::bigLengths(upatlenmultiple) [bigPatlenMultiple $::bigLengths(uintmax)] # +# script limits +bigtestRO script-length-bigdata-1 {Test script length limit} b -body { + try [string cat [string repeat " " 0x7ffffff7] "set a b"] +} +# TODO - different behaviour between compiled and uncompiled +test script-length-bigdata-2.compiled {Test script length limit} -body { + try [string cat [string repeat " " 0x7ffffff8] "set a b"] +} -result {Script length 2147483647 exceeds max permitted length 2147483646.} -returnCodes error +test script-length-bigdata-2.uncompiled {Test script length limit} -body { + testevalex [string cat [string repeat " " 0x7ffffff8] "set a b"] +} -result b +test script-bytecode-length-bigdata-1 {Test bytecode length limit} -body { + # Note we need to exceed bytecode limit without exceeding script char limit + set s [string repeat {{*}$x;} [expr 0x7fffffff/6]] + catch $s r e +} -cleanup { + bigClean +} -constraints panic-in-EnterCmdStartData + +# # string cat bigtest string-cat-bigdata-1 "string cat large small result > INT_MAX" 1 -body { string equal \ @@ -159,7 +179,6 @@ bigtestRO string-equal/compare-bigdata-2 "string compare/equal -length unequal s } -cleanup { bigClean } -# -constraints bug-a814ee5bbd # # string first |