| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclBasic.c: Define [::tcl::Bgerror] in new interps.
* generic/tclEvent.c: Update Tcl_BackgroundError to make use
of the registered [interp bgerror] command.
* generic/tclInterp.c: New [interp bgerror] subcommand.
* tests/interp.test: syntax tests updated.
TIP #226 IMPLEMENTATION
* generic/tcl.decls: Stubs for Tcl_(Save|Restore|Discard)InterpState
* generic/tcl.h: New public opaque type, Tcl_InterpState.
* generic/tclInt.h: Drop old private declarations. Add
Tcl(Get|Set)BgErrorHandler
* generic/tclResult.c: Tcl_*InterpState implementations.
* generic/tclDictObj.c: Update callers.
* generic/tclIOGT.c:
* generic/tclTrace.c:
TIP #227 IMPLEMENTATION
* generic/tcl.decls: Stubs for Tcl_(Get|Set)ReturnOptions.
* generic/tclInt.h: Drop old private declarations.
* generic/tclResult.c: Tcl_*ReturnOptions implementations.
* generic/tclCmdAH.c: Update callers.
* generic/tclMain.c:
|
|
|
|
|
|
| |
relevant to users. [Patch 1056864]
Also patches to core to take advantage of this
Also other general cleaning up of Tcl_WrongNumArgs usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shift the initialization of errorCode to NONE to more central
location.
* generic/tclEvent.c (BgError,Tcl_BackgroundError,HandleBgErrors):
Rewrite to build on the new TclGet/SetReturnOptions routines.
* generic/tclResult.c (TclGetReturnOptions): Add call to
Tcl_AddObjErrorInfo to be sure error fields are initialized.
* generic/tclResult.c (TclTransferResult):
Rewrite to build on the new TclGet/SetReturnOptions routines.
|
|
|
|
|
|
|
|
| |
* generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp):
* generic/tclResult.c (GetKeys,ReleaseKeys,etc.):
Moved the key values of the return options dictionary out of
private fields of the Interp struct and into thread-static
values managed in tclResult.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Updated to call the new TclGet/SetReturnOptions routines to do
much of their work.
* generic/tclInt.h (TclGetReturnOptions,TclSetReturnOptions):
* generic/tclResult.c (TclGetReturnOptions,TclSetReturnOptions):
New utility routines to get/set the return options of an interp.
Intent is that these routines will be converted to public routines
after TIP approval.
* generic/tclCmdMZ.c (TclProcessReturn,TclMergeReturnOptions):
* generic/tclResult.c (TclProcessReturn,TclMergeReturnOptions):
Move internal utility routines from tclCmdMZ.c to tclResult.c.
* generic/tclBasic.c (Tcl_CreateInterp, Tcl_DeleteInterp):
* generic/tclResult.c (TclTransferResult): Rework so that
iPtr->returnOpts can be NULL when there are no special options.
* generic/tclResult.c (TclRestoreInterpState): Plug potential
memory leak.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclResult.c (Tcl*InterpState): TclSaveInterpState,
TclRestoreInterpState, and TclDiscardInterpState are superior
replacements for Tcl_(Save|Restore|Discard)Result. Intent is that
these routines will be converted to public routines after TIP approval.
* generic/tclBasic.c (TclEvalObjvInternal):
* generic/tclDictObj.c (DictUpdateCmd, DictWithCmd):
* generic/tclIOGT.c (ExecuteCallback):
* generic/tclTrace.c (Trace*Proc,TclCheck*Traces,TclCallVarTraces):
Callers of Tcl_*Result updated to call the new routines. The
calls were relocated in several cases to perform save/restore
operations only when needed.
* generic/tclEvent.c (HandleBgErrors):
* generic/tclFCmd.c (CopyRenameOneFile):
Calls to Tcl_*Result that were eliminated because they appeared
to serve no useful purpose, typically saving/restoring an error
message, only to throw it away.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCmdAH.c (Tcl_CatchObjCmd):
* generic/tclCmdMZ.c (TclMergeReturnOptions,TclProcessReturn):
* generic/tclCompCmds.c (TclCompileReturnCmd):
* generic/tclExecute.c (TclCompEvalObj):
* generic/tclInt.h (Interp):
* generic/tclProc.c (TclUpdateReturnInfo):
Place primary storage of the -level and -code information in private
fields of the Interp struct, rather than in a DictObj. This should
significantly improve performance of TclUpdateReturnInfo.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TclEvalObjvInternal,Tcl_LogCommandInfo,TclAddObjErrorInfo):
* generic/tclCmdAH.c (Tcl_CatchObjCmd):
* generic/tclEvent.c (BgError,ErrAssocData,Tcl_BackgroundError,
HandleBgErrors,BgErrorDeleteProc):
* generic/tclExecute.c (TclCreateExecEnv,TclDeleteExecEnv):
* generic/tclIOUtil.c (comments only):
* generic/tclInt.h (ExecEnv,Interp, ERR_IN_PROGRESS):
* generic/tclInterp.c ([tclInit]):
* generic/tclMain.c (comments only):
* generic/tclNamesp.c
(Tcl_CreateNamespace,Tcl_DeleteNamespace,TclTeardownNamespace):
* generic/tclProc.c (TclUpdateReturnInfo):
* generic/tclResult.c
(Tcl_ResetResult,TclTransferResult):
* generic/tclTrace.c (CallVarTraces):
Reworked management of the "errorInfo" data of an interp.
That information is now primarily stored in a new private
(Tcl_Obj *) field of the Interp struct, rather than using a
global variable ::errorInfo as the primary storage. The
ERR_IN_PROGRESS flag bit value is no longer required to manage
the value in its new location, and is removed. Variable traces
are established to support compatibility for any code expecting
the ::errorInfo variable to hold the information.
***POTENTIAL INCOMPATIBILITY***
Code that sets traces on the ::errorInfo variable may notice a
difference in timing of the firing of those traces. Code that
uses the value ERR_IN_PROGRESS.
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclBinary.c:
* generic/tclCmdAH.c:
It is a poor practice to directly set or append to the value
of the objResult of an interp, because that value might be
shared, and in that circumstance a Tcl_Panic() will be the
result. Searched for example of this practice and replaced
with safer alternatives, often using the Tcl_AppendResult()
routine that dkf just rehabilitated.
|
|
|
|
|
| |
TclObjInvoke routine toward unification with the rest of the
evaluation stack.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TclEvalObjvInternal,Tcl_LogCommandInfo):
* generic/tclCmdAH.c (Tcl_CatchObjCmd):
* generic/tclEvent.c (BgError,Tcl_BackgroundError,HandleBgErrors):
* generic/tclInt.h (Interp, ERROR_CODE_SET):
* generic/tclNamesp.c
(Tcl_CreateNamespace,Tcl_DeleteNamespace,TclTeardownNamespace):
* generic/tclResult.c
(Tcl_ResetResult,Tcl_SetObjErrorCode,TclTransferResult):
* generic/tclTrace.c (CallVarTraces):
Reworked management of the "errorCode" data of an interp.
That information is now primarily stored in a new private
(Tcl_Obj *) field of the Interp struct, rather than using a
global variable ::errorCode as the primary storage. The
ERROR_CODE_SET flag bit value is no longer required to manage
the value in its new location, and is removed. Variable traces
are established to support compatibility for any code expecting
the ::errorCode variable to hold the information.
|
|
|
|
|
|
| |
* generic/tclInt.h (Interp): EXPR_INITIALIZED. It was set during
interp creation and never tested. Whatever purpose it had is in
the past.
|
|
|
|
|
|
|
| |
* generic/tclInt.h (Interp): USE_EVAL_DIRECT. It was used only
* generic/tcLTest.c (TestevalexObjCmd): in the testing command
* tests/parser.test (parse-9.2): [testevalex] and nothing in the
test suite made use of the capability it enabled.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCmdAH.c (Tcl_ErrorObjCmd): of the management of
* generic/tclCmdMZ.c (TclProcessReturn): the errorCode value.
* tests/error.test (error-6.4-9):
* generic/tclNamespace.c (TclTeardownNamespace): Tcl_Obj-ified
* tests/namespace.test (namespace-8.5,6): the save/restore
of ::errorInfo and ::errorCode during global namespace teardown.
Revised the comment to clarify why this is done, and added tests
that will fail if this is not done.
* generic/tclResult.c (TclTransferResult): Added safety
checks so that unexpected undefined ::errorInfo or ::errorCode
will not lead to a segfault.
* generic/tclTrace.c (TclCallVarTraces): Save/restore the flag
* tests/var.test (var-16.1): values that define part of the
interpreter state during variable traces. [Bug 10381021].
|
|
|
|
| |
uninitialised variable.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclInt.decls: TclGlobalInvoke, TclObjInvokeGlobal and
* tests/basic.test: the portion of TclObjInvoke that handles
calls without TCL_INVOKE_HIDDEN enabled. None of this code is
called any longer within the core, and the superior public
interface, Tcl_EvalObjv, is available for any external callers.
* generic/tclIntDecls.h: make genstubs
* generic/tclStubInit.c:
* generic/tclEvent.c (HandleBgErrors): Updated [bgerror]
invocations to make use of Tcl_Obj based routines, dropping
the calls to TclGlobalInvoke()
|
|
|
|
|
|
|
|
| |
* generic/tclExecute.c: regarding ERR_ALREADY_LOGGED. That commit
* generic/tclNamesp.c: caused Tk test send-10.7 to fail. Added
* tests/namespace.test (25.7,8): tests in the Tcl test suite
* tests/pkg.test (2.25,26): to catch this error without the
aid of Tk in the future.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCompile.c: flag ERR_ALREADY_LOGGED, to reduce
* generic/tclExecute.c: its exposure. Still left several
* generic/tclNamesp.c: references that are just too nice
on performace to do away with. These changes also resolve
an inconsistency in the ::errorInfo values produced by
[namespace eval x error foo bar] and
[namespace eval x {error foo bar}].
* generic/tclExecute.c (TclCompEvalObj): Simplified
the TclCompEvalObj routine. Much housekeeping now reliably
happens elsewhere. [Patch 1031949]
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCmdAH.c ([catch], [error]):
* generic/tclCmdMZ.c ([return]):
* generic/tclProc.c (TclUpdateReturnInfo):
* generic/tclResult.c (Tcl_SetErrorCodeVA, Tcl_SetObjErrorCode
TclTransferResult): Refactored so that all errorCode setting
flows through Tcl_SetObjErrorCode(). This greatly reduces the
number of different places in the code that need to know details
about an internal bitflag field of the Interp struct. Also
places errorCode setting in one place for easier future mods.
|
|
|
|
|
| |
field for storing the string-based command procedure of built-in
commands. We no longer have any string-based built-in commands!
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* doc/interp.n: Added support for a -namespace option to the
* generic/tclBasic.c: [interp invokehidden] command. Also added an
* generic/tclInt.h: internal routine TclObjInvokeNamespace() and
* generic/tclInterp.c: corrected the flag names TCL_FIND_ONLY_NS and
* generic/tclNamesp.c: TCL_CREATE_NS_IF_UNKNOWN that are passed to the
* generic/tclTrace.c: internal routine TclGetNamespaceForQualName().
* tests/interp.test: [Patch 981841]
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclBasic.c (DeleteInterpProc):
* generic/tclLiteral.c (TclCleanupLiteralTable):
* generic/tclInt.h: added a TclCleanupLiteralTable function,
called from DeleteInterpProc, that frees internal representations
of shared literals early when an interpreter is being deleted.
This change corrects a number of memory mismanagement issues in
the cases where the internal representation of one literal
contains a reference to another, and avoids conditions such as
resolved variable names referring to procedure and namespace
contexts that no longer exist. [Bug 994838]
|
|
|
|
| |
objv[objectsUsed] on error.
|
|
|
|
|
| |
insuring that the fix of [Bug 983660] does not have a negative perf
impact.
|
|
|
|
|
|
|
|
|
| |
found by pspjuth. Tear down the global namespace before freeing
the interp handle, to allow the bytecodes to free their non-shared
literals.
* generic/tclLiteral.c (TclReleaseLiteral): moved special code for
self-ref so that it is also used for non-shared literals. Possible
bug found by inspection.
|
|
|
|
|
|
|
| |
so that it doesn't require Stubs.
* generic/tclBasic.c (Tcl_CreateInterp): Removed comment stating
that TclInitEmbeddedConfigurationInformation needs Stubs; with the
change above, the comment is now erroneous.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* win/configure.in: handle --libdir configuration.
* unix/configure.in: autoconf-2.57
* win/configure.in:
* generic/tclBasic.c (Tcl_CreateInterp): Moved call to
TclInitEmbeddedConfigurationInformation() earlier in
Tcl_CreateInterp() so that other parts of interp creation
and initialization may access and use the config values.
|
|
|
|
| |
Added C docs, cleaned up C code, added note on behaviour of limited master interps
|
| |
|
| |
|
|
|
|
|
|
| |
* generic/tclExecute.c (INST_START_CMD): interp deletion now
modifies the compileEpoch, eliminating the need for the check for
interp deletion in INST_START_CMD.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclInt.h: Reworked the Tcl header files into a clean
* unix/tclUnixPort.h: hierarchy where tcl.h < tclPort.h < tclInt.h
* win/tclWinInt.h: and every C source file should #include
* win/tclWinPort.h: at most one of those files to satisfy its
declaration needs. tclWinInt.h and tclWinPort.h also better organized
so that tclWinPort.h includes the Windows implementation of
cross-platform declarations, while tclWinInt.h makes declarations that
are available on Windows only.
* generic/tclBinary.c (TCL_NO_MATH): Deleted the generic/tclMath.h
* generic/tclMath.h (removed): header file. The internal Tcl
* macosx/Makefile (PRIVATE_HEADERS): header, tclInt.h, has a
* win/tcl.dsp: #include <math.h> directly,
and file external to Tcl needing libm should do the same.
* win/Makefile.in (WIN_OBJS): Deleted the win/tclWinMtherr.c file.
* win/makefile.bc (TCLOBJS): It's a vestige from matherr() days
* win/makefile.vc (TCLOBJS): gone by.
* win/tcl.dsp:
* win/tclWinMtherr.c (removed):
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Not a direct copy
* Better use of Tcl object API
* More extensive test suite
* More extensive documentation
|
|
|
|
|
|
|
| |
to 'Tcl_Panic' (the function). The #define
of panic in tcl.h clearly states it is
deprecated in the comments.
[Patch 865264]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/Tcl.n: of the new leading {expand} syntax on words.
* generic/tcl.h: Parses such words as the new Tcl_Token type
* generic/tclBasic.c: TCL_TOKEN_EXPAND_WORD. Updated Tcl_EvalEx
* generic/tclCompile.c: and the bytecode compiler/execution engine
* generic/tclCompile.h: to recognize the new token type. New opcodes
* generic/tclExecute.c: INST_LIST_VERIFY and INST_INVOKE_EXP and a new
* generic/tclParse.c: operand type OPERAND_ULIST1 are defined. Docs
* generic/tclTest.c: and tests are included.
* tests/basic.test:
* tests/compile.test:
* tests/parse.test:
* library/auto.tcl: Replaced several [eval]s used to perform
* library/package.tcl: argument expansion with the new syntax.
* library/safe.tcl: In the test files lindex.test and lset.test,
* tests/cmdInfo.test: replaced use of [eval] to force direct
* tests/encoding.test: string evaluation with use of [testevalex]
* tests/execute.test: which more directly and robustly serves the
* tests/fCmd.test: same purpose.
* tests/http.test:
* tests/init.test:
* tests/interp.test:
* tests/io.test:
* tests/ioUtil.test:
* tests/iogt.test:
* tests/lindex.test:
* tests/lset.test:
* tests/namespace-old.test:
* tests/namespace.test:
* tests/pkg.test:
* tests/pkgMkIndex.test:
* tests/proc.test:
* tests/reg.test:
* tests/trace.test:
* tests/upvar.test:
* tests/winConsole.test:
* tests/winFCmd.test:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
that appends a Tcl_Obj to the errorInfo, saving the caller the trouble
of extracting the string rep.
* generic/tclStringObj.c (TclAppendLimitedToObj): New internal
routine that supports truncated appends with optional ellipsis marking.
This single routine supports UTF-8-safe truncated appends needed in
several places throughout the Tcl source code, mostly for error and
stack messages. Clean fix for [Bug 760872].
* generic/tclInt.h: Declarations for new internal routines.
* generic/tclCmdMZ.c: Updated callers to use the new routines.
* generic/tclCompExpr.c:
* generic/tclCompile.c:
* generic/tclExecute.c:
* generic/tclIOUtil.c:
* generic/tclNamesp.c:
* generic/tclObj.c:
* generic/tclParseExpr.c:
* generic/tclProc.c:
* generic/tclStringObj.c:
* mac/tclMacResource.c:
* library/init.tcl: Updated ::errorInfo cleanup in [unknown] to
reflect slight modifications to Tcl_LogCommandInfo(). Corrects
failing init-4.* tests.
|
|
|
|
|
|
|
| |
control the state of errorCode and errorInfo management when calling
"leave" execution traces, so that all error information of the traced
command is still available whether traced or not. [Bug 760947]
Thanks to Yahalom Emet.
|
|
|
|
|
| |
* generic/tclCmdMZ.c: and execution traces that caused access to
freed memory in trace-32.1. [Bug 811483].
|
| |
|
| |
|
| |
|
| |
|