aboutsummaryrefslogtreecommitdiff
path: root/regtest.tcl
AgeCommit message (Collapse)AuthorFilesLines
2023-05-06jim: info frame improvementsSteve Bennett1-0/+3
always include 'proc' even if introspection disabled correctly set 'proc' at the eval frame level that is currently running in the given proc. This makes it easier to produce an accurate level stacktrace even across uplevel, etc. Update stacktrace to use the new info frame. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2021-12-16dict: consider dummy entries when determining when to expand hash tableSteve Bennett1-0/+24
This issue was caused by the fix in 24b234543c7322d2dd20339b45367fa3f4c53495 Because we used closed hashing for the dict hash table, it is important that the table doesn't get too full, as it gets very inefficient due to hash collisions. When allowing for space, also consider dummy entries that consume slots. If there are too many dummy slots, the hash table is expanded, clearing out the dummy slots. Without this fix it is possible to get unlucky when filling a dictionary and emptying it again (twice) will result all slots become dummy slots and thus no more entries can be added. See REGTEST 54 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-07-12string last: fix segfault with invalid indexSteve Bennett1-0/+5
[string last foo bar -1] gave segfault due to missing check for invalid index. Fixes #161 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2020-05-27lsearch: handle too few args with -commandSteve Bennett1-0/+6
Fixes #155 Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-08-07expr: Fix refcount issue converting invalid booleanSteve Bennett1-0/+5
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-08-07expr: Check for missing operand to operatorSteve Bennett1-0/+5
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-26format: validate too long precisionSteve Bennett1-0/+5
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-26scan: validate -ve XPG3 specifierSteve Bennett1-0/+5
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-23expr: Replace expression engineSteve Bennett1-0/+5
Rework the expression engine to use recursive descent evaluation rather than a shunting yard algorithm. Among other things, it is easier to make lazy operators and the ternary operator work correctly. In particular, the following expression no longer crashes: $(99?9,99?9:*9:999)?9) And the code is now smaller. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12scan: Ensure format is converted to string formSteve Bennett1-0/+5
Must have a stringrep before parsing. Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12regexp: Fix bad memory access on missing close braceSteve Bennett1-0/+5
For counted repetitions Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12lsort -unique: Fix case with no duplicatesSteve Bennett1-0/+5
In this case the final element was written a second time. Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12format: Validate too many flags in format stringSteve Bennett1-0/+5
Avoid a stack overflow Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12exec: Fix check for | and |&Steve Bennett1-0/+5
These are only allowed as separate args. One check was allowing them as a prefix which could lead to an invalid memory access Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12scan: error on missing conversion charSteve Bennett1-0/+5
Don't read invalid memory Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12jim: Fix ref count problem with interpolated dict substSteve Bennett1-0/+1
When duplicating interpolated object type, need to increment ref count of the key to offset the decrement during free. Also remove type-specific dup for dict-substitution which is not needed since it does nothing different from the default dup. Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-05-12lsort: Fix a refcount issueSteve Bennett1-0/+6
Only duplicate a shared object Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07expr: Add better checks for invalid ternary expressionSteve Bennett1-0/+5
Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07Fix ref count for interpolation/expressionSteve Bennett1-0/+6
Ref count may be wrong when an expression is used in interpolation. Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07expr: fix crash on invalid ternary orderSteve Bennett1-0/+5
expr {1 : 2 ? 3} Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2017-04-07Fix / command: divide by zeroSteve Bennett1-0/+5
Avoid exception on integer divided by zero Reported-by: Ryan Whitworth <me@ryanwhitworth.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-09-05Fix a crash due to cached local command resolutionSteve Bennett1-0/+15
When a 'local' command is deleted, the proc epoch needs to increase to ensure that subsequent lookups are re-resolved. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2016-08-17Don't unconditionally define _GNU_SOURCESteve Bennett1-1/+7
Also, fix build if JIM_OPTIMIZATION is disabled Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-04-28aio: Fix conflict between onexception and writableSteve Bennett1-5/+5
onexecption was using the wrong location Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-04-28Add testSteve Bennett1-0/+8
2014-04-23array: avoid crash on unset variableSteve Bennett1-0/+5
Fix the case where the variable does not exist and a pattern is specified. Courtesy of coverity Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-18regtest: don't exit prematurely from test 32Steve Bennett1-1/+1
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2014-01-03Add regression test for return -code evalSteve Bennett1-0/+9
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-12-12Fix infinite loop with error in lsort -uniqueSteve Bennett1-0/+5
Reported-by: Sergei Gavrikov <sergei.gavrikov@gmail.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-11-11Add titles to recent regression testsSteve Bennett1-0/+5
Reported-by: Sergei Gavrikov <sergei.gavrikov@gmail.com> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2013-11-06Fix [string tolower] buffer overflow for non-utf8Steve Bennett1-0/+4
Reported-by: Andy <jimdevel@hummypkg.org.uk> Signed-off-by: Steve Bennett <steveb@workware.net.au>
2012-03-13Fix a reference counting bugSteve Bennett1-0/+6
Ensure that the internal rep of interp->emptyObj is never changed to a script, since scripts use emptyObj as the source filename when no source info is available. Instead use a special nullScriptObj for this purpose. Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-16Fix bug when calling ref finalizersSteve Bennett1-0/+8
Commit 21d7fc318 introduced a bug where the finalizer was freed too early Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-12-02Prevent infinite recursion for eval, aliasSteve Bennett1-0/+18
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-18Don't allow upvar to a higher levelSteve Bennett1-0/+13
i.e. upvar of a global var to a proc var Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-11-18Improvements to variable caching and resolutionSteve Bennett1-0/+12
Cache the correct callframe id for ::global vars Move variable creation out into JimCreateVariable() Fix some cases of upvar/global with ::global vars Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-27Fix object leak in regexp/regsubSteve Bennett1-0/+10
During internal rep change to regex Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-07-07Use clock instead of open for loadable module bugSteve Bennett1-3/+4
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-06-21Fix crash on dup of object with script repSteve Bennett1-0/+7
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-05-26Fix an infinite loop in substSteve Bennett1-0/+5
If a null byte is encountered Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-05-26Fix crash with: global ::nameSteve Bennett1-0/+6
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-05-25Fix a crash when evaluating an invalid expressionSteve Bennett1-0/+7
expr {5 ne ::} Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-04-12Fix [for] crash if loop var is unsetSteve Bennett1-0/+7
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-11-26Bug fix: crash parsing invalid dict sugarSteve Bennett1-0/+5
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix bug when renaming the current procSteve Bennett1-0/+5
Reference counting issues Also don't allow rename to an existing command (Tcl compatible) Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix reference counting of stack trace in 'error'Steve Bennett1-0/+8
Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix crash on expand of empty argSteve Bennett1-0/+6
Found by the clang static analyser Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Fix a crash during list parsingSteve Bennett1-0/+6
If the list ended in a trailing newline Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15It was possible to create a bad refSteve Bennett1-0/+6
Need to fix invalid chars in the tag name Signed-off-by: Steve Bennett <steveb@workware.net.au>
2010-10-15Reference count commandsSteve Bennett1-0/+6
So that commands are not deleted while executing Add a regression test for this case Signed-off-by: Steve Bennett <steveb@workware.net.au>