Compare commits
215
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ddabb17f9 | ||
|
|
a3babfe12a | ||
|
|
b6fecacc22 | ||
|
|
360b5c41ee | ||
|
|
5a6443d00e | ||
|
|
7134cd9399 | ||
|
|
1a92fb378c | ||
|
|
ef6f1ba2c3 | ||
|
|
b0078c8129 | ||
|
|
49e7d0262b | ||
|
|
2cbec4bf44 | ||
|
|
7ac39417f1 | ||
|
|
3faf4cc3b8 | ||
|
|
9f699d22a2 | ||
|
|
13667e8096 | ||
|
|
51f7688e96 | ||
|
|
f6d6b394eb | ||
|
|
7e44dabec3 | ||
|
|
cfefe7127b | ||
|
|
2613112a13 | ||
|
|
18131f9c09 | ||
|
|
baf649278a | ||
|
|
88ec3c9772 | ||
|
|
ad19550909 | ||
|
|
aed72bee30 | ||
|
|
f65cb994d8 | ||
|
|
893c9c7302 | ||
|
|
24817641b1 | ||
|
|
89e6a65411 | ||
|
|
f664d633e6 | ||
|
|
d56e61b246 | ||
|
|
8dd58baa04 | ||
|
|
559113cc4c | ||
|
|
5dafefe112 | ||
|
|
955507f635 | ||
|
|
e942227f6e | ||
|
|
68b5780dde | ||
|
|
3b7664e77f | ||
|
|
b47b88af9b | ||
|
|
d7a9d63520 | ||
|
|
f716d8815b | ||
|
|
4e0313afe2 | ||
|
|
d9b30b94b8 | ||
|
|
2f8ea1be7c | ||
|
|
59cb45cc16 | ||
|
|
ee5c231ff5 | ||
|
|
604faa265f | ||
|
|
8e80c62f6f | ||
|
|
a417c667a5 | ||
|
|
26326004c6 | ||
|
|
0318c256ed | ||
|
|
704532c57a | ||
|
|
2d415cbf59 | ||
|
|
916f1716f3 | ||
|
|
d297273a13 | ||
|
|
b27238fbbb | ||
|
|
7466351c90 | ||
|
|
58bde2cb77 | ||
|
|
40420634aa | ||
|
|
b52476a5cd | ||
|
|
bc8ffb3922 | ||
|
|
bfb321eb38 | ||
|
|
5c1b9fefdf | ||
|
|
6d936db4a3 | ||
|
|
dd4c175c81 | ||
|
|
29b10229de | ||
|
|
bff00baca2 | ||
|
|
7dfd9c5a96 | ||
|
|
05971adca4 | ||
|
|
2f3edeea43 | ||
|
|
0c0be35710 | ||
|
|
137e142be2 | ||
|
|
8694763c10 | ||
|
|
58cd08bb7d | ||
|
|
730a9a132c | ||
|
|
d7cf041bab | ||
|
|
03f0d60f88 | ||
|
|
92402afe21 | ||
|
|
d9465a5be2 | ||
|
|
52bcb866e5 | ||
|
|
7f5ddf43ee | ||
|
|
484de8b987 | ||
|
|
2b3e403550 | ||
|
|
fa8d5668aa | ||
|
|
24d57ad4ff | ||
|
|
3185389da2 | ||
|
|
164250cf86 | ||
|
|
9c2149012b | ||
|
|
6e056b1e14 | ||
|
|
99ee3e86d7 | ||
|
|
3bbc2317b3 | ||
|
|
7d10d699c7 | ||
|
|
620cf6fa02 | ||
|
|
98e4ac55d2 | ||
|
|
eb64ed3cf0 | ||
|
|
5e0d1d6bc5 | ||
|
|
7565b9ff1e | ||
|
|
10dc783c93 | ||
|
|
0c027bb706 | ||
|
|
c658976cc3 | ||
|
|
1db5ff8c2c | ||
|
|
fbba7d0b1e | ||
|
|
559b8ab9de | ||
|
|
60ef43cb8c | ||
|
|
5c6717b7d5 | ||
|
|
2f8dae1cec | ||
|
|
dac552ac0b | ||
|
|
53ae611583 | ||
|
|
57de194b09 | ||
|
|
5204910c12 | ||
|
|
71d27bd9c6 | ||
|
|
3fa4ffc77a | ||
|
|
d2b69b306e | ||
|
|
db9946ccc3 | ||
|
|
cb0895755d | ||
|
|
b14c2f49d2 | ||
|
|
48ab03f3cd | ||
|
|
de82a1a99e | ||
|
|
7ec17e20d3 | ||
|
|
d95273cf0e | ||
|
|
f87735c127 | ||
|
|
1e769e4b57 | ||
|
|
a8dc863399 | ||
|
|
476a68cbe5 | ||
|
|
54d2883694 | ||
|
|
5a9b116846 | ||
|
|
df4391e23f | ||
|
|
717a98747d | ||
|
|
915359ddce | ||
|
|
999c88ea06 | ||
|
|
790fed46bb | ||
|
|
da01ebeabe | ||
|
|
91d5ac9d0b | ||
|
|
adff5bc1c6 | ||
|
|
eee56ee95a | ||
|
|
9cf7e2a336 | ||
|
|
93082a74a2 | ||
|
|
9f2c3815f7 | ||
|
|
592ab670f3 | ||
|
|
c0e8db49d5 | ||
|
|
d7604e5728 | ||
|
|
8e5b3b87a5 | ||
|
|
d31d858702 | ||
|
|
1234267c92 | ||
|
|
59491ce8ca | ||
|
|
ef89704696 | ||
|
|
1ce240e90f | ||
|
|
c132978e4b | ||
|
|
59f2031ac5 | ||
|
|
f85490f4e1 | ||
|
|
c2be2a28e0 | ||
|
|
4977df535f | ||
|
|
182bace1e3 | ||
|
|
1f33c7ae12 | ||
|
|
78c2c1cedf | ||
|
|
186ecf8003 | ||
|
|
56c0b11912 | ||
|
|
1df1505d69 | ||
|
|
1a08ae6fb4 | ||
|
|
891a0ade43 | ||
|
|
29d06499aa | ||
|
|
ea97de415f | ||
|
|
b327c90dcc | ||
|
|
cd1372b52d | ||
|
|
3b4cf982e3 | ||
|
|
7c4da917a7 | ||
|
|
e36d384130 | ||
|
|
5e53c4c296 | ||
|
|
78fcaa3580 | ||
|
|
11db57d058 | ||
|
|
822a2b50f7 | ||
|
|
fc21aee814 | ||
|
|
d06897f3ea | ||
|
|
1598658a83 | ||
|
|
192fa71096 | ||
|
|
76db7c5c04 | ||
|
|
85f3786d9c | ||
|
|
5e0835667d | ||
|
|
26fe5fff38 | ||
|
|
d75135cca1 | ||
|
|
a5dd225e78 | ||
|
|
5f9519213f | ||
|
|
7bce68fe3b | ||
|
|
600ace1c4b | ||
|
|
62004c9fb4 | ||
|
|
976c48a7f1 | ||
|
|
a3b501f125 | ||
|
|
13d8cae724 | ||
|
|
303cced03d | ||
|
|
3f8809d6ec | ||
|
|
2e512ffbe8 | ||
|
|
aa2667b729 | ||
|
|
0bab3624a9 | ||
|
|
c0726f8f4f | ||
|
|
39ddd8c91b | ||
|
|
d69c1d382b | ||
|
|
14b32b82e1 | ||
|
|
3f60452ac2 | ||
|
|
75b361386e | ||
|
|
f3dba34e63 | ||
|
|
36a7db47de | ||
|
|
97323cd8a0 | ||
|
|
8fa124afba | ||
|
|
df623b6abe | ||
|
|
3ef97fba38 | ||
|
|
a261f7d413 | ||
|
|
50cc521ee3 | ||
|
|
48205fa50d | ||
|
|
9fb06ec1c9 | ||
|
|
f9e188bad3 | ||
|
|
6b65756937 | ||
|
|
a74538b064 | ||
|
|
55787f4f08 | ||
|
|
0d59c187fe | ||
|
|
4d2add8f0f |
@@ -1,5 +1,5 @@
|
||||
README: Tcl
|
||||
This is the Tcl 8.6.2 source distribution.
|
||||
This is the Tcl 8.6.3 source distribution.
|
||||
http://sourceforge.net/projects/tcl/files/Tcl/
|
||||
You can get any source release of Tcl from the URL above.
|
||||
|
||||
|
||||
@@ -8303,11 +8303,11 @@ reported usage of large expressions (porter)
|
||||
|
||||
Many optmizations, improvements, and tightened stack management in bytecode.
|
||||
|
||||
--- Released 8.6.1, September 20, 2013 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.1, September 20, 2013 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2013-09-27 (enhancement) improved ::env synchronization (fellows)
|
||||
|
||||
2013-10-20 (bug fix)[2835313] segfault from
|
||||
2013-10-20 (bug fix)[2835313] segfault from
|
||||
[apply {{} {while 1 {a {*}[return -level 0 -code continue]}}}] (fellows)
|
||||
|
||||
2013-10-22 (bug fix)[3556215] [scan %E%G%X] support (fellows)
|
||||
@@ -8451,4 +8451,45 @@ include ::oo::class (fellows)
|
||||
|
||||
2014-08-25 (TIP 429) New command [string cat] (leitgeb,ferrieux)
|
||||
|
||||
--- Released 8.6.2, August 27, 2014 --- http://core.tcl.tk/tcl/ for details
|
||||
--- Released 8.6.2, August 27, 2014 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2014-08-28 (bug)[b9e1a3] Correct Method Search Order (nadkarni,fellows)
|
||||
=> TclOO 1.0.3
|
||||
|
||||
2014-09-05 (bug)[ccc2c2] Regression [lreplace {} 1 1] (bron,fellows)
|
||||
|
||||
2014-09-08 (bug)<oo-1.18.2> Crash regression in [oo::class destroy] (porter)
|
||||
|
||||
2014-09-09 (bug)[84af11] Regress [regsub -all {\(.*} a(b) {}] (fellows)
|
||||
|
||||
2014-09-10 (bug)[cee90e] [try {} on ok {} - on return {} {}] panic (porter)
|
||||
|
||||
2014-09-20 (feature) [tcl::unsupported::getbytecode] disassember (fellows)
|
||||
|
||||
2014-09-27 (enhancement) [string cat] bytecode optimization (leitgeb,ferrieux)
|
||||
|
||||
2014-09-27 (bug)[82521b] segfault in mangled bytecode (ogilvie,sofer)
|
||||
|
||||
2014-10-02 (bug)[bc5b79] Hang in some [read]s of limited size (rogers,porter)
|
||||
|
||||
2014-10-03 (bug)[bc1a96] segfault in [array set] of traced array (tab,porter)
|
||||
|
||||
2014-10-08 (bug)[59a2e7] MSVC14 compile support (dower,nijtmans)
|
||||
|
||||
2014-10-10 (bug)[ed29c4] [fcopy] treats [blocked] as error (rowen,porter)
|
||||
|
||||
2014-10-10 (bug)[bf7135] regression in Tcl_Write() interface (porter)
|
||||
|
||||
2014-10-18 (bug)[10dc6d] fix [gets] on non-blocking channels (fassel,porter)
|
||||
|
||||
2014-10-26 Support for Windows 10 (nijtmans)
|
||||
|
||||
2014-10-31 (bug)[dcc034] restore [open comX: r+] (lll,nijtmans)
|
||||
|
||||
2014-11-05 (bug)[214cc0] Restore [lappend v] return value (sayers,porter)
|
||||
|
||||
2014-11-06 (bug)[5adc35] Stop forcing EOF to be permanent (porter)
|
||||
|
||||
--- Released 8.6.3, November 12, 2014 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2014-12-17 (TIP 427) [fconfigure $h -connecting, -peername, -sockname] (oehlmann,rmax)
|
||||
|
||||
+10
-23
@@ -86,11 +86,14 @@ operation is being performed on the command. The bit
|
||||
\fBTCL_TRACE_DESTROYED\fR will be set in \fIflags\fR if the trace is about
|
||||
to be destroyed; this information may be useful to \fIproc\fR so that
|
||||
it can clean up its own internal data structures (see the section
|
||||
\fBTCL_TRACE_DESTROYED\fR below for more details). Lastly, the bit
|
||||
\fBTCL_INTERP_DESTROYED\fR will be set if the entire interpreter is being
|
||||
destroyed. When this bit is set, \fIproc\fR must be especially
|
||||
careful in the things it does (see the section \fBTCL_INTERP_DESTROYED\fR
|
||||
below).
|
||||
\fBTCL_TRACE_DESTROYED\fR below for more details). Because the
|
||||
deletion of commands can take place as part of the deletion of the interp
|
||||
that contains them, \fIproc\fR must be careful about checking what
|
||||
the passed in \fIinterp\fR value can be called upon to do.
|
||||
The routine \fBTcl_InterpDeleted\fR is an important tool for this.
|
||||
When \fBTcl_InterpDeleted\fR returns 1, \fIproc\fR will not be able
|
||||
to invoke any scripts in \fIinterp\fR. The function of \fIproc\fR
|
||||
in that circumstance is limited to the cleanup of its own data structures.
|
||||
.PP
|
||||
\fBTcl_UntraceCommand\fR may be used to remove a trace. If the
|
||||
command specified by \fIinterp\fR, \fIcmdName\fR, and \fIflags\fR has
|
||||
@@ -123,7 +126,8 @@ traces for a given command that have the same \fIproc\fR.
|
||||
.PP
|
||||
During rename traces, the command being renamed is visible with both
|
||||
names simultaneously, and the command still exists during delete
|
||||
traces (if \fBTCL_INTERP_DESTROYED\fR is not set). However, there is no
|
||||
traces, unless the interp that contains it is being deleted.
|
||||
However, there is no
|
||||
mechanism for signaling that an error occurred in a trace procedure,
|
||||
so great care should be taken that errors do not get silently lost.
|
||||
.SH "MULTIPLE TRACES"
|
||||
@@ -142,22 +146,5 @@ rename the command, the last renaming takes precedence.
|
||||
In a delete callback to \fIproc\fR, the \fBTCL_TRACE_DESTROYED\fR bit
|
||||
is set in \fIflags\fR.
|
||||
.\" Perhaps need some more comments here? - DKF
|
||||
.SH "TCL_INTERP_DESTROYED"
|
||||
.PP
|
||||
When an interpreter is destroyed, unset traces are called for
|
||||
all of its commands.
|
||||
The \fBTCL_INTERP_DESTROYED\fR bit will be set in the \fIflags\fR
|
||||
argument passed to the trace procedures.
|
||||
Trace procedures must be extremely careful in what they do if
|
||||
the \fBTCL_INTERP_DESTROYED\fR bit is set.
|
||||
It is not safe for the procedures to invoke any Tcl procedures
|
||||
on the interpreter, since its state is partially deleted.
|
||||
All that trace procedures should do under these circumstances is
|
||||
to clean up and free their own internal data structures.
|
||||
.SH BUGS
|
||||
.PP
|
||||
Tcl does not do any error checking to prevent trace procedures
|
||||
from misusing the interpreter during traces with \fBTCL_INTERP_DESTROYED\fR
|
||||
set.
|
||||
.SH KEYWORDS
|
||||
clientData, trace, command
|
||||
|
||||
+13
-48
@@ -361,18 +361,17 @@ may cause this error.
|
||||
A BREAK condition has been detected by your UART (see above).
|
||||
.SH "PORTABILITY ISSUES"
|
||||
.TP
|
||||
\fBWindows \fR(all versions)
|
||||
\fBWindows \fR
|
||||
.
|
||||
Valid values for \fIfileName\fR to open a serial port are of the form
|
||||
\fBcom\fIX\fB:\fR, where \fIX\fR is a number, generally from 1 to 4.
|
||||
This notation only works for serial ports from 1 to 9, if the system
|
||||
happens to have more than four. An attempt to open a serial port that
|
||||
\fBcom\fIX\fB\fR, where \fIX\fR is a number, generally from 1 to 9.
|
||||
A legacy form accepted as well is \fBcom\fIX\fB:\fR. This notation only
|
||||
works for serial ports from 1 to 9. An attempt to open a serial port that
|
||||
does not exist or has a number greater than 9 will fail. An alternate
|
||||
form of opening serial ports is to use the filename \fB\e\e.\ecomX\fR,
|
||||
where X is any number that corresponds to a serial port; please note
|
||||
that this method is considerably slower on Windows 95 and Windows 98.
|
||||
.TP
|
||||
\fBWindows NT\fR
|
||||
form of opening serial ports is to use the filename \fB//./comX\fR,
|
||||
where X is any number that corresponds to a serial port.
|
||||
.RS
|
||||
.PP
|
||||
.
|
||||
When running Tcl interactively, there may be some strange interactions
|
||||
between the real console, if one is present, and a command pipeline that uses
|
||||
@@ -380,45 +379,11 @@ standard input or output. If a command pipeline is opened for reading, some
|
||||
of the lines entered at the console will be sent to the command pipeline and
|
||||
some will be sent to the Tcl evaluator. If a command pipeline is opened for
|
||||
writing, keystrokes entered into the console are not visible until the
|
||||
pipe is closed. This behavior occurs whether the command pipeline is
|
||||
executing 16-bit or 32-bit applications. These problems only occur because
|
||||
both Tcl and the child application are competing for the console at
|
||||
the same time. If the command pipeline is started from a script, so that Tcl
|
||||
is not accessing the console, or if the command pipeline does not use
|
||||
standard input or output, but is redirected from or to a file, then the
|
||||
above problems do not occur.
|
||||
.TP
|
||||
\fBWindows 95\fR
|
||||
.
|
||||
A command pipeline that executes a 16-bit DOS application cannot be opened
|
||||
for both reading and writing, since 16-bit DOS applications that receive
|
||||
standard input from a pipe and send standard output to a pipe run
|
||||
synchronously. Command pipelines that do not execute 16-bit DOS
|
||||
applications run asynchronously and can be opened for both reading and
|
||||
writing.
|
||||
.RS
|
||||
.PP
|
||||
When running Tcl interactively, there may be some strange interactions
|
||||
between the real console, if one is present, and a command pipeline that uses
|
||||
standard input or output. If a command pipeline is opened for reading from
|
||||
a 32-bit application, some of the keystrokes entered at the console will be
|
||||
sent to the command pipeline and some will be sent to the Tcl evaluator. If
|
||||
a command pipeline is opened for writing to a 32-bit application, no output
|
||||
is visible on the console until the pipe is closed. These problems only
|
||||
occur because both Tcl and the child application are competing for the
|
||||
console at the same time. If the command pipeline is started from a script,
|
||||
so that Tcl is not accessing the console, or if the command pipeline does
|
||||
not use standard input or output, but is redirected from or to a file, then
|
||||
the above problems do not occur.
|
||||
.PP
|
||||
Whether or not Tcl is running interactively, if a command pipeline is opened
|
||||
for reading from a 16-bit DOS application, the call to \fBopen\fR will not
|
||||
return until end-of-file has been received from the command pipeline's
|
||||
standard output. If a command pipeline is opened for writing to a 16-bit DOS
|
||||
application, no data will be sent to the command pipeline's standard output
|
||||
until the pipe is actually closed. This problem occurs because 16-bit DOS
|
||||
applications are run synchronously, as described above.
|
||||
.RE
|
||||
pipe is closed. These problems only occur because both Tcl and the child
|
||||
application are competing for the console at the same time. If the command
|
||||
pipeline is started from a script, so that Tcl is not accessing the console,
|
||||
or if the command pipeline does not use standard input or output, but is
|
||||
redirected from or to a file, then the above problems do not occur.
|
||||
.TP
|
||||
\fBUnix\fR\0\0\0\0\0\0\0
|
||||
.
|
||||
|
||||
@@ -97,6 +97,10 @@ writable channel event on the socket to get notified when the
|
||||
asynchronous connection has succeeded or failed. See the \fBvwait\fR
|
||||
and the \fBchan\fR commands for more details on the event loop and
|
||||
channel events.
|
||||
.PP
|
||||
The \fBchan configure\fR option \fB-connecting\fR may be used to check if the connect is still running. To verify a successful connect, the option \fB-error\fR may be checked when \fB-connecting\fR returned 0.
|
||||
.PP
|
||||
Operation without the event queue requires at the moment calls to \fBchan configure\fR to advance the internal state machine.
|
||||
.RE
|
||||
.SH "SERVER SOCKETS"
|
||||
.PP
|
||||
@@ -186,6 +190,11 @@ sockets, this option returns a list of three elements; these are the
|
||||
address, the host name and the port to which the peer socket is connected
|
||||
or bound. If the host name cannot be computed, the second element of the
|
||||
list is identical to the address, its first element.
|
||||
.RE
|
||||
.TP
|
||||
\fB\-connecting\fR
|
||||
.
|
||||
This option is not supported by server sockets. For client sockets, this option returns 1 if an asyncroneous connect is still in progress, 0 otherwise.
|
||||
.PP
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
|
||||
+19
-2
@@ -56,10 +56,10 @@ extern "C" {
|
||||
#define TCL_MAJOR_VERSION 8
|
||||
#define TCL_MINOR_VERSION 6
|
||||
#define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE
|
||||
#define TCL_RELEASE_SERIAL 2
|
||||
#define TCL_RELEASE_SERIAL 3
|
||||
|
||||
#define TCL_VERSION "8.6"
|
||||
#define TCL_PATCH_LEVEL "8.6.2"
|
||||
#define TCL_PATCH_LEVEL "8.6.3"
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------------
|
||||
@@ -2144,11 +2144,28 @@ typedef struct Tcl_EncodingType {
|
||||
* substituting one or more "close" characters in
|
||||
* the destination buffer and then continue to
|
||||
* convert the source.
|
||||
* TCL_ENCODING_NO_TERMINATE - If set, Tcl_ExternalToUtf will not append a
|
||||
* terminating NUL byte. Knowing that it will
|
||||
* not need space to do so, it will fill all
|
||||
* dstLen bytes with encoded UTF-8 content, as
|
||||
* other circumstances permit. If clear, the
|
||||
* default behavior is to reserve a byte in
|
||||
* the dst space for NUL termination, and to
|
||||
* append the NUL byte.
|
||||
* TCL_ENCODING_CHAR_LIMIT - If set and dstCharsPtr is not NULL, then
|
||||
* Tcl_ExternalToUtf takes the initial value
|
||||
* of *dstCharsPtr is taken as a limit of the
|
||||
* maximum number of chars to produce in the
|
||||
* encoded UTF-8 content. Otherwise, the
|
||||
* number of chars produced is controlled only
|
||||
* by other limiting factors.
|
||||
*/
|
||||
|
||||
#define TCL_ENCODING_START 0x01
|
||||
#define TCL_ENCODING_END 0x02
|
||||
#define TCL_ENCODING_STOPONERROR 0x04
|
||||
#define TCL_ENCODING_NO_TERMINATE 0x08
|
||||
#define TCL_ENCODING_CHAR_LIMIT 0x10
|
||||
|
||||
/*
|
||||
* The following definitions are the error codes returned by the conversion
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* until Tcl uses config.h properly.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__BORLANDC__)
|
||||
#if defined(_MSC_VER) || defined(__MSVCRT__) || defined(__BORLANDC__)
|
||||
typedef unsigned long caddr_t;
|
||||
#endif
|
||||
|
||||
|
||||
+3
-1
@@ -840,7 +840,9 @@ Tcl_CreateInterp(void)
|
||||
*/
|
||||
|
||||
Tcl_CreateObjCommand(interp, "::tcl::unsupported::disassemble",
|
||||
Tcl_DisassembleObjCmd, NULL, NULL);
|
||||
Tcl_DisassembleObjCmd, INT2PTR(0), NULL);
|
||||
Tcl_CreateObjCommand(interp, "::tcl::unsupported::getbytecode",
|
||||
Tcl_DisassembleObjCmd, INT2PTR(1), NULL);
|
||||
Tcl_CreateObjCommand(interp, "::tcl::unsupported::representation",
|
||||
Tcl_RepresentationCmd, NULL, NULL);
|
||||
|
||||
|
||||
+228
-109
@@ -26,14 +26,23 @@ static void FreeDictUpdateInfo(ClientData clientData);
|
||||
static void PrintDictUpdateInfo(ClientData clientData,
|
||||
Tcl_Obj *appendObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void DisassembleDictUpdateInfo(ClientData clientData,
|
||||
Tcl_Obj *dictObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static ClientData DupForeachInfo(ClientData clientData);
|
||||
static void FreeForeachInfo(ClientData clientData);
|
||||
static void PrintForeachInfo(ClientData clientData,
|
||||
Tcl_Obj *appendObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void DisassembleForeachInfo(ClientData clientData,
|
||||
Tcl_Obj *dictObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void PrintNewForeachInfo(ClientData clientData,
|
||||
Tcl_Obj *appendObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void DisassembleNewForeachInfo(ClientData clientData,
|
||||
Tcl_Obj *dictObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static int CompileEachloopCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, Command *cmdPtr,
|
||||
CompileEnv *envPtr, int collect);
|
||||
@@ -49,21 +58,24 @@ const AuxDataType tclForeachInfoType = {
|
||||
"ForeachInfo", /* name */
|
||||
DupForeachInfo, /* dupProc */
|
||||
FreeForeachInfo, /* freeProc */
|
||||
PrintForeachInfo /* printProc */
|
||||
PrintForeachInfo, /* printProc */
|
||||
DisassembleForeachInfo /* disassembleProc */
|
||||
};
|
||||
|
||||
const AuxDataType tclNewForeachInfoType = {
|
||||
"NewForeachInfo", /* name */
|
||||
DupForeachInfo, /* dupProc */
|
||||
FreeForeachInfo, /* freeProc */
|
||||
PrintNewForeachInfo /* printProc */
|
||||
PrintNewForeachInfo, /* printProc */
|
||||
DisassembleNewForeachInfo /* disassembleProc */
|
||||
};
|
||||
|
||||
const AuxDataType tclDictUpdateInfoType = {
|
||||
"DictUpdateInfo", /* name */
|
||||
DupDictUpdateInfo, /* dupProc */
|
||||
FreeDictUpdateInfo, /* freeProc */
|
||||
PrintDictUpdateInfo /* printProc */
|
||||
PrintDictUpdateInfo, /* printProc */
|
||||
DisassembleDictUpdateInfo /* disassembleProc */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -165,9 +177,9 @@ TclCompileAppendCmd(
|
||||
*/
|
||||
|
||||
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
|
||||
PushVarNameWord(interp, varTokenPtr, envPtr, TCL_NO_ELEMENT,
|
||||
&localIndex, &isScalar, 1);
|
||||
if (!isScalar || localIndex < 0) {
|
||||
|
||||
localIndex = LocalScalarFromToken(varTokenPtr, envPtr);
|
||||
if (localIndex < 0) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -289,7 +301,8 @@ TclCompileArraySetCmd(
|
||||
* a proc, we cannot do a better compile than generic.
|
||||
*/
|
||||
|
||||
if (envPtr->procPtr == NULL && !(isDataEven && len == 0)) {
|
||||
if ((varTokenPtr->type != TCL_TOKEN_SIMPLE_WORD) ||
|
||||
(envPtr->procPtr == NULL && !(isDataEven && len == 0))) {
|
||||
code = TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
|
||||
goto done;
|
||||
}
|
||||
@@ -330,8 +343,9 @@ TclCompileArraySetCmd(
|
||||
* a non-local variable: upvar from a local one! This consumes the
|
||||
* variable name that was left at stacktop.
|
||||
*/
|
||||
|
||||
localIndex = AnonymousLocal(envPtr);
|
||||
|
||||
localIndex = TclFindCompiledLocal(varTokenPtr->start,
|
||||
varTokenPtr->size, 1, envPtr);
|
||||
PushStringLiteral(envPtr, "0");
|
||||
TclEmitInstInt4(INST_REVERSE, 2, envPtr);
|
||||
TclEmitInstInt4(INST_UPVAR, localIndex, envPtr);
|
||||
@@ -2084,11 +2098,13 @@ TclCompileDictWithCmd(
|
||||
* DupDictUpdateInfo: a copy of the auxiliary data
|
||||
* FreeDictUpdateInfo: none
|
||||
* PrintDictUpdateInfo: none
|
||||
* DisassembleDictUpdateInfo: none
|
||||
*
|
||||
* Side effects:
|
||||
* DupDictUpdateInfo: allocates memory
|
||||
* FreeDictUpdateInfo: releases memory
|
||||
* PrintDictUpdateInfo: none
|
||||
* DisassembleDictUpdateInfo: none
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2131,6 +2147,25 @@ PrintDictUpdateInfo(
|
||||
Tcl_AppendPrintfToObj(appendObj, "%%v%u", duiPtr->varIndices[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DisassembleDictUpdateInfo(
|
||||
ClientData clientData,
|
||||
Tcl_Obj *dictObj,
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
DictUpdateInfo *duiPtr = clientData;
|
||||
int i;
|
||||
Tcl_Obj *variables = Tcl_NewObj();
|
||||
|
||||
for (i=0 ; i<duiPtr->length ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, variables,
|
||||
Tcl_NewIntObj(duiPtr->varIndices[i]));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("variables", -1),
|
||||
variables);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -2368,7 +2403,6 @@ TclCompileForCmd(
|
||||
|
||||
SetLineInformation(2);
|
||||
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
|
||||
TclClearNumConversion(envPtr);
|
||||
|
||||
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
|
||||
if (jumpDist > 127) {
|
||||
@@ -2493,24 +2527,16 @@ CompileEachloopCmd(
|
||||
* (TCL_EACH_*) */
|
||||
{
|
||||
Proc *procPtr = envPtr->procPtr;
|
||||
ForeachInfo *infoPtr; /* Points to the structure describing this
|
||||
ForeachInfo *infoPtr=NULL; /* Points to the structure describing this
|
||||
* foreach command. Stored in a AuxData
|
||||
* record in the ByteCode. */
|
||||
|
||||
Tcl_Token *tokenPtr, *bodyTokenPtr;
|
||||
int jumpBackOffset, infoIndex, range;
|
||||
int numWords, numLists, numVars, loopIndex, i, j, code;
|
||||
int numWords, numLists, i, j, code = TCL_OK;
|
||||
Tcl_Obj *varListObj = NULL;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
/*
|
||||
* We parse the variable list argument words and create two arrays:
|
||||
* varcList[i] is number of variables in i-th var list.
|
||||
* varvList[i] points to array of var names in i-th var list.
|
||||
*/
|
||||
|
||||
int *varcList;
|
||||
const char ***varvList;
|
||||
|
||||
/*
|
||||
* If the foreach command isn't in a procedure, don't compile it inline:
|
||||
* the payoff is too small.
|
||||
@@ -2539,105 +2565,73 @@ CompileEachloopCmd(
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate storage for the varcList and varvList arrays if necessary.
|
||||
* Create and initialize the ForeachInfo and ForeachVarList data
|
||||
* structures describing this command. Then create a AuxData record
|
||||
* pointing to the ForeachInfo structure.
|
||||
*/
|
||||
|
||||
numLists = (numWords - 2)/2;
|
||||
varcList = TclStackAlloc(interp, numLists * sizeof(int));
|
||||
memset(varcList, 0, numLists * sizeof(int));
|
||||
varvList = (const char ***) TclStackAlloc(interp,
|
||||
numLists * sizeof(const char **));
|
||||
memset((char*) varvList, 0, numLists * sizeof(const char **));
|
||||
infoPtr = ckalloc(sizeof(ForeachInfo)
|
||||
+ (numLists - 1) * sizeof(ForeachVarList *));
|
||||
infoPtr->numLists = 0; /* Count this up as we go */
|
||||
|
||||
/*
|
||||
* Break up each var list and set the varcList and varvList arrays. Don't
|
||||
* Parse each var list into sequence of var names. Don't
|
||||
* compile the foreach inline if any var name needs substitutions or isn't
|
||||
* a scalar, or if any var list needs substitutions.
|
||||
*/
|
||||
|
||||
loopIndex = 0;
|
||||
varListObj = Tcl_NewObj();
|
||||
for (i = 0, tokenPtr = parsePtr->tokenPtr;
|
||||
i < numWords-1;
|
||||
i++, tokenPtr = TokenAfter(tokenPtr)) {
|
||||
Tcl_DString varList;
|
||||
ForeachVarList *varListPtr;
|
||||
int numVars;
|
||||
|
||||
if (i%2 != 1) {
|
||||
continue;
|
||||
}
|
||||
if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* Lots of copying going on here. Need a ListObj wizard to show a
|
||||
* better way.
|
||||
*/
|
||||
|
||||
Tcl_DStringInit(&varList);
|
||||
TclDStringAppendToken(&varList, &tokenPtr[1]);
|
||||
code = Tcl_SplitList(NULL, Tcl_DStringValue(&varList),
|
||||
&varcList[loopIndex], &varvList[loopIndex]);
|
||||
Tcl_DStringFree(&varList);
|
||||
if (code != TCL_OK) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
numVars = varcList[loopIndex];
|
||||
|
||||
/*
|
||||
* If the variable list is empty, we can enter an infinite loop when
|
||||
* the interpreted version would not. Take care to ensure this does
|
||||
* not happen. [Bug 1671138]
|
||||
* the interpreted version would not. Take care to ensure this does
|
||||
* not happen. [Bug 1671138]
|
||||
*/
|
||||
|
||||
if (numVars == 0) {
|
||||
if (!TclWordKnownAtCompileTime(tokenPtr, varListObj) ||
|
||||
TCL_OK != Tcl_ListObjLength(NULL, varListObj, &numVars) ||
|
||||
numVars == 0) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
for (j = 0; j < numVars; j++) {
|
||||
const char *varName = varvList[loopIndex][j];
|
||||
varListPtr = ckalloc(sizeof(ForeachVarList)
|
||||
+ (numVars - 1) * sizeof(int));
|
||||
varListPtr->numVars = numVars;
|
||||
infoPtr->varLists[i/2] = varListPtr;
|
||||
infoPtr->numLists++;
|
||||
|
||||
if (!TclIsLocalScalar(varName, (int) strlen(varName))) {
|
||||
for (j = 0; j < numVars; j++) {
|
||||
Tcl_Obj *varNameObj;
|
||||
const char *bytes;
|
||||
int numBytes, varIndex;
|
||||
|
||||
Tcl_ListObjIndex(NULL, varListObj, j, &varNameObj);
|
||||
bytes = Tcl_GetStringFromObj(varNameObj, &numBytes);
|
||||
varIndex = LocalScalar(bytes, numBytes, envPtr);
|
||||
if (varIndex < 0) {
|
||||
code = TCL_ERROR;
|
||||
goto done;
|
||||
}
|
||||
varListPtr->varIndexes[j] = varIndex;
|
||||
}
|
||||
loopIndex++;
|
||||
Tcl_SetObjLength(varListObj, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* We will compile the foreach command.
|
||||
*/
|
||||
|
||||
code = TCL_OK;
|
||||
|
||||
/*
|
||||
* Create and initialize the ForeachInfo and ForeachVarList data
|
||||
* structures describing this command. Then create a AuxData record
|
||||
* pointing to the ForeachInfo structure.
|
||||
*/
|
||||
|
||||
infoPtr = ckalloc(sizeof(ForeachInfo)
|
||||
+ (numLists - 1) * sizeof(ForeachVarList *));
|
||||
infoPtr->numLists = numLists;
|
||||
for (loopIndex = 0; loopIndex < numLists; loopIndex++) {
|
||||
ForeachVarList *varListPtr;
|
||||
|
||||
numVars = varcList[loopIndex];
|
||||
varListPtr = ckalloc(sizeof(ForeachVarList)
|
||||
+ (numVars - 1) * sizeof(int));
|
||||
varListPtr->numVars = numVars;
|
||||
for (j = 0; j < numVars; j++) {
|
||||
const char *varName = varvList[loopIndex][j];
|
||||
int nameChars = strlen(varName);
|
||||
|
||||
varListPtr->varIndexes[j] = TclFindCompiledLocal(varName,
|
||||
nameChars, /*create*/ 1, envPtr);
|
||||
}
|
||||
infoPtr->varLists[loopIndex] = varListPtr;
|
||||
}
|
||||
infoIndex = TclCreateAuxData(infoPtr, &tclNewForeachInfoType, envPtr);
|
||||
|
||||
/*
|
||||
@@ -2709,13 +2703,14 @@ CompileEachloopCmd(
|
||||
}
|
||||
|
||||
done:
|
||||
for (loopIndex = 0; loopIndex < numLists; loopIndex++) {
|
||||
if (varvList[loopIndex] != NULL) {
|
||||
ckfree(varvList[loopIndex]);
|
||||
if (code == TCL_ERROR) {
|
||||
if (infoPtr) {
|
||||
FreeForeachInfo(infoPtr);
|
||||
}
|
||||
}
|
||||
TclStackFree(interp, (void *)varvList);
|
||||
TclStackFree(interp, varcList);
|
||||
if (varListObj) {
|
||||
Tcl_DecrRefCount(varListObj);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
@@ -2809,10 +2804,10 @@ FreeForeachInfo(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* PrintForeachInfo --
|
||||
* PrintForeachInfo, DisassembleForeachInfo --
|
||||
*
|
||||
* Function to write a human-readable representation of a ForeachInfo
|
||||
* structure to stdout for debugging.
|
||||
* Functions to write a human-readable or script-readablerepresentation
|
||||
* of a ForeachInfo structure to a Tcl_Obj for debugging.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
@@ -2892,6 +2887,89 @@ PrintNewForeachInfo(
|
||||
Tcl_AppendToObj(appendObj, "]", -1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DisassembleForeachInfo(
|
||||
ClientData clientData,
|
||||
Tcl_Obj *dictObj,
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
register ForeachInfo *infoPtr = clientData;
|
||||
register ForeachVarList *varsPtr;
|
||||
int i, j;
|
||||
Tcl_Obj *objPtr, *innerPtr;
|
||||
|
||||
/*
|
||||
* Data stores.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
Tcl_ListObjAppendElement(NULL, objPtr,
|
||||
Tcl_NewIntObj(infoPtr->firstValueTemp + i));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("data", -1), objPtr);
|
||||
|
||||
/*
|
||||
* Loop counter.
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("loop", -1),
|
||||
Tcl_NewIntObj(infoPtr->loopCtTemp));
|
||||
|
||||
/*
|
||||
* Assignment targets.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
innerPtr = Tcl_NewObj();
|
||||
varsPtr = infoPtr->varLists[i];
|
||||
for (j=0 ; j<varsPtr->numVars ; j++) {
|
||||
Tcl_ListObjAppendElement(NULL, innerPtr,
|
||||
Tcl_NewIntObj(varsPtr->varIndexes[j]));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("assign", -1), objPtr);
|
||||
}
|
||||
|
||||
static void
|
||||
DisassembleNewForeachInfo(
|
||||
ClientData clientData,
|
||||
Tcl_Obj *dictObj,
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
register ForeachInfo *infoPtr = clientData;
|
||||
register ForeachVarList *varsPtr;
|
||||
int i, j;
|
||||
Tcl_Obj *objPtr, *innerPtr;
|
||||
|
||||
/*
|
||||
* Jump offset.
|
||||
*/
|
||||
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("jumpOffset", -1),
|
||||
Tcl_NewIntObj(infoPtr->loopCtTemp));
|
||||
|
||||
/*
|
||||
* Assignment targets.
|
||||
*/
|
||||
|
||||
objPtr = Tcl_NewObj();
|
||||
for (i=0 ; i<infoPtr->numLists ; i++) {
|
||||
innerPtr = Tcl_NewObj();
|
||||
varsPtr = infoPtr->varLists[i];
|
||||
for (j=0 ; j<varsPtr->numVars ; j++) {
|
||||
Tcl_ListObjAppendElement(NULL, innerPtr,
|
||||
Tcl_NewIntObj(varsPtr->varIndexes[j]));
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, objPtr, innerPtr);
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("assign", -1), objPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -3114,6 +3192,54 @@ TclCompileFormatCmd(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclLocalScalarFromToken --
|
||||
*
|
||||
* Get the index into the table of compiled locals that corresponds
|
||||
* to a local scalar variable name.
|
||||
*
|
||||
* Results:
|
||||
* Returns the non-negative integer index value into the table of
|
||||
* compiled locals corresponding to a local scalar variable name.
|
||||
* If the arguments passed in do not identify a local scalar variable
|
||||
* then return -1.
|
||||
*
|
||||
* Side effects:
|
||||
* May add an entery into the table of compiled locals.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclLocalScalarFromToken(
|
||||
Tcl_Token *tokenPtr,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
int isScalar, index;
|
||||
|
||||
TclPushVarName(NULL, tokenPtr, envPtr, TCL_NO_ELEMENT, &index, &isScalar);
|
||||
if (!isScalar) {
|
||||
index = -1;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
int
|
||||
TclLocalScalar(
|
||||
const char *bytes,
|
||||
int numBytes,
|
||||
CompileEnv *envPtr)
|
||||
{
|
||||
Tcl_Token token[2] = {{TCL_TOKEN_SIMPLE_WORD, NULL, 0, 1},
|
||||
{TCL_TOKEN_TEXT, NULL, 0, 0}};
|
||||
|
||||
token[1].start = bytes;
|
||||
token[1].size = numBytes;
|
||||
return TclLocalScalarFromToken(token, envPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -3172,16 +3298,7 @@ TclPushVarName(
|
||||
nameChars = elNameChars = 0;
|
||||
localIndex = -1;
|
||||
|
||||
/*
|
||||
* Check not only that the type is TCL_TOKEN_SIMPLE_WORD, but whether
|
||||
* curly braces surround the variable name. This really matters for array
|
||||
* elements to handle things like
|
||||
* set {x($foo)} 5
|
||||
* which raises an undefined var error if we are not careful here.
|
||||
*/
|
||||
|
||||
if ((varTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) &&
|
||||
(varTokenPtr->start[0] != '{')) {
|
||||
if (varTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
|
||||
/*
|
||||
* A simple variable name. Divide it up into "name" and "elName"
|
||||
* strings. If it is not a local variable, look it up at runtime.
|
||||
@@ -3205,7 +3322,7 @@ TclPushVarName(
|
||||
}
|
||||
}
|
||||
|
||||
if ((elName != NULL) && elNameChars) {
|
||||
if (!(flags & TCL_NO_ELEMENT) && (elName != NULL) && elNameChars) {
|
||||
/*
|
||||
* An array element, the element name is a simple string:
|
||||
* assemble the corresponding token.
|
||||
@@ -3220,7 +3337,7 @@ TclPushVarName(
|
||||
elemTokenCount = 1;
|
||||
}
|
||||
}
|
||||
} else if (((n = varTokenPtr->numComponents) > 1)
|
||||
} else if (interp && ((n = varTokenPtr->numComponents) > 1)
|
||||
&& (varTokenPtr[1].type == TCL_TOKEN_TEXT)
|
||||
&& (varTokenPtr[n].type == TCL_TOKEN_TEXT)
|
||||
&& (varTokenPtr[n].start[varTokenPtr[n].size - 1] == ')')) {
|
||||
@@ -3256,9 +3373,10 @@ TclPushVarName(
|
||||
nameChars = p - varTokenPtr[1].start;
|
||||
elName = p + 1;
|
||||
remainingChars = (varTokenPtr[2].start - p) - 1;
|
||||
elNameChars = (varTokenPtr[n].start-p) + varTokenPtr[n].size - 2;
|
||||
elNameChars = (varTokenPtr[n].start-p) + varTokenPtr[n].size - 1;
|
||||
|
||||
if (remainingChars) {
|
||||
if (!(flags & TCL_NO_ELEMENT)) {
|
||||
if (remainingChars) {
|
||||
/*
|
||||
* Make a first token with the extra characters in the first
|
||||
* token.
|
||||
@@ -3278,13 +3396,14 @@ TclPushVarName(
|
||||
|
||||
memcpy(elemTokenPtr+1, varTokenPtr+2,
|
||||
(n-1) * sizeof(Tcl_Token));
|
||||
} else {
|
||||
} else {
|
||||
/*
|
||||
* Use the already available tokens.
|
||||
*/
|
||||
|
||||
elemTokenPtr = &varTokenPtr[2];
|
||||
elemTokenCount = n - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3319,7 +3438,7 @@ TclPushVarName(
|
||||
localIndex = -1;
|
||||
}
|
||||
}
|
||||
if (localIndex < 0) {
|
||||
if (interp && localIndex < 0) {
|
||||
PushLiteral(envPtr, name, nameChars);
|
||||
}
|
||||
|
||||
@@ -3336,7 +3455,7 @@ TclPushVarName(
|
||||
PushStringLiteral(envPtr, "");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (interp) {
|
||||
/*
|
||||
* The var name isn't simple: compile and push it.
|
||||
*/
|
||||
|
||||
+24
-17
@@ -281,7 +281,6 @@ TclCompileIfCmd(
|
||||
SetLineInformation(wordIdx);
|
||||
Tcl_ResetResult(interp);
|
||||
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
|
||||
TclClearNumConversion(envPtr);
|
||||
if (jumpFalseFixupArray.next >= jumpFalseFixupArray.end) {
|
||||
TclExpandJumpFixupArray(&jumpFalseFixupArray);
|
||||
}
|
||||
@@ -531,7 +530,6 @@ TclCompileIncrCmd(
|
||||
} else {
|
||||
SetLineInformation(2);
|
||||
CompileTokens(envPtr, incrTokenPtr, interp);
|
||||
TclClearNumConversion(envPtr);
|
||||
}
|
||||
} else { /* No incr amount given so use 1. */
|
||||
haveImmValue = 1;
|
||||
@@ -873,7 +871,7 @@ TclCompileLappendCmd(
|
||||
|
||||
/* TODO: Consider support for compiling expanded args. */
|
||||
numWords = parsePtr->numWords;
|
||||
if (numWords == 1) {
|
||||
if (numWords < 3) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
@@ -1480,7 +1478,7 @@ TclCompileLreplaceCmd(
|
||||
Tcl_Token *tokenPtr, *listTokenPtr;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Obj *tmpObj;
|
||||
int idx1, idx2, i, offset;
|
||||
int idx1, idx2, i, offset, offset2;
|
||||
|
||||
if (parsePtr->numWords < 4) {
|
||||
return TCL_ERROR;
|
||||
@@ -1586,12 +1584,18 @@ TclCompileLreplaceCmd(
|
||||
TclEmitOpcode( INST_GT, envPtr);
|
||||
offset = CurrentOffset(envPtr);
|
||||
TclEmitInstInt1( INST_JUMP_TRUE1, 0, envPtr);
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
TclEmitOpcode( INST_LIST_LENGTH, envPtr);
|
||||
offset2 = CurrentOffset(envPtr);
|
||||
TclEmitInstInt1( INST_JUMP_FALSE1, 0, envPtr);
|
||||
TclEmitPush(TclAddLiteralObj(envPtr, Tcl_ObjPrintf(
|
||||
"list doesn't contain element %d", idx1), NULL), envPtr);
|
||||
CompileReturnInternal(envPtr, INST_RETURN_IMM, TCL_ERROR, 0,
|
||||
Tcl_ObjPrintf("-errorcode {TCL OPERATION LREPLACE BADIDX}"));
|
||||
TclStoreInt1AtPtr(CurrentOffset(envPtr) - offset,
|
||||
envPtr->codeStart + offset + 1);
|
||||
TclStoreInt1AtPtr(CurrentOffset(envPtr) - offset2,
|
||||
envPtr->codeStart + offset2 + 1);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
}
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
@@ -1636,12 +1640,18 @@ TclCompileLreplaceCmd(
|
||||
TclEmitOpcode( INST_GT, envPtr);
|
||||
offset = CurrentOffset(envPtr);
|
||||
TclEmitInstInt1( INST_JUMP_TRUE1, 0, envPtr);
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
TclEmitOpcode( INST_LIST_LENGTH, envPtr);
|
||||
offset2 = CurrentOffset(envPtr);
|
||||
TclEmitInstInt1( INST_JUMP_TRUE1, 0, envPtr);
|
||||
TclEmitPush(TclAddLiteralObj(envPtr, Tcl_ObjPrintf(
|
||||
"list doesn't contain element %d", idx1), NULL), envPtr);
|
||||
CompileReturnInternal(envPtr, INST_RETURN_IMM, TCL_ERROR, 0,
|
||||
Tcl_ObjPrintf("-errorcode {TCL OPERATION LREPLACE BADIDX}"));
|
||||
TclStoreInt1AtPtr(CurrentOffset(envPtr) - offset,
|
||||
envPtr->codeStart + offset + 1);
|
||||
TclStoreInt1AtPtr(CurrentOffset(envPtr) - offset2,
|
||||
envPtr->codeStart + offset2 + 1);
|
||||
TclAdjustStackDepth(-1, envPtr);
|
||||
}
|
||||
TclEmitOpcode( INST_DUP, envPtr);
|
||||
@@ -2034,7 +2044,7 @@ TclCompileNamespaceUpvarCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
|
||||
int isScalar, localIndex, numWords, i;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
|
||||
if (envPtr->procPtr == NULL) {
|
||||
@@ -2069,10 +2079,8 @@ TclCompileNamespaceUpvarCmd(
|
||||
localTokenPtr = TokenAfter(otherTokenPtr);
|
||||
|
||||
CompileWord(envPtr, otherTokenPtr, interp, i);
|
||||
PushVarNameWord(interp, localTokenPtr, envPtr, 0,
|
||||
&localIndex, &isScalar, i+1);
|
||||
|
||||
if ((localIndex < 0) || !isScalar) {
|
||||
localIndex = LocalScalarFromToken(localTokenPtr, envPtr);
|
||||
if (localIndex < 0) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclEmitInstInt4( INST_NSUPVAR, localIndex, envPtr);
|
||||
@@ -2258,7 +2266,7 @@ TclCompileRegexpCmd(
|
||||
* converted pattern as a literal.
|
||||
*/
|
||||
|
||||
if (TclReToGlob(NULL, varTokenPtr[1].start, len, &ds, &exact)
|
||||
if (TclReToGlob(NULL, varTokenPtr[1].start, len, &ds, &exact, NULL)
|
||||
== TCL_OK) {
|
||||
simple = 1;
|
||||
PushLiteral(envPtr, Tcl_DStringValue(&ds),Tcl_DStringLength(&ds));
|
||||
@@ -2350,7 +2358,7 @@ TclCompileRegsubCmd(
|
||||
Tcl_Obj *patternObj = NULL, *replacementObj = NULL;
|
||||
Tcl_DString pattern;
|
||||
const char *bytes;
|
||||
int len, exact, result = TCL_ERROR;
|
||||
int len, exact, quantified, result = TCL_ERROR;
|
||||
|
||||
if (parsePtr->numWords < 5 || parsePtr->numWords > 6) {
|
||||
return TCL_ERROR;
|
||||
@@ -2410,7 +2418,8 @@ TclCompileRegsubCmd(
|
||||
*/
|
||||
|
||||
bytes = Tcl_GetStringFromObj(patternObj, &len);
|
||||
if (TclReToGlob(NULL, bytes, len, &pattern, &exact) != TCL_OK || exact) {
|
||||
if (TclReToGlob(NULL, bytes, len, &pattern, &exact, &quantified)
|
||||
!= TCL_OK || exact || quantified) {
|
||||
goto done;
|
||||
}
|
||||
bytes = Tcl_DStringValue(&pattern);
|
||||
@@ -2752,7 +2761,7 @@ TclCompileUpvarCmd(
|
||||
CompileEnv *envPtr) /* Holds resulting instructions. */
|
||||
{
|
||||
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
|
||||
int isScalar, localIndex, numWords, i;
|
||||
int localIndex, numWords, i;
|
||||
DefineLineInformation; /* TIP #280 */
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
@@ -2815,10 +2824,8 @@ TclCompileUpvarCmd(
|
||||
localTokenPtr = TokenAfter(otherTokenPtr);
|
||||
|
||||
CompileWord(envPtr, otherTokenPtr, interp, i);
|
||||
PushVarNameWord(interp, localTokenPtr, envPtr, 0,
|
||||
&localIndex, &isScalar, i+1);
|
||||
|
||||
if ((localIndex < 0) || !isScalar) {
|
||||
localIndex = LocalScalarFromToken(localTokenPtr, envPtr);
|
||||
if (localIndex < 0) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
TclEmitInstInt4( INST_UPVAR, localIndex, envPtr);
|
||||
|
||||
+35
-5
@@ -28,6 +28,9 @@ static void FreeJumptableInfo(ClientData clientData);
|
||||
static void PrintJumptableInfo(ClientData clientData,
|
||||
Tcl_Obj *appendObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static void DisassembleJumptableInfo(ClientData clientData,
|
||||
Tcl_Obj *dictObj, ByteCode *codePtr,
|
||||
unsigned int pcOffset);
|
||||
static int CompileAssociativeBinaryOpCmd(Tcl_Interp *interp,
|
||||
Tcl_Parse *parsePtr, const char *identity,
|
||||
int instruction, CompileEnv *envPtr);
|
||||
@@ -72,7 +75,8 @@ const AuxDataType tclJumptableInfoType = {
|
||||
"JumptableInfo", /* name */
|
||||
DupJumptableInfo, /* dupProc */
|
||||
FreeJumptableInfo, /* freeProc */
|
||||
PrintJumptableInfo /* printProc */
|
||||
PrintJumptableInfo, /* printProc */
|
||||
DisassembleJumptableInfo /* disassembleProc */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -318,8 +322,8 @@ TclCompileStringCatCmd(
|
||||
CompileWord(envPtr, wordTokenPtr, interp, i);
|
||||
numArgs ++;
|
||||
if (numArgs >= 254) { /* 254 to take care of the possible +1 of "folded" above */
|
||||
TclEmitInstInt1(INST_STR_CONCAT1, 254, envPtr);
|
||||
numArgs -= 253; /* concat pushes 1 obj, the result */
|
||||
TclEmitInstInt1(INST_STR_CONCAT1, numArgs, envPtr);
|
||||
numArgs = 1; /* concat pushes 1 obj, the result */
|
||||
}
|
||||
}
|
||||
wordTokenPtr = TokenAfter(wordTokenPtr);
|
||||
@@ -2091,7 +2095,7 @@ IssueSwitchChainedTests(
|
||||
*/
|
||||
|
||||
if (TclReToGlob(NULL, bodyToken[i]->start,
|
||||
bodyToken[i]->size, &ds, &exact) == TCL_OK) {
|
||||
bodyToken[i]->size, &ds, &exact, NULL) == TCL_OK){
|
||||
simple = 1;
|
||||
PushLiteral(envPtr, Tcl_DStringValue(&ds),
|
||||
Tcl_DStringLength(&ds));
|
||||
@@ -2441,11 +2445,13 @@ IssueSwitchJumpTable(
|
||||
* DupJumptableInfo: a copy of the jump-table
|
||||
* FreeJumptableInfo: none
|
||||
* PrintJumptableInfo: none
|
||||
* DisassembleJumptableInfo: none
|
||||
*
|
||||
* Side effects:
|
||||
* DupJumptableInfo: allocates memory
|
||||
* FreeJumptableInfo: releases memory
|
||||
* PrintJumptableInfo: none
|
||||
* DisassembleJumptableInfo: none
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2508,6 +2514,30 @@ PrintJumptableInfo(
|
||||
keyPtr, pcOffset + offset);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DisassembleJumptableInfo(
|
||||
ClientData clientData,
|
||||
Tcl_Obj *dictObj,
|
||||
ByteCode *codePtr,
|
||||
unsigned int pcOffset)
|
||||
{
|
||||
register JumptableInfo *jtPtr = clientData;
|
||||
Tcl_Obj *mapping = Tcl_NewObj();
|
||||
Tcl_HashEntry *hPtr;
|
||||
Tcl_HashSearch search;
|
||||
const char *keyPtr;
|
||||
int offset;
|
||||
|
||||
hPtr = Tcl_FirstHashEntry(&jtPtr->hashTable, &search);
|
||||
for (; hPtr ; hPtr = Tcl_NextHashEntry(&search)) {
|
||||
keyPtr = Tcl_GetHashKey(&jtPtr->hashTable, hPtr);
|
||||
offset = PTR2INT(Tcl_GetHashValue(hPtr));
|
||||
Tcl_DictObjPut(NULL, mapping, Tcl_NewStringObj(keyPtr, -1),
|
||||
Tcl_NewIntObj(offset));
|
||||
}
|
||||
Tcl_DictObjPut(NULL, dictObj, Tcl_NewStringObj("mapping", -1), mapping);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -3038,6 +3068,7 @@ IssueTryClausesInstructions(
|
||||
if (!handlerTokens[i]) {
|
||||
forwardsNeedFixing = 1;
|
||||
JUMP4( JUMP, forwardsToFix[i]);
|
||||
TclAdjustStackDepth(1, envPtr);
|
||||
} else {
|
||||
int dontChangeOptions;
|
||||
|
||||
@@ -3751,7 +3782,6 @@ TclCompileWhileCmd(
|
||||
}
|
||||
SetLineInformation(1);
|
||||
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
|
||||
TclClearNumConversion(envPtr);
|
||||
|
||||
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
|
||||
if (jumpDist > 127) {
|
||||
|
||||
+40
-43
@@ -365,7 +365,7 @@ static const unsigned char prec[] = {
|
||||
0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0,
|
||||
0,
|
||||
/* Unary operator lexemes */
|
||||
PREC_UNARY, /* UNARY_PLUS */
|
||||
PREC_UNARY, /* UNARY_MINUS */
|
||||
@@ -420,7 +420,7 @@ static const unsigned char instruction[] = {
|
||||
0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0,
|
||||
0,
|
||||
/* Unary operator lexemes */
|
||||
INST_UPLUS, /* UNARY_PLUS */
|
||||
INST_UMINUS, /* UNARY_MINUS */
|
||||
@@ -488,7 +488,7 @@ static const unsigned char Lexeme[] = {
|
||||
|
||||
typedef struct JumpList {
|
||||
JumpFixup jump; /* Pass this argument to matching calls of
|
||||
* TclEmitForwardJump() and
|
||||
* TclEmitForwardJump() and
|
||||
* TclFixupForwardJump(). */
|
||||
struct JumpList *next; /* Point to next item on the stack */
|
||||
} JumpList;
|
||||
@@ -838,7 +838,7 @@ ParseExpr(
|
||||
|
||||
switch (lexeme) {
|
||||
case NUMBER:
|
||||
case BOOLEAN:
|
||||
case BOOLEAN:
|
||||
/*
|
||||
* TODO: Consider using a dict or hash to collapse all
|
||||
* duplicate literals into a single representative value.
|
||||
@@ -861,7 +861,7 @@ ParseExpr(
|
||||
start += scanned;
|
||||
numBytes -= scanned;
|
||||
continue;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1324,7 +1324,7 @@ ParseExpr(
|
||||
nodePtr->mark = MARK_LEFT;
|
||||
nodePtr->left = complete;
|
||||
|
||||
/*
|
||||
/*
|
||||
* The COMMA operator cannot be optimized, since the function
|
||||
* needs all of its arguments, and optimization would reduce the
|
||||
* number. Other binary operators root constant expressions when
|
||||
@@ -1546,7 +1546,7 @@ ConvertTreeToTokens(
|
||||
* Tcl_ParseExpr() we do not change them now. Internally, we can
|
||||
* do better.
|
||||
*/
|
||||
|
||||
|
||||
int toCopy = tokenPtr->numComponents + 1;
|
||||
|
||||
if (tokenPtr->numComponents == tokenPtr[1].numComponents + 1) {
|
||||
@@ -1562,7 +1562,7 @@ ConvertTreeToTokens(
|
||||
subExprTokenPtr->type = TCL_TOKEN_SUB_EXPR;
|
||||
parsePtr->numTokens += toCopy;
|
||||
} else {
|
||||
/*
|
||||
/*
|
||||
* Multiple element word. Create a TCL_TOKEN_SUB_EXPR token to
|
||||
* lead, with fields initialized from the leading token, then
|
||||
* copy entire set of word tokens.
|
||||
@@ -1611,7 +1611,7 @@ ConvertTreeToTokens(
|
||||
case COMMA:
|
||||
case COLON:
|
||||
|
||||
/*
|
||||
/*
|
||||
* Historical practice has been to have no Tcl_Tokens for
|
||||
* these operators.
|
||||
*/
|
||||
@@ -1747,7 +1747,7 @@ ConvertTreeToTokens(
|
||||
/*
|
||||
* Before we leave this node/operator/subexpression for the
|
||||
* last time, finish up its tokens....
|
||||
*
|
||||
*
|
||||
* Our current position scanning the string is where the
|
||||
* substring for the subexpression ends.
|
||||
*/
|
||||
@@ -1967,7 +1967,7 @@ ParseLexeme(
|
||||
|
||||
case 'i':
|
||||
if ((numBytes > 1) && (start[1] == 'n')
|
||||
&& ((numBytes == 2) || !isalpha(UCHAR(start[2])))) {
|
||||
&& ((numBytes == 2) || start[2] & 0x80 || !isalpha(UCHAR(start[2])))) {
|
||||
/*
|
||||
* Must make this check so we can tell the difference between the
|
||||
* "in" operator and the "int" function name and the "infinity"
|
||||
@@ -1981,14 +1981,15 @@ ParseLexeme(
|
||||
|
||||
case 'e':
|
||||
if ((numBytes > 1) && (start[1] == 'q')
|
||||
&& ((numBytes == 2) || !isalpha(UCHAR(start[2])))) {
|
||||
&& ((numBytes == 2) || start[2] & 0x80 || !isalpha(UCHAR(start[2])))) {
|
||||
*lexemePtr = STREQ;
|
||||
return 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
if ((numBytes > 1) && ((numBytes == 2) || !isalpha(UCHAR(start[2])))) {
|
||||
if ((numBytes > 1)
|
||||
&& ((numBytes == 2) || start[2] & 0x80 || !isalpha(UCHAR(start[2])))) {
|
||||
switch (start[1]) {
|
||||
case 'e':
|
||||
*lexemePtr = STRNEQ;
|
||||
@@ -2003,9 +2004,8 @@ ParseLexeme(
|
||||
literal = Tcl_NewObj();
|
||||
if (TclParseNumber(NULL, literal, NULL, start, numBytes, &end,
|
||||
TCL_PARSE_NO_WHITESPACE) == TCL_OK) {
|
||||
if (end < start + numBytes && !isalnum(UCHAR(*end))
|
||||
&& UCHAR(*end) != '_') {
|
||||
|
||||
if (end < start + numBytes && !TclIsBareword(*end)) {
|
||||
|
||||
number:
|
||||
TclInitStringRep(literal, start, end-start);
|
||||
*lexemePtr = NUMBER;
|
||||
@@ -2029,9 +2029,9 @@ ParseLexeme(
|
||||
const char *p = start;
|
||||
|
||||
while (p < end) {
|
||||
if (!isalnum(UCHAR(*p++))) {
|
||||
if (!TclIsBareword(*p++)) {
|
||||
/*
|
||||
* The number has non-bareword characters, so we
|
||||
* The number has non-bareword characters, so we
|
||||
* must treat it as a number.
|
||||
*/
|
||||
goto number;
|
||||
@@ -2054,33 +2054,30 @@ ParseLexeme(
|
||||
}
|
||||
}
|
||||
|
||||
if (Tcl_UtfCharComplete(start, numBytes)) {
|
||||
scanned = Tcl_UtfToUniChar(start, &ch);
|
||||
} else {
|
||||
char utfBytes[TCL_UTF_MAX];
|
||||
/*
|
||||
* We reject leading underscores in bareword. No sensible reason why.
|
||||
* Might be inspired by reserved identifier rules in C, which of course
|
||||
* have no direct relevance here.
|
||||
*/
|
||||
|
||||
memcpy(utfBytes, start, (size_t) numBytes);
|
||||
utfBytes[numBytes] = '\0';
|
||||
scanned = Tcl_UtfToUniChar(utfBytes, &ch);
|
||||
}
|
||||
if (!isalnum(UCHAR(ch))) {
|
||||
if (!TclIsBareword(*start) || *start == '_') {
|
||||
if (Tcl_UtfCharComplete(start, numBytes)) {
|
||||
scanned = Tcl_UtfToUniChar(start, &ch);
|
||||
} else {
|
||||
char utfBytes[TCL_UTF_MAX];
|
||||
|
||||
memcpy(utfBytes, start, (size_t) numBytes);
|
||||
utfBytes[numBytes] = '\0';
|
||||
scanned = Tcl_UtfToUniChar(utfBytes, &ch);
|
||||
}
|
||||
*lexemePtr = INVALID;
|
||||
Tcl_DecrRefCount(literal);
|
||||
return scanned;
|
||||
}
|
||||
end = start;
|
||||
while (isalnum(UCHAR(ch)) || (UCHAR(ch) == '_')) {
|
||||
end += scanned;
|
||||
numBytes -= scanned;
|
||||
if (Tcl_UtfCharComplete(end, numBytes)) {
|
||||
scanned = Tcl_UtfToUniChar(end, &ch);
|
||||
} else {
|
||||
char utfBytes[TCL_UTF_MAX];
|
||||
|
||||
memcpy(utfBytes, end, (size_t) numBytes);
|
||||
utfBytes[numBytes] = '\0';
|
||||
scanned = Tcl_UtfToUniChar(utfBytes, &ch);
|
||||
}
|
||||
while (numBytes && TclIsBareword(*end)) {
|
||||
end += 1;
|
||||
numBytes -= 1;
|
||||
}
|
||||
*lexemePtr = BAREWORD;
|
||||
if (literalPtr) {
|
||||
@@ -2098,7 +2095,7 @@ ParseLexeme(
|
||||
* TclCompileExpr --
|
||||
*
|
||||
* This procedure compiles a string containing a Tcl expression into Tcl
|
||||
* bytecodes.
|
||||
* bytecodes.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
@@ -2333,7 +2330,7 @@ CompileExprTree(
|
||||
* Use the numWords count we've kept to invoke the function
|
||||
* command with the correct number of arguments.
|
||||
*/
|
||||
|
||||
|
||||
if (numWords < 255) {
|
||||
TclEmitInvoke(envPtr, INST_INVOKE_STK1, numWords);
|
||||
} else {
|
||||
@@ -2427,7 +2424,7 @@ CompileExprTree(
|
||||
const char *bytes = TclGetStringFromObj(literal, &length);
|
||||
int index = TclRegisterNewLiteral(envPtr, bytes, length);
|
||||
Tcl_Obj *objPtr = TclFetchLiteral(envPtr, index);
|
||||
|
||||
|
||||
if ((objPtr->typePtr == NULL) && (literal->typePtr != NULL)) {
|
||||
/*
|
||||
* Would like to do this:
|
||||
@@ -2570,7 +2567,7 @@ TclSingleOpCmd(
|
||||
*
|
||||
* TclSortingOpCmd --
|
||||
* Implements the commands:
|
||||
* <, <=, >, >=, ==, eq
|
||||
* <, <=, >, >=, ==, eq
|
||||
* in the ::tcl::mathop namespace. These commands are defined for
|
||||
* arbitrary number of arguments by computing the AND of the base
|
||||
* operator applied to all neighbor argument pairs.
|
||||
|
||||
+11
-818
@@ -55,9 +55,9 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
/* Name Bytes stackEffect #Opnds Operand types */
|
||||
{"done", 1, -1, 0, {OPERAND_NONE}},
|
||||
/* Finish ByteCode execution and return stktop (top stack item) */
|
||||
{"push1", 2, +1, 1, {OPERAND_UINT1}},
|
||||
{"push1", 2, +1, 1, {OPERAND_LIT1}},
|
||||
/* Push object at ByteCode objArray[op1] */
|
||||
{"push4", 5, +1, 1, {OPERAND_UINT4}},
|
||||
{"push4", 5, +1, 1, {OPERAND_LIT4}},
|
||||
/* Push object at ByteCode objArray[op4] */
|
||||
{"pop", 1, -1, 0, {OPERAND_NONE}},
|
||||
/* Pop the topmost stack object */
|
||||
@@ -125,17 +125,17 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
{"incrStkImm", 2, 0, 1, {OPERAND_INT1}},
|
||||
/* Incr general variable; unparsed name is top, amount is op1 */
|
||||
|
||||
{"jump1", 2, 0, 1, {OPERAND_INT1}},
|
||||
{"jump1", 2, 0, 1, {OPERAND_OFFSET1}},
|
||||
/* Jump relative to (pc + op1) */
|
||||
{"jump4", 5, 0, 1, {OPERAND_INT4}},
|
||||
{"jump4", 5, 0, 1, {OPERAND_OFFSET4}},
|
||||
/* Jump relative to (pc + op4) */
|
||||
{"jumpTrue1", 2, -1, 1, {OPERAND_INT1}},
|
||||
{"jumpTrue1", 2, -1, 1, {OPERAND_OFFSET1}},
|
||||
/* Jump relative to (pc + op1) if stktop expr object is true */
|
||||
{"jumpTrue4", 5, -1, 1, {OPERAND_INT4}},
|
||||
{"jumpTrue4", 5, -1, 1, {OPERAND_OFFSET4}},
|
||||
/* Jump relative to (pc + op4) if stktop expr object is true */
|
||||
{"jumpFalse1", 2, -1, 1, {OPERAND_INT1}},
|
||||
{"jumpFalse1", 2, -1, 1, {OPERAND_OFFSET1}},
|
||||
/* Jump relative to (pc + op1) if stktop expr object is false */
|
||||
{"jumpFalse4", 5, -1, 1, {OPERAND_INT4}},
|
||||
{"jumpFalse4", 5, -1, 1, {OPERAND_OFFSET4}},
|
||||
/* Jump relative to (pc + op4) if stktop expr object is false */
|
||||
|
||||
{"lor", 1, -1, 0, {OPERAND_NONE}},
|
||||
@@ -298,7 +298,7 @@ InstructionDesc const tclInstructionTable[] = {
|
||||
/* List Index: push (lindex stktop op4) */
|
||||
{"listRangeImm", 9, 0, 2, {OPERAND_IDX4, OPERAND_IDX4}},
|
||||
/* List Range: push (lrange stktop op4 op4) */
|
||||
{"startCommand", 9, 0, 2, {OPERAND_INT4,OPERAND_UINT4}},
|
||||
{"startCommand", 9, 0, 2, {OPERAND_OFFSET4, OPERAND_UINT4}},
|
||||
/* Start of bytecoded command: op is the length of the cmd's code, op2
|
||||
* is number of commands here */
|
||||
|
||||
@@ -692,11 +692,6 @@ static void RegisterAuxDataType(const AuxDataType *typePtr);
|
||||
static int SetByteCodeFromAny(Tcl_Interp *interp,
|
||||
Tcl_Obj *objPtr);
|
||||
static void StartExpanding(CompileEnv *envPtr);
|
||||
static int FormatInstruction(ByteCode *codePtr,
|
||||
const unsigned char *pc, Tcl_Obj *bufferObj);
|
||||
static void PrintSourceToObj(Tcl_Obj *appendObj,
|
||||
const char *stringPtr, int maxChars);
|
||||
static void UpdateStringOfInstName(Tcl_Obj *objPtr);
|
||||
|
||||
/*
|
||||
* TIP #280: Helper for building the per-word line information of all compiled
|
||||
@@ -734,19 +729,6 @@ static const Tcl_ObjType substCodeType = {
|
||||
NULL, /* setFromAnyProc */
|
||||
};
|
||||
|
||||
/*
|
||||
* The structure below defines an instruction name Tcl object to allow
|
||||
* reporting of inner contexts in errorstack without string allocation.
|
||||
*/
|
||||
|
||||
static const Tcl_ObjType tclInstNameType = {
|
||||
"instname", /* name */
|
||||
NULL, /* freeIntRepProc */
|
||||
NULL, /* dupIntRepProc */
|
||||
UpdateStringOfInstName, /* updateStringProc */
|
||||
NULL, /* setFromAnyProc */
|
||||
};
|
||||
|
||||
/*
|
||||
* Helper macros.
|
||||
*/
|
||||
@@ -4360,10 +4342,11 @@ TclInitAuxDataTypeTable(void)
|
||||
Tcl_InitHashTable(&auxDataTypeTable, TCL_STRING_KEYS);
|
||||
|
||||
/*
|
||||
* There are only three AuxData types at this time, so register them here.
|
||||
* There are only four AuxData types at this time, so register them here.
|
||||
*/
|
||||
|
||||
RegisterAuxDataType(&tclForeachInfoType);
|
||||
RegisterAuxDataType(&tclNewForeachInfoType);
|
||||
RegisterAuxDataType(&tclJumptableInfoType);
|
||||
RegisterAuxDataType(&tclDictUpdateInfoType);
|
||||
}
|
||||
@@ -4596,796 +4579,6 @@ EncodeCmdLocMap(
|
||||
return p;
|
||||
}
|
||||
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclPrintByteCodeObj --
|
||||
*
|
||||
* This procedure prints ("disassembles") the instructions of a bytecode
|
||||
* object to stdout.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
TclPrintByteCodeObj(
|
||||
Tcl_Interp *interp, /* Used only for Tcl_GetStringFromObj. */
|
||||
Tcl_Obj *objPtr) /* The bytecode object to disassemble. */
|
||||
{
|
||||
Tcl_Obj *bufPtr = TclDisassembleByteCodeObj(objPtr);
|
||||
|
||||
fprintf(stdout, "\n%s", TclGetString(bufPtr));
|
||||
Tcl_DecrRefCount(bufPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclPrintInstruction --
|
||||
*
|
||||
* This procedure prints ("disassembles") one instruction from a bytecode
|
||||
* object to stdout.
|
||||
*
|
||||
* Results:
|
||||
* Returns the length in bytes of the current instruiction.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclPrintInstruction(
|
||||
ByteCode *codePtr, /* Bytecode containing the instruction. */
|
||||
const unsigned char *pc) /* Points to first byte of instruction. */
|
||||
{
|
||||
Tcl_Obj *bufferObj;
|
||||
int numBytes;
|
||||
|
||||
TclNewObj(bufferObj);
|
||||
numBytes = FormatInstruction(codePtr, pc, bufferObj);
|
||||
fprintf(stdout, "%s", TclGetString(bufferObj));
|
||||
Tcl_DecrRefCount(bufferObj);
|
||||
return numBytes;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclPrintObject --
|
||||
*
|
||||
* This procedure prints up to a specified number of characters from the
|
||||
* argument Tcl object's string representation to a specified file.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Outputs characters to the specified file.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
TclPrintObject(
|
||||
FILE *outFile, /* The file to print the source to. */
|
||||
Tcl_Obj *objPtr, /* Points to the Tcl object whose string
|
||||
* representation should be printed. */
|
||||
int maxChars) /* Maximum number of chars to print. */
|
||||
{
|
||||
char *bytes;
|
||||
int length;
|
||||
|
||||
bytes = Tcl_GetStringFromObj(objPtr, &length);
|
||||
TclPrintSource(outFile, bytes, TclMin(length, maxChars));
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclPrintSource --
|
||||
*
|
||||
* This procedure prints up to a specified number of characters from the
|
||||
* argument string to a specified file. It tries to produce legible
|
||||
* output by adding backslashes as necessary.
|
||||
*
|
||||
* Results:
|
||||
* None.
|
||||
*
|
||||
* Side effects:
|
||||
* Outputs characters to the specified file.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
TclPrintSource(
|
||||
FILE *outFile, /* The file to print the source to. */
|
||||
const char *stringPtr, /* The string to print. */
|
||||
int maxChars) /* Maximum number of chars to print. */
|
||||
{
|
||||
Tcl_Obj *bufferObj;
|
||||
|
||||
TclNewObj(bufferObj);
|
||||
PrintSourceToObj(bufferObj, stringPtr, maxChars);
|
||||
fprintf(outFile, "%s", TclGetString(bufferObj));
|
||||
Tcl_DecrRefCount(bufferObj);
|
||||
}
|
||||
#endif /* TCL_COMPILE_DEBUG */
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclDisassembleByteCodeObj --
|
||||
*
|
||||
* Given an object which is of bytecode type, return a disassembled
|
||||
* version of the bytecode (in a new refcount 0 object). No guarantees
|
||||
* are made about the details of the contents of the result.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_Obj *
|
||||
TclDisassembleByteCodeObj(
|
||||
Tcl_Obj *objPtr) /* The bytecode object to disassemble. */
|
||||
{
|
||||
ByteCode *codePtr = objPtr->internalRep.twoPtrValue.ptr1;
|
||||
unsigned char *codeStart, *codeLimit, *pc;
|
||||
unsigned char *codeDeltaNext, *codeLengthNext;
|
||||
unsigned char *srcDeltaNext, *srcLengthNext;
|
||||
int codeOffset, codeLen, srcOffset, srcLen, numCmds, delta, i;
|
||||
Interp *iPtr = (Interp *) *codePtr->interpHandle;
|
||||
Tcl_Obj *bufferObj;
|
||||
char ptrBuf1[20], ptrBuf2[20];
|
||||
|
||||
TclNewObj(bufferObj);
|
||||
if (codePtr->refCount <= 0) {
|
||||
return bufferObj; /* Already freed. */
|
||||
}
|
||||
|
||||
codeStart = codePtr->codeStart;
|
||||
codeLimit = codeStart + codePtr->numCodeBytes;
|
||||
numCmds = codePtr->numCommands;
|
||||
|
||||
/*
|
||||
* Print header lines describing the ByteCode.
|
||||
*/
|
||||
|
||||
sprintf(ptrBuf1, "%p", codePtr);
|
||||
sprintf(ptrBuf2, "%p", iPtr);
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
"ByteCode 0x%s, refCt %u, epoch %u, interp 0x%s (epoch %u)\n",
|
||||
ptrBuf1, codePtr->refCount, codePtr->compileEpoch, ptrBuf2,
|
||||
iPtr->compileEpoch);
|
||||
Tcl_AppendToObj(bufferObj, " Source ", -1);
|
||||
PrintSourceToObj(bufferObj, codePtr->source,
|
||||
TclMin(codePtr->numSrcBytes, 55));
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
"\n Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n",
|
||||
numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes,
|
||||
codePtr->numLitObjects, codePtr->numAuxDataItems,
|
||||
codePtr->maxStackDepth,
|
||||
#ifdef TCL_COMPILE_STATS
|
||||
codePtr->numSrcBytes?
|
||||
codePtr->structureSize/(float)codePtr->numSrcBytes :
|
||||
#endif
|
||||
0.0);
|
||||
|
||||
#ifdef TCL_COMPILE_STATS
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
" Code %lu = header %lu+inst %d+litObj %lu+exc %lu+aux %lu+cmdMap %d\n",
|
||||
(unsigned long) codePtr->structureSize,
|
||||
(unsigned long) (sizeof(ByteCode) - sizeof(size_t) - sizeof(Tcl_Time)),
|
||||
codePtr->numCodeBytes,
|
||||
(unsigned long) (codePtr->numLitObjects * sizeof(Tcl_Obj *)),
|
||||
(unsigned long) (codePtr->numExceptRanges*sizeof(ExceptionRange)),
|
||||
(unsigned long) (codePtr->numAuxDataItems * sizeof(AuxData)),
|
||||
codePtr->numCmdLocBytes);
|
||||
#endif /* TCL_COMPILE_STATS */
|
||||
|
||||
/*
|
||||
* If the ByteCode is the compiled body of a Tcl procedure, print
|
||||
* information about that procedure. Note that we don't know the
|
||||
* procedure's name since ByteCode's can be shared among procedures.
|
||||
*/
|
||||
|
||||
if (codePtr->procPtr != NULL) {
|
||||
Proc *procPtr = codePtr->procPtr;
|
||||
int numCompiledLocals = procPtr->numCompiledLocals;
|
||||
|
||||
sprintf(ptrBuf1, "%p", procPtr);
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
" Proc 0x%s, refCt %d, args %d, compiled locals %d\n",
|
||||
ptrBuf1, procPtr->refCount, procPtr->numArgs,
|
||||
numCompiledLocals);
|
||||
if (numCompiledLocals > 0) {
|
||||
CompiledLocal *localPtr = procPtr->firstLocalPtr;
|
||||
|
||||
for (i = 0; i < numCompiledLocals; i++) {
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
" slot %d%s%s%s%s%s%s", i,
|
||||
(localPtr->flags & (VAR_ARRAY|VAR_LINK)) ? "" : ", scalar",
|
||||
(localPtr->flags & VAR_ARRAY) ? ", array" : "",
|
||||
(localPtr->flags & VAR_LINK) ? ", link" : "",
|
||||
(localPtr->flags & VAR_ARGUMENT) ? ", arg" : "",
|
||||
(localPtr->flags & VAR_TEMPORARY) ? ", temp" : "",
|
||||
(localPtr->flags & VAR_RESOLVED) ? ", resolved" : "");
|
||||
if (TclIsVarTemporary(localPtr)) {
|
||||
Tcl_AppendToObj(bufferObj, "\n", -1);
|
||||
} else {
|
||||
Tcl_AppendPrintfToObj(bufferObj, ", \"%s\"\n",
|
||||
localPtr->name);
|
||||
}
|
||||
localPtr = localPtr->nextPtr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Print the ExceptionRange array.
|
||||
*/
|
||||
|
||||
if (codePtr->numExceptRanges > 0) {
|
||||
Tcl_AppendPrintfToObj(bufferObj, " Exception ranges %d, depth %d:\n",
|
||||
codePtr->numExceptRanges, codePtr->maxExceptDepth);
|
||||
for (i = 0; i < codePtr->numExceptRanges; i++) {
|
||||
ExceptionRange *rangePtr = &codePtr->exceptArrayPtr[i];
|
||||
|
||||
Tcl_AppendPrintfToObj(bufferObj,
|
||||
" %d: level %d, %s, pc %d-%d, ",
|
||||
i, rangePtr->nestingLevel,
|
||||
(rangePtr->type==LOOP_EXCEPTION_RANGE ? "loop" : "catch"),
|
||||
rangePtr->codeOffset,
|
||||
(rangePtr->codeOffset + rangePtr->numCodeBytes - 1));
|
||||
switch (rangePtr->type) {
|
||||
case LOOP_EXCEPTION_RANGE:
|
||||
Tcl_AppendPrintfToObj(bufferObj, "continue %d, break %d\n",
|
||||
rangePtr->continueOffset, rangePtr->breakOffset);
|
||||
break;
|
||||
case CATCH_EXCEPTION_RANGE:
|
||||
Tcl_AppendPrintfToObj(bufferObj, "catch %d\n",
|
||||
rangePtr->catchOffset);
|
||||
break;
|
||||
default:
|
||||
Tcl_Panic("TclDisassembleByteCodeObj: bad ExceptionRange type %d",
|
||||
rangePtr->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If there were no commands (e.g., an expression or an empty string was
|
||||
* compiled), just print all instructions and return.
|
||||
*/
|
||||
|
||||
if (numCmds == 0) {
|
||||
pc = codeStart;
|
||||
while (pc < codeLimit) {
|
||||
Tcl_AppendToObj(bufferObj, " ", -1);
|
||||
pc += FormatInstruction(codePtr, pc, bufferObj);
|
||||
}
|
||||
return bufferObj;
|
||||
}
|
||||
|
||||
/*
|
||||
* Print table showing the code offset, source offset, and source length
|
||||
* for each command. These are encoded as a sequence of bytes.
|
||||
*/
|
||||
|
||||
Tcl_AppendPrintfToObj(bufferObj, " Commands %d:", numCmds);
|
||||
codeDeltaNext = codePtr->codeDeltaStart;
|
||||
codeLengthNext = codePtr->codeLengthStart;
|
||||
srcDeltaNext = codePtr->srcDeltaStart;
|
||||
srcLengthNext = codePtr->srcLengthStart;
|
||||
codeOffset = srcOffset = 0;
|
||||
for (i = 0; i < numCmds; i++) {
|
||||
if ((unsigned) *codeDeltaNext == (unsigned) 0xFF) {
|
||||
codeDeltaNext++;
|
||||
delta = TclGetInt4AtPtr(codeDeltaNext);
|
||||
codeDeltaNext += 4;
|
||||
} else {
|
||||
delta = TclGetInt1AtPtr(codeDeltaNext);
|
||||
codeDeltaNext++;
|
||||
}
|
||||
codeOffset += delta;
|
||||
|
||||
if ((unsigned) *codeLengthNext == (unsigned) 0xFF) {
|
||||
codeLengthNext++;
|
||||
codeLen = TclGetInt4AtPtr(codeLengthNext);
|
||||
codeLengthNext += 4;
|
||||
} else {
|
||||
codeLen = TclGetInt1AtPtr(codeLengthNext);
|
||||
codeLengthNext++;
|
||||
}
|
||||
|
||||
if ((unsigned) *srcDeltaNext == (unsigned) 0xFF) {
|
||||
srcDeltaNext++;
|
||||
delta = TclGetInt4AtPtr(srcDeltaNext);
|
||||
srcDeltaNext += 4;
|
||||
} else {
|
||||
delta = TclGetInt1AtPtr(srcDeltaNext);
|
||||
srcDeltaNext++;
|
||||
}
|
||||
srcOffset += delta;
|
||||
|
||||
if ((unsigned) *srcLengthNext == (unsigned) 0xFF) {
|
||||
srcLengthNext++;
|
||||
srcLen = TclGetInt4AtPtr(srcLengthNext);
|
||||
srcLengthNext += 4;
|
||||
} else {
|
||||
srcLen = TclGetInt1AtPtr(srcLengthNext);
|
||||
srcLengthNext++;
|
||||
}
|
||||
|
||||
Tcl_AppendPrintfToObj(bufferObj, "%s%4d: pc %d-%d, src %d-%d",
|
||||
((i % 2)? " " : "\n "),
|
||||
(i+1), codeOffset, (codeOffset + codeLen - 1),
|
||||
srcOffset, (srcOffset + srcLen - 1));
|
||||
}
|
||||
if (numCmds > 0) {
|
||||
Tcl_AppendToObj(bufferObj, "\n", -1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Print each instruction. If the instruction corresponds to the start of
|
||||
* a command, print the command's source. Note that we don't need the code
|
||||
* length here.
|
||||
*/
|
||||
|
||||
codeDeltaNext = codePtr->codeDeltaStart;
|
||||
srcDeltaNext = codePtr->srcDeltaStart;
|
||||
srcLengthNext = codePtr->srcLengthStart;
|
||||
codeOffset = srcOffset = 0;
|
||||
pc = codeStart;
|
||||
for (i = 0; i < numCmds; i++) {
|
||||
if ((unsigned) *codeDeltaNext == (unsigned) 0xFF) {
|
||||
codeDeltaNext++;
|
||||
delta = TclGetInt4AtPtr(codeDeltaNext);
|
||||
codeDeltaNext += 4;
|
||||
} else {
|
||||
delta = TclGetInt1AtPtr(codeDeltaNext);
|
||||
codeDeltaNext++;
|
||||
}
|
||||
codeOffset += delta;
|
||||
|
||||
if ((unsigned) *srcDeltaNext == (unsigned) 0xFF) {
|
||||
srcDeltaNext++;
|
||||
delta = TclGetInt4AtPtr(srcDeltaNext);
|
||||
srcDeltaNext += 4;
|
||||
} else {
|
||||
delta = TclGetInt1AtPtr(srcDeltaNext);
|
||||
srcDeltaNext++;
|
||||
}
|
||||
srcOffset += delta;
|
||||
|
||||
if ((unsigned) *srcLengthNext == (unsigned) 0xFF) {
|
||||
srcLengthNext++;
|
||||
srcLen = TclGetInt4AtPtr(srcLengthNext);
|
||||
srcLengthNext += 4;
|
||||
} else {
|
||||
srcLen = TclGetInt1AtPtr(srcLengthNext);
|
||||
srcLengthNext++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Print instructions before command i.
|
||||
*/
|
||||
|
||||
while ((pc-codeStart) < codeOffset) {
|
||||
Tcl_AppendToObj(bufferObj, " ", -1);
|
||||
pc += FormatInstruction(codePtr, pc, bufferObj);
|
||||
}
|
||||
|
||||
Tcl_AppendPrintfToObj(bufferObj, " Command %d: ", i+1);
|
||||
PrintSourceToObj(bufferObj, (codePtr->source + srcOffset),
|
||||
TclMin(srcLen, 55));
|
||||
Tcl_AppendToObj(bufferObj, "\n", -1);
|
||||
}
|
||||
if (pc < codeLimit) {
|
||||
/*
|
||||
* Print instructions after the last command.
|
||||
*/
|
||||
|
||||
while (pc < codeLimit) {
|
||||
Tcl_AppendToObj(bufferObj, " ", -1);
|
||||
pc += FormatInstruction(codePtr, pc, bufferObj);
|
||||
}
|
||||
}
|
||||
return bufferObj;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* FormatInstruction --
|
||||
*
|
||||
* Appends a representation of a bytecode instruction to a Tcl_Obj.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
FormatInstruction(
|
||||
ByteCode *codePtr, /* Bytecode containing the instruction. */
|
||||
const unsigned char *pc, /* Points to first byte of instruction. */
|
||||
Tcl_Obj *bufferObj) /* Object to append instruction info to. */
|
||||
{
|
||||
Proc *procPtr = codePtr->procPtr;
|
||||
unsigned char opCode = *pc;
|
||||
register const InstructionDesc *instDesc = &tclInstructionTable[opCode];
|
||||
unsigned char *codeStart = codePtr->codeStart;
|
||||
unsigned pcOffset = pc - codeStart;
|
||||
int opnd = 0, i, j, numBytes = 1;
|
||||
int localCt = procPtr ? procPtr->numCompiledLocals : 0;
|
||||
CompiledLocal *localPtr = procPtr ? procPtr->firstLocalPtr : NULL;
|
||||
char suffixBuffer[128]; /* Additional info to print after main opcode
|
||||
* and immediates. */
|
||||
char *suffixSrc = NULL;
|
||||
Tcl_Obj *suffixObj = NULL;
|
||||
AuxData *auxPtr = NULL;
|
||||
|
||||
suffixBuffer[0] = '\0';
|
||||
Tcl_AppendPrintfToObj(bufferObj, "(%u) %s ", pcOffset, instDesc->name);
|
||||
for (i = 0; i < instDesc->numOperands; i++) {
|
||||
switch (instDesc->opTypes[i]) {
|
||||
case OPERAND_INT1:
|
||||
opnd = TclGetInt1AtPtr(pc+numBytes); numBytes++;
|
||||
if (opCode == INST_JUMP1 || opCode == INST_JUMP_TRUE1
|
||||
|| opCode == INST_JUMP_FALSE1) {
|
||||
sprintf(suffixBuffer, "pc %u", pcOffset+opnd);
|
||||
}
|
||||
Tcl_AppendPrintfToObj(bufferObj, "%+d ", opnd);
|
||||
break;
|
||||
case OPERAND_INT4:
|
||||
opnd = TclGetInt4AtPtr(pc+numBytes); numBytes += 4;
|
||||
if (opCode == INST_JUMP4 || opCode == INST_JUMP_TRUE4
|
||||
|| opCode == INST_JUMP_FALSE4) {
|
||||
sprintf(suffixBuffer, "pc %u", pcOffset+opnd);
|
||||
} else if (opCode == INST_START_CMD) {
|
||||
sprintf(suffixBuffer, "next cmd at pc %u", pcOffset+opnd);
|
||||
}
|
||||
Tcl_AppendPrintfToObj(bufferObj, "%+d ", opnd);
|
||||
break;
|
||||
case OPERAND_UINT1:
|
||||
opnd = TclGetUInt1AtPtr(pc+numBytes); numBytes++;
|
||||
if (opCode == INST_PUSH1) {
|
||||
suffixObj = codePtr->objArrayPtr[opnd];
|
||||
}
|
||||
Tcl_AppendPrintfToObj(bufferObj, "%u ", (unsigned) opnd);
|
||||
break;
|
||||
case OPERAND_AUX4:
|
||||
case OPERAND_UINT4:
|
||||
opnd = TclGetUInt4AtPtr(pc+numBytes); numBytes += 4;
|
||||
if (opCode == INST_PUSH4) {
|
||||
suffixObj = codePtr->objArrayPtr[opnd];
|
||||
} else if (opCode == INST_START_CMD && opnd != 1) {
|
||||
sprintf(suffixBuffer+strlen(suffixBuffer),
|
||||
", %u cmds start here", opnd);
|
||||
}
|
||||
Tcl_AppendPrintfToObj(bufferObj, "%u ", (unsigned) opnd);
|
||||
if (instDesc->opTypes[i] == OPERAND_AUX4) {
|
||||
auxPtr = &codePtr->auxDataArrayPtr[opnd];
|
||||
}
|
||||
break;
|
||||
case OPERAND_IDX4:
|
||||
opnd = TclGetInt4AtPtr(pc+numBytes); numBytes += 4;
|
||||
if (opnd >= -1) {
|
||||
Tcl_AppendPrintfToObj(bufferObj, "%d ", opnd);
|
||||
} else if (opnd == -2) {
|
||||
Tcl_AppendPrintfToObj(bufferObj, "end ");
|
||||
} else {
|
||||
Tcl_AppendPrintfToObj(bufferObj, "end-%d ", -2-opnd);
|
||||
}
|
||||
break;
|
||||
case OPERAND_LVT1:
|
||||
opnd = TclGetUInt1AtPtr(pc+numBytes);
|
||||
numBytes++;
|
||||
goto printLVTindex;
|
||||
case OPERAND_LVT4:
|
||||
opnd = TclGetUInt4AtPtr(pc+numBytes);
|
||||
numBytes += 4;
|
||||
printLVTindex:
|
||||
if (localPtr != NULL) {
|
||||
if (opnd >= localCt) {
|
||||
Tcl_Panic("FormatInstruction: bad local var index %u (%u locals)",
|
||||
(unsigned) opnd, localCt);
|
||||
}
|
||||
for (j = 0; j < opnd; j++) {
|
||||
localPtr = localPtr->nextPtr;
|
||||
}
|
||||
if (TclIsVarTemporary(localPtr)) {
|
||||
sprintf(suffixBuffer, "temp var %u", (unsigned) opnd);
|
||||
} else {
|
||||
sprintf(suffixBuffer, "var ");
|
||||
suffixSrc = localPtr->name;
|
||||
}
|
||||
}
|
||||
Tcl_AppendPrintfToObj(bufferObj, "%%v%u ", (unsigned) opnd);
|
||||
break;
|
||||
case OPERAND_SCLS1:
|
||||
opnd = TclGetUInt1AtPtr(pc+numBytes); numBytes++;
|
||||
Tcl_AppendPrintfToObj(bufferObj, "%s ",
|
||||
tclStringClassTable[opnd].name);
|
||||
break;
|
||||
case OPERAND_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (suffixObj) {
|
||||
const char *bytes;
|
||||
int length;
|
||||
|
||||
Tcl_AppendToObj(bufferObj, "\t# ", -1);
|
||||
bytes = Tcl_GetStringFromObj(codePtr->objArrayPtr[opnd], &length);
|
||||
PrintSourceToObj(bufferObj, bytes, TclMin(length, 40));
|
||||
} else if (suffixBuffer[0]) {
|
||||
Tcl_AppendPrintfToObj(bufferObj, "\t# %s", suffixBuffer);
|
||||
if (suffixSrc) {
|
||||
PrintSourceToObj(bufferObj, suffixSrc, 40);
|
||||
}
|
||||
}
|
||||
Tcl_AppendToObj(bufferObj, "\n", -1);
|
||||
if (auxPtr && auxPtr->type->printProc) {
|
||||
Tcl_AppendToObj(bufferObj, "\t\t[", -1);
|
||||
auxPtr->type->printProc(auxPtr->clientData, bufferObj, codePtr,
|
||||
pcOffset);
|
||||
Tcl_AppendToObj(bufferObj, "]\n", -1);
|
||||
}
|
||||
return numBytes;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclGetInnerContext --
|
||||
*
|
||||
* If possible, returns a list capturing the inner context. Otherwise
|
||||
* return NULL.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_Obj *
|
||||
TclGetInnerContext(
|
||||
Tcl_Interp *interp,
|
||||
const unsigned char *pc,
|
||||
Tcl_Obj **tosPtr)
|
||||
{
|
||||
int objc = 0, off = 0;
|
||||
Tcl_Obj *result;
|
||||
Interp *iPtr = (Interp *) interp;
|
||||
|
||||
switch (*pc) {
|
||||
case INST_STR_LEN:
|
||||
case INST_LNOT:
|
||||
case INST_BITNOT:
|
||||
case INST_UMINUS:
|
||||
case INST_UPLUS:
|
||||
case INST_TRY_CVT_TO_NUMERIC:
|
||||
case INST_EXPAND_STKTOP:
|
||||
case INST_EXPR_STK:
|
||||
objc = 1;
|
||||
break;
|
||||
|
||||
case INST_LIST_IN:
|
||||
case INST_LIST_NOT_IN: /* Basic list containment operators. */
|
||||
case INST_STR_EQ:
|
||||
case INST_STR_NEQ: /* String (in)equality check */
|
||||
case INST_STR_CMP: /* String compare. */
|
||||
case INST_STR_INDEX:
|
||||
case INST_STR_MATCH:
|
||||
case INST_REGEXP:
|
||||
case INST_EQ:
|
||||
case INST_NEQ:
|
||||
case INST_LT:
|
||||
case INST_GT:
|
||||
case INST_LE:
|
||||
case INST_GE:
|
||||
case INST_MOD:
|
||||
case INST_LSHIFT:
|
||||
case INST_RSHIFT:
|
||||
case INST_BITOR:
|
||||
case INST_BITXOR:
|
||||
case INST_BITAND:
|
||||
case INST_EXPON:
|
||||
case INST_ADD:
|
||||
case INST_SUB:
|
||||
case INST_DIV:
|
||||
case INST_MULT:
|
||||
objc = 2;
|
||||
break;
|
||||
|
||||
case INST_RETURN_STK:
|
||||
/* early pop. TODO: dig out opt dict too :/ */
|
||||
objc = 1;
|
||||
break;
|
||||
|
||||
case INST_SYNTAX:
|
||||
case INST_RETURN_IMM:
|
||||
objc = 2;
|
||||
break;
|
||||
|
||||
case INST_INVOKE_STK4:
|
||||
objc = TclGetUInt4AtPtr(pc+1);
|
||||
break;
|
||||
|
||||
case INST_INVOKE_STK1:
|
||||
objc = TclGetUInt1AtPtr(pc+1);
|
||||
break;
|
||||
}
|
||||
|
||||
result = iPtr->innerContext;
|
||||
if (Tcl_IsShared(result)) {
|
||||
Tcl_DecrRefCount(result);
|
||||
iPtr->innerContext = result = Tcl_NewListObj(objc + 1, NULL);
|
||||
Tcl_IncrRefCount(result);
|
||||
} else {
|
||||
int len;
|
||||
|
||||
/*
|
||||
* Reset while keeping the list intrep as much as possible.
|
||||
*/
|
||||
|
||||
Tcl_ListObjLength(interp, result, &len);
|
||||
Tcl_ListObjReplace(interp, result, 0, len, 0, NULL);
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, result, TclNewInstNameObj(*pc));
|
||||
|
||||
for (; objc>0 ; objc--) {
|
||||
Tcl_Obj *objPtr;
|
||||
|
||||
objPtr = tosPtr[1 - objc + off];
|
||||
if (!objPtr) {
|
||||
Tcl_Panic("InnerContext: bad tos -- appending null object");
|
||||
}
|
||||
if ((objPtr->refCount<=0)
|
||||
#ifdef TCL_MEM_DEBUG
|
||||
|| (objPtr->refCount==0x61616161)
|
||||
#endif
|
||||
) {
|
||||
Tcl_Panic("InnerContext: bad tos -- appending freed object %p",
|
||||
objPtr);
|
||||
}
|
||||
Tcl_ListObjAppendElement(NULL, result, objPtr);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclNewInstNameObj --
|
||||
*
|
||||
* Creates a new InstName Tcl_Obj based on the given instruction
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Tcl_Obj *
|
||||
TclNewInstNameObj(
|
||||
unsigned char inst)
|
||||
{
|
||||
Tcl_Obj *objPtr = Tcl_NewObj();
|
||||
|
||||
objPtr->typePtr = &tclInstNameType;
|
||||
objPtr->internalRep.longValue = (long) inst;
|
||||
objPtr->bytes = NULL;
|
||||
|
||||
return objPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* UpdateStringOfInstName --
|
||||
*
|
||||
* Update the string representation for an instruction name object.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
UpdateStringOfInstName(
|
||||
Tcl_Obj *objPtr)
|
||||
{
|
||||
int inst = objPtr->internalRep.longValue;
|
||||
char *s, buf[20];
|
||||
int len;
|
||||
|
||||
if ((inst < 0) || (inst > LAST_INST_OPCODE)) {
|
||||
sprintf(buf, "inst_%d", inst);
|
||||
s = buf;
|
||||
} else {
|
||||
s = (char *) tclInstructionTable[objPtr->internalRep.longValue].name;
|
||||
}
|
||||
len = strlen(s);
|
||||
objPtr->bytes = ckalloc(len + 1);
|
||||
memcpy(objPtr->bytes, s, len + 1);
|
||||
objPtr->length = len;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* PrintSourceToObj --
|
||||
*
|
||||
* Appends a quoted representation of a string to a Tcl_Obj.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
PrintSourceToObj(
|
||||
Tcl_Obj *appendObj, /* The object to print the source to. */
|
||||
const char *stringPtr, /* The string to print. */
|
||||
int maxChars) /* Maximum number of chars to print. */
|
||||
{
|
||||
register const char *p;
|
||||
register int i = 0, len;
|
||||
|
||||
if (stringPtr == NULL) {
|
||||
Tcl_AppendToObj(appendObj, "\"\"", -1);
|
||||
return;
|
||||
}
|
||||
|
||||
Tcl_AppendToObj(appendObj, "\"", -1);
|
||||
p = stringPtr;
|
||||
for (; (*p != '\0') && (i < maxChars); p+=len) {
|
||||
Tcl_UniChar ch;
|
||||
|
||||
len = TclUtfToUniChar(p, &ch);
|
||||
switch (ch) {
|
||||
case '"':
|
||||
Tcl_AppendToObj(appendObj, "\\\"", -1);
|
||||
i += 2;
|
||||
continue;
|
||||
case '\f':
|
||||
Tcl_AppendToObj(appendObj, "\\f", -1);
|
||||
i += 2;
|
||||
continue;
|
||||
case '\n':
|
||||
Tcl_AppendToObj(appendObj, "\\n", -1);
|
||||
i += 2;
|
||||
continue;
|
||||
case '\r':
|
||||
Tcl_AppendToObj(appendObj, "\\r", -1);
|
||||
i += 2;
|
||||
continue;
|
||||
case '\t':
|
||||
Tcl_AppendToObj(appendObj, "\\t", -1);
|
||||
i += 2;
|
||||
continue;
|
||||
case '\v':
|
||||
Tcl_AppendToObj(appendObj, "\\v", -1);
|
||||
i += 2;
|
||||
continue;
|
||||
default:
|
||||
if (ch < 0x20 || ch >= 0x7f) {
|
||||
Tcl_AppendPrintfToObj(appendObj, "\\u%04x", ch);
|
||||
i += 6;
|
||||
} else {
|
||||
Tcl_AppendPrintfToObj(appendObj, "%c", ch);
|
||||
i++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Tcl_AppendToObj(appendObj, "\"", -1);
|
||||
if (*p != '\0') {
|
||||
Tcl_AppendToObj(appendObj, "...", -1);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TCL_COMPILE_STATS
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
|
||||
+36
-20
@@ -48,6 +48,13 @@ MODULE_SCOPE int tclTraceCompile;
|
||||
|
||||
MODULE_SCOPE int tclTraceExec;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The type of lambda expressions. Note that every lambda will *always* have a
|
||||
* string representation.
|
||||
*/
|
||||
|
||||
MODULE_SCOPE const Tcl_ObjType tclLambdaType;
|
||||
|
||||
/*
|
||||
*------------------------------------------------------------------------
|
||||
@@ -238,6 +245,16 @@ typedef struct AuxDataType {
|
||||
AuxDataPrintProc *printProc;/* Callback function to invoke when printing
|
||||
* the aux data as part of debugging. NULL
|
||||
* means that the data can't be printed. */
|
||||
AuxDataPrintProc *disassembleProc;
|
||||
/* Callback function to invoke when doing a
|
||||
* disassembly of the aux data (like the
|
||||
* printProc, except that the output is
|
||||
* intended to be script-readable). The
|
||||
* appendObj argument should be filled in with
|
||||
* a descriptive dictionary; it will start out
|
||||
* with "name" mapped to the content of the
|
||||
* name field. NULL means that the printProc
|
||||
* should be used instead. */
|
||||
} AuxDataType;
|
||||
|
||||
/*
|
||||
@@ -832,6 +849,12 @@ typedef enum InstOperandType {
|
||||
* variable table. */
|
||||
OPERAND_AUX4, /* Four byte unsigned index into the aux data
|
||||
* table. */
|
||||
OPERAND_OFFSET1, /* One byte signed jump offset. */
|
||||
OPERAND_OFFSET4, /* Four byte signed jump offset. */
|
||||
OPERAND_LIT1, /* One byte unsigned index into table of
|
||||
* literals. */
|
||||
OPERAND_LIT4, /* Four byte unsigned index into table of
|
||||
* literals. */
|
||||
OPERAND_SCLS1 /* Index into tclStringClassTable. */
|
||||
} InstOperandType;
|
||||
|
||||
@@ -1128,6 +1151,10 @@ MODULE_SCOPE void TclFinalizeLoopExceptionRange(CompileEnv *envPtr,
|
||||
MODULE_SCOPE char * TclLiteralStats(LiteralTable *tablePtr);
|
||||
MODULE_SCOPE int TclLog2(int value);
|
||||
#endif
|
||||
MODULE_SCOPE int TclLocalScalar(const char *bytes, int numBytes,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclLocalScalarFromToken(Tcl_Token *tokenPtr,
|
||||
CompileEnv *envPtr);
|
||||
MODULE_SCOPE void TclOptimizeBytecode(void *envPtr);
|
||||
#ifdef TCL_COMPILE_DEBUG
|
||||
MODULE_SCOPE void TclPrintByteCodeObj(Tcl_Interp *interp,
|
||||
@@ -1165,12 +1192,15 @@ MODULE_SCOPE void TclVerifyLocalLiteralTable(CompileEnv *envPtr);
|
||||
MODULE_SCOPE int TclWordKnownAtCompileTime(Tcl_Token *tokenPtr,
|
||||
Tcl_Obj *valuePtr);
|
||||
MODULE_SCOPE void TclLogCommandInfo(Tcl_Interp *interp,
|
||||
const char *script,
|
||||
const char *command, int length,
|
||||
const unsigned char *pc, Tcl_Obj **tosPtr);
|
||||
const char *script, const char *command,
|
||||
int length, const unsigned char *pc,
|
||||
Tcl_Obj **tosPtr);
|
||||
MODULE_SCOPE Tcl_Obj *TclGetInnerContext(Tcl_Interp *interp,
|
||||
const unsigned char *pc, Tcl_Obj **tosPtr);
|
||||
const unsigned char *pc, Tcl_Obj **tosPtr);
|
||||
MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData,
|
||||
register Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[], int isLambda);
|
||||
|
||||
|
||||
/*
|
||||
@@ -1387,18 +1417,6 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* If the expr compiler finished with TRY_CONVERT, macro to remove it when the
|
||||
* job is done by the following instruction.
|
||||
*/
|
||||
|
||||
#define TclClearNumConversion(envPtr) \
|
||||
do { \
|
||||
if (*(envPtr->codeNext - 1) == INST_TRY_CVT_TO_NUMERIC) { \
|
||||
envPtr->codeNext--; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Macros to update a (signed or unsigned) integer starting at a pointer. The
|
||||
* two variants depend on the number of bytes. The ANSI C "prototypes" for
|
||||
@@ -1664,11 +1682,9 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
|
||||
#define AnonymousLocal(envPtr) \
|
||||
(TclFindCompiledLocal(NULL, /*nameChars*/ 0, /*create*/ 1, (envPtr)))
|
||||
#define LocalScalar(chars,len,envPtr) \
|
||||
(!TclIsLocalScalar((chars), (len)) ? -1 : \
|
||||
TclFindCompiledLocal((chars), (len), /*create*/ 1, (envPtr)))
|
||||
TclLocalScalar(chars, len, envPtr)
|
||||
#define LocalScalarFromToken(tokenPtr,envPtr) \
|
||||
((tokenPtr)->type != TCL_TOKEN_SIMPLE_WORD ? -1 : \
|
||||
LocalScalar((tokenPtr)[1].start, (tokenPtr)[1].size, (envPtr)))
|
||||
TclLocalScalarFromToken(tokenPtr, envPtr)
|
||||
|
||||
/*
|
||||
* Flags bits used by TclPushVarName.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+72
-24
@@ -180,9 +180,9 @@ TCL_DECLARE_MUTEX(encodingMutex)
|
||||
* the system encoding will be used to perform the conversion.
|
||||
*/
|
||||
|
||||
static Tcl_Encoding defaultEncoding;
|
||||
static Tcl_Encoding systemEncoding;
|
||||
Tcl_Encoding tclIdentityEncoding;
|
||||
static Tcl_Encoding defaultEncoding = NULL;
|
||||
static Tcl_Encoding systemEncoding = NULL;
|
||||
Tcl_Encoding tclIdentityEncoding = NULL;
|
||||
|
||||
/*
|
||||
* The following variable is used in the sparse matrix code for a
|
||||
@@ -652,7 +652,10 @@ TclFinalizeEncodingSubsystem(void)
|
||||
Tcl_MutexLock(&encodingMutex);
|
||||
encodingsInitialized = 0;
|
||||
FreeEncoding(systemEncoding);
|
||||
systemEncoding = NULL;
|
||||
defaultEncoding = NULL;
|
||||
FreeEncoding(tclIdentityEncoding);
|
||||
tclIdentityEncoding = NULL;
|
||||
|
||||
hPtr = Tcl_FirstHashEntry(&encodingTable, &search);
|
||||
while (hPtr != NULL) {
|
||||
@@ -1203,7 +1206,10 @@ Tcl_ExternalToUtf(
|
||||
* output buffer. */
|
||||
{
|
||||
const Encoding *encodingPtr;
|
||||
int result, srcRead, dstWrote, dstChars;
|
||||
int result, srcRead, dstWrote, dstChars = 0;
|
||||
int noTerminate = flags & TCL_ENCODING_NO_TERMINATE;
|
||||
int charLimited = (flags & TCL_ENCODING_CHAR_LIMIT) && dstCharsPtr;
|
||||
int maxChars = INT_MAX;
|
||||
Tcl_EncodingState state;
|
||||
|
||||
if (encoding == NULL) {
|
||||
@@ -1228,19 +1234,40 @@ Tcl_ExternalToUtf(
|
||||
}
|
||||
if (dstCharsPtr == NULL) {
|
||||
dstCharsPtr = &dstChars;
|
||||
flags &= ~TCL_ENCODING_CHAR_LIMIT;
|
||||
} else if (charLimited) {
|
||||
maxChars = *dstCharsPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
* If there are any null characters in the middle of the buffer, they will
|
||||
* converted to the UTF-8 null character (\xC080). To get the actual \0 at
|
||||
* the end of the destination buffer, we need to append it manually.
|
||||
*/
|
||||
if (!noTerminate) {
|
||||
/*
|
||||
* If there are any null characters in the middle of the buffer,
|
||||
* they will converted to the UTF-8 null character (\xC080). To get
|
||||
* the actual \0 at the end of the destination buffer, we need to
|
||||
* append it manually. First make room for it...
|
||||
*/
|
||||
|
||||
dstLen--;
|
||||
result = encodingPtr->toUtfProc(encodingPtr->clientData, src, srcLen,
|
||||
flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr,
|
||||
dstCharsPtr);
|
||||
dst[*dstWrotePtr] = '\0';
|
||||
dstLen--;
|
||||
}
|
||||
do {
|
||||
int savedFlags = flags;
|
||||
Tcl_EncodingState savedState = *statePtr;
|
||||
|
||||
result = encodingPtr->toUtfProc(encodingPtr->clientData, src, srcLen,
|
||||
flags, statePtr, dst, dstLen, srcReadPtr, dstWrotePtr,
|
||||
dstCharsPtr);
|
||||
if (*dstCharsPtr <= maxChars) {
|
||||
break;
|
||||
}
|
||||
dstLen = Tcl_UtfAtIndex(dst, maxChars) - 1 - dst + TCL_UTF_MAX;
|
||||
flags = savedFlags;
|
||||
*statePtr = savedState;
|
||||
} while (1);
|
||||
if (!noTerminate) {
|
||||
/* ...and then append it */
|
||||
|
||||
dst[*dstWrotePtr] = '\0';
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -2104,6 +2131,9 @@ BinaryProc(
|
||||
if (dstLen < 0) {
|
||||
dstLen = 0;
|
||||
}
|
||||
if ((flags & TCL_ENCODING_CHAR_LIMIT) && srcLen > *dstCharsPtr) {
|
||||
srcLen = *dstCharsPtr;
|
||||
}
|
||||
if (srcLen > dstLen) {
|
||||
srcLen = dstLen;
|
||||
result = TCL_CONVERT_NOSPACE;
|
||||
@@ -2264,7 +2294,7 @@ UtfToUtfProc(
|
||||
{
|
||||
const char *srcStart, *srcEnd, *srcClose;
|
||||
const char *dstStart, *dstEnd;
|
||||
int result, numChars;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
Tcl_UniChar ch;
|
||||
|
||||
result = TCL_OK;
|
||||
@@ -2275,11 +2305,14 @@ UtfToUtfProc(
|
||||
if ((flags & TCL_ENCODING_END) == 0) {
|
||||
srcClose -= TCL_UTF_MAX;
|
||||
}
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
|
||||
dstStart = dst;
|
||||
dstEnd = dst + dstLen - TCL_UTF_MAX;
|
||||
|
||||
for (numChars = 0; src < srcEnd; numChars++) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
|
||||
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
|
||||
/*
|
||||
* If there is more string to follow, this will ensure that the
|
||||
@@ -2375,9 +2408,12 @@ UnicodeToUtfProc(
|
||||
{
|
||||
const char *srcStart, *srcEnd;
|
||||
const char *dstEnd, *dstStart;
|
||||
int result, numChars;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
Tcl_UniChar ch;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
result = TCL_OK;
|
||||
if ((srcLen % sizeof(Tcl_UniChar)) != 0) {
|
||||
result = TCL_CONVERT_MULTIBYTE;
|
||||
@@ -2391,7 +2427,7 @@ UnicodeToUtfProc(
|
||||
dstStart = dst;
|
||||
dstEnd = dst + dstLen - TCL_UTF_MAX;
|
||||
|
||||
for (numChars = 0; src < srcEnd; numChars++) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
|
||||
if (dst > dstEnd) {
|
||||
result = TCL_CONVERT_NOSPACE;
|
||||
break;
|
||||
@@ -2559,12 +2595,15 @@ TableToUtfProc(
|
||||
{
|
||||
const char *srcStart, *srcEnd;
|
||||
const char *dstEnd, *dstStart, *prefixBytes;
|
||||
int result, byte, numChars;
|
||||
int result, byte, numChars, charLimit = INT_MAX;
|
||||
Tcl_UniChar ch;
|
||||
const unsigned short *const *toUnicode;
|
||||
const unsigned short *pageZero;
|
||||
TableEncodingData *dataPtr = clientData;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
srcStart = src;
|
||||
srcEnd = src + srcLen;
|
||||
|
||||
@@ -2576,7 +2615,7 @@ TableToUtfProc(
|
||||
pageZero = toUnicode[0];
|
||||
|
||||
result = TCL_OK;
|
||||
for (numChars = 0; src < srcEnd; numChars++) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
|
||||
if (dst > dstEnd) {
|
||||
result = TCL_CONVERT_NOSPACE;
|
||||
break;
|
||||
@@ -2790,8 +2829,11 @@ Iso88591ToUtfProc(
|
||||
{
|
||||
const char *srcStart, *srcEnd;
|
||||
const char *dstEnd, *dstStart;
|
||||
int result, numChars;
|
||||
int result, numChars, charLimit = INT_MAX;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
srcStart = src;
|
||||
srcEnd = src + srcLen;
|
||||
|
||||
@@ -2799,7 +2841,7 @@ Iso88591ToUtfProc(
|
||||
dstEnd = dst + dstLen - TCL_UTF_MAX;
|
||||
|
||||
result = TCL_OK;
|
||||
for (numChars = 0; src < srcEnd; numChars++) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
|
||||
Tcl_UniChar ch;
|
||||
|
||||
if (dst > dstEnd) {
|
||||
@@ -2960,7 +3002,9 @@ TableFreeProc(
|
||||
*/
|
||||
|
||||
ckfree(dataPtr->toUnicode);
|
||||
dataPtr->toUnicode = NULL;
|
||||
ckfree(dataPtr->fromUnicode);
|
||||
dataPtr->fromUnicode = NULL;
|
||||
ckfree(dataPtr);
|
||||
}
|
||||
|
||||
@@ -3013,9 +3057,12 @@ EscapeToUtfProc(
|
||||
const char *prefixBytes, *tablePrefixBytes, *srcStart, *srcEnd;
|
||||
const unsigned short *const *tableToUnicode;
|
||||
const Encoding *encodingPtr;
|
||||
int state, result, numChars;
|
||||
int state, result, numChars, charLimit = INT_MAX;
|
||||
const char *dstStart, *dstEnd;
|
||||
|
||||
if (flags & TCL_ENCODING_CHAR_LIMIT) {
|
||||
charLimit = *dstCharsPtr;
|
||||
}
|
||||
result = TCL_OK;
|
||||
tablePrefixBytes = NULL; /* lint. */
|
||||
tableToUnicode = NULL; /* lint. */
|
||||
@@ -3033,7 +3080,7 @@ EscapeToUtfProc(
|
||||
state = 0;
|
||||
}
|
||||
|
||||
for (numChars = 0; src < srcEnd; ) {
|
||||
for (numChars = 0; src < srcEnd && numChars <= charLimit; ) {
|
||||
int byte, hi, lo, ch;
|
||||
|
||||
if (dst > dstEnd) {
|
||||
@@ -3433,6 +3480,7 @@ EscapeFreeProc(
|
||||
subTablePtr = dataPtr->subTables;
|
||||
for (i = 0; i < dataPtr->numSubTables; i++) {
|
||||
FreeEncoding((Tcl_Encoding) subTablePtr->encodingPtr);
|
||||
subTablePtr->encodingPtr = NULL;
|
||||
subTablePtr++;
|
||||
}
|
||||
}
|
||||
|
||||
+20
-15
@@ -119,6 +119,7 @@ static char * VwaitVarProc(ClientData clientData,
|
||||
Tcl_Interp *interp, const char *name1,
|
||||
const char *name2, int flags);
|
||||
static void InvokeExitHandlers(void);
|
||||
static void FinalizeThread(int quick);
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -983,7 +984,7 @@ Tcl_Exit(
|
||||
* Tcl_Channels that may have data enqueued.
|
||||
*/
|
||||
|
||||
Tcl_FinalizeThread();
|
||||
FinalizeThread(/* quick */ 1);
|
||||
}
|
||||
TclpExit(status);
|
||||
Tcl_Panic("OS exit failed!");
|
||||
@@ -1183,7 +1184,7 @@ Tcl_Finalize(void)
|
||||
* This fixes the Tcl Bug #990552.
|
||||
*/
|
||||
|
||||
TclFinalizeThreadData();
|
||||
TclFinalizeThreadData(/* quick */ 0);
|
||||
|
||||
/*
|
||||
* Now we can free constants for conversions to/from double.
|
||||
@@ -1268,6 +1269,13 @@ Tcl_Finalize(void)
|
||||
|
||||
void
|
||||
Tcl_FinalizeThread(void)
|
||||
{
|
||||
FinalizeThread(/* quick */ 0);
|
||||
}
|
||||
|
||||
void
|
||||
FinalizeThread(
|
||||
int quick)
|
||||
{
|
||||
ExitHandler *exitPtr;
|
||||
ThreadSpecificData *tsdPtr;
|
||||
@@ -1299,20 +1307,17 @@ Tcl_FinalizeThread(void)
|
||||
TclFinalizeAsync();
|
||||
TclFinalizeThreadObjects();
|
||||
}
|
||||
if (TclFullFinalizationRequested()) { /* useless if we are facing a quick-exit */
|
||||
|
||||
/*
|
||||
* Blow away all thread local storage blocks.
|
||||
*
|
||||
* Note that Tcl API allows creation of threads which do not use any Tcl
|
||||
* interp or other Tcl subsytems. Those threads might, however, use thread
|
||||
* local storage, so we must unconditionally finalize it.
|
||||
*
|
||||
* Fix [Bug #571002]
|
||||
*/
|
||||
|
||||
TclFinalizeThreadData();
|
||||
}
|
||||
/*
|
||||
* Blow away all thread local storage blocks.
|
||||
*
|
||||
* Note that Tcl API allows creation of threads which do not use any Tcl
|
||||
* interp or other Tcl subsytems. Those threads might, however, use thread
|
||||
* local storage, so we must unconditionally finalize it.
|
||||
*
|
||||
* Fix [Bug #571002]
|
||||
*/
|
||||
TclFinalizeThreadData(quick);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -81,9 +81,7 @@ int tclTraceExec = 0;
|
||||
|
||||
static const char *const operatorStrings[] = {
|
||||
"||", "&&", "|", "^", "&", "==", "!=", "<", ">", "<=", ">=", "<<", ">>",
|
||||
"+", "-", "*", "/", "%", "+", "-", "~", "!",
|
||||
"BUILTIN FUNCTION", "FUNCTION",
|
||||
"", "", "", "", "", "", "", "", "eq", "ne"
|
||||
"+", "-", "*", "/", "%", "+", "-", "~", "!"
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -5412,8 +5410,8 @@ TEBCresume(
|
||||
s1 = (char *) Tcl_GetByteArrayFromObj(valuePtr, &s1len);
|
||||
s2 = (char *) Tcl_GetByteArrayFromObj(value2Ptr, &s2len);
|
||||
memCmpFn = memcmp;
|
||||
} else if (((valuePtr->typePtr == &tclStringType)
|
||||
&& (value2Ptr->typePtr == &tclStringType))) {
|
||||
} else if ((valuePtr->typePtr == &tclStringType)
|
||||
&& (value2Ptr->typePtr == &tclStringType)) {
|
||||
/*
|
||||
* Do a unicode-specific comparison if both of the args are of
|
||||
* String type. If the char length == byte length, we can do a
|
||||
@@ -5424,7 +5422,9 @@ TEBCresume(
|
||||
s1len = Tcl_GetCharLength(valuePtr);
|
||||
s2len = Tcl_GetCharLength(value2Ptr);
|
||||
if ((s1len == valuePtr->length)
|
||||
&& (s2len == value2Ptr->length)) {
|
||||
&& (valuePtr->bytes != NULL)
|
||||
&& (s2len == value2Ptr->length)
|
||||
&& (value2Ptr->bytes != NULL)) {
|
||||
s1 = valuePtr->bytes;
|
||||
s2 = value2Ptr->bytes;
|
||||
memCmpFn = memcmp;
|
||||
@@ -9830,7 +9830,7 @@ IllegalExprOperandType(
|
||||
|
||||
if (opcode == INST_EXPON) {
|
||||
operator = "**";
|
||||
} else if (opcode <= INST_STR_NEQ) {
|
||||
} else if (opcode <= INST_LNOT) {
|
||||
operator = operatorStrings[opcode - INST_LOR];
|
||||
}
|
||||
|
||||
|
||||
@@ -235,9 +235,9 @@ ExtractWinRoot(
|
||||
if ((path[0] == 'c' || path[0] == 'C')
|
||||
&& (path[1] == 'o' || path[1] == 'O')) {
|
||||
if ((path[2] == 'm' || path[2] == 'M')
|
||||
&& path[3] >= '1' && path[3] <= '4') {
|
||||
&& path[3] >= '1' && path[3] <= '9') {
|
||||
/*
|
||||
* May have match for 'com[1-4]:?', which is a serial port.
|
||||
* May have match for 'com[1-9]:?', which is a serial port.
|
||||
*/
|
||||
|
||||
if (path[4] == '\0') {
|
||||
@@ -257,9 +257,9 @@ ExtractWinRoot(
|
||||
} else if ((path[0] == 'l' || path[0] == 'L')
|
||||
&& (path[1] == 'p' || path[1] == 'P')
|
||||
&& (path[2] == 't' || path[2] == 'T')) {
|
||||
if (path[3] >= '1' && path[3] <= '3') {
|
||||
if (path[3] >= '1' && path[3] <= '9') {
|
||||
/*
|
||||
* May have match for 'lpt[1-3]:?'
|
||||
* May have match for 'lpt[1-9]:?'
|
||||
*/
|
||||
|
||||
if (path[4] == '\0') {
|
||||
|
||||
+293
-107
@@ -35,15 +35,15 @@ typedef struct ChannelHandler {
|
||||
|
||||
/*
|
||||
* This structure keeps track of the current ChannelHandler being invoked in
|
||||
* the current invocation of ChannelHandlerEventProc. There is a potential
|
||||
* the current invocation of Tcl_NotifyChannel. There is a potential
|
||||
* problem if a ChannelHandler is deleted while it is the current one, since
|
||||
* ChannelHandlerEventProc needs to look at the nextPtr field. To handle this
|
||||
* Tcl_NotifyChannel needs to look at the nextPtr field. To handle this
|
||||
* problem, structures of the type below indicate the next handler to be
|
||||
* processed for any (recursively nested) dispatches in progress. The
|
||||
* nextHandlerPtr field is updated if the handler being pointed to is deleted.
|
||||
* The nextPtr field is used to chain together all recursive invocations, so
|
||||
* that Tcl_DeleteChannelHandler can find all the recursively nested
|
||||
* invocations of ChannelHandlerEventProc and compare the handler being
|
||||
* The nestedHandlerPtr field is used to chain together all recursive
|
||||
* invocations, so that Tcl_DeleteChannelHandler can find all the recursively
|
||||
* nested invocations of Tcl_NotifyChannel and compare the handler being
|
||||
* deleted against the NEXT handler to be invoked in that invocation; when it
|
||||
* finds such a situation, Tcl_DeleteChannelHandler updates the nextHandlerPtr
|
||||
* field of the structure to the next handler.
|
||||
@@ -54,20 +54,9 @@ typedef struct NextChannelHandler {
|
||||
* this invocation. */
|
||||
struct NextChannelHandler *nestedHandlerPtr;
|
||||
/* Next nested invocation of
|
||||
* ChannelHandlerEventProc. */
|
||||
* Tcl_NotifyChannel. */
|
||||
} NextChannelHandler;
|
||||
|
||||
/*
|
||||
* The following structure describes the event that is added to the Tcl
|
||||
* event queue by the channel handler check procedure.
|
||||
*/
|
||||
|
||||
typedef struct ChannelHandlerEvent {
|
||||
Tcl_Event header; /* Standard header for all events. */
|
||||
Channel *chanPtr; /* The channel that is ready. */
|
||||
int readyMask; /* Events that have occurred. */
|
||||
} ChannelHandlerEvent;
|
||||
|
||||
/*
|
||||
* The following structure is used by Tcl_GetsObj() to encapsulates the
|
||||
* state for a "gets" operation.
|
||||
@@ -130,7 +119,7 @@ typedef struct CopyState {
|
||||
typedef struct ThreadSpecificData {
|
||||
NextChannelHandler *nestedHandlerPtr;
|
||||
/* This variable holds the list of nested
|
||||
* ChannelHandlerEventProc invocations. */
|
||||
* Tcl_NotifyChannel invocations. */
|
||||
ChannelState *firstCSPtr; /* List of all channels currently open,
|
||||
* indexed by ChannelState, as only one
|
||||
* ChannelState exists per set of stacked
|
||||
@@ -166,6 +155,7 @@ static ChannelBuffer * AllocChannelBuffer(int length);
|
||||
static void PreserveChannelBuffer(ChannelBuffer *bufPtr);
|
||||
static void ReleaseChannelBuffer(ChannelBuffer *bufPtr);
|
||||
static int IsShared(ChannelBuffer *bufPtr);
|
||||
static void ChannelFree(Channel *chanPtr);
|
||||
static void ChannelTimerProc(ClientData clientData);
|
||||
static int ChanRead(Channel *chanPtr, char *dst, int dstSize);
|
||||
static int CheckChannelErrors(ChannelState *statePtr,
|
||||
@@ -1925,6 +1915,16 @@ TclChannelRelease(
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ChannelFree(
|
||||
Channel *chanPtr)
|
||||
{
|
||||
if (chanPtr->refCount == 0) {
|
||||
ckfree(chanPtr);
|
||||
return;
|
||||
}
|
||||
chanPtr->typePtr = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -2071,7 +2071,7 @@ Tcl_UnstackChannel(
|
||||
*/
|
||||
|
||||
result = ChanClose(chanPtr, interp);
|
||||
chanPtr->typePtr = NULL;
|
||||
ChannelFree(chanPtr);
|
||||
|
||||
UpdateInterest(statePtr->topChanPtr);
|
||||
|
||||
@@ -2822,9 +2822,15 @@ FlushChannel(
|
||||
* write in this call, and we've completed the BG flush.
|
||||
* These are the two cases above. If we get here, that means
|
||||
* there is some kind failure in the writable event machinery.
|
||||
*/
|
||||
*
|
||||
* The tls extension indeed suffers from flaws in its channel
|
||||
* event mgmt. See http://core.tcl.tk/tcl/info/c31ca233ca.
|
||||
* Until that patch is broadly distributed, disable the
|
||||
* assertion checking here, so that programs using Tcl and
|
||||
* tls can be debugged.
|
||||
|
||||
assert(!calledFromAsyncFlush);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3023,7 +3029,8 @@ CloseChannel(
|
||||
|
||||
statePtr->topChanPtr = downChanPtr;
|
||||
downChanPtr->upChanPtr = NULL;
|
||||
chanPtr->typePtr = NULL;
|
||||
|
||||
ChannelFree(chanPtr);
|
||||
|
||||
return Tcl_Close(interp, (Tcl_Channel) downChanPtr);
|
||||
}
|
||||
@@ -3034,7 +3041,7 @@ CloseChannel(
|
||||
* stack, make sure to free the ChannelState structure associated with it.
|
||||
*/
|
||||
|
||||
chanPtr->typePtr = NULL;
|
||||
ChannelFree(chanPtr);
|
||||
|
||||
Tcl_EventuallyFree(statePtr, TCL_DYNAMIC);
|
||||
|
||||
@@ -3905,7 +3912,10 @@ Tcl_Write(
|
||||
if (srcLen < 0) {
|
||||
srcLen = strlen(src);
|
||||
}
|
||||
return WriteBytes(chanPtr, src, srcLen);
|
||||
if (WriteBytes(chanPtr, src, srcLen) < 0) {
|
||||
return -1;
|
||||
}
|
||||
return srcLen;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4395,6 +4405,21 @@ Tcl_GetsObj(
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we're sitting ready to read the eofchar, there's no need to
|
||||
* do it.
|
||||
*/
|
||||
|
||||
if (GotFlag(statePtr, CHANNEL_STICKY_EOF)) {
|
||||
SetFlag(statePtr, CHANNEL_EOF);
|
||||
assert( statePtr->inputEncodingFlags & TCL_ENCODING_END );
|
||||
assert( !GotFlag(statePtr, CHANNEL_BLOCKED|INPUT_SAW_CR) );
|
||||
|
||||
/* TODO: Do we need this? */
|
||||
UpdateInterest(chanPtr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* A binary version of Tcl_GetsObj. This could also handle encodings that
|
||||
* are ascii-7 pure (iso8859, utf-8, ...) with a final encoding conversion
|
||||
@@ -4461,6 +4486,7 @@ Tcl_GetsObj(
|
||||
eof = NULL;
|
||||
inEofChar = statePtr->inEofChar;
|
||||
|
||||
ResetFlag(statePtr, CHANNEL_BLOCKED);
|
||||
while (1) {
|
||||
if (dst >= dstEnd) {
|
||||
if (FilterInputBytes(chanPtr, &gs) != 0) {
|
||||
@@ -4552,14 +4578,14 @@ Tcl_GetsObj(
|
||||
* Skip the raw bytes that make up the '\n'.
|
||||
*/
|
||||
|
||||
char tmp[1 + TCL_UTF_MAX];
|
||||
char tmp[TCL_UTF_MAX];
|
||||
int rawRead;
|
||||
|
||||
bufPtr = gs.bufPtr;
|
||||
Tcl_ExternalToUtf(NULL, gs.encoding, RemovePoint(bufPtr),
|
||||
gs.rawRead, statePtr->inputEncodingFlags,
|
||||
&gs.state, tmp, 1 + TCL_UTF_MAX, &rawRead, NULL,
|
||||
NULL);
|
||||
gs.rawRead, statePtr->inputEncodingFlags
|
||||
| TCL_ENCODING_NO_TERMINATE, &gs.state, tmp,
|
||||
TCL_UTF_MAX, &rawRead, NULL, NULL);
|
||||
bufPtr->nextRemoved += rawRead;
|
||||
gs.rawRead -= rawRead;
|
||||
gs.bytesWrote--;
|
||||
@@ -4612,6 +4638,7 @@ Tcl_GetsObj(
|
||||
dstEnd = eof;
|
||||
SetFlag(statePtr, CHANNEL_EOF | CHANNEL_STICKY_EOF);
|
||||
statePtr->inputEncodingFlags |= TCL_ENCODING_END;
|
||||
ResetFlag(statePtr, CHANNEL_BLOCKED|INPUT_SAW_CR);
|
||||
}
|
||||
if (GotFlag(statePtr, CHANNEL_EOF)) {
|
||||
skip = 0;
|
||||
@@ -4659,8 +4686,9 @@ Tcl_GetsObj(
|
||||
}
|
||||
statePtr->inputEncodingState = gs.state;
|
||||
Tcl_ExternalToUtf(NULL, gs.encoding, RemovePoint(bufPtr), gs.rawRead,
|
||||
statePtr->inputEncodingFlags, &statePtr->inputEncodingState, dst,
|
||||
eol - dst + skip + TCL_UTF_MAX, &gs.rawRead, NULL,
|
||||
statePtr->inputEncodingFlags | TCL_ENCODING_NO_TERMINATE,
|
||||
&statePtr->inputEncodingState, dst,
|
||||
eol - dst + skip + TCL_UTF_MAX - 1, &gs.rawRead, NULL,
|
||||
&gs.charsWrote);
|
||||
bufPtr->nextRemoved += gs.rawRead;
|
||||
|
||||
@@ -4725,6 +4753,13 @@ Tcl_GetsObj(
|
||||
*/
|
||||
|
||||
done:
|
||||
assert(!GotFlag(statePtr, CHANNEL_EOF)
|
||||
|| GotFlag(statePtr, CHANNEL_STICKY_EOF)
|
||||
|| Tcl_InputBuffered((Tcl_Channel)chanPtr) == 0);
|
||||
|
||||
assert( !(GotFlag(statePtr, CHANNEL_EOF|CHANNEL_BLOCKED)
|
||||
== (CHANNEL_EOF|CHANNEL_BLOCKED)) );
|
||||
|
||||
/*
|
||||
* Regenerate the top channel, in case it was changed due to
|
||||
* self-modifying reflected transforms.
|
||||
@@ -4748,6 +4783,11 @@ Tcl_GetsObj(
|
||||
* end-of-line or end-of-file has been seen. Bytes read from the input
|
||||
* channel return as a ByteArray obj.
|
||||
*
|
||||
* WARNING! The notion of "binary" used here is different from
|
||||
* notions of "binary" used in other places. In particular, this
|
||||
* "binary" routine may be called when an -eofchar is set on the
|
||||
* channel.
|
||||
*
|
||||
* Results:
|
||||
* Number of characters accumulated in the object or -1 if error,
|
||||
* blocked, or EOF. If -1, use Tcl_GetErrno() to retrieve the POSIX error
|
||||
@@ -4809,6 +4849,7 @@ TclGetsObjBinary(
|
||||
|
||||
eolChar = (statePtr->inputTranslation == TCL_TRANSLATE_LF) ? '\n' : '\r';
|
||||
|
||||
ResetFlag(statePtr, CHANNEL_BLOCKED);
|
||||
while (1) {
|
||||
/*
|
||||
* Subtract the number of bytes that were removed from channel
|
||||
@@ -4835,6 +4876,17 @@ TclGetsObjBinary(
|
||||
if (bufPtr == NULL) {
|
||||
goto restore;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Incoming CHANNEL_STICKY_EOF is filtered out on entry.
|
||||
* A new CHANNEL_STICKY_EOF set in this routine leads to
|
||||
* return before coming back here. When we are not dealing
|
||||
* with CHANNEL_STICKY_EOF, a CHANNEL_EOF implies an
|
||||
* empty buffer. Here the buffer is non-empty so we know
|
||||
* we're a non-EOF */
|
||||
|
||||
assert ( !GotFlag(statePtr, CHANNEL_STICKY_EOF) );
|
||||
assert ( !GotFlag(statePtr, CHANNEL_EOF) );
|
||||
}
|
||||
|
||||
dst = (unsigned char *) RemovePoint(bufPtr);
|
||||
@@ -4876,6 +4928,7 @@ TclGetsObjBinary(
|
||||
|
||||
SetFlag(statePtr, CHANNEL_EOF | CHANNEL_STICKY_EOF);
|
||||
statePtr->inputEncodingFlags |= TCL_ENCODING_END;
|
||||
ResetFlag(statePtr, CHANNEL_BLOCKED|INPUT_SAW_CR);
|
||||
}
|
||||
if (GotFlag(statePtr, CHANNEL_EOF)) {
|
||||
skip = 0;
|
||||
@@ -4985,6 +5038,11 @@ TclGetsObjBinary(
|
||||
*/
|
||||
|
||||
done:
|
||||
assert(!GotFlag(statePtr, CHANNEL_EOF)
|
||||
|| GotFlag(statePtr, CHANNEL_STICKY_EOF)
|
||||
|| Tcl_InputBuffered((Tcl_Channel)chanPtr) == 0);
|
||||
assert( !(GotFlag(statePtr, CHANNEL_EOF|CHANNEL_BLOCKED)
|
||||
== (CHANNEL_EOF|CHANNEL_BLOCKED)) );
|
||||
UpdateInterest(chanPtr);
|
||||
TclChannelRelease((Tcl_Channel)chanPtr);
|
||||
return copiedTotal;
|
||||
@@ -5097,6 +5155,12 @@ FilterInputBytes(
|
||||
*/
|
||||
|
||||
read:
|
||||
if (GotFlag(statePtr, CHANNEL_NONBLOCKING|CHANNEL_BLOCKED)
|
||||
== (CHANNEL_NONBLOCKING|CHANNEL_BLOCKED)) {
|
||||
gsPtr->charsWrote = 0;
|
||||
gsPtr->rawRead = 0;
|
||||
return -1;
|
||||
}
|
||||
if (GetInput(chanPtr) != 0) {
|
||||
gsPtr->charsWrote = 0;
|
||||
gsPtr->rawRead = 0;
|
||||
@@ -5109,6 +5173,17 @@ FilterInputBytes(
|
||||
gsPtr->rawRead = 0;
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Incoming CHANNEL_STICKY_EOF is filtered out on entry.
|
||||
* A new CHANNEL_STICKY_EOF set in this routine leads to
|
||||
* return before coming back here. When we are not dealing
|
||||
* with CHANNEL_STICKY_EOF, a CHANNEL_EOF implies an
|
||||
* empty buffer. Here the buffer is non-empty so we know
|
||||
* we're a non-EOF */
|
||||
|
||||
assert ( !GotFlag(statePtr, CHANNEL_STICKY_EOF) );
|
||||
assert ( !GotFlag(statePtr, CHANNEL_EOF) );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5145,9 +5220,9 @@ FilterInputBytes(
|
||||
}
|
||||
gsPtr->state = statePtr->inputEncodingState;
|
||||
result = Tcl_ExternalToUtf(NULL, gsPtr->encoding, raw, rawLen,
|
||||
statePtr->inputEncodingFlags, &statePtr->inputEncodingState,
|
||||
dst, spaceLeft+1, &gsPtr->rawRead, &gsPtr->bytesWrote,
|
||||
&gsPtr->charsWrote);
|
||||
statePtr->inputEncodingFlags | TCL_ENCODING_NO_TERMINATE,
|
||||
&statePtr->inputEncodingState, dst, spaceLeft, &gsPtr->rawRead,
|
||||
&gsPtr->bytesWrote, &gsPtr->charsWrote);
|
||||
|
||||
/*
|
||||
* Make sure that if we go through 'gets', that we reset the
|
||||
@@ -5187,12 +5262,6 @@ FilterInputBytes(
|
||||
* some more, but avoid blocking on a non-blocking channel.
|
||||
*/
|
||||
|
||||
if (GotFlag(statePtr, CHANNEL_NONBLOCKING|CHANNEL_BLOCKED)
|
||||
== (CHANNEL_NONBLOCKING|CHANNEL_BLOCKED)) {
|
||||
gsPtr->charsWrote = 0;
|
||||
gsPtr->rawRead = 0;
|
||||
return -1;
|
||||
}
|
||||
goto read;
|
||||
}
|
||||
} else {
|
||||
@@ -5439,6 +5508,7 @@ Tcl_ReadRaw(
|
||||
/* State info for channel */
|
||||
int copied = 0;
|
||||
|
||||
assert(bytesToRead > 0);
|
||||
if (CheckChannelErrors(statePtr, TCL_READABLE | CHANNEL_RAW_MODE) != 0) {
|
||||
return -1;
|
||||
}
|
||||
@@ -5470,8 +5540,19 @@ Tcl_ReadRaw(
|
||||
}
|
||||
}
|
||||
|
||||
/* Go to the driver if more data needed. */
|
||||
/*
|
||||
* Go to the driver only if we got nothing from pushback.
|
||||
* Have to do it this way to avoid EOF mis-timings when we
|
||||
* consider the ability that EOF may not be a permanent
|
||||
* condition in the driver, and in that case we have to
|
||||
* synchronize.
|
||||
*/
|
||||
|
||||
if (copied) {
|
||||
return copied;
|
||||
}
|
||||
|
||||
/* This test not needed. */
|
||||
if (bytesToRead > 0) {
|
||||
|
||||
int nread = ChanRead(chanPtr, readBuf, bytesToRead);
|
||||
@@ -5494,12 +5575,10 @@ Tcl_ReadRaw(
|
||||
if (!GotFlag(statePtr, CHANNEL_BLOCKED) || copied == 0) {
|
||||
copied = -1;
|
||||
}
|
||||
} else if (copied > 0) {
|
||||
} else {
|
||||
/*
|
||||
* nread == 0. Driver is at EOF, but if copied>0 bytes
|
||||
* from pushback, then we should not signal it yet.
|
||||
* nread == 0. Driver is at EOF. Let that state filter up.
|
||||
*/
|
||||
ResetFlag(statePtr, CHANNEL_EOF);
|
||||
}
|
||||
}
|
||||
return copied;
|
||||
@@ -5598,19 +5677,11 @@ DoReadChars(
|
||||
ChannelState *statePtr = chanPtr->state;
|
||||
/* State info for channel */
|
||||
ChannelBuffer *bufPtr;
|
||||
int factor, copied, copiedNow, result;
|
||||
Tcl_Encoding encoding;
|
||||
int copied, copiedNow, result;
|
||||
Tcl_Encoding encoding = statePtr->encoding;
|
||||
int binaryMode;
|
||||
#define UTF_EXPANSION_FACTOR 1024
|
||||
|
||||
/*
|
||||
* This operation should occur at the top of a channel stack.
|
||||
*/
|
||||
|
||||
chanPtr = statePtr->topChanPtr;
|
||||
encoding = statePtr->encoding;
|
||||
factor = UTF_EXPANSION_FACTOR;
|
||||
TclChannelPreserve((Tcl_Channel)chanPtr);
|
||||
int factor = UTF_EXPANSION_FACTOR;
|
||||
|
||||
binaryMode = (encoding == NULL)
|
||||
&& (statePtr->inputTranslation == TCL_TRANSLATE_LF)
|
||||
@@ -5634,6 +5705,36 @@ DoReadChars(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Early out when next read will see eofchar.
|
||||
*
|
||||
* NOTE: See DoRead for argument that it's a bug (one we're keeping)
|
||||
* to have this escape before the one for zero-char read request.
|
||||
*/
|
||||
|
||||
if (GotFlag(statePtr, CHANNEL_STICKY_EOF)) {
|
||||
SetFlag(statePtr, CHANNEL_EOF);
|
||||
assert( statePtr->inputEncodingFlags & TCL_ENCODING_END );
|
||||
assert( !GotFlag(statePtr, CHANNEL_BLOCKED|INPUT_SAW_CR) );
|
||||
|
||||
UpdateInterest(chanPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Special handling for zero-char read request. */
|
||||
if (toRead == 0) {
|
||||
ResetFlag(statePtr, CHANNEL_BLOCKED|CHANNEL_EOF);
|
||||
UpdateInterest(chanPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This operation should occur at the top of a channel stack.
|
||||
*/
|
||||
|
||||
chanPtr = statePtr->topChanPtr;
|
||||
TclChannelPreserve((Tcl_Channel)chanPtr);
|
||||
|
||||
/* Must clear the BLOCKED flag here since we check before reading */
|
||||
ResetFlag(statePtr, CHANNEL_BLOCKED);
|
||||
for (copied = 0; (unsigned) toRead > 0; ) {
|
||||
@@ -5710,6 +5811,11 @@ DoReadChars(
|
||||
* Update the notifier state so we don't block while there is still data
|
||||
* in the buffers.
|
||||
*/
|
||||
assert(!GotFlag(statePtr, CHANNEL_EOF)
|
||||
|| GotFlag(statePtr, CHANNEL_STICKY_EOF)
|
||||
|| Tcl_InputBuffered((Tcl_Channel)chanPtr) == 0);
|
||||
assert( !(GotFlag(statePtr, CHANNEL_EOF|CHANNEL_BLOCKED)
|
||||
== (CHANNEL_EOF|CHANNEL_BLOCKED)) );
|
||||
UpdateInterest(chanPtr);
|
||||
TclChannelRelease((Tcl_Channel)chanPtr);
|
||||
return copied;
|
||||
@@ -5823,7 +5929,7 @@ ReadChars(
|
||||
int savedIEFlags = statePtr->inputEncodingFlags;
|
||||
int savedFlags = statePtr->flags;
|
||||
char *dst, *src = RemovePoint(bufPtr);
|
||||
int dstLimit, numBytes, srcLen = BytesLeft(bufPtr);
|
||||
int numBytes, srcLen = BytesLeft(bufPtr);
|
||||
|
||||
/*
|
||||
* One src byte can yield at most one character. So when the
|
||||
@@ -5842,14 +5948,14 @@ ReadChars(
|
||||
*/
|
||||
|
||||
int factor = *factorPtr;
|
||||
int dstNeeded = TCL_UTF_MAX - 1 + toRead * factor / UTF_EXPANSION_FACTOR;
|
||||
int dstLimit = TCL_UTF_MAX - 1 + toRead * factor / UTF_EXPANSION_FACTOR;
|
||||
|
||||
(void) TclGetStringFromObj(objPtr, &numBytes);
|
||||
Tcl_AppendToObj(objPtr, NULL, dstNeeded);
|
||||
Tcl_AppendToObj(objPtr, NULL, dstLimit);
|
||||
if (toRead == srcLen) {
|
||||
unsigned int size;
|
||||
dst = TclGetStringStorage(objPtr, &size) + numBytes;
|
||||
dstNeeded = size - numBytes;
|
||||
dstLimit = size - numBytes;
|
||||
} else {
|
||||
dst = TclGetString(objPtr) + numBytes;
|
||||
}
|
||||
@@ -5870,19 +5976,24 @@ ReadChars(
|
||||
* a consistent set of results. This takes the shape of a loop.
|
||||
*/
|
||||
|
||||
dstLimit = dstNeeded + 1;
|
||||
while (1) {
|
||||
int dstDecoded, dstRead, dstWrote, srcRead, numChars;
|
||||
int dstDecoded, dstRead, dstWrote, srcRead, numChars, code;
|
||||
int flags = statePtr->inputEncodingFlags | TCL_ENCODING_NO_TERMINATE;
|
||||
|
||||
if (charsToRead > 0) {
|
||||
flags |= TCL_ENCODING_CHAR_LIMIT;
|
||||
numChars = charsToRead;
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform the encoding transformation. Read no more than
|
||||
* srcLen bytes, write no more than dstLimit bytes.
|
||||
*/
|
||||
|
||||
int code = Tcl_ExternalToUtf(NULL, encoding, src, srcLen,
|
||||
statePtr->inputEncodingFlags & (bufPtr->nextPtr
|
||||
? ~0 : ~TCL_ENCODING_END), &statePtr->inputEncodingState,
|
||||
dst, dstLimit, &srcRead, &dstDecoded, &numChars);
|
||||
code = Tcl_ExternalToUtf(NULL, encoding, src, srcLen,
|
||||
flags & (bufPtr->nextPtr ? ~0 : ~TCL_ENCODING_END),
|
||||
&statePtr->inputEncodingState, dst, dstLimit, &srcRead,
|
||||
&dstDecoded, &numChars);
|
||||
|
||||
/*
|
||||
* Perform the translation transformation in place. Read no more
|
||||
@@ -5945,7 +6056,7 @@ ReadChars(
|
||||
* time.
|
||||
*/
|
||||
|
||||
dstLimit = dstRead + TCL_UTF_MAX;
|
||||
dstLimit = dstRead - 1 + TCL_UTF_MAX;
|
||||
statePtr->flags = savedFlags;
|
||||
statePtr->inputEncodingFlags = savedIEFlags;
|
||||
statePtr->inputEncodingState = savedState;
|
||||
@@ -5971,7 +6082,7 @@ ReadChars(
|
||||
* up back here in this call.
|
||||
*/
|
||||
|
||||
dstLimit = dstRead + TCL_UTF_MAX;
|
||||
dstLimit = dstRead - 1 + TCL_UTF_MAX;
|
||||
statePtr->flags = savedFlags;
|
||||
statePtr->inputEncodingFlags = savedIEFlags;
|
||||
statePtr->inputEncodingState = savedState;
|
||||
@@ -5988,7 +6099,7 @@ ReadChars(
|
||||
*/
|
||||
|
||||
if (code != TCL_OK) {
|
||||
char buffer[TCL_UTF_MAX + 2];
|
||||
char buffer[TCL_UTF_MAX + 1];
|
||||
int read, decoded, count;
|
||||
|
||||
/*
|
||||
@@ -6000,9 +6111,10 @@ ReadChars(
|
||||
statePtr->inputEncodingState = savedState;
|
||||
|
||||
Tcl_ExternalToUtf(NULL, encoding, src, srcLen,
|
||||
statePtr->inputEncodingFlags & (bufPtr->nextPtr
|
||||
? ~0 : ~TCL_ENCODING_END), &statePtr->inputEncodingState,
|
||||
buffer, TCL_UTF_MAX + 2, &read, &decoded, &count);
|
||||
(statePtr->inputEncodingFlags | TCL_ENCODING_NO_TERMINATE)
|
||||
& (bufPtr->nextPtr ? ~0 : ~TCL_ENCODING_END),
|
||||
&statePtr->inputEncodingState, buffer, TCL_UTF_MAX + 1,
|
||||
&read, &decoded, &count);
|
||||
|
||||
if (count == 2) {
|
||||
if (buffer[1] == '\n') {
|
||||
@@ -6014,7 +6126,6 @@ ReadChars(
|
||||
bufPtr->nextRemoved += srcRead;
|
||||
}
|
||||
|
||||
dst[1] = '\0';
|
||||
statePtr->inputEncodingFlags &= ~TCL_ENCODING_START;
|
||||
|
||||
Tcl_SetObjLength(objPtr, numBytes + 1);
|
||||
@@ -6055,14 +6166,15 @@ ReadChars(
|
||||
if (charsToRead > 0 && numChars > charsToRead) {
|
||||
|
||||
/*
|
||||
* TODO: This cannot happen anymore.
|
||||
*
|
||||
* We read more chars than allowed. Reset limits to
|
||||
* prevent that and try again. Don't forget the extra
|
||||
* padding of TCL_UTF_MAX - 1 bytes demanded by the
|
||||
* padding of TCL_UTF_MAX bytes demanded by the
|
||||
* Tcl_ExternalToUtf() call!
|
||||
*/
|
||||
|
||||
dstLimit = Tcl_UtfAtIndex(dst, charsToRead + 1)
|
||||
+ TCL_UTF_MAX - 1 - dst;
|
||||
dstLimit = Tcl_UtfAtIndex(dst, charsToRead) - 1 + TCL_UTF_MAX - dst;
|
||||
statePtr->flags = savedFlags;
|
||||
statePtr->inputEncodingFlags = savedIEFlags;
|
||||
statePtr->inputEncodingState = savedState;
|
||||
@@ -6319,7 +6431,7 @@ TranslateInputEOL(
|
||||
|
||||
SetFlag(statePtr, CHANNEL_EOF | CHANNEL_STICKY_EOF);
|
||||
statePtr->inputEncodingFlags |= TCL_ENCODING_END;
|
||||
ResetFlag(statePtr, INPUT_SAW_CR);
|
||||
ResetFlag(statePtr, CHANNEL_BLOCKED|INPUT_SAW_CR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6529,6 +6641,14 @@ GetInput(
|
||||
ChannelState *statePtr = chanPtr->state;
|
||||
/* State info for channel */
|
||||
|
||||
/*
|
||||
* Verify that all callers know better than to call us when
|
||||
* it's recorded that the next char waiting to be read is the
|
||||
* eofchar.
|
||||
*/
|
||||
|
||||
assert( !GotFlag(statePtr, CHANNEL_STICKY_EOF) );
|
||||
|
||||
/*
|
||||
* Prevent reading from a dead channel -- a channel that has been closed
|
||||
* but not yet deallocated, which can happen if the exit handler for
|
||||
@@ -6540,18 +6660,24 @@ GetInput(
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* For a channel at EOF do not bother allocating buffers; there's
|
||||
* nothing more to read. Avoid calling the driver inputproc in
|
||||
* case some of them do not react well to additional calls after
|
||||
* they've reported an eof state..
|
||||
* TODO: Candidate for a can't happen panic.
|
||||
/*
|
||||
* WARNING: There was once a comment here claiming that it was
|
||||
* a bad idea to make another call to the inputproc of a channel
|
||||
* driver when EOF has already been detected on the channel. Through
|
||||
* much of Tcl's history, this warning was then completely negated
|
||||
* by having all (most?) read paths clear the EOF setting before
|
||||
* reaching here. So we had a guard that was never triggered.
|
||||
*
|
||||
* Don't be tempted to restore the guard. Even if EOF is set on
|
||||
* the channel, continue through and call the inputproc again. This
|
||||
* is the way to enable the ability to [read] again beyond the EOF,
|
||||
* which seems a strange thing to do, but for which use cases exist
|
||||
* [Tcl Bug 5adc350683] and which may even be essential for channels
|
||||
* representing things like ttys or other devices where the stream
|
||||
* might take the logical form of a series of 'files' separated by
|
||||
* an EOF condition.
|
||||
*/
|
||||
|
||||
if (GotFlag(statePtr, CHANNEL_EOF)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* First check for more buffers in the pushback area of the topmost
|
||||
* channel in the stack and use them. They can be the result of a
|
||||
@@ -6561,6 +6687,7 @@ GetInput(
|
||||
|
||||
if (chanPtr->inQueueHead != NULL) {
|
||||
|
||||
/* TODO: Tests to cover this. */
|
||||
assert(statePtr->inQueueHead == NULL);
|
||||
|
||||
statePtr->inQueueHead = chanPtr->inQueueHead;
|
||||
@@ -6591,6 +6718,7 @@ GetInput(
|
||||
* Check the actual buffersize against the requested buffersize.
|
||||
* Saved buffers of the wrong size are squashed. This is done
|
||||
* to honor dynamic changes of the buffersize made by the user.
|
||||
* TODO: Tests to cover this.
|
||||
*/
|
||||
|
||||
if ((bufPtr != NULL)
|
||||
@@ -7108,9 +7236,7 @@ Tcl_Eof(
|
||||
ChannelState *statePtr = ((Channel *) chan)->state;
|
||||
/* State of real channel structure. */
|
||||
|
||||
return (GotFlag(statePtr, CHANNEL_STICKY_EOF) ||
|
||||
(GotFlag(statePtr, CHANNEL_EOF) &&
|
||||
(Tcl_InputBuffered(chan) == 0))) ? 1 : 0;
|
||||
return GotFlag(statePtr, CHANNEL_EOF) ? 1 : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8100,7 +8226,7 @@ Tcl_NotifyChannel(
|
||||
|
||||
/*
|
||||
* Add this invocation to the list of recursive invocations of
|
||||
* ChannelHandlerEventProc.
|
||||
* Tcl_NotifyChannel.
|
||||
*/
|
||||
|
||||
nh.nextHandlerPtr = NULL;
|
||||
@@ -8419,7 +8545,7 @@ Tcl_DeleteChannelHandler(
|
||||
}
|
||||
|
||||
/*
|
||||
* If ChannelHandlerEventProc is about to process this handler, tell it to
|
||||
* If Tcl_NotifyChannel is about to process this handler, tell it to
|
||||
* process the next one instead - we are going to delete *this* one.
|
||||
*/
|
||||
|
||||
@@ -9032,7 +9158,7 @@ MBRead(
|
||||
}
|
||||
|
||||
code = GetInput(inStatePtr->topChanPtr);
|
||||
if (code == 0) {
|
||||
if (code == 0 || GotFlag(inStatePtr, CHANNEL_BLOCKED)) {
|
||||
return TCL_OK;
|
||||
} else {
|
||||
MBError(csPtr, TCL_READABLE, code);
|
||||
@@ -9097,6 +9223,9 @@ MBWrite(
|
||||
}
|
||||
outStatePtr->outQueueTail = tail;
|
||||
inStatePtr->inQueueHead = bufPtr;
|
||||
if (inStatePtr->inQueueTail == tail) {
|
||||
inStatePtr->inQueueTail = bufPtr;
|
||||
}
|
||||
if (bufPtr == NULL) {
|
||||
inStatePtr->inQueueTail = NULL;
|
||||
}
|
||||
@@ -9282,6 +9411,10 @@ CopyData(
|
||||
csPtr);
|
||||
}
|
||||
if (size == 0) {
|
||||
if (!GotFlag(inStatePtr, CHANNEL_NONBLOCKING)) {
|
||||
/* We allowed a short read. Keep trying. */
|
||||
continue;
|
||||
}
|
||||
if (bufObj != NULL) {
|
||||
TclDecrRefCount(bufObj);
|
||||
bufObj = NULL;
|
||||
@@ -9493,6 +9626,36 @@ DoRead(
|
||||
ChannelState *statePtr = chanPtr->state;
|
||||
char *p = dst;
|
||||
|
||||
assert (bytesToRead >= 0);
|
||||
|
||||
/*
|
||||
* Early out when we know a read will get the eofchar.
|
||||
*
|
||||
* NOTE: This seems to be a bug. The special handling for
|
||||
* a zero-char read request ought to come first. As coded
|
||||
* the EOF due to eofchar has distinguishing behavior from
|
||||
* the EOF due to reported EOF on the underlying device, and
|
||||
* that seems undesirable. However recent history indicates
|
||||
* that new inconsistent behavior in a patchlevel has problems
|
||||
* too. Keep on keeping on for now.
|
||||
*/
|
||||
|
||||
if (GotFlag(statePtr, CHANNEL_STICKY_EOF)) {
|
||||
SetFlag(statePtr, CHANNEL_EOF);
|
||||
assert( statePtr->inputEncodingFlags & TCL_ENCODING_END );
|
||||
assert( !GotFlag(statePtr, CHANNEL_BLOCKED|INPUT_SAW_CR) );
|
||||
|
||||
UpdateInterest(chanPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Special handling for zero-char read request. */
|
||||
if (bytesToRead == 0) {
|
||||
ResetFlag(statePtr, CHANNEL_BLOCKED|CHANNEL_EOF);
|
||||
UpdateInterest(chanPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
TclChannelPreserve((Tcl_Channel)chanPtr);
|
||||
while (bytesToRead) {
|
||||
/*
|
||||
@@ -9504,31 +9667,39 @@ DoRead(
|
||||
ChannelBuffer *bufPtr = statePtr->inQueueHead;
|
||||
|
||||
/*
|
||||
* When there's no buffered data to read, and we're at EOF,
|
||||
* escape to the caller.
|
||||
* Don't read more data if we have what we need.
|
||||
*/
|
||||
|
||||
if (statePtr->flags & CHANNEL_EOF
|
||||
&& (bufPtr == NULL || IsBufferEmpty(bufPtr))) {
|
||||
break;
|
||||
}
|
||||
while (!bufPtr || /* We got no buffer! OR */
|
||||
(!IsBufferFull(bufPtr) && /* Our buffer has room AND */
|
||||
(BytesLeft(bufPtr) < bytesToRead) ) ) {
|
||||
/* Not enough bytes in it
|
||||
* yet to fill the dst */
|
||||
int code;
|
||||
|
||||
/*
|
||||
* If there is not enough data in the buffers to possibly
|
||||
* complete the read, then go get more.
|
||||
*/
|
||||
|
||||
if (bufPtr == NULL || BytesLeft(bufPtr) < bytesToRead) {
|
||||
moreData:
|
||||
if (GetInput(chanPtr)) {
|
||||
code = GetInput(chanPtr);
|
||||
bufPtr = statePtr->inQueueHead;
|
||||
|
||||
assert (bufPtr != NULL);
|
||||
|
||||
if (GotFlag(statePtr, CHANNEL_EOF|CHANNEL_BLOCKED)) {
|
||||
/* Further reads cannot do any more */
|
||||
break;
|
||||
}
|
||||
|
||||
if (code) {
|
||||
/* Read error */
|
||||
UpdateInterest(chanPtr);
|
||||
TclChannelRelease((Tcl_Channel)chanPtr);
|
||||
return -1;
|
||||
}
|
||||
bufPtr = statePtr->inQueueHead;
|
||||
|
||||
assert (IsBufferFull(bufPtr));
|
||||
}
|
||||
|
||||
assert (bufPtr != NULL);
|
||||
|
||||
bytesRead = BytesLeft(bufPtr);
|
||||
bytesWritten = bytesToRead;
|
||||
|
||||
@@ -9555,8 +9726,7 @@ DoRead(
|
||||
* 1) We're @EOF because we saw eof char.
|
||||
*/
|
||||
|
||||
if (statePtr->inEofChar
|
||||
&& RemovePoint(bufPtr)[0] == statePtr->inEofChar) {
|
||||
if (GotFlag(statePtr, CHANNEL_STICKY_EOF)) {
|
||||
UpdateInterest(chanPtr);
|
||||
break;
|
||||
}
|
||||
@@ -9607,17 +9777,33 @@ DoRead(
|
||||
statePtr->inQueueTail = NULL;
|
||||
}
|
||||
RecycleBuffer(statePtr, bufPtr, 0);
|
||||
bufPtr = statePtr->inQueueHead;
|
||||
}
|
||||
|
||||
if ((GotFlag(statePtr, CHANNEL_NONBLOCKING) || allowShortReads)
|
||||
&& GotFlag(statePtr, CHANNEL_BLOCKED)) {
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* When there's no buffered data to read, and we're at EOF,
|
||||
* escape to the caller.
|
||||
*/
|
||||
|
||||
if (GotFlag(statePtr, CHANNEL_EOF)
|
||||
&& (bufPtr == NULL || IsBufferEmpty(bufPtr))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bytesToRead == 0) {
|
||||
ResetFlag(statePtr, CHANNEL_BLOCKED);
|
||||
}
|
||||
|
||||
assert(!GotFlag(statePtr, CHANNEL_EOF)
|
||||
|| GotFlag(statePtr, CHANNEL_STICKY_EOF)
|
||||
|| Tcl_InputBuffered((Tcl_Channel)chanPtr) == 0);
|
||||
assert( !(GotFlag(statePtr, CHANNEL_EOF|CHANNEL_BLOCKED)
|
||||
== (CHANNEL_EOF|CHANNEL_BLOCKED)) );
|
||||
TclChannelRelease((Tcl_Channel)chanPtr);
|
||||
return (int)(p - dst);
|
||||
}
|
||||
|
||||
+21
-10
@@ -187,6 +187,7 @@ struct TransformChannelData {
|
||||
Tcl_Channel self; /* Our own Channel handle. */
|
||||
int readIsFlushed; /* Flag to note whether in.flushProc was
|
||||
* called or not. */
|
||||
int eofPending; /* Flag: EOF seen down, not raised up */
|
||||
int flags; /* Currently CHANNEL_ASYNC or zero. */
|
||||
int watchMask; /* Current watch/event/interest mask. */
|
||||
int mode; /* Mode of parent channel, OR'ed combination
|
||||
@@ -292,6 +293,7 @@ TclChannelTransform(
|
||||
Tcl_DStringInit(&ds);
|
||||
Tcl_GetChannelOption(interp, chan, "-blocking", &ds);
|
||||
dataPtr->readIsFlushed = 0;
|
||||
dataPtr->eofPending = 0;
|
||||
dataPtr->flags = 0;
|
||||
if (ds.string[0] == '0') {
|
||||
dataPtr->flags |= CHANNEL_ASYNC;
|
||||
@@ -624,7 +626,7 @@ TransformInputProc(
|
||||
|
||||
if (toRead == 0 || dataPtr->self == NULL) {
|
||||
/*
|
||||
* Catch a no-op.
|
||||
* Catch a no-op. TODO: Is this a panic()?
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
@@ -676,6 +678,17 @@ TransformInputProc(
|
||||
if (toRead <= 0) {
|
||||
break;
|
||||
}
|
||||
if (dataPtr->eofPending) {
|
||||
/*
|
||||
* Already saw EOF from downChan; don't ask again.
|
||||
* NOTE: Could move this up to avoid the last maxRead
|
||||
* execution. Believe this would still be correct behavior,
|
||||
* but the test suite tests the whole command callback
|
||||
* sequence, so leave it unchanged for now.
|
||||
*/
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get bytes from the underlying channel.
|
||||
@@ -711,14 +724,7 @@ TransformInputProc(
|
||||
* on the down channel.
|
||||
*/
|
||||
|
||||
if (dataPtr->readIsFlushed) {
|
||||
/*
|
||||
* Already flushed, nothing to do anymore.
|
||||
*/
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
dataPtr->eofPending = 1;
|
||||
dataPtr->readIsFlushed = 1;
|
||||
ExecuteCallback(dataPtr, NULL, A_FLUSH_READ, NULL, 0,
|
||||
TRANSMIT_IBUF, P_PRESERVE);
|
||||
@@ -746,8 +752,11 @@ TransformInputProc(
|
||||
break;
|
||||
}
|
||||
} /* while toRead > 0 */
|
||||
ReleaseData(dataPtr);
|
||||
|
||||
if (gotBytes == 0) {
|
||||
dataPtr->eofPending = 0;
|
||||
}
|
||||
ReleaseData(dataPtr);
|
||||
return gotBytes;
|
||||
}
|
||||
|
||||
@@ -858,6 +867,7 @@ TransformSeekProc(
|
||||
P_NO_PRESERVE);
|
||||
ResultClear(&dataPtr->result);
|
||||
dataPtr->readIsFlushed = 0;
|
||||
dataPtr->eofPending = 0;
|
||||
}
|
||||
ReleaseData(dataPtr);
|
||||
|
||||
@@ -931,6 +941,7 @@ TransformWideSeekProc(
|
||||
P_NO_PRESERVE);
|
||||
ResultClear(&dataPtr->result);
|
||||
dataPtr->readIsFlushed = 0;
|
||||
dataPtr->eofPending = 0;
|
||||
}
|
||||
ReleaseData(dataPtr);
|
||||
|
||||
|
||||
+17
-4
@@ -161,6 +161,7 @@ typedef struct {
|
||||
int mode; /* Mask of R/W mode */
|
||||
int nonblocking; /* Flag: Channel is blocking or not. */
|
||||
int readIsDrained; /* Flag: Read buffers are flushed. */
|
||||
int eofPending; /* Flag: EOF seen down, but not raised up */
|
||||
int dead; /* Boolean signal that some operations
|
||||
* should no longer be attempted. */
|
||||
ResultBuffer result;
|
||||
@@ -1082,6 +1083,10 @@ ReflectInput(
|
||||
bufObj = Tcl_NewByteArrayObj(NULL, toRead);
|
||||
Tcl_IncrRefCount(bufObj);
|
||||
gotBytes = 0;
|
||||
if (rtPtr->eofPending) {
|
||||
goto stop;
|
||||
}
|
||||
rtPtr->readIsDrained = 0;
|
||||
while (toRead > 0) {
|
||||
/*
|
||||
* Loop until the request is satisfied (or no data available from
|
||||
@@ -1097,6 +1102,11 @@ ReflectInput(
|
||||
goto stop;
|
||||
}
|
||||
|
||||
if (rtPtr->eofPending) {
|
||||
goto stop;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The buffer is exhausted, but the caller wants even more. We now
|
||||
* have to go to the underlying channel, get more bytes and then
|
||||
@@ -1165,11 +1175,9 @@ ReflectInput(
|
||||
* Zero returned from Tcl_ReadRaw() always indicates EOF
|
||||
* on the down channel.
|
||||
*/
|
||||
|
||||
if (rtPtr->readIsDrained) {
|
||||
goto stop;
|
||||
}
|
||||
|
||||
rtPtr->eofPending = 1;
|
||||
|
||||
/*
|
||||
* Now this is a bit different. The partial data waiting is
|
||||
* converted and returned.
|
||||
@@ -1211,6 +1219,9 @@ ReflectInput(
|
||||
} /* while toRead > 0 */
|
||||
|
||||
stop:
|
||||
if (gotBytes == 0) {
|
||||
rtPtr->eofPending = 0;
|
||||
}
|
||||
Tcl_DecrRefCount(bufObj);
|
||||
Tcl_Release(rtPtr);
|
||||
return gotBytes;
|
||||
@@ -1766,6 +1777,7 @@ NewReflectedTransform(
|
||||
rtPtr->timer = NULL;
|
||||
rtPtr->mode = 0;
|
||||
rtPtr->readIsDrained = 0;
|
||||
rtPtr->eofPending = 0;
|
||||
rtPtr->nonblocking =
|
||||
(((Channel *) parentChan)->state->flags & CHANNEL_NONBLOCKING);
|
||||
rtPtr->dead = 0;
|
||||
@@ -3318,6 +3330,7 @@ TransformClear(
|
||||
(void) InvokeTclMethod(rtPtr, "clear", NULL, NULL, NULL);
|
||||
|
||||
rtPtr->readIsDrained = 0;
|
||||
rtPtr->eofPending = 0;
|
||||
ResultClear(&rtPtr->result);
|
||||
}
|
||||
|
||||
|
||||
+20
-3
@@ -12,9 +12,26 @@
|
||||
#include "tclInt.h"
|
||||
|
||||
#if defined(_WIN32) && defined(UNICODE)
|
||||
/* On Windows, we always need the ASCII version. */
|
||||
# undef gai_strerror
|
||||
# define gai_strerror gai_strerrorA
|
||||
/* On Windows, we need to do proper Unicode->UTF-8 conversion. */
|
||||
|
||||
typedef struct ThreadSpecificData {
|
||||
int initialized;
|
||||
Tcl_DString errorMsg; /* UTF-8 encoded error-message */
|
||||
} ThreadSpecificData;
|
||||
static Tcl_ThreadDataKey dataKey;
|
||||
|
||||
#undef gai_strerror
|
||||
static const char *gai_strerror(int code) {
|
||||
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
|
||||
|
||||
if (tsdPtr->initialized) {
|
||||
Tcl_DStringFree(&tsdPtr->errorMsg);
|
||||
} else {
|
||||
tsdPtr->initialized = 1;
|
||||
}
|
||||
Tcl_WinTCharToUtf(gai_strerrorW(code), -1, &tsdPtr->errorMsg);
|
||||
return Tcl_DStringValue(&tsdPtr->errorMsg);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+5
-4
@@ -1741,7 +1741,7 @@ enum PkgPreferOptions {
|
||||
* definition there.
|
||||
* Some macros require knowledge of some fields in the struct in order to
|
||||
* avoid hitting the TSD unnecessarily. In order to facilitate this, a pointer
|
||||
* to the relevant fields is kept in the objCache field in struct Interp.
|
||||
* to the relevant fields is kept in the allocCache field in struct Interp.
|
||||
*----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -2927,7 +2927,7 @@ MODULE_SCOPE void TclFinalizePreserve(void);
|
||||
MODULE_SCOPE void TclFinalizeSynchronization(void);
|
||||
MODULE_SCOPE void TclFinalizeThreadAlloc(void);
|
||||
MODULE_SCOPE void TclFinalizeThreadAllocThread(void);
|
||||
MODULE_SCOPE void TclFinalizeThreadData(void);
|
||||
MODULE_SCOPE void TclFinalizeThreadData(int quick);
|
||||
MODULE_SCOPE void TclFinalizeThreadObjects(void);
|
||||
MODULE_SCOPE double TclFloor(const mp_int *a);
|
||||
MODULE_SCOPE void TclFormatNaN(double value, char *buffer);
|
||||
@@ -2985,8 +2985,8 @@ MODULE_SCOPE void TclInitNotifier(void);
|
||||
MODULE_SCOPE void TclInitObjSubsystem(void);
|
||||
MODULE_SCOPE void TclInitSubsystems(void);
|
||||
MODULE_SCOPE int TclInterpReady(Tcl_Interp *interp);
|
||||
MODULE_SCOPE int TclIsLocalScalar(const char *src, int len);
|
||||
MODULE_SCOPE int TclIsSpaceProc(char byte);
|
||||
MODULE_SCOPE int TclIsBareword(char byte);
|
||||
MODULE_SCOPE Tcl_Obj * TclJoinPath(int elements, Tcl_Obj * const objv[]);
|
||||
MODULE_SCOPE int TclJoinThread(Tcl_ThreadId id, int *result);
|
||||
MODULE_SCOPE void TclLimitRemoveAllHandlers(Tcl_Interp *interp);
|
||||
@@ -3095,7 +3095,8 @@ MODULE_SCOPE void TclRememberJoinableThread(Tcl_ThreadId id);
|
||||
MODULE_SCOPE void TclRememberMutex(Tcl_Mutex *mutex);
|
||||
MODULE_SCOPE void TclRemoveScriptLimitCallbacks(Tcl_Interp *interp);
|
||||
MODULE_SCOPE int TclReToGlob(Tcl_Interp *interp, const char *reStr,
|
||||
int reStrLen, Tcl_DString *dsPtr, int *flagsPtr);
|
||||
int reStrLen, Tcl_DString *dsPtr, int *flagsPtr,
|
||||
int *quantifiersFoundPtr);
|
||||
MODULE_SCOPE int TclScanElement(const char *string, int length,
|
||||
int *flagPtr);
|
||||
MODULE_SCOPE void TclSetBgErrorHandler(Tcl_Interp *interp,
|
||||
|
||||
+3
-1
@@ -1287,7 +1287,9 @@ TclOORemoveFromInstances(
|
||||
|
||||
removeInstance:
|
||||
if (Deleted(clsPtr->thisPtr)) {
|
||||
DelRef(clsPtr->instances.list[i]);
|
||||
if (!IsRootClass(clsPtr)) {
|
||||
DelRef(clsPtr->instances.list[i]);
|
||||
}
|
||||
clsPtr->instances.list[i] = NULL;
|
||||
} else {
|
||||
clsPtr->instances.num--;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
* win/tclooConfig.sh
|
||||
*/
|
||||
|
||||
#define TCLOO_VERSION "1.0.2"
|
||||
#define TCLOO_VERSION "1.0.3"
|
||||
#define TCLOO_PATCHLEVEL TCLOO_VERSION
|
||||
|
||||
#include "tcl.h"
|
||||
|
||||
+46
-67
@@ -618,6 +618,47 @@ TclIsSpaceProc(
|
||||
return CHAR_TYPE(byte) & (TYPE_SPACE) || byte == '\n';
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclIsBareword--
|
||||
*
|
||||
* Report whether byte is one that can be part of a "bareword".
|
||||
* This concept is named in expression parsing, where it determines
|
||||
* what can be a legal function name, but is the same definition used
|
||||
* in determining what variable names can be parsed as variable
|
||||
* substitutions without the benefit of enclosing braces. The set of
|
||||
* ASCII chars that are accepted are the numeric chars ('0'-'9'),
|
||||
* the alphabetic chars ('a'-'z', 'A'-'Z') and underscore ('_').
|
||||
*
|
||||
* Results:
|
||||
* Returns 1, if byte is in the accepted set of chars, 0 otherwise.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclIsBareword(
|
||||
char byte)
|
||||
{
|
||||
if (byte < '0' || byte > 'z') {
|
||||
return 0;
|
||||
}
|
||||
if (byte <= '9' || byte >= 'a') {
|
||||
return 1;
|
||||
}
|
||||
if (byte == '_') {
|
||||
return 1;
|
||||
}
|
||||
if (byte < 'A' || byte > 'Z') {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
@@ -1346,9 +1387,7 @@ Tcl_ParseVarName(
|
||||
{
|
||||
Tcl_Token *tokenPtr;
|
||||
register const char *src;
|
||||
unsigned char c;
|
||||
int varIndex, offset;
|
||||
Tcl_UniChar ch;
|
||||
int varIndex;
|
||||
unsigned array;
|
||||
|
||||
if ((numBytes == 0) || (start == NULL)) {
|
||||
@@ -1431,22 +1470,12 @@ Tcl_ParseVarName(
|
||||
tokenPtr->numComponents = 0;
|
||||
|
||||
while (numBytes) {
|
||||
if (Tcl_UtfCharComplete(src, numBytes)) {
|
||||
offset = Tcl_UtfToUniChar(src, &ch);
|
||||
} else {
|
||||
char utfBytes[TCL_UTF_MAX];
|
||||
|
||||
memcpy(utfBytes, src, (size_t) numBytes);
|
||||
utfBytes[numBytes] = '\0';
|
||||
offset = Tcl_UtfToUniChar(utfBytes, &ch);
|
||||
}
|
||||
c = UCHAR(ch);
|
||||
if (isalnum(c) || (c == '_')) { /* INTL: ISO only, UCHAR. */
|
||||
src += offset;
|
||||
numBytes -= offset;
|
||||
if (TclIsBareword(*src)) {
|
||||
src += 1;
|
||||
numBytes -= 1;
|
||||
continue;
|
||||
}
|
||||
if ((c == ':') && (numBytes != 1) && (src[1] == ':')) {
|
||||
if ((src[0] == ':') && (numBytes != 1) && (src[1] == ':')) {
|
||||
src += 2;
|
||||
numBytes -= 2;
|
||||
while (numBytes && (*src == ':')) {
|
||||
@@ -2496,56 +2525,6 @@ TclObjCommandComplete(
|
||||
return CommandComplete(script, length);
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* TclIsLocalScalar --
|
||||
*
|
||||
* Check to see if a given string is a legal scalar variable name with no
|
||||
* namespace qualifiers or substitutions.
|
||||
*
|
||||
* Results:
|
||||
* Returns 1 if the variable is a local scalar.
|
||||
*
|
||||
* Side effects:
|
||||
* None.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
TclIsLocalScalar(
|
||||
const char *src,
|
||||
int len)
|
||||
{
|
||||
const char *p;
|
||||
const char *lastChar = src + (len - 1);
|
||||
|
||||
for (p=src ; p<=lastChar ; p++) {
|
||||
if ((CHAR_TYPE(*p) != TYPE_NORMAL)
|
||||
&& (CHAR_TYPE(*p) != TYPE_COMMAND_END)) {
|
||||
/*
|
||||
* TCL_COMMAND_END is returned for the last character of the
|
||||
* string. By this point we know it isn't an array or namespace
|
||||
* reference.
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
if (*p == '(') {
|
||||
if (*lastChar == ')') { /* We have an array element */
|
||||
return 0;
|
||||
}
|
||||
} else if (*p == ':') {
|
||||
if ((p != lastChar) && *(p+1) == ':') { /* qualified name */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
|
||||
+14
-246
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "tclInt.h"
|
||||
#include "tclCompile.h"
|
||||
#include "tclOOInt.h"
|
||||
|
||||
/*
|
||||
* Variables that are part of the [apply] command implementation and which
|
||||
@@ -41,9 +40,6 @@ static void InitResolvedLocals(Tcl_Interp *interp,
|
||||
ByteCode *codePtr, Var *defPtr,
|
||||
Namespace *nsPtr);
|
||||
static void InitLocalCache(Proc *procPtr);
|
||||
static int PushProcCallFrame(ClientData clientData,
|
||||
register Tcl_Interp *interp, int objc,
|
||||
Tcl_Obj *const objv[], int isLambda);
|
||||
static void ProcBodyDup(Tcl_Obj *srcPtr, Tcl_Obj *dupPtr);
|
||||
static void ProcBodyFree(Tcl_Obj *objPtr);
|
||||
static int ProcWrongNumArgs(Tcl_Interp *interp, int skip);
|
||||
@@ -92,10 +88,10 @@ static const Tcl_ObjType levelReferenceType = {
|
||||
*
|
||||
* Internally, ptr1 is a pointer to a Proc instance that is not bound to a
|
||||
* command name, and ptr2 is a pointer to the namespace that the Proc instance
|
||||
* will execute within.
|
||||
* will execute within. IF YOU CHANGE THIS, CHECK IN tclDisassemble.c TOO.
|
||||
*/
|
||||
|
||||
static const Tcl_ObjType lambdaType = {
|
||||
const Tcl_ObjType tclLambdaType = {
|
||||
"lambdaExpr", /* name */
|
||||
FreeLambdaInternalRep, /* freeIntRepProc */
|
||||
DupLambdaInternalRep, /* dupIntRepProc */
|
||||
@@ -221,7 +217,7 @@ Tcl_ProcObjCmd(
|
||||
*
|
||||
* This code is nearly identical to the #280 code in SetLambdaFromAny, see
|
||||
* this file. The differences are the different index of the body in the
|
||||
* line array of the context, and the lamdba code requires some special
|
||||
* line array of the context, and the lambda code requires some special
|
||||
* processing. Find a way to factor the common elements into a single
|
||||
* function.
|
||||
*/
|
||||
@@ -1571,7 +1567,7 @@ InitArgsAndLocals(
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* PushProcCallFrame --
|
||||
* TclPushProcCallFrame --
|
||||
*
|
||||
* Compiles a proc body if necessary, then pushes a CallFrame suitable
|
||||
* for executing it.
|
||||
@@ -1586,8 +1582,8 @@ InitArgsAndLocals(
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
PushProcCallFrame(
|
||||
int
|
||||
TclPushProcCallFrame(
|
||||
ClientData clientData, /* Record describing procedure to be
|
||||
* interpreted. */
|
||||
register Tcl_Interp *interp,/* Interpreter in which procedure was
|
||||
@@ -1708,7 +1704,7 @@ TclNRInterpProc(
|
||||
* procedure. */
|
||||
Tcl_Obj *const objv[]) /* Argument value objects. */
|
||||
{
|
||||
int result = PushProcCallFrame(clientData, interp, objc, objv,
|
||||
int result = TclPushProcCallFrame(clientData, interp, objc, objv,
|
||||
/*isLambda*/ 0);
|
||||
|
||||
if (result != TCL_OK) {
|
||||
@@ -2443,7 +2439,7 @@ DupLambdaInternalRep(
|
||||
|
||||
procPtr->refCount++;
|
||||
Tcl_IncrRefCount(nsObjPtr);
|
||||
copyPtr->typePtr = &lambdaType;
|
||||
copyPtr->typePtr = &tclLambdaType;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2480,7 +2476,7 @@ SetLambdaFromAny(
|
||||
|
||||
/*
|
||||
* Convert objPtr to list type first; if it cannot be converted, or if its
|
||||
* length is not 2, then it cannot be converted to lambdaType.
|
||||
* length is not 2, then it cannot be converted to tclLambdaType.
|
||||
*/
|
||||
|
||||
result = TclListObjGetElements(NULL, objPtr, &objc, &objv);
|
||||
@@ -2626,14 +2622,14 @@ SetLambdaFromAny(
|
||||
/*
|
||||
* Free the list internalrep of objPtr - this will free argsPtr, but
|
||||
* bodyPtr retains a reference from the Proc structure. Then finish the
|
||||
* conversion to lambdaType.
|
||||
* conversion to tclLambdaType.
|
||||
*/
|
||||
|
||||
TclFreeIntRep(objPtr);
|
||||
|
||||
objPtr->internalRep.twoPtrValue.ptr1 = procPtr;
|
||||
objPtr->internalRep.twoPtrValue.ptr2 = nsObjPtr;
|
||||
objPtr->typePtr = &lambdaType;
|
||||
objPtr->typePtr = &tclLambdaType;
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
@@ -2684,12 +2680,12 @@ TclNRApplyObjCmd(
|
||||
}
|
||||
|
||||
/*
|
||||
* Set lambdaPtr, convert it to lambdaType in the current interp if
|
||||
* Set lambdaPtr, convert it to tclLambdaType in the current interp if
|
||||
* necessary.
|
||||
*/
|
||||
|
||||
lambdaPtr = objv[1];
|
||||
if (lambdaPtr->typePtr == &lambdaType) {
|
||||
if (lambdaPtr->typePtr == &tclLambdaType) {
|
||||
procPtr = lambdaPtr->internalRep.twoPtrValue.ptr1;
|
||||
}
|
||||
|
||||
@@ -2767,7 +2763,7 @@ TclNRApplyObjCmd(
|
||||
}
|
||||
extraPtr->isRootEnsemble = isRootEnsemble;
|
||||
|
||||
result = PushProcCallFrame(procPtr, interp, objc, objv, 1);
|
||||
result = TclPushProcCallFrame(procPtr, interp, objc, objv, 1);
|
||||
if (result == TCL_OK) {
|
||||
TclNRAddCallback(interp, ApplyNR2, extraPtr, NULL, NULL, NULL);
|
||||
result = TclNRInterpProcCore(interp, objv[1], 2, &MakeLambdaError);
|
||||
@@ -2826,234 +2822,6 @@ MakeLambdaError(
|
||||
(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
|
||||
}
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* Tcl_DisassembleObjCmd --
|
||||
*
|
||||
* Implementation of the "::tcl::unsupported::disassemble" command. This
|
||||
* command is not documented, but will disassemble procedures, lambda
|
||||
* terms and general scripts. Note that will compile terms if necessary
|
||||
* in order to disassemble them.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
Tcl_DisassembleObjCmd(
|
||||
ClientData dummy, /* Not used. */
|
||||
Tcl_Interp *interp, /* Current interpreter. */
|
||||
int objc, /* Number of arguments. */
|
||||
Tcl_Obj *const objv[]) /* Argument objects. */
|
||||
{
|
||||
static const char *const types[] = {
|
||||
"lambda", "method", "objmethod", "proc", "script", NULL
|
||||
};
|
||||
enum Types {
|
||||
DISAS_LAMBDA, DISAS_CLASS_METHOD, DISAS_OBJECT_METHOD, DISAS_PROC,
|
||||
DISAS_SCRIPT
|
||||
};
|
||||
int idx, result;
|
||||
Tcl_Obj *codeObjPtr = NULL;
|
||||
Proc *procPtr = NULL;
|
||||
Tcl_HashEntry *hPtr;
|
||||
Object *oPtr;
|
||||
|
||||
if (objc < 2) {
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "type ...");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (Tcl_GetIndexFromObj(interp, objv[1], types, "type", 0, &idx)!=TCL_OK){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
switch ((enum Types) idx) {
|
||||
case DISAS_LAMBDA: {
|
||||
Command cmd;
|
||||
Tcl_Obj *nsObjPtr;
|
||||
Tcl_Namespace *nsPtr;
|
||||
|
||||
/*
|
||||
* Compile (if uncompiled) and disassemble a lambda term.
|
||||
*/
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "lambdaTerm");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (objv[2]->typePtr == &lambdaType) {
|
||||
procPtr = objv[2]->internalRep.twoPtrValue.ptr1;
|
||||
}
|
||||
if (procPtr == NULL || procPtr->iPtr != (Interp *) interp) {
|
||||
result = SetLambdaFromAny(interp, objv[2]);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
procPtr = objv[2]->internalRep.twoPtrValue.ptr1;
|
||||
}
|
||||
|
||||
memset(&cmd, 0, sizeof(Command));
|
||||
nsObjPtr = objv[2]->internalRep.twoPtrValue.ptr2;
|
||||
result = TclGetNamespaceFromObj(interp, nsObjPtr, &nsPtr);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
cmd.nsPtr = (Namespace *) nsPtr;
|
||||
procPtr->cmdPtr = &cmd;
|
||||
result = PushProcCallFrame(procPtr, interp, objc, objv, 1);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
TclPopStackFrame(interp);
|
||||
codeObjPtr = procPtr->bodyPtr;
|
||||
break;
|
||||
}
|
||||
case DISAS_PROC:
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "procName");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
procPtr = TclFindProc((Interp *) interp, TclGetString(objv[2]));
|
||||
if (procPtr == NULL) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"\"%s\" isn't a procedure", TclGetString(objv[2])));
|
||||
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "PROC",
|
||||
TclGetString(objv[2]), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compile (if uncompiled) and disassemble a procedure.
|
||||
*/
|
||||
|
||||
result = PushProcCallFrame(procPtr, interp, 2, objv+1, 1);
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
TclPopStackFrame(interp);
|
||||
codeObjPtr = procPtr->bodyPtr;
|
||||
break;
|
||||
case DISAS_SCRIPT:
|
||||
/*
|
||||
* Compile and disassemble a script.
|
||||
*/
|
||||
|
||||
if (objc != 3) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "script");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if ((objv[2]->typePtr != &tclByteCodeType)
|
||||
&& (TclSetByteCodeFromAny(interp, objv[2], NULL, NULL) != TCL_OK)) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
codeObjPtr = objv[2];
|
||||
break;
|
||||
|
||||
case DISAS_CLASS_METHOD:
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "className methodName");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Look up the body of a class method.
|
||||
*/
|
||||
|
||||
oPtr = (Object *) Tcl_GetObjectFromObj(interp, objv[2]);
|
||||
if (oPtr == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (oPtr->classPtr == NULL) {
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"\"%s\" is not a class", TclGetString(objv[2])));
|
||||
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CLASS",
|
||||
TclGetString(objv[2]), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
hPtr = Tcl_FindHashEntry(&oPtr->classPtr->classMethods,
|
||||
(char *) objv[3]);
|
||||
goto methodBody;
|
||||
case DISAS_OBJECT_METHOD:
|
||||
if (objc != 4) {
|
||||
Tcl_WrongNumArgs(interp, 2, objv, "objectName methodName");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* Look up the body of an instance method.
|
||||
*/
|
||||
|
||||
oPtr = (Object *) Tcl_GetObjectFromObj(interp, objv[2]);
|
||||
if (oPtr == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (oPtr->methodsPtr == NULL) {
|
||||
goto unknownMethod;
|
||||
}
|
||||
hPtr = Tcl_FindHashEntry(oPtr->methodsPtr, (char *) objv[3]);
|
||||
|
||||
/*
|
||||
* Compile (if necessary) and disassemble a method body.
|
||||
*/
|
||||
|
||||
methodBody:
|
||||
if (hPtr == NULL) {
|
||||
unknownMethod:
|
||||
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
|
||||
"unknown method \"%s\"", TclGetString(objv[3])));
|
||||
Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD",
|
||||
TclGetString(objv[3]), NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
procPtr = TclOOGetProcFromMethod(Tcl_GetHashValue(hPtr));
|
||||
if (procPtr == NULL) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"body not available for this kind of method", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE",
|
||||
"METHODTYPE", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if (procPtr->bodyPtr->typePtr != &tclByteCodeType) {
|
||||
Command cmd;
|
||||
|
||||
/*
|
||||
* Yes, this is ugly, but we need to pass the namespace in to the
|
||||
* compiler in two places.
|
||||
*/
|
||||
|
||||
cmd.nsPtr = (Namespace *) oPtr->namespacePtr;
|
||||
procPtr->cmdPtr = &cmd;
|
||||
result = TclProcCompileProc(interp, procPtr, procPtr->bodyPtr,
|
||||
(Namespace *) oPtr->namespacePtr, "body of method",
|
||||
TclGetString(objv[3]));
|
||||
procPtr->cmdPtr = NULL;
|
||||
if (result != TCL_OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
codeObjPtr = procPtr->bodyPtr;
|
||||
break;
|
||||
default:
|
||||
CLANG_ASSERT(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Do the actual disassembly.
|
||||
*/
|
||||
|
||||
if (((ByteCode *) codeObjPtr->internalRep.twoPtrValue.ptr1)->flags
|
||||
& TCL_BYTECODE_PRECOMPILED) {
|
||||
Tcl_SetObjResult(interp, Tcl_NewStringObj(
|
||||
"may not disassemble prebuilt bytecode", -1));
|
||||
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE",
|
||||
"BYTECODE", NULL);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
Tcl_SetObjResult(interp, TclDisassembleByteCodeObj(codeObjPtr));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode: c
|
||||
|
||||
+2
-1
@@ -946,7 +946,8 @@ CompileRegexp(
|
||||
* Tcl_RegExpExecObj to optionally do a fast match (avoids RE engine).
|
||||
*/
|
||||
|
||||
if (TclReToGlob(NULL, string, length, &stringBuf, &exact) == TCL_OK) {
|
||||
if (TclReToGlob(NULL, string, length, &stringBuf, &exact,
|
||||
NULL) == TCL_OK) {
|
||||
regexpPtr->globObjPtr = TclDStringToObj(&stringBuf);
|
||||
Tcl_IncrRefCount(regexpPtr->globObjPtr);
|
||||
} else {
|
||||
|
||||
+7
-2
@@ -353,11 +353,16 @@ Tcl_ConditionFinalize(
|
||||
*/
|
||||
|
||||
void
|
||||
TclFinalizeThreadData(void)
|
||||
TclFinalizeThreadData(int quick)
|
||||
{
|
||||
TclFinalizeThreadDataThread();
|
||||
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
|
||||
TclFinalizeThreadAllocThread();
|
||||
if (!quick) {
|
||||
/*
|
||||
* Quick exit principle makes it useless to terminate allocators
|
||||
*/
|
||||
TclFinalizeThreadAllocThread();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2511,6 +2511,9 @@ TclObjCallVarTraces(
|
||||
if (!part1Ptr) {
|
||||
part1Ptr = localName(iPtr->varFramePtr, index);
|
||||
}
|
||||
if (!part1Ptr) {
|
||||
Tcl_Panic("Cannot trace a variable with no name");
|
||||
}
|
||||
part1 = TclGetString(part1Ptr);
|
||||
part2 = part2Ptr? TclGetString(part2Ptr) : NULL;
|
||||
|
||||
|
||||
+8
-1
@@ -4249,7 +4249,8 @@ TclReToGlob(
|
||||
const char *reStr,
|
||||
int reStrLen,
|
||||
Tcl_DString *dsPtr,
|
||||
int *exactPtr)
|
||||
int *exactPtr,
|
||||
int *quantifiersFoundPtr)
|
||||
{
|
||||
int anchorLeft, anchorRight, lastIsStar, numStars;
|
||||
char *dsStr, *dsStrStart;
|
||||
@@ -4257,6 +4258,9 @@ TclReToGlob(
|
||||
|
||||
strEnd = reStr + reStrLen;
|
||||
Tcl_DStringInit(dsPtr);
|
||||
if (quantifiersFoundPtr != NULL) {
|
||||
*quantifiersFoundPtr = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* "***=xxx" == "*xxx*", watch for glob-sensitive chars.
|
||||
@@ -4369,6 +4373,9 @@ TclReToGlob(
|
||||
}
|
||||
break;
|
||||
case '.':
|
||||
if (quantifiersFoundPtr != NULL) {
|
||||
*quantifiersFoundPtr = 1;
|
||||
}
|
||||
anchorLeft = 0; /* prevent exact match */
|
||||
if (p+1 < strEnd) {
|
||||
if (p[1] == '*') {
|
||||
|
||||
+4
-5
@@ -4405,8 +4405,8 @@ ObjMakeUpvar(
|
||||
|| !HasLocalVars(varFramePtr)
|
||||
|| (strstr(TclGetString(myNamePtr), "::") != NULL))) {
|
||||
Tcl_SetObjResult((Tcl_Interp *) iPtr, Tcl_ObjPrintf(
|
||||
"bad variable name \"%s\": upvar won't create "
|
||||
"namespace variable that refers to procedure variable",
|
||||
"bad variable name \"%s\": can't create namespace "
|
||||
"variable that refers to procedure variable",
|
||||
TclGetString(myNamePtr)));
|
||||
Tcl_SetErrorCode(interp, "TCL", "UPVAR", "INVERTED", NULL);
|
||||
return TCL_ERROR;
|
||||
@@ -4506,9 +4506,8 @@ TclPtrObjMakeUpvar(
|
||||
*/
|
||||
|
||||
Tcl_SetObjResult((Tcl_Interp *) iPtr, Tcl_ObjPrintf(
|
||||
"bad variable name \"%s\": upvar won't create a"
|
||||
" scalar variable that looks like an array element",
|
||||
myName));
|
||||
"bad variable name \"%s\": can't create a scalar "
|
||||
"variable that looks like an array element", myName));
|
||||
Tcl_SetErrorCode(interp, "TCL", "UPVAR", "LOCAL_ELEMENT",
|
||||
NULL);
|
||||
return TCL_ERROR;
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
if {[info commands package] == ""} {
|
||||
error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]"
|
||||
}
|
||||
package require -exact Tcl 8.6.2
|
||||
package require -exact Tcl 8.6.3
|
||||
|
||||
# Compute the auto path to use in this interpreter.
|
||||
# The values on the path come from several locations:
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Addis_Ababa) {
|
||||
{-9223372036854775808 9288 0 LMT}
|
||||
{-3155682888 9320 0 ADMT}
|
||||
{-1062210920 10800 0 EAT}
|
||||
if {![info exists TZData(Africa/Nairobi)]} {
|
||||
LoadTimeZoneFile Africa/Nairobi
|
||||
}
|
||||
set TZData(:Africa/Addis_Ababa) $TZData(:Africa/Nairobi)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Asmara) {
|
||||
{-9223372036854775808 9332 0 LMT}
|
||||
{-3155682932 9332 0 AMT}
|
||||
{-2524530932 9320 0 ADMT}
|
||||
{-1062210920 10800 0 EAT}
|
||||
if {![info exists TZData(Africa/Nairobi)]} {
|
||||
LoadTimeZoneFile Africa/Nairobi
|
||||
}
|
||||
set TZData(:Africa/Asmara) $TZData(:Africa/Nairobi)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Bangui) {
|
||||
{-9223372036854775808 4460 0 LMT}
|
||||
{-1830388460 3600 0 WAT}
|
||||
if {![info exists TZData(Africa/Lagos)]} {
|
||||
LoadTimeZoneFile Africa/Lagos
|
||||
}
|
||||
set TZData(:Africa/Bangui) $TZData(:Africa/Lagos)
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
set TZData(:Africa/Bissau) {
|
||||
{-9223372036854775808 -3740 0 LMT}
|
||||
{-1849388260 -3600 0 WAT}
|
||||
{-1830380260 -3600 0 WAT}
|
||||
{157770000 0 0 GMT}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Blantyre) {
|
||||
{-9223372036854775808 8400 0 LMT}
|
||||
{-2109291600 7200 0 CAT}
|
||||
if {![info exists TZData(Africa/Maputo)]} {
|
||||
LoadTimeZoneFile Africa/Maputo
|
||||
}
|
||||
set TZData(:Africa/Blantyre) $TZData(:Africa/Maputo)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Brazzaville) {
|
||||
{-9223372036854775808 3668 0 LMT}
|
||||
{-1830387668 3600 0 WAT}
|
||||
if {![info exists TZData(Africa/Lagos)]} {
|
||||
LoadTimeZoneFile Africa/Lagos
|
||||
}
|
||||
set TZData(:Africa/Brazzaville) $TZData(:Africa/Lagos)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Bujumbura) {
|
||||
{-9223372036854775808 7048 0 LMT}
|
||||
{-2524528648 7200 0 CAT}
|
||||
if {![info exists TZData(Africa/Maputo)]} {
|
||||
LoadTimeZoneFile Africa/Maputo
|
||||
}
|
||||
set TZData(:Africa/Bujumbura) $TZData(:Africa/Maputo)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Dar_es_Salaam) {
|
||||
{-9223372036854775808 9428 0 LMT}
|
||||
{-1230777428 10800 0 EAT}
|
||||
{-694321200 9900 0 BEAUT}
|
||||
{-284006700 10800 0 EAT}
|
||||
if {![info exists TZData(Africa/Nairobi)]} {
|
||||
LoadTimeZoneFile Africa/Nairobi
|
||||
}
|
||||
set TZData(:Africa/Dar_es_Salaam) $TZData(:Africa/Nairobi)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Djibouti) {
|
||||
{-9223372036854775808 10356 0 LMT}
|
||||
{-1846291956 10800 0 EAT}
|
||||
if {![info exists TZData(Africa/Nairobi)]} {
|
||||
LoadTimeZoneFile Africa/Nairobi
|
||||
}
|
||||
set TZData(:Africa/Djibouti) $TZData(:Africa/Nairobi)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Douala) {
|
||||
{-9223372036854775808 2328 0 LMT}
|
||||
{-1830386328 3600 0 WAT}
|
||||
if {![info exists TZData(Africa/Lagos)]} {
|
||||
LoadTimeZoneFile Africa/Lagos
|
||||
}
|
||||
set TZData(:Africa/Douala) $TZData(:Africa/Lagos)
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Gaborone) {
|
||||
{-9223372036854775808 6220 0 LMT}
|
||||
{-2682294220 5400 0 SAST}
|
||||
{-2109288600 7200 0 CAT}
|
||||
{-829526400 10800 1 CAST}
|
||||
{-813805200 7200 0 CAT}
|
||||
if {![info exists TZData(Africa/Maputo)]} {
|
||||
LoadTimeZoneFile Africa/Maputo
|
||||
}
|
||||
set TZData(:Africa/Gaborone) $TZData(:Africa/Maputo)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Harare) {
|
||||
{-9223372036854775808 7452 0 LMT}
|
||||
{-2109290652 7200 0 CAT}
|
||||
if {![info exists TZData(Africa/Maputo)]} {
|
||||
LoadTimeZoneFile Africa/Maputo
|
||||
}
|
||||
set TZData(:Africa/Harare) $TZData(:Africa/Maputo)
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Kampala) {
|
||||
{-9223372036854775808 7780 0 LMT}
|
||||
{-1309745380 10800 0 EAT}
|
||||
{-1262314800 9000 0 BEAT}
|
||||
{-694319400 9900 0 BEAUT}
|
||||
{-410237100 10800 0 EAT}
|
||||
if {![info exists TZData(Africa/Nairobi)]} {
|
||||
LoadTimeZoneFile Africa/Nairobi
|
||||
}
|
||||
set TZData(:Africa/Kampala) $TZData(:Africa/Nairobi)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Kigali) {
|
||||
{-9223372036854775808 7216 0 LMT}
|
||||
{-1091498416 7200 0 CAT}
|
||||
if {![info exists TZData(Africa/Maputo)]} {
|
||||
LoadTimeZoneFile Africa/Maputo
|
||||
}
|
||||
set TZData(:Africa/Kigali) $TZData(:Africa/Maputo)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Kinshasa) {
|
||||
{-9223372036854775808 3672 0 LMT}
|
||||
{-2276643672 3600 0 WAT}
|
||||
if {![info exists TZData(Africa/Lagos)]} {
|
||||
LoadTimeZoneFile Africa/Lagos
|
||||
}
|
||||
set TZData(:Africa/Kinshasa) $TZData(:Africa/Lagos)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Libreville) {
|
||||
{-9223372036854775808 2268 0 LMT}
|
||||
{-1830386268 3600 0 WAT}
|
||||
if {![info exists TZData(Africa/Lagos)]} {
|
||||
LoadTimeZoneFile Africa/Lagos
|
||||
}
|
||||
set TZData(:Africa/Libreville) $TZData(:Africa/Lagos)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Luanda) {
|
||||
{-9223372036854775808 3176 0 LMT}
|
||||
{-2461452776 3124 0 AOT}
|
||||
{-1849395124 3600 0 WAT}
|
||||
if {![info exists TZData(Africa/Lagos)]} {
|
||||
LoadTimeZoneFile Africa/Lagos
|
||||
}
|
||||
set TZData(:Africa/Luanda) $TZData(:Africa/Lagos)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Lubumbashi) {
|
||||
{-9223372036854775808 6592 0 LMT}
|
||||
{-2276646592 7200 0 CAT}
|
||||
if {![info exists TZData(Africa/Maputo)]} {
|
||||
LoadTimeZoneFile Africa/Maputo
|
||||
}
|
||||
set TZData(:Africa/Lubumbashi) $TZData(:Africa/Maputo)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Lusaka) {
|
||||
{-9223372036854775808 6788 0 LMT}
|
||||
{-2109289988 7200 0 CAT}
|
||||
if {![info exists TZData(Africa/Maputo)]} {
|
||||
LoadTimeZoneFile Africa/Maputo
|
||||
}
|
||||
set TZData(:Africa/Lusaka) $TZData(:Africa/Maputo)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Malabo) {
|
||||
{-9223372036854775808 2108 0 LMT}
|
||||
{-1830386108 0 0 GMT}
|
||||
{-190857600 3600 0 WAT}
|
||||
if {![info exists TZData(Africa/Lagos)]} {
|
||||
LoadTimeZoneFile Africa/Lagos
|
||||
}
|
||||
set TZData(:Africa/Malabo) $TZData(:Africa/Lagos)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Maseru) {
|
||||
{-9223372036854775808 6600 0 LMT}
|
||||
{-2109289800 7200 0 SAST}
|
||||
{-829526400 10800 1 SAST}
|
||||
{-813805200 7200 0 SAST}
|
||||
if {![info exists TZData(Africa/Johannesburg)]} {
|
||||
LoadTimeZoneFile Africa/Johannesburg
|
||||
}
|
||||
set TZData(:Africa/Maseru) $TZData(:Africa/Johannesburg)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Mbabane) {
|
||||
{-9223372036854775808 7464 0 LMT}
|
||||
{-2109290664 7200 0 SAST}
|
||||
if {![info exists TZData(Africa/Johannesburg)]} {
|
||||
LoadTimeZoneFile Africa/Johannesburg
|
||||
}
|
||||
set TZData(:Africa/Mbabane) $TZData(:Africa/Johannesburg)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Mogadishu) {
|
||||
{-9223372036854775808 10888 0 LMT}
|
||||
{-2403572488 10800 0 EAT}
|
||||
{-1230778800 9000 0 BEAT}
|
||||
{-410236200 10800 0 EAT}
|
||||
if {![info exists TZData(Africa/Nairobi)]} {
|
||||
LoadTimeZoneFile Africa/Nairobi
|
||||
}
|
||||
set TZData(:Africa/Mogadishu) $TZData(:Africa/Nairobi)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Niamey) {
|
||||
{-9223372036854775808 508 0 LMT}
|
||||
{-1830384508 -3600 0 WAT}
|
||||
{-1131231600 0 0 GMT}
|
||||
{-315619200 3600 0 WAT}
|
||||
if {![info exists TZData(Africa/Lagos)]} {
|
||||
LoadTimeZoneFile Africa/Lagos
|
||||
}
|
||||
set TZData(:Africa/Niamey) $TZData(:Africa/Lagos)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Africa/Porto-Novo) {
|
||||
{-9223372036854775808 628 0 LMT}
|
||||
{-1830384628 0 0 GMT}
|
||||
{-1131235200 3600 0 WAT}
|
||||
if {![info exists TZData(Africa/Lagos)]} {
|
||||
LoadTimeZoneFile Africa/Lagos
|
||||
}
|
||||
set TZData(:Africa/Porto-Novo) $TZData(:Africa/Lagos)
|
||||
|
||||
@@ -4,6 +4,7 @@ set TZData(:America/Grand_Turk) {
|
||||
{-9223372036854775808 -17072 0 LMT}
|
||||
{-2524504528 -18431 0 KMT}
|
||||
{-1827687169 -18000 0 EST}
|
||||
{284014800 -18000 0 EST}
|
||||
{294217200 -14400 1 EDT}
|
||||
{309938400 -18000 0 EST}
|
||||
{325666800 -14400 1 EDT}
|
||||
@@ -77,173 +78,5 @@ set TZData(:America/Grand_Turk) {
|
||||
{1394348400 -14400 1 EDT}
|
||||
{1414908000 -18000 0 EST}
|
||||
{1425798000 -14400 1 EDT}
|
||||
{1446357600 -18000 0 EST}
|
||||
{1457852400 -14400 1 EDT}
|
||||
{1478412000 -18000 0 EST}
|
||||
{1489302000 -14400 1 EDT}
|
||||
{1509861600 -18000 0 EST}
|
||||
{1520751600 -14400 1 EDT}
|
||||
{1541311200 -18000 0 EST}
|
||||
{1552201200 -14400 1 EDT}
|
||||
{1572760800 -18000 0 EST}
|
||||
{1583650800 -14400 1 EDT}
|
||||
{1604210400 -18000 0 EST}
|
||||
{1615705200 -14400 1 EDT}
|
||||
{1636264800 -18000 0 EST}
|
||||
{1647154800 -14400 1 EDT}
|
||||
{1667714400 -18000 0 EST}
|
||||
{1678604400 -14400 1 EDT}
|
||||
{1699164000 -18000 0 EST}
|
||||
{1710054000 -14400 1 EDT}
|
||||
{1730613600 -18000 0 EST}
|
||||
{1741503600 -14400 1 EDT}
|
||||
{1762063200 -18000 0 EST}
|
||||
{1772953200 -14400 1 EDT}
|
||||
{1793512800 -18000 0 EST}
|
||||
{1805007600 -14400 1 EDT}
|
||||
{1825567200 -18000 0 EST}
|
||||
{1836457200 -14400 1 EDT}
|
||||
{1857016800 -18000 0 EST}
|
||||
{1867906800 -14400 1 EDT}
|
||||
{1888466400 -18000 0 EST}
|
||||
{1899356400 -14400 1 EDT}
|
||||
{1919916000 -18000 0 EST}
|
||||
{1930806000 -14400 1 EDT}
|
||||
{1951365600 -18000 0 EST}
|
||||
{1962860400 -14400 1 EDT}
|
||||
{1983420000 -18000 0 EST}
|
||||
{1994310000 -14400 1 EDT}
|
||||
{2014869600 -18000 0 EST}
|
||||
{2025759600 -14400 1 EDT}
|
||||
{2046319200 -18000 0 EST}
|
||||
{2057209200 -14400 1 EDT}
|
||||
{2077768800 -18000 0 EST}
|
||||
{2088658800 -14400 1 EDT}
|
||||
{2109218400 -18000 0 EST}
|
||||
{2120108400 -14400 1 EDT}
|
||||
{2140668000 -18000 0 EST}
|
||||
{2152162800 -14400 1 EDT}
|
||||
{2172722400 -18000 0 EST}
|
||||
{2183612400 -14400 1 EDT}
|
||||
{2204172000 -18000 0 EST}
|
||||
{2215062000 -14400 1 EDT}
|
||||
{2235621600 -18000 0 EST}
|
||||
{2246511600 -14400 1 EDT}
|
||||
{2267071200 -18000 0 EST}
|
||||
{2277961200 -14400 1 EDT}
|
||||
{2298520800 -18000 0 EST}
|
||||
{2309410800 -14400 1 EDT}
|
||||
{2329970400 -18000 0 EST}
|
||||
{2341465200 -14400 1 EDT}
|
||||
{2362024800 -18000 0 EST}
|
||||
{2372914800 -14400 1 EDT}
|
||||
{2393474400 -18000 0 EST}
|
||||
{2404364400 -14400 1 EDT}
|
||||
{2424924000 -18000 0 EST}
|
||||
{2435814000 -14400 1 EDT}
|
||||
{2456373600 -18000 0 EST}
|
||||
{2467263600 -14400 1 EDT}
|
||||
{2487823200 -18000 0 EST}
|
||||
{2499318000 -14400 1 EDT}
|
||||
{2519877600 -18000 0 EST}
|
||||
{2530767600 -14400 1 EDT}
|
||||
{2551327200 -18000 0 EST}
|
||||
{2562217200 -14400 1 EDT}
|
||||
{2582776800 -18000 0 EST}
|
||||
{2593666800 -14400 1 EDT}
|
||||
{2614226400 -18000 0 EST}
|
||||
{2625116400 -14400 1 EDT}
|
||||
{2645676000 -18000 0 EST}
|
||||
{2656566000 -14400 1 EDT}
|
||||
{2677125600 -18000 0 EST}
|
||||
{2688620400 -14400 1 EDT}
|
||||
{2709180000 -18000 0 EST}
|
||||
{2720070000 -14400 1 EDT}
|
||||
{2740629600 -18000 0 EST}
|
||||
{2751519600 -14400 1 EDT}
|
||||
{2772079200 -18000 0 EST}
|
||||
{2782969200 -14400 1 EDT}
|
||||
{2803528800 -18000 0 EST}
|
||||
{2814418800 -14400 1 EDT}
|
||||
{2834978400 -18000 0 EST}
|
||||
{2846473200 -14400 1 EDT}
|
||||
{2867032800 -18000 0 EST}
|
||||
{2877922800 -14400 1 EDT}
|
||||
{2898482400 -18000 0 EST}
|
||||
{2909372400 -14400 1 EDT}
|
||||
{2929932000 -18000 0 EST}
|
||||
{2940822000 -14400 1 EDT}
|
||||
{2961381600 -18000 0 EST}
|
||||
{2972271600 -14400 1 EDT}
|
||||
{2992831200 -18000 0 EST}
|
||||
{3003721200 -14400 1 EDT}
|
||||
{3024280800 -18000 0 EST}
|
||||
{3035775600 -14400 1 EDT}
|
||||
{3056335200 -18000 0 EST}
|
||||
{3067225200 -14400 1 EDT}
|
||||
{3087784800 -18000 0 EST}
|
||||
{3098674800 -14400 1 EDT}
|
||||
{3119234400 -18000 0 EST}
|
||||
{3130124400 -14400 1 EDT}
|
||||
{3150684000 -18000 0 EST}
|
||||
{3161574000 -14400 1 EDT}
|
||||
{3182133600 -18000 0 EST}
|
||||
{3193023600 -14400 1 EDT}
|
||||
{3213583200 -18000 0 EST}
|
||||
{3225078000 -14400 1 EDT}
|
||||
{3245637600 -18000 0 EST}
|
||||
{3256527600 -14400 1 EDT}
|
||||
{3277087200 -18000 0 EST}
|
||||
{3287977200 -14400 1 EDT}
|
||||
{3308536800 -18000 0 EST}
|
||||
{3319426800 -14400 1 EDT}
|
||||
{3339986400 -18000 0 EST}
|
||||
{3350876400 -14400 1 EDT}
|
||||
{3371436000 -18000 0 EST}
|
||||
{3382930800 -14400 1 EDT}
|
||||
{3403490400 -18000 0 EST}
|
||||
{3414380400 -14400 1 EDT}
|
||||
{3434940000 -18000 0 EST}
|
||||
{3445830000 -14400 1 EDT}
|
||||
{3466389600 -18000 0 EST}
|
||||
{3477279600 -14400 1 EDT}
|
||||
{3497839200 -18000 0 EST}
|
||||
{3508729200 -14400 1 EDT}
|
||||
{3529288800 -18000 0 EST}
|
||||
{3540178800 -14400 1 EDT}
|
||||
{3560738400 -18000 0 EST}
|
||||
{3572233200 -14400 1 EDT}
|
||||
{3592792800 -18000 0 EST}
|
||||
{3603682800 -14400 1 EDT}
|
||||
{3624242400 -18000 0 EST}
|
||||
{3635132400 -14400 1 EDT}
|
||||
{3655692000 -18000 0 EST}
|
||||
{3666582000 -14400 1 EDT}
|
||||
{3687141600 -18000 0 EST}
|
||||
{3698031600 -14400 1 EDT}
|
||||
{3718591200 -18000 0 EST}
|
||||
{3730086000 -14400 1 EDT}
|
||||
{3750645600 -18000 0 EST}
|
||||
{3761535600 -14400 1 EDT}
|
||||
{3782095200 -18000 0 EST}
|
||||
{3792985200 -14400 1 EDT}
|
||||
{3813544800 -18000 0 EST}
|
||||
{3824434800 -14400 1 EDT}
|
||||
{3844994400 -18000 0 EST}
|
||||
{3855884400 -14400 1 EDT}
|
||||
{3876444000 -18000 0 EST}
|
||||
{3887334000 -14400 1 EDT}
|
||||
{3907893600 -18000 0 EST}
|
||||
{3919388400 -14400 1 EDT}
|
||||
{3939948000 -18000 0 EST}
|
||||
{3950838000 -14400 1 EDT}
|
||||
{3971397600 -18000 0 EST}
|
||||
{3982287600 -14400 1 EDT}
|
||||
{4002847200 -18000 0 EST}
|
||||
{4013737200 -14400 1 EDT}
|
||||
{4034296800 -18000 0 EST}
|
||||
{4045186800 -14400 1 EDT}
|
||||
{4065746400 -18000 0 EST}
|
||||
{4076636400 -14400 1 EDT}
|
||||
{4097196000 -18000 0 EST}
|
||||
{1446361200 -14400 0 AST}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ set TZData(:America/Jamaica) {
|
||||
{-9223372036854775808 -18431 0 LMT}
|
||||
{-2524503169 -18431 0 KMT}
|
||||
{-1827687169 -18000 0 EST}
|
||||
{136364400 -14400 0 EDT}
|
||||
{126248400 -18000 0 EST}
|
||||
{126687600 -14400 1 EDT}
|
||||
{152085600 -18000 0 EST}
|
||||
{162370800 -14400 1 EDT}
|
||||
{183535200 -18000 0 EST}
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Antarctica/Troll) {
|
||||
{-9223372036854775808 0 0 zzz}
|
||||
{1108166400 0 0 UTC}
|
||||
{1111885200 7200 1 CEST}
|
||||
{1130634000 0 0 UTC}
|
||||
{1143334800 7200 1 CEST}
|
||||
{1162083600 0 0 UTC}
|
||||
{1174784400 7200 1 CEST}
|
||||
{1193533200 0 0 UTC}
|
||||
{1206838800 7200 1 CEST}
|
||||
{1224982800 0 0 UTC}
|
||||
{1238288400 7200 1 CEST}
|
||||
{1256432400 0 0 UTC}
|
||||
{1269738000 7200 1 CEST}
|
||||
{1288486800 0 0 UTC}
|
||||
{1301187600 7200 1 CEST}
|
||||
{1319936400 0 0 UTC}
|
||||
{1332637200 7200 1 CEST}
|
||||
{1351386000 0 0 UTC}
|
||||
{1364691600 7200 1 CEST}
|
||||
{1382835600 0 0 UTC}
|
||||
{1396141200 7200 1 CEST}
|
||||
{1414285200 0 0 UTC}
|
||||
{1427590800 7200 1 CEST}
|
||||
{1445734800 0 0 UTC}
|
||||
{1459040400 7200 1 CEST}
|
||||
{1477789200 0 0 UTC}
|
||||
{1490490000 7200 1 CEST}
|
||||
{1509238800 0 0 UTC}
|
||||
{1521939600 7200 1 CEST}
|
||||
{1540688400 0 0 UTC}
|
||||
{1553994000 7200 1 CEST}
|
||||
{1572138000 0 0 UTC}
|
||||
{1585443600 7200 1 CEST}
|
||||
{1603587600 0 0 UTC}
|
||||
{1616893200 7200 1 CEST}
|
||||
{1635642000 0 0 UTC}
|
||||
{1648342800 7200 1 CEST}
|
||||
{1667091600 0 0 UTC}
|
||||
{1679792400 7200 1 CEST}
|
||||
{1698541200 0 0 UTC}
|
||||
{1711846800 7200 1 CEST}
|
||||
{1729990800 0 0 UTC}
|
||||
{1743296400 7200 1 CEST}
|
||||
{1761440400 0 0 UTC}
|
||||
{1774746000 7200 1 CEST}
|
||||
{1792890000 0 0 UTC}
|
||||
{1806195600 7200 1 CEST}
|
||||
{1824944400 0 0 UTC}
|
||||
{1837645200 7200 1 CEST}
|
||||
{1856394000 0 0 UTC}
|
||||
{1869094800 7200 1 CEST}
|
||||
{1887843600 0 0 UTC}
|
||||
{1901149200 7200 1 CEST}
|
||||
{1919293200 0 0 UTC}
|
||||
{1932598800 7200 1 CEST}
|
||||
{1950742800 0 0 UTC}
|
||||
{1964048400 7200 1 CEST}
|
||||
{1982797200 0 0 UTC}
|
||||
{1995498000 7200 1 CEST}
|
||||
{2014246800 0 0 UTC}
|
||||
{2026947600 7200 1 CEST}
|
||||
{2045696400 0 0 UTC}
|
||||
{2058397200 7200 1 CEST}
|
||||
{2077146000 0 0 UTC}
|
||||
{2090451600 7200 1 CEST}
|
||||
{2108595600 0 0 UTC}
|
||||
{2121901200 7200 1 CEST}
|
||||
{2140045200 0 0 UTC}
|
||||
{2153350800 7200 1 CEST}
|
||||
{2172099600 0 0 UTC}
|
||||
{2184800400 7200 1 CEST}
|
||||
{2203549200 0 0 UTC}
|
||||
{2216250000 7200 1 CEST}
|
||||
{2234998800 0 0 UTC}
|
||||
{2248304400 7200 1 CEST}
|
||||
{2266448400 0 0 UTC}
|
||||
{2279754000 7200 1 CEST}
|
||||
{2297898000 0 0 UTC}
|
||||
{2311203600 7200 1 CEST}
|
||||
{2329347600 0 0 UTC}
|
||||
{2342653200 7200 1 CEST}
|
||||
{2361402000 0 0 UTC}
|
||||
{2374102800 7200 1 CEST}
|
||||
{2392851600 0 0 UTC}
|
||||
{2405552400 7200 1 CEST}
|
||||
{2424301200 0 0 UTC}
|
||||
{2437606800 7200 1 CEST}
|
||||
{2455750800 0 0 UTC}
|
||||
{2469056400 7200 1 CEST}
|
||||
{2487200400 0 0 UTC}
|
||||
{2500506000 7200 1 CEST}
|
||||
{2519254800 0 0 UTC}
|
||||
{2531955600 7200 1 CEST}
|
||||
{2550704400 0 0 UTC}
|
||||
{2563405200 7200 1 CEST}
|
||||
{2582154000 0 0 UTC}
|
||||
{2595459600 7200 1 CEST}
|
||||
{2613603600 0 0 UTC}
|
||||
{2626909200 7200 1 CEST}
|
||||
{2645053200 0 0 UTC}
|
||||
{2658358800 7200 1 CEST}
|
||||
{2676502800 0 0 UTC}
|
||||
{2689808400 7200 1 CEST}
|
||||
{2708557200 0 0 UTC}
|
||||
{2721258000 7200 1 CEST}
|
||||
{2740006800 0 0 UTC}
|
||||
{2752707600 7200 1 CEST}
|
||||
{2771456400 0 0 UTC}
|
||||
{2784762000 7200 1 CEST}
|
||||
{2802906000 0 0 UTC}
|
||||
{2816211600 7200 1 CEST}
|
||||
{2834355600 0 0 UTC}
|
||||
{2847661200 7200 1 CEST}
|
||||
{2866410000 0 0 UTC}
|
||||
{2879110800 7200 1 CEST}
|
||||
{2897859600 0 0 UTC}
|
||||
{2910560400 7200 1 CEST}
|
||||
{2929309200 0 0 UTC}
|
||||
{2942010000 7200 1 CEST}
|
||||
{2960758800 0 0 UTC}
|
||||
{2974064400 7200 1 CEST}
|
||||
{2992208400 0 0 UTC}
|
||||
{3005514000 7200 1 CEST}
|
||||
{3023658000 0 0 UTC}
|
||||
{3036963600 7200 1 CEST}
|
||||
{3055712400 0 0 UTC}
|
||||
{3068413200 7200 1 CEST}
|
||||
{3087162000 0 0 UTC}
|
||||
{3099862800 7200 1 CEST}
|
||||
{3118611600 0 0 UTC}
|
||||
{3131917200 7200 1 CEST}
|
||||
{3150061200 0 0 UTC}
|
||||
{3163366800 7200 1 CEST}
|
||||
{3181510800 0 0 UTC}
|
||||
{3194816400 7200 1 CEST}
|
||||
{3212960400 0 0 UTC}
|
||||
{3226266000 7200 1 CEST}
|
||||
{3245014800 0 0 UTC}
|
||||
{3257715600 7200 1 CEST}
|
||||
{3276464400 0 0 UTC}
|
||||
{3289165200 7200 1 CEST}
|
||||
{3307914000 0 0 UTC}
|
||||
{3321219600 7200 1 CEST}
|
||||
{3339363600 0 0 UTC}
|
||||
{3352669200 7200 1 CEST}
|
||||
{3370813200 0 0 UTC}
|
||||
{3384118800 7200 1 CEST}
|
||||
{3402867600 0 0 UTC}
|
||||
{3415568400 7200 1 CEST}
|
||||
{3434317200 0 0 UTC}
|
||||
{3447018000 7200 1 CEST}
|
||||
{3465766800 0 0 UTC}
|
||||
{3479072400 7200 1 CEST}
|
||||
{3497216400 0 0 UTC}
|
||||
{3510522000 7200 1 CEST}
|
||||
{3528666000 0 0 UTC}
|
||||
{3541971600 7200 1 CEST}
|
||||
{3560115600 0 0 UTC}
|
||||
{3573421200 7200 1 CEST}
|
||||
{3592170000 0 0 UTC}
|
||||
{3604870800 7200 1 CEST}
|
||||
{3623619600 0 0 UTC}
|
||||
{3636320400 7200 1 CEST}
|
||||
{3655069200 0 0 UTC}
|
||||
{3668374800 7200 1 CEST}
|
||||
{3686518800 0 0 UTC}
|
||||
{3699824400 7200 1 CEST}
|
||||
{3717968400 0 0 UTC}
|
||||
{3731274000 7200 1 CEST}
|
||||
{3750022800 0 0 UTC}
|
||||
{3762723600 7200 1 CEST}
|
||||
{3781472400 0 0 UTC}
|
||||
{3794173200 7200 1 CEST}
|
||||
{3812922000 0 0 UTC}
|
||||
{3825622800 7200 1 CEST}
|
||||
{3844371600 0 0 UTC}
|
||||
{3857677200 7200 1 CEST}
|
||||
{3875821200 0 0 UTC}
|
||||
{3889126800 7200 1 CEST}
|
||||
{3907270800 0 0 UTC}
|
||||
{3920576400 7200 1 CEST}
|
||||
{3939325200 0 0 UTC}
|
||||
{3952026000 7200 1 CEST}
|
||||
{3970774800 0 0 UTC}
|
||||
{3983475600 7200 1 CEST}
|
||||
{4002224400 0 0 UTC}
|
||||
{4015530000 7200 1 CEST}
|
||||
{4033674000 0 0 UTC}
|
||||
{4046979600 7200 1 CEST}
|
||||
{4065123600 0 0 UTC}
|
||||
{4078429200 7200 1 CEST}
|
||||
{4096573200 0 0 UTC}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Chita) {
|
||||
{-9223372036854775808 27232 0 LMT}
|
||||
{-1579419232 28800 0 YAKT}
|
||||
{-1247558400 32400 0 YAKMMTT}
|
||||
{354898800 36000 1 YAKST}
|
||||
{370706400 32400 0 YAKT}
|
||||
{386434800 36000 1 YAKST}
|
||||
{402242400 32400 0 YAKT}
|
||||
{417970800 36000 1 YAKST}
|
||||
{433778400 32400 0 YAKT}
|
||||
{449593200 36000 1 YAKST}
|
||||
{465325200 32400 0 YAKT}
|
||||
{481050000 36000 1 YAKST}
|
||||
{496774800 32400 0 YAKT}
|
||||
{512499600 36000 1 YAKST}
|
||||
{528224400 32400 0 YAKT}
|
||||
{543949200 36000 1 YAKST}
|
||||
{559674000 32400 0 YAKT}
|
||||
{575398800 36000 1 YAKST}
|
||||
{591123600 32400 0 YAKT}
|
||||
{606848400 36000 1 YAKST}
|
||||
{622573200 32400 0 YAKT}
|
||||
{638298000 36000 1 YAKST}
|
||||
{654627600 32400 0 YAKT}
|
||||
{670352400 28800 0 YAKMMTT}
|
||||
{670356000 32400 1 YAKST}
|
||||
{686080800 28800 0 YAKT}
|
||||
{695757600 32400 0 YAKMMTT}
|
||||
{701791200 36000 1 YAKST}
|
||||
{717512400 32400 0 YAKT}
|
||||
{733251600 36000 1 YAKST}
|
||||
{748976400 32400 0 YAKT}
|
||||
{764701200 36000 1 YAKST}
|
||||
{780426000 32400 0 YAKT}
|
||||
{796150800 36000 1 YAKST}
|
||||
{811875600 32400 0 YAKT}
|
||||
{828205200 36000 1 YAKST}
|
||||
{846349200 32400 0 YAKT}
|
||||
{859654800 36000 1 YAKST}
|
||||
{877798800 32400 0 YAKT}
|
||||
{891104400 36000 1 YAKST}
|
||||
{909248400 32400 0 YAKT}
|
||||
{922554000 36000 1 YAKST}
|
||||
{941302800 32400 0 YAKT}
|
||||
{954003600 36000 1 YAKST}
|
||||
{972752400 32400 0 YAKT}
|
||||
{985453200 36000 1 YAKST}
|
||||
{1004202000 32400 0 YAKT}
|
||||
{1017507600 36000 1 YAKST}
|
||||
{1035651600 32400 0 YAKT}
|
||||
{1048957200 36000 1 YAKST}
|
||||
{1067101200 32400 0 YAKT}
|
||||
{1080406800 36000 1 YAKST}
|
||||
{1099155600 32400 0 YAKT}
|
||||
{1111856400 36000 1 YAKST}
|
||||
{1130605200 32400 0 YAKT}
|
||||
{1143306000 36000 1 YAKST}
|
||||
{1162054800 32400 0 YAKT}
|
||||
{1174755600 36000 1 YAKST}
|
||||
{1193504400 32400 0 YAKT}
|
||||
{1206810000 36000 1 YAKST}
|
||||
{1224954000 32400 0 YAKT}
|
||||
{1238259600 36000 1 YAKST}
|
||||
{1256403600 32400 0 YAKT}
|
||||
{1269709200 36000 1 YAKST}
|
||||
{1288458000 32400 0 YAKT}
|
||||
{1301158800 36000 0 YAKT}
|
||||
{1414252800 28800 0 IRKT}
|
||||
}
|
||||
@@ -10,5 +10,5 @@ set TZData(:Asia/Dhaka) {
|
||||
{38772000 21600 0 BDT}
|
||||
{1230746400 21600 0 BDT}
|
||||
{1245430800 25200 1 BDST}
|
||||
{1262278740 21600 0 BDT}
|
||||
{1262278800 21600 0 BDT}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
set TZData(:Asia/Ho_Chi_Minh) {
|
||||
{-9223372036854775808 25600 0 LMT}
|
||||
{-2005974400 25580 0 SMT}
|
||||
{-1855983920 25200 0 ICT}
|
||||
{-1819954800 28800 0 ICT}
|
||||
{-1220428800 25200 0 ICT}
|
||||
{-2004073600 25590 0 PLMT}
|
||||
{-1851577590 25200 0 ICT}
|
||||
{-852105600 28800 0 IDT}
|
||||
{-782643600 32400 0 JST}
|
||||
{-767869200 25200 0 ICT}
|
||||
{-718095600 28800 0 IDT}
|
||||
{-457776000 25200 0 ICT}
|
||||
{-315648000 28800 0 IDT}
|
||||
{171820800 25200 0 ICT}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Irkutsk) {
|
||||
{-9223372036854775808 25035 0 LMT}
|
||||
{-2840165835 25035 0 IMT}
|
||||
{-1575874635 25200 0 IRKT}
|
||||
{-9223372036854775808 25025 0 LMT}
|
||||
{-2840165825 25025 0 IMT}
|
||||
{-1575874625 25200 0 IRKT}
|
||||
{-1247554800 28800 0 IRKMMTT}
|
||||
{354902400 32400 1 IRKST}
|
||||
{370710000 28800 0 IRKT}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Krasnoyarsk) {
|
||||
{-9223372036854775808 22280 0 LMT}
|
||||
{-1577513480 21600 0 KRAT}
|
||||
{-9223372036854775808 22286 0 LMT}
|
||||
{-1577513486 21600 0 KRAT}
|
||||
{-1247551200 25200 0 KRAMMTT}
|
||||
{354906000 28800 1 KRAST}
|
||||
{370713600 25200 0 KRAT}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Novokuznetsk) {
|
||||
{-9223372036854775808 20928 0 NMT}
|
||||
{-1577512128 21600 0 KRAT}
|
||||
{-9223372036854775808 20928 0 LMT}
|
||||
{-1441259328 21600 0 KRAT}
|
||||
{-1247551200 25200 0 KRAMMTT}
|
||||
{354906000 28800 1 KRAST}
|
||||
{370713600 25200 0 KRAT}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Omsk) {
|
||||
{-9223372036854775808 17616 0 LMT}
|
||||
{-1582088016 18000 0 OMST}
|
||||
{-9223372036854775808 17610 0 LMT}
|
||||
{-1582088010 18000 0 OMST}
|
||||
{-1247547600 21600 0 OMSMMTT}
|
||||
{354909600 25200 1 OMSST}
|
||||
{370717200 21600 0 OMST}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Phnom_Penh) {
|
||||
{-9223372036854775808 25180 0 LMT}
|
||||
{-2005973980 25580 0 SMT}
|
||||
{-1855983920 25200 0 ICT}
|
||||
{-1819954800 28800 0 ICT}
|
||||
{-1220428800 25200 0 ICT}
|
||||
if {![info exists TZData(Asia/Bangkok)]} {
|
||||
LoadTimeZoneFile Asia/Bangkok
|
||||
}
|
||||
set TZData(:Asia/Phnom_Penh) $TZData(:Asia/Bangkok)
|
||||
|
||||
@@ -2,12 +2,8 @@
|
||||
|
||||
set TZData(:Asia/Pyongyang) {
|
||||
{-9223372036854775808 30180 0 LMT}
|
||||
{-2524551780 30600 0 KST}
|
||||
{-2053931400 32400 0 JCST}
|
||||
{-1325494800 30600 0 KST}
|
||||
{-1199262600 32400 0 JCST}
|
||||
{-1948782180 30600 0 KST}
|
||||
{-1830414600 32400 0 JCST}
|
||||
{-1017824400 32400 0 JST}
|
||||
{-768646800 32400 0 KST}
|
||||
{-498128400 28800 0 KST}
|
||||
{-264931200 32400 0 KST}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Samarkand) {
|
||||
{-9223372036854775808 16032 0 LMT}
|
||||
{-1441168032 14400 0 SAMT}
|
||||
{-9223372036854775808 16073 0 LMT}
|
||||
{-1441168073 14400 0 SAMT}
|
||||
{-1247544000 18000 0 SAMT}
|
||||
{354913200 21600 1 SAMST}
|
||||
{370720800 21600 0 TAST}
|
||||
|
||||
+20
-13
@@ -2,19 +2,26 @@
|
||||
|
||||
set TZData(:Asia/Seoul) {
|
||||
{-9223372036854775808 30472 0 LMT}
|
||||
{-2524552072 30600 0 KST}
|
||||
{-2053931400 32400 0 JCST}
|
||||
{-1325494800 30600 0 KST}
|
||||
{-1199262600 32400 0 JCST}
|
||||
{-1948782472 30600 0 KST}
|
||||
{-1830414600 32400 0 JCST}
|
||||
{-1017824400 32400 0 JST}
|
||||
{-767350800 32400 0 KST}
|
||||
{-498128400 28800 0 KST}
|
||||
{-303984000 32400 1 KDT}
|
||||
{-293533200 28800 0 KST}
|
||||
{-264931200 30600 0 KST}
|
||||
{-39515400 32400 0 KST}
|
||||
{547570800 36000 1 KDT}
|
||||
{560872800 32400 0 KST}
|
||||
{579020400 36000 1 KDT}
|
||||
{592322400 32400 0 KST}
|
||||
{-498128400 30600 0 KST}
|
||||
{-462702600 34200 1 KDT}
|
||||
{-451733400 30600 0 KST}
|
||||
{-429784200 34200 1 KDT}
|
||||
{-418296600 30600 0 KST}
|
||||
{-399544200 34200 1 KDT}
|
||||
{-387451800 30600 0 KST}
|
||||
{-368094600 34200 1 KDT}
|
||||
{-356002200 30600 0 KST}
|
||||
{-336645000 34200 1 KDT}
|
||||
{-324552600 30600 0 KST}
|
||||
{-305195400 34200 1 KDT}
|
||||
{-293103000 30600 0 KST}
|
||||
{-264933000 32400 0 KST}
|
||||
{547578000 36000 1 KDT}
|
||||
{560883600 32400 0 KST}
|
||||
{579027600 36000 1 KDT}
|
||||
{592333200 32400 0 KST}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Srednekolymsk) {
|
||||
{-9223372036854775808 36892 0 LMT}
|
||||
{-1441188892 36000 0 MAGT}
|
||||
{-1247565600 39600 0 MAGMMTT}
|
||||
{354891600 43200 1 MAGST}
|
||||
{370699200 39600 0 MAGT}
|
||||
{386427600 43200 1 MAGST}
|
||||
{402235200 39600 0 MAGT}
|
||||
{417963600 43200 1 MAGST}
|
||||
{433771200 39600 0 MAGT}
|
||||
{449586000 43200 1 MAGST}
|
||||
{465318000 39600 0 MAGT}
|
||||
{481042800 43200 1 MAGST}
|
||||
{496767600 39600 0 MAGT}
|
||||
{512492400 43200 1 MAGST}
|
||||
{528217200 39600 0 MAGT}
|
||||
{543942000 43200 1 MAGST}
|
||||
{559666800 39600 0 MAGT}
|
||||
{575391600 43200 1 MAGST}
|
||||
{591116400 39600 0 MAGT}
|
||||
{606841200 43200 1 MAGST}
|
||||
{622566000 39600 0 MAGT}
|
||||
{638290800 43200 1 MAGST}
|
||||
{654620400 39600 0 MAGT}
|
||||
{670345200 36000 0 MAGMMTT}
|
||||
{670348800 39600 1 MAGST}
|
||||
{686073600 36000 0 MAGT}
|
||||
{695750400 39600 0 MAGMMTT}
|
||||
{701784000 43200 1 MAGST}
|
||||
{717505200 39600 0 MAGT}
|
||||
{733244400 43200 1 MAGST}
|
||||
{748969200 39600 0 MAGT}
|
||||
{764694000 43200 1 MAGST}
|
||||
{780418800 39600 0 MAGT}
|
||||
{796143600 43200 1 MAGST}
|
||||
{811868400 39600 0 MAGT}
|
||||
{828198000 43200 1 MAGST}
|
||||
{846342000 39600 0 MAGT}
|
||||
{859647600 43200 1 MAGST}
|
||||
{877791600 39600 0 MAGT}
|
||||
{891097200 43200 1 MAGST}
|
||||
{909241200 39600 0 MAGT}
|
||||
{922546800 43200 1 MAGST}
|
||||
{941295600 39600 0 MAGT}
|
||||
{953996400 43200 1 MAGST}
|
||||
{972745200 39600 0 MAGT}
|
||||
{985446000 43200 1 MAGST}
|
||||
{1004194800 39600 0 MAGT}
|
||||
{1017500400 43200 1 MAGST}
|
||||
{1035644400 39600 0 MAGT}
|
||||
{1048950000 43200 1 MAGST}
|
||||
{1067094000 39600 0 MAGT}
|
||||
{1080399600 43200 1 MAGST}
|
||||
{1099148400 39600 0 MAGT}
|
||||
{1111849200 43200 1 MAGST}
|
||||
{1130598000 39600 0 MAGT}
|
||||
{1143298800 43200 1 MAGST}
|
||||
{1162047600 39600 0 MAGT}
|
||||
{1174748400 43200 1 MAGST}
|
||||
{1193497200 39600 0 MAGT}
|
||||
{1206802800 43200 1 MAGST}
|
||||
{1224946800 39600 0 MAGT}
|
||||
{1238252400 43200 1 MAGST}
|
||||
{1256396400 39600 0 MAGT}
|
||||
{1269702000 43200 1 MAGST}
|
||||
{1288450800 39600 0 MAGT}
|
||||
{1301151600 43200 0 MAGT}
|
||||
{1414245600 39600 0 SRET}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Tbilisi) {
|
||||
{-9223372036854775808 10746 0 LMT}
|
||||
{-2840151546 10746 0 TBMT}
|
||||
{-1441162746 10800 0 TBIT}
|
||||
{-9223372036854775808 10751 0 LMT}
|
||||
{-2840151551 10751 0 TBMT}
|
||||
{-1441162751 10800 0 TBIT}
|
||||
{-405140400 14400 0 TBIT}
|
||||
{354916800 18000 1 TBIST}
|
||||
{370724400 14400 0 TBIT}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Vientiane) {
|
||||
{-9223372036854775808 24624 0 LMT}
|
||||
{-2005973424 25580 0 SMT}
|
||||
{-1855983920 25200 0 ICT}
|
||||
{-1819954800 28800 0 ICT}
|
||||
{-1220428800 25200 0 ICT}
|
||||
if {![info exists TZData(Asia/Bangkok)]} {
|
||||
LoadTimeZoneFile Asia/Bangkok
|
||||
}
|
||||
set TZData(:Asia/Vientiane) $TZData(:Asia/Bangkok)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Vladivostok) {
|
||||
{-9223372036854775808 31654 0 LMT}
|
||||
{-1487321254 32400 0 VLAT}
|
||||
{-9223372036854775808 31651 0 LMT}
|
||||
{-1487321251 32400 0 VLAT}
|
||||
{-1247562000 36000 0 VLAMMTT}
|
||||
{354895200 39600 1 VLAST}
|
||||
{370702800 36000 0 VLAT}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Asia/Yakutsk) {
|
||||
{-9223372036854775808 31120 0 LMT}
|
||||
{-1579423120 28800 0 YAKT}
|
||||
{-9223372036854775808 31138 0 LMT}
|
||||
{-1579423138 28800 0 YAKT}
|
||||
{-1247558400 32400 0 YAKMMTT}
|
||||
{354898800 36000 1 YAKST}
|
||||
{370706400 32400 0 YAKT}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
set TZData(:Asia/Yekaterinburg) {
|
||||
{-9223372036854775808 14553 0 LMT}
|
||||
{-1592611353 14400 0 SVET}
|
||||
{-1688270553 13505 0 PMT}
|
||||
{-1592610305 14400 0 SVET}
|
||||
{-1247544000 18000 0 SVEMMTT}
|
||||
{354913200 21600 1 SVEST}
|
||||
{370720800 18000 0 SVET}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
set TZData(:Atlantic/Azores) {
|
||||
{-9223372036854775808 -6160 0 LMT}
|
||||
{-2713904240 -6872 0 HMT}
|
||||
{-1849557928 -7200 0 AZOT}
|
||||
{-1830377128 -7200 0 AZOT}
|
||||
{-1689548400 -3600 1 AZOST}
|
||||
{-1677794400 -7200 0 AZOT}
|
||||
{-1667430000 -3600 1 AZOST}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
set TZData(:Atlantic/Madeira) {
|
||||
{-9223372036854775808 -4056 0 LMT}
|
||||
{-2713906344 -4056 0 FMT}
|
||||
{-1849560744 -3600 0 MADT}
|
||||
{-1830379944 -3600 0 MADT}
|
||||
{-1689552000 0 1 MADST}
|
||||
{-1677798000 -3600 0 MADT}
|
||||
{-1667433600 0 1 MADST}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Europe/Lisbon) {
|
||||
{-9223372036854775808 -2192 0 LMT}
|
||||
{-2713908208 -2192 0 LMT}
|
||||
{-1830381808 0 0 WET}
|
||||
{-9223372036854775808 -2205 0 LMT}
|
||||
{-2713908195 -2205 0 LMT}
|
||||
{-1830381795 0 0 WET}
|
||||
{-1689555600 3600 1 WEST}
|
||||
{-1677801600 0 0 WET}
|
||||
{-1667437200 3600 1 WEST}
|
||||
|
||||
@@ -71,4 +71,5 @@ set TZData(:Europe/Minsk) {
|
||||
{1269734400 10800 1 EEST}
|
||||
{1288483200 7200 0 EET}
|
||||
{1301184000 10800 0 FET}
|
||||
{1414274400 10800 0 MSK}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Europe/Riga) {
|
||||
{-9223372036854775808 5788 0 LMT}
|
||||
{-2840146588 5788 0 RMT}
|
||||
{-1632008188 9388 1 LST}
|
||||
{-1618702588 5788 0 RMT}
|
||||
{-1601681788 9388 1 LST}
|
||||
{-1597275388 5788 0 RMT}
|
||||
{-1377308188 7200 0 EET}
|
||||
{-9223372036854775808 5794 0 LMT}
|
||||
{-2840146594 5794 0 RMT}
|
||||
{-1632008194 9394 1 LST}
|
||||
{-1618702594 5794 0 RMT}
|
||||
{-1601681794 9394 1 LST}
|
||||
{-1597275394 5794 0 RMT}
|
||||
{-1377308194 7200 0 EET}
|
||||
{-928029600 10800 0 MSK}
|
||||
{-899521200 3600 0 CET}
|
||||
{-857257200 3600 0 CET}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Europe/Samara) {
|
||||
{-9223372036854775808 12036 0 LMT}
|
||||
{-1593825636 10800 0 SAMT}
|
||||
{-9223372036854775808 12020 0 LMT}
|
||||
{-1593825620 10800 0 SAMT}
|
||||
{-1247540400 14400 0 SAMT}
|
||||
{-1102305600 14400 0 KUYMMTT}
|
||||
{354916800 18000 1 KUYST}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Indian/Antananarivo) {
|
||||
{-9223372036854775808 11404 0 LMT}
|
||||
{-1846293004 10800 0 EAT}
|
||||
{-499924800 14400 1 EAST}
|
||||
{-492062400 10800 0 EAT}
|
||||
if {![info exists TZData(Africa/Nairobi)]} {
|
||||
LoadTimeZoneFile Africa/Nairobi
|
||||
}
|
||||
set TZData(:Indian/Antananarivo) $TZData(:Africa/Nairobi)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Indian/Comoro) {
|
||||
{-9223372036854775808 10384 0 LMT}
|
||||
{-1846291984 10800 0 EAT}
|
||||
if {![info exists TZData(Africa/Nairobi)]} {
|
||||
LoadTimeZoneFile Africa/Nairobi
|
||||
}
|
||||
set TZData(:Indian/Comoro) $TZData(:Africa/Nairobi)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Indian/Mayotte) {
|
||||
{-9223372036854775808 10856 0 LMT}
|
||||
{-1846292456 10800 0 EAT}
|
||||
if {![info exists TZData(Africa/Nairobi)]} {
|
||||
LoadTimeZoneFile Africa/Nairobi
|
||||
}
|
||||
set TZData(:Indian/Mayotte) $TZData(:Africa/Nairobi)
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# created by tools/tclZIC.tcl - do not edit
|
||||
|
||||
set TZData(:Pacific/Bougainville) {
|
||||
{-9223372036854775808 37336 0 LMT}
|
||||
{-2840178136 35312 0 PMMT}
|
||||
{-2366790512 36000 0 PGT}
|
||||
{-868010400 32400 0 JST}
|
||||
{-768906000 36000 0 PGT}
|
||||
{1419696000 39600 0 BST}
|
||||
}
|
||||
+171
-171
@@ -17,175 +17,175 @@ set TZData(:Pacific/Fiji) {
|
||||
{1358604000 43200 0 FJT}
|
||||
{1382796000 46800 1 FJST}
|
||||
{1390050000 43200 0 FJT}
|
||||
{1414245600 46800 1 FJST}
|
||||
{1421499600 43200 0 FJT}
|
||||
{1445695200 46800 1 FJST}
|
||||
{1453554000 43200 0 FJT}
|
||||
{1477144800 46800 1 FJST}
|
||||
{1485003600 43200 0 FJT}
|
||||
{1508594400 46800 1 FJST}
|
||||
{1516453200 43200 0 FJT}
|
||||
{1540044000 46800 1 FJST}
|
||||
{1547902800 43200 0 FJT}
|
||||
{1572098400 46800 1 FJST}
|
||||
{1579352400 43200 0 FJT}
|
||||
{1603548000 46800 1 FJST}
|
||||
{1611406800 43200 0 FJT}
|
||||
{1634997600 46800 1 FJST}
|
||||
{1642856400 43200 0 FJT}
|
||||
{1666447200 46800 1 FJST}
|
||||
{1674306000 43200 0 FJT}
|
||||
{1697896800 46800 1 FJST}
|
||||
{1705755600 43200 0 FJT}
|
||||
{1729951200 46800 1 FJST}
|
||||
{1737205200 43200 0 FJT}
|
||||
{1761400800 46800 1 FJST}
|
||||
{1768654800 43200 0 FJT}
|
||||
{1792850400 46800 1 FJST}
|
||||
{1800709200 43200 0 FJT}
|
||||
{1824300000 46800 1 FJST}
|
||||
{1832158800 43200 0 FJT}
|
||||
{1855749600 46800 1 FJST}
|
||||
{1863608400 43200 0 FJT}
|
||||
{1887199200 46800 1 FJST}
|
||||
{1895058000 43200 0 FJT}
|
||||
{1919253600 46800 1 FJST}
|
||||
{1926507600 43200 0 FJT}
|
||||
{1950703200 46800 1 FJST}
|
||||
{1957957200 43200 0 FJT}
|
||||
{1982152800 46800 1 FJST}
|
||||
{1990011600 43200 0 FJT}
|
||||
{2013602400 46800 1 FJST}
|
||||
{2021461200 43200 0 FJT}
|
||||
{2045052000 46800 1 FJST}
|
||||
{2052910800 43200 0 FJT}
|
||||
{2076501600 46800 1 FJST}
|
||||
{2084360400 43200 0 FJT}
|
||||
{2108556000 46800 1 FJST}
|
||||
{2115810000 43200 0 FJT}
|
||||
{2140005600 46800 1 FJST}
|
||||
{2147864400 43200 0 FJT}
|
||||
{2171455200 46800 1 FJST}
|
||||
{2179314000 43200 0 FJT}
|
||||
{2202904800 46800 1 FJST}
|
||||
{2210763600 43200 0 FJT}
|
||||
{2234354400 46800 1 FJST}
|
||||
{2242213200 43200 0 FJT}
|
||||
{2266408800 46800 1 FJST}
|
||||
{2273662800 43200 0 FJT}
|
||||
{2297858400 46800 1 FJST}
|
||||
{2305112400 43200 0 FJT}
|
||||
{2329308000 46800 1 FJST}
|
||||
{2337166800 43200 0 FJT}
|
||||
{2360757600 46800 1 FJST}
|
||||
{2368616400 43200 0 FJT}
|
||||
{2392207200 46800 1 FJST}
|
||||
{2400066000 43200 0 FJT}
|
||||
{2423656800 46800 1 FJST}
|
||||
{2431515600 43200 0 FJT}
|
||||
{2455711200 46800 1 FJST}
|
||||
{2462965200 43200 0 FJT}
|
||||
{2487160800 46800 1 FJST}
|
||||
{2495019600 43200 0 FJT}
|
||||
{2518610400 46800 1 FJST}
|
||||
{2526469200 43200 0 FJT}
|
||||
{2550060000 46800 1 FJST}
|
||||
{2557918800 43200 0 FJT}
|
||||
{2581509600 46800 1 FJST}
|
||||
{2589368400 43200 0 FJT}
|
||||
{2613564000 46800 1 FJST}
|
||||
{2620818000 43200 0 FJT}
|
||||
{2645013600 46800 1 FJST}
|
||||
{2652267600 43200 0 FJT}
|
||||
{2676463200 46800 1 FJST}
|
||||
{2684322000 43200 0 FJT}
|
||||
{2707912800 46800 1 FJST}
|
||||
{2715771600 43200 0 FJT}
|
||||
{2739362400 46800 1 FJST}
|
||||
{2747221200 43200 0 FJT}
|
||||
{2770812000 46800 1 FJST}
|
||||
{2778670800 43200 0 FJT}
|
||||
{2802866400 46800 1 FJST}
|
||||
{2810120400 43200 0 FJT}
|
||||
{2834316000 46800 1 FJST}
|
||||
{2841570000 43200 0 FJT}
|
||||
{2865765600 46800 1 FJST}
|
||||
{2873624400 43200 0 FJT}
|
||||
{2897215200 46800 1 FJST}
|
||||
{2905074000 43200 0 FJT}
|
||||
{2928664800 46800 1 FJST}
|
||||
{2936523600 43200 0 FJT}
|
||||
{2960114400 46800 1 FJST}
|
||||
{2967973200 43200 0 FJT}
|
||||
{2992168800 46800 1 FJST}
|
||||
{2999422800 43200 0 FJT}
|
||||
{3023618400 46800 1 FJST}
|
||||
{3031477200 43200 0 FJT}
|
||||
{3055068000 46800 1 FJST}
|
||||
{3062926800 43200 0 FJT}
|
||||
{3086517600 46800 1 FJST}
|
||||
{3094376400 43200 0 FJT}
|
||||
{3117967200 46800 1 FJST}
|
||||
{3125826000 43200 0 FJT}
|
||||
{3150021600 46800 1 FJST}
|
||||
{3157275600 43200 0 FJT}
|
||||
{3181471200 46800 1 FJST}
|
||||
{3188725200 43200 0 FJT}
|
||||
{3212920800 46800 1 FJST}
|
||||
{3220779600 43200 0 FJT}
|
||||
{3244370400 46800 1 FJST}
|
||||
{3252229200 43200 0 FJT}
|
||||
{3275820000 46800 1 FJST}
|
||||
{3283678800 43200 0 FJT}
|
||||
{3307269600 46800 1 FJST}
|
||||
{3315128400 43200 0 FJT}
|
||||
{3339324000 46800 1 FJST}
|
||||
{3346578000 43200 0 FJT}
|
||||
{3370773600 46800 1 FJST}
|
||||
{3378632400 43200 0 FJT}
|
||||
{3402223200 46800 1 FJST}
|
||||
{3410082000 43200 0 FJT}
|
||||
{3433672800 46800 1 FJST}
|
||||
{3441531600 43200 0 FJT}
|
||||
{3465122400 46800 1 FJST}
|
||||
{3472981200 43200 0 FJT}
|
||||
{3497176800 46800 1 FJST}
|
||||
{3504430800 43200 0 FJT}
|
||||
{3528626400 46800 1 FJST}
|
||||
{3535880400 43200 0 FJT}
|
||||
{3560076000 46800 1 FJST}
|
||||
{3567934800 43200 0 FJT}
|
||||
{3591525600 46800 1 FJST}
|
||||
{3599384400 43200 0 FJT}
|
||||
{3622975200 46800 1 FJST}
|
||||
{3630834000 43200 0 FJT}
|
||||
{3654424800 46800 1 FJST}
|
||||
{3662283600 43200 0 FJT}
|
||||
{3686479200 46800 1 FJST}
|
||||
{3693733200 43200 0 FJT}
|
||||
{3717928800 46800 1 FJST}
|
||||
{3725182800 43200 0 FJT}
|
||||
{3749378400 46800 1 FJST}
|
||||
{3757237200 43200 0 FJT}
|
||||
{3780828000 46800 1 FJST}
|
||||
{3788686800 43200 0 FJT}
|
||||
{3812277600 46800 1 FJST}
|
||||
{3820136400 43200 0 FJT}
|
||||
{3843727200 46800 1 FJST}
|
||||
{3851586000 43200 0 FJT}
|
||||
{3875781600 46800 1 FJST}
|
||||
{3883035600 43200 0 FJT}
|
||||
{3907231200 46800 1 FJST}
|
||||
{3915090000 43200 0 FJT}
|
||||
{3938680800 46800 1 FJST}
|
||||
{3946539600 43200 0 FJT}
|
||||
{3970130400 46800 1 FJST}
|
||||
{3977989200 43200 0 FJT}
|
||||
{4001580000 46800 1 FJST}
|
||||
{4009438800 43200 0 FJT}
|
||||
{4033634400 46800 1 FJST}
|
||||
{4040888400 43200 0 FJT}
|
||||
{4065084000 46800 1 FJST}
|
||||
{4072338000 43200 0 FJT}
|
||||
{4096533600 46800 1 FJST}
|
||||
{1414850400 46800 1 FJST}
|
||||
{1421503200 43200 0 FJT}
|
||||
{1446300000 46800 1 FJST}
|
||||
{1453557600 43200 0 FJT}
|
||||
{1478354400 46800 1 FJST}
|
||||
{1485007200 43200 0 FJT}
|
||||
{1509804000 46800 1 FJST}
|
||||
{1516456800 43200 0 FJT}
|
||||
{1541253600 46800 1 FJST}
|
||||
{1547906400 43200 0 FJT}
|
||||
{1572703200 46800 1 FJST}
|
||||
{1579356000 43200 0 FJT}
|
||||
{1604152800 46800 1 FJST}
|
||||
{1611410400 43200 0 FJT}
|
||||
{1636207200 46800 1 FJST}
|
||||
{1642860000 43200 0 FJT}
|
||||
{1667656800 46800 1 FJST}
|
||||
{1674309600 43200 0 FJT}
|
||||
{1699106400 46800 1 FJST}
|
||||
{1705759200 43200 0 FJT}
|
||||
{1730556000 46800 1 FJST}
|
||||
{1737208800 43200 0 FJT}
|
||||
{1762005600 46800 1 FJST}
|
||||
{1768658400 43200 0 FJT}
|
||||
{1793455200 46800 1 FJST}
|
||||
{1800712800 43200 0 FJT}
|
||||
{1825509600 46800 1 FJST}
|
||||
{1832162400 43200 0 FJT}
|
||||
{1856959200 46800 1 FJST}
|
||||
{1863612000 43200 0 FJT}
|
||||
{1888408800 46800 1 FJST}
|
||||
{1895061600 43200 0 FJT}
|
||||
{1919858400 46800 1 FJST}
|
||||
{1926511200 43200 0 FJT}
|
||||
{1951308000 46800 1 FJST}
|
||||
{1957960800 43200 0 FJT}
|
||||
{1983362400 46800 1 FJST}
|
||||
{1990015200 43200 0 FJT}
|
||||
{2014812000 46800 1 FJST}
|
||||
{2021464800 43200 0 FJT}
|
||||
{2046261600 46800 1 FJST}
|
||||
{2052914400 43200 0 FJT}
|
||||
{2077711200 46800 1 FJST}
|
||||
{2084364000 43200 0 FJT}
|
||||
{2109160800 46800 1 FJST}
|
||||
{2115813600 43200 0 FJT}
|
||||
{2140610400 46800 1 FJST}
|
||||
{2147868000 43200 0 FJT}
|
||||
{2172664800 46800 1 FJST}
|
||||
{2179317600 43200 0 FJT}
|
||||
{2204114400 46800 1 FJST}
|
||||
{2210767200 43200 0 FJT}
|
||||
{2235564000 46800 1 FJST}
|
||||
{2242216800 43200 0 FJT}
|
||||
{2267013600 46800 1 FJST}
|
||||
{2273666400 43200 0 FJT}
|
||||
{2298463200 46800 1 FJST}
|
||||
{2305116000 43200 0 FJT}
|
||||
{2329912800 46800 1 FJST}
|
||||
{2337170400 43200 0 FJT}
|
||||
{2361967200 46800 1 FJST}
|
||||
{2368620000 43200 0 FJT}
|
||||
{2393416800 46800 1 FJST}
|
||||
{2400069600 43200 0 FJT}
|
||||
{2424866400 46800 1 FJST}
|
||||
{2431519200 43200 0 FJT}
|
||||
{2456316000 46800 1 FJST}
|
||||
{2462968800 43200 0 FJT}
|
||||
{2487765600 46800 1 FJST}
|
||||
{2495023200 43200 0 FJT}
|
||||
{2519820000 46800 1 FJST}
|
||||
{2526472800 43200 0 FJT}
|
||||
{2551269600 46800 1 FJST}
|
||||
{2557922400 43200 0 FJT}
|
||||
{2582719200 46800 1 FJST}
|
||||
{2589372000 43200 0 FJT}
|
||||
{2614168800 46800 1 FJST}
|
||||
{2620821600 43200 0 FJT}
|
||||
{2645618400 46800 1 FJST}
|
||||
{2652271200 43200 0 FJT}
|
||||
{2677068000 46800 1 FJST}
|
||||
{2684325600 43200 0 FJT}
|
||||
{2709122400 46800 1 FJST}
|
||||
{2715775200 43200 0 FJT}
|
||||
{2740572000 46800 1 FJST}
|
||||
{2747224800 43200 0 FJT}
|
||||
{2772021600 46800 1 FJST}
|
||||
{2778674400 43200 0 FJT}
|
||||
{2803471200 46800 1 FJST}
|
||||
{2810124000 43200 0 FJT}
|
||||
{2834920800 46800 1 FJST}
|
||||
{2841573600 43200 0 FJT}
|
||||
{2866975200 46800 1 FJST}
|
||||
{2873628000 43200 0 FJT}
|
||||
{2898424800 46800 1 FJST}
|
||||
{2905077600 43200 0 FJT}
|
||||
{2929874400 46800 1 FJST}
|
||||
{2936527200 43200 0 FJT}
|
||||
{2961324000 46800 1 FJST}
|
||||
{2967976800 43200 0 FJT}
|
||||
{2992773600 46800 1 FJST}
|
||||
{2999426400 43200 0 FJT}
|
||||
{3024223200 46800 1 FJST}
|
||||
{3031480800 43200 0 FJT}
|
||||
{3056277600 46800 1 FJST}
|
||||
{3062930400 43200 0 FJT}
|
||||
{3087727200 46800 1 FJST}
|
||||
{3094380000 43200 0 FJT}
|
||||
{3119176800 46800 1 FJST}
|
||||
{3125829600 43200 0 FJT}
|
||||
{3150626400 46800 1 FJST}
|
||||
{3157279200 43200 0 FJT}
|
||||
{3182076000 46800 1 FJST}
|
||||
{3188728800 43200 0 FJT}
|
||||
{3213525600 46800 1 FJST}
|
||||
{3220783200 43200 0 FJT}
|
||||
{3245580000 46800 1 FJST}
|
||||
{3252232800 43200 0 FJT}
|
||||
{3277029600 46800 1 FJST}
|
||||
{3283682400 43200 0 FJT}
|
||||
{3308479200 46800 1 FJST}
|
||||
{3315132000 43200 0 FJT}
|
||||
{3339928800 46800 1 FJST}
|
||||
{3346581600 43200 0 FJT}
|
||||
{3371378400 46800 1 FJST}
|
||||
{3378636000 43200 0 FJT}
|
||||
{3403432800 46800 1 FJST}
|
||||
{3410085600 43200 0 FJT}
|
||||
{3434882400 46800 1 FJST}
|
||||
{3441535200 43200 0 FJT}
|
||||
{3466332000 46800 1 FJST}
|
||||
{3472984800 43200 0 FJT}
|
||||
{3497781600 46800 1 FJST}
|
||||
{3504434400 43200 0 FJT}
|
||||
{3529231200 46800 1 FJST}
|
||||
{3535884000 43200 0 FJT}
|
||||
{3560680800 46800 1 FJST}
|
||||
{3567938400 43200 0 FJT}
|
||||
{3592735200 46800 1 FJST}
|
||||
{3599388000 43200 0 FJT}
|
||||
{3624184800 46800 1 FJST}
|
||||
{3630837600 43200 0 FJT}
|
||||
{3655634400 46800 1 FJST}
|
||||
{3662287200 43200 0 FJT}
|
||||
{3687084000 46800 1 FJST}
|
||||
{3693736800 43200 0 FJT}
|
||||
{3718533600 46800 1 FJST}
|
||||
{3725186400 43200 0 FJT}
|
||||
{3750588000 46800 1 FJST}
|
||||
{3757240800 43200 0 FJT}
|
||||
{3782037600 46800 1 FJST}
|
||||
{3788690400 43200 0 FJT}
|
||||
{3813487200 46800 1 FJST}
|
||||
{3820140000 43200 0 FJT}
|
||||
{3844936800 46800 1 FJST}
|
||||
{3851589600 43200 0 FJT}
|
||||
{3876386400 46800 1 FJST}
|
||||
{3883039200 43200 0 FJT}
|
||||
{3907836000 46800 1 FJST}
|
||||
{3915093600 43200 0 FJT}
|
||||
{3939890400 46800 1 FJST}
|
||||
{3946543200 43200 0 FJT}
|
||||
{3971340000 46800 1 FJST}
|
||||
{3977992800 43200 0 FJT}
|
||||
{4002789600 46800 1 FJST}
|
||||
{4009442400 43200 0 FJT}
|
||||
{4034239200 46800 1 FJST}
|
||||
{4040892000 43200 0 FJT}
|
||||
{4065688800 46800 1 FJST}
|
||||
{4072341600 43200 0 FJT}
|
||||
{4097138400 46800 1 FJST}
|
||||
}
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ MODIFICATIONS.
|
||||
|
||||
GOVERNMENT USE: If you are acquiring this software on behalf of the
|
||||
U.S. government, the Government shall have only "Restricted Rights"
|
||||
in the software and related documentation as defined in the Federal
|
||||
in the software and related documentation as defined in the Federal
|
||||
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
|
||||
are acquiring the software on behalf of the Department of Defense, the
|
||||
software shall be classified as "Commercial Computer Software" and the
|
||||
@@ -37,4 +37,4 @@ Government shall have only "Restricted Rights" as defined in Clause
|
||||
252.227-7014 (b) (3) of DFARs. Notwithstanding the foregoing, the
|
||||
authors grant the U.S. Government and others acting in its behalf
|
||||
permission to use and distribute the software in accordance with the
|
||||
terms specified in this license.
|
||||
terms specified in this license.
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ INSTALL_TARGET := install
|
||||
|
||||
export CPPROG := cp -p
|
||||
|
||||
INSTALL_TARGETS = install-binaries install-libraries
|
||||
INSTALL_TARGETS = install-binaries install-headers install-libraries
|
||||
ifeq (${EMBEDDED_BUILD},)
|
||||
INSTALL_TARGETS += install-private-headers
|
||||
endif
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
|
||||
dnl generate the file "configure", which is run during Tcl installation
|
||||
dnl to configure the system for the local environment.
|
||||
|
||||
dnl Ensure that the config (auto)headers support is used, then just
|
||||
dnl Ensure that the config (auto)headers support is used, then just
|
||||
dnl include the configure sources from ../unix:
|
||||
|
||||
m4_include(../unix/aclocal.m4)
|
||||
|
||||
+2
-2
@@ -36,14 +36,14 @@ needs to conform to the following conventions.
|
||||
|
||||
clean: Delete all files generated by the default build target.
|
||||
|
||||
distclean: Delete all generated files.
|
||||
distclean: Delete all generated files.
|
||||
|
||||
dist: Produce a copy of the package's source code distribution.
|
||||
Must respect the DIST_ROOT variable determining where to
|
||||
write the generated directory.
|
||||
|
||||
Packages that are written to make use of the Tcl Extension Architecture (TEA)
|
||||
and that make use of the tclconfig collection of support files, should
|
||||
and that make use of the tclconfig collection of support files, should
|
||||
conform to these conventions without further efforts.
|
||||
|
||||
These conventions are subject to revision and refinement over time to
|
||||
|
||||
@@ -292,6 +292,23 @@ test append-9.3 {bug 3057639, append direct eval, read trace on non-existing env
|
||||
} -cleanup {
|
||||
unset -nocomplain ::env(__DUMMY__)
|
||||
} -result {0 {new value}}
|
||||
|
||||
test append-10.1 {Bug 214cc0eb22: lappend with no values} {
|
||||
set lst "# 1 2 3"
|
||||
[subst lappend] lst
|
||||
} "# 1 2 3"
|
||||
test append-10.2 {Bug 214cc0eb22: lappend with no values} -body {
|
||||
set lst "1 \{ 2"
|
||||
[subst lappend] lst
|
||||
} -returnCodes error -result {unmatched open brace in list}
|
||||
test append-10.3 {Bug 214cc0eb22: expanded lappend with no values} {
|
||||
set lst "# 1 2 3"
|
||||
[subst lappend] lst {*}[list]
|
||||
} "# 1 2 3"
|
||||
test append-10.4 {Bug 214cc0eb22: expanded lappend with no values} -body {
|
||||
set lst "1 \{ 2"
|
||||
[subst lappend] lst {*}[list]
|
||||
} -returnCodes error -result {unmatched open brace in list}
|
||||
|
||||
unset -nocomplain i x result y
|
||||
catch {rename foo ""}
|
||||
|
||||
@@ -438,6 +438,27 @@ test appendComp-9.3 {bug 3057639, append direct eval, read trace on non-existing
|
||||
} -cleanup {
|
||||
unset -nocomplain ::env(__DUMMY__)
|
||||
} -result {0 {new value}}
|
||||
|
||||
test appendComp-10.1 {Bug 214cc0eb22: lappend with no values} {
|
||||
apply {lst {
|
||||
lappend lst
|
||||
}} "# 1 2 3"
|
||||
} "# 1 2 3"
|
||||
test appendComp-10.2 {Bug 214cc0eb22: lappend with no values} -body {
|
||||
apply {lst {
|
||||
lappend lst
|
||||
}} "1 \{ 2"
|
||||
} -returnCodes error -result {unmatched open brace in list}
|
||||
test appendComp-10.3 {Bug 214cc0eb22: expanded lappend with no values} {
|
||||
apply {lst {
|
||||
lappend lst {*}[list]
|
||||
}} "# 1 2 3"
|
||||
} "# 1 2 3"
|
||||
test appendComp-10.4 {Bug 214cc0eb22: expanded lappend with no values} -body {
|
||||
apply {lst {
|
||||
lappend lst {*}[list]
|
||||
}} "1 \{ 2"
|
||||
} -returnCodes error -result {unmatched open brace in list}
|
||||
|
||||
catch {unset i x result y}
|
||||
catch {rename foo ""}
|
||||
|
||||
+91
-3
@@ -455,14 +455,22 @@ test compile-13.1 {testing underestimate of maxStackSize in list cmd} {exec} {
|
||||
list [catch {exec [interpreter] << $script} msg] $msg
|
||||
} {0 OK}
|
||||
|
||||
# Special test for compiling tokens from a copy of the source string. [Bug
|
||||
# 599788]
|
||||
# Tests compile-14.* for [Bug 599788] [Bug 0c043a175a47da8c2342]
|
||||
test compile-14.1 {testing errors in element name; segfault?} {} {
|
||||
catch {set a([error])} msg1
|
||||
catch {set bubba([join $abba $jubba]) $vol} msg2
|
||||
list $msg1 $msg2
|
||||
} {{wrong # args: should be "error message ?errorInfo? ?errorCode?"} {can't read "abba": no such variable}}
|
||||
|
||||
test compile-14.2 {testing element name "$"} -body {
|
||||
unset -nocomplain a
|
||||
set a() 1
|
||||
set a(1) 2
|
||||
set a($) 3
|
||||
list [set a()] [set a(1)] [set a($)] [unset a() a(1); lindex [array names a] 0]
|
||||
} -cleanup {unset a} -result [list 1 2 3 {$}]
|
||||
|
||||
|
||||
# Tests compile-15.* cover Tcl Bug 633204
|
||||
test compile-15.1 {proper TCL_RETURN code from [return]} {
|
||||
apply {{} {catch return}}
|
||||
@@ -658,12 +666,15 @@ test compile-17.2 {Command interpretation binding for non-compiled code} -setup
|
||||
# does not check the format of disassembled bytecode though; that's liable to
|
||||
# change without warning.
|
||||
|
||||
set disassemblables [linsert [join {
|
||||
lambda method objmethod proc script
|
||||
} ", "] end-1 or]
|
||||
test compile-18.1 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::disassemble
|
||||
} -match glob -result {wrong # args: should be "*"}
|
||||
test compile-18.2 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::disassemble ?
|
||||
} -match glob -result {bad type "?": must be *}
|
||||
} -result "bad type \"?\": must be $disassemblables"
|
||||
test compile-18.3 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::disassemble lambda
|
||||
} -match glob -result {wrong # args: should be "* lambda lambdaTerm"}
|
||||
@@ -737,6 +748,83 @@ test compile-18.19 {disassembler - basics} -setup {
|
||||
} -cleanup {
|
||||
foo destroy
|
||||
} -match glob -result *
|
||||
# There never was a compile-18.20.
|
||||
# The keys of the dictionary produced by [getbytecode] are defined.
|
||||
set bytecodekeys {literals variables exception instructions auxiliary commands script namespace stackdepth exceptdepth}
|
||||
test compile-18.21 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode
|
||||
} -match glob -result {wrong # args: should be "*"}
|
||||
test compile-18.22 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode ?
|
||||
} -result "bad type \"?\": must be $disassemblables"
|
||||
test compile-18.23 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode lambda
|
||||
} -match glob -result {wrong # args: should be "* lambda lambdaTerm"}
|
||||
test compile-18.24 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode lambda \{
|
||||
} -result "can't interpret \"\{\" as a lambda expression"
|
||||
test compile-18.25 {disassembler - basics} -body {
|
||||
dict keys [tcl::unsupported::getbytecode lambda {{} {}}]
|
||||
} -result $bytecodekeys
|
||||
test compile-18.26 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode proc
|
||||
} -match glob -result {wrong # args: should be "* proc procName"}
|
||||
test compile-18.27 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode proc nosuchproc
|
||||
} -result {"nosuchproc" isn't a procedure}
|
||||
test compile-18.28 {disassembler - basics} -setup {
|
||||
proc chewonthis {} {}
|
||||
} -body {
|
||||
dict keys [tcl::unsupported::getbytecode proc chewonthis]
|
||||
} -cleanup {
|
||||
rename chewonthis {}
|
||||
} -result $bytecodekeys
|
||||
test compile-18.29 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode script
|
||||
} -match glob -result {wrong # args: should be "* script script"}
|
||||
test compile-18.30 {disassembler - basics} -body {
|
||||
dict keys [tcl::unsupported::getbytecode script {}]
|
||||
} -result $bytecodekeys
|
||||
test compile-18.31 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode method
|
||||
} -match glob -result {wrong # args: should be "* method className methodName"}
|
||||
test compile-18.32 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode method nosuchclass foo
|
||||
} -result {nosuchclass does not refer to an object}
|
||||
test compile-18.33 {disassembler - basics} -returnCodes error -setup {
|
||||
oo::object create justanobject
|
||||
} -body {
|
||||
tcl::unsupported::getbytecode method justanobject foo
|
||||
} -cleanup {
|
||||
justanobject destroy
|
||||
} -result {"justanobject" is not a class}
|
||||
test compile-18.34 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode method oo::object nosuchmethod
|
||||
} -result {unknown method "nosuchmethod"}
|
||||
test compile-18.35 {disassembler - basics} -setup {
|
||||
oo::class create foo {method bar {} {}}
|
||||
} -body {
|
||||
dict keys [tcl::unsupported::getbytecode method foo bar]
|
||||
} -cleanup {
|
||||
foo destroy
|
||||
} -result $bytecodekeys
|
||||
test compile-18.36 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode objmethod
|
||||
} -match glob -result {wrong # args: should be "* objmethod objectName methodName"}
|
||||
test compile-18.37 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode objmethod nosuchobject foo
|
||||
} -result {nosuchobject does not refer to an object}
|
||||
test compile-18.38 {disassembler - basics} -returnCodes error -body {
|
||||
tcl::unsupported::getbytecode objmethod oo::object nosuchmethod
|
||||
} -result {unknown method "nosuchmethod"}
|
||||
test compile-18.39 {disassembler - basics} -setup {
|
||||
oo::object create foo
|
||||
oo::objdefine foo {method bar {} {}}
|
||||
} -body {
|
||||
dict keys [tcl::unsupported::getbytecode objmethod foo bar]
|
||||
} -cleanup {
|
||||
foo destroy
|
||||
} -result $bytecodekeys
|
||||
|
||||
test compile-19.0 {Bug 3614102: reset stack housekeeping} -body {
|
||||
# This will panic in a --enable-symbols=compile build, unless bug is fixed.
|
||||
|
||||
@@ -726,6 +726,20 @@ test coroutine-7.11 {yieldto context nuke: Bug a90d9331bc} -setup {
|
||||
catch {namespace delete ::cotest}
|
||||
catch {rename cotest ""}
|
||||
} -result {yieldto called in deleted namespace}
|
||||
test coroutine-7.12 {coro floor above street level #3008307} -body {
|
||||
proc c {} {
|
||||
yield
|
||||
}
|
||||
proc cc {} {
|
||||
coroutine C c
|
||||
}
|
||||
proc boom {} {
|
||||
cc ; # coro created at level 2
|
||||
C ; # and called at level 1
|
||||
}
|
||||
boom ; # does not crash: the coro floor is a good insulator
|
||||
list
|
||||
} -result {}
|
||||
|
||||
|
||||
# cleanup
|
||||
|
||||
@@ -1184,6 +1184,12 @@ test error-21.8 {memory leaks in try: Bug 2910044} memory {
|
||||
}
|
||||
} 0
|
||||
|
||||
test error-21.9 {Bug cee90e4e88} {
|
||||
# Just don't panic.
|
||||
apply {{} {try {} on ok {} - on return {} {}}}
|
||||
} {}
|
||||
|
||||
|
||||
# negative case try tests - bad "trap" handler
|
||||
# what is the effect if we attempt to trap an errorcode that is not a list?
|
||||
# nested try
|
||||
|
||||
@@ -513,6 +513,9 @@ test filesystem-6.32 {empty file name} -returnCodes error -body {
|
||||
file type ""
|
||||
} -result {could not read "": no such file or directory}
|
||||
test filesystem-6.33 {empty file name} {file writable ""} 0
|
||||
test filesystem-6.34 {file name with (invalid) nul character} {
|
||||
list [catch "open foo\x00" msg] $msg
|
||||
} [list 1 "couldn't open \"foo\x00\": filename is invalid on this platform"]
|
||||
|
||||
# Make sure the testfilesystem hasn't been registered.
|
||||
if {[testConstraint testfilesystem]} {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user