Age | Commit message (Collapse) | Author | Files | Lines |
|
More consistent behaviour of replacing past end of list
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
jim/jim.c: In function ‘SetExprFromAny’:
jim/jim.c:9109:16: error: ‘top’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
expr->expr = top;
^
jim/jim.c:9075:25: note: ‘top’ was declared here
struct JimExprNode *top;
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
For consistency with Tcl
Reported-by: Stuart Cassoff <stwo@bell.net>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Perform the same internal checks as Jim_GetString() when
the string rep needs to be generated by calling Jim_GetString()
Reported-by: Stuart Cassoff <stwo@bell.net>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Limit the depth of the expressions to a reasonable level to prevent
stack overflow
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Small improvements to code for clarity and code reduction.
Improve comments.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
If a C command invokes another C command (including indirectly),
cmdPrivData was being changed but not restored
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
When Jim_GetEnum() succeeds, cache the result in the object
to speed up subsequent identical calls to Jim_GetEnum()
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
This speeds up call frame destruction in the common
case that $jim::defer does not exist.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Allows commands to run when a proc or interpreter exits.
If the $jim::defer variables exists at proc or interp exit,
it is treated as a list of scripts to evaluate (in reverse order).
The [defer] command is a helper to add scripts to $jim::defer
See tests/defer.test
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
When a dict-subst object is duplicated, ref counts
need to be adjusted.
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au
|
|
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
In scripts, like Tcl does.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Reported-by: tcler.yin
|
|
Non-zero return codes (e.g. break, continue, exit) were all being
converted to the error code.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
Minor optimisation
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Removes some duplicate code
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Must have a stringrep before parsing.
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
Don't read invalid memory
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
Only duplicate a shared object
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Off by one for length of the return code name array.
Found with afl-fuzz.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
expr {1 : 2 ? 3}
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Avoid exception on integer divided by zero
Reported-by: Ryan Whitworth <me@ryanwhitworth.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
For the benefit of C89 compilers.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
The script implementation of dict values was not correctly handling the case
where a dictionary had duplicate values.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Changed 'array exists' to actually check if the variable is an array
(matches tclsh)
Fix Jim_DictInfo to avoid using printf() and make output match tclsh
Added some more tests for array command - checked these work with tclsh
|
|
Change Jim_SetResultFormatted() to increment/decrement the ref count
of any %#s parameters. This allows zero refcount objects to be passed in
and be freed automatically.
Reported-by: Evan Hunter <evan@ozhiker.com>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
pkgconfig for SDL causes _GNU_SOURCE to be defined on the commandline,
hence causing an error when these source files re-define it.
|
|
For systems with signed char
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
This option returns a list of support subcommands and is
useful for command line completion.
Support added to: socket, namespace, tcl::prefix, string, dict, info
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
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>
|
|
No need for references support
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Mostly from -Wshadow
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
It is wrong to call Jim_WrongNumArgs() with argc == 0.
Instead -1 should be returned from the subcmd function to display the standard error message.
Add a --maintainer check for this condition in Jim_WrongNumArgs() and fix the zlib unit tests.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|
|
Also, fix build if JIM_OPTIMIZATION is disabled
Signed-off-by: Steve Bennett <steveb@workware.net.au>
|