Compare commits
217
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c44a55411 | ||
|
|
a33a94ec85 | ||
|
|
f36f801d24 | ||
|
|
55b0c17067 | ||
|
|
272b2008ad | ||
|
|
f7cf1b2bae | ||
|
|
8173bccfd9 | ||
|
|
a5b75dfa9a | ||
|
|
52b97dd00b | ||
|
|
f632850eb8 | ||
|
|
ed72e77b7d | ||
|
|
83d427e824 | ||
|
|
f18c1126d5 | ||
|
|
62e1b3723e | ||
|
|
4d6aaa2e8b | ||
|
|
4bf79aef9b | ||
|
|
a6f2dee7fb | ||
|
|
c084f0ea75 | ||
|
|
5cdaf0e05b | ||
|
|
fe60431f53 | ||
|
|
058f0df44d | ||
|
|
bee5c35f44 | ||
|
|
8971b5cdea | ||
|
|
0c1e275cdf | ||
|
|
a2400fbe30 | ||
|
|
211f7d6466 | ||
|
|
6dee5b3e07 | ||
|
|
9d1f38c3e3 | ||
|
|
33647e79c8 | ||
|
|
f440a6ef41 | ||
|
|
c086de021c | ||
|
|
97eb71a629 | ||
|
|
e62b40c808 | ||
|
|
234fb04984 | ||
|
|
1b7d424507 | ||
|
|
5797625e42 | ||
|
|
987422a01f | ||
|
|
5f6b71f3f2 | ||
|
|
f6f0891fff | ||
|
|
27c5ada57e | ||
|
|
5f2f5b63c3 | ||
|
|
59f7320bdd | ||
|
|
00546e5e21 | ||
|
|
a63563bd9a | ||
|
|
1d99884b08 | ||
|
|
8bd533d76e | ||
|
|
23d61a10c2 | ||
|
|
0ee8df700b | ||
|
|
50a950f2b1 | ||
|
|
c74640849e | ||
|
|
861b34625c | ||
|
|
0958b92b37 | ||
|
|
6d9ae4aa16 | ||
|
|
965128fe34 | ||
|
|
ebc5b27c8c | ||
|
|
3916ce9d4c | ||
|
|
4bd227bc12 | ||
|
|
84e92af6dc | ||
|
|
15ca940ca7 | ||
|
|
525bc7c9b5 | ||
|
|
6adf3b8c6c | ||
|
|
3d14dd6bc9 | ||
|
|
41afeeec2b | ||
|
|
623c1cbe5b | ||
|
|
60ef39d24a | ||
|
|
889454ec06 | ||
|
|
752ab085d6 | ||
|
|
c019848148 | ||
|
|
fd1c7c2fb3 | ||
|
|
8f2d19b951 | ||
|
|
f2bea640bb | ||
|
|
d818803502 | ||
|
|
e0437fdf58 | ||
|
|
8163234efd | ||
|
|
f796ad762c | ||
|
|
0185dd6477 | ||
|
|
07d10b8a58 | ||
|
|
bc28cd1ac8 | ||
|
|
9350513d16 | ||
|
|
4fb5d04b2f | ||
|
|
f287d8cb0f | ||
|
|
0c2e553e8f | ||
|
|
915c6abe66 | ||
|
|
0070244914 | ||
|
|
17ebc3cd20 | ||
|
|
5e9e003379 | ||
|
|
2aed1acbd1 | ||
|
|
81a1a91361 | ||
|
|
9a19e4cba0 | ||
|
|
c2d6c48dd9 | ||
|
|
d383707870 | ||
|
|
c33f97005c | ||
|
|
3f126895fb | ||
|
|
d848f30c45 | ||
|
|
d860a2c3a4 | ||
|
|
009f2adf3d | ||
|
|
774c402365 | ||
|
|
740d1811bc | ||
|
|
451ab6927c | ||
|
|
f302557ad5 | ||
|
|
d061b31460 | ||
|
|
783aea7d3a | ||
|
|
34c17bad36 | ||
|
|
f0992177e4 | ||
|
|
6f4f296706 | ||
|
|
75bc23d59c | ||
|
|
9d91a3db0b | ||
|
|
1dc19d8370 | ||
|
|
458197828b | ||
|
|
c079ab076f | ||
|
|
d69c39d52e | ||
|
|
7a53c36e3a | ||
|
|
ee74db1cbf | ||
|
|
1e62f5ac76 | ||
|
|
afad6ffbb4 | ||
|
|
d72d5f8b7a | ||
|
|
c46c774126 | ||
|
|
ba3bf9b61f | ||
|
|
82bddf4dca | ||
|
|
e10479f3d7 | ||
|
|
7183692271 | ||
|
|
b7fbf3c433 | ||
|
|
c10c796a46 | ||
|
|
582824087d | ||
|
|
da4296c06f | ||
|
|
0dec640514 | ||
|
|
d2b490f552 | ||
|
|
4cfafc3002 | ||
|
|
fb3fc7d5d3 | ||
|
|
de31df63e7 | ||
|
|
a7bebaafdb | ||
|
|
bd6afa9af5 | ||
|
|
c8629fcad6 | ||
|
|
b52ba9ae90 | ||
|
|
a6fe3119b2 | ||
|
|
28bc2e5adf | ||
|
|
191c6d2137 | ||
|
|
7eab500306 | ||
|
|
421cc90918 | ||
|
|
e26d6e29c1 | ||
|
|
57f4decd9b | ||
|
|
e0373f12ec | ||
|
|
fa8b071f04 | ||
|
|
6f68b762d3 | ||
|
|
ade4e6d9bb | ||
|
|
a6b67f2ef2 | ||
|
|
88731d9d93 | ||
|
|
73faa3bbb6 | ||
|
|
89b2fc0982 | ||
|
|
7d8dff7c72 | ||
|
|
aec5846c12 | ||
|
|
05fb0c0810 | ||
|
|
a47b03577b | ||
|
|
fda71d6d4c | ||
|
|
7070acfea1 | ||
|
|
eec0dcb530 | ||
|
|
c0f408b9cd | ||
|
|
ddd130e532 | ||
|
|
e592a6c9d5 | ||
|
|
5ea3e8b570 | ||
|
|
324ca57f3d | ||
|
|
a9f49cd781 | ||
|
|
b3fea91162 | ||
|
|
ae7b32a706 | ||
|
|
eaf387ef13 | ||
|
|
78b0a4a13c | ||
|
|
f7fd65de47 | ||
|
|
d751f58f9d | ||
|
|
5eecd400b7 | ||
|
|
3f19b90244 | ||
|
|
11f1a88c12 | ||
|
|
c012287fc8 | ||
|
|
9fd3e86565 | ||
|
|
adb4b18477 | ||
|
|
dc4782f595 | ||
|
|
708da35f79 | ||
|
|
07bfe18a21 | ||
|
|
9497794406 | ||
|
|
8d8c38c7c7 | ||
|
|
dcb4da22fa | ||
|
|
130c6dd203 | ||
|
|
bbca4ec51b | ||
|
|
4a6f1d02be | ||
|
|
202a7c4db1 | ||
|
|
4d9fc81c0f | ||
|
|
cdd8467ca9 | ||
|
|
099345d98c | ||
|
|
76df95e6e4 | ||
|
|
7243b34d80 | ||
|
|
6a445a3fe6 | ||
|
|
d6ca452640 | ||
|
|
7b9871647a | ||
|
|
5f13065a33 | ||
|
|
e80db5fa35 | ||
|
|
3215339ef0 | ||
|
|
b7289f092d | ||
|
|
ded13430f9 | ||
|
|
6eb0e8555d | ||
|
|
c05b753e95 | ||
|
|
f332c17690 | ||
|
|
df6a99b1f7 | ||
|
|
07096327dc | ||
|
|
a831b299f7 | ||
|
|
b6b9185fa8 | ||
|
|
bd6f6a89c6 | ||
|
|
169288808b | ||
|
|
615ab1a0d4 | ||
|
|
c961880a26 | ||
|
|
f118d91a3d | ||
|
|
3c473ee0c4 | ||
|
|
67264f1e10 | ||
|
|
9cccd5fd91 | ||
|
|
470fc04dd0 | ||
|
|
46db2c3edd | ||
|
|
52ce2fdeb0 | ||
|
|
b6b0d1b8dd | ||
|
|
1ddb66bfda |
@@ -1,3 +1,53 @@
|
||||
2013-08-03 Donal Fellows <dkf@users.sf.net>
|
||||
|
||||
* library/auto.tcl: [Patch 3611643]: Allow TclOO classes to be found
|
||||
by the autoloading mechanism.
|
||||
|
||||
2013-08-02 Donal Fellows <dkf@users.sf.net>
|
||||
|
||||
* generic/tclOODefineCmds.c (ClassSuperSet): Bug [9d61624b3d]: Stop
|
||||
crashes when emptying the superclass slot, even when doing elaborate
|
||||
things with metaclasses.
|
||||
|
||||
2013-08-01 Harald Oehlmann <oehhar@users.sf.net>
|
||||
|
||||
* tclUnixNotify.c (Tcl_InitNotifier): Bug [a0bc856dcd]: Start notifier
|
||||
thread again if we were forked, to solve Rivet bug 55153.
|
||||
|
||||
2013-07-05 Kevin B. Kenny <kennykb@acm.org>
|
||||
|
||||
* library/tzdata/Africa/Casablanca:
|
||||
* library/tzdata/America/Asuncion:
|
||||
* library/tzdata/Antarctica/Macquarie:
|
||||
* library/tzdata/Asia/Gaza:
|
||||
* library/tzdata/Asia/Hebron:
|
||||
* library/tzdata/Asia/Jerusalem:
|
||||
http://www.iana.org/time-zones/repository/releases/tzdata2013d.tar.gz
|
||||
|
||||
2013-07-03 Jan Nijtmans <nijtmans@users.sf.net>
|
||||
|
||||
* unix/tclXtNotify.c: Bug [817249]: bring tclXtNotify.c up to date with
|
||||
Tcl_SetNotifier() change.
|
||||
|
||||
2013-07-02 Jan Nijtmans <nijtmans@users.sf.net>
|
||||
|
||||
* unix/tcl.m4: Bug [32afa6e256]: dirent64 check is incorrect in tcl.m4
|
||||
* unix/configure: (thanks to Brian Griffin)
|
||||
|
||||
2013-06-27 Jan Nijtmans <nijtmans@users.sf.net>
|
||||
|
||||
* generic/tclConfig.c: Bug [9b2e636361]: Tcl_CreateInterp() needs initialized
|
||||
* generic/tclMain.c: encodings.
|
||||
|
||||
2013-06-18 Jan Nijtmans <nijtmans@users.sf.net>
|
||||
|
||||
* generic/tclEvent.c: Bug [3611974]: InitSubsystems multiple thread issue.
|
||||
|
||||
2013-06-17 Jan Nijtmans <nijtmans@users.sf.net>
|
||||
|
||||
* generic/regc_locale.c: Bug [a876646efe]: re_expr character class
|
||||
[:cntrl:] should contain \u0000 - \u001f
|
||||
|
||||
2013-06-09 Donal K. Fellows <dkf@users.sf.net>
|
||||
|
||||
* generic/tclCompCmdsSZ.c (TclCompileTryCmd): [Bug 779d38b996]:
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
README: Tcl
|
||||
This is the Tcl 8.6.0 source distribution.
|
||||
http://tcl.sourceforge.net/
|
||||
You can get any source release of Tcl from the file distributions
|
||||
link at the above URL.
|
||||
http://sourceforge.net/projects/tcl/files/Tcl/
|
||||
You can get any source release of Tcl from the URL above.
|
||||
|
||||
Contents
|
||||
--------
|
||||
@@ -27,9 +26,14 @@ Tcl can also be used for a variety of web-related tasks and for creating
|
||||
powerful command languages for applications.
|
||||
|
||||
Tcl is maintained, enhanced, and distributed freely by the Tcl community.
|
||||
The home for Tcl/Tk releases and bug/patch database is on SourceForge:
|
||||
Source code development and tracking of bug reports and feature requests
|
||||
takes place at:
|
||||
|
||||
http://tcl.sourceforge.net/
|
||||
http://core.tcl.tk/
|
||||
|
||||
Tcl/Tk release and mailing list services are hosted by SourceForge:
|
||||
|
||||
http://sourceforge.net/projects/tcl/
|
||||
|
||||
with the Tcl Developer Xchange hosted at:
|
||||
|
||||
@@ -49,7 +53,7 @@ The home page for this release, including new features, is
|
||||
|
||||
Detailed release notes can be found at the file distributions page
|
||||
by clicking on the relevant version.
|
||||
http://sourceforge.net/projects/tcl/files/
|
||||
http://sourceforge.net/projects/tcl/files/Tcl/
|
||||
|
||||
Information about Tcl itself can be found at
|
||||
http://www.tcl.tk/about/
|
||||
@@ -146,18 +150,13 @@ and go to the Mailing Lists page.
|
||||
------------------------
|
||||
|
||||
We are very interested in receiving bug reports, patches, and suggestions
|
||||
for improvements. We prefer that you send this information to us via the
|
||||
bug form at SourceForge, rather than emailing us directly. The bug
|
||||
database is at:
|
||||
for improvements. We prefer that you send this information to us as
|
||||
tickets entered into our tracker at:
|
||||
|
||||
http://tcl.sourceforge.net/
|
||||
|
||||
The bug form was designed to give uniform structure to bug reports as
|
||||
well as to solicit enough information to minimize followup questions.
|
||||
http://core.tcl.tk/tcl/reportlist
|
||||
|
||||
We will log and follow-up on each bug, although we cannot promise a
|
||||
specific turn-around time. Enhancements, reported via the Feature
|
||||
Requests form at the same web site, may take longer and may not happen
|
||||
specific turn-around time. Enhancements may take longer and may not happen
|
||||
at all unless there is widespread support for them (we're trying to
|
||||
slow the rate at which Tcl/Tk turns into a kitchen sink). It's very
|
||||
difficult to make incompatible changes to Tcl/Tk at this point, due to
|
||||
|
||||
Binary file not shown.
+6
-6
@@ -176,16 +176,16 @@ these return options.
|
||||
The \fB\-errorinfo\fR option holds a stack trace of the
|
||||
operations that were in progress when an error occurred,
|
||||
and is intended to be human-readable.
|
||||
The \fB\-errorcode\fR option holds a list of items that
|
||||
The \fB\-errorcode\fR option holds a Tcl list of items that
|
||||
are intended to be machine-readable.
|
||||
The first item in the \fB\-errorcode\fR value identifies the class of
|
||||
error that occurred
|
||||
(e.g. POSIX means an error occurred in a POSIX system call)
|
||||
(e.g., POSIX means an error occurred in a POSIX system call)
|
||||
and additional elements hold additional pieces
|
||||
of information that depend on the class.
|
||||
See the \fBtclvars\fR manual entry for details on the various
|
||||
formats for the \fB\-errorcode\fR option used by
|
||||
Tcl's built-in commands.
|
||||
See the manual entry on the \fBerrorCode\fR variable for details on the
|
||||
various formats for the \fB\-errorcode\fR option used by Tcl's built-in
|
||||
commands.
|
||||
.PP
|
||||
The \fB\-errorinfo\fR option value is gradually built up as an
|
||||
error unwinds through the nested operations.
|
||||
@@ -307,6 +307,6 @@ so they continue to hold a record of information about the
|
||||
most recent error seen in an interpreter.
|
||||
.SH "SEE ALSO"
|
||||
Tcl_DecrRefCount(3), Tcl_IncrRefCount(3), Tcl_Interp(3), Tcl_ResetResult(3),
|
||||
Tcl_SetErrno(3), tclvars(n)
|
||||
Tcl_SetErrno(3), errorCode(n), errorInfo(n)
|
||||
.SH KEYWORDS
|
||||
error, value, value result, stack, trace, variable
|
||||
|
||||
+4
-3
@@ -41,8 +41,9 @@ may only be passed to Tcl routines called from the same thread as
|
||||
the original \fBTcl_CreateInterp\fR call. It is not safe for multiple
|
||||
threads to pass the same token to Tcl's routines.
|
||||
The new interpreter is initialized with the built-in Tcl commands
|
||||
and with the variables documented in the \fBtclvars\fR manual page. To bind in
|
||||
additional commands, call \fBTcl_CreateCommand\fR.
|
||||
and with standard variables like \fBtcl_platform\fR and \fBenv\fR. To
|
||||
bind in additional commands, call \fBTcl_CreateCommand\fR, and to
|
||||
create additional variables, call \fBTcl_SetVar\fR.
|
||||
.PP
|
||||
\fBTcl_DeleteInterp\fR marks an interpreter as deleted; the interpreter
|
||||
will eventually be deleted when all calls to \fBTcl_Preserve\fR for it have
|
||||
@@ -144,6 +145,6 @@ should be used to determine when an interpreter is a candidate for deletion
|
||||
due to inactivity.
|
||||
.VE 8.6
|
||||
.SH "SEE ALSO"
|
||||
Tcl_Preserve(3), Tcl_Release(3), tclvars(n)
|
||||
Tcl_Preserve(3), Tcl_Release(3)
|
||||
.SH KEYWORDS
|
||||
command, create, delete, interpreter
|
||||
|
||||
+1
-1
@@ -33,6 +33,6 @@ Tcl-based applications using \fBputenv\fR should redefine it to
|
||||
\fBTcl_PutEnv\fR so that they will interface properly to the Tcl
|
||||
runtime.
|
||||
.SH "SEE ALSO"
|
||||
tclvars(n)
|
||||
env(n)
|
||||
.SH KEYWORDS
|
||||
environment, variable
|
||||
|
||||
+3
-2
@@ -172,8 +172,9 @@ typedef struct {
|
||||
.PP
|
||||
The \fIversion\fR field allows for future expansion of the structure, and
|
||||
should always be declared equal to TCL_OO_METHOD_VERSION_CURRENT. The
|
||||
\fIname\fR field provides a human-readable name for the type, and is reserved
|
||||
for debugging.
|
||||
\fIname\fR field provides a human-readable name for the type, and is the value
|
||||
that is exposed via the \fBinfo class methodtype\fR and
|
||||
\fBinfo object methodtype\fR Tcl commands.
|
||||
.PP
|
||||
The \fIcallProc\fR field gives a function that is called when the method is
|
||||
invoked; it must never be NULL.
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
.TH NRE 3 8.6 Tcl "Tcl Library Procedures"
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NRCreateCommand, Tcl_NRCallObjProc, Tcl_NREvalObj, Tcl_NREvalObjv, Tcl_NRCmdSwap, Tcl_NRAddCallback \- Non-Recursive (stackless) evaluation of Tcl scripts.
|
||||
Tcl_NRCreateCommand, Tcl_NRCallObjProc, Tcl_NREvalObj, Tcl_NREvalObjv,
|
||||
Tcl_NRCmdSwap, Tcl_NRExprObj, Tcl_NRAddCallback \- Non-Recursive (stackless) evaluation of Tcl scripts.
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -207,7 +208,7 @@ is something like:
|
||||
.PP
|
||||
.CS
|
||||
int
|
||||
\fITheCmdObjProc\fR(
|
||||
\fITheCmdOldObjProc\fR(
|
||||
ClientData clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
@@ -225,7 +226,7 @@ int
|
||||
return result;
|
||||
}
|
||||
\fBTcl_CreateObjCommand\fR(interp, "theCommand",
|
||||
\fITheCmdObjProc\fR, clientData, TheCmdDeleteProc);
|
||||
\fITheCmdOldObjProc\fR, clientData, TheCmdDeleteProc);
|
||||
.CE
|
||||
.PP
|
||||
To enable a command like this one for trampoline-based evaluation,
|
||||
@@ -255,8 +256,8 @@ int
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
return \fBTcl_NRCallObjProc\fR(interp, name,
|
||||
\fITheCmdNRObjProc\fR, clientData, objc, objv);
|
||||
return \fBTcl_NRCallObjProc\fR(interp, \fITheCmdNRObjProc\fR,
|
||||
clientData, objc, objv);
|
||||
}
|
||||
.CE
|
||||
.PP
|
||||
@@ -317,7 +318,7 @@ and the second is for use when there is already a trampoline in place.
|
||||
.PP
|
||||
.CS
|
||||
\fBTcl_NRCreateCommand\fR(interp, "theCommand",
|
||||
\fITheCmdObjProc\fR, \fITheCmdNRObjProc\fR, clientData,
|
||||
\fITheCmdNewObjProc\fR, \fITheCmdNRObjProc\fR, clientData,
|
||||
TheCmdDeleteProc);
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
|
||||
+4
-1
@@ -85,6 +85,9 @@ proc bgerror {message} {
|
||||
}
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
after(n), interp(n), tclvars(n)
|
||||
after(n), errorCode(n), errorInfo(n), interp(n)
|
||||
.SH KEYWORDS
|
||||
background error, reporting
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
|
||||
+1
-1
@@ -884,7 +884,7 @@ close $f
|
||||
puts [\fBbinary encode\fR base64 \-maxlen 64 $data]
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
format(n), scan(n), tclvars(n)
|
||||
format(n), scan(n), tcl_platform(n)
|
||||
.SH KEYWORDS
|
||||
binary, format, scan
|
||||
'\" Local Variables:
|
||||
|
||||
+2
-1
@@ -115,7 +115,8 @@ if { [\fBcatch\fR {open $someFile w} fid] } {
|
||||
There are more complex examples of \fBcatch\fR usage in the
|
||||
documentation for the \fBreturn\fR command.
|
||||
.SH "SEE ALSO"
|
||||
break(n), continue(n), dict(n), error(n), info(n), return(n), tclvars(n)
|
||||
break(n), continue(n), dict(n), error(n), errorCode(n), errorInfo(n), info(n),
|
||||
return(n)
|
||||
.SH KEYWORDS
|
||||
catch, error, exception
|
||||
'\" Local Variables:
|
||||
|
||||
+2
-1
@@ -75,7 +75,8 @@ However, the last line would now normally be written without
|
||||
set var [linsert $var 0 {*}$args]
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
catch(n), concat(n), error(n), interp(n), list(n), namespace(n), subst(n), tclvars(n), uplevel(n)
|
||||
catch(n), concat(n), error(n), errorCode(n), errorInfo(n), interp(n), list(n),
|
||||
namespace(n), subst(n), uplevel(n)
|
||||
.SH KEYWORDS
|
||||
concatenate, evaluate, script
|
||||
'\" Local Variables:
|
||||
|
||||
+6
-6
@@ -296,7 +296,6 @@ Returns the name of the library directory in which standard Tcl
|
||||
scripts are stored.
|
||||
This is actually the value of the \fBtcl_library\fR
|
||||
variable and may be changed by setting \fBtcl_library\fR.
|
||||
See the \fBtclvars\fR manual entry for more information.
|
||||
.TP
|
||||
\fBinfo loaded \fR?\fIinterp\fR?
|
||||
.
|
||||
@@ -336,8 +335,8 @@ described in \fBOBJECT INTROSPECTION\fR below.
|
||||
.TP
|
||||
\fBinfo patchlevel\fR
|
||||
.
|
||||
Returns the value of the global variable \fBtcl_patchLevel\fR; see
|
||||
the \fBtclvars\fR manual entry for more information.
|
||||
Returns the value of the global variable \fBtcl_patchLevel\fR, which holds
|
||||
the exact version of the Tcl library by default.
|
||||
.TP
|
||||
\fBinfo procs \fR?\fIpattern\fR?
|
||||
.
|
||||
@@ -374,8 +373,8 @@ string is returned.
|
||||
.TP
|
||||
\fBinfo tclversion\fR
|
||||
.
|
||||
Returns the value of the global variable \fBtcl_version\fR; see
|
||||
the \fBtclvars\fR manual entry for more information.
|
||||
Returns the value of the global variable \fBtcl_version\fR, which holds the
|
||||
major and minor version of the Tcl library by default.
|
||||
.TP
|
||||
\fBinfo vars\fR ?\fIpattern\fR?
|
||||
.
|
||||
@@ -763,8 +762,9 @@ proc getDef {obj method} {
|
||||
.VE 8.6
|
||||
.SH "SEE ALSO"
|
||||
.VS 8.6
|
||||
global(n), oo::class(n), oo::define(n), oo::object(n), proc(n), self(n)
|
||||
global(n), oo::class(n), oo::define(n), oo::object(n), proc(n), self(n),
|
||||
.VE 8.6
|
||||
tcl_library(n), tcl_patchLevel(n), tcl_version(n)
|
||||
.SH KEYWORDS
|
||||
command, information, interpreter, introspection, level, namespace,
|
||||
.VS 8.6
|
||||
|
||||
+7
-3
@@ -262,13 +262,17 @@ If set to any value, then \fBunknown\fR will not attempt to auto-load
|
||||
any commands.
|
||||
.TP
|
||||
\fBauto_path\fR
|
||||
.
|
||||
If set, then it must contain a valid Tcl list giving directories to
|
||||
search during auto-load operations.
|
||||
search during auto-load operations (including for package index
|
||||
files when using the default \fBpackage unknown\fR handler).
|
||||
This variable is initialized during startup to contain, in order:
|
||||
the directories listed in the \fBTCLLIBPATH\fR environment variable,
|
||||
the directory named by the \fBtcl_library\fR variable,
|
||||
the directory named by the \fBtcl_library\fR global variable,
|
||||
the parent directory of \fBtcl_library\fR,
|
||||
the directories listed in the \fBtcl_pkgPath\fR variable.
|
||||
Additional locations to look for files and package indices should
|
||||
normally be added to this variable using \fBlappend\fR.
|
||||
.TP
|
||||
\fBenv(TCL_LIBRARY)\fR
|
||||
If set, then it specifies the location of the directory containing
|
||||
@@ -306,7 +310,7 @@ considered to be a word character. On Windows platforms, words are
|
||||
comprised of any character that is not a space, tab, or newline. Under
|
||||
Unix, words are comprised of numbers, letters or underscores.
|
||||
.SH "SEE ALSO"
|
||||
info(n), re_syntax(n), tclvars(n)
|
||||
env(n), info(n), re_syntax(n)
|
||||
.SH KEYWORDS
|
||||
auto-exec, auto-load, library, unknown, word, whitespace
|
||||
'\"Local Variables:
|
||||
|
||||
+2
-2
@@ -317,8 +317,8 @@ proc myReturn {args} {
|
||||
}
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
break(n), catch(n), continue(n), dict(n), error(n), proc(n),
|
||||
source(n), tclvars(n), throw(n), try(n)
|
||||
break(n), catch(n), continue(n), dict(n), error(n), errorCode(n),
|
||||
errorInfo(n), proc(n), source(n), throw(n), try(n)
|
||||
.SH KEYWORDS
|
||||
break, catch, continue, error, exception, procedure, result, return
|
||||
.\" Local Variables:
|
||||
|
||||
+5
-3
@@ -102,7 +102,9 @@ but also the disadvantage of making it harder to write scripts that
|
||||
start up uniformly across different versions of Tcl.
|
||||
.SH "VARIABLES"
|
||||
.PP
|
||||
\fBTclsh\fR sets the following Tcl variables:
|
||||
\fBTclsh\fR sets the following global Tcl variables in addition to those
|
||||
created by the Tcl library itself (such as \fBenv\fR, which maps
|
||||
environment variables such as \fBPATH\fR into Tcl):
|
||||
.TP 15
|
||||
\fBargc\fR
|
||||
.
|
||||
@@ -129,7 +131,7 @@ device), 0 otherwise.
|
||||
When \fBtclsh\fR is invoked interactively it normally prompts for each
|
||||
command with
|
||||
.QW "\fB% \fR" .
|
||||
You can change the prompt by setting the
|
||||
You can change the prompt by setting the global
|
||||
variables \fBtcl_prompt1\fR and \fBtcl_prompt2\fR. If variable
|
||||
\fBtcl_prompt1\fR exists then it must consist of a Tcl script
|
||||
to output a prompt; instead of outputting a prompt \fBtclsh\fR
|
||||
@@ -142,6 +144,6 @@ incomplete commands.
|
||||
.PP
|
||||
See \fBTcl_StandardChannels\fR for more explanations.
|
||||
.SH "SEE ALSO"
|
||||
encoding(n), fconfigure(n), tclvars(n)
|
||||
auto_path(n), encoding(n), env(n), fconfigure(n)
|
||||
.SH KEYWORDS
|
||||
application, argument, interpreter, prompt, script file, shell
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ The following produces an error that is identical to that produced by
|
||||
\fBthrow\fR {ARITH DIVZERO {divide by zero}} {divide by zero}
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
catch(n), error(n), return(n), tclvars(n), try(n)
|
||||
catch(n), error(n), errorCode(n), errorInfo(n), return(n), try(n)
|
||||
.SH "KEYWORDS"
|
||||
error, exception
|
||||
'\" Local Variables:
|
||||
|
||||
@@ -259,8 +259,9 @@ static const chr alphaCharTable[] = {
|
||||
*/
|
||||
|
||||
static const crange controlRangeTable[] = {
|
||||
{0x7f, 0x9f}, {0x600, 0x604}, {0x200b, 0x200f}, {0x202a, 0x202e},
|
||||
{0x2060, 0x2064}, {0x206a, 0x206f}, {0xe000, 0xf8ff}, {0xfff9, 0xfffb}
|
||||
{0x0, 0x1f}, {0x7f, 0x9f}, {0x600, 0x604}, {0x200b, 0x200f},
|
||||
{0x202a, 0x202e}, {0x2060, 0x2064}, {0x206a, 0x206f}, {0xe000, 0xf8ff},
|
||||
{0xfff9, 0xfffb}
|
||||
#if TCL_UTF_MAX > 4
|
||||
,{0x1d173, 0x1d17a}, {0xe0020, 0xe007f}, {0xf0000, 0xffffd}, {0x100000, 0x10fffd}
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -824,7 +824,7 @@ duptraverse(
|
||||
* make all normal tests (not reg-33.14) pass.
|
||||
*/
|
||||
#ifndef DUPTRAVERSE_MAX_DEPTH
|
||||
#define DUPTRAVERSE_MAX_DEPTH 700
|
||||
#define DUPTRAVERSE_MAX_DEPTH 15000
|
||||
#endif
|
||||
|
||||
if (depth++ > DUPTRAVERSE_MAX_DEPTH) {
|
||||
|
||||
+1
-6
@@ -504,12 +504,7 @@ complicatedFindLoop(
|
||||
return er;
|
||||
}
|
||||
if ((shorter) ? end == estop : end == begin) {
|
||||
/*
|
||||
* No point in trying again.
|
||||
*/
|
||||
|
||||
*coldp = cold;
|
||||
return REG_NOMATCH;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -2417,7 +2417,7 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
|
||||
*/
|
||||
|
||||
#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
|
||||
(Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)()))
|
||||
((Tcl_CreateInterp)()))
|
||||
EXTERN void Tcl_MainEx(int argc, char **argv,
|
||||
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
|
||||
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
|
||||
|
||||
+29
-11
@@ -930,6 +930,10 @@ TclCompileAssembleCmd(
|
||||
{
|
||||
Tcl_Token *tokenPtr; /* Token in the input script */
|
||||
|
||||
int numCommands = envPtr->numCommands;
|
||||
int offset = envPtr->codeNext - envPtr->codeStart;
|
||||
int depth = envPtr->currStackDepth;
|
||||
|
||||
/*
|
||||
* Make sure that the command has a single arg that is a simple word.
|
||||
*/
|
||||
@@ -943,10 +947,23 @@ TclCompileAssembleCmd(
|
||||
}
|
||||
|
||||
/*
|
||||
* Compile the code and return any error from the compilation.
|
||||
* Compile the code and convert any error from the compilation into
|
||||
* bytecode reporting the error;
|
||||
*/
|
||||
|
||||
return TclAssembleCode(envPtr, tokenPtr[1].start, tokenPtr[1].size, 0);
|
||||
if (TCL_ERROR == TclAssembleCode(envPtr, tokenPtr[1].start,
|
||||
tokenPtr[1].size, TCL_EVAL_DIRECT)) {
|
||||
|
||||
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
|
||||
"\n (\"%.*s\" body, line %d)",
|
||||
parsePtr->tokenPtr->size, parsePtr->tokenPtr->start,
|
||||
Tcl_GetErrorLine(interp)));
|
||||
envPtr->numCommands = numCommands;
|
||||
envPtr->codeNext = envPtr->codeStart + offset;
|
||||
envPtr->currStackDepth = depth;
|
||||
TclCompileSyntaxError(interp, envPtr);
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -985,8 +1002,6 @@ TclAssembleCode(
|
||||
|
||||
const char* instPtr = codePtr;
|
||||
/* Where to start looking for a line of code */
|
||||
int instLen; /* Length in bytes of the current line of
|
||||
* code */
|
||||
const char* nextPtr; /* Pointer to the end of the line of code */
|
||||
int bytesLeft = codeLen; /* Number of bytes of source code remaining to
|
||||
* be parsed */
|
||||
@@ -1000,10 +1015,6 @@ TclAssembleCode(
|
||||
*/
|
||||
|
||||
status = Tcl_ParseCommand(interp, instPtr, bytesLeft, 0, parsePtr);
|
||||
instLen = parsePtr->commandSize;
|
||||
if (parsePtr->term == parsePtr->commandStart + instLen - 1) {
|
||||
--instLen;
|
||||
}
|
||||
|
||||
/*
|
||||
* Report errors in the parse.
|
||||
@@ -1012,7 +1023,7 @@ TclAssembleCode(
|
||||
if (status != TCL_OK) {
|
||||
if (flags & TCL_EVAL_DIRECT) {
|
||||
Tcl_LogCommandInfo(interp, codePtr, parsePtr->commandStart,
|
||||
instLen);
|
||||
parsePtr->term + 1 - parsePtr->commandStart);
|
||||
}
|
||||
FreeAssemblyEnv(assemEnvPtr);
|
||||
return TCL_ERROR;
|
||||
@@ -1032,6 +1043,13 @@ TclAssembleCode(
|
||||
*/
|
||||
|
||||
if (parsePtr->numWords > 0) {
|
||||
int instLen = parsePtr->commandSize;
|
||||
/* Length in bytes of the current command */
|
||||
|
||||
if (parsePtr->term == parsePtr->commandStart + instLen - 1) {
|
||||
--instLen;
|
||||
}
|
||||
|
||||
/*
|
||||
* If tracing, show each line assembled as it happens.
|
||||
*/
|
||||
@@ -1107,7 +1125,7 @@ NewAssemblyEnv(
|
||||
|
||||
assemEnvPtr->envPtr = envPtr;
|
||||
assemEnvPtr->parsePtr = parsePtr;
|
||||
assemEnvPtr->cmdLine = envPtr->line;
|
||||
assemEnvPtr->cmdLine = 1;
|
||||
assemEnvPtr->clNext = envPtr->clNext;
|
||||
|
||||
/*
|
||||
@@ -3029,7 +3047,7 @@ ResolveJumpTableTargets(
|
||||
auxDataIndex = TclGetInt4AtPtr(envPtr->codeStart + bbPtr->jumpOffset + 1);
|
||||
DEBUG_PRINT("bbPtr = %p jumpOffset = %d auxDataIndex = %d\n",
|
||||
bbPtr, bbPtr->jumpOffset, auxDataIndex);
|
||||
realJumpTablePtr = envPtr->auxDataArrayPtr[auxDataIndex].clientData;
|
||||
realJumpTablePtr = TclFetchAuxData(envPtr, auxDataIndex);
|
||||
realJumpHashPtr = &realJumpTablePtr->hashTable;
|
||||
|
||||
/*
|
||||
|
||||
+201
-386
@@ -127,15 +127,12 @@ static Tcl_ObjCmdProc ExprSqrtFunc;
|
||||
static Tcl_ObjCmdProc ExprSrandFunc;
|
||||
static Tcl_ObjCmdProc ExprUnaryFunc;
|
||||
static Tcl_ObjCmdProc ExprWideFunc;
|
||||
static Tcl_Obj * GetCommandSource(Interp *iPtr, int objc,
|
||||
Tcl_Obj *const objv[], int lookup);
|
||||
static void MathFuncWrongNumArgs(Tcl_Interp *interp, int expected,
|
||||
int actual, Tcl_Obj *const *objv);
|
||||
static Tcl_NRPostProc NRCoroutineCallerCallback;
|
||||
static Tcl_NRPostProc NRCoroutineExitCallback;
|
||||
static int NRCommand(ClientData data[], Tcl_Interp *interp, int result);
|
||||
|
||||
static Tcl_NRPostProc NRRunObjProc;
|
||||
static Tcl_ObjCmdProc OldMathFuncProc;
|
||||
static void OldMathFuncDeleteProc(ClientData clientData);
|
||||
static void ProcessUnexpectedResult(Tcl_Interp *interp,
|
||||
@@ -149,7 +146,7 @@ static inline Command * TEOV_LookupCmdFromObj(Tcl_Interp *interp,
|
||||
static int TEOV_NotFound(Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[], Namespace *lookupNsPtr);
|
||||
static int TEOV_RunEnterTraces(Tcl_Interp *interp,
|
||||
Command **cmdPtrPtr, int objc,
|
||||
Command **cmdPtrPtr, Tcl_Obj *commandPtr, int objc,
|
||||
Tcl_Obj *const objv[], Namespace *lookupNsPtr);
|
||||
static Tcl_NRPostProc RewindCoroutineCallback;
|
||||
static Tcl_NRPostProc TailcallCleanup;
|
||||
@@ -160,6 +157,8 @@ static Tcl_NRPostProc TEOV_Exception;
|
||||
static Tcl_NRPostProc TEOV_NotFoundCallback;
|
||||
static Tcl_NRPostProc TEOV_RestoreVarFrame;
|
||||
static Tcl_NRPostProc TEOV_RunLeaveTraces;
|
||||
static Tcl_NRPostProc EvalObjvCore;
|
||||
static Tcl_NRPostProc Dispatch;
|
||||
|
||||
static Tcl_ObjCmdProc NRCoroInjectObjCmd;
|
||||
|
||||
@@ -489,11 +488,12 @@ Tcl_CreateInterp(void)
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
if (sizeof(time_t) != 4) {
|
||||
/*NOTREACHED*/
|
||||
Tcl_Panic("sys/time.h is not compatible with MSVC");
|
||||
Tcl_Panic("<time.h> is not compatible with MSVC");
|
||||
}
|
||||
if (sizeof(Tcl_StatBuf) != 48) {
|
||||
if ((TclOffset(Tcl_StatBuf,st_atime) != 32)
|
||||
|| (TclOffset(Tcl_StatBuf,st_ctime) != 40)) {
|
||||
/*NOTREACHED*/
|
||||
Tcl_Panic("sys/stat.h is not compatible with MSVC");
|
||||
Tcl_Panic("<sys/stat.h> is not compatible with MSVC");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1608,8 +1608,6 @@ DeleteInterpProc(
|
||||
ckfree(eclPtr->loc);
|
||||
}
|
||||
|
||||
Tcl_DeleteHashTable(&eclPtr->litInfo);
|
||||
|
||||
ckfree(eclPtr);
|
||||
Tcl_DeleteHashEntry(hPtr);
|
||||
}
|
||||
@@ -2175,12 +2173,8 @@ Tcl_CreateCommand(
|
||||
* future calls to Tcl_GetCommandName.
|
||||
*
|
||||
* Side effects:
|
||||
* If no command named "cmdName" already exists for interp, one is
|
||||
* created. Otherwise, if a command does exist, then if the object-based
|
||||
* Tcl_ObjCmdProc is TclInvokeStringCommand, we assume Tcl_CreateCommand
|
||||
* was called previously for the same command and just set its
|
||||
* Tcl_ObjCmdProc to the argument "proc"; otherwise, we delete the old
|
||||
* command.
|
||||
* If a command named "cmdName" already exists for interp, it is
|
||||
* first deleted. Then the new command is created from the arguments.
|
||||
*
|
||||
* In the future, during bytecode evaluation when "cmdName" is seen as
|
||||
* the name of a command by Tcl_EvalObj or Tcl_Eval, the object-based
|
||||
@@ -2248,21 +2242,7 @@ Tcl_CreateObjCommand(
|
||||
cmdPtr = Tcl_GetHashValue(hPtr);
|
||||
|
||||
/*
|
||||
* Command already exists. If its object-based Tcl_ObjCmdProc is
|
||||
* TclInvokeStringCommand, we just set its Tcl_ObjCmdProc to the
|
||||
* argument "proc". Otherwise, we delete the old command.
|
||||
*/
|
||||
|
||||
if (cmdPtr->objProc == TclInvokeStringCommand) {
|
||||
cmdPtr->objProc = proc;
|
||||
cmdPtr->objClientData = clientData;
|
||||
cmdPtr->deleteProc = deleteProc;
|
||||
cmdPtr->deleteData = clientData;
|
||||
return (Tcl_Command) cmdPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Otherwise, we delete the old command. Be careful to preserve any
|
||||
* Command already exists; delete it. Be careful to preserve any
|
||||
* existing import links so we can restore them down below. That way,
|
||||
* you can redefine a command and its import status will remain
|
||||
* intact.
|
||||
@@ -2410,8 +2390,8 @@ TclInvokeStringCommand(
|
||||
* A standard Tcl string result value.
|
||||
*
|
||||
* Side effects:
|
||||
* Besides those side effects of the called Tcl_CmdProc,
|
||||
* TclInvokeStringCommand allocates and frees storage.
|
||||
* Besides those side effects of the called Tcl_ObjCmdProc,
|
||||
* TclInvokeObjectCommand allocates and frees storage.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -3351,66 +3331,6 @@ CancelEvalProc(
|
||||
return code;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* GetCommandSource --
|
||||
*
|
||||
* This function returns a Tcl_Obj with the full source string for the
|
||||
* command. This insures that traces get a correct NUL-terminated command
|
||||
* string. The Tcl_Obj has refCount==1.
|
||||
*
|
||||
* *** MAINTAINER WARNING ***
|
||||
* The returned Tcl_Obj is all wrong for any purpose but getting the
|
||||
* source string for an objc/objv command line in the stringRep (no
|
||||
* stringRep if no source is available) and the corresponding substituted
|
||||
* version in the List intrep.
|
||||
* This means that the intRep and stringRep DO NOT COINCIDE! Using these
|
||||
* Tcl_Objs normally is likely to break things.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static Tcl_Obj *
|
||||
GetCommandSource(
|
||||
Interp *iPtr,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[],
|
||||
int lookup)
|
||||
{
|
||||
Tcl_Obj *objPtr, *obj2Ptr;
|
||||
CmdFrame *cfPtr = iPtr->cmdFramePtr;
|
||||
const char *command = NULL;
|
||||
int numChars;
|
||||
|
||||
objPtr = Tcl_NewListObj(objc, objv);
|
||||
if (lookup && cfPtr && (cfPtr->numLevels == iPtr->numLevels-1)) {
|
||||
switch (cfPtr->type) {
|
||||
case TCL_LOCATION_EVAL:
|
||||
case TCL_LOCATION_SOURCE:
|
||||
command = cfPtr->cmd.str.cmd;
|
||||
numChars = cfPtr->cmd.str.len;
|
||||
break;
|
||||
case TCL_LOCATION_BC:
|
||||
case TCL_LOCATION_PREBC:
|
||||
command = TclGetSrcInfoForCmd(iPtr, &numChars);
|
||||
break;
|
||||
case TCL_LOCATION_EVAL_LIST:
|
||||
/* Got it already */
|
||||
break;
|
||||
}
|
||||
if (command) {
|
||||
obj2Ptr = Tcl_NewStringObj(command, numChars);
|
||||
objPtr->bytes = obj2Ptr->bytes;
|
||||
objPtr->length = numChars;
|
||||
obj2Ptr->bytes = NULL;
|
||||
Tcl_DecrRefCount(obj2Ptr);
|
||||
}
|
||||
}
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
return objPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -4174,39 +4094,52 @@ TclNREvalObjv(
|
||||
* requested Command struct to be invoked. */
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
int result;
|
||||
Namespace *lookupNsPtr = iPtr->lookupNsPtr;
|
||||
Command **cmdPtrPtr;
|
||||
NRE_callback *callbackPtr;
|
||||
|
||||
iPtr->lookupNsPtr = NULL;
|
||||
|
||||
/*
|
||||
* Push a callback with cleanup tasks for commands; the cmdPtr at data[0]
|
||||
* will be filled later when the command is found: save its address at
|
||||
* objProcPtr.
|
||||
*
|
||||
* data[1] stores a marker for use by tailcalls; it will be set to 1 by
|
||||
* command redirectors (imports, alias, ensembles) so that tailcalls
|
||||
* finishes the source command and not just the target.
|
||||
*/
|
||||
|
||||
if (iPtr->deferredCallbacks) {
|
||||
callbackPtr = iPtr->deferredCallbacks;
|
||||
iPtr->deferredCallbacks = NULL;
|
||||
} else {
|
||||
TclNRAddCallback(interp, NRCommand, NULL, NULL, NULL, NULL);
|
||||
callbackPtr = TOP_CB(interp);
|
||||
}
|
||||
cmdPtrPtr = (Command **) &(callbackPtr->data[0]);
|
||||
|
||||
iPtr->numLevels++;
|
||||
result = TclInterpReady(interp);
|
||||
TclNRAddCallback(interp, EvalObjvCore, cmdPtr, INT2PTR(flags),
|
||||
INT2PTR(objc), objv);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
if ((result != TCL_OK) || (objc == 0)) {
|
||||
return result;
|
||||
static int
|
||||
EvalObjvCore(
|
||||
ClientData data[],
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
Command *cmdPtr = data[0];
|
||||
int flags = PTR2INT(data[1]);
|
||||
int objc = PTR2INT(data[2]);
|
||||
Tcl_Obj **objv = data[3];
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Namespace *lookupNsPtr = iPtr->lookupNsPtr;
|
||||
|
||||
if (TCL_OK != TclInterpReady(interp)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
if (objc == 0) {
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
if (TclLimitExceeded(iPtr->limit)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
iPtr->lookupNsPtr = NULL;
|
||||
|
||||
if (cmdPtr) {
|
||||
goto commandFound;
|
||||
}
|
||||
@@ -4250,11 +4183,6 @@ TclNREvalObjv(
|
||||
return TEOV_NotFound(interp, objc, objv, lookupNsPtr);
|
||||
}
|
||||
|
||||
iPtr->cmdCount++;
|
||||
if (TclLimitExceeded(iPtr->limit)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Found a command! The real work begins now ...
|
||||
*/
|
||||
@@ -4266,15 +4194,34 @@ TclNREvalObjv(
|
||||
* necessary.
|
||||
*/
|
||||
|
||||
result = TEOV_RunEnterTraces(interp, &cmdPtr, objc, objv, lookupNsPtr);
|
||||
if (!cmdPtr) {
|
||||
return TEOV_NotFound(interp, objc, objv, lookupNsPtr);
|
||||
}
|
||||
result = TEOV_RunEnterTraces(interp, &cmdPtr, TclGetSourceFromFrame(
|
||||
flags & TCL_EVAL_SOURCE_IN_FRAME ? iPtr->cmdFramePtr : NULL,
|
||||
objc, objv), objc, objv, lookupNsPtr);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
if (!cmdPtr) {
|
||||
return TEOV_NotFound(interp, objc, objv, lookupNsPtr);
|
||||
}
|
||||
}
|
||||
|
||||
TclNRAddCallback(interp, Dispatch,
|
||||
cmdPtr->nreProc ? cmdPtr->nreProc : cmdPtr->objProc,
|
||||
cmdPtr->objClientData, INT2PTR(objc), objv);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
static int
|
||||
Dispatch(
|
||||
ClientData data[],
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
Tcl_ObjCmdProc *objProc = data[0];
|
||||
ClientData clientData = data[1];
|
||||
int objc = PTR2INT(data[2]);
|
||||
Tcl_Obj **objv = data[3];
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
|
||||
#ifdef USE_DTRACE
|
||||
if (TCL_DTRACE_CMD_ARGS_ENABLED()) {
|
||||
@@ -4295,34 +4242,18 @@ TclNREvalObjv(
|
||||
TCL_DTRACE_CMD_INFO(a[0], a[1], a[2], a[3], i[0], i[1], a[4], a[5]);
|
||||
TclDecrRefCount(info);
|
||||
}
|
||||
if (TCL_DTRACE_CMD_RETURN_ENABLED() || TCL_DTRACE_CMD_RESULT_ENABLED()) {
|
||||
if ((TCL_DTRACE_CMD_RETURN_ENABLED() || TCL_DTRACE_CMD_RESULT_ENABLED())
|
||||
&& objc) {
|
||||
TclNRAddCallback(interp, DTraceCmdReturn, objv[0], NULL, NULL, NULL);
|
||||
}
|
||||
if (TCL_DTRACE_CMD_ENTRY_ENABLED()) {
|
||||
if (TCL_DTRACE_CMD_ENTRY_ENABLED() && objc) {
|
||||
TCL_DTRACE_CMD_ENTRY(TclGetString(objv[0]), objc - 1,
|
||||
(Tcl_Obj **)(objv + 1));
|
||||
}
|
||||
#endif /* USE_DTRACE */
|
||||
/*
|
||||
* Fix the original callback to point to the now known cmdPtr. Insure that
|
||||
* the Command struct lives until the command returns.
|
||||
*/
|
||||
|
||||
*cmdPtrPtr = cmdPtr;
|
||||
cmdPtr->refCount++;
|
||||
|
||||
/*
|
||||
* Find the objProc to call: nreProc if available, objProc otherwise. Push
|
||||
* a callback to do the actual running.
|
||||
*/
|
||||
|
||||
if (cmdPtr->nreProc) {
|
||||
TclNRAddCallback(interp, NRRunObjProc, cmdPtr,
|
||||
INT2PTR(objc), (ClientData) objv, NULL);
|
||||
return TCL_OK;
|
||||
} else {
|
||||
return cmdPtr->objProc(cmdPtr->objClientData, interp, objc, objv);
|
||||
}
|
||||
iPtr->cmdCount++;
|
||||
return objProc(clientData, interp, objc, objv);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -4351,6 +4282,7 @@ TclNRRunCallbacks(
|
||||
(void) Tcl_GetObjResult(interp);
|
||||
}
|
||||
|
||||
iPtr->execEnvPtr->stackLevel++;
|
||||
while (TOP_CB(interp) != rootPtr) {
|
||||
callbackPtr = TOP_CB(interp);
|
||||
procPtr = callbackPtr->procPtr;
|
||||
@@ -4358,6 +4290,7 @@ TclNRRunCallbacks(
|
||||
result = procPtr(callbackPtr->data, interp, result);
|
||||
TCLNR_FREE(interp, callbackPtr);
|
||||
}
|
||||
iPtr->execEnvPtr->stackLevel--;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -4368,13 +4301,8 @@ NRCommand(
|
||||
int result)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Command *cmdPtr = data[0];
|
||||
/* int cmdStart = PTR2INT(data[1]); NOT USED HERE */
|
||||
|
||||
if (cmdPtr) {
|
||||
TclCleanupCommandMacro(cmdPtr);
|
||||
}
|
||||
((Interp *)interp)->numLevels--;
|
||||
iPtr->numLevels--;
|
||||
|
||||
/*
|
||||
* If there is a tailcall, schedule it
|
||||
@@ -4401,22 +4329,6 @@ NRCommand(
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
NRRunObjProc(
|
||||
ClientData data[],
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
/* OPT: do not call? */
|
||||
|
||||
Command* cmdPtr = data[0];
|
||||
int objc = PTR2INT(data[1]);
|
||||
Tcl_Obj **objv = data[2];
|
||||
|
||||
return cmdPtr->nreProc(cmdPtr->objClientData, interp, objc, objv);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -4680,6 +4592,7 @@ static int
|
||||
TEOV_RunEnterTraces(
|
||||
Tcl_Interp *interp,
|
||||
Command **cmdPtrPtr,
|
||||
Tcl_Obj *commandPtr,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[],
|
||||
Namespace *lookupNsPtr)
|
||||
@@ -4691,9 +4604,8 @@ TEOV_RunEnterTraces(
|
||||
int newEpoch;
|
||||
const char *command;
|
||||
int length;
|
||||
Tcl_Obj *commandPtr;
|
||||
|
||||
commandPtr = GetCommandSource(iPtr, objc, objv, 1);
|
||||
Tcl_IncrRefCount(commandPtr);
|
||||
command = Tcl_GetStringFromObj(commandPtr, &length);
|
||||
|
||||
/*
|
||||
@@ -4726,13 +4638,13 @@ TEOV_RunEnterTraces(
|
||||
*cmdPtrPtr = cmdPtr;
|
||||
}
|
||||
|
||||
if (cmdPtr) {
|
||||
if (cmdPtr && (traceCode == TCL_OK)) {
|
||||
/*
|
||||
* Command was found: push a record to schedule the leave traces.
|
||||
*/
|
||||
|
||||
TclNRAddCallback(interp, TEOV_RunLeaveTraces, INT2PTR(traceCode),
|
||||
commandPtr, cmdPtr, NULL);
|
||||
TclNRAddCallback(interp, TEOV_RunLeaveTraces, INT2PTR(objc),
|
||||
commandPtr, cmdPtr, objv);
|
||||
cmdPtr->refCount++;
|
||||
} else {
|
||||
Tcl_DecrRefCount(commandPtr);
|
||||
@@ -4747,20 +4659,18 @@ TEOV_RunLeaveTraces(
|
||||
int result)
|
||||
{
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
const char *command;
|
||||
int length, objc;
|
||||
Tcl_Obj **objv;
|
||||
int traceCode = PTR2INT(data[0]);
|
||||
int traceCode = TCL_OK;
|
||||
int objc = PTR2INT(data[0]);
|
||||
Tcl_Obj *commandPtr = data[1];
|
||||
Command *cmdPtr = data[2];
|
||||
Tcl_Obj **objv = data[3];
|
||||
|
||||
command = Tcl_GetStringFromObj(commandPtr, &length);
|
||||
if (TCL_OK != Tcl_ListObjGetElements(interp, commandPtr, &objc, &objv)) {
|
||||
Tcl_Panic("Who messed with commandPtr?");
|
||||
}
|
||||
|
||||
if (!(cmdPtr->flags & CMD_IS_DELETED)) {
|
||||
if ((cmdPtr->flags & CMD_HAS_EXEC_TRACES) && traceCode == TCL_OK){
|
||||
int length;
|
||||
const char *command = Tcl_GetStringFromObj(commandPtr, &length);
|
||||
|
||||
if (cmdPtr->flags & CMD_HAS_EXEC_TRACES){
|
||||
traceCode = TclCheckExecutionTraces(interp, command, length,
|
||||
cmdPtr, result, TCL_TRACE_LEAVE_EXEC, objc, objv);
|
||||
}
|
||||
@@ -5016,31 +4926,22 @@ TclEvalEx(
|
||||
/*
|
||||
* TIP #280 Initialize tracking. Do not push on the frame stack yet.
|
||||
*
|
||||
* We may continue counting based on a specific context (CTX), or open a
|
||||
* new context, either for a sourced script, or 'eval'. For sourced files
|
||||
* we always have a path object, even if nothing was specified in the
|
||||
* interp itself. That makes code using it simpler as NULL checks can be
|
||||
* left out. Sourced file without path in the 'scriptFile' is possible
|
||||
* during Tcl initialization.
|
||||
* We open a new context, either for a sourced script, or 'eval'.
|
||||
* For sourced files we always have a path object, even if nothing was
|
||||
* specified in the interp itself. That makes code using it simpler as
|
||||
* NULL checks can be left out. Sourced file without path in the
|
||||
* 'scriptFile' is possible during Tcl initialization.
|
||||
*/
|
||||
|
||||
eeFramePtr->level = iPtr->cmdFramePtr ? iPtr->cmdFramePtr->level + 1 : 1;
|
||||
eeFramePtr->numLevels = iPtr->numLevels;
|
||||
eeFramePtr->framePtr = iPtr->framePtr;
|
||||
eeFramePtr->nextPtr = iPtr->cmdFramePtr;
|
||||
eeFramePtr->nline = 0;
|
||||
eeFramePtr->line = NULL;
|
||||
eeFramePtr->cmdObj = NULL;
|
||||
|
||||
iPtr->cmdFramePtr = eeFramePtr;
|
||||
if (iPtr->evalFlags & TCL_EVAL_CTX) {
|
||||
/*
|
||||
* Path information comes out of the context.
|
||||
*/
|
||||
|
||||
eeFramePtr->type = TCL_LOCATION_SOURCE;
|
||||
eeFramePtr->data.eval.path = iPtr->invokeCmdFramePtr->data.eval.path;
|
||||
Tcl_IncrRefCount(eeFramePtr->data.eval.path);
|
||||
} else if (iPtr->evalFlags & TCL_EVAL_FILE) {
|
||||
if (iPtr->evalFlags & TCL_EVAL_FILE) {
|
||||
/*
|
||||
* Set up for a sourced file.
|
||||
*/
|
||||
@@ -5083,7 +4984,9 @@ TclEvalEx(
|
||||
do {
|
||||
if (Tcl_ParseCommand(interp, p, bytesLeft, 0, parsePtr) != TCL_OK) {
|
||||
code = TCL_ERROR;
|
||||
goto error;
|
||||
Tcl_LogCommandInfo(interp, script, parsePtr->commandStart,
|
||||
parsePtr->term + 1 - parsePtr->commandStart);
|
||||
goto posterror;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5249,23 +5152,28 @@ TclEvalEx(
|
||||
* have been executed.
|
||||
*/
|
||||
|
||||
eeFramePtr->cmd.str.cmd = parsePtr->commandStart;
|
||||
eeFramePtr->cmd.str.len = parsePtr->commandSize;
|
||||
eeFramePtr->cmd = parsePtr->commandStart;
|
||||
eeFramePtr->len = parsePtr->commandSize;
|
||||
|
||||
if (parsePtr->term ==
|
||||
parsePtr->commandStart + parsePtr->commandSize - 1) {
|
||||
eeFramePtr->cmd.str.len--;
|
||||
eeFramePtr->len--;
|
||||
}
|
||||
|
||||
eeFramePtr->nline = objectsUsed;
|
||||
eeFramePtr->line = lines;
|
||||
|
||||
TclArgumentEnter(interp, objv, objectsUsed, eeFramePtr);
|
||||
code = Tcl_EvalObjv(interp, objectsUsed, objv, TCL_EVAL_NOERR);
|
||||
code = Tcl_EvalObjv(interp, objectsUsed, objv,
|
||||
TCL_EVAL_NOERR | TCL_EVAL_SOURCE_IN_FRAME);
|
||||
TclArgumentRelease(interp, objv, objectsUsed);
|
||||
|
||||
eeFramePtr->line = NULL;
|
||||
eeFramePtr->nline = 0;
|
||||
if (eeFramePtr->cmdObj) {
|
||||
Tcl_DecrRefCount(eeFramePtr->cmdObj);
|
||||
eeFramePtr->cmdObj = NULL;
|
||||
}
|
||||
|
||||
if (code != TCL_OK) {
|
||||
goto error;
|
||||
@@ -5339,6 +5247,7 @@ TclEvalEx(
|
||||
Tcl_LogCommandInfo(interp, script, parsePtr->commandStart,
|
||||
commandLength);
|
||||
}
|
||||
posterror:
|
||||
iPtr->flags &= ~ERR_ALREADY_LOGGED;
|
||||
|
||||
/*
|
||||
@@ -5613,76 +5522,88 @@ TclArgumentBCEnter(
|
||||
int objc,
|
||||
void *codePtr,
|
||||
CmdFrame *cfPtr,
|
||||
int cmd,
|
||||
int pc)
|
||||
{
|
||||
ExtCmdLoc *eclPtr;
|
||||
int word;
|
||||
ECL *ePtr;
|
||||
CFWordBC *lastPtr = NULL;
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Tcl_HashEntry *hePtr =
|
||||
Tcl_FindHashEntry(iPtr->lineBCPtr, (char *) codePtr);
|
||||
ExtCmdLoc *eclPtr;
|
||||
|
||||
if (!hePtr) {
|
||||
return;
|
||||
}
|
||||
eclPtr = Tcl_GetHashValue(hePtr);
|
||||
hePtr = Tcl_FindHashEntry(&eclPtr->litInfo, INT2PTR(pc));
|
||||
if (hePtr) {
|
||||
int word;
|
||||
int cmd = PTR2INT(Tcl_GetHashValue(hePtr));
|
||||
ECL *ePtr = &eclPtr->loc[cmd];
|
||||
CFWordBC *lastPtr = NULL;
|
||||
ePtr = &eclPtr->loc[cmd];
|
||||
|
||||
/*
|
||||
* A few truths ...
|
||||
* (1) ePtr->nline == objc
|
||||
* (2) (ePtr->line[word] < 0) => !literal, for all words
|
||||
* (3) (word == 0) => !literal
|
||||
*
|
||||
* Item (2) is why we can use objv to get the literals, and do not
|
||||
* have to save them at compile time.
|
||||
*/
|
||||
/*
|
||||
* ePtr->nline is the number of words originally parsed.
|
||||
*
|
||||
* objc is the number of elements getting invoked.
|
||||
*
|
||||
* If they are not the same, we arrived here by compiling an
|
||||
* ensemble dispatch. Ensemble subcommands that lead to script
|
||||
* evaluation are not supposed to get compiled, because a command
|
||||
* such as [info level] in the script can expose some of the dispatch
|
||||
* shenanigans. This means that we don't have to tend to the
|
||||
* housekeeping, and can escape now.
|
||||
*/
|
||||
|
||||
if (ePtr->nline != objc) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ePtr->nline != objc) {
|
||||
Tcl_Panic ("TIP 280 data structure inconsistency");
|
||||
}
|
||||
/*
|
||||
* Having disposed of the ensemble cases, we can state...
|
||||
* A few truths ...
|
||||
* (1) ePtr->nline == objc
|
||||
* (2) (ePtr->line[word] < 0) => !literal, for all words
|
||||
* (3) (word == 0) => !literal
|
||||
*
|
||||
* Item (2) is why we can use objv to get the literals, and do not
|
||||
* have to save them at compile time.
|
||||
*/
|
||||
|
||||
for (word = 1; word < objc; word++) {
|
||||
if (ePtr->line[word] >= 0) {
|
||||
int isnew;
|
||||
Tcl_HashEntry *hPtr = Tcl_CreateHashEntry(iPtr->lineLABCPtr,
|
||||
objv[word], &isnew);
|
||||
CFWordBC *cfwPtr = ckalloc(sizeof(CFWordBC));
|
||||
for (word = 1; word < objc; word++) {
|
||||
if (ePtr->line[word] >= 0) {
|
||||
int isnew;
|
||||
Tcl_HashEntry *hPtr = Tcl_CreateHashEntry(iPtr->lineLABCPtr,
|
||||
objv[word], &isnew);
|
||||
CFWordBC *cfwPtr = ckalloc(sizeof(CFWordBC));
|
||||
|
||||
cfwPtr->framePtr = cfPtr;
|
||||
cfwPtr->obj = objv[word];
|
||||
cfwPtr->pc = pc;
|
||||
cfwPtr->word = word;
|
||||
cfwPtr->nextPtr = lastPtr;
|
||||
lastPtr = cfwPtr;
|
||||
cfwPtr->framePtr = cfPtr;
|
||||
cfwPtr->obj = objv[word];
|
||||
cfwPtr->pc = pc;
|
||||
cfwPtr->word = word;
|
||||
cfwPtr->nextPtr = lastPtr;
|
||||
lastPtr = cfwPtr;
|
||||
|
||||
if (isnew) {
|
||||
/*
|
||||
* The word is not on the stack yet, remember the current
|
||||
* location and initialize references.
|
||||
*/
|
||||
if (isnew) {
|
||||
/*
|
||||
* The word is not on the stack yet, remember the current
|
||||
* location and initialize references.
|
||||
*/
|
||||
|
||||
cfwPtr->prevPtr = NULL;
|
||||
} else {
|
||||
/*
|
||||
* The object is already on the stack, however it may have
|
||||
* a different location now (literal sharing may map
|
||||
* multiple location to a single Tcl_Obj*. Save the old
|
||||
* information in the new structure.
|
||||
*/
|
||||
cfwPtr->prevPtr = NULL;
|
||||
} else {
|
||||
/*
|
||||
* The object is already on the stack, however it may have
|
||||
* a different location now (literal sharing may map
|
||||
* multiple location to a single Tcl_Obj*. Save the old
|
||||
* information in the new structure.
|
||||
*/
|
||||
|
||||
cfwPtr->prevPtr = Tcl_GetHashValue(hPtr);
|
||||
}
|
||||
|
||||
Tcl_SetHashValue(hPtr, cfwPtr);
|
||||
cfwPtr->prevPtr = Tcl_GetHashValue(hPtr);
|
||||
}
|
||||
} /* for */
|
||||
|
||||
cfPtr->litarg = lastPtr;
|
||||
} /* if */
|
||||
Tcl_SetHashValue(hPtr, cfwPtr);
|
||||
}
|
||||
} /* for */
|
||||
|
||||
cfPtr->litarg = lastPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5892,6 +5813,11 @@ Tcl_GlobalEvalObj(
|
||||
* compiled into bytecodes if necessary, unless TCL_EVAL_DIRECT is
|
||||
* specified.
|
||||
*
|
||||
* If the flag TCL_EVAL_DIRECT is passed in, the value of invoker
|
||||
* must be NULL. Support for non-NULL invokers in that mode has
|
||||
* been removed since it was unused and untested. Failure to
|
||||
* follow this limitation will lead to an assertion panic.
|
||||
*
|
||||
* Results:
|
||||
* The return value is one of the return codes defined in tcl.h (such as
|
||||
* TCL_OK), and the interpreter's result contains a value to supplement
|
||||
@@ -5960,13 +5886,12 @@ TclNREvalObjEx(
|
||||
*/
|
||||
|
||||
if (TclListObjIsCanonical(objPtr)) {
|
||||
Tcl_Obj *listPtr = objPtr;
|
||||
CmdFrame *eoFramePtr = NULL;
|
||||
int objc;
|
||||
Tcl_Obj **objv;
|
||||
Tcl_Obj *listPtr, **objv;
|
||||
|
||||
/*
|
||||
* Pure List Optimization (no string representation). In this case, we
|
||||
* Canonical List Optimization: In this case, we
|
||||
* can safely use Tcl_EvalObjv instead and get an appreciable
|
||||
* improvement in execution speed. This is because it allows us to
|
||||
* avoid a setFromAny step that would just pack everything into a
|
||||
@@ -5974,11 +5899,6 @@ TclNREvalObjEx(
|
||||
*
|
||||
* This also preserves any associations between list elements and
|
||||
* location information for such elements.
|
||||
*
|
||||
* This restriction has been relaxed a bit by storing in lists whether
|
||||
* they are "canonical" or not (a canonical list being one that is
|
||||
* either pure or that has its string rep derived by
|
||||
* UpdateStringOfList from the internal rep).
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -5987,13 +5907,13 @@ TclNREvalObjEx(
|
||||
* we always make a copy. The callback takes care od the refCounts for
|
||||
* both listPtr and objPtr.
|
||||
*
|
||||
* TODO: Create a test to demo this need, or eliminate it.
|
||||
* FIXME OPT: preserve just the internal rep?
|
||||
*/
|
||||
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
listPtr = TclListObjCopy(interp, objPtr);
|
||||
Tcl_IncrRefCount(listPtr);
|
||||
TclDecrRefCount(objPtr);
|
||||
|
||||
if (word != INT_MIN) {
|
||||
/*
|
||||
@@ -6016,22 +5936,25 @@ TclNREvalObjEx(
|
||||
eoFramePtr->nline = 0;
|
||||
eoFramePtr->line = NULL;
|
||||
|
||||
eoFramePtr->type = TCL_LOCATION_EVAL_LIST;
|
||||
eoFramePtr->type = TCL_LOCATION_EVAL;
|
||||
eoFramePtr->level = (iPtr->cmdFramePtr == NULL?
|
||||
1 : iPtr->cmdFramePtr->level + 1);
|
||||
eoFramePtr->numLevels = iPtr->numLevels;
|
||||
eoFramePtr->framePtr = iPtr->framePtr;
|
||||
eoFramePtr->nextPtr = iPtr->cmdFramePtr;
|
||||
|
||||
eoFramePtr->cmd.listPtr = listPtr;
|
||||
eoFramePtr->cmdObj = objPtr;
|
||||
eoFramePtr->cmd = NULL;
|
||||
eoFramePtr->len = 0;
|
||||
eoFramePtr->data.eval.path = NULL;
|
||||
|
||||
iPtr->cmdFramePtr = eoFramePtr;
|
||||
|
||||
flags |= TCL_EVAL_SOURCE_IN_FRAME;
|
||||
}
|
||||
|
||||
TclMarkTailcall(interp);
|
||||
TclNRAddCallback(interp, TEOEx_ListCallback, listPtr, eoFramePtr,
|
||||
NULL, NULL);
|
||||
objPtr, NULL);
|
||||
|
||||
ListObjGetElements(listPtr, objc, objv);
|
||||
return TclNREvalObjv(interp, objc, objv, flags, NULL);
|
||||
@@ -6071,14 +5994,6 @@ TclNREvalObjEx(
|
||||
* We're not supposed to use the compiler or byte-code
|
||||
* interpreter. Let Tcl_EvalEx evaluate the command directly (and
|
||||
* probably more slowly).
|
||||
*
|
||||
* TIP #280. Propagate context as much as we can. Especially if the
|
||||
* script to evaluate is a single literal it makes sense to look if
|
||||
* our context is one with absolute line numbers we can then track
|
||||
* into the literal itself too.
|
||||
*
|
||||
* See also tclCompile.c, TclInitCompileEnv, for the equivalent code
|
||||
* in the bytecode compiler.
|
||||
*/
|
||||
|
||||
const char *script;
|
||||
@@ -6102,92 +6017,19 @@ TclNREvalObjEx(
|
||||
*/
|
||||
|
||||
ContLineLoc *saveCLLocPtr = iPtr->scriptCLLocPtr;
|
||||
ContLineLoc *clLocPtr = TclContinuationsGet(objPtr);
|
||||
|
||||
if (clLocPtr) {
|
||||
iPtr->scriptCLLocPtr = clLocPtr;
|
||||
Tcl_Preserve(iPtr->scriptCLLocPtr);
|
||||
} else {
|
||||
iPtr->scriptCLLocPtr = NULL;
|
||||
}
|
||||
assert(invoker == NULL);
|
||||
|
||||
iPtr->scriptCLLocPtr = TclContinuationsGet(objPtr);
|
||||
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
if (invoker == NULL) {
|
||||
/*
|
||||
* No context, force opening of our own.
|
||||
*/
|
||||
|
||||
script = Tcl_GetStringFromObj(objPtr, &numSrcBytes);
|
||||
result = Tcl_EvalEx(interp, script, numSrcBytes, flags);
|
||||
} else {
|
||||
/*
|
||||
* We have an invoker, describing the command asking for the
|
||||
* evaluation of a subordinate script. This script may originate
|
||||
* in a literal word, or from a variable, etc. Using the line
|
||||
* array we now check if we have good line information for the
|
||||
* relevant word. The type of context is relevant as well. In a
|
||||
* non-'source' context we don't have to try tracking lines.
|
||||
*
|
||||
* First see if the word exists and is a literal. If not we go
|
||||
* through the easy dynamic branch. No need to perform more
|
||||
* complex invokations.
|
||||
*/
|
||||
script = Tcl_GetStringFromObj(objPtr, &numSrcBytes);
|
||||
result = Tcl_EvalEx(interp, script, numSrcBytes, flags);
|
||||
|
||||
int pc = 0;
|
||||
CmdFrame *ctxPtr = TclStackAlloc(interp, sizeof(CmdFrame));
|
||||
|
||||
*ctxPtr = *invoker;
|
||||
if (invoker->type == TCL_LOCATION_BC) {
|
||||
/*
|
||||
* Note: Type BC => ctxPtr->data.eval.path is not used.
|
||||
* ctxPtr->data.tebc.codePtr is used instead.
|
||||
*/
|
||||
|
||||
TclGetSrcInfoForPc(ctxPtr);
|
||||
pc = 1;
|
||||
}
|
||||
|
||||
script = Tcl_GetStringFromObj(objPtr, &numSrcBytes);
|
||||
|
||||
if ((invoker->nline <= word) ||
|
||||
(invoker->line[word] < 0) ||
|
||||
(ctxPtr->type != TCL_LOCATION_SOURCE)) {
|
||||
/*
|
||||
* Dynamic script, or dynamic context, force our own context.
|
||||
*/
|
||||
|
||||
result = Tcl_EvalEx(interp, script, numSrcBytes, flags);
|
||||
} else {
|
||||
/*
|
||||
* Absolute context to reuse.
|
||||
*/
|
||||
|
||||
iPtr->invokeCmdFramePtr = ctxPtr;
|
||||
iPtr->evalFlags |= TCL_EVAL_CTX;
|
||||
|
||||
result = TclEvalEx(interp, script, numSrcBytes, flags,
|
||||
ctxPtr->line[word], NULL, script);
|
||||
}
|
||||
if (pc && (ctxPtr->type == TCL_LOCATION_SOURCE)) {
|
||||
/*
|
||||
* Death of SrcInfo reference.
|
||||
*/
|
||||
|
||||
Tcl_DecrRefCount(ctxPtr->data.eval.path);
|
||||
}
|
||||
TclStackFree(interp, ctxPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now release the lock on the continuation line information, if any,
|
||||
* and restore the caller's settings.
|
||||
*/
|
||||
|
||||
if (iPtr->scriptCLLocPtr) {
|
||||
Tcl_Release(iPtr->scriptCLLocPtr);
|
||||
}
|
||||
iPtr->scriptCLLocPtr = saveCLLocPtr;
|
||||
TclDecrRefCount(objPtr);
|
||||
|
||||
iPtr->scriptCLLocPtr = saveCLLocPtr;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -6247,6 +6089,7 @@ TEOEx_ListCallback(
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
Tcl_Obj *listPtr = data[0];
|
||||
CmdFrame *eoFramePtr = data[1];
|
||||
Tcl_Obj *objPtr = data[2];
|
||||
|
||||
/*
|
||||
* Remove the cmdFrame
|
||||
@@ -6256,6 +6099,7 @@ TEOEx_ListCallback(
|
||||
iPtr->cmdFramePtr = eoFramePtr->nextPtr;
|
||||
TclStackFree(interp, eoFramePtr);
|
||||
}
|
||||
TclDecrRefCount(objPtr);
|
||||
TclDecrRefCount(listPtr);
|
||||
|
||||
return result;
|
||||
@@ -8137,39 +7981,11 @@ Tcl_NRCallObjProc(
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
int result = TCL_OK;
|
||||
NRE_callback *rootPtr = TOP_CB(interp);
|
||||
|
||||
#ifdef USE_DTRACE
|
||||
if (TCL_DTRACE_CMD_ARGS_ENABLED()) {
|
||||
const char *a[10];
|
||||
int i = 0;
|
||||
|
||||
while (i < 10) {
|
||||
a[i] = i < objc ? TclGetString(objv[i]) : NULL; i++;
|
||||
}
|
||||
TCL_DTRACE_CMD_ARGS(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7],
|
||||
a[8], a[9]);
|
||||
}
|
||||
if (TCL_DTRACE_CMD_INFO_ENABLED() && ((Interp *) interp)->cmdFramePtr) {
|
||||
Tcl_Obj *info = TclInfoFrame(interp, ((Interp *) interp)->cmdFramePtr);
|
||||
const char *a[6]; int i[2];
|
||||
|
||||
TclDTraceInfo(info, a, i);
|
||||
TCL_DTRACE_CMD_INFO(a[0], a[1], a[2], a[3], i[0], i[1], a[4], a[5]);
|
||||
TclDecrRefCount(info);
|
||||
}
|
||||
if ((TCL_DTRACE_CMD_RETURN_ENABLED() || TCL_DTRACE_CMD_RESULT_ENABLED())
|
||||
&& objc) {
|
||||
TclNRAddCallback(interp, DTraceCmdReturn, objv[0], NULL, NULL, NULL);
|
||||
}
|
||||
if (TCL_DTRACE_CMD_ENTRY_ENABLED() && objc) {
|
||||
TCL_DTRACE_CMD_ENTRY(TclGetString(objv[0]), objc - 1,
|
||||
(Tcl_Obj **)(objv + 1));
|
||||
}
|
||||
#endif /* USE_DTRACE */
|
||||
result = objProc(clientData, interp, objc, objv);
|
||||
return TclNRRunCallbacks(interp, result, rootPtr);
|
||||
TclNRAddCallback(interp, Dispatch, objProc, clientData,
|
||||
INT2PTR(objc), objv);
|
||||
return TclNRRunCallbacks(interp, TCL_OK, rootPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8696,7 +8512,7 @@ NRCoroutineExitCallback(
|
||||
TclDeleteExecEnv(corPtr->eePtr);
|
||||
corPtr->eePtr = NULL;
|
||||
|
||||
corPtr->stackLevel = NULL;
|
||||
corPtr->stackLevel = -1;
|
||||
|
||||
/*
|
||||
* #280.
|
||||
@@ -8740,10 +8556,9 @@ TclNRCoroutineActivateCallback(
|
||||
{
|
||||
CoroutineData *corPtr = data[0];
|
||||
int type = PTR2INT(data[1]);
|
||||
int numLevels, unused;
|
||||
int *stackLevel = &unused;
|
||||
int numLevels;
|
||||
|
||||
if (!corPtr->stackLevel) {
|
||||
if (COR_IS_SUSPENDED(corPtr)) {
|
||||
/*
|
||||
* -- Coroutine is suspended --
|
||||
* Push the callback to restore the caller's context on yield or
|
||||
@@ -8758,7 +8573,7 @@ TclNRCoroutineActivateCallback(
|
||||
* the interp's environment to make it suitable to run this coroutine.
|
||||
*/
|
||||
|
||||
corPtr->stackLevel = stackLevel;
|
||||
corPtr->stackLevel = corPtr->eePtr->stackLevel;
|
||||
numLevels = corPtr->auxNumLevels;
|
||||
corPtr->auxNumLevels = iPtr->numLevels;
|
||||
|
||||
@@ -8772,7 +8587,7 @@ TclNRCoroutineActivateCallback(
|
||||
* Coroutine is active: yield
|
||||
*/
|
||||
|
||||
if (corPtr->stackLevel != stackLevel) {
|
||||
if (corPtr->stackLevel != corPtr->eePtr->stackLevel) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"cannot yield: C stack busy", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD",
|
||||
@@ -8788,7 +8603,7 @@ TclNRCoroutineActivateCallback(
|
||||
Tcl_Panic("Yield received an option which is not implemented");
|
||||
}
|
||||
|
||||
corPtr->stackLevel = NULL;
|
||||
corPtr->stackLevel = -1;
|
||||
|
||||
numLevels = iPtr->numLevels;
|
||||
iPtr->numLevels = corPtr->auxNumLevels;
|
||||
@@ -9032,7 +8847,7 @@ TclNRCoroutineObjCmd(
|
||||
corPtr->running.varFramePtr = iPtr->rootFramePtr;
|
||||
corPtr->running.cmdFramePtr = NULL;
|
||||
corPtr->running.lineLABCPtr = corPtr->lineLABCPtr;
|
||||
corPtr->stackLevel = NULL;
|
||||
corPtr->stackLevel = -1;
|
||||
corPtr->auxNumLevels = 0;
|
||||
|
||||
/*
|
||||
|
||||
+3
-4
@@ -194,8 +194,7 @@ Tcl_CaseObjCmd(
|
||||
for (i = 0; i < caseObjc; i += 2) {
|
||||
int patObjc, j;
|
||||
const char **patObjv;
|
||||
const char *pat;
|
||||
unsigned char *p;
|
||||
const char *pat, *p;
|
||||
|
||||
if (i == caseObjc-1) {
|
||||
Tcl_ResetResult(interp);
|
||||
@@ -210,8 +209,8 @@ Tcl_CaseObjCmd(
|
||||
*/
|
||||
|
||||
pat = TclGetString(caseObjv[i]);
|
||||
for (p = (unsigned char *) pat; *p != '\0'; p++) {
|
||||
if (isspace(*p) || (*p == '\\')) { /* INTL: ISO space, UCHAR */
|
||||
for (p = pat; *p != '\0'; p++) {
|
||||
if (TclIsSpaceProc(*p) || (*p == '\\')) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+8
-26
@@ -1302,28 +1302,12 @@ TclInfoFrame(
|
||||
*/
|
||||
|
||||
ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], -1));
|
||||
ADD_PAIR("line", Tcl_NewIntObj(framePtr->line[0]));
|
||||
ADD_PAIR("cmd", Tcl_NewStringObj(framePtr->cmd.str.cmd,
|
||||
framePtr->cmd.str.len));
|
||||
break;
|
||||
|
||||
case TCL_LOCATION_EVAL_LIST:
|
||||
/*
|
||||
* List optimized evaluation. Type, line, cmd, the latter through
|
||||
* listPtr, possibly a frame.
|
||||
*/
|
||||
|
||||
ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], -1));
|
||||
ADD_PAIR("line", Tcl_NewIntObj(1));
|
||||
|
||||
/*
|
||||
* We put a duplicate of the command list obj into the result to
|
||||
* ensure that the 'pure List'-property of the command itself is not
|
||||
* destroyed. Otherwise the query here would disable the list
|
||||
* optimization path in Tcl_EvalObjEx.
|
||||
*/
|
||||
|
||||
ADD_PAIR("cmd", Tcl_DuplicateObj(framePtr->cmd.listPtr));
|
||||
if (framePtr->line) {
|
||||
ADD_PAIR("line", Tcl_NewIntObj(framePtr->line[0]));
|
||||
} else {
|
||||
ADD_PAIR("line", Tcl_NewIntObj(1));
|
||||
}
|
||||
ADD_PAIR("cmd", TclGetSourceFromFrame(framePtr, 0, NULL));
|
||||
break;
|
||||
|
||||
case TCL_LOCATION_PREBC:
|
||||
@@ -1371,8 +1355,7 @@ TclInfoFrame(
|
||||
Tcl_DecrRefCount(fPtr->data.eval.path);
|
||||
}
|
||||
|
||||
ADD_PAIR("cmd",
|
||||
Tcl_NewStringObj(fPtr->cmd.str.cmd, fPtr->cmd.str.len));
|
||||
ADD_PAIR("cmd", TclGetSourceFromFrame(fPtr, 0, NULL));
|
||||
TclStackFree(interp, fPtr);
|
||||
break;
|
||||
}
|
||||
@@ -1391,8 +1374,7 @@ TclInfoFrame(
|
||||
* the result list object.
|
||||
*/
|
||||
|
||||
ADD_PAIR("cmd", Tcl_NewStringObj(framePtr->cmd.str.cmd,
|
||||
framePtr->cmd.str.len));
|
||||
ADD_PAIR("cmd", TclGetSourceFromFrame(framePtr, 0, NULL));
|
||||
break;
|
||||
|
||||
case TCL_LOCATION_PROC:
|
||||
|
||||
+28
-63
@@ -87,6 +87,7 @@ TclCompileAppendCmd(
|
||||
int isScalar, localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords == 1) {
|
||||
return TCL_ERROR;
|
||||
@@ -544,8 +545,6 @@ TclCompileCatchCmd(
|
||||
JumpFixup jumpFixup;
|
||||
Tcl_Token *cmdTokenPtr, *resultNameTokenPtr, *optsNameTokenPtr;
|
||||
int resultIndex, optsIndex, range;
|
||||
int initStackDepth = envPtr->currStackDepth;
|
||||
int savedStackDepth;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
@@ -611,15 +610,13 @@ TclCompileCatchCmd(
|
||||
* begin by undeflowing the stack below the mark set by BEGIN_CATCH4.
|
||||
*/
|
||||
|
||||
SetLineInformation(1);
|
||||
if (cmdTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
|
||||
savedStackDepth = envPtr->currStackDepth;
|
||||
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
|
||||
ExceptionRangeStarts(envPtr, range);
|
||||
CompileBody(envPtr, cmdTokenPtr, interp);
|
||||
BODY(cmdTokenPtr, 1);
|
||||
} else {
|
||||
SetLineInformation(1);
|
||||
CompileTokens(envPtr, cmdTokenPtr, interp);
|
||||
savedStackDepth = envPtr->currStackDepth;
|
||||
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
|
||||
ExceptionRangeStarts(envPtr, range);
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
@@ -641,7 +638,7 @@ TclCompileCatchCmd(
|
||||
TclEmitOpcode( INST_POP, envPtr);
|
||||
PushStringLiteral(envPtr, "0");
|
||||
TclEmitInstInt1( INST_JUMP1, 3, envPtr);
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
ExceptionRangeTarget(envPtr, range, catchOffset);
|
||||
TclEmitOpcode( INST_PUSH_RETURN_CODE, envPtr);
|
||||
ExceptionRangeEnds(envPtr, range);
|
||||
@@ -670,7 +667,7 @@ TclCompileCatchCmd(
|
||||
* return code.
|
||||
*/
|
||||
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
TclAdjustStackDepth(-2, envPtr);
|
||||
ExceptionRangeTarget(envPtr, range, catchOffset);
|
||||
/* Stack at this point: ?script? */
|
||||
TclEmitOpcode( INST_PUSH_RESULT, envPtr);
|
||||
@@ -745,15 +742,6 @@ TclCompileCatchCmd(
|
||||
TclEmitOpcode( INST_POP, envPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Result of all this, on either branch, should have been to leave one
|
||||
* operand -- the return code -- on the stack.
|
||||
*/
|
||||
|
||||
if (envPtr->currStackDepth != initStackDepth + 1) {
|
||||
Tcl_Panic("in TclCompileCatchCmd, currStackDepth = %d should be %d",
|
||||
envPtr->currStackDepth, initStackDepth+1);
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -986,6 +974,7 @@ TclCompileDictGetCmd(
|
||||
* case is legal, but too special and magic for us to deal with here).
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords < 3) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1023,6 +1012,7 @@ TclCompileDictExistsCmd(
|
||||
* case is legal, but too special and magic for us to deal with here).
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords < 3) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1060,6 +1050,7 @@ TclCompileDictUnsetCmd(
|
||||
* compile to bytecode.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords < 3) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1205,6 +1196,7 @@ TclCompileDictMergeCmd(
|
||||
* argument, the only thing to do is to verify the dict-ness.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. (less likely) */
|
||||
if (parsePtr->numWords < 2) {
|
||||
PushStringLiteral(envPtr, "");
|
||||
return TCL_OK;
|
||||
@@ -1286,6 +1278,7 @@ TclCompileDictMergeCmd(
|
||||
* subsequent) dicts. This is strictly not necessary, but it is nice.
|
||||
*/
|
||||
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
ExceptionRangeTarget(envPtr, outLoop, catchOffset);
|
||||
TclEmitOpcode( INST_PUSH_RETURN_OPTIONS, envPtr);
|
||||
TclEmitOpcode( INST_PUSH_RESULT, envPtr);
|
||||
@@ -1295,7 +1288,6 @@ TclCompileDictMergeCmd(
|
||||
TclEmitInstInt1( INST_UNSET_SCALAR, 0, envPtr);
|
||||
TclEmitInt4( infoIndex, envPtr);
|
||||
TclEmitOpcode( INST_RETURN_STK, envPtr);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -1345,9 +1337,6 @@ CompileDictEachCmd(
|
||||
int numVars, endTargetOffset;
|
||||
int collectVar = -1; /* Index of temp var holding the result
|
||||
* dict. */
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
/* Needed because jumps confuse the stack
|
||||
* space calculator. */
|
||||
const char **argv;
|
||||
Tcl_DString buffer;
|
||||
|
||||
@@ -1473,8 +1462,7 @@ CompileDictEachCmd(
|
||||
* Compile the loop body itself. It should be stack-neutral.
|
||||
*/
|
||||
|
||||
SetLineInformation(3);
|
||||
CompileBody(envPtr, bodyTokenPtr, interp);
|
||||
BODY(bodyTokenPtr, 3);
|
||||
if (collect == TCL_EACH_COLLECT) {
|
||||
Emit14Inst( INST_LOAD_SCALAR, keyVarIndex, envPtr);
|
||||
TclEmitInstInt4(INST_OVER, 1, envPtr);
|
||||
@@ -1510,6 +1498,7 @@ CompileDictEachCmd(
|
||||
* and rethrows the error.
|
||||
*/
|
||||
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
ExceptionRangeTarget(envPtr, catchRange, catchOffset);
|
||||
TclEmitOpcode( INST_PUSH_RETURN_OPTIONS, envPtr);
|
||||
TclEmitOpcode( INST_PUSH_RESULT, envPtr);
|
||||
@@ -1528,7 +1517,6 @@ CompileDictEachCmd(
|
||||
* easy!) Note that we skip the END_CATCH. [Bug 1382528]
|
||||
*/
|
||||
|
||||
envPtr->currStackDepth = savedStackDepth + 2;
|
||||
jumpDisplacement = CurrentOffset(envPtr) - emptyTargetOffset;
|
||||
TclUpdateInstInt4AtPc(INST_JUMP_TRUE4, jumpDisplacement,
|
||||
envPtr->codeStart + emptyTargetOffset);
|
||||
@@ -1657,8 +1645,7 @@ TclCompileDictUpdateCmd(
|
||||
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
|
||||
|
||||
ExceptionRangeStarts(envPtr, range);
|
||||
SetLineInformation(parsePtr->numWords - 1);
|
||||
CompileBody(envPtr, bodyTokenPtr, interp);
|
||||
BODY(bodyTokenPtr, parsePtr->numWords - 1);
|
||||
ExceptionRangeEnds(envPtr, range);
|
||||
|
||||
/*
|
||||
@@ -1730,6 +1717,7 @@ TclCompileDictAppendCmd(
|
||||
* speed quite so much. ;-)
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords<4 || parsePtr->numWords>100) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1782,6 +1770,8 @@ TclCompileDictLappendCmd(
|
||||
* There must be three arguments after the command.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
/* Probably not. Why is INST_DICT_LAPPEND limited to one value? */
|
||||
if (parsePtr->numWords != 4) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1828,6 +1818,7 @@ TclCompileDictWithCmd(
|
||||
* There must be at least one argument after the command.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords < 3) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1998,8 +1989,7 @@ TclCompileDictWithCmd(
|
||||
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
|
||||
|
||||
ExceptionRangeStarts(envPtr, range);
|
||||
SetLineInformation(parsePtr->numWords-1);
|
||||
CompileBody(envPtr, tokenPtr, interp);
|
||||
BODY(tokenPtr, parsePtr->numWords - 1);
|
||||
ExceptionRangeEnds(envPtr, range);
|
||||
|
||||
/*
|
||||
@@ -2240,7 +2230,6 @@ TclCompileForCmd(
|
||||
JumpFixup jumpEvalCondFixup;
|
||||
int testCodeOffset, bodyCodeOffset, nextCodeOffset, jumpDist;
|
||||
int bodyRange, nextRange;
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (parsePtr->numWords != 5) {
|
||||
@@ -2275,8 +2264,7 @@ TclCompileForCmd(
|
||||
* Inline compile the initial command.
|
||||
*/
|
||||
|
||||
SetLineInformation(1);
|
||||
CompileBody(envPtr, startTokenPtr, interp);
|
||||
BODY(startTokenPtr, 1);
|
||||
TclEmitOpcode(INST_POP, envPtr);
|
||||
|
||||
/*
|
||||
@@ -2299,10 +2287,8 @@ TclCompileForCmd(
|
||||
|
||||
bodyRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
|
||||
bodyCodeOffset = ExceptionRangeStarts(envPtr, bodyRange);
|
||||
SetLineInformation(4);
|
||||
CompileBody(envPtr, bodyTokenPtr, interp);
|
||||
BODY(bodyTokenPtr, 4);
|
||||
ExceptionRangeEnds(envPtr, bodyRange);
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
TclEmitOpcode(INST_POP, envPtr);
|
||||
|
||||
/*
|
||||
@@ -2313,14 +2299,10 @@ TclCompileForCmd(
|
||||
|
||||
nextRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
|
||||
envPtr->exceptAuxArrayPtr[nextRange].supportsContinue = 0;
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
nextCodeOffset = ExceptionRangeStarts(envPtr, nextRange);
|
||||
SetLineInformation(3);
|
||||
CompileBody(envPtr, nextTokenPtr, interp);
|
||||
BODY(nextTokenPtr, 3);
|
||||
ExceptionRangeEnds(envPtr, nextRange);
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
TclEmitOpcode(INST_POP, envPtr);
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
|
||||
/*
|
||||
* Compile the test expression then emit the conditional jump that
|
||||
@@ -2337,9 +2319,7 @@ TclCompileForCmd(
|
||||
}
|
||||
|
||||
SetLineInformation(2);
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
|
||||
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
|
||||
if (jumpDist > 127) {
|
||||
@@ -2367,7 +2347,6 @@ TclCompileForCmd(
|
||||
* The for command's result is an empty string.
|
||||
*/
|
||||
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
PushStringLiteral(envPtr, "");
|
||||
|
||||
return TCL_OK;
|
||||
@@ -2478,9 +2457,8 @@ CompileEachloopCmd(
|
||||
Tcl_Token *tokenPtr, *bodyTokenPtr;
|
||||
unsigned char *jumpPc;
|
||||
JumpFixup jumpFalseFixup;
|
||||
int jumpBackDist, jumpBackOffset, infoIndex, range, bodyIndex;
|
||||
int jumpBackDist, jumpBackOffset, infoIndex, range;
|
||||
int numWords, numLists, numVars, loopIndex, tempVar, i, j, code;
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
@@ -2519,8 +2497,6 @@ CompileEachloopCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
bodyIndex = i-1;
|
||||
|
||||
/*
|
||||
* Allocate storage for the varcList and varvList arrays if necessary.
|
||||
*/
|
||||
@@ -2559,7 +2535,7 @@ CompileEachloopCmd(
|
||||
|
||||
Tcl_DStringInit(&varList);
|
||||
TclDStringAppendToken(&varList, &tokenPtr[1]);
|
||||
code = Tcl_SplitList(interp, Tcl_DStringValue(&varList),
|
||||
code = Tcl_SplitList(NULL, Tcl_DStringValue(&varList),
|
||||
&varcList[loopIndex], &varvList[loopIndex]);
|
||||
Tcl_DStringFree(&varList);
|
||||
if (code != TCL_OK) {
|
||||
@@ -2661,8 +2637,7 @@ CompileEachloopCmd(
|
||||
i < numWords-1;
|
||||
i++, tokenPtr = TokenAfter(tokenPtr)) {
|
||||
if ((i%2 == 0) && (i > 0)) {
|
||||
SetLineInformation(i);
|
||||
CompileTokens(envPtr, tokenPtr, interp);
|
||||
CompileWord(envPtr, tokenPtr, interp, i);
|
||||
tempVar = (firstValueTemp + loopIndex);
|
||||
Emit14Inst( INST_STORE_SCALAR, tempVar, envPtr);
|
||||
TclEmitOpcode( INST_POP, envPtr);
|
||||
@@ -2699,11 +2674,9 @@ CompileEachloopCmd(
|
||||
* Inline compile the loop body.
|
||||
*/
|
||||
|
||||
SetLineInformation(bodyIndex);
|
||||
ExceptionRangeStarts(envPtr, range);
|
||||
CompileBody(envPtr, bodyTokenPtr, interp);
|
||||
BODY(bodyTokenPtr, numWords - 1);
|
||||
ExceptionRangeEnds(envPtr, range);
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
|
||||
if (collect == TCL_EACH_COLLECT) {
|
||||
Emit14Inst( INST_LAPPEND_SCALAR, collectVar,envPtr);
|
||||
@@ -2763,7 +2736,6 @@ CompileEachloopCmd(
|
||||
* list of results from evaluating the loop body.
|
||||
*/
|
||||
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
if (collect == TCL_EACH_COLLECT) {
|
||||
Emit14Inst( INST_LOAD_SCALAR, collectVar, envPtr);
|
||||
TclEmitInstInt1(INST_UNSET_SCALAR, 0, envPtr);
|
||||
@@ -2771,7 +2743,6 @@ CompileEachloopCmd(
|
||||
} else {
|
||||
PushStringLiteral(envPtr, "");
|
||||
}
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
|
||||
done:
|
||||
for (loopIndex = 0; loopIndex < numLists; loopIndex++) {
|
||||
@@ -3006,7 +2977,8 @@ TclCompileFormatCmd(
|
||||
ckfree(objv);
|
||||
Tcl_DecrRefCount(formatObj);
|
||||
if (tmpObj == NULL) {
|
||||
return TCL_ERROR;
|
||||
TclCompileSyntaxError(interp, envPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3184,10 +3156,7 @@ TclPushVarName(
|
||||
CompileEnv *envPtr, /* Holds resulting instructions. */
|
||||
int flags, /* TCL_NO_LARGE_INDEX | TCL_NO_ELEMENT. */
|
||||
int *localIndexPtr, /* Must not be NULL. */
|
||||
int *isScalarPtr, /* Must not be NULL. */
|
||||
int line, /* Line the token starts on. */
|
||||
int *clNext) /* Reference to offset of next hidden cont.
|
||||
* line. */
|
||||
int *isScalarPtr) /* Must not be NULL. */
|
||||
{
|
||||
register const char *p;
|
||||
const char *name, *elName;
|
||||
@@ -3367,8 +3336,6 @@ TclPushVarName(
|
||||
|
||||
if (elName != NULL && !(flags & TCL_NO_ELEMENT)) {
|
||||
if (elNameChars) {
|
||||
envPtr->line = line;
|
||||
envPtr->clNext = clNext;
|
||||
TclCompileTokens(interp, elemTokenPtr, elemTokenCount,
|
||||
envPtr);
|
||||
} else {
|
||||
@@ -3380,8 +3347,6 @@ TclPushVarName(
|
||||
* The var name isn't simple: compile and push it.
|
||||
*/
|
||||
|
||||
envPtr->line = line;
|
||||
envPtr->clNext = clNext;
|
||||
CompileTokens(envPtr, varTokenPtr, interp);
|
||||
}
|
||||
|
||||
|
||||
+9
-20
@@ -60,6 +60,7 @@ TclCompileGlobalCmd(
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords < 2) {
|
||||
return TCL_ERROR;
|
||||
@@ -142,10 +143,6 @@ TclCompileIfCmd(
|
||||
int jumpIndex = 0; /* Avoid compiler warning. */
|
||||
int jumpFalseDist, numWords, wordIdx, numBytes, j, code;
|
||||
const char *word;
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
/* Saved stack depth at the start of the first
|
||||
* test; the envPtr current depth is restored
|
||||
* to this value at the start of each test. */
|
||||
int realCond = 1; /* Set to 0 for static conditions:
|
||||
* "if 0 {..}" */
|
||||
int boolVal; /* Value of static condition. */
|
||||
@@ -203,7 +200,6 @@ TclCompileIfCmd(
|
||||
* the "then" part.
|
||||
*/
|
||||
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
testTokenPtr = tokenPtr;
|
||||
|
||||
if (realCond) {
|
||||
@@ -269,9 +265,7 @@ TclCompileIfCmd(
|
||||
*/
|
||||
|
||||
if (compileScripts) {
|
||||
SetLineInformation(wordIdx);
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
CompileBody(envPtr, tokenPtr, interp);
|
||||
BODY(tokenPtr, wordIdx);
|
||||
}
|
||||
|
||||
if (realCond) {
|
||||
@@ -295,6 +289,7 @@ TclCompileIfCmd(
|
||||
* with a 4 byte jump.
|
||||
*/
|
||||
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
if (TclFixupForwardJumpToHere(envPtr,
|
||||
jumpFalseFixupArray.fixup+jumpIndex, 120)) {
|
||||
/*
|
||||
@@ -324,13 +319,6 @@ TclCompileIfCmd(
|
||||
wordIdx++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restore the current stack depth in the environment; the "else" clause
|
||||
* (or its default) will add 1 to this.
|
||||
*/
|
||||
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
|
||||
/*
|
||||
* Check for the optional else clause. Do not compile anything if this was
|
||||
* an "if 1 {...}" case.
|
||||
@@ -357,8 +345,7 @@ TclCompileIfCmd(
|
||||
* Compile the else command body.
|
||||
*/
|
||||
|
||||
SetLineInformation(wordIdx);
|
||||
CompileBody(envPtr, tokenPtr, interp);
|
||||
BODY(tokenPtr, wordIdx);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -416,7 +403,6 @@ TclCompileIfCmd(
|
||||
*/
|
||||
|
||||
done:
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
TclFreeJumpFixupArray(&jumpFalseFixupArray);
|
||||
TclFreeJumpFixupArray(&jumpEndFixupArray);
|
||||
return code;
|
||||
@@ -714,8 +700,7 @@ TclCompileInfoLevelCmd(
|
||||
* list of arguments.
|
||||
*/
|
||||
|
||||
SetLineInformation(1);
|
||||
CompileTokens(envPtr, TokenAfter(parsePtr->tokenPtr), interp);
|
||||
CompileWord(envPtr, TokenAfter(parsePtr->tokenPtr), interp, 1);
|
||||
TclEmitOpcode( INST_INFO_LEVEL_ARGS, envPtr);
|
||||
}
|
||||
return TCL_OK;
|
||||
@@ -836,6 +821,7 @@ TclCompileLappendCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords == 1) {
|
||||
return TCL_ERROR;
|
||||
@@ -1077,6 +1063,7 @@ TclCompileLindexCmd(
|
||||
* Quit if too few args.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (numWords <= 1) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -1599,6 +1586,7 @@ TclCompileLsetCmd(
|
||||
* Check argument count.
|
||||
*/
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords < 3) {
|
||||
/*
|
||||
* Fail at run time, not in compilation.
|
||||
@@ -2547,6 +2535,7 @@ TclCompileSyntaxError(
|
||||
TclEmitPush(TclRegisterNewLiteral(envPtr, bytes, numBytes), envPtr);
|
||||
CompileReturnInternal(envPtr, INST_SYNTAX, TCL_ERROR, 0,
|
||||
TclNoErrorStack(interp, Tcl_GetReturnOptions(interp, TCL_ERROR)));
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+85
-140
@@ -40,17 +40,14 @@ static int CompileUnaryOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, int instruction,
|
||||
CompileEnv *envPtr);
|
||||
static void IssueSwitchChainedTests(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, ExtCmdLoc *mapPtr,
|
||||
int eclIndex, int mode, int noCase,
|
||||
int valueIndex, Tcl_Token *valueTokenPtr,
|
||||
int numWords, Tcl_Token **bodyToken,
|
||||
int *bodyLines, int **bodyNext);
|
||||
static void IssueSwitchJumpTable(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, ExtCmdLoc *mapPtr,
|
||||
int eclIndex, int valueIndex,
|
||||
Tcl_Token *valueTokenPtr, int numWords,
|
||||
CompileEnv *envPtr, int mode, int noCase,
|
||||
int valueIndex, int numWords,
|
||||
Tcl_Token **bodyToken, int *bodyLines,
|
||||
int **bodyContLines);
|
||||
int **bodyNext);
|
||||
static void IssueSwitchJumpTable(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, int valueIndex,
|
||||
int numWords, Tcl_Token **bodyToken,
|
||||
int *bodyLines, int **bodyContLines);
|
||||
static int IssueTryClausesInstructions(Tcl_Interp *interp,
|
||||
CompileEnv *envPtr, Tcl_Token *bodyToken,
|
||||
int numHandlers, int *matchCodes,
|
||||
@@ -88,8 +85,6 @@ const AuxDataType tclJumptableInfoType = {
|
||||
TclEmitInstInt1(INST_##name,(val1),envPtr);TclEmitInt4((val2),envPtr)
|
||||
#define OP44(name,val1,val2) \
|
||||
TclEmitInstInt4(INST_##name,(val1),envPtr);TclEmitInt4((val2),envPtr)
|
||||
#define BODY(token,index) \
|
||||
SetLineInformation((index));CompileBody(envPtr,(token),interp)
|
||||
#define PUSH(str) \
|
||||
PushStringLiteral(envPtr, str)
|
||||
#define JUMP4(name,var) \
|
||||
@@ -748,6 +743,9 @@ TclSubstCompile(
|
||||
Tcl_InterpState state = NULL;
|
||||
|
||||
TclSubstParse(interp, bytes, numBytes, flags, &parse, &state);
|
||||
if (state != NULL) {
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Tricky point! If the first token does not result in a *guaranteed* push
|
||||
@@ -865,6 +863,7 @@ TclSubstCompile(
|
||||
/* Substitution produced TCL_OK */
|
||||
OP( END_CATCH);
|
||||
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &okFixup);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
|
||||
/* Exceptional return codes processed here */
|
||||
ExceptionRangeTarget(envPtr, catchRange, catchOffset);
|
||||
@@ -890,6 +889,7 @@ TclSubstCompile(
|
||||
/* OTHER */
|
||||
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &otherFixup);
|
||||
|
||||
TclAdjustStackDepth(1, envPtr);
|
||||
/* BREAK destination */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &breakFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad break jump distance %d",
|
||||
@@ -905,6 +905,7 @@ TclSubstCompile(
|
||||
OP1(JUMP1, -breakJump);
|
||||
}
|
||||
|
||||
TclAdjustStackDepth(2, envPtr);
|
||||
/* CONTINUE destination */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &continueFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad continue jump distance %d",
|
||||
@@ -914,6 +915,7 @@ TclSubstCompile(
|
||||
OP( POP);
|
||||
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &endFixup);
|
||||
|
||||
TclAdjustStackDepth(2, envPtr);
|
||||
/* RETURN + other destination */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &returnFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad return jump distance %d",
|
||||
@@ -931,17 +933,6 @@ TclSubstCompile(
|
||||
OP4( REVERSE, 2);
|
||||
OP( POP);
|
||||
|
||||
/*
|
||||
* We've emitted several POP instructions, and the automatic
|
||||
* computations for stack depth requirements have been decrementing
|
||||
* for every one. However, we know that every branch actually taken
|
||||
* only encounters some of those instructions. No branch passes
|
||||
* through them all. So, we now have a stack requirements estimate
|
||||
* that is too low. Here we manually fix that up.
|
||||
*/
|
||||
|
||||
TclAdjustStackDepth(4, envPtr);
|
||||
|
||||
/* OK destination */
|
||||
if (TclFixupForwardJumpToHere(envPtr, &okFixup, 127)) {
|
||||
Tcl_Panic("TclCompileSubstCmd: bad ok jump distance %d",
|
||||
@@ -1000,9 +991,6 @@ TclSubstCompile(
|
||||
* Instructions are added to envPtr to execute the "switch" command at
|
||||
* runtime.
|
||||
*
|
||||
* FIXME:
|
||||
* Stack depths are probably not calculated correctly.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -1293,13 +1281,15 @@ TclCompileSwitchCmd(
|
||||
* but it handles the most common case well enough.
|
||||
*/
|
||||
|
||||
/* Both methods push the value to match against onto the stack. */
|
||||
CompileWord(envPtr, valueTokenPtr, interp, valueIndex);
|
||||
|
||||
if (mode == Switch_Exact) {
|
||||
IssueSwitchJumpTable(interp, envPtr, mapPtr, eclIndex, valueIndex,
|
||||
valueTokenPtr, numWords, bodyToken, bodyLines, bodyContLines);
|
||||
IssueSwitchJumpTable(interp, envPtr, valueIndex, numWords, bodyToken,
|
||||
bodyLines, bodyContLines);
|
||||
} else {
|
||||
IssueSwitchChainedTests(interp, envPtr, mapPtr, eclIndex, mode,noCase,
|
||||
valueIndex, valueTokenPtr, numWords, bodyToken, bodyLines,
|
||||
bodyContLines);
|
||||
IssueSwitchChainedTests(interp, envPtr, mode, noCase, valueIndex,
|
||||
numWords, bodyToken, bodyLines, bodyContLines);
|
||||
}
|
||||
result = TCL_OK;
|
||||
|
||||
@@ -1337,13 +1327,9 @@ static void
|
||||
IssueSwitchChainedTests(
|
||||
Tcl_Interp *interp, /* Context for compiling script bodies. */
|
||||
CompileEnv *envPtr, /* Holds resulting instructions. */
|
||||
ExtCmdLoc *mapPtr, /* For mapping tokens to their source code
|
||||
* location. */
|
||||
int eclIndex,
|
||||
int mode, /* Exact, Glob or Regexp */
|
||||
int noCase, /* Case-insensitivity flag. */
|
||||
int valueIndex, /* The value to match against. */
|
||||
Tcl_Token *valueTokenPtr,
|
||||
int numBodyTokens, /* Number of tokens describing things the
|
||||
* switch can match against and bodies to
|
||||
* execute when the match succeeds. */
|
||||
@@ -1353,7 +1339,6 @@ IssueSwitchChainedTests(
|
||||
int **bodyContLines) /* Array of continuation line info. */
|
||||
{
|
||||
enum {Switch_Exact, Switch_Glob, Switch_Regexp};
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
int foundDefault; /* Flag to indicate whether a "default" clause
|
||||
* is present. */
|
||||
JumpFixup *fixupArray; /* Array of forward-jump fixup records. */
|
||||
@@ -1368,13 +1353,6 @@ IssueSwitchChainedTests(
|
||||
int simple, exact; /* For extracting the type of regexp. */
|
||||
int i;
|
||||
|
||||
/*
|
||||
* First, we push the value we're matching against on the stack.
|
||||
*/
|
||||
|
||||
SetLineInformation(valueIndex);
|
||||
CompileTokens(envPtr, valueTokenPtr, interp);
|
||||
|
||||
/*
|
||||
* Generate a test for each arm.
|
||||
*/
|
||||
@@ -1388,7 +1366,6 @@ IssueSwitchChainedTests(
|
||||
foundDefault = 0;
|
||||
for (i=0 ; i<numBodyTokens ; i+=2) {
|
||||
nextArmFixupIndex = -1;
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
if (i!=numBodyTokens-2 || bodyToken[numBodyTokens-2]->size != 7 ||
|
||||
memcmp(bodyToken[numBodyTokens-2]->start, "default", 7)) {
|
||||
/*
|
||||
@@ -1519,13 +1496,12 @@ IssueSwitchChainedTests(
|
||||
}
|
||||
|
||||
/*
|
||||
* Now do the actual compilation. Note that we do not use CompileBody
|
||||
* Now do the actual compilation. Note that we do not use BODY()
|
||||
* because we may have synthesized the tokens in a non-standard
|
||||
* pattern.
|
||||
*/
|
||||
|
||||
OP( POP);
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
envPtr->line = bodyLines[i+1]; /* TIP #280 */
|
||||
envPtr->clNext = bodyContLines[i+1]; /* TIP #280 */
|
||||
TclCompileCmdWord(interp, bodyToken[i+1], 1, envPtr);
|
||||
@@ -1583,8 +1559,6 @@ IssueSwitchChainedTests(
|
||||
}
|
||||
TclStackFree(interp, fixupTargetArray);
|
||||
TclStackFree(interp, fixupArray);
|
||||
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1604,11 +1578,7 @@ static void
|
||||
IssueSwitchJumpTable(
|
||||
Tcl_Interp *interp, /* Context for compiling script bodies. */
|
||||
CompileEnv *envPtr, /* Holds resulting instructions. */
|
||||
ExtCmdLoc *mapPtr, /* For mapping tokens to their source code
|
||||
* location. */
|
||||
int eclIndex,
|
||||
int valueIndex, /* The value to match against. */
|
||||
Tcl_Token *valueTokenPtr,
|
||||
int numBodyTokens, /* Number of tokens describing things the
|
||||
* switch can match against and bodies to
|
||||
* execute when the match succeeds. */
|
||||
@@ -1618,19 +1588,11 @@ IssueSwitchJumpTable(
|
||||
int **bodyContLines) /* Array of continuation line info. */
|
||||
{
|
||||
JumptableInfo *jtPtr;
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
int infoIndex, isNew, *finalFixups, numRealBodies = 0, jumpLocation;
|
||||
int mustGenerate, foundDefault, jumpToDefault, i;
|
||||
Tcl_DString buffer;
|
||||
Tcl_HashEntry *hPtr;
|
||||
|
||||
/*
|
||||
* First, we push the value we're matching against on the stack.
|
||||
*/
|
||||
|
||||
SetLineInformation(valueIndex);
|
||||
CompileTokens(envPtr, valueTokenPtr, interp);
|
||||
|
||||
/*
|
||||
* Compile the switch by using a jump table, which is basically a
|
||||
* hashtable that maps from literal values to match against to the offset
|
||||
@@ -1731,7 +1693,6 @@ IssueSwitchJumpTable(
|
||||
* Compile the body of the arm.
|
||||
*/
|
||||
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
envPtr->line = bodyLines[i+1]; /* TIP #280 */
|
||||
envPtr->clNext = bodyContLines[i+1]; /* TIP #280 */
|
||||
TclCompileCmdWord(interp, bodyToken[i+1], 1, envPtr);
|
||||
@@ -1753,6 +1714,7 @@ IssueSwitchJumpTable(
|
||||
*/
|
||||
|
||||
OP4( JUMP4, 0);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1763,7 +1725,6 @@ IssueSwitchJumpTable(
|
||||
*/
|
||||
|
||||
if (!foundDefault) {
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
TclStoreInt4AtPtr(CurrentOffset(envPtr)-jumpToDefault,
|
||||
envPtr->codeStart+jumpToDefault+1);
|
||||
PUSH("");
|
||||
@@ -1784,7 +1745,6 @@ IssueSwitchJumpTable(
|
||||
*/
|
||||
|
||||
TclStackFree(interp, finalFixups);
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1942,9 +1902,9 @@ TclCompileThrowCmd(
|
||||
{
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int numWords = parsePtr->numWords;
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
Tcl_Token *codeToken, *msgToken;
|
||||
Tcl_Obj *objPtr;
|
||||
int codeKnown, codeIsList, codeIsValid, len;
|
||||
|
||||
if (numWords != 3) {
|
||||
return TCL_ERROR;
|
||||
@@ -1954,77 +1914,66 @@ TclCompileThrowCmd(
|
||||
|
||||
TclNewObj(objPtr);
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
if (TclWordKnownAtCompileTime(codeToken, objPtr)) {
|
||||
|
||||
codeKnown = TclWordKnownAtCompileTime(codeToken, objPtr);
|
||||
|
||||
/*
|
||||
* First we must emit the code to substitute the arguments. This
|
||||
* must come first in case substitution raises errors.
|
||||
*/
|
||||
if (!codeKnown) {
|
||||
CompileWord(envPtr, codeToken, interp, 1);
|
||||
PUSH( "-errorcode");
|
||||
}
|
||||
CompileWord(envPtr, msgToken, interp, 2);
|
||||
|
||||
codeIsList = codeKnown && (TCL_OK ==
|
||||
Tcl_ListObjLength(interp, objPtr, &len));
|
||||
codeIsValid = codeIsList && (len != 0);
|
||||
|
||||
if (codeIsValid) {
|
||||
Tcl_Obj *errPtr, *dictPtr;
|
||||
const char *string;
|
||||
int len;
|
||||
|
||||
/*
|
||||
* The code is known at compilation time. This allows us to issue a
|
||||
* very efficient sequence of instructions.
|
||||
*/
|
||||
|
||||
if (Tcl_ListObjLength(interp, objPtr, &len) != TCL_OK) {
|
||||
/*
|
||||
* Must still do this; might generate an error when getting this
|
||||
* "ignored" value prepared as an argument.
|
||||
*/
|
||||
|
||||
CompileWord(envPtr, msgToken, interp, 2);
|
||||
TclCompileSyntaxError(interp, envPtr);
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
return TCL_OK;
|
||||
}
|
||||
if (len == 0) {
|
||||
/*
|
||||
* Must still do this; might generate an error when getting this
|
||||
* "ignored" value prepared as an argument.
|
||||
*/
|
||||
|
||||
CompileWord(envPtr, msgToken, interp, 2);
|
||||
goto issueErrorForEmptyCode;
|
||||
}
|
||||
TclNewLiteralStringObj(errPtr, "-errorcode");
|
||||
TclNewObj(dictPtr);
|
||||
Tcl_DictObjPut(NULL, dictPtr, errPtr, objPtr);
|
||||
Tcl_IncrRefCount(dictPtr);
|
||||
string = Tcl_GetStringFromObj(dictPtr, &len);
|
||||
CompileWord(envPtr, msgToken, interp, 2);
|
||||
PushLiteral(envPtr, string, len);
|
||||
TclDecrRefCount(dictPtr);
|
||||
OP44( RETURN_IMM, 1, 0);
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
} else {
|
||||
/*
|
||||
* When the code token is not known at compilation time, we need to do
|
||||
* a little bit more work. The main tricky bit here is that the error
|
||||
* code has to be a list (a [throw] restriction) so we must emit extra
|
||||
* instructions to enforce that condition.
|
||||
*/
|
||||
|
||||
CompileWord(envPtr, codeToken, interp, 1);
|
||||
PUSH( "-errorcode");
|
||||
CompileWord(envPtr, msgToken, interp, 2);
|
||||
OP4( REVERSE, 3);
|
||||
OP( DUP);
|
||||
OP( LIST_LENGTH);
|
||||
OP1( JUMP_FALSE1, 16);
|
||||
OP4( LIST, 2);
|
||||
OP44( RETURN_IMM, 1, 0);
|
||||
|
||||
/*
|
||||
* Generate an error for being an empty list. Can't leverage anything
|
||||
* else to do this for us.
|
||||
*/
|
||||
|
||||
issueErrorForEmptyCode:
|
||||
PUSH( "type must be non-empty list");
|
||||
PUSH( "");
|
||||
OP44( RETURN_IMM, 1, 0);
|
||||
TclEmitPush(TclAddLiteralObj(envPtr, dictPtr, NULL), envPtr);
|
||||
}
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
TclDecrRefCount(objPtr);
|
||||
|
||||
/*
|
||||
* Simpler bytecodes when we detect invalid arguments at compile time.
|
||||
*/
|
||||
if (codeKnown && !codeIsValid) {
|
||||
OP( POP);
|
||||
if (codeIsList) {
|
||||
/* Must be an empty list */
|
||||
goto issueErrorForEmptyCode;
|
||||
}
|
||||
TclCompileSyntaxError(interp, envPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
if (!codeKnown) {
|
||||
/*
|
||||
* Argument validity checking has to be done by bytecode at
|
||||
* run time.
|
||||
*/
|
||||
OP4( REVERSE, 3);
|
||||
OP( DUP);
|
||||
OP( LIST_LENGTH);
|
||||
OP1( JUMP_FALSE1, 16);
|
||||
OP4( LIST, 2);
|
||||
OP44( RETURN_IMM, 1, 0);
|
||||
TclAdjustStackDepth(2, envPtr);
|
||||
OP( POP);
|
||||
OP( POP);
|
||||
OP( POP);
|
||||
issueErrorForEmptyCode:
|
||||
PUSH( "type must be non-empty list");
|
||||
PUSH( "-errorcode {TCL OPERATION THROW BADEXCEPTION}");
|
||||
}
|
||||
OP44( RETURN_IMM, 1, 0);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2074,8 +2023,7 @@ TclCompileTryCmd(
|
||||
*/
|
||||
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
SetLineInformation(1);
|
||||
CompileBody(envPtr, bodyToken, interp);
|
||||
BODY(bodyToken, 1);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2703,15 +2651,13 @@ IssueTryClausesFinallyInstructions(
|
||||
/* Skip POP at end; can clean up with subsequent POP */
|
||||
if (i+1 < numHandlers) {
|
||||
OP( POP);
|
||||
} else {
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
}
|
||||
|
||||
endOfThisArm:
|
||||
if (i+1 < numHandlers) {
|
||||
JUMP4( JUMP, addrsToFix[i]);
|
||||
TclAdjustStackDepth(1, envPtr);
|
||||
}
|
||||
TclAdjustStackDepth(1, envPtr);
|
||||
if (matchClauses[i]) {
|
||||
FIXJUMP4( notECJumpSource);
|
||||
}
|
||||
@@ -2872,6 +2818,7 @@ TclCompileUnsetCmd(
|
||||
Tcl_Obj *leadingWord;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords-1;
|
||||
flags = 1;
|
||||
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
@@ -2965,7 +2912,6 @@ TclCompileWhileCmd(
|
||||
Tcl_Token *testTokenPtr, *bodyTokenPtr;
|
||||
JumpFixup jumpEvalCondFixup;
|
||||
int testCodeOffset, bodyCodeOffset, jumpDist, range, code, boolVal;
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
int loopMayEnd = 1; /* This is set to 0 if it is recognized as an
|
||||
* infinite loop. */
|
||||
Tcl_Obj *boolObj;
|
||||
@@ -3057,15 +3003,13 @@ TclCompileWhileCmd(
|
||||
* Compile the loop body.
|
||||
*/
|
||||
|
||||
SetLineInformation(2);
|
||||
bodyCodeOffset = ExceptionRangeStarts(envPtr, range);
|
||||
if (!loopMayEnd) {
|
||||
envPtr->exceptArrayPtr[range].continueOffset = testCodeOffset;
|
||||
envPtr->exceptArrayPtr[range].codeOffset = bodyCodeOffset;
|
||||
}
|
||||
CompileBody(envPtr, bodyTokenPtr, interp);
|
||||
BODY(bodyTokenPtr, 2);
|
||||
ExceptionRangeEnds(envPtr, range);
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
OP( POP);
|
||||
|
||||
/*
|
||||
@@ -3080,10 +3024,8 @@ TclCompileWhileCmd(
|
||||
bodyCodeOffset += 3;
|
||||
testCodeOffset += 3;
|
||||
}
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
SetLineInformation(1);
|
||||
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
|
||||
envPtr->currStackDepth = savedStackDepth + 1;
|
||||
|
||||
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
|
||||
if (jumpDist > 127) {
|
||||
@@ -3114,7 +3056,6 @@ TclCompileWhileCmd(
|
||||
*/
|
||||
|
||||
pushResult:
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
PUSH("");
|
||||
return TCL_OK;
|
||||
}
|
||||
@@ -3233,6 +3174,7 @@ CompileAssociativeBinaryOpCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
for (words=1 ; words<parsePtr->numWords ; words++) {
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
CompileWord(envPtr, tokenPtr, interp, words);
|
||||
@@ -3316,6 +3258,7 @@ CompileComparisonOpCmd(
|
||||
Tcl_Token *tokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords < 3) {
|
||||
PUSH("1");
|
||||
} else if (parsePtr->numWords == 3) {
|
||||
@@ -3653,6 +3596,7 @@ TclCompileMinusOpCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords == 1) {
|
||||
/*
|
||||
* Fallback to direct eval to report syntax error.
|
||||
@@ -3698,6 +3642,7 @@ TclCompileDivOpCmd(
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
int words;
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
if (parsePtr->numWords == 1) {
|
||||
/*
|
||||
* Fallback to direct eval to report syntax error.
|
||||
|
||||
@@ -2401,6 +2401,7 @@ CompileExprTree(
|
||||
(nodePtr->lexeme == AND) ? "1" : "0", 1), envPtr);
|
||||
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP,
|
||||
&jumpPtr->next->next->jump);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
TclFixupForwardJumpToHere(envPtr, &jumpPtr->next->jump, 127);
|
||||
if (TclFixupForwardJumpToHere(envPtr, &jumpPtr->jump, 127)) {
|
||||
jumpPtr->next->next->jump.codeOffset += 3;
|
||||
@@ -2485,8 +2486,7 @@ CompileExprTree(
|
||||
break;
|
||||
}
|
||||
case OT_TOKENS:
|
||||
TclCompileTokens(interp, tokenPtr+1, tokenPtr->numComponents,
|
||||
envPtr);
|
||||
CompileTokens(envPtr, tokenPtr, interp);
|
||||
tokenPtr += tokenPtr->numComponents + 1;
|
||||
break;
|
||||
default:
|
||||
|
||||
+433
-565
File diff suppressed because it is too large
Load Diff
+28
-28
@@ -193,13 +193,6 @@ typedef struct ExtCmdLoc {
|
||||
ECL *loc; /* Command word locations (lines). */
|
||||
int nloc; /* Number of allocated entries in 'loc'. */
|
||||
int nuloc; /* Number of used entries in 'loc'. */
|
||||
Tcl_HashTable litInfo; /* Indexed by bytecode 'PC', to have the
|
||||
* information accessible per command and
|
||||
* argument, not per whole bytecode. Value is
|
||||
* index of command in 'loc', giving us the
|
||||
* literals to associate with line information
|
||||
* as command argument, see
|
||||
* TclArgumentBCEnter() */
|
||||
} ExtCmdLoc;
|
||||
|
||||
/*
|
||||
@@ -372,10 +365,6 @@ typedef struct CompileEnv {
|
||||
* encountered that have not yet been paired
|
||||
* with a corresponding
|
||||
* INST_INVOKE_EXPANDED. */
|
||||
ContLineLoc *clLoc; /* If not NULL, the table holding the
|
||||
* locations of the invisible continuation
|
||||
* lines in the input script, to adjust the
|
||||
* line counter. */
|
||||
int *clNext; /* If not NULL, it refers to the next slot in
|
||||
* clLoc to check for an invisible
|
||||
* continuation line. */
|
||||
@@ -991,6 +980,9 @@ MODULE_SCOPE ByteCode * TclCompileObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
MODULE_SCOPE int TclAttemptCompileProc(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, int depth, Command *cmdPtr,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclCleanupByteCode(ByteCode *codePtr);
|
||||
MODULE_SCOPE void TclCleanupStackForBreakContinue(CompileEnv *envPtr,
|
||||
ExceptionAux *auxPtr);
|
||||
@@ -1002,6 +994,9 @@ MODULE_SCOPE void TclCompileExpr(Tcl_Interp *interp, const char *script,
|
||||
MODULE_SCOPE void TclCompileExprWords(Tcl_Interp *interp,
|
||||
Tcl_Token *tokenPtr, int numWords,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclCompileInvocation(Tcl_Interp *interp,
|
||||
Tcl_Token *tokenPtr, Tcl_Obj *cmdObj, int numWords,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclCompileScript(Tcl_Interp *interp,
|
||||
const char *script, int numBytes,
|
||||
CompileEnv *envPtr);
|
||||
@@ -1074,7 +1069,7 @@ MODULE_SCOPE void TclPrintSource(FILE *outFile,
|
||||
MODULE_SCOPE void TclPushVarName(Tcl_Interp *interp,
|
||||
Tcl_Token *varTokenPtr, CompileEnv *envPtr,
|
||||
int flags, int *localIndexPtr,
|
||||
int *isScalarPtr, int line, int *clNext);
|
||||
int *isScalarPtr);
|
||||
MODULE_SCOPE int TclRegisterLiteral(CompileEnv *envPtr,
|
||||
char *bytes, int length, int flags);
|
||||
MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr);
|
||||
@@ -1114,6 +1109,15 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*
|
||||
* Simplified form to access AuxData.
|
||||
*
|
||||
* ClientData TclFetchAuxData(CompileEng *envPtr, int index);
|
||||
*/
|
||||
|
||||
#define TclFetchAuxData(envPtr, index) \
|
||||
(envPtr)->auxDataArrayPtr[(index)].clientData
|
||||
|
||||
#define LITERAL_ON_HEAP 0x01
|
||||
#define LITERAL_CMD_NAME 0x02
|
||||
|
||||
@@ -1407,16 +1411,16 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
#define TclMax(i, j) ((((int) i) > ((int) j))? (i) : (j))
|
||||
|
||||
/*
|
||||
* Convenience macro for use when compiling bodies of commands. The ANSI C
|
||||
* "prototype" for this macro is:
|
||||
* Convenience macros for use when compiling bodies of commands. The ANSI C
|
||||
* "prototype" for these macros are:
|
||||
*
|
||||
* static void CompileBody(CompileEnv *envPtr, Tcl_Token *tokenPtr,
|
||||
* Tcl_Interp *interp);
|
||||
* static void BODY(Tcl_Token *tokenPtr, int word);
|
||||
*/
|
||||
|
||||
#define CompileBody(envPtr, tokenPtr, interp) \
|
||||
TclCompileCmdWord((interp), (tokenPtr)+1, (tokenPtr)->numComponents, \
|
||||
(envPtr))
|
||||
#define BODY(tokenPtr, word) \
|
||||
SetLineInformation((word)); \
|
||||
TclCompileCmdWord(interp, (tokenPtr)+1, (tokenPtr)->numComponents, \
|
||||
envPtr)
|
||||
|
||||
/*
|
||||
* Convenience macro for use when compiling tokens to be pushed. The ANSI C
|
||||
@@ -1515,13 +1519,10 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
|
||||
#define CompileWord(envPtr, tokenPtr, interp, word) \
|
||||
if ((tokenPtr)->type == TCL_TOKEN_SIMPLE_WORD) { \
|
||||
TclEmitPush(TclRegisterNewLiteral((envPtr), (tokenPtr)[1].start, \
|
||||
(tokenPtr)[1].size), (envPtr)); \
|
||||
PushLiteral((envPtr), (tokenPtr)[1].start, (tokenPtr)[1].size); \
|
||||
} else { \
|
||||
envPtr->line = mapPtr->loc[eclIndex].line[word]; \
|
||||
envPtr->clNext = mapPtr->loc[eclIndex].next[word]; \
|
||||
TclCompileTokens((interp), (tokenPtr)+1, (tokenPtr)->numComponents, \
|
||||
(envPtr)); \
|
||||
SetLineInformation((word)); \
|
||||
CompileTokens((envPtr), (tokenPtr), (interp)); \
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1542,9 +1543,8 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
envPtr->clNext = mapPtr->loc[eclIndex].next[(word)]
|
||||
|
||||
#define PushVarNameWord(i,v,e,f,l,sc,word) \
|
||||
TclPushVarName(i,v,e,f,l,sc, \
|
||||
mapPtr->loc[eclIndex].line[(word)], \
|
||||
mapPtr->loc[eclIndex].next[(word)])
|
||||
SetLineInformation(word); \
|
||||
TclPushVarName(i,v,e,f,l,sc)
|
||||
|
||||
/*
|
||||
* Often want to issue one of two versions of an instruction based on whether
|
||||
|
||||
+62
-51
@@ -26,14 +26,15 @@
|
||||
#define ASSOC_KEY "tclPackageAboutDict"
|
||||
|
||||
/*
|
||||
* A ClientData struct for the QueryConfig command. Store the two bits
|
||||
* A ClientData struct for the QueryConfig command. Store the three bits
|
||||
* of data we need; the package name for which we store a config dict,
|
||||
* and the (Tcl_Interp *) in which it is stored.
|
||||
* the (Tcl_Interp *) in which it is stored, and the encoding.
|
||||
*/
|
||||
|
||||
typedef struct QCCD {
|
||||
Tcl_Obj *pkg;
|
||||
Tcl_Interp *interp;
|
||||
char *encoding;
|
||||
} QCCD;
|
||||
|
||||
/*
|
||||
@@ -75,22 +76,28 @@ Tcl_RegisterConfig(
|
||||
const char *valEncoding) /* Name of the encoding used to store the
|
||||
* configuration values, ASCII, thus UTF-8. */
|
||||
{
|
||||
Tcl_Obj *pDB, *pkgDict;
|
||||
Tcl_DString cmdName;
|
||||
const Tcl_Config *cfg;
|
||||
Tcl_Encoding venc = Tcl_GetEncoding(NULL, valEncoding);
|
||||
QCCD *cdPtr = ckalloc(sizeof(QCCD));
|
||||
|
||||
cdPtr->interp = interp;
|
||||
if (valEncoding) {
|
||||
cdPtr->encoding = ckalloc(strlen(valEncoding)+1);
|
||||
strcpy(cdPtr->encoding, valEncoding);
|
||||
} else {
|
||||
cdPtr->encoding = NULL;
|
||||
}
|
||||
cdPtr->pkg = Tcl_NewStringObj(pkgName, -1);
|
||||
|
||||
/*
|
||||
* Phase I: Adding the provided information to the internal database of
|
||||
* package meta data. Only if we have an ok encoding.
|
||||
* package meta data.
|
||||
*
|
||||
* Phase II: Create a command for querying this database, specific to the
|
||||
* package registerting its configuration. This is the approved interface
|
||||
* package registering its configuration. This is the approved interface
|
||||
* in TIP 59. In the future a more general interface should be done, as
|
||||
* followup to TIP 59. Simply because our database is now general across
|
||||
* follow-up to TIP 59. Simply because our database is now general across
|
||||
* packages, and not a structure tied to one package.
|
||||
*
|
||||
* Note, the created command will have a reference through its clientdata.
|
||||
@@ -103,52 +110,36 @@ Tcl_RegisterConfig(
|
||||
* dictionaries visible at Tcl level. I.e. they are not filled
|
||||
*/
|
||||
|
||||
if (venc != NULL) {
|
||||
Tcl_Obj *pkgDict, *pDB = GetConfigDict(interp);
|
||||
pDB = GetConfigDict(interp);
|
||||
|
||||
/*
|
||||
* Retrieve package specific configuration...
|
||||
*/
|
||||
/*
|
||||
* Retrieve package specific configuration...
|
||||
*/
|
||||
|
||||
if (Tcl_DictObjGet(interp, pDB, cdPtr->pkg, &pkgDict) != TCL_OK
|
||||
|| (pkgDict == NULL)) {
|
||||
pkgDict = Tcl_NewDictObj();
|
||||
} else if (Tcl_IsShared(pkgDict)) {
|
||||
pkgDict = Tcl_DuplicateObj(pkgDict);
|
||||
}
|
||||
|
||||
/*
|
||||
* Extend the package configuration...
|
||||
*/
|
||||
|
||||
for (cfg=configuration ; cfg->key!=NULL && cfg->key[0]!='\0' ; cfg++) {
|
||||
Tcl_DString conv;
|
||||
const char *convValue =
|
||||
Tcl_ExternalToUtfDString(venc, cfg->value, -1, &conv);
|
||||
|
||||
/*
|
||||
* We know that the keys are in ASCII/UTF-8, so for them is no
|
||||
* conversion required.
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(interp, pkgDict, Tcl_NewStringObj(cfg->key, -1),
|
||||
Tcl_NewStringObj(convValue, -1));
|
||||
Tcl_DStringFree(&conv);
|
||||
}
|
||||
|
||||
/*
|
||||
* We're now done with the encoding, so drop it.
|
||||
*/
|
||||
|
||||
Tcl_FreeEncoding(venc);
|
||||
|
||||
/*
|
||||
* Write the changes back into the overall database.
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(interp, pDB, cdPtr->pkg, pkgDict);
|
||||
if (Tcl_DictObjGet(interp, pDB, cdPtr->pkg, &pkgDict) != TCL_OK
|
||||
|| (pkgDict == NULL)) {
|
||||
pkgDict = Tcl_NewDictObj();
|
||||
} else if (Tcl_IsShared(pkgDict)) {
|
||||
pkgDict = Tcl_DuplicateObj(pkgDict);
|
||||
}
|
||||
|
||||
/*
|
||||
* Extend the package configuration...
|
||||
* We cannot assume that the encodings are initialized, therefore
|
||||
* store the value as-is in a byte array. See Bug [9b2e636361].
|
||||
*/
|
||||
|
||||
for (cfg=configuration ; cfg->key!=NULL && cfg->key[0]!='\0' ; cfg++) {
|
||||
Tcl_DictObjPut(interp, pkgDict, Tcl_NewStringObj(cfg->key, -1),
|
||||
Tcl_NewByteArrayObj((unsigned char *)cfg->value, strlen(cfg->value)));
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the changes back into the overall database.
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(interp, pDB, cdPtr->pkg, pkgDict);
|
||||
|
||||
/*
|
||||
* Now create the interface command for retrieval of the package
|
||||
* information.
|
||||
@@ -218,6 +209,9 @@ QueryConfigObjCmd(
|
||||
enum subcmds {
|
||||
CFG_GET, CFG_LIST
|
||||
};
|
||||
Tcl_DString conv;
|
||||
Tcl_Encoding venc = NULL;
|
||||
const char *value;
|
||||
|
||||
if ((objc < 2) || (objc > 3)) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?arg?");
|
||||
@@ -257,7 +251,21 @@ QueryConfigObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
Tcl_SetObjResult(interp, val);
|
||||
if (cdPtr->encoding) {
|
||||
venc = Tcl_GetEncoding(interp, cdPtr->encoding);
|
||||
if (!venc) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Value is stored as-is in a byte array, see Bug [9b2e636361],
|
||||
* so we have to decode it first.
|
||||
*/
|
||||
value = (const char *) Tcl_GetByteArrayFromObj(val, &n);
|
||||
value = Tcl_ExternalToUtfDString(venc, value, n, &conv);
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(value,
|
||||
Tcl_DStringLength(&conv)));
|
||||
Tcl_DStringFree(&conv);
|
||||
return TCL_OK;
|
||||
|
||||
case CFG_LIST:
|
||||
@@ -324,7 +332,10 @@ QueryConfigDelete(
|
||||
|
||||
Tcl_DictObjRemove(NULL, pDB, pkgName);
|
||||
Tcl_DecrRefCount(pkgName);
|
||||
ckfree(cdPtr);
|
||||
if (cdPtr->encoding) {
|
||||
ckfree((char *)cdPtr->encoding);
|
||||
}
|
||||
ckfree((char *)cdPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -366,7 +377,7 @@ GetConfigDict(
|
||||
*
|
||||
* This function is associated with the "Package About dict" assoc data
|
||||
* for an interpreter; it is invoked when the interpreter is deleted in
|
||||
* order to free the information assoicated with any pending error
|
||||
* order to free the information associated with any pending error
|
||||
* reports.
|
||||
*
|
||||
* Results:
|
||||
|
||||
+1
-1
@@ -2686,7 +2686,7 @@ TclDatelex(
|
||||
|
||||
location->first_column = yyInput - info->dateStart;
|
||||
for ( ; ; ) {
|
||||
while (isspace(UCHAR(*yyInput))) {
|
||||
while (TclIsSpaceProc(*yyInput)) {
|
||||
yyInput++;
|
||||
}
|
||||
|
||||
|
||||
+69
-126
@@ -35,9 +35,6 @@ static void MakeCachedEnsembleCommand(Tcl_Obj *objPtr,
|
||||
static void FreeEnsembleCmdRep(Tcl_Obj *objPtr);
|
||||
static void DupEnsembleCmdRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr);
|
||||
static void StringOfEnsembleCmdRep(Tcl_Obj *objPtr);
|
||||
static int CompileToCompiledCommand(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, int depth, Command *cmdPtr,
|
||||
CompileEnv *envPtr);
|
||||
static void CompileToInvokedCommand(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Tcl_Obj *replacements,
|
||||
Command *cmdPtr, CompileEnv *envPtr);
|
||||
@@ -88,16 +85,6 @@ const Tcl_ObjType tclEnsembleCmdType = {
|
||||
NULL /* setFromAnyProc */
|
||||
};
|
||||
|
||||
/*
|
||||
* Copied from tclCompCmds.c
|
||||
*/
|
||||
|
||||
#define DefineLineInformation \
|
||||
ExtCmdLoc *mapPtr = envPtr->extCmdMapPtr; \
|
||||
int eclIndex = mapPtr->nuloc - 1
|
||||
#define SetLineInformation(word) \
|
||||
envPtr->line = mapPtr->loc[eclIndex].line[(word)]; \
|
||||
envPtr->clNext = mapPtr->loc[eclIndex].next[(word)]
|
||||
|
||||
static inline Tcl_Obj *
|
||||
NewNsObj(
|
||||
@@ -1537,6 +1524,14 @@ TclMakeEnsemble(
|
||||
cmdName = nameParts[nameCount - 1];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Switch on compilation always for core ensembles now that we can do
|
||||
* nice bytecode things with them. Do it now. Waiting until later will
|
||||
* just cause pointless epoch bumps.
|
||||
*/
|
||||
|
||||
ensembleFlags |= ENSEMBLE_COMPILE;
|
||||
ensemble = Tcl_CreateEnsemble(interp, cmdName, ns, ensembleFlags);
|
||||
|
||||
/*
|
||||
@@ -1588,14 +1583,6 @@ TclMakeEnsemble(
|
||||
}
|
||||
}
|
||||
Tcl_SetEnsembleMappingDict(interp, ensemble, mapDict);
|
||||
|
||||
/*
|
||||
* Switch on compilation always for core ensembles now that we can do
|
||||
* nice bytecode things with them.
|
||||
*/
|
||||
|
||||
Tcl_SetEnsembleFlags(interp, ensemble,
|
||||
ensembleFlags | ENSEMBLE_COMPILE);
|
||||
}
|
||||
|
||||
Tcl_DStringFree(&buf);
|
||||
@@ -3004,8 +2991,8 @@ TclCompileEnsemble(
|
||||
*/
|
||||
|
||||
invokeAnyway = 1;
|
||||
if (CompileToCompiledCommand(interp, parsePtr, depth, cmdPtr,
|
||||
envPtr) == TCL_OK) {
|
||||
if (TCL_OK == TclAttemptCompileProc(interp, parsePtr, depth, cmdPtr,
|
||||
envPtr)) {
|
||||
ourResult = TCL_OK;
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -3039,95 +3026,88 @@ TclCompileEnsemble(
|
||||
return ourResult;
|
||||
}
|
||||
|
||||
/*
|
||||
* How to compile a subcommand using its own command compiler. To do that, we
|
||||
* have to perform some trickery to rewrite the arguments, as compilers *must*
|
||||
* have parse tokens that refer to addresses in the original script.
|
||||
*/
|
||||
|
||||
static int
|
||||
CompileToCompiledCommand(
|
||||
int
|
||||
TclAttemptCompileProc(
|
||||
Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr,
|
||||
int depth,
|
||||
Command *cmdPtr,
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Parse synthetic;
|
||||
Tcl_Token *tokenPtr;
|
||||
int result, i;
|
||||
int savedNumCmds = envPtr->numCommands;
|
||||
Tcl_Token *saveTokenPtr = parsePtr->tokenPtr;
|
||||
int savedStackDepth = envPtr->currStackDepth;
|
||||
unsigned savedCodeNext = envPtr->codeNext - envPtr->codeStart;
|
||||
DefineLineInformation;
|
||||
|
||||
if (cmdPtr->compileProc == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
TclParseInit(interp, NULL, 0, &synthetic);
|
||||
synthetic.numWords = parsePtr->numWords - depth + 1;
|
||||
TclGrowParseTokenArray(&synthetic, 2);
|
||||
synthetic.numTokens = 2;
|
||||
|
||||
/*
|
||||
* Now we have the space to work in, install something rewritten. The
|
||||
* first word will "officially" be the bytes of the structured ensemble
|
||||
* name. That's technically wrong, but nobody will care; we just need
|
||||
* *something* here...
|
||||
* Advance parsePtr->tokenPtr so that it points at the last subcommand.
|
||||
* This will be wrong, but it will not matter, and it will put the
|
||||
* tokens for the arguments in the right place without the needed to
|
||||
* allocate a synthetic Tcl_Parse struct, or copy tokens around.
|
||||
*/
|
||||
|
||||
synthetic.tokenPtr[0].type = TCL_TOKEN_SIMPLE_WORD;
|
||||
synthetic.tokenPtr[0].start = parsePtr->tokenPtr[0].start;
|
||||
synthetic.tokenPtr[0].numComponents = 1;
|
||||
synthetic.tokenPtr[1].type = TCL_TOKEN_TEXT;
|
||||
synthetic.tokenPtr[1].start = parsePtr->tokenPtr[0].start;
|
||||
synthetic.tokenPtr[1].numComponents = 0;
|
||||
for (i=0,tokenPtr=parsePtr->tokenPtr ; i<depth ; i++) {
|
||||
int sclen = (tokenPtr->start - synthetic.tokenPtr[0].start)
|
||||
+ tokenPtr->size;
|
||||
|
||||
synthetic.tokenPtr[0].size = sclen;
|
||||
synthetic.tokenPtr[1].size = sclen;
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
for (i = 0; i < depth - 1; i++) {
|
||||
parsePtr->tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
}
|
||||
parsePtr->numWords -= (depth - 1);
|
||||
|
||||
/*
|
||||
* Copy over the real argument tokens.
|
||||
* Shift the line information arrays to account for different word
|
||||
* index values.
|
||||
*/
|
||||
|
||||
for (i=1; i<synthetic.numWords; i++) {
|
||||
int toCopy;
|
||||
|
||||
toCopy = tokenPtr->numComponents + 1;
|
||||
TclGrowParseTokenArray(&synthetic, toCopy);
|
||||
memcpy(synthetic.tokenPtr + synthetic.numTokens, tokenPtr,
|
||||
sizeof(Tcl_Token) * toCopy);
|
||||
synthetic.numTokens += toCopy;
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
mapPtr->loc[eclIndex].line += (depth - 1);
|
||||
mapPtr->loc[eclIndex].next += (depth - 1);
|
||||
|
||||
/*
|
||||
* Hand off compilation to the subcommand compiler. At last!
|
||||
*/
|
||||
|
||||
result = cmdPtr->compileProc(interp, &synthetic, cmdPtr, envPtr);
|
||||
result = cmdPtr->compileProc(interp, parsePtr, cmdPtr, envPtr);
|
||||
|
||||
/*
|
||||
* If our target fails to compile, revert the number of commands and the
|
||||
* pointer to the place to issue the next instruction. [Bug 3600328]
|
||||
* Undo the shift.
|
||||
*/
|
||||
|
||||
mapPtr->loc[eclIndex].line -= (depth - 1);
|
||||
mapPtr->loc[eclIndex].next -= (depth - 1);
|
||||
|
||||
parsePtr->numWords += (depth - 1);
|
||||
parsePtr->tokenPtr = saveTokenPtr;
|
||||
|
||||
/*
|
||||
* If our target failed to compile, revert any data from failed partial
|
||||
* compiles. Note that envPtr->numCommands need not be checked because
|
||||
* we avoid compiling subcommands that recursively call TclCompileScript().
|
||||
*/
|
||||
|
||||
if (result != TCL_OK) {
|
||||
envPtr->numCommands = savedNumCmds;
|
||||
envPtr->currStackDepth = savedStackDepth;
|
||||
envPtr->codeNext = envPtr->codeStart + savedCodeNext;
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
} else {
|
||||
/*
|
||||
* Confirm that the command compiler generated a single value on
|
||||
* the stack as its result. This is only done in debugging mode,
|
||||
* as it *should* be correct and normal users have no reasonable
|
||||
* way to fix it anyway.
|
||||
*/
|
||||
|
||||
int diff = envPtr->currStackDepth - savedStackDepth;
|
||||
|
||||
if (diff != 1) {
|
||||
Tcl_Panic("bad stack adjustment when compiling"
|
||||
" %.*s (was %d instead of 1)", parsePtr->tokenPtr->size,
|
||||
parsePtr->tokenPtr->start, diff);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up if necessary.
|
||||
*/
|
||||
|
||||
Tcl_FreeParse(&synthetic);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3157,11 +3137,16 @@ CompileToInvokedCommand(
|
||||
*/
|
||||
|
||||
Tcl_ListObjGetElements(NULL, replacements, &numWords, &words);
|
||||
for (i=0,tokPtr=parsePtr->tokenPtr ; i<parsePtr->numWords ; i++) {
|
||||
for (i = 0, tokPtr = parsePtr->tokenPtr; i < parsePtr->numWords;
|
||||
i++, tokPtr = TokenAfter(tokPtr)) {
|
||||
if (i > 0 && i < numWords+1) {
|
||||
bytes = Tcl_GetStringFromObj(words[i-1], &length);
|
||||
PushLiteral(envPtr, bytes, length);
|
||||
} else if (tokPtr->type == TCL_TOKEN_SIMPLE_WORD) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SetLineInformation(i);
|
||||
if (tokPtr->type == TCL_TOKEN_SIMPLE_WORD) {
|
||||
int literal = TclRegisterNewLiteral(envPtr,
|
||||
tokPtr[1].start, tokPtr[1].size);
|
||||
|
||||
@@ -3169,16 +3154,12 @@ CompileToInvokedCommand(
|
||||
TclContinuationsEnterDerived(
|
||||
TclFetchLiteral(envPtr, literal),
|
||||
tokPtr[1].start - envPtr->source,
|
||||
mapPtr->loc[eclIndex].next[i]);
|
||||
envPtr->clNext);
|
||||
}
|
||||
TclEmitPush(literal, envPtr);
|
||||
} else {
|
||||
if (envPtr->clNext) {
|
||||
SetLineInformation(i);
|
||||
}
|
||||
CompileTokens(envPtr, tokPtr, interp);
|
||||
}
|
||||
tokPtr = TokenAfter(tokPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3224,51 +3205,13 @@ CompileBasicNArgCommand(
|
||||
* compiled. */
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Token *tokenPtr;
|
||||
Tcl_Obj *objPtr;
|
||||
char *bytes;
|
||||
int length, i, literal;
|
||||
DefineLineInformation;
|
||||
Tcl_Obj *objPtr = Tcl_NewObj();
|
||||
|
||||
/*
|
||||
* Push the name of the command we're actually dispatching to as part of
|
||||
* the implementation.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
|
||||
bytes = Tcl_GetStringFromObj(objPtr, &length);
|
||||
literal = TclRegisterNewCmdLiteral(envPtr, bytes, length);
|
||||
TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, literal), cmdPtr);
|
||||
TclEmitPush(literal, envPtr);
|
||||
TclDecrRefCount(objPtr);
|
||||
|
||||
/*
|
||||
* Push the words of the command.
|
||||
*/
|
||||
|
||||
tokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
for (i=1 ; i<parsePtr->numWords ; i++) {
|
||||
if (envPtr->clNext) {
|
||||
SetLineInformation(i);
|
||||
}
|
||||
if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
|
||||
PushLiteral(envPtr, tokenPtr[1].start, tokenPtr[1].size);
|
||||
} else {
|
||||
CompileTokens(envPtr, tokenPtr, interp);
|
||||
}
|
||||
tokenPtr = TokenAfter(tokenPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Do the standard dispatch.
|
||||
*/
|
||||
|
||||
if (i <= 255) {
|
||||
TclEmitInstInt1(INST_INVOKE_STK1, i, envPtr);
|
||||
} else {
|
||||
TclEmitInstInt4(INST_INVOKE_STK4, i, envPtr);
|
||||
}
|
||||
TclCompileInvocation(interp, parsePtr->tokenPtr, objPtr,
|
||||
parsePtr->numWords, envPtr);
|
||||
Tcl_DecrRefCount(objPtr);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
||||
+2
-7
@@ -1030,14 +1030,8 @@ TclInitSubsystems(void)
|
||||
|
||||
TclpInitLock();
|
||||
if (subsystemsInitialized == 0) {
|
||||
/*
|
||||
* Have to set this bit here to avoid deadlock with the routines
|
||||
* below us that call into TclInitSubsystems.
|
||||
*/
|
||||
|
||||
subsystemsInitialized = 1;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Initialize locks used by the memory allocators before anything
|
||||
* interesting happens so we can use the allocators in the
|
||||
* implementation of self-initializing locks.
|
||||
@@ -1061,6 +1055,7 @@ TclInitSubsystems(void)
|
||||
TclInitEncodingSubsystem(); /* Process wide encoding init. */
|
||||
TclpSetInterfaces();
|
||||
TclInitNamespaceSubsystem();/* Register ns obj type (mutexed). */
|
||||
subsystemsInitialized = 1;
|
||||
}
|
||||
TclpInitUnlock();
|
||||
}
|
||||
|
||||
+106
-61
@@ -202,6 +202,9 @@ typedef struct TEBCdata {
|
||||
|
||||
#define PUSH_TAUX_OBJ(objPtr) \
|
||||
do { \
|
||||
if (auxObjList) { \
|
||||
objPtr->length += auxObjList->length; \
|
||||
} \
|
||||
objPtr->internalRep.ptrAndLongRep.ptr = auxObjList; \
|
||||
auxObjList = objPtr; \
|
||||
} while (0)
|
||||
@@ -718,7 +721,7 @@ static ExceptionRange * GetExceptRangeForPc(const unsigned char *pc,
|
||||
int catchOnly, ByteCode *codePtr);
|
||||
static const char * GetSrcInfoForPc(const unsigned char *pc,
|
||||
ByteCode *codePtr, int *lengthPtr,
|
||||
const unsigned char **pcBeg);
|
||||
const unsigned char **pcBeg, int *cmdIdxPtr);
|
||||
static Tcl_Obj ** GrowEvaluationStack(ExecEnv *eePtr, int growth,
|
||||
int move);
|
||||
static void IllegalExprOperandType(Tcl_Interp *interp,
|
||||
@@ -876,6 +879,7 @@ TclCreateExecEnv(
|
||||
eePtr->interp = interp;
|
||||
eePtr->callbackPtr = NULL;
|
||||
eePtr->corPtr = NULL;
|
||||
eePtr->stackLevel = 0;
|
||||
eePtr->rewind = 0;
|
||||
|
||||
esPtr->prevPtr = NULL;
|
||||
@@ -1423,17 +1427,12 @@ Tcl_NRExprObj(
|
||||
Tcl_Obj *resultPtr)
|
||||
{
|
||||
ByteCode *codePtr;
|
||||
Tcl_InterpState state = Tcl_SaveInterpState(interp, TCL_OK);
|
||||
|
||||
/* TODO: consider saving whole state? */
|
||||
Tcl_Obj *saveObjPtr = Tcl_GetObjResult(interp);
|
||||
|
||||
Tcl_IncrRefCount(saveObjPtr);
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
codePtr = CompileExprObj(interp, objPtr);
|
||||
|
||||
/* TODO: Confirm reset not required? */
|
||||
/*Tcl_ResetResult(interp);*/
|
||||
Tcl_NRAddCallback(interp, ExprObjCallback, saveObjPtr, resultPtr,
|
||||
Tcl_NRAddCallback(interp, ExprObjCallback, state, resultPtr,
|
||||
NULL, NULL);
|
||||
return TclNRExecuteByteCode(interp, codePtr);
|
||||
}
|
||||
@@ -1444,14 +1443,15 @@ ExprObjCallback(
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
Tcl_Obj *saveObjPtr = data[0];
|
||||
Tcl_InterpState state = data[0];
|
||||
Tcl_Obj *resultPtr = data[1];
|
||||
|
||||
if (result == TCL_OK) {
|
||||
TclSetDuplicateObj(resultPtr, Tcl_GetObjResult(interp));
|
||||
Tcl_SetObjResult(interp, saveObjPtr);
|
||||
(void) Tcl_RestoreInterpState(interp, state);
|
||||
} else {
|
||||
Tcl_DiscardInterpState(state);
|
||||
}
|
||||
TclDecrRefCount(saveObjPtr);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1999,7 +1999,6 @@ TclNRExecuteByteCode(
|
||||
bcFramePtr->type = ((codePtr->flags & TCL_BYTECODE_PRECOMPILED)
|
||||
? TCL_LOCATION_PREBC : TCL_LOCATION_BC);
|
||||
bcFramePtr->level = (iPtr->cmdFramePtr ? iPtr->cmdFramePtr->level+1 : 1);
|
||||
bcFramePtr->numLevels = iPtr->numLevels;
|
||||
bcFramePtr->framePtr = iPtr->framePtr;
|
||||
bcFramePtr->nextPtr = iPtr->cmdFramePtr;
|
||||
bcFramePtr->nline = 0;
|
||||
@@ -2007,8 +2006,9 @@ TclNRExecuteByteCode(
|
||||
bcFramePtr->litarg = NULL;
|
||||
bcFramePtr->data.tebc.codePtr = codePtr;
|
||||
bcFramePtr->data.tebc.pc = NULL;
|
||||
bcFramePtr->cmd.str.cmd = NULL;
|
||||
bcFramePtr->cmd.str.len = 0;
|
||||
bcFramePtr->cmdObj = NULL;
|
||||
bcFramePtr->cmd = NULL;
|
||||
bcFramePtr->len = 0;
|
||||
|
||||
#ifdef TCL_COMPILE_STATS
|
||||
iPtr->stats.numExecutions++;
|
||||
@@ -2131,6 +2131,11 @@ TEBCresume(
|
||||
result = TCL_ERROR;
|
||||
}
|
||||
NRE_ASSERT(iPtr->cmdFramePtr == bcFramePtr);
|
||||
if (bcFramePtr->cmdObj) {
|
||||
Tcl_DecrRefCount(bcFramePtr->cmdObj);
|
||||
bcFramePtr->cmdObj = NULL;
|
||||
bcFramePtr->cmd = NULL;
|
||||
}
|
||||
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
|
||||
if (iPtr->flags & INTERP_DEBUG_FRAME) {
|
||||
TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);
|
||||
@@ -2320,7 +2325,7 @@ TEBCresume(
|
||||
goto instLoadScalar1;
|
||||
} else if (inst == INST_PUSH1) {
|
||||
PUSH_OBJECT(codePtr->objArrayPtr[TclGetUInt1AtPtr(pc+1)]);
|
||||
TRACE_WITH_OBJ(("%u => ", TclGetInt1AtPtr(pc+1)), OBJ_AT_TOS);
|
||||
TRACE_WITH_OBJ(("%u => ", TclGetUInt1AtPtr(pc+1)), OBJ_AT_TOS);
|
||||
inst = *(pc += 2);
|
||||
goto peepholeStart;
|
||||
} else if (inst == INST_START_CMD) {
|
||||
@@ -2362,7 +2367,7 @@ TEBCresume(
|
||||
TRACE(("%u %u => ", code, level));
|
||||
result = TclProcessReturn(interp, code, level, OBJ_AT_TOS);
|
||||
if (result == TCL_OK) {
|
||||
TRACE_APPEND(("continuing to next instruction (result=\"%.30s\")",
|
||||
TRACE_APPEND(("continuing to next instruction (result=\"%.30s\")\n",
|
||||
O2S(objResultPtr)));
|
||||
NEXT_INST_F(9, 1, 0);
|
||||
}
|
||||
@@ -2371,6 +2376,7 @@ TEBCresume(
|
||||
iPtr->flags &= ~ERR_ALREADY_LOGGED;
|
||||
}
|
||||
cleanup = 2;
|
||||
TRACE_APPEND(("\n"));
|
||||
goto processExceptionReturn;
|
||||
}
|
||||
|
||||
@@ -2381,7 +2387,7 @@ TEBCresume(
|
||||
if (result == TCL_OK) {
|
||||
Tcl_DecrRefCount(OBJ_AT_TOS);
|
||||
OBJ_AT_TOS = objResultPtr;
|
||||
TRACE_APPEND(("continuing to next instruction (result=\"%.30s\")",
|
||||
TRACE_APPEND(("continuing to next instruction (result=\"%.30s\")\n",
|
||||
O2S(objResultPtr)));
|
||||
NEXT_INST_F(1, 0, 0);
|
||||
} else if (result == TCL_ERROR) {
|
||||
@@ -2401,6 +2407,7 @@ TEBCresume(
|
||||
Tcl_SetObjResult(interp, objResultPtr);
|
||||
}
|
||||
cleanup = 1;
|
||||
TRACE_APPEND(("\n"));
|
||||
goto processExceptionReturn;
|
||||
|
||||
case INST_YIELD: {
|
||||
@@ -2430,8 +2437,11 @@ TEBCresume(
|
||||
iPtr->cmdFramePtr = bcFramePtr;
|
||||
|
||||
if (iPtr->flags & INTERP_DEBUG_FRAME) {
|
||||
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
|
||||
codePtr, bcFramePtr, pc - codePtr->codeStart);
|
||||
int cmd;
|
||||
if (GetSrcInfoForPc(pc, codePtr, NULL, NULL, &cmd)) {
|
||||
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
|
||||
codePtr, bcFramePtr, cmd, pc - codePtr->codeStart);
|
||||
}
|
||||
}
|
||||
|
||||
pc++;
|
||||
@@ -2715,6 +2725,7 @@ TEBCresume(
|
||||
|
||||
TclNewObj(objPtr);
|
||||
objPtr->internalRep.ptrAndLongRep.value = CURR_DEPTH;
|
||||
objPtr->length = 0;
|
||||
PUSH_TAUX_OBJ(objPtr);
|
||||
NEXT_INST_F(1, 0, 0);
|
||||
|
||||
@@ -2759,22 +2770,27 @@ TEBCresume(
|
||||
* stack depth, as seen by the compiler.
|
||||
*/
|
||||
|
||||
length = objc + (codePtr->maxStackDepth - TclGetInt4AtPtr(pc+1));
|
||||
DECACHE_STACK_INFO();
|
||||
moved = GrowEvaluationStack(iPtr->execEnvPtr, length, 1)
|
||||
- (Tcl_Obj **) TD;
|
||||
if (moved) {
|
||||
/*
|
||||
* Change the global data to point to the new stack: move the
|
||||
* TEBCdataPtr TD, recompute the position of every other
|
||||
* stack-allocated parameter, update the stack pointers.
|
||||
*/
|
||||
auxObjList->length += objc - 1;
|
||||
if ((objc > 1) && (auxObjList->length > 0)) {
|
||||
length = auxObjList->length /* Total expansion room we need */
|
||||
+ codePtr->maxStackDepth /* Beyond the original max */
|
||||
- CURR_DEPTH; /* Relative to where we are */
|
||||
DECACHE_STACK_INFO();
|
||||
moved = GrowEvaluationStack(iPtr->execEnvPtr, length, 1)
|
||||
- (Tcl_Obj **) TD;
|
||||
if (moved) {
|
||||
/*
|
||||
* Change the global data to point to the new stack: move the
|
||||
* TEBCdataPtr TD, recompute the position of every other
|
||||
* stack-allocated parameter, update the stack pointers.
|
||||
*/
|
||||
|
||||
esPtr = iPtr->execEnvPtr->execStackPtr;
|
||||
TD = (TEBCdata *) (((Tcl_Obj **)TD) + moved);
|
||||
esPtr = iPtr->execEnvPtr->execStackPtr;
|
||||
TD = (TEBCdata *) (((Tcl_Obj **)TD) + moved);
|
||||
|
||||
catchTop += moved;
|
||||
tosPtr += moved;
|
||||
catchTop += moved;
|
||||
tosPtr += moved;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2878,8 +2894,11 @@ TEBCresume(
|
||||
iPtr->cmdFramePtr = bcFramePtr;
|
||||
|
||||
if (iPtr->flags & INTERP_DEBUG_FRAME) {
|
||||
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
|
||||
codePtr, bcFramePtr, pc - codePtr->codeStart);
|
||||
int cmd;
|
||||
if (GetSrcInfoForPc(pc, codePtr, NULL, NULL, &cmd)) {
|
||||
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
|
||||
codePtr, bcFramePtr, cmd, pc - codePtr->codeStart);
|
||||
}
|
||||
}
|
||||
|
||||
DECACHE_STACK_INFO();
|
||||
@@ -2887,7 +2906,7 @@ TEBCresume(
|
||||
pc += pcAdjustment;
|
||||
TEBC_YIELD();
|
||||
return TclNREvalObjv(interp, objc, objv,
|
||||
TCL_EVAL_NOERR, NULL);
|
||||
TCL_EVAL_NOERR | TCL_EVAL_SOURCE_IN_FRAME, NULL);
|
||||
|
||||
#if TCL_SUPPORT_84_BYTECODE
|
||||
case INST_CALL_BUILTIN_FUNC1:
|
||||
@@ -3024,8 +3043,11 @@ TEBCresume(
|
||||
bcFramePtr->data.tebc.pc = (char *) pc;
|
||||
iPtr->cmdFramePtr = bcFramePtr;
|
||||
if (iPtr->flags & INTERP_DEBUG_FRAME) {
|
||||
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
|
||||
codePtr, bcFramePtr, pc - codePtr->codeStart);
|
||||
int cmd;
|
||||
if (GetSrcInfoForPc(pc, codePtr, NULL, NULL, &cmd)) {
|
||||
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
|
||||
codePtr, bcFramePtr, cmd, pc - codePtr->codeStart);
|
||||
}
|
||||
}
|
||||
iPtr->ensembleRewrite.sourceObjs = objv;
|
||||
iPtr->ensembleRewrite.numRemovedObjs = opnd;
|
||||
@@ -3662,7 +3684,7 @@ TEBCresume(
|
||||
arrayPtr = NULL;
|
||||
part1Ptr = part2Ptr = NULL;
|
||||
cleanup = 0;
|
||||
TRACE(("%u %ld => ", opnd, increment));
|
||||
TRACE(("%u %s => ", opnd, Tcl_GetString(incrPtr)));
|
||||
|
||||
doIncrVar:
|
||||
if (TclIsVarDirectModifyable2(varPtr, arrayPtr)) {
|
||||
@@ -4227,7 +4249,7 @@ TEBCresume(
|
||||
} else {
|
||||
TRACE(("%d => %.20s false, new pc %u\n", jmpOffset[0],
|
||||
O2S(valuePtr),
|
||||
(unsigned)(pc + jmpOffset[1] - codePtr->codeStart)));
|
||||
(unsigned)(pc + jmpOffset[0] - codePtr->codeStart)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -6610,7 +6632,7 @@ TEBCresume(
|
||||
}
|
||||
#endif
|
||||
|
||||
TRACE_APPEND(("\"%.30s\" \"%.30s\" %d",
|
||||
TRACE_APPEND(("\"%.30s\" \"%.30s\" %d\n",
|
||||
O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), done));
|
||||
objResultPtr = TCONST(done);
|
||||
/* TODO: consider opt like INST_FOREACH_STEP4 */
|
||||
@@ -6624,7 +6646,7 @@ TEBCresume(
|
||||
while (TclIsVarLink(varPtr)) {
|
||||
varPtr = varPtr->value.linkPtr;
|
||||
}
|
||||
TRACE(("%u => ", opnd));
|
||||
TRACE(("%u => \n", opnd));
|
||||
if (TclIsVarDirectReadable(varPtr)) {
|
||||
dictPtr = varPtr->value.objPtr;
|
||||
} else {
|
||||
@@ -6753,6 +6775,7 @@ TEBCresume(
|
||||
O2S(dictPtr), O2S(listPtr)), Tcl_GetObjResult(interp));
|
||||
goto gotError;
|
||||
}
|
||||
TRACE((" => "));
|
||||
TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
|
||||
NEXT_INST_F(1, 2, 1);
|
||||
|
||||
@@ -6959,7 +6982,7 @@ TEBCresume(
|
||||
if ((result == TCL_ERROR) && !(iPtr->flags & ERR_ALREADY_LOGGED)) {
|
||||
const unsigned char *pcBeg;
|
||||
|
||||
bytes = GetSrcInfoForPc(pc, codePtr, &length, &pcBeg);
|
||||
bytes = GetSrcInfoForPc(pc, codePtr, &length, &pcBeg, NULL);
|
||||
DECACHE_STACK_INFO();
|
||||
TclLogCommandInfo(interp, codePtr->source, bytes,
|
||||
bytes ? length : 0, pcBeg, tosPtr);
|
||||
@@ -7141,7 +7164,7 @@ TEBCresume(
|
||||
}
|
||||
|
||||
codePtr->flags |= TCL_BYTECODE_RECOMPILE;
|
||||
bytes = GetSrcInfoForPc(pc, codePtr, &length, NULL);
|
||||
bytes = GetSrcInfoForPc(pc, codePtr, &length, NULL, NULL);
|
||||
opnd = TclGetUInt4AtPtr(pc+1);
|
||||
pc += (opnd-1);
|
||||
PUSH_OBJECT(Tcl_NewStringObj(bytes, length));
|
||||
@@ -8634,7 +8657,7 @@ ValidatePcAndStackTop(
|
||||
if (checkStack &&
|
||||
((stackTop < 0) || (stackTop > stackUpperBound))) {
|
||||
int numChars;
|
||||
const char *cmd = GetSrcInfoForPc(pc, codePtr, &numChars, NULL);
|
||||
const char *cmd = GetSrcInfoForPc(pc, codePtr, &numChars, NULL, NULL);
|
||||
|
||||
fprintf(stderr, "\nBad stack top %d at pc %u in TclNRExecuteByteCode (min 0, max %i)",
|
||||
stackTop, relativePc, stackUpperBound);
|
||||
@@ -8718,7 +8741,7 @@ IllegalExprOperandType(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclGetSrcInfoForPc, GetSrcInfoForPc, TclGetSrcInfoForCmd --
|
||||
* TclGetSrcInfoForPc, GetSrcInfoForPc, TclGetSourceFromFrame --
|
||||
*
|
||||
* Given a program counter value, finds the closest command in the
|
||||
* bytecode code unit's CmdLocation array and returns information about
|
||||
@@ -8739,16 +8762,26 @@ IllegalExprOperandType(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const char *
|
||||
TclGetSrcInfoForCmd(
|
||||
Interp *iPtr,
|
||||
int *lenPtr)
|
||||
Tcl_Obj *
|
||||
TclGetSourceFromFrame(
|
||||
CmdFrame *cfPtr,
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
CmdFrame *cfPtr = iPtr->cmdFramePtr;
|
||||
ByteCode *codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
|
||||
if (cfPtr == NULL) {
|
||||
return Tcl_NewListObj(objc, objv);
|
||||
}
|
||||
if (cfPtr->cmdObj == NULL) {
|
||||
if (cfPtr->cmd == NULL) {
|
||||
ByteCode *codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
|
||||
|
||||
return GetSrcInfoForPc((unsigned char *) cfPtr->data.tebc.pc,
|
||||
codePtr, lenPtr, NULL);
|
||||
cfPtr->cmd = GetSrcInfoForPc((unsigned char *)
|
||||
cfPtr->data.tebc.pc, codePtr, &cfPtr->len, NULL, NULL);
|
||||
}
|
||||
cfPtr->cmdObj = Tcl_NewStringObj(cfPtr->cmd, cfPtr->len);
|
||||
Tcl_IncrRefCount(cfPtr->cmdObj);
|
||||
}
|
||||
return cfPtr->cmdObj;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -8757,13 +8790,16 @@ TclGetSrcInfoForPc(
|
||||
{
|
||||
ByteCode *codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
|
||||
|
||||
if (cfPtr->cmd.str.cmd == NULL) {
|
||||
cfPtr->cmd.str.cmd = GetSrcInfoForPc(
|
||||
assert(cfPtr->type == TCL_LOCATION_BC);
|
||||
|
||||
if (cfPtr->cmd == NULL) {
|
||||
|
||||
cfPtr->cmd = GetSrcInfoForPc(
|
||||
(unsigned char *) cfPtr->data.tebc.pc, codePtr,
|
||||
&cfPtr->cmd.str.len, NULL);
|
||||
&cfPtr->len, NULL, NULL);
|
||||
}
|
||||
|
||||
if (cfPtr->cmd.str.cmd != NULL) {
|
||||
if (cfPtr->cmd != NULL) {
|
||||
/*
|
||||
* We now have the command. We can get the srcOffset back and from
|
||||
* there find the list of word locations for this command.
|
||||
@@ -8780,7 +8816,7 @@ TclGetSrcInfoForPc(
|
||||
return;
|
||||
}
|
||||
|
||||
srcOffset = cfPtr->cmd.str.cmd - codePtr->source;
|
||||
srcOffset = cfPtr->cmd - codePtr->source;
|
||||
eclPtr = Tcl_GetHashValue(hePtr);
|
||||
|
||||
for (i=0; i < eclPtr->nuloc; i++) {
|
||||
@@ -8820,9 +8856,12 @@ GetSrcInfoForPc(
|
||||
int *lengthPtr, /* If non-NULL, the location where the length
|
||||
* of the command's source should be stored.
|
||||
* If NULL, no length is stored. */
|
||||
const unsigned char **pcBeg)/* If non-NULL, the bytecode location
|
||||
const unsigned char **pcBeg,/* If non-NULL, the bytecode location
|
||||
* where the current instruction starts.
|
||||
* If NULL; no pointer is stored. */
|
||||
int *cmdIdxPtr) /* If non-NULL, the location where the index
|
||||
* of the command containing the pc should
|
||||
* be stored. */
|
||||
{
|
||||
register int pcOffset = (pc - codePtr->codeStart);
|
||||
int numCmds = codePtr->numCommands;
|
||||
@@ -8832,6 +8871,7 @@ GetSrcInfoForPc(
|
||||
int bestDist = INT_MAX; /* Distance of pc to best cmd's start pc. */
|
||||
int bestSrcOffset = -1; /* Initialized to avoid compiler warning. */
|
||||
int bestSrcLength = -1; /* Initialized to avoid compiler warning. */
|
||||
int bestCmdIdx = -1;
|
||||
|
||||
if ((pcOffset < 0) || (pcOffset >= codePtr->numCodeBytes)) {
|
||||
if (pcBeg != NULL) *pcBeg = NULL;
|
||||
@@ -8899,6 +8939,7 @@ GetSrcInfoForPc(
|
||||
bestDist = dist;
|
||||
bestSrcOffset = srcOffset;
|
||||
bestSrcLength = srcLen;
|
||||
bestCmdIdx = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8928,6 +8969,10 @@ GetSrcInfoForPc(
|
||||
*lengthPtr = bestSrcLength;
|
||||
}
|
||||
|
||||
if (cmdIdxPtr != NULL) {
|
||||
*cmdIdxPtr = bestCmdIdx;
|
||||
}
|
||||
|
||||
return (codePtr->source + bestSrcOffset);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -139,7 +139,7 @@ int
|
||||
TclCreateSocketAddress(
|
||||
Tcl_Interp *interp, /* Interpreter for querying
|
||||
* the desired socket family */
|
||||
struct addrinfo **addrlist, /* Socket address list */
|
||||
void **addrlist, /* Socket address list */
|
||||
const char *host, /* Host. NULL implies INADDR_ANY */
|
||||
int port, /* Port number */
|
||||
int willBind, /* Is this an address to bind() to or
|
||||
@@ -213,7 +213,7 @@ TclCreateSocketAddress(
|
||||
hints.ai_flags |= AI_PASSIVE;
|
||||
}
|
||||
|
||||
result = getaddrinfo(native, portstring, &hints, addrlist);
|
||||
result = getaddrinfo(native, portstring, &hints, (struct addrinfo **) addrlist);
|
||||
|
||||
if (host != NULL) {
|
||||
Tcl_DStringFree(&ds);
|
||||
|
||||
+38
-46
@@ -30,8 +30,7 @@
|
||||
* here, so that system-dependent personalizations for the include files only
|
||||
* have to be made in once place. This results in a few extra includes, but
|
||||
* greater modularity. The order of the three groups of #includes is
|
||||
* important. For example, stdio.h is needed by tcl.h, and the _ANSI_ARGS_
|
||||
* declaration in tcl.h is needed by stdlib.h in some configurations.
|
||||
* important. For example, stdio.h is needed by tcl.h.
|
||||
*/
|
||||
|
||||
#include "tclPort.h"
|
||||
@@ -119,6 +118,10 @@ typedef int ptrdiff_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# define vsnprintf _vsnprintf
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following procedures allow namespaces to be customized to support
|
||||
* special name resolution rules for commands/variables.
|
||||
@@ -1172,29 +1175,27 @@ typedef struct CmdFrame {
|
||||
*
|
||||
* EXECUTION CONTEXTS and usage of CmdFrame
|
||||
*
|
||||
* Field TEBC EvalEx EvalObjEx
|
||||
* ======= ==== ====== =========
|
||||
* level yes yes yes
|
||||
* type BC/PREBC SRC/EVAL EVAL_LIST
|
||||
* line0 yes yes yes
|
||||
* framePtr yes yes yes
|
||||
* ======= ==== ====== =========
|
||||
* Field TEBC EvalEx
|
||||
* ======= ==== ======
|
||||
* level yes yes
|
||||
* type BC/PREBC SRC/EVAL
|
||||
* line0 yes yes
|
||||
* framePtr yes yes
|
||||
* ======= ==== ======
|
||||
*
|
||||
* ======= ==== ====== ========= union data
|
||||
* line1 - yes -
|
||||
* line3 - yes -
|
||||
* path - yes -
|
||||
* ------- ---- ------ ---------
|
||||
* codePtr yes - -
|
||||
* pc yes - -
|
||||
* ======= ==== ====== =========
|
||||
* ======= ==== ========= union data
|
||||
* line1 - yes
|
||||
* line3 - yes
|
||||
* path - yes
|
||||
* ------- ---- ------
|
||||
* codePtr yes -
|
||||
* pc yes -
|
||||
* ======= ==== ======
|
||||
*
|
||||
* ======= ==== ====== ========= | union cmd
|
||||
* listPtr - - yes |
|
||||
* ------- ---- ------ --------- |
|
||||
* cmd yes yes - |
|
||||
* cmdlen yes yes - |
|
||||
* ------- ---- ------ --------- |
|
||||
* ======= ==== ========= union cmd
|
||||
* str.cmd yes yes
|
||||
* str.len yes yes
|
||||
* ------- ---- ------
|
||||
*/
|
||||
|
||||
union {
|
||||
@@ -1207,15 +1208,9 @@ typedef struct CmdFrame {
|
||||
const char *pc; /* ... and instruction pointer. */
|
||||
} tebc;
|
||||
} data;
|
||||
union {
|
||||
struct {
|
||||
const char *cmd; /* The executed command, if possible... */
|
||||
int len; /* ... and its length. */
|
||||
} str;
|
||||
Tcl_Obj *listPtr; /* Tcl_EvalObjEx, cmd list. */
|
||||
} cmd;
|
||||
int numLevels; /* Value of interp's numLevels when the frame
|
||||
* was pushed. */
|
||||
Tcl_Obj *cmdObj;
|
||||
const char *cmd; /* The executed command, if possible... */
|
||||
int len; /* ... and its length. */
|
||||
const struct CFWordBC *litarg;
|
||||
/* Link to set of literal arguments which have
|
||||
* ben pushed on the lineLABCPtr stack by
|
||||
@@ -1279,8 +1274,6 @@ typedef struct ContLineLoc {
|
||||
* location data referenced via the 'baseLocPtr'.
|
||||
*
|
||||
* TCL_LOCATION_EVAL : Frame is for a script evaluated by EvalEx.
|
||||
* TCL_LOCATION_EVAL_LIST : Frame is for a script evaluated by the list
|
||||
* optimization path of EvalObjEx.
|
||||
* TCL_LOCATION_BC : Frame is for bytecode.
|
||||
* TCL_LOCATION_PREBC : Frame is for precompiled bytecode.
|
||||
* TCL_LOCATION_SOURCE : Frame is for a script evaluated by EvalEx, from a
|
||||
@@ -1292,8 +1285,6 @@ typedef struct ContLineLoc {
|
||||
*/
|
||||
|
||||
#define TCL_LOCATION_EVAL (0) /* Location in a dynamic eval script. */
|
||||
#define TCL_LOCATION_EVAL_LIST (1) /* Location in a dynamic eval script,
|
||||
* list-path. */
|
||||
#define TCL_LOCATION_BC (2) /* Location in byte code. */
|
||||
#define TCL_LOCATION_PREBC (3) /* Location in precompiled byte code, no
|
||||
* location. */
|
||||
@@ -1447,7 +1438,7 @@ typedef struct CoroutineData {
|
||||
CorContext caller;
|
||||
CorContext running;
|
||||
Tcl_HashTable *lineLABCPtr; /* See Interp.lineLABCPtr */
|
||||
void *stackLevel;
|
||||
int stackLevel;
|
||||
int auxNumLevels; /* While the coroutine is running the
|
||||
* numLevels of the create/resume command is
|
||||
* stored here; for suspended coroutines it
|
||||
@@ -1465,11 +1456,12 @@ typedef struct ExecEnv {
|
||||
struct NRE_callback *callbackPtr;
|
||||
/* Top callback in NRE's stack. */
|
||||
struct CoroutineData *corPtr;
|
||||
int stackLevel;
|
||||
int rewind;
|
||||
} ExecEnv;
|
||||
|
||||
#define COR_IS_SUSPENDED(corPtr) \
|
||||
((corPtr)->stackLevel == NULL)
|
||||
((corPtr)->stackLevel == -1)
|
||||
|
||||
/*
|
||||
* The definitions for the LiteralTable and LiteralEntry structures. Each
|
||||
@@ -2207,9 +2199,9 @@ typedef struct Interp {
|
||||
* other than these should be turned into errors.
|
||||
*/
|
||||
|
||||
#define TCL_ALLOW_EXCEPTIONS 4
|
||||
#define TCL_EVAL_FILE 2
|
||||
#define TCL_EVAL_CTX 8
|
||||
#define TCL_ALLOW_EXCEPTIONS 0x04
|
||||
#define TCL_EVAL_FILE 0x02
|
||||
#define TCL_EVAL_SOURCE_IN_FRAME 0x10
|
||||
|
||||
/*
|
||||
* Flag bits for Interp structures:
|
||||
@@ -2825,7 +2817,7 @@ MODULE_SCOPE void TclArgumentRelease(Tcl_Interp *interp,
|
||||
Tcl_Obj *objv[], int objc);
|
||||
MODULE_SCOPE void TclArgumentBCEnter(Tcl_Interp *interp,
|
||||
Tcl_Obj *objv[], int objc,
|
||||
void *codePtr, CmdFrame *cfPtr, int pc);
|
||||
void *codePtr, CmdFrame *cfPtr, int cmd, int pc);
|
||||
MODULE_SCOPE void TclArgumentBCRelease(Tcl_Interp *interp,
|
||||
CmdFrame *cfPtr);
|
||||
MODULE_SCOPE void TclArgumentGet(Tcl_Interp *interp, Tcl_Obj *obj,
|
||||
@@ -2916,7 +2908,8 @@ MODULE_SCOPE int TclGetOpenModeEx(Tcl_Interp *interp,
|
||||
const char *modeString, int *seekFlagPtr,
|
||||
int *binaryPtr);
|
||||
MODULE_SCOPE Tcl_Obj * TclGetProcessGlobalValue(ProcessGlobalValue *pgvPtr);
|
||||
MODULE_SCOPE const char *TclGetSrcInfoForCmd(Interp *iPtr, int *lenPtr);
|
||||
MODULE_SCOPE Tcl_Obj * TclGetSourceFromFrame(CmdFrame *cfPtr, int objc,
|
||||
Tcl_Obj *const objv[]);
|
||||
MODULE_SCOPE int TclGlob(Tcl_Interp *interp, char *pattern,
|
||||
Tcl_Obj *unquotedPrefix, int globFlags,
|
||||
Tcl_GlobTypeData *types);
|
||||
@@ -3007,9 +3000,8 @@ MODULE_SCOPE void TclpFinalizeMutex(Tcl_Mutex *mutexPtr);
|
||||
MODULE_SCOPE void TclpFinalizePipes(void);
|
||||
MODULE_SCOPE void TclpFinalizeSockets(void);
|
||||
MODULE_SCOPE int TclCreateSocketAddress(Tcl_Interp *interp,
|
||||
struct addrinfo **addrlist,
|
||||
const char *host, int port, int willBind,
|
||||
const char **errorMsgPtr);
|
||||
void **addrlist, const char *host, int port,
|
||||
int willBind, const char **errorMsgPtr);
|
||||
MODULE_SCOPE int TclpThreadCreate(Tcl_ThreadId *idPtr,
|
||||
Tcl_ThreadCreateProc *proc, ClientData clientData,
|
||||
int stackSize, int flags);
|
||||
|
||||
@@ -545,6 +545,8 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
|
||||
#undef TclpGmtime_unix
|
||||
#undef TclWinConvertWSAError
|
||||
#define TclWinConvertWSAError TclWinConvertError
|
||||
#undef TclpInetNtoa
|
||||
#define TclpInetNtoa inet_ntoa
|
||||
|
||||
#if defined(__WIN32__) || defined(__CYGWIN__)
|
||||
# undef TclWinNToHS
|
||||
|
||||
+3
-1
@@ -313,6 +313,9 @@ Tcl_MainEx(
|
||||
Tcl_Channel chan;
|
||||
InteractiveState is;
|
||||
|
||||
TclpSetInitialEncodings();
|
||||
TclpFindExecutable((const char *)argv[0]);
|
||||
|
||||
Tcl_InitMemory(interp);
|
||||
|
||||
is.interp = interp;
|
||||
@@ -640,7 +643,6 @@ Tcl_Main(
|
||||
* function to call after most initialization
|
||||
* but before starting to execute commands. */
|
||||
{
|
||||
Tcl_FindExecutable(argv[0]);
|
||||
Tcl_MainEx(argc, argv, appInitProc, Tcl_CreateInterp());
|
||||
}
|
||||
#endif /* TCL_MAJOR_VERSION == 8 && !UNICODE */
|
||||
|
||||
@@ -88,7 +88,7 @@ TclOO_Class_Constructor(
|
||||
Tcl_Obj *const *objv)
|
||||
{
|
||||
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
|
||||
Tcl_Obj *invoke[3];
|
||||
Tcl_Obj **invoke;
|
||||
|
||||
if (objc-1 > Tcl_ObjectContextSkippedArgs(context)) {
|
||||
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
|
||||
@@ -102,6 +102,7 @@ TclOO_Class_Constructor(
|
||||
* Delegate to [oo::define] to do the work.
|
||||
*/
|
||||
|
||||
invoke = ckalloc(3 * sizeof(Tcl_Obj *));
|
||||
invoke[0] = oPtr->fPtr->defineName;
|
||||
invoke[1] = TclOOObjectName(interp, oPtr);
|
||||
invoke[2] = objv[objc-1];
|
||||
@@ -115,7 +116,7 @@ TclOO_Class_Constructor(
|
||||
Tcl_IncrRefCount(invoke[1]);
|
||||
Tcl_IncrRefCount(invoke[2]);
|
||||
TclNRAddCallback(interp, DecrRefsPostClassConstructor,
|
||||
invoke[0], invoke[1], invoke[2], NULL);
|
||||
invoke, NULL, NULL, NULL);
|
||||
|
||||
/*
|
||||
* Tricky point: do not want the extra reported level in the Tcl stack
|
||||
@@ -131,9 +132,12 @@ DecrRefsPostClassConstructor(
|
||||
Tcl_Interp *interp,
|
||||
int result)
|
||||
{
|
||||
TclDecrRefCount((Tcl_Obj *) data[0]);
|
||||
TclDecrRefCount((Tcl_Obj *) data[1]);
|
||||
TclDecrRefCount((Tcl_Obj *) data[2]);
|
||||
Tcl_Obj **invoke = data[0];
|
||||
|
||||
TclDecrRefCount(invoke[0]);
|
||||
TclDecrRefCount(invoke[1]);
|
||||
TclDecrRefCount(invoke[2]);
|
||||
ckfree(invoke);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+31
-18
@@ -2206,29 +2206,42 @@ ClassSuperSet(
|
||||
|
||||
/*
|
||||
* Parse the arguments to get the class to use as superclasses.
|
||||
*
|
||||
* Note that zero classes is special, as it is equivalent to just the
|
||||
* class of objects. [Bug 9d61624b3d]
|
||||
*/
|
||||
|
||||
for (i=0 ; i<superc ; i++) {
|
||||
superclasses[i] = GetClassInOuterContext(interp, superv[i],
|
||||
"only a class can be a superclass");
|
||||
if (superclasses[i] == NULL) {
|
||||
goto failedAfterAlloc;
|
||||
if (superc == 0) {
|
||||
superclasses = ckrealloc(superclasses, sizeof(Class *));
|
||||
superclasses[0] = oPtr->fPtr->objectCls;
|
||||
superc = 1;
|
||||
if (TclOOIsReachable(oPtr->fPtr->classCls, oPtr->classPtr)) {
|
||||
superclasses[0] = oPtr->fPtr->classCls;
|
||||
}
|
||||
for (j=0 ; j<i ; j++) {
|
||||
if (superclasses[j] == superclasses[i]) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"class should only be a direct superclass once", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OO", "REPETITIOUS", NULL);
|
||||
} else {
|
||||
for (i=0 ; i<superc ; i++) {
|
||||
superclasses[i] = GetClassInOuterContext(interp, superv[i],
|
||||
"only a class can be a superclass");
|
||||
if (superclasses[i] == NULL) {
|
||||
goto failedAfterAlloc;
|
||||
}
|
||||
}
|
||||
if (TclOOIsReachable(oPtr->classPtr, superclasses[i])) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"attempt to form circular dependency graph", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OO", "CIRCULARITY", NULL);
|
||||
failedAfterAlloc:
|
||||
ckfree((char *) superclasses);
|
||||
return TCL_ERROR;
|
||||
for (j=0 ; j<i ; j++) {
|
||||
if (superclasses[j] == superclasses[i]) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"class should only be a direct superclass once",
|
||||
-1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OO", "REPETITIOUS",NULL);
|
||||
goto failedAfterAlloc;
|
||||
}
|
||||
}
|
||||
if (TclOOIsReachable(oPtr->classPtr, superclasses[i])) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"attempt to form circular dependency graph", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OO", "CIRCULARITY", NULL);
|
||||
failedAfterAlloc:
|
||||
ckfree((char *) superclasses);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,12 +122,6 @@ typedef struct ForwardMethod {
|
||||
Tcl_Obj *prefixObj; /* The list of values to use to replace the
|
||||
* object and method name with. Will be a
|
||||
* non-empty list. */
|
||||
int fullyQualified; /* If 1, the command name is fully qualified
|
||||
* and we should let the default Tcl mechanism
|
||||
* handle the command lookup because it is
|
||||
* more efficient. If 0, we need to do a
|
||||
* specialized lookup based on the current
|
||||
* object's namespace. */
|
||||
} ForwardMethod;
|
||||
|
||||
/*
|
||||
|
||||
+7
-16
@@ -513,8 +513,8 @@ TclOOMakeProcInstanceMethod(
|
||||
cfPtr->data.eval.path = context.data.eval.path;
|
||||
Tcl_IncrRefCount(cfPtr->data.eval.path);
|
||||
|
||||
cfPtr->cmd.str.cmd = NULL;
|
||||
cfPtr->cmd.str.len = 0;
|
||||
cfPtr->cmd = NULL;
|
||||
cfPtr->len = 0;
|
||||
|
||||
hPtr = Tcl_CreateHashEntry(iPtr->linePBodyPtr,
|
||||
(char *) procPtr, &isNew);
|
||||
@@ -626,8 +626,8 @@ TclOOMakeProcMethod(
|
||||
cfPtr->data.eval.path = context.data.eval.path;
|
||||
Tcl_IncrRefCount(cfPtr->data.eval.path);
|
||||
|
||||
cfPtr->cmd.str.cmd = NULL;
|
||||
cfPtr->cmd.str.len = 0;
|
||||
cfPtr->cmd = NULL;
|
||||
cfPtr->len = 0;
|
||||
|
||||
hPtr = Tcl_CreateHashEntry(iPtr->linePBodyPtr,
|
||||
(char *) procPtr, &isNew);
|
||||
@@ -1338,7 +1338,6 @@ TclOONewForwardInstanceMethod(
|
||||
fmPtr = ckalloc(sizeof(ForwardMethod));
|
||||
fmPtr->prefixObj = prefixObj;
|
||||
Tcl_ListObjIndex(interp, prefixObj, 0, &cmdObj);
|
||||
fmPtr->fullyQualified = (strncmp(TclGetString(cmdObj), "::", 2) == 0);
|
||||
Tcl_IncrRefCount(prefixObj);
|
||||
return (Method *) Tcl_NewInstanceMethod(interp, (Tcl_Object) oPtr,
|
||||
nameObj, flags, &fwdMethodType, fmPtr);
|
||||
@@ -1380,7 +1379,6 @@ TclOONewForwardMethod(
|
||||
fmPtr = ckalloc(sizeof(ForwardMethod));
|
||||
fmPtr->prefixObj = prefixObj;
|
||||
Tcl_ListObjIndex(interp, prefixObj, 0, &cmdObj);
|
||||
fmPtr->fullyQualified = (strncmp(TclGetString(cmdObj), "::", 2) == 0);
|
||||
Tcl_IncrRefCount(prefixObj);
|
||||
return (Method *) Tcl_NewMethod(interp, (Tcl_Class) clsPtr, nameObj,
|
||||
flags, &fwdMethodType, fmPtr);
|
||||
@@ -1409,7 +1407,6 @@ InvokeForwardMethod(
|
||||
ForwardMethod *fmPtr = clientData;
|
||||
Tcl_Obj **argObjs, **prefixObjs;
|
||||
int numPrefixes, len, skip = contextPtr->skip;
|
||||
Command *cmdPtr;
|
||||
|
||||
/*
|
||||
* Build the real list of arguments to use. Note that we know that the
|
||||
@@ -1421,15 +1418,10 @@ InvokeForwardMethod(
|
||||
Tcl_ListObjGetElements(NULL, fmPtr->prefixObj, &numPrefixes, &prefixObjs);
|
||||
argObjs = InitEnsembleRewrite(interp, objc, objv, skip,
|
||||
numPrefixes, prefixObjs, &len);
|
||||
|
||||
if (fmPtr->fullyQualified) {
|
||||
cmdPtr = NULL;
|
||||
} else {
|
||||
cmdPtr = (Command *) Tcl_FindCommand(interp, TclGetString(argObjs[0]),
|
||||
contextPtr->oPtr->namespacePtr, 0 /* normal lookup */);
|
||||
}
|
||||
Tcl_NRAddCallback(interp, FinalizeForwardCall, argObjs, NULL, NULL, NULL);
|
||||
return TclNREvalObjv(interp, len, argObjs, TCL_EVAL_INVOKE, cmdPtr);
|
||||
((Interp *)interp)->lookupNsPtr
|
||||
= (Namespace *) contextPtr->oPtr->namespacePtr;
|
||||
return TclNREvalObjv(interp, len, argObjs, TCL_EVAL_INVOKE, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1474,7 +1466,6 @@ CloneForwardMethod(
|
||||
ForwardMethod *fm2Ptr = ckalloc(sizeof(ForwardMethod));
|
||||
|
||||
fm2Ptr->prefixObj = fmPtr->prefixObj;
|
||||
fm2Ptr->fullyQualified = fmPtr->fullyQualified;
|
||||
Tcl_IncrRefCount(fm2Ptr->prefixObj);
|
||||
*newClientData = fm2Ptr;
|
||||
return TCL_OK;
|
||||
|
||||
+3
-35
@@ -97,7 +97,6 @@ typedef struct ThreadSpecificData {
|
||||
|
||||
static Tcl_ThreadDataKey dataKey;
|
||||
|
||||
static void ContLineLocFree(char *clientData);
|
||||
static void TclThreadFinalizeContLines(ClientData clientData);
|
||||
static ThreadSpecificData *TclGetContLineTable(void);
|
||||
|
||||
@@ -805,14 +804,7 @@ TclThreadFinalizeContLines(
|
||||
|
||||
for (hPtr = Tcl_FirstHashEntry(tsdPtr->lineCLPtr, &hSearch);
|
||||
hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) {
|
||||
/*
|
||||
* We are not using Tcl_EventuallyFree (as in TclFreeObj()) because
|
||||
* here we can be sure that the compiler will not hold references to
|
||||
* the data in the hashtable, and using TEF might bork the
|
||||
* finalization sequence.
|
||||
*/
|
||||
|
||||
ContLineLocFree(Tcl_GetHashValue(hPtr));
|
||||
ckfree(Tcl_GetHashValue(hPtr));
|
||||
Tcl_DeleteHashEntry(hPtr);
|
||||
}
|
||||
Tcl_DeleteHashTable(tsdPtr->lineCLPtr);
|
||||
@@ -820,30 +812,6 @@ TclThreadFinalizeContLines(
|
||||
tsdPtr->lineCLPtr = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* ContLineLocFree --
|
||||
*
|
||||
* The freProc for continuation line location tables.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Releases memory.
|
||||
*
|
||||
* TIP #280
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
ContLineLocFree(
|
||||
char *clientData)
|
||||
{
|
||||
ckfree(clientData);
|
||||
}
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------
|
||||
*
|
||||
@@ -1405,7 +1373,7 @@ TclFreeObj(
|
||||
if (tsdPtr->lineCLPtr) {
|
||||
hPtr = Tcl_FindHashEntry(tsdPtr->lineCLPtr, objPtr);
|
||||
if (hPtr) {
|
||||
Tcl_EventuallyFree(Tcl_GetHashValue(hPtr), ContLineLocFree);
|
||||
ckfree(Tcl_GetHashValue(hPtr));
|
||||
Tcl_DeleteHashEntry(hPtr);
|
||||
}
|
||||
}
|
||||
@@ -1496,7 +1464,7 @@ TclFreeObj(
|
||||
if (tsdPtr->lineCLPtr) {
|
||||
hPtr = Tcl_FindHashEntry(tsdPtr->lineCLPtr, objPtr);
|
||||
if (hPtr) {
|
||||
Tcl_EventuallyFree(Tcl_GetHashValue(hPtr), ContLineLocFree);
|
||||
ckfree(Tcl_GetHashValue(hPtr));
|
||||
Tcl_DeleteHashEntry(hPtr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@ LocateTargetAddresses(
|
||||
case INST_JUMP4:
|
||||
case INST_JUMP_TRUE4:
|
||||
case INST_JUMP_FALSE4:
|
||||
case INST_START_CMD:
|
||||
targetInstPtr = currentInstPtr+TclGetInt4AtPtr(currentInstPtr+1);
|
||||
goto storeTarget;
|
||||
case INST_BEGIN_CATCH4:
|
||||
@@ -109,8 +110,6 @@ LocateTargetAddresses(
|
||||
DefineTargetAddress(tablePtr, currentInstPtr + 2*i - 1);
|
||||
}
|
||||
break;
|
||||
case INST_START_CMD:
|
||||
assert (envPtr->atCmdStart < 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +212,8 @@ ConvertZeroEffectToNOP(
|
||||
int blank = 0, i, nextInst;
|
||||
|
||||
size = AddrLength(currentInstPtr);
|
||||
while (*(currentInstPtr+size) == INST_NOP) {
|
||||
while ((currentInstPtr + size < envPtr->codeNext)
|
||||
&& *(currentInstPtr+size) == INST_NOP) {
|
||||
if (IsTargetAddress(&targets, currentInstPtr + size)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,10 @@ Tcl_SetPanicProc(
|
||||
#if defined(_WIN32)
|
||||
/* tclWinDebugPanic only installs if there is no panicProc yet. */
|
||||
if ((proc != tclWinDebugPanic) || (panicProc == NULL))
|
||||
#elif defined(__CYGWIN__)
|
||||
if (proc == NULL)
|
||||
panicProc = tclWinDebugPanic;
|
||||
else
|
||||
#endif
|
||||
panicProc = proc;
|
||||
}
|
||||
|
||||
+7
-8
@@ -13,6 +13,7 @@
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include "tclInt.h"
|
||||
#include "tclParse.h"
|
||||
|
||||
@@ -1567,6 +1568,7 @@ Tcl_ParseVar(
|
||||
|
||||
code = TclSubstTokens(interp, parsePtr->tokenPtr, parsePtr->numTokens,
|
||||
NULL, 1, NULL, NULL);
|
||||
Tcl_FreeParse(parsePtr);
|
||||
TclStackFree(interp, parsePtr);
|
||||
if (code != TCL_OK) {
|
||||
return NULL;
|
||||
@@ -1577,16 +1579,13 @@ Tcl_ParseVar(
|
||||
* At this point we should have an object containing the value of a
|
||||
* variable. Just return the string from that object.
|
||||
*
|
||||
* This should have returned the object for the user to manage, but
|
||||
* instead we have some weak reference to the string value in the object,
|
||||
* which is why we make sure the object exists after resetting the result.
|
||||
* This isn't ideal, but it's the best we can do with the current
|
||||
* documented interface. -- hobbs
|
||||
* Since TclSubstTokens above returned TCL_OK, we know that objPtr
|
||||
* is shared. It is in both the interp result and the value of the
|
||||
* variable. Returning the string relies on that to be true.
|
||||
*/
|
||||
|
||||
if (!Tcl_IsShared(objPtr)) {
|
||||
Tcl_IncrRefCount(objPtr);
|
||||
}
|
||||
assert( Tcl_IsShared(objPtr) );
|
||||
|
||||
Tcl_ResetResult(interp);
|
||||
return TclGetString(objPtr);
|
||||
}
|
||||
|
||||
+4
-4
@@ -271,8 +271,8 @@ Tcl_ProcObjCmd(
|
||||
cfPtr->data.eval.path = contextPtr->data.eval.path;
|
||||
Tcl_IncrRefCount(cfPtr->data.eval.path);
|
||||
|
||||
cfPtr->cmd.str.cmd = NULL;
|
||||
cfPtr->cmd.str.len = 0;
|
||||
cfPtr->cmd = NULL;
|
||||
cfPtr->len = 0;
|
||||
|
||||
hePtr = Tcl_CreateHashEntry(iPtr->linePBodyPtr,
|
||||
procPtr, &isNew);
|
||||
@@ -2595,8 +2595,8 @@ SetLambdaFromAny(
|
||||
cfPtr->data.eval.path = contextPtr->data.eval.path;
|
||||
Tcl_IncrRefCount(cfPtr->data.eval.path);
|
||||
|
||||
cfPtr->cmd.str.cmd = NULL;
|
||||
cfPtr->cmd.str.len = 0;
|
||||
cfPtr->cmd = NULL;
|
||||
cfPtr->len = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1112,6 +1112,7 @@ Tcl_SetObjErrorCode(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_GetErrorLine
|
||||
int
|
||||
Tcl_GetErrorLine(
|
||||
Tcl_Interp *interp)
|
||||
@@ -1129,6 +1130,7 @@ Tcl_GetErrorLine(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#undef Tcl_SetErrorLine
|
||||
void
|
||||
Tcl_SetErrorLine(
|
||||
Tcl_Interp *interp,
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#undef TclSockMinimumBuffers
|
||||
#define TclBackgroundException Tcl_BackgroundException
|
||||
#undef Tcl_SetIntObj
|
||||
#undef TclpInetNtoa
|
||||
|
||||
/* See bug 510001: TclSockMinimumBuffers needs plat imp */
|
||||
#ifdef _WIN64
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* tclStubLibTbl.c --
|
||||
*
|
||||
* Stub object that will be statically linked into extensions that want
|
||||
* to access Tcl.
|
||||
*
|
||||
* Copyright (c) 1998-1999 by Scriptics Corporation.
|
||||
* Copyright (c) 1998 Paul Duffin.
|
||||
*
|
||||
* See the file "license.terms" for information on usage and redistribution of
|
||||
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
*/
|
||||
|
||||
#include "tclInt.h"
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclInitStubTable --
|
||||
*
|
||||
* Initialize the stub table, using the structure pointed at
|
||||
* by the "version" argument.
|
||||
*
|
||||
* Results:
|
||||
* Outputs the value of the "version" argument.
|
||||
*
|
||||
* Side effects:
|
||||
* Sets the stub table pointers.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
MODULE_SCOPE const char *
|
||||
TclInitStubTable(
|
||||
const char *version) /* points to the version field of a
|
||||
TclStubInfoType structure variable. */
|
||||
{
|
||||
tclStubsPtr = ((const TclStubInfoType *) version)->stubs;
|
||||
|
||||
if (tclStubsPtr->hooks) {
|
||||
tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;
|
||||
tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs;
|
||||
tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs;
|
||||
} else {
|
||||
tclPlatStubsPtr = NULL;
|
||||
tclIntStubsPtr = NULL;
|
||||
tclIntPlatStubsPtr = NULL;
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
* c-basic-offset: 4
|
||||
* fill-column: 78
|
||||
* End:
|
||||
*/
|
||||
+4
-4
@@ -1555,14 +1555,14 @@ DelCallbackProc(
|
||||
*
|
||||
* TestdelCmd --
|
||||
*
|
||||
* This procedure implements the "testdcall" command. It is used
|
||||
* to test Tcl_CallWhenDeleted.
|
||||
* This procedure implements the "testdel" command. It is used
|
||||
* to test calling of command deletion callbacks.
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl result.
|
||||
*
|
||||
* Side effects:
|
||||
* Creates and deletes interpreters.
|
||||
* Creates a command.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1856,7 +1856,7 @@ TestdstringCmd(
|
||||
if (Tcl_GetInt(interp, argv[2], &count) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_DStringTrunc(&dstring, count);
|
||||
Tcl_DStringSetLength(&dstring, count);
|
||||
} else if (strcmp(argv[1], "start") == 0) {
|
||||
if (argc != 2) {
|
||||
goto wrongNumArgs;
|
||||
|
||||
@@ -337,7 +337,7 @@ ThreadObjCmd(
|
||||
*/
|
||||
|
||||
if (objc == 2) {
|
||||
idObj = Tcl_NewLongObj((long)(size_t)Tcl_GetCurrentThread());
|
||||
idObj = Tcl_NewWideIntObj((Tcl_WideInt)(size_t)Tcl_GetCurrentThread());
|
||||
} else if (objc == 3
|
||||
&& strcmp("-main", Tcl_GetString(objv[2])) == 0) {
|
||||
Tcl_MutexLock(&threadMutex);
|
||||
@@ -355,14 +355,14 @@ ThreadObjCmd(
|
||||
return TCL_ERROR;
|
||||
}
|
||||
case THREAD_JOIN: {
|
||||
long id;
|
||||
Tcl_WideInt id;
|
||||
int result, status;
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "id");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tcl_GetLongFromObj(interp, objv[2], &id) != TCL_OK) {
|
||||
if (Tcl_GetWideIntFromObj(interp, objv[2], &id) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ ThreadObjCmd(
|
||||
} else {
|
||||
char buf[20];
|
||||
|
||||
TclFormatInt(buf, id);
|
||||
sprintf(buf, "%" TCL_LL_MODIFIER "d", id);
|
||||
Tcl_AppendResult(interp, "cannot join thread ", buf, NULL);
|
||||
}
|
||||
return result;
|
||||
@@ -384,7 +384,7 @@ ThreadObjCmd(
|
||||
}
|
||||
return ThreadList(interp);
|
||||
case THREAD_SEND: {
|
||||
long id;
|
||||
Tcl_WideInt id;
|
||||
const char *script;
|
||||
int wait, arg;
|
||||
|
||||
@@ -403,7 +403,7 @@ ThreadObjCmd(
|
||||
wait = 1;
|
||||
arg = 2;
|
||||
}
|
||||
if (Tcl_GetLongFromObj(interp, objv[arg], &id) != TCL_OK) {
|
||||
if (Tcl_GetWideIntFromObj(interp, objv[arg], &id) != TCL_OK) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
arg++;
|
||||
@@ -523,7 +523,7 @@ ThreadCreate(
|
||||
Tcl_ConditionWait(&ctrl.condWait, &threadMutex, NULL);
|
||||
Tcl_MutexUnlock(&threadMutex);
|
||||
Tcl_ConditionFinalize(&ctrl.condWait);
|
||||
Tcl_SetObjResult(interp, Tcl_NewLongObj((long)(size_t)id));
|
||||
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((Tcl_WideInt)(size_t)id));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -655,7 +655,7 @@ ThreadErrorProc(
|
||||
char *script;
|
||||
char buf[TCL_DOUBLE_SPACE+1];
|
||||
|
||||
TclFormatInt(buf, (size_t) Tcl_GetCurrentThread());
|
||||
sprintf(buf, "%" TCL_LL_MODIFIER "d", (Tcl_WideInt)(size_t)Tcl_GetCurrentThread());
|
||||
|
||||
errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
|
||||
if (errorProcString == NULL) {
|
||||
@@ -773,7 +773,7 @@ ThreadList(
|
||||
Tcl_MutexLock(&threadMutex);
|
||||
for (tsdPtr = threadList ; tsdPtr ; tsdPtr = tsdPtr->nextPtr) {
|
||||
Tcl_ListObjAppendElement(interp, listPtr,
|
||||
Tcl_NewLongObj((long)(size_t)tsdPtr->threadId));
|
||||
Tcl_NewWideIntObj((Tcl_WideInt)(size_t)tsdPtr->threadId));
|
||||
}
|
||||
Tcl_MutexUnlock(&threadMutex);
|
||||
Tcl_SetObjResult(interp, listPtr);
|
||||
|
||||
+2
-2
@@ -1555,10 +1555,10 @@ Tcl_UniCharIsSpace(
|
||||
*/
|
||||
|
||||
if (((Tcl_UniChar) ch) < ((Tcl_UniChar) 0x80)) {
|
||||
return isspace(UCHAR(ch)); /* INTL: ISO space */
|
||||
return TclIsSpaceProc((char) ch);
|
||||
} else if ((Tcl_UniChar) ch == 0x0085 || (Tcl_UniChar) ch == 0x180e
|
||||
|| (Tcl_UniChar) ch == 0x200b || (Tcl_UniChar) ch == 0x2060
|
||||
|| (Tcl_UniChar) ch == 0xfeff) {
|
||||
|| (Tcl_UniChar) ch == 0x202f || (Tcl_UniChar) ch == 0xfeff) {
|
||||
return 1;
|
||||
} else {
|
||||
return ((SPACE_BITS >> GetCategory(ch)) & 1);
|
||||
|
||||
@@ -617,4 +617,18 @@ auto_mkindex_parser::command namespace {op args} {
|
||||
}
|
||||
}
|
||||
|
||||
# AUTO MKINDEX: oo::class create name ?definition?
|
||||
# Adds an entry to the auto index list for the given class name.
|
||||
foreach cmd {oo::class class} {
|
||||
auto_mkindex_parser::command $cmd {ecmd name {body ""}} {
|
||||
if {$cmd eq "create"} {
|
||||
variable index
|
||||
variable scriptFile
|
||||
append index [format "set %s \[list source \[%s]]\n" \
|
||||
[list auto_index([fullname $name])] \
|
||||
[list file join $dir {*}[file split $scriptFile]]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
+2
-2
@@ -324,7 +324,7 @@ proc ::tcl::clock::Initialize {} {
|
||||
{-10800 0 3600 0 2 0 2 2 0 0 0 0 10 0 3 2 0 0 0} :America/Sao_Paulo
|
||||
{-10800 0 3600 0 10 0 5 2 0 0 0 0 4 0 1 2 0 0 0} :America/Godthab
|
||||
{-10800 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :America/Buenos_Aires
|
||||
{-10800 0 3600 0 2 0 5 2 0 0 0 0 11 0 1 2 0 0 0} :America/Brasilia
|
||||
{-10800 0 3600 0 2 0 5 2 0 0 0 0 11 0 1 2 0 0 0} :America/Bahia
|
||||
{-10800 0 3600 0 3 0 2 2 0 0 0 0 10 0 1 2 0 0 0} :America/Montevideo
|
||||
{-7200 0 3600 0 9 0 5 2 0 0 0 0 3 0 5 2 0 0 0} :America/Noronha
|
||||
{-3600 0 3600 0 10 0 5 3 0 0 0 0 3 0 5 2 0 0 0} :Atlantic/Azores
|
||||
@@ -3861,7 +3861,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } {
|
||||
|
||||
# Put DST in effect in all years from 1916 to 2099.
|
||||
|
||||
for { set y 1916 } { $y < 2099 } { incr y } {
|
||||
for { set y 1916 } { $y < 2100 } { incr y } {
|
||||
set startTime [DeterminePosixDSTTime $z start $y]
|
||||
incr startTime [expr { - wide($stdOffset) }]
|
||||
set endTime [DeterminePosixDSTTime $z end $y]
|
||||
|
||||
@@ -34,8 +34,8 @@ set TZData(:Africa/Casablanca) {
|
||||
{1345428000 3600 1 WEST}
|
||||
{1348970400 0 0 WET}
|
||||
{1367114400 3600 1 WEST}
|
||||
{1373335200 0 0 WET}
|
||||
{1375927200 3600 1 WEST}
|
||||
{1373162400 0 0 WET}
|
||||
{1376100000 3600 1 WEST}
|
||||
{1380420000 0 0 WET}
|
||||
{1398564000 3600 1 WEST}
|
||||
{1404007200 0 0 WET}
|
||||
|
||||
@@ -83,178 +83,177 @@ set TZData(:America/Asuncion) {
|
||||
{1333854000 -14400 0 PYT}
|
||||
{1349582400 -10800 1 PYST}
|
||||
{1364094000 -14400 0 PYT}
|
||||
{1365912000 -14400 0 PYT}
|
||||
{1381032000 -10800 1 PYST}
|
||||
{1397358000 -14400 0 PYT}
|
||||
{1395543600 -14400 0 PYT}
|
||||
{1412481600 -10800 1 PYST}
|
||||
{1428807600 -14400 0 PYT}
|
||||
{1426993200 -14400 0 PYT}
|
||||
{1443931200 -10800 1 PYST}
|
||||
{1460257200 -14400 0 PYT}
|
||||
{1459047600 -14400 0 PYT}
|
||||
{1475380800 -10800 1 PYST}
|
||||
{1491706800 -14400 0 PYT}
|
||||
{1490497200 -14400 0 PYT}
|
||||
{1506830400 -10800 1 PYST}
|
||||
{1523156400 -14400 0 PYT}
|
||||
{1521946800 -14400 0 PYT}
|
||||
{1538884800 -10800 1 PYST}
|
||||
{1555210800 -14400 0 PYT}
|
||||
{1553396400 -14400 0 PYT}
|
||||
{1570334400 -10800 1 PYST}
|
||||
{1586660400 -14400 0 PYT}
|
||||
{1584846000 -14400 0 PYT}
|
||||
{1601784000 -10800 1 PYST}
|
||||
{1618110000 -14400 0 PYT}
|
||||
{1616900400 -14400 0 PYT}
|
||||
{1633233600 -10800 1 PYST}
|
||||
{1649559600 -14400 0 PYT}
|
||||
{1648350000 -14400 0 PYT}
|
||||
{1664683200 -10800 1 PYST}
|
||||
{1681009200 -14400 0 PYT}
|
||||
{1679799600 -14400 0 PYT}
|
||||
{1696132800 -10800 1 PYST}
|
||||
{1713063600 -14400 0 PYT}
|
||||
{1711249200 -14400 0 PYT}
|
||||
{1728187200 -10800 1 PYST}
|
||||
{1744513200 -14400 0 PYT}
|
||||
{1742698800 -14400 0 PYT}
|
||||
{1759636800 -10800 1 PYST}
|
||||
{1775962800 -14400 0 PYT}
|
||||
{1774148400 -14400 0 PYT}
|
||||
{1791086400 -10800 1 PYST}
|
||||
{1807412400 -14400 0 PYT}
|
||||
{1806202800 -14400 0 PYT}
|
||||
{1822536000 -10800 1 PYST}
|
||||
{1838862000 -14400 0 PYT}
|
||||
{1837652400 -14400 0 PYT}
|
||||
{1853985600 -10800 1 PYST}
|
||||
{1870311600 -14400 0 PYT}
|
||||
{1869102000 -14400 0 PYT}
|
||||
{1886040000 -10800 1 PYST}
|
||||
{1902366000 -14400 0 PYT}
|
||||
{1900551600 -14400 0 PYT}
|
||||
{1917489600 -10800 1 PYST}
|
||||
{1933815600 -14400 0 PYT}
|
||||
{1932001200 -14400 0 PYT}
|
||||
{1948939200 -10800 1 PYST}
|
||||
{1965265200 -14400 0 PYT}
|
||||
{1964055600 -14400 0 PYT}
|
||||
{1980388800 -10800 1 PYST}
|
||||
{1996714800 -14400 0 PYT}
|
||||
{1995505200 -14400 0 PYT}
|
||||
{2011838400 -10800 1 PYST}
|
||||
{2028164400 -14400 0 PYT}
|
||||
{2026954800 -14400 0 PYT}
|
||||
{2043288000 -10800 1 PYST}
|
||||
{2059614000 -14400 0 PYT}
|
||||
{2058404400 -14400 0 PYT}
|
||||
{2075342400 -10800 1 PYST}
|
||||
{2091668400 -14400 0 PYT}
|
||||
{2089854000 -14400 0 PYT}
|
||||
{2106792000 -10800 1 PYST}
|
||||
{2123118000 -14400 0 PYT}
|
||||
{2121303600 -14400 0 PYT}
|
||||
{2138241600 -10800 1 PYST}
|
||||
{2154567600 -14400 0 PYT}
|
||||
{2153358000 -14400 0 PYT}
|
||||
{2169691200 -10800 1 PYST}
|
||||
{2186017200 -14400 0 PYT}
|
||||
{2184807600 -14400 0 PYT}
|
||||
{2201140800 -10800 1 PYST}
|
||||
{2217466800 -14400 0 PYT}
|
||||
{2216257200 -14400 0 PYT}
|
||||
{2233195200 -10800 1 PYST}
|
||||
{2249521200 -14400 0 PYT}
|
||||
{2247706800 -14400 0 PYT}
|
||||
{2264644800 -10800 1 PYST}
|
||||
{2280970800 -14400 0 PYT}
|
||||
{2279156400 -14400 0 PYT}
|
||||
{2296094400 -10800 1 PYST}
|
||||
{2312420400 -14400 0 PYT}
|
||||
{2310606000 -14400 0 PYT}
|
||||
{2327544000 -10800 1 PYST}
|
||||
{2343870000 -14400 0 PYT}
|
||||
{2342660400 -14400 0 PYT}
|
||||
{2358993600 -10800 1 PYST}
|
||||
{2375319600 -14400 0 PYT}
|
||||
{2374110000 -14400 0 PYT}
|
||||
{2390443200 -10800 1 PYST}
|
||||
{2406769200 -14400 0 PYT}
|
||||
{2405559600 -14400 0 PYT}
|
||||
{2422497600 -10800 1 PYST}
|
||||
{2438823600 -14400 0 PYT}
|
||||
{2437009200 -14400 0 PYT}
|
||||
{2453947200 -10800 1 PYST}
|
||||
{2470273200 -14400 0 PYT}
|
||||
{2468458800 -14400 0 PYT}
|
||||
{2485396800 -10800 1 PYST}
|
||||
{2501722800 -14400 0 PYT}
|
||||
{2500513200 -14400 0 PYT}
|
||||
{2516846400 -10800 1 PYST}
|
||||
{2533172400 -14400 0 PYT}
|
||||
{2531962800 -14400 0 PYT}
|
||||
{2548296000 -10800 1 PYST}
|
||||
{2564622000 -14400 0 PYT}
|
||||
{2563412400 -14400 0 PYT}
|
||||
{2579745600 -10800 1 PYST}
|
||||
{2596676400 -14400 0 PYT}
|
||||
{2594862000 -14400 0 PYT}
|
||||
{2611800000 -10800 1 PYST}
|
||||
{2628126000 -14400 0 PYT}
|
||||
{2626311600 -14400 0 PYT}
|
||||
{2643249600 -10800 1 PYST}
|
||||
{2659575600 -14400 0 PYT}
|
||||
{2657761200 -14400 0 PYT}
|
||||
{2674699200 -10800 1 PYST}
|
||||
{2691025200 -14400 0 PYT}
|
||||
{2689815600 -14400 0 PYT}
|
||||
{2706148800 -10800 1 PYST}
|
||||
{2722474800 -14400 0 PYT}
|
||||
{2721265200 -14400 0 PYT}
|
||||
{2737598400 -10800 1 PYST}
|
||||
{2753924400 -14400 0 PYT}
|
||||
{2752714800 -14400 0 PYT}
|
||||
{2769652800 -10800 1 PYST}
|
||||
{2785978800 -14400 0 PYT}
|
||||
{2784164400 -14400 0 PYT}
|
||||
{2801102400 -10800 1 PYST}
|
||||
{2817428400 -14400 0 PYT}
|
||||
{2815614000 -14400 0 PYT}
|
||||
{2832552000 -10800 1 PYST}
|
||||
{2848878000 -14400 0 PYT}
|
||||
{2847668400 -14400 0 PYT}
|
||||
{2864001600 -10800 1 PYST}
|
||||
{2880327600 -14400 0 PYT}
|
||||
{2879118000 -14400 0 PYT}
|
||||
{2895451200 -10800 1 PYST}
|
||||
{2911777200 -14400 0 PYT}
|
||||
{2910567600 -14400 0 PYT}
|
||||
{2926900800 -10800 1 PYST}
|
||||
{2943226800 -14400 0 PYT}
|
||||
{2942017200 -14400 0 PYT}
|
||||
{2958955200 -10800 1 PYST}
|
||||
{2975281200 -14400 0 PYT}
|
||||
{2973466800 -14400 0 PYT}
|
||||
{2990404800 -10800 1 PYST}
|
||||
{3006730800 -14400 0 PYT}
|
||||
{3004916400 -14400 0 PYT}
|
||||
{3021854400 -10800 1 PYST}
|
||||
{3038180400 -14400 0 PYT}
|
||||
{3036970800 -14400 0 PYT}
|
||||
{3053304000 -10800 1 PYST}
|
||||
{3069630000 -14400 0 PYT}
|
||||
{3068420400 -14400 0 PYT}
|
||||
{3084753600 -10800 1 PYST}
|
||||
{3101079600 -14400 0 PYT}
|
||||
{3099870000 -14400 0 PYT}
|
||||
{3116808000 -10800 1 PYST}
|
||||
{3133134000 -14400 0 PYT}
|
||||
{3131319600 -14400 0 PYT}
|
||||
{3148257600 -10800 1 PYST}
|
||||
{3164583600 -14400 0 PYT}
|
||||
{3162769200 -14400 0 PYT}
|
||||
{3179707200 -10800 1 PYST}
|
||||
{3196033200 -14400 0 PYT}
|
||||
{3194218800 -14400 0 PYT}
|
||||
{3211156800 -10800 1 PYST}
|
||||
{3227482800 -14400 0 PYT}
|
||||
{3226273200 -14400 0 PYT}
|
||||
{3242606400 -10800 1 PYST}
|
||||
{3258932400 -14400 0 PYT}
|
||||
{3257722800 -14400 0 PYT}
|
||||
{3274056000 -10800 1 PYST}
|
||||
{3290382000 -14400 0 PYT}
|
||||
{3289172400 -14400 0 PYT}
|
||||
{3306110400 -10800 1 PYST}
|
||||
{3322436400 -14400 0 PYT}
|
||||
{3320622000 -14400 0 PYT}
|
||||
{3337560000 -10800 1 PYST}
|
||||
{3353886000 -14400 0 PYT}
|
||||
{3352071600 -14400 0 PYT}
|
||||
{3369009600 -10800 1 PYST}
|
||||
{3385335600 -14400 0 PYT}
|
||||
{3384126000 -14400 0 PYT}
|
||||
{3400459200 -10800 1 PYST}
|
||||
{3416785200 -14400 0 PYT}
|
||||
{3415575600 -14400 0 PYT}
|
||||
{3431908800 -10800 1 PYST}
|
||||
{3448234800 -14400 0 PYT}
|
||||
{3447025200 -14400 0 PYT}
|
||||
{3463358400 -10800 1 PYST}
|
||||
{3480289200 -14400 0 PYT}
|
||||
{3478474800 -14400 0 PYT}
|
||||
{3495412800 -10800 1 PYST}
|
||||
{3511738800 -14400 0 PYT}
|
||||
{3509924400 -14400 0 PYT}
|
||||
{3526862400 -10800 1 PYST}
|
||||
{3543188400 -14400 0 PYT}
|
||||
{3541374000 -14400 0 PYT}
|
||||
{3558312000 -10800 1 PYST}
|
||||
{3574638000 -14400 0 PYT}
|
||||
{3573428400 -14400 0 PYT}
|
||||
{3589761600 -10800 1 PYST}
|
||||
{3606087600 -14400 0 PYT}
|
||||
{3604878000 -14400 0 PYT}
|
||||
{3621211200 -10800 1 PYST}
|
||||
{3637537200 -14400 0 PYT}
|
||||
{3636327600 -14400 0 PYT}
|
||||
{3653265600 -10800 1 PYST}
|
||||
{3669591600 -14400 0 PYT}
|
||||
{3667777200 -14400 0 PYT}
|
||||
{3684715200 -10800 1 PYST}
|
||||
{3701041200 -14400 0 PYT}
|
||||
{3699226800 -14400 0 PYT}
|
||||
{3716164800 -10800 1 PYST}
|
||||
{3732490800 -14400 0 PYT}
|
||||
{3731281200 -14400 0 PYT}
|
||||
{3747614400 -10800 1 PYST}
|
||||
{3763940400 -14400 0 PYT}
|
||||
{3762730800 -14400 0 PYT}
|
||||
{3779064000 -10800 1 PYST}
|
||||
{3795390000 -14400 0 PYT}
|
||||
{3794180400 -14400 0 PYT}
|
||||
{3810513600 -10800 1 PYST}
|
||||
{3826839600 -14400 0 PYT}
|
||||
{3825630000 -14400 0 PYT}
|
||||
{3842568000 -10800 1 PYST}
|
||||
{3858894000 -14400 0 PYT}
|
||||
{3857079600 -14400 0 PYT}
|
||||
{3874017600 -10800 1 PYST}
|
||||
{3890343600 -14400 0 PYT}
|
||||
{3888529200 -14400 0 PYT}
|
||||
{3905467200 -10800 1 PYST}
|
||||
{3921793200 -14400 0 PYT}
|
||||
{3920583600 -14400 0 PYT}
|
||||
{3936916800 -10800 1 PYST}
|
||||
{3953242800 -14400 0 PYT}
|
||||
{3952033200 -14400 0 PYT}
|
||||
{3968366400 -10800 1 PYST}
|
||||
{3984692400 -14400 0 PYT}
|
||||
{3983482800 -14400 0 PYT}
|
||||
{4000420800 -10800 1 PYST}
|
||||
{4016746800 -14400 0 PYT}
|
||||
{4014932400 -14400 0 PYT}
|
||||
{4031870400 -10800 1 PYST}
|
||||
{4048196400 -14400 0 PYT}
|
||||
{4046382000 -14400 0 PYT}
|
||||
{4063320000 -10800 1 PYST}
|
||||
{4079646000 -14400 0 PYT}
|
||||
{4077831600 -14400 0 PYT}
|
||||
{4094769600 -10800 1 PYST}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,11 @@
|
||||
|
||||
set TZData(:Antarctica/Macquarie) {
|
||||
{-9223372036854775808 0 0 zzz}
|
||||
{-1861920000 36000 0 EST}
|
||||
{-2214259200 36000 0 EST}
|
||||
{-1680508800 39600 1 EST}
|
||||
{-1669892400 39600 0 EST}
|
||||
{-1665392400 36000 0 EST}
|
||||
{-883641600 39600 1 EST}
|
||||
{-876128400 36000 0 EST}
|
||||
{-860400000 39600 1 EST}
|
||||
{-844678800 36000 0 EST}
|
||||
{-828345600 39600 1 EST}
|
||||
{-813229200 36000 0 EST}
|
||||
{-1601719200 0 0 zzz}
|
||||
{-94730400 36000 0 EST}
|
||||
{-71136000 39600 1 EST}
|
||||
{-55411200 36000 0 EST}
|
||||
|
||||
+183
-6
@@ -88,14 +88,191 @@ set TZData(:Asia/Gaza) {
|
||||
{1158872400 7200 0 EET}
|
||||
{1175378400 10800 1 EEST}
|
||||
{1189638000 7200 0 EET}
|
||||
{1207000800 10800 1 EEST}
|
||||
{1219957200 7200 0 EET}
|
||||
{1206655200 10800 1 EEST}
|
||||
{1219960800 7200 0 EET}
|
||||
{1220220000 7200 0 EET}
|
||||
{1238104800 10800 1 EEST}
|
||||
{1252018800 7200 0 EET}
|
||||
{1269640860 10800 1 EEST}
|
||||
{1252015200 7200 0 EET}
|
||||
{1262296800 7200 0 EET}
|
||||
{1269640860 10800 0 EEST}
|
||||
{1281474000 7200 0 EET}
|
||||
{1301738460 10800 1 EEST}
|
||||
{1312146000 7200 0 EET}
|
||||
{1301608860 10800 1 EEST}
|
||||
{1312149600 7200 0 EET}
|
||||
{1325368800 7200 0 EET}
|
||||
{1333058400 10800 1 EEST}
|
||||
{1348178400 7200 0 EET}
|
||||
{1364508000 10800 1 EEST}
|
||||
{1380232800 7200 0 EET}
|
||||
{1395957600 10800 1 EEST}
|
||||
{1411682400 7200 0 EET}
|
||||
{1427407200 10800 1 EEST}
|
||||
{1443132000 7200 0 EET}
|
||||
{1459461600 10800 1 EEST}
|
||||
{1474581600 7200 0 EET}
|
||||
{1490911200 10800 1 EEST}
|
||||
{1506031200 7200 0 EET}
|
||||
{1522360800 10800 1 EEST}
|
||||
{1537480800 7200 0 EET}
|
||||
{1553810400 10800 1 EEST}
|
||||
{1569535200 7200 0 EET}
|
||||
{1585260000 10800 1 EEST}
|
||||
{1600984800 7200 0 EET}
|
||||
{1616709600 10800 1 EEST}
|
||||
{1632434400 7200 0 EET}
|
||||
{1648764000 10800 1 EEST}
|
||||
{1663884000 7200 0 EET}
|
||||
{1680213600 10800 1 EEST}
|
||||
{1695333600 7200 0 EET}
|
||||
{1711663200 10800 1 EEST}
|
||||
{1727388000 7200 0 EET}
|
||||
{1743112800 10800 1 EEST}
|
||||
{1758837600 7200 0 EET}
|
||||
{1774562400 10800 1 EEST}
|
||||
{1790287200 7200 0 EET}
|
||||
{1806012000 10800 1 EEST}
|
||||
{1821736800 7200 0 EET}
|
||||
{1838066400 10800 1 EEST}
|
||||
{1853186400 7200 0 EET}
|
||||
{1869516000 10800 1 EEST}
|
||||
{1884636000 7200 0 EET}
|
||||
{1900965600 10800 1 EEST}
|
||||
{1916690400 7200 0 EET}
|
||||
{1932415200 10800 1 EEST}
|
||||
{1948140000 7200 0 EET}
|
||||
{1963864800 10800 1 EEST}
|
||||
{1979589600 7200 0 EET}
|
||||
{1995919200 10800 1 EEST}
|
||||
{2011039200 7200 0 EET}
|
||||
{2027368800 10800 1 EEST}
|
||||
{2042488800 7200 0 EET}
|
||||
{2058818400 10800 1 EEST}
|
||||
{2073938400 7200 0 EET}
|
||||
{2090268000 10800 1 EEST}
|
||||
{2105992800 7200 0 EET}
|
||||
{2121717600 10800 1 EEST}
|
||||
{2137442400 7200 0 EET}
|
||||
{2153167200 10800 1 EEST}
|
||||
{2168892000 7200 0 EET}
|
||||
{2185221600 10800 1 EEST}
|
||||
{2200341600 7200 0 EET}
|
||||
{2216671200 10800 1 EEST}
|
||||
{2231791200 7200 0 EET}
|
||||
{2248120800 10800 1 EEST}
|
||||
{2263845600 7200 0 EET}
|
||||
{2279570400 10800 1 EEST}
|
||||
{2295295200 7200 0 EET}
|
||||
{2311020000 10800 1 EEST}
|
||||
{2326744800 7200 0 EET}
|
||||
{2343074400 10800 1 EEST}
|
||||
{2358194400 7200 0 EET}
|
||||
{2374524000 10800 1 EEST}
|
||||
{2389644000 7200 0 EET}
|
||||
{2405973600 10800 1 EEST}
|
||||
{2421093600 7200 0 EET}
|
||||
{2437423200 10800 1 EEST}
|
||||
{2453148000 7200 0 EET}
|
||||
{2468872800 10800 1 EEST}
|
||||
{2484597600 7200 0 EET}
|
||||
{2500322400 10800 1 EEST}
|
||||
{2516047200 7200 0 EET}
|
||||
{2532376800 10800 1 EEST}
|
||||
{2547496800 7200 0 EET}
|
||||
{2563826400 10800 1 EEST}
|
||||
{2578946400 7200 0 EET}
|
||||
{2595276000 10800 1 EEST}
|
||||
{2611000800 7200 0 EET}
|
||||
{2626725600 10800 1 EEST}
|
||||
{2642450400 7200 0 EET}
|
||||
{2658175200 10800 1 EEST}
|
||||
{2673900000 7200 0 EET}
|
||||
{2689624800 10800 1 EEST}
|
||||
{2705349600 7200 0 EET}
|
||||
{2721679200 10800 1 EEST}
|
||||
{2736799200 7200 0 EET}
|
||||
{2753128800 10800 1 EEST}
|
||||
{2768248800 7200 0 EET}
|
||||
{2784578400 10800 1 EEST}
|
||||
{2800303200 7200 0 EET}
|
||||
{2816028000 10800 1 EEST}
|
||||
{2831752800 7200 0 EET}
|
||||
{2847477600 10800 1 EEST}
|
||||
{2863202400 7200 0 EET}
|
||||
{2879532000 10800 1 EEST}
|
||||
{2894652000 7200 0 EET}
|
||||
{2910981600 10800 1 EEST}
|
||||
{2926101600 7200 0 EET}
|
||||
{2942431200 10800 1 EEST}
|
||||
{2957551200 7200 0 EET}
|
||||
{2973880800 10800 1 EEST}
|
||||
{2989605600 7200 0 EET}
|
||||
{3005330400 10800 1 EEST}
|
||||
{3021055200 7200 0 EET}
|
||||
{3036780000 10800 1 EEST}
|
||||
{3052504800 7200 0 EET}
|
||||
{3068834400 10800 1 EEST}
|
||||
{3083954400 7200 0 EET}
|
||||
{3100284000 10800 1 EEST}
|
||||
{3115404000 7200 0 EET}
|
||||
{3131733600 10800 1 EEST}
|
||||
{3147458400 7200 0 EET}
|
||||
{3163183200 10800 1 EEST}
|
||||
{3178908000 7200 0 EET}
|
||||
{3194632800 10800 1 EEST}
|
||||
{3210357600 7200 0 EET}
|
||||
{3226687200 10800 1 EEST}
|
||||
{3241807200 7200 0 EET}
|
||||
{3258136800 10800 1 EEST}
|
||||
{3273256800 7200 0 EET}
|
||||
{3289586400 10800 1 EEST}
|
||||
{3304706400 7200 0 EET}
|
||||
{3321036000 10800 1 EEST}
|
||||
{3336760800 7200 0 EET}
|
||||
{3352485600 10800 1 EEST}
|
||||
{3368210400 7200 0 EET}
|
||||
{3383935200 10800 1 EEST}
|
||||
{3399660000 7200 0 EET}
|
||||
{3415989600 10800 1 EEST}
|
||||
{3431109600 7200 0 EET}
|
||||
{3447439200 10800 1 EEST}
|
||||
{3462559200 7200 0 EET}
|
||||
{3478888800 10800 1 EEST}
|
||||
{3494613600 7200 0 EET}
|
||||
{3510338400 10800 1 EEST}
|
||||
{3526063200 7200 0 EET}
|
||||
{3541788000 10800 1 EEST}
|
||||
{3557512800 7200 0 EET}
|
||||
{3573237600 10800 1 EEST}
|
||||
{3588962400 7200 0 EET}
|
||||
{3605292000 10800 1 EEST}
|
||||
{3620412000 7200 0 EET}
|
||||
{3636741600 10800 1 EEST}
|
||||
{3651861600 7200 0 EET}
|
||||
{3668191200 10800 1 EEST}
|
||||
{3683916000 7200 0 EET}
|
||||
{3699640800 10800 1 EEST}
|
||||
{3715365600 7200 0 EET}
|
||||
{3731090400 10800 1 EEST}
|
||||
{3746815200 7200 0 EET}
|
||||
{3763144800 10800 1 EEST}
|
||||
{3778264800 7200 0 EET}
|
||||
{3794594400 10800 1 EEST}
|
||||
{3809714400 7200 0 EET}
|
||||
{3826044000 10800 1 EEST}
|
||||
{3841164000 7200 0 EET}
|
||||
{3857493600 10800 1 EEST}
|
||||
{3873218400 7200 0 EET}
|
||||
{3888943200 10800 1 EEST}
|
||||
{3904668000 7200 0 EET}
|
||||
{3920392800 10800 1 EEST}
|
||||
{3936117600 7200 0 EET}
|
||||
{3952447200 10800 1 EEST}
|
||||
{3967567200 7200 0 EET}
|
||||
{3983896800 10800 1 EEST}
|
||||
{3999016800 7200 0 EET}
|
||||
{4015346400 10800 1 EEST}
|
||||
{4031071200 7200 0 EET}
|
||||
{4046796000 10800 1 EEST}
|
||||
{4062520800 7200 0 EET}
|
||||
{4078245600 10800 1 EEST}
|
||||
{4093970400 7200 0 EET}
|
||||
}
|
||||
|
||||
+179
-6
@@ -88,17 +88,190 @@ set TZData(:Asia/Hebron) {
|
||||
{1158872400 7200 0 EET}
|
||||
{1175378400 10800 1 EEST}
|
||||
{1189638000 7200 0 EET}
|
||||
{1207000800 10800 1 EEST}
|
||||
{1217541600 10800 1 EEST}
|
||||
{1206655200 10800 1 EEST}
|
||||
{1220216400 7200 0 EET}
|
||||
{1238104800 10800 1 EEST}
|
||||
{1252018800 7200 0 EET}
|
||||
{1269640860 10800 1 EEST}
|
||||
{1252015200 7200 0 EET}
|
||||
{1269554400 10800 1 EEST}
|
||||
{1281474000 7200 0 EET}
|
||||
{1301652060 10800 1 EEST}
|
||||
{1301608860 10800 1 EEST}
|
||||
{1312146000 7200 0 EET}
|
||||
{1314655200 10800 1 EEST}
|
||||
{1317340800 7200 0 EET}
|
||||
{1317330000 7200 0 EET}
|
||||
{1333058400 10800 1 EEST}
|
||||
{1348178400 7200 0 EET}
|
||||
{1364508000 10800 1 EEST}
|
||||
{1380232800 7200 0 EET}
|
||||
{1395957600 10800 1 EEST}
|
||||
{1411682400 7200 0 EET}
|
||||
{1427407200 10800 1 EEST}
|
||||
{1443132000 7200 0 EET}
|
||||
{1459461600 10800 1 EEST}
|
||||
{1474581600 7200 0 EET}
|
||||
{1490911200 10800 1 EEST}
|
||||
{1506031200 7200 0 EET}
|
||||
{1522360800 10800 1 EEST}
|
||||
{1537480800 7200 0 EET}
|
||||
{1553810400 10800 1 EEST}
|
||||
{1569535200 7200 0 EET}
|
||||
{1585260000 10800 1 EEST}
|
||||
{1600984800 7200 0 EET}
|
||||
{1616709600 10800 1 EEST}
|
||||
{1632434400 7200 0 EET}
|
||||
{1648764000 10800 1 EEST}
|
||||
{1663884000 7200 0 EET}
|
||||
{1680213600 10800 1 EEST}
|
||||
{1695333600 7200 0 EET}
|
||||
{1711663200 10800 1 EEST}
|
||||
{1727388000 7200 0 EET}
|
||||
{1743112800 10800 1 EEST}
|
||||
{1758837600 7200 0 EET}
|
||||
{1774562400 10800 1 EEST}
|
||||
{1790287200 7200 0 EET}
|
||||
{1806012000 10800 1 EEST}
|
||||
{1821736800 7200 0 EET}
|
||||
{1838066400 10800 1 EEST}
|
||||
{1853186400 7200 0 EET}
|
||||
{1869516000 10800 1 EEST}
|
||||
{1884636000 7200 0 EET}
|
||||
{1900965600 10800 1 EEST}
|
||||
{1916690400 7200 0 EET}
|
||||
{1932415200 10800 1 EEST}
|
||||
{1948140000 7200 0 EET}
|
||||
{1963864800 10800 1 EEST}
|
||||
{1979589600 7200 0 EET}
|
||||
{1995919200 10800 1 EEST}
|
||||
{2011039200 7200 0 EET}
|
||||
{2027368800 10800 1 EEST}
|
||||
{2042488800 7200 0 EET}
|
||||
{2058818400 10800 1 EEST}
|
||||
{2073938400 7200 0 EET}
|
||||
{2090268000 10800 1 EEST}
|
||||
{2105992800 7200 0 EET}
|
||||
{2121717600 10800 1 EEST}
|
||||
{2137442400 7200 0 EET}
|
||||
{2153167200 10800 1 EEST}
|
||||
{2168892000 7200 0 EET}
|
||||
{2185221600 10800 1 EEST}
|
||||
{2200341600 7200 0 EET}
|
||||
{2216671200 10800 1 EEST}
|
||||
{2231791200 7200 0 EET}
|
||||
{2248120800 10800 1 EEST}
|
||||
{2263845600 7200 0 EET}
|
||||
{2279570400 10800 1 EEST}
|
||||
{2295295200 7200 0 EET}
|
||||
{2311020000 10800 1 EEST}
|
||||
{2326744800 7200 0 EET}
|
||||
{2343074400 10800 1 EEST}
|
||||
{2358194400 7200 0 EET}
|
||||
{2374524000 10800 1 EEST}
|
||||
{2389644000 7200 0 EET}
|
||||
{2405973600 10800 1 EEST}
|
||||
{2421093600 7200 0 EET}
|
||||
{2437423200 10800 1 EEST}
|
||||
{2453148000 7200 0 EET}
|
||||
{2468872800 10800 1 EEST}
|
||||
{2484597600 7200 0 EET}
|
||||
{2500322400 10800 1 EEST}
|
||||
{2516047200 7200 0 EET}
|
||||
{2532376800 10800 1 EEST}
|
||||
{2547496800 7200 0 EET}
|
||||
{2563826400 10800 1 EEST}
|
||||
{2578946400 7200 0 EET}
|
||||
{2595276000 10800 1 EEST}
|
||||
{2611000800 7200 0 EET}
|
||||
{2626725600 10800 1 EEST}
|
||||
{2642450400 7200 0 EET}
|
||||
{2658175200 10800 1 EEST}
|
||||
{2673900000 7200 0 EET}
|
||||
{2689624800 10800 1 EEST}
|
||||
{2705349600 7200 0 EET}
|
||||
{2721679200 10800 1 EEST}
|
||||
{2736799200 7200 0 EET}
|
||||
{2753128800 10800 1 EEST}
|
||||
{2768248800 7200 0 EET}
|
||||
{2784578400 10800 1 EEST}
|
||||
{2800303200 7200 0 EET}
|
||||
{2816028000 10800 1 EEST}
|
||||
{2831752800 7200 0 EET}
|
||||
{2847477600 10800 1 EEST}
|
||||
{2863202400 7200 0 EET}
|
||||
{2879532000 10800 1 EEST}
|
||||
{2894652000 7200 0 EET}
|
||||
{2910981600 10800 1 EEST}
|
||||
{2926101600 7200 0 EET}
|
||||
{2942431200 10800 1 EEST}
|
||||
{2957551200 7200 0 EET}
|
||||
{2973880800 10800 1 EEST}
|
||||
{2989605600 7200 0 EET}
|
||||
{3005330400 10800 1 EEST}
|
||||
{3021055200 7200 0 EET}
|
||||
{3036780000 10800 1 EEST}
|
||||
{3052504800 7200 0 EET}
|
||||
{3068834400 10800 1 EEST}
|
||||
{3083954400 7200 0 EET}
|
||||
{3100284000 10800 1 EEST}
|
||||
{3115404000 7200 0 EET}
|
||||
{3131733600 10800 1 EEST}
|
||||
{3147458400 7200 0 EET}
|
||||
{3163183200 10800 1 EEST}
|
||||
{3178908000 7200 0 EET}
|
||||
{3194632800 10800 1 EEST}
|
||||
{3210357600 7200 0 EET}
|
||||
{3226687200 10800 1 EEST}
|
||||
{3241807200 7200 0 EET}
|
||||
{3258136800 10800 1 EEST}
|
||||
{3273256800 7200 0 EET}
|
||||
{3289586400 10800 1 EEST}
|
||||
{3304706400 7200 0 EET}
|
||||
{3321036000 10800 1 EEST}
|
||||
{3336760800 7200 0 EET}
|
||||
{3352485600 10800 1 EEST}
|
||||
{3368210400 7200 0 EET}
|
||||
{3383935200 10800 1 EEST}
|
||||
{3399660000 7200 0 EET}
|
||||
{3415989600 10800 1 EEST}
|
||||
{3431109600 7200 0 EET}
|
||||
{3447439200 10800 1 EEST}
|
||||
{3462559200 7200 0 EET}
|
||||
{3478888800 10800 1 EEST}
|
||||
{3494613600 7200 0 EET}
|
||||
{3510338400 10800 1 EEST}
|
||||
{3526063200 7200 0 EET}
|
||||
{3541788000 10800 1 EEST}
|
||||
{3557512800 7200 0 EET}
|
||||
{3573237600 10800 1 EEST}
|
||||
{3588962400 7200 0 EET}
|
||||
{3605292000 10800 1 EEST}
|
||||
{3620412000 7200 0 EET}
|
||||
{3636741600 10800 1 EEST}
|
||||
{3651861600 7200 0 EET}
|
||||
{3668191200 10800 1 EEST}
|
||||
{3683916000 7200 0 EET}
|
||||
{3699640800 10800 1 EEST}
|
||||
{3715365600 7200 0 EET}
|
||||
{3731090400 10800 1 EEST}
|
||||
{3746815200 7200 0 EET}
|
||||
{3763144800 10800 1 EEST}
|
||||
{3778264800 7200 0 EET}
|
||||
{3794594400 10800 1 EEST}
|
||||
{3809714400 7200 0 EET}
|
||||
{3826044000 10800 1 EEST}
|
||||
{3841164000 7200 0 EET}
|
||||
{3857493600 10800 1 EEST}
|
||||
{3873218400 7200 0 EET}
|
||||
{3888943200 10800 1 EEST}
|
||||
{3904668000 7200 0 EET}
|
||||
{3920392800 10800 1 EEST}
|
||||
{3936117600 7200 0 EET}
|
||||
{3952447200 10800 1 EEST}
|
||||
{3967567200 7200 0 EET}
|
||||
{3983896800 10800 1 EEST}
|
||||
{3999016800 7200 0 EET}
|
||||
{4015346400 10800 1 EEST}
|
||||
{4031071200 7200 0 EET}
|
||||
{4046796000 10800 1 EEST}
|
||||
{4062520800 7200 0 EET}
|
||||
{4078245600 10800 1 EEST}
|
||||
{4093970400 7200 0 EET}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Jerusalem) {
|
||||
{-9223372036854775808 8456 0 LMT}
|
||||
{-2840149256 8440 0 JMT}
|
||||
{-9223372036854775808 8454 0 LMT}
|
||||
{-2840149254 8440 0 JMT}
|
||||
{-1641003640 7200 0 IST}
|
||||
{-933645600 10800 1 IDT}
|
||||
{-857358000 7200 0 IST}
|
||||
@@ -96,177 +96,177 @@ set TZData(:Asia/Jerusalem) {
|
||||
{1333065600 10800 1 IDT}
|
||||
{1348354800 7200 0 IST}
|
||||
{1364515200 10800 1 IDT}
|
||||
{1381014000 7200 0 IST}
|
||||
{1382828400 7200 0 IST}
|
||||
{1395964800 10800 1 IDT}
|
||||
{1412463600 7200 0 IST}
|
||||
{1414278000 7200 0 IST}
|
||||
{1427414400 10800 1 IDT}
|
||||
{1443913200 7200 0 IST}
|
||||
{1445727600 7200 0 IST}
|
||||
{1458864000 10800 1 IDT}
|
||||
{1475362800 7200 0 IST}
|
||||
{1477782000 7200 0 IST}
|
||||
{1490313600 10800 1 IDT}
|
||||
{1507417200 7200 0 IST}
|
||||
{1509231600 7200 0 IST}
|
||||
{1521763200 10800 1 IDT}
|
||||
{1538866800 7200 0 IST}
|
||||
{1540681200 7200 0 IST}
|
||||
{1553817600 10800 1 IDT}
|
||||
{1570316400 7200 0 IST}
|
||||
{1572130800 7200 0 IST}
|
||||
{1585267200 10800 1 IDT}
|
||||
{1601766000 7200 0 IST}
|
||||
{1603580400 7200 0 IST}
|
||||
{1616716800 10800 1 IDT}
|
||||
{1633215600 7200 0 IST}
|
||||
{1635634800 7200 0 IST}
|
||||
{1648166400 10800 1 IDT}
|
||||
{1664665200 7200 0 IST}
|
||||
{1667084400 7200 0 IST}
|
||||
{1679616000 10800 1 IDT}
|
||||
{1696719600 7200 0 IST}
|
||||
{1698534000 7200 0 IST}
|
||||
{1711670400 10800 1 IDT}
|
||||
{1728169200 7200 0 IST}
|
||||
{1729983600 7200 0 IST}
|
||||
{1743120000 10800 1 IDT}
|
||||
{1759618800 7200 0 IST}
|
||||
{1761433200 7200 0 IST}
|
||||
{1774569600 10800 1 IDT}
|
||||
{1791068400 7200 0 IST}
|
||||
{1792882800 7200 0 IST}
|
||||
{1806019200 10800 1 IDT}
|
||||
{1822604400 7200 0 IST}
|
||||
{1824937200 7200 0 IST}
|
||||
{1837468800 10800 1 IDT}
|
||||
{1854572400 7200 0 IST}
|
||||
{1856386800 7200 0 IST}
|
||||
{1868918400 10800 1 IDT}
|
||||
{1886022000 7200 0 IST}
|
||||
{1887836400 7200 0 IST}
|
||||
{1900972800 10800 1 IDT}
|
||||
{1917471600 7200 0 IST}
|
||||
{1919286000 7200 0 IST}
|
||||
{1932422400 10800 1 IDT}
|
||||
{1948921200 7200 0 IST}
|
||||
{1950735600 7200 0 IST}
|
||||
{1963872000 10800 1 IDT}
|
||||
{1980370800 7200 0 IST}
|
||||
{1982790000 7200 0 IST}
|
||||
{1995321600 10800 1 IDT}
|
||||
{2011820400 7200 0 IST}
|
||||
{2014239600 7200 0 IST}
|
||||
{2026771200 10800 1 IDT}
|
||||
{2043874800 7200 0 IST}
|
||||
{2045689200 7200 0 IST}
|
||||
{2058220800 10800 1 IDT}
|
||||
{2075324400 7200 0 IST}
|
||||
{2077138800 7200 0 IST}
|
||||
{2090275200 10800 1 IDT}
|
||||
{2106774000 7200 0 IST}
|
||||
{2108588400 7200 0 IST}
|
||||
{2121724800 10800 1 IDT}
|
||||
{2138223600 7200 0 IST}
|
||||
{2140038000 7200 0 IST}
|
||||
{2153174400 10800 1 IDT}
|
||||
{2169673200 7200 0 IST}
|
||||
{2172092400 7200 0 IST}
|
||||
{2184624000 10800 1 IDT}
|
||||
{2201122800 7200 0 IST}
|
||||
{2203542000 7200 0 IST}
|
||||
{2216073600 10800 1 IDT}
|
||||
{2233177200 7200 0 IST}
|
||||
{2234991600 7200 0 IST}
|
||||
{2248128000 10800 1 IDT}
|
||||
{2264626800 7200 0 IST}
|
||||
{2266441200 7200 0 IST}
|
||||
{2279577600 10800 1 IDT}
|
||||
{2296076400 7200 0 IST}
|
||||
{2297890800 7200 0 IST}
|
||||
{2311027200 10800 1 IDT}
|
||||
{2327526000 7200 0 IST}
|
||||
{2329340400 7200 0 IST}
|
||||
{2342476800 10800 1 IDT}
|
||||
{2358975600 7200 0 IST}
|
||||
{2361394800 7200 0 IST}
|
||||
{2373926400 10800 1 IDT}
|
||||
{2391030000 7200 0 IST}
|
||||
{2392844400 7200 0 IST}
|
||||
{2405376000 10800 1 IDT}
|
||||
{2422479600 7200 0 IST}
|
||||
{2424294000 7200 0 IST}
|
||||
{2437430400 10800 1 IDT}
|
||||
{2453929200 7200 0 IST}
|
||||
{2455743600 7200 0 IST}
|
||||
{2468880000 10800 1 IDT}
|
||||
{2485378800 7200 0 IST}
|
||||
{2487193200 7200 0 IST}
|
||||
{2500329600 10800 1 IDT}
|
||||
{2516828400 7200 0 IST}
|
||||
{2519247600 7200 0 IST}
|
||||
{2531779200 10800 1 IDT}
|
||||
{2548278000 7200 0 IST}
|
||||
{2550697200 7200 0 IST}
|
||||
{2563228800 10800 1 IDT}
|
||||
{2580332400 7200 0 IST}
|
||||
{2582146800 7200 0 IST}
|
||||
{2595283200 10800 1 IDT}
|
||||
{2611782000 7200 0 IST}
|
||||
{2613596400 7200 0 IST}
|
||||
{2626732800 10800 1 IDT}
|
||||
{2643231600 7200 0 IST}
|
||||
{2645046000 7200 0 IST}
|
||||
{2658182400 10800 1 IDT}
|
||||
{2674681200 7200 0 IST}
|
||||
{2676495600 7200 0 IST}
|
||||
{2689632000 10800 1 IDT}
|
||||
{2706130800 7200 0 IST}
|
||||
{2708550000 7200 0 IST}
|
||||
{2721081600 10800 1 IDT}
|
||||
{2738185200 7200 0 IST}
|
||||
{2739999600 7200 0 IST}
|
||||
{2752531200 10800 1 IDT}
|
||||
{2769634800 7200 0 IST}
|
||||
{2771449200 7200 0 IST}
|
||||
{2784585600 10800 1 IDT}
|
||||
{2801084400 7200 0 IST}
|
||||
{2802898800 7200 0 IST}
|
||||
{2816035200 10800 1 IDT}
|
||||
{2832534000 7200 0 IST}
|
||||
{2834348400 7200 0 IST}
|
||||
{2847484800 10800 1 IDT}
|
||||
{2863983600 7200 0 IST}
|
||||
{2866402800 7200 0 IST}
|
||||
{2878934400 10800 1 IDT}
|
||||
{2895433200 7200 0 IST}
|
||||
{2897852400 7200 0 IST}
|
||||
{2910384000 10800 1 IDT}
|
||||
{2927487600 7200 0 IST}
|
||||
{2929302000 7200 0 IST}
|
||||
{2941833600 10800 1 IDT}
|
||||
{2958937200 7200 0 IST}
|
||||
{2960751600 7200 0 IST}
|
||||
{2973888000 10800 1 IDT}
|
||||
{2990386800 7200 0 IST}
|
||||
{2992201200 7200 0 IST}
|
||||
{3005337600 10800 1 IDT}
|
||||
{3021836400 7200 0 IST}
|
||||
{3023650800 7200 0 IST}
|
||||
{3036787200 10800 1 IDT}
|
||||
{3053286000 7200 0 IST}
|
||||
{3055705200 7200 0 IST}
|
||||
{3068236800 10800 1 IDT}
|
||||
{3084735600 7200 0 IST}
|
||||
{3087154800 7200 0 IST}
|
||||
{3099686400 10800 1 IDT}
|
||||
{3116790000 7200 0 IST}
|
||||
{3118604400 7200 0 IST}
|
||||
{3131740800 10800 1 IDT}
|
||||
{3148239600 7200 0 IST}
|
||||
{3150054000 7200 0 IST}
|
||||
{3163190400 10800 1 IDT}
|
||||
{3179689200 7200 0 IST}
|
||||
{3181503600 7200 0 IST}
|
||||
{3194640000 10800 1 IDT}
|
||||
{3211138800 7200 0 IST}
|
||||
{3212953200 7200 0 IST}
|
||||
{3226089600 10800 1 IDT}
|
||||
{3242588400 7200 0 IST}
|
||||
{3245007600 7200 0 IST}
|
||||
{3257539200 10800 1 IDT}
|
||||
{3274642800 7200 0 IST}
|
||||
{3276457200 7200 0 IST}
|
||||
{3288988800 10800 1 IDT}
|
||||
{3306092400 7200 0 IST}
|
||||
{3307906800 7200 0 IST}
|
||||
{3321043200 10800 1 IDT}
|
||||
{3337542000 7200 0 IST}
|
||||
{3339356400 7200 0 IST}
|
||||
{3352492800 10800 1 IDT}
|
||||
{3368991600 7200 0 IST}
|
||||
{3370806000 7200 0 IST}
|
||||
{3383942400 10800 1 IDT}
|
||||
{3400441200 7200 0 IST}
|
||||
{3402860400 7200 0 IST}
|
||||
{3415392000 10800 1 IDT}
|
||||
{3431890800 7200 0 IST}
|
||||
{3434310000 7200 0 IST}
|
||||
{3446841600 10800 1 IDT}
|
||||
{3463945200 7200 0 IST}
|
||||
{3465759600 7200 0 IST}
|
||||
{3478896000 10800 1 IDT}
|
||||
{3495394800 7200 0 IST}
|
||||
{3497209200 7200 0 IST}
|
||||
{3510345600 10800 1 IDT}
|
||||
{3526844400 7200 0 IST}
|
||||
{3528658800 7200 0 IST}
|
||||
{3541795200 10800 1 IDT}
|
||||
{3558294000 7200 0 IST}
|
||||
{3560108400 7200 0 IST}
|
||||
{3573244800 10800 1 IDT}
|
||||
{3589743600 7200 0 IST}
|
||||
{3592162800 7200 0 IST}
|
||||
{3604694400 10800 1 IDT}
|
||||
{3621798000 7200 0 IST}
|
||||
{3623612400 7200 0 IST}
|
||||
{3636144000 10800 1 IDT}
|
||||
{3653247600 7200 0 IST}
|
||||
{3655062000 7200 0 IST}
|
||||
{3668198400 10800 1 IDT}
|
||||
{3684697200 7200 0 IST}
|
||||
{3686511600 7200 0 IST}
|
||||
{3699648000 10800 1 IDT}
|
||||
{3716146800 7200 0 IST}
|
||||
{3717961200 7200 0 IST}
|
||||
{3731097600 10800 1 IDT}
|
||||
{3747596400 7200 0 IST}
|
||||
{3750015600 7200 0 IST}
|
||||
{3762547200 10800 1 IDT}
|
||||
{3779046000 7200 0 IST}
|
||||
{3781465200 7200 0 IST}
|
||||
{3793996800 10800 1 IDT}
|
||||
{3811100400 7200 0 IST}
|
||||
{3812914800 7200 0 IST}
|
||||
{3825446400 10800 1 IDT}
|
||||
{3842550000 7200 0 IST}
|
||||
{3844364400 7200 0 IST}
|
||||
{3857500800 10800 1 IDT}
|
||||
{3873999600 7200 0 IST}
|
||||
{3875814000 7200 0 IST}
|
||||
{3888950400 10800 1 IDT}
|
||||
{3905449200 7200 0 IST}
|
||||
{3907263600 7200 0 IST}
|
||||
{3920400000 10800 1 IDT}
|
||||
{3936898800 7200 0 IST}
|
||||
{3939318000 7200 0 IST}
|
||||
{3951849600 10800 1 IDT}
|
||||
{3968348400 7200 0 IST}
|
||||
{3970767600 7200 0 IST}
|
||||
{3983299200 10800 1 IDT}
|
||||
{4000402800 7200 0 IST}
|
||||
{4002217200 7200 0 IST}
|
||||
{4015353600 10800 1 IDT}
|
||||
{4031852400 7200 0 IST}
|
||||
{4033666800 7200 0 IST}
|
||||
{4046803200 10800 1 IDT}
|
||||
{4063302000 7200 0 IST}
|
||||
{4065116400 7200 0 IST}
|
||||
{4078252800 10800 1 IDT}
|
||||
{4094751600 7200 0 IST}
|
||||
{4096566000 7200 0 IST}
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ before asking on the list, many questions have already been answered).
|
||||
http://wiki.tcl.tk/_/ref?N=3753
|
||||
http://wiki.tcl.tk/_/ref?N=8361
|
||||
|
||||
- Please report bugs with Tcl or Tk on Mac OS X to the sourceforge bug trackers:
|
||||
http://tcl.sourceforge.net/
|
||||
- Please report bugs with Tcl on Mac OS X to the tracker:
|
||||
http://core.tcl.tk/tcl/reportlist
|
||||
|
||||
2. Using Tcl on Mac OS X
|
||||
------------------------
|
||||
|
||||
+1
-2
@@ -175,8 +175,7 @@ test assemble-4.1 {syntax error} {
|
||||
-match glob
|
||||
-result {1 {extra characters after close-brace} {extra characters after close-brace
|
||||
while executing
|
||||
"{}extra
|
||||
"
|
||||
"{}e"
|
||||
("assemble" body, line 2)*}}
|
||||
}
|
||||
test assemble-4.2 {null command} {
|
||||
|
||||
@@ -609,6 +609,30 @@ test coroutine-7.3 {yielding between coroutines} -body {
|
||||
} -cleanup {
|
||||
catch {rename juggler ""}
|
||||
} -result {{{a b c d e} ::j1 {a b c d} ::j2 {a b c} ::j3 {a b} ::j1 a ::j2} {} {} {}}
|
||||
|
||||
test coroutine-7.4 {Bug 8ff0cb9fe1} -setup {
|
||||
proc foo {a b} {catch yield; return 1}
|
||||
} -cleanup {
|
||||
rename foo {}
|
||||
} -body {
|
||||
coroutine demo lsort -command foo {a b}
|
||||
} -result {b a}
|
||||
|
||||
test coroutine-7.5 {return codes} {
|
||||
set result {}
|
||||
foreach code {0 1 2 3 4 5} {
|
||||
lappend result [catch {coroutine demo return -level 0 -code $code}]
|
||||
}
|
||||
set result
|
||||
} {0 1 2 3 4 5}
|
||||
|
||||
test coroutine-7.6 {Early yield crashes} {
|
||||
proc foo args {}
|
||||
trace add execution foo enter {catch yield}
|
||||
coroutine demo foo
|
||||
rename foo {}
|
||||
} {}
|
||||
|
||||
|
||||
# cleanup
|
||||
unset lambda
|
||||
|
||||
+2
-2
@@ -89,7 +89,7 @@ set printenvScript [makeFile {
|
||||
SHLIB_PATH SYSTEMDRIVE SYSTEMROOT DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH
|
||||
DYLD_NEW_LOCAL_SHARED_REGIONS DYLD_NO_FIX_PREBINDING
|
||||
__CF_USER_TEXT_ENCODING SECURITYSESSIONID LANG WINDIR TERM
|
||||
CommonProgramFiles ProgramFiles
|
||||
CommonProgramFiles ProgramFiles CommonProgramW6432 ProgramW6432
|
||||
} {
|
||||
lrem names $name
|
||||
}
|
||||
@@ -121,7 +121,7 @@ foreach name [array names env] {
|
||||
SYSTEMDRIVE SYSTEMROOT DYLD_LIBRARY_PATH DYLD_FRAMEWORK_PATH
|
||||
DYLD_NEW_LOCAL_SHARED_REGIONS DYLD_NO_FIX_PREBINDING
|
||||
SECURITYSESSIONID LANG WINDIR TERM
|
||||
CommonProgramFiles ProgramFiles
|
||||
CONNOMPROGRAMFILES PROGRAMFILES COMMONPROGRAMW6432 PROGRAMW6432
|
||||
}} {
|
||||
unset env($name)
|
||||
}
|
||||
|
||||
@@ -317,6 +317,12 @@ test error-8.8 {throw syntax checks} -returnCodes error -body {
|
||||
test error-8.9 {throw syntax checks} -returnCodes error -body {
|
||||
throw {} foo
|
||||
} -result {type must be non-empty list}
|
||||
test error-8.10 {Bug 33b7abb8a2: throw stack usage} -returnCodes error -body {
|
||||
apply {code {throw $code foo}} {}
|
||||
} -result {type must be non-empty list}
|
||||
test error-8.11 {Bug 7174354ecb: throw error message} -returnCodes error -body {
|
||||
throw {not {}a list} x[]y
|
||||
} -result {list element in braces followed by "a" instead of space}
|
||||
|
||||
# simple try tests: body completes with code ok
|
||||
|
||||
|
||||
+434
@@ -1961,6 +1961,440 @@ test info-9.13 {info level option, value in global context} -body {
|
||||
uplevel #0 {info level 2}
|
||||
} -returnCodes error -result {bad level "2"}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
catch {*}{
|
||||
{info frame 0}
|
||||
res
|
||||
}
|
||||
return $res
|
||||
}
|
||||
test info-33.4 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 1968 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
dict for {a b} {c d} {*}{
|
||||
{set res [info frame 0]}
|
||||
}
|
||||
return $res
|
||||
}
|
||||
test info-33.5 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 1983 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
set d {a b}
|
||||
dict update d x y {*}{
|
||||
{set res [info frame 0]}
|
||||
}
|
||||
return $res
|
||||
}
|
||||
test info-33.6 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 1998 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
set d {}
|
||||
dict with d {*}{
|
||||
{set res [info frame 0]}
|
||||
}
|
||||
return $res
|
||||
}
|
||||
test info-33.7 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2013 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
for {*}{
|
||||
{set res [info frame 0]}
|
||||
{1} {} {break}
|
||||
}
|
||||
return $res
|
||||
}
|
||||
test info-33.8 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2027 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
for {*}{
|
||||
{} {1} {}
|
||||
{set res [info frame 0]; break}
|
||||
}
|
||||
return $res
|
||||
}
|
||||
test info-33.9 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2043 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
for {*}{
|
||||
{} {1}
|
||||
{return [info frame 0]}
|
||||
{}
|
||||
}
|
||||
}
|
||||
test info-33.10 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2058 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
for {*}{
|
||||
{}
|
||||
{[return [info frame 0]]}
|
||||
{} {}
|
||||
}
|
||||
}
|
||||
test info-33.11 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2073 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
foreach {*}{
|
||||
x
|
||||
} [return [info frame 0]] {}
|
||||
}
|
||||
test info-33.12 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2088 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
foreach {*}{
|
||||
x y
|
||||
{set res [info frame 0]}
|
||||
}
|
||||
return $res
|
||||
}
|
||||
test info-33.13 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2101 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
if {*}{
|
||||
{[return [info frame 0]]}
|
||||
{}
|
||||
}
|
||||
}
|
||||
test info-33.14 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2115 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
if 0 {*}{
|
||||
{} else
|
||||
{return [info frame 0]}
|
||||
}
|
||||
}
|
||||
test info-33.15 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2130 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
incr {*}{
|
||||
x
|
||||
} [return [info frame 0]]
|
||||
}
|
||||
test info-33.16 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2144 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
info level {*}{
|
||||
} [return [info frame 0]]
|
||||
}
|
||||
test info-33.17 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2156 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
string match {*}{
|
||||
} [return [info frame 0]] {}
|
||||
}
|
||||
test info-33.18 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2168 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
string match {*}{
|
||||
{}
|
||||
} [return [info frame 0]]
|
||||
}
|
||||
test info-33.19 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2181 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
string length {*}{
|
||||
} [return [info frame 0]]
|
||||
}
|
||||
test info-33.20 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2193 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
while {*}{
|
||||
{[return [info frame 0]]}
|
||||
} {}
|
||||
}
|
||||
test info-33.21 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2205 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
switch -- {*}{
|
||||
} [return [info frame 0]] {*}{
|
||||
} x y
|
||||
}
|
||||
test info-33.22 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2218 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
try {*}{
|
||||
{set res [info frame 0]}
|
||||
}
|
||||
return $res
|
||||
}
|
||||
test info-33.23 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2231 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
try {*}{
|
||||
{set res [info frame 0]}
|
||||
} finally {}
|
||||
return $res
|
||||
}
|
||||
test info-33.24 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2245 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
try {*}{
|
||||
{set res [info frame 0]}
|
||||
} on ok {} {}
|
||||
return $res
|
||||
}
|
||||
test info-33.25 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2259 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
try {*}{
|
||||
{set res [info frame 0]}
|
||||
} on ok {} {} finally {}
|
||||
return $res
|
||||
}
|
||||
test info-33.26 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2273 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
while 1 {*}{
|
||||
{return [info frame 0]}
|
||||
}
|
||||
}
|
||||
test info-33.27 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2287 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
try {} finally {*}{
|
||||
{return [info frame 0]}
|
||||
}
|
||||
}
|
||||
test info-33.28 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2300 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
try {} on ok {} {} finally {*}{
|
||||
{return [info frame 0]}
|
||||
}
|
||||
}
|
||||
test info-33.29 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2313 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
try {} on ok {} {*}{
|
||||
{return [info frame 0]}
|
||||
}
|
||||
}
|
||||
test info-33.30 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2326 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
try {} on ok {} {*}{
|
||||
{return [info frame 0]}
|
||||
} finally {}
|
||||
}
|
||||
test info-33.31 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2339 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
binary format {*}{
|
||||
} [return [info frame 0]]
|
||||
}
|
||||
test info-33.32 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2352 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
set format format
|
||||
binary $format {*}{
|
||||
} [return [info frame 0]]
|
||||
}
|
||||
test info-33.33 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2365 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
append x {*}{
|
||||
} [return [info frame 0]]
|
||||
}
|
||||
test info-33.34 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2377 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
namespace eval foo {}
|
||||
proc foo::bar {} {
|
||||
append {*}{
|
||||
} x([return [info frame 0]]) {*}{
|
||||
} a
|
||||
}
|
||||
test info-33.35 {{*}, literal, simple, bytecompiled} -body {
|
||||
reduce [foo::bar]
|
||||
} -cleanup {
|
||||
namespace delete foo
|
||||
} -result {type source line 2389 file info.test cmd {info frame 0} proc ::foo::bar level 0}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
unset -nocomplain res
|
||||
|
||||
|
||||
@@ -1599,6 +1599,20 @@ test interp-20.50 {Bug 2486550} -setup {
|
||||
} -cleanup {
|
||||
interp delete slave
|
||||
} -returnCodes error -match glob -result *
|
||||
test interp-20.50.1 {Bug 2486550} -setup {
|
||||
interp create slave
|
||||
} -body {
|
||||
slave hide coroutine
|
||||
catch {slave invokehidden coroutine} m o
|
||||
dict get $o -errorinfo
|
||||
} -cleanup {
|
||||
unset -nocomplain m 0
|
||||
interp delete slave
|
||||
} -returnCodes ok -result {wrong # args: should be "coroutine name cmd ?arg ...?"
|
||||
while executing
|
||||
"coroutine"
|
||||
invoked from within
|
||||
"slave invokehidden coroutine"}
|
||||
|
||||
test interp-21.1 {interp hidden} {
|
||||
interp hidden {}
|
||||
|
||||
+1
-6
@@ -59,12 +59,7 @@ test misc-1.2 {error in variable ref. in command in array reference} {
|
||||
missing close-brace for variable name
|
||||
missing close-brace for variable name
|
||||
while executing
|
||||
"set tst $a([winfo name $\{zz)
|
||||
# this is a bogus comment
|
||||
# this is a bogus comment
|
||||
# this is a bogus comment
|
||||
# this is a bogus comment
|
||||
# this is a ..."
|
||||
"set tst $a([winfo name $\{"
|
||||
(procedure "tstProc" line 4)
|
||||
invoked from within
|
||||
"tstProc"}]
|
||||
|
||||
@@ -936,6 +936,69 @@ test oo-6.18 {Bug 3408830: more forwarding cases} -setup {
|
||||
} -returnCodes error -cleanup {
|
||||
fooClass destroy
|
||||
} -result {wrong # args: should be "::foo len string"}
|
||||
test oo-6.19 {Bug 3610404: forwarding resolution + traces} -setup {
|
||||
oo::object create foo
|
||||
unset -nocomplain ::result
|
||||
set ::result {}
|
||||
} -body {
|
||||
proc ::my {method} {lappend ::result global}
|
||||
oo::objdefine foo {
|
||||
method target {} {lappend ::result instance}
|
||||
forward bar my target
|
||||
method bump {} {
|
||||
set ns [info object namespace ::foo]
|
||||
rename ${ns}::my ${ns}::
|
||||
rename ${ns}:: ${ns}::my
|
||||
}
|
||||
}
|
||||
proc harness {} {
|
||||
foo target
|
||||
foo bar
|
||||
foo target
|
||||
}
|
||||
trace add execution harness enterstep {apply {{cmd args} {foo bump}}}
|
||||
foo target
|
||||
foo bar
|
||||
foo bump
|
||||
foo bar
|
||||
harness
|
||||
} -cleanup {
|
||||
catch {rename harness {}}
|
||||
catch {rename ::my {}}
|
||||
foo destroy
|
||||
} -result {instance instance instance instance instance instance}
|
||||
test oo-6.20 {Bug 3610404: forwarding resolution + traces} -setup {
|
||||
oo::class create fooClass
|
||||
fooClass create foo
|
||||
unset -nocomplain ::result
|
||||
set ::result {}
|
||||
} -body {
|
||||
proc ::my {method} {lappend ::result global}
|
||||
oo::define fooClass {
|
||||
method target {} {lappend ::result class}
|
||||
forward bar my target
|
||||
method bump {} {
|
||||
set ns [info object namespace [self]]
|
||||
rename ${ns}::my ${ns}::
|
||||
rename ${ns}:: ${ns}::my
|
||||
}
|
||||
}
|
||||
proc harness {} {
|
||||
foo target
|
||||
foo bar
|
||||
foo target
|
||||
}
|
||||
trace add execution harness enterstep {apply {{cmd args} {foo bump}}}
|
||||
foo target
|
||||
foo bar
|
||||
foo bump
|
||||
foo bar
|
||||
harness
|
||||
} -cleanup {
|
||||
catch {rename harness {}}
|
||||
catch {rename ::my {}}
|
||||
fooClass destroy
|
||||
} -result {class class class class class class}
|
||||
|
||||
test oo-7.1 {OO: inheritance 101} -setup {
|
||||
oo::class create superClass
|
||||
@@ -3374,6 +3437,42 @@ test oo-34.8 {TIP 380: slots - presence} {
|
||||
test oo-34.9 {TIP 380: slots - presence} {
|
||||
getMethods oo::objdefine::variable
|
||||
} {{-append -clear -set} {Get Set}}
|
||||
|
||||
test oo-35.1 {Bug 9d61624b3d: Empty superclass must not cause crash} -setup {
|
||||
oo::class create fruit {
|
||||
method eat {} {}
|
||||
}
|
||||
set result {}
|
||||
} -body {
|
||||
lappend result [fruit create ::apple] [info class superclasses fruit]
|
||||
oo::define fruit superclass
|
||||
lappend result [info class superclasses fruit] \
|
||||
[info object class apple oo::object] \
|
||||
[info class call fruit destroy] \
|
||||
[catch { apple }]
|
||||
} -cleanup {
|
||||
unset -nocomplain result
|
||||
fruit destroy
|
||||
} -result {::apple ::oo::object ::oo::object 1 {{method destroy ::oo::object {core method: "destroy"}}} 1}
|
||||
test oo-35.2 {Bug 9d61624b3d: Empty superclass must not cause crash} -setup {
|
||||
oo::class create fruitMetaclass {
|
||||
superclass oo::class
|
||||
method eat {} {}
|
||||
}
|
||||
set result {}
|
||||
} -body {
|
||||
lappend result [fruitMetaclass create ::appleClass] \
|
||||
[appleClass create orange] \
|
||||
[info class superclasses fruitMetaclass]
|
||||
oo::define fruitMetaclass superclass
|
||||
lappend result [info class superclasses fruitMetaclass] \
|
||||
[info object class appleClass oo::class] \
|
||||
[catch { orange }] [info object class orange] \
|
||||
[appleClass create pear]
|
||||
} -cleanup {
|
||||
unset -nocomplain result
|
||||
fruitMetaclass destroy
|
||||
} -result {::appleClass ::orange ::oo::class ::oo::class 1 1 ::appleClass ::pear}
|
||||
|
||||
cleanupTests
|
||||
return
|
||||
|
||||
@@ -27,6 +27,7 @@ testConstraint testparsevar [llength [info commands testparsevar]]
|
||||
testConstraint testasync [llength [info commands testasync]]
|
||||
testConstraint testcmdtrace [llength [info commands testcmdtrace]]
|
||||
testConstraint testevent [llength [info commands testevent]]
|
||||
testConstraint memory [llength [info commands memory]]
|
||||
|
||||
test parse-1.1 {Tcl_ParseCommand procedure, computing string length} testparser {
|
||||
testparser [bytestring "foo\0 bar"] -1
|
||||
@@ -678,6 +679,26 @@ test parse-13.5 {Tcl_ParseVar procedure, error looking up variable} testparsevar
|
||||
unset -nocomplain abc
|
||||
list [catch {testparsevar {$abc([bogus x y z])}} msg] $msg
|
||||
} {1 {invalid command name "bogus"}}
|
||||
test parse-13.6 {Tcl_ParseVar memory leak} -constraints memory -setup {
|
||||
proc getbytes {} {
|
||||
return [lindex [split [memory info] \n] 3 3]
|
||||
}
|
||||
} -body {
|
||||
set a() foo
|
||||
set end [getbytes]
|
||||
for {set i 0} {$i < 5} {incr i} {
|
||||
set vn {}
|
||||
set res [testparsevar [append vn $ a([string repeat {[]} 19]) bar]]
|
||||
if {$res ne {foo bar}} {error "Unexpected result: $res"}
|
||||
|
||||
set tmp $end
|
||||
set end [getbytes]
|
||||
}
|
||||
expr {$end - $tmp}
|
||||
} -cleanup {
|
||||
unset -nocomplain a end i vn res tmp
|
||||
rename getbytes {}
|
||||
} -result 0
|
||||
|
||||
test parse-14.1 {Tcl_ParseBraces procedure, computing string length} testparser {
|
||||
testparser [bytestring "foo\0 bar"] -1
|
||||
@@ -1097,6 +1118,12 @@ test parse-21.0 {Bug 1884496} testevent {
|
||||
testevent queue a head $::script
|
||||
vwait done
|
||||
} {}
|
||||
test parse-21.1 {TCL_EVAL_DIRECT coverage} testevent {
|
||||
testevent queue a head {testevent delete a; \
|
||||
set ::done [dict get [info frame 0] line]}
|
||||
vwait done
|
||||
set ::done
|
||||
} 2
|
||||
|
||||
cleanupTests
|
||||
}
|
||||
|
||||
@@ -1155,6 +1155,9 @@ test reg-33.15 {Bug 3603557 - an "in the wild" RE} {
|
||||
(.*) # ConditionalFields
|
||||
}] 0
|
||||
} 68
|
||||
test reg-33.16 {Bug [8d2c0da36d]- another "in the wild" RE} {
|
||||
lindex [regexp -about "^MRK:client1: =1339 14HKelly Talisman 10011000 (\[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]*) \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 8 0 8 0 0 0 77 77 1 1 2 0 11 { 1 3 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 13HC6 My Creator 2 3 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 31HC7 Slightly offensive name, huh 3 8 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 23HE-mail:kelly@hotbox.com 4 9 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 17Hcompface must die 5 10 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 0 3HAir 6 12 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 14HPGP public key 7 13 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 16Hkelly@hotbox.com 8 30 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 0 12H2 text/plain 9 30 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 0 13H2 x-kom/basic 10 33 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 1H0 11 14 8 \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* \[0-9\]* 00000000 1 1H3 }\r?"] 0
|
||||
} 1
|
||||
|
||||
# cleanup
|
||||
::tcltest::cleanupTests
|
||||
|
||||
@@ -876,6 +876,10 @@ test regexp-22.5 {Bug 3610026} -setup {
|
||||
} -cleanup {
|
||||
unset -nocomplain e cp
|
||||
} -returnCodes error -match glob -result {*too many colors*}
|
||||
test regexp-22.6 {Bug 6585b21ca8} {
|
||||
expr {[regexp {(\w).*?\1} Programmer m] ? $m : "<NONE>"}
|
||||
} rogr
|
||||
|
||||
|
||||
test regexp-23.1 {regexp -all and -line} {
|
||||
set string ""
|
||||
|
||||
@@ -140,6 +140,13 @@ test rename-4.7 {reentrancy issues with command deletion and renaming} testdel {
|
||||
if {[info exists env(value)]} {
|
||||
unset env(value)
|
||||
}
|
||||
test rename-4.8 {Bug a16752c252} testdel {
|
||||
set x broken
|
||||
testdel {} foo {set x ok}
|
||||
proc foo args {}
|
||||
rename foo {}
|
||||
return -level 0 $x[unset x]
|
||||
} ok
|
||||
|
||||
# Save the unknown procedure which is modified by the following test.
|
||||
|
||||
|
||||
@@ -425,6 +425,19 @@ test safe-10.1 {testing statics loading} -constraints TcltestPackage -setup {
|
||||
} -returnCodes error -cleanup {
|
||||
safe::interpDelete $i
|
||||
} -result {can't use package in a safe interpreter: no Safepkg1_SafeInit procedure}
|
||||
test safe-10.1.1 {testing statics loading} -constraints TcltestPackage -setup {
|
||||
set i [safe::interpCreate]
|
||||
} -body {
|
||||
catch {interp eval $i {load {} Safepkg1}} m o
|
||||
dict get $o -errorinfo
|
||||
} -returnCodes ok -cleanup {
|
||||
unset -nocomplain m o
|
||||
safe::interpDelete $i
|
||||
} -result {can't use package in a safe interpreter: no Safepkg1_SafeInit procedure
|
||||
invoked from within
|
||||
"load {} Safepkg1"
|
||||
invoked from within
|
||||
"interp eval $i {load {} Safepkg1}"}
|
||||
test safe-10.2 {testing statics loading / -nostatics} -constraints TcltestPackage -body {
|
||||
set i [safe::interpCreate -nostatics]
|
||||
interp eval $i {load {} Safepkg1}
|
||||
@@ -444,6 +457,18 @@ test safe-10.4 {testing nested statics loading / -nestedloadok} -constraints Tcl
|
||||
} -returnCodes error -cleanup {
|
||||
safe::interpDelete $i
|
||||
} -result {can't use package in a safe interpreter: no Safepkg1_SafeInit procedure}
|
||||
test safe-10.4.1 {testing nested statics loading / -nestedloadok} -constraints TcltestPackage -body {
|
||||
set i [safe::interpCreate -nestedloadok]
|
||||
catch {interp eval $i {interp create x; load {} Safepkg1 x}} m o
|
||||
dict get $o -errorinfo
|
||||
} -returnCodes ok -cleanup {
|
||||
unset -nocomplain m o
|
||||
safe::interpDelete $i
|
||||
} -result {can't use package in a safe interpreter: no Safepkg1_SafeInit procedure
|
||||
invoked from within
|
||||
"load {} Safepkg1 x"
|
||||
invoked from within
|
||||
"interp eval $i {interp create x; load {} Safepkg1 x}"}
|
||||
|
||||
test safe-11.1 {testing safe encoding} -setup {
|
||||
set i [safe::interpCreate]
|
||||
@@ -501,6 +526,23 @@ test safe-11.7 {testing safe encoding} -setup {
|
||||
} -returnCodes error -cleanup {
|
||||
safe::interpDelete $i
|
||||
} -result {wrong # args: should be "encoding convertfrom ?encoding? data"}
|
||||
test safe-11.7.1 {testing safe encoding} -setup {
|
||||
set i [safe::interpCreate]
|
||||
} -body {
|
||||
catch {interp eval $i encoding convertfrom} m o
|
||||
dict get $o -errorinfo
|
||||
} -returnCodes ok -cleanup {
|
||||
unset -nocomplain m o
|
||||
safe::interpDelete $i
|
||||
} -result {wrong # args: should be "encoding convertfrom ?encoding? data"
|
||||
while executing
|
||||
"encoding convertfrom"
|
||||
invoked from within
|
||||
"::interp invokehidden interp1 encoding convertfrom"
|
||||
invoked from within
|
||||
"encoding convertfrom"
|
||||
invoked from within
|
||||
"interp eval $i encoding convertfrom"}
|
||||
test safe-11.8 {testing safe encoding} -setup {
|
||||
set i [safe::interpCreate]
|
||||
} -body {
|
||||
@@ -508,6 +550,23 @@ test safe-11.8 {testing safe encoding} -setup {
|
||||
} -returnCodes error -cleanup {
|
||||
safe::interpDelete $i
|
||||
} -result {wrong # args: should be "encoding convertto ?encoding? data"}
|
||||
test safe-11.8.1 {testing safe encoding} -setup {
|
||||
set i [safe::interpCreate]
|
||||
} -body {
|
||||
catch {interp eval $i encoding convertto} m o
|
||||
dict get $o -errorinfo
|
||||
} -returnCodes ok -cleanup {
|
||||
unset -nocomplain m o
|
||||
safe::interpDelete $i
|
||||
} -result {wrong # args: should be "encoding convertto ?encoding? data"
|
||||
while executing
|
||||
"encoding convertto"
|
||||
invoked from within
|
||||
"::interp invokehidden interp1 encoding convertto"
|
||||
invoked from within
|
||||
"encoding convertto"
|
||||
invoked from within
|
||||
"interp eval $i encoding convertto"}
|
||||
|
||||
test safe-12.1 {glob is restricted [Bug 2906841]} -setup {
|
||||
set i [safe::interpCreate]
|
||||
@@ -715,8 +774,29 @@ test safe-15.1 {safe file ensemble does not surprise code} -setup {
|
||||
lappend result [catch {interp eval $i {file split a/b/c}} msg] $msg
|
||||
lappend result [catch {interp eval $i {file isdirectory .}} msg] $msg
|
||||
} -cleanup {
|
||||
unset -nocomplain msg
|
||||
interp delete $i
|
||||
} -result {1 {a b c} 1 {a b c} 1 {invalid command name "file"} 1 0 {a b c} 1 {not allowed to invoke subcommand isdirectory of file}}
|
||||
test safe-15.1.1 {safe file ensemble does not surprise code} -setup {
|
||||
set i [interp create -safe]
|
||||
} -body {
|
||||
set result [expr {"file" in [interp hidden $i]}]
|
||||
lappend result [interp eval $i {tcl::file::split a/b/c}]
|
||||
lappend result [catch {interp eval $i {tcl::file::isdirectory .}}]
|
||||
lappend result [interp invokehidden $i file split a/b/c]
|
||||
lappend result [catch {interp eval $i {file split a/b/c}} msg] $msg
|
||||
lappend result [catch {interp invokehidden $i file isdirectory .}]
|
||||
interp expose $i file
|
||||
lappend result [catch {interp eval $i {file split a/b/c}} msg] $msg
|
||||
lappend result [catch {interp eval $i {file isdirectory .}} msg o] [dict get $o -errorinfo]
|
||||
} -cleanup {
|
||||
unset -nocomplain msg o
|
||||
interp delete $i
|
||||
} -result {1 {a b c} 1 {a b c} 1 {invalid command name "file"} 1 0 {a b c} 1 {not allowed to invoke subcommand isdirectory of file
|
||||
while executing
|
||||
"file isdirectory ."
|
||||
invoked from within
|
||||
"interp eval $i {file isdirectory .}"}}
|
||||
|
||||
### ~ should have no special meaning in paths in safe interpreters
|
||||
test safe-16.1 {Bug 3529949: defang ~ in paths} -setup {
|
||||
|
||||
@@ -293,6 +293,10 @@ test subst-13.1 {Bug 3081065} -setup {
|
||||
} -cleanup {
|
||||
removeFile subst13.tcl
|
||||
}
|
||||
test subst-13.2 {Test for segfault} -body {
|
||||
subst {[}
|
||||
} -returnCodes error -result * -match glob
|
||||
|
||||
|
||||
# cleanup
|
||||
::tcltest::cleanupTests
|
||||
|
||||
@@ -2661,6 +2661,13 @@ test trace-39.1 {bug #3485022: tracing Bc'ed commands} -setup {
|
||||
rename dotrace {}
|
||||
rename foo {}
|
||||
} -result {3 | 0 1 1}
|
||||
|
||||
test trace-40.1 {execution trace errors become command errors} {
|
||||
proc foo args {}
|
||||
trace add execution foo enter {rename foo {}; error bar;#}
|
||||
catch foo m
|
||||
return -level 0 $m[unset m]
|
||||
} bar
|
||||
|
||||
# Delete procedures when done, so we don't clash with other tests
|
||||
# (e.g. foobar will clash with 'unknown' tests).
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
# This file contains a collection of tests for the procedures in the file
|
||||
# tclUnixNotify.c. Sourcing this file into Tcl runs the tests and
|
||||
# generates output for errors. No output means no errors were found.
|
||||
#
|
||||
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
|
||||
# Copyright (c) 1998-1999 by Scriptics Corporation.
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
|
||||
package require tcltest 2
|
||||
namespace import -force ::tcltest::*
|
||||
|
||||
testConstraint testfork [llength [info commands testfork]]
|
||||
|
||||
# Test if the notifier thread is well initialized in a forked interpreter
|
||||
# by Tcl_InitNotifier
|
||||
test unixforkevent-1.1 {fork and test writeable event} \
|
||||
-constraints {testfork nonPortable} \
|
||||
-body {
|
||||
set myFolder [makeDirectory unixtestfork]
|
||||
set pid [testfork]
|
||||
if {$pid == 0} {
|
||||
# we are the forked process
|
||||
set result initialized
|
||||
set h [open [file join $myFolder test.txt] w]
|
||||
fileevent $h writable\
|
||||
"set result writable;\
|
||||
after cancel [after 1000 {set result timeout}]"
|
||||
vwait result
|
||||
close $h
|
||||
makeFile $result result.txt $myFolder
|
||||
exit
|
||||
}
|
||||
# we are the original process
|
||||
while {![file readable [file join $myFolder result.txt]]} {}
|
||||
viewFile result.txt $myFolder
|
||||
} \
|
||||
-result {writable} \
|
||||
-cleanup {
|
||||
catch { removeFolder $myFolder }
|
||||
}
|
||||
|
||||
::tcltest::cleanupTests
|
||||
return
|
||||
+2
-2
@@ -337,8 +337,8 @@ test utf-21.11 {TclUniCharIsControl} {
|
||||
string is control \u00ad
|
||||
} {1}
|
||||
test utf-21.12 {unicode control char in regc_locale.c} {
|
||||
# [Bug 3464428]
|
||||
regexp {^[[:cntrl:]]$} \u00ad
|
||||
# [Bug 3464428], [Bug a876646efe]
|
||||
regexp {^[[:cntrl:]]*$} \u0000\u001f\u00ad
|
||||
} {1}
|
||||
|
||||
test utf-22.1 {TclUniCharIsWordChar} {
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ proc genTable {type} {
|
||||
if {$i == ($last + 1)} {
|
||||
set last $i
|
||||
} else {
|
||||
if {$first > 0} {
|
||||
if {$first >= 0} {
|
||||
emitRange $first $last
|
||||
}
|
||||
set first $i
|
||||
|
||||
+12
-4
@@ -335,7 +335,10 @@ TOMMATH_OBJS = bncore.o bn_reverse.o bn_fast_s_mp_mul_digs.o \
|
||||
bn_mp_unsigned_bin_size.o bn_mp_xor.o bn_mp_zero.o bn_s_mp_add.o \
|
||||
bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o
|
||||
|
||||
STUB_LIB_OBJS = tclStubLib.o tclTomMathStubLib.o tclOOStubLib.o ${COMPAT_OBJS}
|
||||
STUB_LIB_OBJS = tclStubLib.o \
|
||||
tclTomMathStubLib.o \
|
||||
tclOOStubLib.o \
|
||||
${COMPAT_OBJS}
|
||||
|
||||
UNIX_OBJS = tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o \
|
||||
tclUnixFile.o tclUnixPipe.o tclUnixSock.o \
|
||||
@@ -346,6 +349,8 @@ NOTIFY_OBJS = tclUnixNotfy.o
|
||||
|
||||
MAC_OSX_OBJS = tclMacOSXBundle.o tclMacOSXFCmd.o tclMacOSXNotify.o
|
||||
|
||||
CYGWIN_OBJS = tclWinError.o
|
||||
|
||||
DTRACE_OBJ = tclDTrace.o
|
||||
|
||||
ZLIB_OBJS = Zadler32.o Zcompress.o Zcrc32.o Zdeflate.o Zinfback.o \
|
||||
@@ -575,6 +580,9 @@ MAC_OSX_SRCS = \
|
||||
$(MAC_OSX_DIR)/tclMacOSXFCmd.c \
|
||||
$(MAC_OSX_DIR)/tclMacOSXNotify.c
|
||||
|
||||
CYGWIN_SRCS = \
|
||||
$(TOP_DIR)/win/tclWinError.c
|
||||
|
||||
DTRACE_HDR = tclDTrace.h
|
||||
|
||||
DTRACE_SRC = $(GENERIC_DIR)/tclDTrace.d
|
||||
@@ -632,9 +640,9 @@ tclLibObjs:
|
||||
# This targets actually build the objects needed for the lib in the above case
|
||||
objs: ${OBJS}
|
||||
|
||||
${TCL_EXE}: ${TCLSH_OBJS} ${TCL_LIB_FILE}
|
||||
${TCL_EXE}: ${TCLSH_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE}
|
||||
${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} \
|
||||
@TCL_BUILD_LIB_SPEC@ ${LIBS} @EXTRA_TCLSH_LIBS@ \
|
||||
@TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \
|
||||
${CC_SEARCH_FLAGS} -o ${TCL_EXE}
|
||||
|
||||
# Must be empty so it doesn't conflict with rule for ${TCL_EXE} above
|
||||
@@ -1683,7 +1691,7 @@ Zzutil.o: $(ZLIB_DIR)/zutil.c
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
tclStubLib.o: $(GENERIC_DIR)/tclStubLib.c
|
||||
$(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclStubLib.c
|
||||
$(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD $(GENERIC_DIR)/tclStubLib.c
|
||||
|
||||
tclTomMathStubLib.o: $(GENERIC_DIR)/tclTomMathStubLib.c
|
||||
$(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclTomMathStubLib.c
|
||||
|
||||
+3
-2
@@ -163,6 +163,7 @@ you'll see a much more substantial printout for each error. See the README
|
||||
file in the "tests" directory for more information on the test suite. Note:
|
||||
don't run the tests as superuser: this will cause several of them to fail. If
|
||||
a test is failing consistently, please send us a bug report with as much
|
||||
detail as you can manage. Please use the online database at
|
||||
http://tcl.sourceforge.net/
|
||||
detail as you can manage to our tracker:
|
||||
|
||||
http://core.tcl.tk/tcl/reportlist
|
||||
|
||||
|
||||
Vendored
+14
-144
@@ -4821,7 +4821,11 @@ echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you m
|
||||
# Does the pthread-implementation provide
|
||||
# 'pthread_attr_setstacksize' ?
|
||||
|
||||
for ac_func in pthread_attr_setstacksize
|
||||
ac_saved_libs=$LIBS
|
||||
LIBS="$LIBS $THREADS_LIBS"
|
||||
|
||||
|
||||
for ac_func in pthread_attr_setstacksize pthread_atfork
|
||||
do
|
||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||
@@ -4922,6 +4926,7 @@ _ACEOF
|
||||
fi
|
||||
done
|
||||
|
||||
LIBS=$ac_saved_libs
|
||||
else
|
||||
TCL_THREADS=0
|
||||
fi
|
||||
@@ -7068,7 +7073,9 @@ fi
|
||||
SHLIB_CFLAGS=""
|
||||
SHLIB_LD='${CC} -shared'
|
||||
SHLIB_SUFFIX=".dll"
|
||||
DL_OBJS="tclLoadDl.o tclWinError.o"
|
||||
DL_OBJS="tclLoadDl.o"
|
||||
PLAT_OBJS='${CYGWIN_OBJS}'
|
||||
PLAT_SRCS='${CYGWIN_SRCS}'
|
||||
DL_LIBS="-ldl"
|
||||
CC_SEARCH_FLAGS=""
|
||||
LD_SEARCH_FLAGS=""
|
||||
@@ -7727,11 +7734,12 @@ fi
|
||||
OpenBSD-*)
|
||||
arch=`arch -s`
|
||||
case "$arch" in
|
||||
m88k|vax)
|
||||
vax)
|
||||
# Equivalent using configure option --disable-load
|
||||
# Step 4 will set the necessary variables
|
||||
DL_OBJS=""
|
||||
SHLIB_LD_LIBS=""
|
||||
LDFLAGS=""
|
||||
;;
|
||||
*)
|
||||
SHLIB_CFLAGS="-fPIC"
|
||||
@@ -7746,10 +7754,11 @@ fi
|
||||
|
||||
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
|
||||
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
|
||||
LDFLAGS="-Wl,-export-dynamic"
|
||||
;;
|
||||
esac
|
||||
case "$arch" in
|
||||
m88k|vax)
|
||||
vax)
|
||||
CFLAGS_OPTIMIZE="-O1"
|
||||
;;
|
||||
sh)
|
||||
@@ -7759,43 +7768,6 @@ fi
|
||||
CFLAGS_OPTIMIZE="-O2"
|
||||
;;
|
||||
esac
|
||||
echo "$as_me:$LINENO: checking for ELF" >&5
|
||||
echo $ECHO_N "checking for ELF... $ECHO_C" >&6
|
||||
if test "${tcl_cv_ld_elf+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
#ifdef __ELF__
|
||||
yes
|
||||
#endif
|
||||
|
||||
_ACEOF
|
||||
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||
$EGREP "yes" >/dev/null 2>&1; then
|
||||
tcl_cv_ld_elf=yes
|
||||
else
|
||||
tcl_cv_ld_elf=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $tcl_cv_ld_elf" >&5
|
||||
echo "${ECHO_T}$tcl_cv_ld_elf" >&6
|
||||
if test $tcl_cv_ld_elf = yes; then
|
||||
|
||||
LDFLAGS=-Wl,-export-dynamic
|
||||
|
||||
else
|
||||
LDFLAGS=""
|
||||
fi
|
||||
|
||||
if test "${TCL_THREADS}" = "1"; then
|
||||
|
||||
# On OpenBSD: Compile with -pthread
|
||||
@@ -9788,7 +9760,7 @@ cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include <sys/types.h>
|
||||
#include <sys/dirent.h>
|
||||
#include <dirent.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
@@ -17980,108 +17952,6 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
|
||||
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
for ac_func in pthread_atfork
|
||||
do
|
||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
|
||||
if eval "test \"\${$as_ac_var+set}\" = set"; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
|
||||
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
||||
#define $ac_func innocuous_$ac_func
|
||||
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func (); below.
|
||||
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
||||
<limits.h> exists even on freestanding compilers. */
|
||||
|
||||
#ifdef __STDC__
|
||||
# include <limits.h>
|
||||
#else
|
||||
# include <assert.h>
|
||||
#endif
|
||||
|
||||
#undef $ac_func
|
||||
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char $ac_func ();
|
||||
/* The GNU C library defines this for functions which it implements
|
||||
to always fail with ENOSYS. Some functions are actually named
|
||||
something starting with __ and the normal name is an alias. */
|
||||
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
|
||||
choke me
|
||||
#else
|
||||
char (*f) () = $ac_func;
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return f != $ac_func;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; } &&
|
||||
{ ac_try='test -s conftest$ac_exeext'
|
||||
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); }; }; then
|
||||
eval "$as_ac_var=yes"
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
eval "$as_ac_var=no"
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
|
||||
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
|
||||
if test `eval echo '${'$as_ac_var'}'` = yes; then
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -576,7 +576,6 @@ if test "`uname -s`" = "Darwin" ; then
|
||||
if test $tcl_corefoundation = yes; then
|
||||
AC_CHECK_HEADERS(libkern/OSAtomic.h)
|
||||
AC_CHECK_FUNCS(OSSpinLockLock)
|
||||
AC_CHECK_FUNCS(pthread_atfork)
|
||||
fi
|
||||
AC_DEFINE(USE_VFORK, 1, [Should we use vfork() instead of fork()?])
|
||||
AC_DEFINE(TCL_DEFAULT_ENCODING, "utf-8",
|
||||
|
||||
+17
-18
@@ -676,7 +676,11 @@ AC_DEFUN([SC_ENABLE_THREADS], [
|
||||
|
||||
# Does the pthread-implementation provide
|
||||
# 'pthread_attr_setstacksize' ?
|
||||
AC_CHECK_FUNCS(pthread_attr_setstacksize)
|
||||
|
||||
ac_saved_libs=$LIBS
|
||||
LIBS="$LIBS $THREADS_LIBS"
|
||||
AC_CHECK_FUNCS(pthread_attr_setstacksize pthread_atfork)
|
||||
LIBS=$ac_saved_libs
|
||||
else
|
||||
TCL_THREADS=0
|
||||
fi
|
||||
@@ -1224,7 +1228,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
|
||||
SHLIB_CFLAGS=""
|
||||
SHLIB_LD='${CC} -shared'
|
||||
SHLIB_SUFFIX=".dll"
|
||||
DL_OBJS="tclLoadDl.o tclWinError.o"
|
||||
DL_OBJS="tclLoadDl.o"
|
||||
PLAT_OBJS='${CYGWIN_OBJS}'
|
||||
PLAT_SRCS='${CYGWIN_SRCS}'
|
||||
DL_LIBS="-ldl"
|
||||
CC_SEARCH_FLAGS=""
|
||||
LD_SEARCH_FLAGS=""
|
||||
@@ -1473,11 +1479,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
|
||||
OpenBSD-*)
|
||||
arch=`arch -s`
|
||||
case "$arch" in
|
||||
m88k|vax)
|
||||
vax)
|
||||
# Equivalent using configure option --disable-load
|
||||
# Step 4 will set the necessary variables
|
||||
DL_OBJS=""
|
||||
SHLIB_LD_LIBS=""
|
||||
LDFLAGS=""
|
||||
;;
|
||||
*)
|
||||
SHLIB_CFLAGS="-fPIC"
|
||||
@@ -1489,10 +1496,11 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
|
||||
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
|
||||
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
|
||||
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
|
||||
LDFLAGS="-Wl,-export-dynamic"
|
||||
;;
|
||||
esac
|
||||
case "$arch" in
|
||||
m88k|vax)
|
||||
vax)
|
||||
CFLAGS_OPTIMIZE="-O1"
|
||||
;;
|
||||
sh)
|
||||
@@ -1502,15 +1510,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
|
||||
CFLAGS_OPTIMIZE="-O2"
|
||||
;;
|
||||
esac
|
||||
AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
|
||||
AC_EGREP_CPP(yes, [
|
||||
#ifdef __ELF__
|
||||
yes
|
||||
#endif
|
||||
], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
|
||||
AS_IF([test $tcl_cv_ld_elf = yes], [
|
||||
LDFLAGS=-Wl,-export-dynamic
|
||||
], [LDFLAGS=""])
|
||||
AS_IF([test "${TCL_THREADS}" = "1"], [
|
||||
# On OpenBSD: Compile with -pthread
|
||||
# Don't link with -lpthread
|
||||
@@ -2255,9 +2254,9 @@ AC_DEFUN([SC_PATH_X], [
|
||||
not_really_there=""
|
||||
if test "$no_x" = ""; then
|
||||
if test "$x_includes" = ""; then
|
||||
AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
|
||||
AC_TRY_CPP([#include <X11/Xlib.h>], , not_really_there="yes")
|
||||
else
|
||||
if test ! -r $x_includes/X11/Intrinsic.h; then
|
||||
if test ! -r $x_includes/X11/Xlib.h; then
|
||||
not_really_there="yes"
|
||||
fi
|
||||
fi
|
||||
@@ -2265,11 +2264,11 @@ AC_DEFUN([SC_PATH_X], [
|
||||
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
|
||||
AC_MSG_CHECKING([for X11 header files])
|
||||
found_xincludes="no"
|
||||
AC_TRY_CPP([#include <X11/Intrinsic.h>], found_xincludes="yes", found_xincludes="no")
|
||||
AC_TRY_CPP([#include <X11/Xlib.h>], found_xincludes="yes", found_xincludes="no")
|
||||
if test "$found_xincludes" = "no"; then
|
||||
dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
|
||||
for i in $dirs ; do
|
||||
if test -r $i/X11/Intrinsic.h; then
|
||||
if test -r $i/X11/Xlib.h; then
|
||||
AC_MSG_RESULT([$i])
|
||||
XINCLUDES=" -I$i"
|
||||
found_xincludes="yes"
|
||||
@@ -2640,7 +2639,7 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
|
||||
# Now check for auxiliary declarations
|
||||
AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/dirent.h>],[struct dirent64 p;],
|
||||
#include <dirent.h>],[struct dirent64 p;],
|
||||
tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
|
||||
if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
|
||||
|
||||
+7
-7
@@ -22,14 +22,14 @@ extern Tcl_PackageInitProc Tcltest_SafeInit;
|
||||
#endif /* TCL_TEST */
|
||||
|
||||
#ifdef TCL_XT_TEST
|
||||
extern void XtToolkitInitialize(void);
|
||||
extern int Tclxttest_Init(Tcl_Interp *interp);
|
||||
#endif
|
||||
extern void XtToolkitInitialize(void);
|
||||
extern Tcl_PackageInitProc Tclxttest_Init;
|
||||
#endif /* TCL_XT_TEST */
|
||||
|
||||
/*
|
||||
* The following #if block allows you to change the AppInit function by using
|
||||
* a #define of TCL_LOCAL_APPINIT instead of rewriting this entire file. The
|
||||
* #if checks for that #define and uses Tcl_AppInit if it doesn't exist.
|
||||
* #if checks for that #define and uses Tcl_AppInit if it does not exist.
|
||||
*/
|
||||
|
||||
#ifndef TCL_LOCAL_APPINIT
|
||||
@@ -71,7 +71,7 @@ MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, char ***argv);
|
||||
int
|
||||
main(
|
||||
int argc, /* Number of command-line arguments. */
|
||||
char **argv) /* Values of command-line arguments. */
|
||||
char *argv[]) /* Values of command-line arguments. */
|
||||
{
|
||||
#ifdef TCL_XT_TEST
|
||||
XtToolkitInitialize();
|
||||
@@ -145,8 +145,8 @@ Tcl_AppInit(
|
||||
/*
|
||||
* Specify a user-specific startup file to invoke if the application is
|
||||
* run interactively. Typically the startup file is "~/.apprc" where "app"
|
||||
* is the name of the application. If this line is deleted then no user-
|
||||
* specific startup file will be run under any conditions.
|
||||
* is the name of the application. If this line is deleted then no
|
||||
* user-specific startup file will be run under any conditions.
|
||||
*/
|
||||
|
||||
#ifdef DJGPP
|
||||
|
||||
+118
-7
@@ -96,7 +96,7 @@ typedef struct ThreadSpecificData {
|
||||
* that an event is ready to be processed
|
||||
* by sending this event. */
|
||||
void *hwnd; /* Messaging window. */
|
||||
#else
|
||||
#else /* !__CYGWIN__ */
|
||||
Tcl_Condition waitCV; /* Any other thread alerts a notifier that an
|
||||
* event is ready to be processed by signaling
|
||||
* this condition variable. */
|
||||
@@ -119,6 +119,15 @@ static Tcl_ThreadDataKey dataKey;
|
||||
|
||||
static int notifierCount = 0;
|
||||
|
||||
/*
|
||||
* The following static stores the process ID of the initialized notifier
|
||||
* thread. If it changes, we have passed a fork and we should start a new
|
||||
* notifier thread.
|
||||
*
|
||||
* You must hold the notifierMutex lock before accessing this variable.
|
||||
*/
|
||||
static pid_t processIDInitialized = 0;
|
||||
|
||||
/*
|
||||
* The following variable points to the head of a doubly-linked list of
|
||||
* ThreadSpecificData structures for all threads that are currently waiting on
|
||||
@@ -184,9 +193,15 @@ static Tcl_ThreadId notifierThread;
|
||||
*/
|
||||
|
||||
#ifdef TCL_THREADS
|
||||
static void NotifierThreadProc(ClientData clientData);
|
||||
#endif
|
||||
static int FileHandlerEventProc(Tcl_Event *evPtr, int flags);
|
||||
static void NotifierThreadProc(ClientData clientData);
|
||||
#ifdef HAVE_PTHREAD_ATFORK
|
||||
static int atForkInit = 0;
|
||||
static void AtForkPrepare(void);
|
||||
static void AtForkParent(void);
|
||||
static void AtForkChild(void);
|
||||
#endif /* HAVE_PTHREAD_ATFORK */
|
||||
#endif /* TCL_THREADS */
|
||||
static int FileHandlerEventProc(Tcl_Event *evPtr, int flags);
|
||||
|
||||
/*
|
||||
* Import of Windows API when building threaded with Cygwin.
|
||||
@@ -213,14 +228,14 @@ typedef struct {
|
||||
void *hCursor;
|
||||
void *hbrBackground;
|
||||
void *lpszMenuName;
|
||||
void *lpszClassName;
|
||||
const void *lpszClassName;
|
||||
} WNDCLASS;
|
||||
|
||||
extern void __stdcall CloseHandle(void *);
|
||||
extern void *__stdcall CreateEventW(void *, unsigned char, unsigned char,
|
||||
void *);
|
||||
extern void * __stdcall CreateWindowExW(void *, void *, void *, DWORD, int,
|
||||
int, int, int, void *, void *, void *, void *);
|
||||
extern void * __stdcall CreateWindowExW(void *, const void *, const void *,
|
||||
DWORD, int, int, int, int, void *, void *, void *, void *);
|
||||
extern DWORD __stdcall DefWindowProcW(void *, int, void *, void *);
|
||||
extern unsigned char __stdcall DestroyWindow(void *);
|
||||
extern int __stdcall DispatchMessageW(const MSG *);
|
||||
@@ -275,11 +290,38 @@ Tcl_InitNotifier(void)
|
||||
*/
|
||||
|
||||
Tcl_MutexLock(¬ifierMutex);
|
||||
#ifdef HAVE_PTHREAD_ATFORK
|
||||
/*
|
||||
* Install pthread_atfork handlers to reinitialize the notifier in the
|
||||
* child of a fork.
|
||||
*/
|
||||
|
||||
if (!atForkInit) {
|
||||
int result = pthread_atfork(AtForkPrepare, AtForkParent, AtForkChild);
|
||||
|
||||
if (result) {
|
||||
Tcl_Panic("Tcl_InitNotifier: pthread_atfork failed");
|
||||
}
|
||||
atForkInit = 1;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Check if my process id changed, e.g. I was forked
|
||||
* In this case, restart the notifier thread and close the
|
||||
* pipe to the original notifier thread
|
||||
*/
|
||||
if (notifierCount > 0 && processIDInitialized != getpid()) {
|
||||
notifierCount = 0;
|
||||
processIDInitialized = 0;
|
||||
close(triggerPipe);
|
||||
triggerPipe = -1;
|
||||
}
|
||||
if (notifierCount == 0) {
|
||||
if (TclpThreadCreate(¬ifierThread, NotifierThreadProc, NULL,
|
||||
TCL_THREAD_STACK_DEFAULT, TCL_THREAD_JOINABLE) != TCL_OK) {
|
||||
Tcl_Panic("Tcl_InitNotifier: unable to start notifier thread");
|
||||
}
|
||||
processIDInitialized = getpid();
|
||||
}
|
||||
notifierCount++;
|
||||
|
||||
@@ -1270,6 +1312,75 @@ NotifierThreadProc(
|
||||
|
||||
TclpThreadExit(0);
|
||||
}
|
||||
|
||||
#ifdef HAVE_PTHREAD_ATFORK
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* AtForkPrepare --
|
||||
*
|
||||
* Lock the notifier in preparation for a fork.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
AtForkPrepare(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* AtForkParent --
|
||||
*
|
||||
* Unlock the notifier in the parent after a fork.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
AtForkParent(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* AtForkChild --
|
||||
*
|
||||
* Unlock and reinstall the notifier in the child after a fork.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
AtForkChild(void)
|
||||
{
|
||||
notifierMutex = NULL;
|
||||
notifierCV = NULL;
|
||||
Tcl_InitNotifier();
|
||||
}
|
||||
#endif /* HAVE_PTHREAD_ATFORK */
|
||||
|
||||
#endif /* TCL_THREADS */
|
||||
|
||||
#endif /* !HAVE_COREFOUNDATION */
|
||||
|
||||
@@ -700,8 +700,6 @@ typedef int socklen_t;
|
||||
|
||||
#ifdef TCL_THREADS
|
||||
# include <pthread.h>
|
||||
# undef inet_ntoa
|
||||
# define inet_ntoa(x) TclpInetNtoa(x)
|
||||
#endif /* TCL_THREADS */
|
||||
|
||||
/* FIXME - Hyper-enormous platform assumption! */
|
||||
|
||||
+3
-2
@@ -1131,7 +1131,7 @@ Tcl_OpenTcpClient(
|
||||
{
|
||||
TcpState *state;
|
||||
const char *errorMsg = NULL;
|
||||
struct addrinfo *addrlist = NULL, *myaddrlist = NULL;
|
||||
void *addrlist = NULL, *myaddrlist = NULL;
|
||||
char channelName[SOCK_CHAN_LENGTH];
|
||||
|
||||
/*
|
||||
@@ -1276,7 +1276,8 @@ Tcl_OpenTcpServer(
|
||||
ClientData acceptProcData) /* Data for the callback. */
|
||||
{
|
||||
int status = 0, sock = -1, reuseaddr = 1, chosenport = 0;
|
||||
struct addrinfo *addrlist = NULL, *addrPtr; /* socket address */
|
||||
void *addrlist = NULL;
|
||||
struct addrinfo *addrPtr; /* socket address */
|
||||
TcpState *statePtr = NULL;
|
||||
char channelName[SOCK_CHAN_LENGTH];
|
||||
const char *errorMsg = NULL;
|
||||
|
||||
@@ -67,6 +67,7 @@ static Tcl_CmdProc TestchmodCmd;
|
||||
static Tcl_CmdProc TestfilehandlerCmd;
|
||||
static Tcl_CmdProc TestfilewaitCmd;
|
||||
static Tcl_CmdProc TestfindexecutableCmd;
|
||||
static Tcl_ObjCmdProc TestforkObjCmd;
|
||||
static Tcl_CmdProc TestgetdefencdirCmd;
|
||||
static Tcl_CmdProc TestgetopenfileCmd;
|
||||
static Tcl_CmdProc TestgotsigCmd;
|
||||
@@ -103,6 +104,8 @@ TclplatformtestInit(
|
||||
NULL, NULL);
|
||||
Tcl_CreateCommand(interp, "testfindexecutable", TestfindexecutableCmd,
|
||||
NULL, NULL);
|
||||
Tcl_CreateObjCommand(interp, "testfork", TestforkObjCmd,
|
||||
NULL, NULL);
|
||||
Tcl_CreateCommand(interp, "testgetopenfile", TestgetopenfileCmd,
|
||||
NULL, NULL);
|
||||
Tcl_CreateCommand(interp, "testgetdefenc", TestgetdefencdirCmd,
|
||||
@@ -526,6 +529,52 @@ TestsetdefencdirCmd(
|
||||
Tcl_SetDefaultEncodingDir(argv[1]);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TestforkObjCmd --
|
||||
*
|
||||
* This function implements the "testfork" command. It is used to
|
||||
* fork the Tcl process for specific test cases.
|
||||
*
|
||||
* Results:
|
||||
* A standard Tcl result.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
TestforkObjCmd(
|
||||
ClientData clientData, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const *objv) /* Argument strings. */
|
||||
{
|
||||
pid_t pid;
|
||||
|
||||
if (objc != 1) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
pid = fork();
|
||||
if (pid == -1) {
|
||||
Tcl_AppendResult(interp,
|
||||
"Cannot fork", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
#if !defined(HAVE_PTHREAD_ATFORK) || defined(MAC_OSX_TCL)
|
||||
/* Only needed when pthread_atfork is not present or on OSX. */
|
||||
if (pid==0) {
|
||||
Tcl_InitNotifier();
|
||||
}
|
||||
#endif
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(pid));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
|
||||
@@ -659,6 +659,7 @@ TclpReaddir(
|
||||
return TclOSreaddir(dir);
|
||||
}
|
||||
|
||||
#undef TclpInetNtoa
|
||||
char *
|
||||
TclpInetNtoa(
|
||||
struct in_addr addr)
|
||||
|
||||
+15
-11
@@ -77,10 +77,10 @@ static int initialized = 0;
|
||||
*/
|
||||
|
||||
static int FileHandlerEventProc(Tcl_Event *evPtr, int flags);
|
||||
static void FileProc(ClientData clientData, int *source,
|
||||
static void FileProc(XtPointer clientData, int *source,
|
||||
XtInputId *id);
|
||||
static void NotifierExitHandler(ClientData clientData);
|
||||
static void TimerProc(ClientData clientData, XtIntervalId *id);
|
||||
static void TimerProc(XtPointer clientData, XtIntervalId *id);
|
||||
static void CreateFileHandler(int fd, int mask,
|
||||
Tcl_FileProc *proc, ClientData clientData);
|
||||
static void DeleteFileHandler(int fd);
|
||||
@@ -181,7 +181,7 @@ TclSetAppContext(
|
||||
void
|
||||
InitNotifier(void)
|
||||
{
|
||||
Tcl_NotifierProcs notifier;
|
||||
Tcl_NotifierProcs np;
|
||||
|
||||
/*
|
||||
* Only reinitialize if we are not in exit handling. The notifier can get
|
||||
@@ -193,11 +193,15 @@ InitNotifier(void)
|
||||
return;
|
||||
}
|
||||
|
||||
notifier.createFileHandlerProc = CreateFileHandler;
|
||||
notifier.deleteFileHandlerProc = DeleteFileHandler;
|
||||
notifier.setTimerProc = SetTimer;
|
||||
notifier.waitForEventProc = WaitForEvent;
|
||||
Tcl_SetNotifier(¬ifier);
|
||||
np.createFileHandlerProc = CreateFileHandler;
|
||||
np.deleteFileHandlerProc = DeleteFileHandler;
|
||||
np.setTimerProc = SetTimer;
|
||||
np.waitForEventProc = WaitForEvent;
|
||||
np.initNotifierProc = Tcl_InitNotifier;
|
||||
np.finalizeNotifierProc = Tcl_FinalizeNotifier;
|
||||
np.alertNotifierProc = Tcl_AlertNotifier;
|
||||
np.serviceModeHookProc = Tcl_ServiceModeHook;
|
||||
Tcl_SetNotifier(&np);
|
||||
|
||||
/*
|
||||
* DO NOT create the application context yet; doing so would prevent
|
||||
@@ -205,7 +209,7 @@ InitNotifier(void)
|
||||
*/
|
||||
|
||||
initialized = 1;
|
||||
memset(¬ifier, 0, sizeof(notifier));
|
||||
memset(&np, 0, sizeof(np));
|
||||
Tcl_CreateExitHandler(NotifierExitHandler, NULL);
|
||||
}
|
||||
|
||||
@@ -301,7 +305,7 @@ SetTimer(
|
||||
|
||||
static void
|
||||
TimerProc(
|
||||
ClientData clientData, /* Not used. */
|
||||
XtPointer clientData, /* Not used. */
|
||||
XtIntervalId *id)
|
||||
{
|
||||
if (*id != notifier.currentTimeout) {
|
||||
@@ -488,7 +492,7 @@ DeleteFileHandler(
|
||||
|
||||
static void
|
||||
FileProc(
|
||||
ClientData clientData,
|
||||
XtPointer clientData,
|
||||
int *fd,
|
||||
XtInputId *id)
|
||||
{
|
||||
|
||||
+1
-1
@@ -458,7 +458,7 @@ ${TEST_DLL_FILE}: ${TCLTEST_OBJS} ${TCL_STUB_LIB_FILE}
|
||||
|
||||
# use pre-built zlib1.dll
|
||||
${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE}
|
||||
@if test "@ZLIB_LIBS@set" == "${ZLIB_DIR}/win64/zdll.libset" ; then \
|
||||
@if test "@ZLIB_LIBS@set" != "${ZLIB_DIR}/win32/zdll.libset" ; then \
|
||||
$(COPY) $(ZLIB_DIR)/win64/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \
|
||||
else \
|
||||
$(COPY) $(ZLIB_DIR)/win32/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \
|
||||
|
||||
+2
-2
@@ -91,9 +91,9 @@ Note: Tcl no longer provides support for Win32s.
|
||||
This distribution contains an extensive test suite for Tcl. Some of the
|
||||
tests are timing dependent and will fail from time to time. If a test is
|
||||
failing consistently, please send us a bug report with as much detail as
|
||||
you can manage. Please use the online database at
|
||||
you can manage to our tracker:
|
||||
|
||||
http://tcl.sourceforge.net/
|
||||
http://core.tcl.tk/tcl/reportlist
|
||||
|
||||
In order to run the test suite, you build the "test" target using the
|
||||
appropriate makefile for your compiler.
|
||||
|
||||
Vendored
+11
-1
@@ -4362,7 +4362,17 @@ if test "$tcl_ok" = "yes"; then
|
||||
|
||||
if test "$do64bit" = "yes"; then
|
||||
|
||||
ZLIB_LIBS=\${ZLIB_DIR}/win64/zdll.lib
|
||||
if test "$GCC" == "yes"; then
|
||||
|
||||
ZLIB_LIBS=\${ZLIB_DIR}/win64/libz.dll.a
|
||||
|
||||
|
||||
else
|
||||
|
||||
ZLIB_LIBS=\${ZLIB_DIR}/win64/zdll.lib
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
else
|
||||
|
||||
+5
-1
@@ -129,7 +129,11 @@ AS_IF([test "${enable_shared+set}" = "set"], [
|
||||
AS_IF([test "$tcl_ok" = "yes"], [
|
||||
AC_SUBST(ZLIB_DLL_FILE,[\${ZLIB_DLL_FILE}])
|
||||
AS_IF([test "$do64bit" = "yes"], [
|
||||
AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR}/win64/zdll.lib])
|
||||
AS_IF([test "$GCC" == "yes"],[
|
||||
AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR}/win64/libz.dll.a])
|
||||
], [
|
||||
AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR}/win64/zdll.lib])
|
||||
])
|
||||
], [
|
||||
AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR}/win32/zdll.lib])
|
||||
])
|
||||
|
||||
+11
-10
@@ -3,7 +3,8 @@
|
||||
*
|
||||
* Provides a default version of the main program and Tcl_AppInit
|
||||
* procedure for tclsh and other Tcl-based applications (without Tk).
|
||||
* Note that this program must be built in Win32 console mode to work properly.
|
||||
* Note that this program must be built in Win32 console mode to work
|
||||
* properly.
|
||||
*
|
||||
* Copyright (c) 1993 The Regents of the University of California.
|
||||
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
|
||||
@@ -34,12 +35,12 @@ extern Tcl_PackageInitProc Dde_SafeInit;
|
||||
|
||||
#ifdef TCL_BROKEN_MAINARGS
|
||||
static void setargv(int *argcPtr, TCHAR ***argvPtr);
|
||||
#endif
|
||||
#endif /* TCL_BROKEN_MAINARGS */
|
||||
|
||||
/*
|
||||
* The following #if block allows you to change the AppInit function by using
|
||||
* a #define of TCL_LOCAL_APPINIT instead of rewriting this entire file. The
|
||||
* #if checks for that #define and uses Tcl_AppInit if it doesn't exist.
|
||||
* #if checks for that #define and uses Tcl_AppInit if it does not exist.
|
||||
*/
|
||||
|
||||
#ifndef TCL_LOCAL_APPINIT
|
||||
@@ -80,15 +81,15 @@ MODULE_SCOPE int TCL_LOCAL_MAIN_HOOK(int *argc, TCHAR ***argv);
|
||||
#ifdef TCL_BROKEN_MAINARGS
|
||||
int
|
||||
main(
|
||||
int argc,
|
||||
char *dummy[])
|
||||
int argc, /* Number of command-line arguments. */
|
||||
char *dummy[]) /* Not used. */
|
||||
{
|
||||
TCHAR **argv;
|
||||
#else
|
||||
int
|
||||
_tmain(
|
||||
int argc,
|
||||
TCHAR *argv[])
|
||||
int argc, /* Number of command-line arguments. */
|
||||
TCHAR *argv[]) /* Values of command-line arguments. */
|
||||
{
|
||||
#endif
|
||||
TCHAR *p;
|
||||
@@ -102,7 +103,7 @@ _tmain(
|
||||
|
||||
#ifdef TCL_BROKEN_MAINARGS
|
||||
/*
|
||||
* Get our args from the c-runtime. Ignore lpszCmdLine.
|
||||
* Get our args from the c-runtime. Ignore command line.
|
||||
*/
|
||||
|
||||
setargv(&argc, &argv);
|
||||
@@ -192,8 +193,8 @@ Tcl_AppInit(
|
||||
/*
|
||||
* Specify a user-specific startup file to invoke if the application is
|
||||
* run interactively. Typically the startup file is "~/.apprc" where "app"
|
||||
* is the name of the application. If this line is deleted then no user-
|
||||
* specific startup file will be run under any conditions.
|
||||
* is the name of the application. If this line is deleted then no
|
||||
* user-specific startup file will be run under any conditions.
|
||||
*/
|
||||
|
||||
(Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL,
|
||||
|
||||
+6
-22
@@ -281,16 +281,9 @@ TclWinNoBackslash(
|
||||
/*
|
||||
*---------------------------------------------------------------------------
|
||||
*
|
||||
* TclWinSetInterfaces --
|
||||
* TclpSetInterfaces --
|
||||
*
|
||||
* A helper proc that allows the test library to change the tclWinProcs
|
||||
* structure to dispatch to either the wide-character or multi-byte
|
||||
* versions of the operating system calls, depending on whether Unicode
|
||||
* is the system encoding.
|
||||
*
|
||||
* As well as this, we can also try to load in some additional procs
|
||||
* which may/may not be present depending on the current Windows version
|
||||
* (e.g. Win95 will not have the procs below).
|
||||
* A helper proc that initializes winTCharEncoding.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
@@ -302,15 +295,10 @@ TclWinNoBackslash(
|
||||
*/
|
||||
|
||||
void
|
||||
TclWinSetInterfaces(
|
||||
int wide) /* Non-zero to use wide interfaces, 0
|
||||
* otherwise. */
|
||||
TclpSetInterfaces(void)
|
||||
{
|
||||
TclWinResetInterfaces();
|
||||
|
||||
if (wide) {
|
||||
winTCharEncoding = Tcl_GetEncoding(NULL, "unicode");
|
||||
}
|
||||
TclWinResetInterfaces();
|
||||
winTCharEncoding = Tcl_GetEncoding(NULL, "unicode");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -318,9 +306,7 @@ TclWinSetInterfaces(
|
||||
*
|
||||
* TclWinEncodingsCleanup --
|
||||
*
|
||||
* Called during finalization to free up any encodings we use. The
|
||||
* tclWinProcs-> look up table is still ok to use after this call,
|
||||
* provided no encoding conversion is required.
|
||||
* Called during finalization to free up any encodings we use.
|
||||
*
|
||||
* We also clean up any memory allocated in our mount point map which is
|
||||
* used to follow certain kinds of symlinks. That code should never be
|
||||
@@ -363,8 +349,6 @@ TclWinEncodingsCleanup(void)
|
||||
* TclWinResetInterfaces --
|
||||
*
|
||||
* Called during finalization to reset us to a safe state for reuse.
|
||||
* After this call, it is best not to use the tclWinProcs-> look up table
|
||||
* since it is likely to be different to what is expected.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user