| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
* generic/tclProc.c (TclUpdateReturnInfo): storage for the
errorInfo and errorCode values are internal fields, we can set
them at the time of the [return] command, and not have to wait
until the specified number of "-level"s have popped.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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:
* generic/tclCmdIL.c:
* generic/tclCmdMZ.c:
* generic/tclCompExpr.c:
* generic/tclDictObj.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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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].
|
|
|
|
|
|
|
| |
* generic/tclCompile.c (TclCompileScript): option to [return].
* tests/compile.test (16.23.*): Use that capability to defer reporting
* tests/misc.test (1.2): of parse errors until runtime.
Updated tests to reflect change. [Bug 1032805]
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
| |
removed potential memory leak. [Bug 986257].
|
| |
|
|
|
|
| |
Also added support for [FRQ 951168] but left that switched off by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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):
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
such as [return -code error $msg] to be bytecompiled.
* generic/tclInt.h: Factored Tcl_ReturnObjCmd() into two pieces:
* generic/tclCmdMZ.c: TclMergeReturnOptions(), which can parse the
options to [return], check their validity, and create the
corresponding return options dictionary, and TclProcessReturn(),
which takes that return options dictionary and performs the
[return] operation.
* generic/tclCompCmds.c: Rewrote TclCompileReturnCmd() to
call TclMergeReturnOptions() at compile time so the return options
dictionary is computed at compile time (when it is fully known).
The dictionary is pushed on the stack along with the result, and
the code and level values are included in the bytecode as operands.
Also supports optimized compilation of un-[catch]ed [return]s from
procs with default options into the INST_DONE instruction.
* generic/tclExecute.c: Rewrote INST_RETURN instruction to retrieve
the code and level operands, pop the return options from the stack,
and call TclProcessReturn() to perform the [return] operation.
* generic/tclCompile.h: New utilities include TclEmitInt4 macro
* generic/tclCompile.c: and TclWordKnownAtCompileTime().
|
|
|
|
|
|
|
| |
to 'Tcl_Panic' (the function). The #define
of panic in tcl.h clearly states it is
deprecated in the comments.
[Patch 865264]
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/source.n: TIPs 137/151. Adds
* doc/tclsh.1: a -encoding option to
* generic/tcl.decls: the [source] command
* generic/tclCmdMZ.c (Tcl_SourceObjCmd): and a new C routine,
* generic/tclIOUtil.c (Tcl_FSEvalFileEx): Tcl_FSEvalFileEx(),
* generic/tclMain.c (Tcl_Main): that provides C access
* mac/tclMacResource.c (Tcl_MacSourceObjCmd): to the same function.
* tests/cmdMZ.test: Also adds command line
* tests/main.test: option handling in Tcl_Main() so that tclsh
* tests/source.test: and other apps built on Tcl_Main() respect
a -encoding command line option before a script filename. Docs and
tests updated as well. [Patch 742683]
This is a ***POTENTIAL INCOMPATIBILITY*** only for those C programs
that embed Tcl, build on Tcl_Main(), and make use of Tcl_Main's former
ability to pass a leading "-encoding" option to interactive shell
operations.
* generic/tclInt.decls: Added internal stub
* generic/tclMain.c (Tcl*StartupScript*): table entries for
two new functions Tcl_SetStartupScript() and Tcl_GetStartupScript()
that set/get the path and encoding for the startup script to be
evaluated by either Tcl_Main() or Tk_Main(). Given public names in
anticipation of their exposure by a followup TIP.
* generic/tclDecls.h: make genstubs
* generic/tclIntDecls.h:
* generic/tclStubInit.c:
|
|
|
|
| |
is deeply tricky. [Bug 759936]
|
|
|
|
| |
and tricky enough to discourage non-specialists...
|
| |
|
|
|
|
| |
crash when overflow sizes were given (throws error). [Bug #714106]
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCmdAH.c: extends the [catch] and [return]
* generic/tclCompCmds.c: commands to enable creation of a
* generic/tclExecute.c: proc that is a replacement for
* generic/tclInt.h: [return]. [Patch 531640]
* generic/tclProc.c:
* generic/tclResult.c:
* tests/cmdAH.test:
* tests/cmdMZ.test:
* tests/error.test:
* tests/proc-old.test:
* library/tcltest/tcltest.tcl: The -returnCodes option to [test]
failed to recognize the symbolic name "ok" for return code 0.
|
|
|
|
|
|
|
|
| |
inconsistent results of [string is integer] observed on systems
where sizeof(long) != sizeof(int). [Bug 718878]
* tests/string.test: Added tests for Bug 718878.
* doc/string.n: Clarified that [string is integer] accepts
32-bit integers.
|
| |
|
|
|
|
| |
Tcl_DiscardResult() call to avoid memory leak.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCmdMZ.c (Tcl_SubstObj):
* generic/tclCompCmds.c (TclCompileSwitchCmd):
* generic/tclCompExpr.c (CompileSubExpr):
* generic/tclCompile.c (TclSetByteCodeFromAny,TclCompileScript,
TclCompileTokens,TclCompileCmdWord):
* generic/tclCompile.h (TclCompileScript):
* generic/tclExecute.c (TclCompEvalObj):
* generic/tclInt.h (Interp,TCL_BRACKET_TERM,TclSubstTokens):
* generic/tclParse.c (ParseTokens,Tcl_SubstObj,TclSubstTokens):
* tests/subst.test (2.4, 8.7, 8.8, 11.4, 11.5):
Substantial refactoring of Tcl_SubstObj to make use of the same
parsing and substitution procedures as normal script evaluation.
Tcl_SubstObj() moved to tclParse.c. New routine TclSubstTokens()
created in tclParse.c which implements all substantial functioning
of Tcl_EvalTokensStandard(). TclCompileScript() loses its
"nested" argument, the Tcl_Interp struct loses its termOffset
field and the TCL_BRACKET_TERM flag in the evalFlags field, all
of which were only used (indirectly) by Tcl_SubstObj(). Tests
subst-8.7,8.8,11.4,11.5 modified to accomodate the only behavior
change: reporting of parse errors now takes precedence over
[return] and [continue] exceptions. All other behavior should
|
|
|
|
| |
deleting a command that had trace on it. [Bug #693564] (sofer)
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclCmdMZ.c (Tcl_StringObjCmd STR_MATCH):
* generic/tclUtf.c (TclUniCharMatch):
* generic/tclInt.decls: add private TclUniCharMatch function that
* generic/tclIntDecls.h: does string match on counted unicode
* generic/tclStubInit.c: strings. Tcl_UniCharCaseMatch has the
* tests/string.test: failing that it can't handle strings or
* tests/stringComp.test: patterns with embedded NULLs. Added
tests that actually try strings/pats with NULLs. TclUniCharMatch
should be TIPed and made public in the next minor version rev.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* generic/tclCmdMZ.c (Tcl_SplitObjCmd): Use TclUtfToUniChar.
Also added a special case for single-ascii-char splits.
(Tcl_StringObjCmd): Use TclUtfToUniChar.
For STR_RANGE, support getting ranges of ByteArrays (reverts
change from 2000-05-26).
(TraceExecutionProc) add proper static declaration.
|
| |
|
|
|
|
|
| |
* generic/tclCmdMZ.c: fix for freed memory r/w in delete traces
[Bug 589863], patch by Hemang Lavana.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/Concat.3: all remaining public interfaces of Tcl.
* doc/CrtCommand.3: Notably, the parser no longer writes on
* doc/CrtSlave.3: the string it is parsing, so it is no
* doc/CrtTrace.3: longer necessary for Tcl_Eval() to be
* doc/Eval.3: given a writable string. Also, the
* doc/ExprLong.3: refactoring of the Tcl_*Var* routines
* doc/LinkVar.3: by Miguel Sofer is included, so that the
* doc/ParseCmd.3: "part1" argument for them no longer needs
* doc/SetVar.3: to be writable either.
* doc/TraceVar.3:
* doc/UpVar.3: Compatibility support has been enhanced so
* generic/tcl.decls that a #define of USE_NON_CONST will remove
* generic/tcl.h all possible source incompatibilities with
* generic/tclBasic.c the 8.3 version of the header file(s).
* generic/tclCmdMZ.c The new #define of USE_COMPAT_CONST now does
* generic/tclCompCmds.c what USE_NON_CONST used to do -- disable
* generic/tclCompExpr.c only those new CONST's that introduce
* generic/tclCompile.c irreconcilable incompatibilities.
* generic/tclCompile.h
* generic/tclDecls.h Several bugs are also fixed by this patch.
* generic/tclEnv.c [Bugs 584051,580433] [Patches 585105,582429]
* generic/tclEvent.c
* generic/tclInt.decls
* generic/tclInt.h
* generic/tclIntDecls.h
* generic/tclInterp.c
* generic/tclLink.c
* generic/tclObj.c
* generic/tclParse.c
* generic/tclParseExpr.c
* generic/tclProc.c
* generic/tclTest.c
* generic/tclUtf.c
* generic/tclUtil.c
* generic/tclVar.c
* mac/tclMacTest.c
* tests/expr-old.test
* tests/parseExpr.test
* unix/tclUnixTest.c
* unix/tclXtTest.c
* win/tclWinTest.c
|
|
|
|
|
| |
as the Tcl_ObjSetVar2 may cause the result to change.
[Patch #558324] (watson)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/trace.n: execution tracing [FR #462580] (lavana).
* generic/tcl.h: This includes enter/leave tracing as well
* generic/tclBasic.c: as inter-procedure stepping.
* generic/tclCmdMZ.c:
* generic/tclCompile.c:
* generic/tclExecute.c:
* generic/tclInt.decls:
* generic/tclInt.h:
* generic/tclIntDecls.h:
* generic/tclStubInit.c:
* generic/tclVar.c:
* tests/trace.test:
|
| |
|
|
|
|
|
|
|
| |
* generic/tclCmdMZ.c (Tcl_StringObjCmd): changed the case for
choosing the Tcl_UniCharNcmp compare to when both objs are of
StringType, as benchmarks show that is the optimal check (both
bigendian and littleendian systems).
|
|
|
|
|
| |
probably optimized far in excess of anything we could do! Little-endian
just use the old code...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* generic/tclIntDecls.h:
* generic/tclStubInit.c:
* generic/tclUtf.c: added TclpUtfNcmp2 private command that
mirrors Tcl_UtfNcmp, but takes n in bytes, not utf-8 chars. This
provides a faster alternative for comparing utf strings internally.
(Tcl_UniCharNcmp, Tcl_UniCharNcasecmp): removed the explicit end
of string check as it wasn't correct for the function (by doc and
logic).
* generic/tclCmdMZ.c (Tcl_StringObjCmd): reworked the string equal
comparison code to use TclpUtfNcmp2 as well as short-circuit for
equal objects or unequal length strings in the equal case.
Removed the use of goto and streamlined the other parts.
* generic/tclExecute.c (TclExecuteByteCode): added check for
object equality in the comparison instructions. Added
short-circuit for != length strings in INST_EQ, INST_NEQ and
INST_STR_CMP. Reworked INST_STR_CMP to use TclpUtfNcmp2 where
appropriate, and only use Tcl_UniCharNcmp when at least one of the
objects is a Unicode obj with no utf bytes.
|
| |
|
|
|
|
|
|
| |
TCL_BREAK and TCL_CONTINUE returned by variable substitution
have the same effect as when those codes are returned by command
substitution. [Bug 536879]
|
|
|
|
|
|
|
|
|
| |
(TraceCommandProc, TclTraceCommandObjCmd): corrected
potential double-free of traces on variables by flagging in
Trace*Proc that it will free the var in case the eval wants to
delete the var trace as well. [Bug #536937]
Also converted Tcl_UntraceVar -> Tcl_UntraceVar2 and Tcl_Eval to
Tcl_EvalEx in Trace*Proc for slight efficiency improvement.
|
|
|
|
| |
to TIP 27. In particular, the "part2" arguments were CONSTified.
|