Compare commits

..
Author SHA1 Message Date
dkf d9096d1ada And the last bits that need fixing; the code is still less efficient than desired but should now not crash. 2013-10-20 18:11:35 +00:00
dkf fc106439d4 Fix handling of 'invokeExpanded' and start to do 'returnStk'. 2013-10-19 14:11:28 +00:00
dkf c0d3a447bc Added missing exception range finalize. 2013-10-19 12:29:06 +00:00
dkf 0981d85b0c Improve coverage of [error] compilation. 2013-10-19 11:20:46 +00:00
dkf 443ca84a71 Tackle evalStk by reusing existing machinery. 2013-10-18 07:08:46 +00:00
dkf 2aaf426036 Do jump generation at places where INST_RETURN_IMM might occur. 2013-10-15 00:27:56 +00:00
dkf e15b769c9d Added the tests I want to pass... 2013-10-13 13:57:27 +00:00
dkf d197994bd2 update comments 2013-10-13 13:34:01 +00:00
dkf 19e7a90783 Stop crashing in interactive testing. (The unknown and history mechanisms tend
to exercise some parts of the bytecode compiler very well.)
2013-10-13 12:09:22 +00:00
dkf daab595dea Working towards better handling of stack balance with break and continue exceptions. 2013-10-08 09:02:50 +00:00
jan.nijtmans f86d726f85 Fix for [d4e464ae48]: tcl 8.5.15/8.6.1 breaks python make check on darwin 2013-10-07 14:25:21 +00:00
jan.nijtmans 3ad87b0a02 Fix for [d4e464ae48]: tcl 8.5.15/8.6.1 breaks python make check on darwin 2013-10-07 14:23:00 +00:00
jan.nijtmans c83af8f8d4 First attempt to fix bug [d4e464ae48]: tcl 8.5.15/8.61 breaks python make check on darwin 2013-10-06 19:27:50 +00:00
dkf d6e62aeb84 [3381085] Improved way of detecting what version of the documentation to build.
Set the HTML_VERSION environment variable to override the (sensible) default.
2013-10-06 19:17:20 +00:00
Kevin B Kenny eb7a25fe2b mark merge 2013-10-05 16:30:16 +00:00
Kevin B Kenny 560c2dcbe1 Advance to tzdata2013g 2013-10-05 16:28:52 +00:00
Kevin B Kenny 7413854f34 Advance to tzdata2013g 2013-10-05 16:22:16 +00:00
dkf 28552e2e35 Added missing documentation. Corrected result of Tcl_OOInitStubs in non-stub case. 2013-10-04 13:12:22 +00:00
jan.nijtmans c3651154a7 When compiling with MSVC++, no longer link the stub library with msvcrt??.dll.
This way, workarounds in extensions like [http://core.tcl.tk/itcl/info/a961f0729c] are no longer necessary.
2013-10-03 20:41:03 +00:00
jan.nijtmans 73b02508fa When compiling with MSVC++, no longer link the stub library with msvcrt??.dll.
This way, workarounds in extensions like [http://core.tcl.tk/itcl/info/a961f0729c] are no longer necessary.
2013-10-03 15:17:43 +00:00
dkf 4759be8760 minor: whitespace correction (my bad!) 2013-10-02 14:35:30 +00:00
dkf 4b54ec077b neater 2013-10-02 13:16:10 +00:00
dkf 76ca8e7008 silence warnings with clang 2013-10-02 13:14:29 +00:00
jan.nijtmans 31d38b0701 Fix compilation of Itcl and Tdbc 2013-10-02 10:30:19 +00:00
dkf e104cccd94 Turn Tcl_OOInitStubs into a no-op in non-stub-enabled usage. 2013-10-02 10:01:50 +00:00
dkf 8789461a94 Fix TclOO API export rules. 2013-10-02 09:41:01 +00:00
jan.nijtmans ec1dceef35 Fix compilation with latest MinGW-w64 version 3.0: Conflict on EXCEPTION_REGISTRATION typedef, which means something completely different in MinGW-w64. 2013-10-02 08:08:10 +00:00
jan.nijtmans 5e1eaa44bc Fix compilation with latest MinGW-w64 version 3.0: Conflict on EXCEPTION_REGISTRATION typedef, which means something completely different in MinGW-w64. 2013-10-02 07:58:50 +00:00
jan.nijtmans a403e2663e Disable command line globbing on MinGW compiles: this saves startup time, since the result of the glob is not used anywhere. 2013-09-30 14:07:20 +00:00
jan.nijtmans c5f68dde5c Disable command line globbing on MinGW compiles: this saves startup time, since the result of the glob is not used anywhere. 2013-09-30 14:03:56 +00:00
jan.nijtmans 868c2951dc Restore copyright assignments and some improved comments in tclOO.decls: previous commit was a blind revert of [371bcd0714], but those changes should not have been reverted. 2013-09-30 09:38:49 +00:00
jan.nijtmans e438509c68 Fix [f51efe99a7] by reverting [371bcd0714] 2013-09-30 09:03:20 +00:00
dkf 4f19f86513 typo; spotted by stu 2013-09-28 22:52:11 +00:00
dkf fd38147f32 [dfc08326e3]: Corrected symbol export for TclOO to match Tcl so things work as
expected in a static build.
2013-09-28 21:10:22 +00:00
dgp ce33f01bf1 Fix test source-4.1 2013-09-27 17:33:17 +00:00
dgp bfb7ea0e46 merge 8.5 2013-09-27 16:10:43 +00:00
dgp 694bd3ba73 Merge forward new test, marked as knownBug, so other merges are no longer held back. 2013-09-27 15:34:09 +00:00
dkf 067ef1dcea [219226]: Rewrote how ::env is synchronized to the environment so it no longer
smashes the array or its elements flat, This affects traces on env, links to
env, and iterations over env: it makes them work as naïvely expected.
2013-09-27 10:29:43 +00:00
jan.nijtmans 878c0cff52 Cherrypick [87d1313df3] from trunk:
Workaround for [http://sourceforge.net/p/mingw/bugs/2065/|MinGW bug #2065]. 
Both MinGW and MinGW-w64 (32-bit) are affected. 
Even though Win64 is not affected, adding -static-libgcc doesn't harm there, and we don't want to distrubute additional dll's with MinGW-compiled Tcl anyway.
2013-09-27 09:35:05 +00:00
jan.nijtmans 9bdcf8e201 Workaround for [http://sourceforge.net/p/mingw/bugs/2065/|MinGW bug #2065].
Both MinGW and MinGW-w64 (32-bit) are affected. 
Even though Win64 is not affected, adding -static-libgcc doesn't harm there, and we don't want to distrubute additional dll's with MinGW-compiled Tcl anyway.
2013-09-27 09:18:36 +00:00
jan.nijtmans 09a4760ba3 Tcl_SetResult -> Tcl_SetObjResult 2013-09-26 14:27:37 +00:00
dkf ce9b84204c [d614d63989] Ensure that there are no trailing colons as that causes chaos when a deleteProc is specified. 2013-09-25 22:54:29 +00:00
dgp e929b91222 Test demonstrating need for "adjust" manipulation in TclSubstTokens. 2013-09-25 16:39:26 +00:00
dgp 1d119413f6 revert mistaken commit of experiment 2013-09-23 12:18:45 +00:00
jan.nijtmans 1fce20754c workaround for mingw bug [http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724] 2013-09-23 11:27:47 +00:00
jan.nijtmans 96fec1a88c workaround for mingw bug [http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724] 2013-09-23 11:12:12 +00:00
jan.nijtmans 9e6b54e433 Make sure that panic's during finalization are handled by the custom panicproc not by the default panicproc, because stderr might not be available.
When the default panicproc is in use, this doesn't make any difference.
2013-09-20 09:11:51 +00:00
dgp 39fcdc3c6e merge release 2013-09-20 05:28:59 +00:00
dkf 1479c62f1c [3970f54c4e]: Improved fix that is more tolerant of a single variable varname. 2013-09-19 22:37:06 +00:00
dgp 54a81d4f0e merge trunk 2013-09-19 20:07:41 +00:00
dkf f95a5e7c82 [3970f54c4e]: Corrected regression in argument order processing in [unset]. 2013-09-19 19:37:05 +00:00
dgp 5285fe3ede merge trunk; update changes 2013-09-19 19:10:47 +00:00
dgp 8e1f9e82da comment 2013-09-19 19:02:42 +00:00
dgp fbac621bfc Line numbers wrong in compiled [unset]. 2013-09-19 18:53:01 +00:00
dgp 3cc058aa46 Line numbers wrong in compiled [dict with]. 2013-09-19 17:21:41 +00:00
dgp 3e3649a18e Line numbers wrong in compiled [dict exists]. 2013-09-19 17:01:58 +00:00
dgp d35d4b2c53 Line numbers wrong in compiled [global] and [variable]. 2013-09-19 16:41:04 +00:00
dgp c91c7b7cf1 Line numbers wrong in compiled [global] and [variable]. 2013-09-19 16:33:36 +00:00
dgp b4a00d3ac5 Line numbers wrong in compiled [namespace upvar]. 2013-09-19 16:11:20 +00:00
dgp bfcb6b40d2 renumber tests for branch merge 2013-09-19 16:06:53 +00:00
dgp 2440231062 Line numbers wrong in compiled [namespace upvar]. 2013-09-19 16:04:48 +00:00
dgp 0f1e352369 Line numbers wrong in compiled [upvar]. 2013-09-19 15:57:38 +00:00
dgp aed9fbb19c Line numbers wrong in compiled [upvar]. 2013-09-19 15:44:21 +00:00
dgp 4551ca9b2c Line numbers wrong in compiled [dict update]. 2013-09-19 15:05:55 +00:00
dgp e4dfb0d689 Line numbers wrong in compiled [dict update]. 2013-09-19 15:04:47 +00:00
dgp 63e65ca6f1 Line numbers wrong in compiled [dict for]. 2013-09-19 14:56:29 +00:00
dgp 7887926261 Line numbers wrong in compiled [dict for]. 2013-09-19 14:55:05 +00:00
dgp 91eca443b7 Line numbers wrong in compiled [dict get]. 2013-09-19 14:49:28 +00:00
dgp cb5d76ed2b Line numbers wrong in compiled [dict get]. 2013-09-19 14:48:02 +00:00
dgp 10372d985a Stop segfault due to OBOE in CompileWord() calls in [dict incr] compiler. 2013-09-19 14:22:37 +00:00
dkf 5aee161167 [3606943]: Corrected description of method search order. 2013-09-19 14:21:21 +00:00
dgp 657b49a9d1 Stop segfault due to OBOE in CompileWord() calls in [dict incr] compiler. 2013-09-19 14:06:46 +00:00
dgp bbf4d17089 [31661d2135] Plug memory leak. 2013-09-19 13:44:18 +00:00
dgp 4a2c3b6440 [31661d2135] Plug memory leak. 2013-09-19 13:39:40 +00:00
dgp 3f481feba6 Line numbers wrong in compiled [dict set]. 2013-09-19 13:13:00 +00:00
dgp 1b0845930c Line numbers wrong in compiled [dict set]. 2013-09-19 13:06:06 +00:00
jan.nijtmans 50a0b81579 consistant use of capitals 2013-09-19 13:00:02 +00:00
jan.nijtmans ad07565ec0 consistant use of capitals. 2013-09-19 12:37:13 +00:00
dgp 3b93da87b3 Merge test; bug already fixed in trunk. 2013-09-19 12:22:25 +00:00
dgp a414da9341 Line numbers wrong in compiled foreach body. 2013-09-19 12:20:13 +00:00
dgp 345bd636d4 Stop segfault due to OBOE in CompileWord() calls in [dict lappend] compiler. 2013-09-19 04:27:11 +00:00
dgp 134ada8ff9 Stop segfault due to OBOE in CompileWord() calls in [dict lappend] compiler. 2013-09-19 04:20:53 +00:00
dgp 3204893f09 [3487626] knownBug tests dict-23.2 and dist-24.21 already fixed on trunk. 2013-09-19 04:11:01 +00:00
dgp 7bc81bcbb0 [3487626] Backport fix for knownBug test dict-23.2. 2013-09-19 04:03:57 +00:00
dgp 6d44125712 merge release 2013-09-18 19:13:31 +00:00
dkf a2df72aecb Bump TclOO version to 1.0.1 2013-09-18 12:32:26 +00:00
dgp 85c48e5e91 merge trunk; update changes 2013-09-17 12:17:40 +00:00
dkf d4d8f3201a [2152292]: Corrected implementation of uuencode handling to support line length
indicator bytes.

***POTENTIAL INCOMPATIBILITY***
Existing code that was using the old versions and working around the
limitations will now need to do far less. The -maxlen option now has strict
limits on the range of supported lengths; this is a limitation of the format
itself.
2013-09-17 09:24:41 +00:00
dkf debbae5fd9 ChangeLog entry 2013-09-17 09:20:58 +00:00
dkf 649d0983f9 small improvements to the documentation 2013-09-17 09:13:40 +00:00
dgp 3146ffb96b [7b32d8d13b] Insert missing field initialization. 2013-09-16 23:18:54 +00:00
dgp f1a2117967 merge trunk; update changes 2013-09-16 18:59:14 +00:00
dkf 2044cba5ac Refactor to remove unused flexibility. 2013-09-16 09:03:50 +00:00
dkf eee6883d2a Be careful: separator needs to be bytes, not internal-encoded. 2013-09-16 08:52:12 +00:00
jan.nijtmans 472fd0a636 Add back -wrapchar option to "binary encode uuencode" 2013-09-15 16:30:01 +00:00
dkf bfe331b12a And the decoder too. 2013-09-14 18:25:45 +00:00
jan.nijtmans 1092cae12e Hm, this check doesn't really add anything. 2013-09-14 08:59:41 +00:00
jan.nijtmans 54850c7528 Add back -wrapchar option to "binary encode uuencode". 2013-09-14 08:51:23 +00:00
dkf 365b878745 [2152292] Corrected implementation of uuencoding. 2013-09-14 07:07:03 +00:00
dgp 08390e5c47 Added note to ChangeLog pointing to the fossil timeline for better logging. 2013-09-13 16:02:11 +00:00
dgp a52254cce9 merge 8.5; update changes 2013-09-13 14:14:24 +00:00
dgp 5cc8523f8e merge mark 2013-09-13 14:12:40 +00:00
dgp bcb4faa32f [bdd91c7e43] Stop crash due to error in execution stack memory management.
Thanks to azazel for the fix.
2013-09-13 14:09:09 +00:00
jan.nijtmans fa65ef51ba Suggested fix for [bdd91c7e43]: tclsh crashes in [interp delete] 2013-09-13 10:53:32 +00:00
dgp e94119e59b More macro use. 2013-09-13 03:33:43 +00:00
dgp 0440ab215b Push fixup on the stack only when needed. 2013-09-12 19:27:48 +00:00
dgp 27c4d781f4 Swap the two fixups used when compiling the ternary operator.
Push them on the stack only when needed, and pop as soon as possible.
2013-09-12 19:21:20 +00:00
dgp 8fd5bbdc7c Stop allocating JumpFixups for jumps that can never need any fixing up. 2013-09-12 17:42:36 +00:00
dgp 612c7a7d4a Eliminate another surplus storage field. Make a(n ab)use of the existing
JumpFixup fields instead.
2013-09-11 05:07:52 +00:00
dgp c4a5440ed1 Make use of the existing JumpFixup fields. Eliminate extra storage
field 'offset' in JumpList that we don't require.
2013-09-11 04:49:08 +00:00
dgp 822fd2d405 Stop the save and restore of currStackDepth. Just manage it correctly so
it doesn't need correcting.
2013-09-11 02:32:04 +00:00
dkf e723893895 [3609693] Must strip the internal representation of procedure-like methods in
order to ensure that any bound references to instance variables are removed.
2013-09-09 14:12:05 +00:00
dkf e0623615e3 [3609693] Must strip the internal representation of procedure-like methods in
order to ensure that any bound references to instance variables are removed.
2013-09-09 13:34:06 +00:00
dkf b348c536f6 merge trunk 2013-09-09 12:34:33 +00:00
dkf 2b788a21e4 [3611643] Stop polluting the global namespace.
Refactor the index entry generation so it is done right, once.
Handle more of [namespace ensemble create]'s behavior.
2013-09-08 10:21:37 +00:00
dgp a8bbc9486a merge 8.5. update changes. 2013-09-08 03:26:12 +00:00
dgp f089b1e4a1 [86ceb4e2b6] Improve reaction when multiple *tm files purport to offer the
same version of the same package. Prefer the file that comes first on the
tm path. Makes TCL*_TM_PATH variables more useful. Thanks to Gustaf Neumann
for the suggestion. 
[a16752c252] Revise (partially revert) bug fix to stop crashes in buggy 
tclcompiler.
2013-09-07 22:19:49 +00:00
dgp bb55ca2e95 [86ceb4e2b6] Improve reaction when multiple *tm files purport to offer the
same version of the same package.  Prefer the file that comes first on
the tm path.  Makes TCL*_TM_PATH variables more useful.  Thanks to
Gustaf Neumann for the suggestion.
2013-09-07 21:36:37 +00:00
dgp 0288a572d8 merge trunk 2013-09-07 21:19:47 +00:00
dgp 1ecf461e41 Partial revert of [a16752c252] bug fix to stop crashes in buggy tclcompiler. 2013-09-07 18:49:55 +00:00
dgp 97f9595151 Partial revert of [a16752c252] bug fix to stop crashes in buggy tclcompiler. 2013-09-05 17:21:41 +00:00
dgp 30710a181c Use ne instead of [string length] for less shimmer risk. 2013-09-05 15:47:29 +00:00
dgp 493b04cbc0 Error in order of #include lines broke some windows builds. 2013-09-05 12:45:11 +00:00
dgp 8938dbcc25 Merge commits to the correct branch -- trunk 2013-09-05 12:35:24 +00:00
dgp db738e7756 [010f4162ef] Repair effect of trace errors on -errorinfo and -errorstack. 2013-09-05 12:31:46 +00:00
dgp c6bb98e763 Cleaned up test command trying to make valgrind happy. 2013-09-04 12:45:51 +00:00
dkf c938932757 [98c8b3ec12] Make test fail in less catastrophic manner. 2013-09-04 09:36:22 +00:00
jan.nijtmans 9878106deb Fix 3 trivial (possible) errors, discovered by covertity.com 2013-09-04 07:22:45 +00:00
dgp 4d70c5f1e1 doc fix exposed by make html 2013-09-03 18:50:08 +00:00
dgp c5cad32cd6 make dist 2013-09-03 17:39:34 +00:00
dgp 6a3868f2cc typo 2013-09-03 17:07:41 +00:00
dgp 3116380710 Favor timeline over ChangeLog 2013-09-03 16:47:50 +00:00
dgp 53dc4dcdee Favor timeline over ChangeLog 2013-09-03 16:45:56 +00:00
dgp 4733e874fc update changes 2013-09-03 16:04:30 +00:00
dgp a313e78ffa some missed changes 2013-09-03 16:04:06 +00:00
dgp 2c3dbea378 Add test and improve errorInfo. 2013-09-02 18:47:07 +00:00
dgp 8520e69f32 [010f4162ef] First step of fix on stammering errorstack. errorstack fixed.
errorinfo revision still under consideration.
2013-09-02 17:59:42 +00:00
jan.nijtmans 54223a5f7e typo 2013-09-02 14:01:00 +00:00
dkf 22515fc47f [b98fa55285]: Fix handling of whitespace at end of hex strings to decode. 2013-09-01 20:08:50 +00:00
dgp 8932701ae7 Bump version number to 8.6.1. 2013-08-30 22:04:12 +00:00
dgp 6b45d21b4b Bump to tcltest 2.3.6 to account for changes since Tcl 8.6.0 release. 2013-08-30 21:57:26 +00:00
dgp 3adc645802 fix date 2013-08-30 14:31:06 +00:00
dgp 743ced9da3 changes 2013-08-30 14:16:05 +00:00
dgp b9ef276505 Bump to 8.5.15 for release. 2013-08-29 20:08:04 +00:00
dgp ebd7e8a86b [2486550] NR-enable same-interp invokehidden. Also, reroute all objProc
invocation through the common routines of EvalObjvCore and Dispatch.
2013-08-29 19:19:32 +00:00
dgp 4096bf5d01 New internal eval flag value so that all TclNREvalObjv() callers that
pre-resolve command names can choose whether or not TclNREvalObjv() should
attempt to re-do the resolution from objv[0] when something goes wrong.
2013-08-29 17:59:36 +00:00
dgp 6dcfcb8be9 Rework the re-resolution after enter traces machinery with cleaner
separations and neater interfaces.
2013-08-28 18:05:07 +00:00
dgp 24cec35f7b Clarfy and prettify influence of flag settings and command lookups. 2013-08-28 02:44:50 +00:00
dgp 367ade79ed Tidy up indenting for clarity in refactoring. 2013-08-27 20:25:15 +00:00
dgp e6af5d333b Exceptions raised from enter traces take priority over re-resolution games. 2013-08-27 20:06:08 +00:00
dgp 24be1383da Inline TEOV_RunEnterTraces() so its interface can be redesigned. 2013-08-27 20:03:57 +00:00
dgp 28384139ba Add test for Bug 2486550. 2013-08-27 18:11:53 +00:00
dgp e5b2f21fe9 merge trunk 2013-08-26 18:32:55 +00:00
dkf ccbbb5d288 Unbreak doc; the apropos index entry *must* be one line.
(This is an external constraint forced by the requirement to fit into the standard Unix manual system.)
2013-08-24 09:42:43 +00:00
dgp 2d27ea7088 merge trunk 2013-08-23 16:33:34 +00:00
dgp a33a94ec85 Make sure all Tcl_NR*Eval*() routines do a schedule only. No errors raised. 2013-08-23 16:23:47 +00:00
mig f36f801d24 fix NRE docs 2013-08-23 13:08:15 +00:00
dgp 841e525556 merge trunk 2013-08-23 12:04:12 +00:00
dgp 55b0c17067 Remove complications that no longer server any required purpose. 2013-08-23 05:59:48 +00:00
dgp 993b39c491 merge trunk 2013-08-22 20:41:02 +00:00
dgp 272b2008ad compiler warning 2013-08-22 20:34:30 +00:00
dgp f7cf1b2bae Make Dispatch() the single point for calling a Tcl_ObjCmdProc, and attach
the DTRACE machinery there (one place, not two).
2013-08-22 20:21:15 +00:00
dgp 8173bccfd9 Remove assertion that is not true in some circumstances (--enable-dtrace). 2013-08-22 16:13:29 +00:00
dgp a5b75dfa9a More coroutine tests. 2013-08-22 13:01:31 +00:00
dkf 52b97dd00b Correction to documentation 2013-08-22 08:07:33 +00:00
dgp 987eb68977 merge trunk 2013-08-22 01:13:13 +00:00
dgp f632850eb8 [8ff0cb9fe1] Make Tcl_NREvalObj() (and friends) behave as documented, by
only scheduling evaluation and not doing any of it until the caller routine
returns.  This fixes some serious errors in [coroutine] too.
2013-08-21 19:30:01 +00:00
dgp ed72e77b7d Tidy the code and add a test. 2013-08-21 19:18:28 +00:00
dgp 83d427e824 Don't allocate memory until you know you're going to use it and arrange for
it to be freed.  Leak!
2013-08-21 19:00:17 +00:00
dgp f18c1126d5 Don't use automatic storage to hold the invocation words of oo::define.
That practice doesn't agree with NRE execution.
2013-08-21 18:27:23 +00:00
dgp 62e1b3723e merge trunk 2013-08-21 13:34:19 +00:00
dkf 4d6aaa2e8b [3612422]: Refer to correct part of tclvars(n) rather than page itself. 2013-08-21 10:25:18 +00:00
dkf 6b6685b8fd define tests for this bug; no fix yet 2013-08-21 09:35:50 +00:00
dgp 4bf79aef9b Push out a trial patch for more eyes to see. 2013-08-20 14:00:05 +00:00
dgp 066a4b7b35 Revise execution trace handling to take account of the new reality in
Tcl 8.6 that callers can pre-resolve a cmdPtr for us.  In that case
a re-resolution in the form of another command name lookup isn't the right
thing.
2013-08-19 16:34:10 +00:00
dgp a6f2dee7fb Testing doing away with the NRRunObjProc routine, which looks like a
useless extra bounce on the NRE trampoline.

Normal testing has no problem with it, but debug-enabled testing
triggers an assert failure.

Either it would be good to have a normal test that fails in the conditions
of the assert failure, or it would be good to discover the assert is
asserting something not actually required, and then make the purge.
2013-08-19 15:22:15 +00:00
dgp a7e397556b merge trunk 2013-08-15 20:00:34 +00:00
dgp c084f0ea75 Make sure the errors raised by execution traces become errors raised by the
traced command, as documented. Deletion of the traced command was supressing
that.
2013-08-15 19:59:32 +00:00
dgp 5cdaf0e05b Make sure the errors raised by execution traces become errors raised by
the traced command, as documented.  Deletion of the traced command was
supressing that.
2013-08-15 19:55:26 +00:00
dgp 200e0742b8 merge trunk 2013-08-15 17:43:39 +00:00
dgp fe60431f53 The fix for [3610404] leads to a simplification in the implementation of
forward methods.
2013-08-15 14:05:02 +00:00
dgp 160ba1cb95 merge trunk 2013-08-14 20:31:16 +00:00
dgp 058f0df44d Add several tests to check consistency of stack traces. 2013-08-14 20:20:11 +00:00
dgp ff926f2b01 merge trunk 2013-08-14 19:07:01 +00:00
dgp bee5c35f44 [3610404] Re-resolution of command after enter traces invalidate epoch.
Make sure context is such that correct resolution happens.
2013-08-14 19:01:38 +00:00
dgp 8971b5cdea merge trunk 2013-08-14 18:44:51 +00:00
dgp b2e3f2fa04 merge trunk 2013-08-14 18:00:45 +00:00
dgp 0c1e275cdf [a16752c252] Correct failure to call cmd deletion callbacks. 2013-08-14 17:07:00 +00:00
dgp a2400fbe30 [a16752c252] Correct failure to call cmd deletion callbacks. 2013-08-14 17:02:41 +00:00
dgp 211f7d6466 Arrange for both execution traces and [info frame] to get their pre-subst
source strings from a common routine.
2013-08-14 12:43:22 +00:00
dgp 6dee5b3e07 Consolidate some helper routines. 2013-08-14 12:15:59 +00:00
dgp 9d1f38c3e3 Only schedule leave traces if enter traces complete successfully.
This avoids a memleak, and opens a data slot, so we can pass objc, objv
without the need to copy them into a list value.
2013-08-14 04:13:21 +00:00
dgp 33647e79c8 Use a new flag value TCL_EVAL_SOURCE_IN_FRAME passed in by callers to
determine whether the pre-subst source information in a CmdFrame is to
be used.  This takes the place of numLevels cross checking, so that field
is removed.  Routines are consolidated as well.
2013-08-12 20:00:14 +00:00
dgp f440a6ef41 merge trunk 2013-08-12 15:52:28 +00:00
jan.nijtmans c086de021c Never guess non-existing timezone name "America/Brasilia" on Windows. Reported by Arnulf Wiedemann 2013-08-11 14:42:24 +00:00
jan.nijtmans 97eb71a629 Never guess non-existing timezone name "America/Brasilia" on Windows. Reported by Arnulf Wiedemann 2013-08-11 14:41:10 +00:00
dgp e62b40c808 Arrange for both execution traces and [info frame] to get their pre-subst
source strings from a common routine, with care taken to reduce copying
by that routine.
2013-08-10 05:16:38 +00:00
dgp 234fb04984 Revised GetCommandSource() can (and thus should) return a normal zero
refcount value.
2013-08-09 16:48:30 +00:00
dgp 1b7d424507 Revise GetCommandSource() to return a normal Tcl_Obj value. 2013-08-07 20:27:30 +00:00
dgp 5797625e42 Give (objc, objv) their own ride from enter to leave traces. 2013-08-07 19:45:13 +00:00
dgp 987422a01f Many simplifications to the TIP 280 machinery.
* Removed support for non-NULL invoker when TCL_EVAL_DIRECT requested.
   * Eliminated TCL_EVAL_CTX eval flag.
   * Removed Tcl_Preserve-ability of ContLineLoc pointers.
   * Removed clLoc field of CompileEnv struct.
2013-08-07 17:11:21 +00:00
dgp 5f6b71f3f2 Remove Tcl_Preserve support for ContLineLoc values. It's not needed.
This allows the clLoc field of CompileEnv struct to go away too.
2013-08-07 16:44:03 +00:00
dgp f6f0891fff Test for TclContinuationsGet() usage, and simplifications. 2013-08-07 16:01:53 +00:00
dgp 27c5ada57e Replace potentially memleak creating safety check of a "cannot happen"
condition with an assertion.
2013-08-07 14:41:46 +00:00
dgp 5f2f5b63c3 Add comment stating new limitation on Tcl(NR)EvalObjEx() interface. 2013-08-07 12:44:42 +00:00
dgp 59f7320bdd All use of the evalFlag value TCL_EVAL_CTX is unused by the code and
unreachable by extensions.  This checkin removes all the code supporting
that flag value.

The consequence is that all the calls to TclNREvalObjEx() and its callers
that are currently choosing not to pass the TCL_EVAL_DIRECT flag in when
they pass in a non-NULL invoker will no longer be free to change their
mind.  That might be reason not to adopt this change.
2013-08-06 17:24:40 +00:00
dgp 00546e5e21 The value TCL_LOCATION_EVAL_LIST in the type field of a CmdFrame appears to
exist only for the sake of taking great pains to make sure that pure list
values remain pure list values.

The value of pure list values is no longer what it once was. For a long long
time now, any canonical list values have been equally good.
2013-08-06 16:41:41 +00:00
dgp a63563bd9a Add assertions that will guide and protect more discovery of dead code for elimination. 2013-08-06 16:20:59 +00:00
dgp 1d99884b08 Drop TCL_LOCATION_EVAL_LIST now that it is unused. 2013-08-06 13:30:36 +00:00
dgp 8bd533d76e Eliminate the union that is no longer needed. 2013-08-06 13:20:36 +00:00
dgp 23d61a10c2 Revert the changes that went too far and broke things. 2013-08-06 13:08:54 +00:00
dgp 0ee8df700b The value TCL_LOCATION_EVAL_LIST in the type field of a CmdFrame appears to
exist only for the sake of taking great pains to make sure that pure list
values remain pure list values.

The value of pure list values is no longer what it once was.  For a long long
time now, any canonical list values have been equally good.  This branch
is Work In Progress eliminating the complication of the additional type value.

Currently some minor botches are breaking execution tracing tests.
2013-08-06 04:15:16 +00:00
jan.nijtmans 50a950f2b1 Mark unixforkevent-1.1 nonPortable, until proven on more platforms.
Make sure that when testing for pthread_atfork the thread library is taken into account.
2013-08-05 22:00:58 +00:00
jan.nijtmans c74640849e Mark unixforkevent-1.1 nonPortable, until proven on more platforms. 2013-08-05 21:58:21 +00:00
dkf 861b34625c [3611643fff]: Support TclOO in autoload mechanism. 2013-08-03 15:27:40 +00:00
dkf 0958b92b37 Deal with the elaborate rip-apart-a-metaclass case as well. 2013-08-02 20:19:44 +00:00
dkf 6d9ae4aa16 [9d61624b3d]: Stop crashes when emptying the superclass slot. 2013-08-02 14:58:58 +00:00
dgp 965128fe34 [1905562] [8d2c0da36d] Raise the recursion limits on regexps to allow
existing regexps "in the wild" to continue working with Tcl 8.6.
Latest example comes from DejaGnu.
2013-08-01 19:18:02 +00:00
jan.nijtmans ebc5b27c8c Tcl_InitNotifier: Bug [a0bc856dcd]. Start notifier thread again if we were forked, to solve Rivet bug 55153 2013-08-01 12:54:16 +00:00
jan.nijtmans 3916ce9d4c Tcl_InitNotifier: Bug [a0bc856dcd].
Start notifier thread again if we were forked, to solve Rivet bug 55153
2013-08-01 12:38:04 +00:00
jan.nijtmans 4bd227bc12 Make sure that "string is space \u202f" will continue to return "1", even if in future Unicode this character (NARROW_NO_BREAK_SPACE) will cease to be a space. See: [http://www.unicode.org/review/pri249/].
Don't hardcode "tclWinError.o" for Cygwin
2013-07-29 10:12:12 +00:00
jan.nijtmans 84e92af6dc Make sure that "string is space \u202f" will continue to return "1", even if in future Unicode this character (NARROW_NO_BREAK_SPACE) will cease to be a space. See: [http://www.unicode.org/review/pri249/] 2013-07-29 09:29:16 +00:00
dgp 15ca940ca7 Simplify AuxData access with a macro. 2013-07-27 20:29:42 +00:00
dgp 525bc7c9b5 [6585b21ca8] [regexp {(\w).*?\1} abb] failed to match. Thanks to Tom Lane for passing on the discovery in Postgres. 2013-07-26 13:24:19 +00:00
dgp 6adf3b8c6c [6585b21ca8] [regexp {(\w).*?\1} abb] failed to match.
Thanks to Tom Lane for passing on the discovery in Postgres.
2013-07-26 13:21:30 +00:00
jan.nijtmans 3d14dd6bc9 Move test for pthread_atfork inside SC_ENABLE_THREADS 2013-07-26 09:20:28 +00:00
oehhar 41afeeec2b Fixed test case variable clash with 'folder' 2013-07-25 17:20:02 +00:00
jan.nijtmans 623c1cbe5b rebase 2013-07-25 14:25:47 +00:00
jan.nijtmans 60ef39d24a Move test for pthread_atfork inside SC_ENABLE_THREADS 2013-07-25 14:24:39 +00:00
jan.nijtmans 889454ec06 Make sure that the notifierMutex and notifierCV in a forked child cannot block anything, even though the initialization of the Notifier Thread in the parent is not finished yet. 2013-07-25 08:29:56 +00:00
jan.nijtmans 752ab085d6 rebase 2013-07-25 07:02:59 +00:00
jan.nijtmans c019848148 Put Cygwin's tclWinError.o in PLAT_OBJS, not in DL_OBJS 2013-07-25 06:59:08 +00:00
dgp fd1c7c2fb3 Demonstrate and fix memory leak in Tcl_ParseVar(). 2013-07-24 16:56:59 +00:00
dgp 8f2d19b951 Demonstrate and fix memory leak in Tcl_ParseVar(). 2013-07-24 16:51:04 +00:00
dgp f2bea640bb Mark commands with potential to compile expansion arguments (as [list] does). 2013-07-24 13:58:35 +00:00
dgp d818803502 more disabled code removal 2013-07-24 12:13:01 +00:00
dgp e0437fdf58 Remove outdated, disabled code. 2013-07-23 20:11:00 +00:00
dgp 8163234efd Remove outdated comment. Stack depths are well checked now. 2013-07-23 18:03:39 +00:00
dgp f796ad762c Stop checking stack depth in [catch] compiler.
Stack depth is checked in compiles of *all* Tcl commands/scripts/bodies
in debug builds already.
2013-07-23 18:01:36 +00:00
jan.nijtmans 0185dd6477 rebase 2013-07-23 09:54:05 +00:00
jan.nijtmans 07d10b8a58 Add "testfork" test command. Not used in any test-case yet 2013-07-23 09:27:59 +00:00
jan.nijtmans bc28cd1ac8 Add "testfork" test command. Not used in any test-case yet 2013-07-23 09:07:21 +00:00
jan.nijtmans 9350513d16 Tcl_InitNotifier() call in TestforkObjCmd() is only necessary when pthread_atfork() is not available. 2013-07-22 11:11:10 +00:00
jan.nijtmans 4fb5d04b2f Use pthread_atfork() when available. 2013-07-22 10:57:44 +00:00
jan.nijtmans f287d8cb0f Test-case should pass on Darwin or with non-threaded build as well. 2013-07-22 10:11:05 +00:00
jan.nijtmans 0c2e553e8f Fix bug which hangs iocmd.tf-32.1 2013-07-22 10:10:00 +00:00
oehhar 915c6abe66 Test file tests/unixForkEvent.test added 2013-07-22 08:45:37 +00:00
jan.nijtmans 0070244914 Rebase to core-8-5-branch
Add "testfork" test command to be usable in testcase.
2013-07-21 14:52:57 +00:00
dgp 17ebc3cd20 Rewrite of the TclCompileScript() routine.
Primarily this breaks that large, rather convoluted routine into many
smaller more single-purpose routines for greater clarity.  This also
permits more sharing of function components.  Ensemble compiles now share
the same low level routines as top-level command compiles.  This refactoring
should also have the benefit of easing merging between branches by better
locating patches according to what function or data structure they tweak.

Also in this checkin:
    Minimized calls to Tcl_ResetResult() during compile.
    Several commands compile their detected syntax errors into
	bytecode that reports the syntax error.
    Significant reform to the TIP 280 machinery, including elimination
	of the litInfo hash table.  Its function of finding the index
	of a compiled command in a script from a pc value has been redone
	using the codeDelta information already stored in ByteCode.
2013-07-18 20:27:01 +00:00
dgp 5e9e003379 [assemble] compile syntax error into bytecode reporting syntax error message. 2013-07-18 18:25:24 +00:00
dgp 2aed1acbd1 merge trunk 2013-07-18 15:42:54 +00:00
dgp 81a1a91361 [Bug 1c17fbba5d] Fix -errorinfo from syntax errors so that the error is
not obscured.  Instead highlight it by making it the last character quoted.
2013-07-18 15:05:18 +00:00
oehhar 9a19e4cba0 Start notifier thread again if we were forked, to solve Rivet bug 55153 - RFE [a0bc856dcd] 2013-07-17 16:02:36 +00:00
dgp c2d6c48dd9 Factor out the call to a compileProc into one place used by both ensemble
subcommand compiles and toplevel command compiles in TclCompileScript.
2013-07-17 13:57:23 +00:00
dgp d383707870 Streamline the housekeeping on the operands of INST_START_CMD.
For example, do only incr on success, not incr on attempt + decr on error.
2013-07-16 20:48:37 +00:00
dgp c33f97005c Simplify the ensemble subcommand compile. There's no need to be
crafting synthetic Tcl_Parse and copying tokens.  Some pointer shifts will do.
2013-07-16 17:21:12 +00:00
dgp 3f126895fb Simplify arguments to TclContinuationsEnterDerived(). 2013-07-16 14:52:33 +00:00
dgp d848f30c45 Eliminate the litInfo table and all the code tending to its care and feeding.
The pc -> command index mapping function it provided can be achieved using
other data already in the ByteCode struct.
2013-07-16 14:07:41 +00:00
dgp d860a2c3a4 Build CompileBasicNArgCommand on top of TclCompileInvocation. 2013-07-15 20:16:11 +00:00
dgp 009f2adf3d merge trunk 2013-07-15 19:40:33 +00:00
dgp 5684ad8d94 Possible improvement in light of [86ceb4e2b6]. 2013-07-15 19:09:59 +00:00
dgp 774c402365 Prefer CompileWord() over CompileTokens() when possible. 2013-07-15 17:07:51 +00:00
dgp 740d1811bc Global replace: CompileBody() -> BODY(). 2013-07-12 18:44:15 +00:00
dgp 451ab6927c Tests demonstrating the need for the last two SetLineInformation() calls. 2013-07-12 16:25:51 +00:00
dgp f302557ad5 Revise the CompileWord() and PushVarNameWord() macros to make explicit the
SetLineInformation() that's in each of them.
2013-07-11 23:19:14 +00:00
dgp d061b31460 Have TclMakeEnsemble() set ENSEMBLE_COMPILE at creation, not as a separate
epoch-bumping step.
2013-07-11 17:06:35 +00:00
dgp 783aea7d3a merge trunk 2013-07-11 04:12:01 +00:00
dgp 34c17bad36 Add a test for each call to SetLineInformation() demonstrating the need
for it to be there.  Fixed bugs revealed by the new tests.

What's still missing are more tests demonstrating the need for other
SetLineInformation() calls that are not there yet. ;)
2013-07-11 04:07:39 +00:00
dgp f0992177e4 Revert the revised macros used in developing the new tests. 2013-07-11 04:00:57 +00:00
dgp 6f4f296706 Add tests for the SetLineInformation() calls in tclEnsemble.c, and fix
the bugs around those calls exposed by the tests.
2013-07-11 03:48:40 +00:00
dgp 75bc23d59c Add tests for SetLineInformation() calls in tclCompCmdsSZ.c as well as some
obvious refactoring improvements.
2013-07-10 20:33:45 +00:00
dgp 9d91a3db0b Add tests for SetLineInformation() calls in tclCompCmdsGR.c. 2013-07-10 19:43:56 +00:00
dgp 1dc19d8370 Add tests for, and fix bugs in, the SetLineInformation() calls in tclCompCmds.c. 2013-07-10 19:34:55 +00:00
dgp 458197828b merge trunk 2013-07-10 18:02:20 +00:00
dgp c079ab076f Fix for [86fb5ea28e]. Test will eventually merge in from tip280-test-coverage. 2013-07-10 17:58:45 +00:00
dgp d69c39d52e Next attempt. Appears to have uncovered a bug. 2013-07-10 16:43:01 +00:00
dgp 7a53c36e3a First additional test. Remove dup macros in tclEnsemble.c. 2013-07-10 16:27:09 +00:00
dgp ee74db1cbf Disabling the SetLineInformation() macro entirely causes only 3 tests
in the test suite to fail.  Restoring just 2 SetLineInformation() calls
fixes those failures.  The need for all the other SLI() calls is not
demonstrated by any test.  Without more complete test coverage, it is
difficult to confidently tweak the TIP 280 implementation without fear
that changes are introducing breakage.
2013-07-10 16:17:12 +00:00
dgp 1e62f5ac76 Remove the (now unused) wlineat arguments. 2013-07-10 03:28:37 +00:00
dgp afad6ffbb4 Revise the litInfo table so that it gets built later (in TclInitByteCodeObj)
from a simpler store of data that can unwind.
2013-07-10 03:17:57 +00:00
dgp d72d5f8b7a Tentative Work In Progress unwinding TIP 280 line information. 2013-07-09 20:37:37 +00:00
dgp c46c774126 Use the TokenAfter() macro. 2013-07-08 23:02:44 +00:00
dgp ba3bf9b61f Use TIP 280 macros. 2013-07-08 22:36:55 +00:00
dgp 82bddf4dca merge trunk 2013-07-08 19:54:50 +00:00
dgp e10479f3d7 Factor out compiling the Command literal. 2013-07-08 19:29:01 +00:00
jan.nijtmans 7183692271 Unbreak MSVC6 debug build (thanks Andreas Kupries!) 2013-07-08 18:56:13 +00:00
jan.nijtmans b7fbf3c433 Unbreak MSVC6 debug build (thanks Andreas Kupries!) 2013-07-08 18:55:23 +00:00
dgp c10c796a46 Plug memory leak; Break three compilation mechanisms into routines. 2013-07-08 18:08:01 +00:00
dgp 582824087d Move TIP 280 and command extent housekeeping to the periphery. 2013-07-08 15:39:55 +00:00
dgp da4296c06f Defer expansion request detection as much as possible. 2013-07-08 15:24:56 +00:00
dgp 0dec640514 Consolidate the StartExpanding() calls. 2013-07-08 15:00:02 +00:00
dgp d2b490f552 The routines StartExpanding() and EnterCmdWordData() are orthogonal, so it's
ok to reverse the order in which they are called.
2013-07-08 14:31:14 +00:00
dgp 4cfafc3002 merge trunk 2013-07-08 12:55:06 +00:00
jan.nijtmans fb3fc7d5d3 Build stub objects with -DSTATIC_BUILD on all platforms. Only important on win32 (already done) and cygwin, on other platforms it should not have any effect. 2013-07-08 06:51:16 +00:00
jan.nijtmans de31df63e7 Build stub objects with -DSTATIC_BUILD on all platforms. Only important on win32 (already done) and cygwin, on other platforms it should not have any effect. 2013-07-08 06:49:44 +00:00
jan.nijtmans a7bebaafdb merge-mark 2013-07-07 09:15:37 +00:00
stwo bd6afa9af5 OpenBSD/m88k is now elf. Remove unneeded elf check. 2013-07-07 02:19:20 +00:00
stwo c8629fcad6 OpenBSD/m88k is now elf. Remove unneeded elf check. 2013-07-07 02:11:57 +00:00
Kevin B Kenny b52ba9ae90 Merge mark 2013-07-06 22:29:36 +00:00
Kevin B Kenny a6fe3119b2 http://www.iana.org/time-zones/repository/releases/tzdata2013d.tar.gz 2013-07-06 22:24:52 +00:00
Kevin B Kenny 28bc2e5adf http://www.iana.org/time-zones/repository/releases/tzdata2013d.tar.gz 2013-07-06 22:22:01 +00:00
dgp 191c6d2137 merge trunk 2013-07-05 19:56:12 +00:00
dgp 7eab500306 merge trunk 2013-07-05 19:54:56 +00:00
jan.nijtmans 421cc90918 Use X11/Xlib.h for checking where X11 can be found in stead of X11/XIntrinsic.h. Suggested by Pietro Cerutti.
(backported from tclconfig)
2013-07-05 14:56:24 +00:00
jan.nijtmans e26d6e29c1 Use X11/Xlib.h for checking where X11 can be found in stead of X11/XIntrinsic.h. Suggested by Pietro Cerutti.
(Backported from tclconfig)
2013-07-05 14:52:07 +00:00
jan.nijtmans 57f4decd9b CONST -> const in one place 2013-07-05 14:04:03 +00:00
jan.nijtmans e0373f12ec Allow successfull compilation, even if Tcl_GetErrorLine/Tcl_SetErrorLine are redefined as macros. 2013-07-05 14:02:59 +00:00
jan.nijtmans fa8b071f04 Bug [817249]: bring tclXtNotify.c up to date with Tcl_SetNotifier() change 2013-07-03 10:43:49 +00:00
jan.nijtmans 6f68b762d3 Bug [817249]: bring tclXtNotify.c up to date with Tcl_SetNotifier() change 2013-07-03 10:39:50 +00:00
jan.nijtmans ade4e6d9bb Fix compiler warning when compiling Itcl 4.0:
In file included from ./generic/itcl2TclOO.c:12:0:
/Tcl/include/tclInt.h:3012:8: warning: ‘struct addrinfo’ declared inside parameter list [enabled by default]
        const char **errorMsgPtr);
        ^
2013-07-03 08:59:09 +00:00
jan.nijtmans a6b67f2ef2 Fix compiler warning when compiling Cygwin port with -Wwrite-strings 2013-07-03 08:56:34 +00:00
dgp 88731d9d93 comment improvements 2013-07-02 10:36:32 +00:00
jan.nijtmans 73faa3bbb6 Bug [32afa6e256]: dirent64 check is incorrect in tcl.m4. Thanks to Brian Griffin. 2013-07-02 07:17:19 +00:00
jan.nijtmans 89b2fc0982 Don't forget ChangeLog for previous commit 2013-07-02 07:16:22 +00:00
jan.nijtmans 7d8dff7c72 Bug [32afa6e256]: dirent64 check is incorrect in tcl.m4. Thanks to Brian Griffin. 2013-07-02 07:14:59 +00:00
dgp aec5846c12 More Work In Progress. 2013-07-01 20:58:15 +00:00
dgp 05fb0c0810 More elimination of error message litter to fix [Bug 20a81392ec]. 2013-06-28 02:58:15 +00:00
dgp a47b03577b Stop the compileProc routines leaving behind error messages in interp.
(Nicer way to solve [Bug 20a81392ec].)  Make simplifications in 
TclCompileScript() make possible by the new structure.  Still a work
in progress.
2013-06-27 20:10:41 +00:00
dgp fda71d6d4c merge trunk 2013-06-27 13:12:09 +00:00
dgp 7070acfea1 plug memory leaks 2013-06-27 13:11:53 +00:00
jan.nijtmans eec0dcb530 Fix [34538ba43f] 2013-06-27 12:35:47 +00:00
jan.nijtmans c0f408b9cd Fix [34538ba43f] 2013-06-27 12:34:49 +00:00
dgp ddd130e532 merge trunk 2013-06-27 12:05:00 +00:00
jan.nijtmans e592a6c9d5 Bug [9b2e636361]: Tcl_CreateInterp() needs initialized encodings. 2013-06-27 08:51:40 +00:00
jan.nijtmans 5ea3e8b570 Bug [9b2e636361]: Tcl_CreateInterp() needs initialized encodings. 2013-06-27 08:28:42 +00:00
dgp 324ca57f3d merge trunk 2013-06-26 20:20:23 +00:00
dgp a9f49cd781 Stop buffer overrun into undefined values detected by valgrind. 2013-06-26 20:13:57 +00:00
dgp b3fea91162 Correct typo detected by valgrind. 2013-06-26 17:26:16 +00:00
dgp ae7b32a706 Fix bytecode ranges in the cmdMapPtr. still leaky. 2013-06-26 16:06:44 +00:00
jan.nijtmans eaf387ef13 typos.
On Cygwin, Tcl_SetPanicProc(NULL) should set back the panic proc to its default, which is not NULL.
2013-06-26 14:24:20 +00:00
jan.nijtmans 78b0a4a13c formatting, typo 2013-06-26 14:20:26 +00:00
jan.nijtmans f7fd65de47 Allocate encoding name, so caller of Tcl_RegisterConfig() doesn't need to keep it forever.
Fix some comments.
2013-06-26 08:10:36 +00:00
jan.nijtmans d751f58f9d Proposed solution for [9b2e636361] 2013-06-26 07:42:53 +00:00
dgp 5eecd400b7 A few bug fixes from failing tests; still leaky. 2013-06-26 03:46:54 +00:00
dgp 3f19b90244 merge trunk 2013-06-25 20:22:59 +00:00
dgp 11f1a88c12 Nearly functional now, but leaky and not yet as tidy as I'm hoping for. 2013-06-25 20:22:31 +00:00
dgp c012287fc8 Replace always true test with assertion. 2013-06-25 19:23:24 +00:00
dgp 9fd3e86565 merge trunk 2013-06-25 15:01:31 +00:00
dgp adb4b18477 Make more use of the CompileTokens() macro. 2013-06-25 15:01:03 +00:00
dgp dc4782f595 Branch for rewriting TclCompileScript() and related routines, with the
intent to generally simplify and make more readable, as well as find and
eliminate duplication with ensemble machinery and improve mergeability
to other branches.  Work in Progress.  Doesn't work at all right now.
2013-06-25 14:19:39 +00:00
jan.nijtmans 708da35f79 Don't use deprecated Tcl_DStringTrunc any more 2013-06-25 12:06:07 +00:00
jan.nijtmans 07bfe18a21 Don't use deprecated Tcl_DStringTrunc any more. 2013-06-25 12:02:56 +00:00
jan.nijtmans 9497794406 Remove TclInitStubTable() function (but keep it in the "initsubsystems" branch). 2013-06-25 10:02:14 +00:00
jan.nijtmans 8d8c38c7c7 Don't use TclpInetNtoa any more, use inet_ntoa in stead. Since IP6 support it's even not necessary any more (except for fake-rfc2553, but mutexes are used here already) , but it's in the internal stub table so we cannot remove it until 9.0 2013-06-21 11:57:59 +00:00
jan.nijtmans dcb4da22fa Modify internal TclStubInfoType type: use TclStubs * in stead of ClientData, so less type casts are needed in the code.
Disadvantage: somewhat more code duplication, but it makes the code much more understandable.
2013-06-21 11:53:11 +00:00
dgp 130c6dd203 TclCompileScript() should not overwrite envPtr->numSrcBytes.
The envPtr already has the right value stored in it.
2013-06-20 14:20:59 +00:00
dgp bbca4ec51b TclCompileScript() should not overwrite envPtr->numSrcBytes.
The envPtr already has the right value stored in it.
2013-06-20 14:17:05 +00:00
dkf 4a6f1d02be Fixed bug with optimizing with INST_START_CMD about. 2013-06-19 22:44:42 +00:00
dgp 202a7c4db1 More use of simplifying macros.
Replace dynamic allocation with automatic storage on the call stack.
2013-06-19 19:33:21 +00:00
jan.nijtmans 4d9fc81c0f Eliminate a lot of dead code (for Windows 95/98/ME only).
Eliminate all usage of TclWinSetInterfaces(), which does exactly the same as TclpSetInterfaces(), but keep exported symbol and stub entry.
2013-06-19 12:53:53 +00:00
jan.nijtmans cdd8467ca9 Fix [3611974]: InitSubsystems multiple thread issue 2013-06-18 10:36:06 +00:00
jan.nijtmans 099345d98c Fix [3611974]: InitSubsystems multiple thread issue 2013-06-18 10:33:33 +00:00
jan.nijtmans 76df95e6e4 Fix uniClass tool which was the real cause for [a876646efe], and add test-case for it. 2013-06-18 07:50:19 +00:00
jan.nijtmans 7243b34d80 Fix uniClass tool which was the real cause for [a876646efe], and add test-case for it. 2013-06-18 07:43:59 +00:00
jan.nijtmans 6a445a3fe6 Better place to put vsnprintf switch, so it is usable by all *.c files.
Fix comment on _ANSI_ARGS_ which is no longer true since 8.6.
2013-06-18 07:00:04 +00:00
dgp d6ca452640 Updates to redirect bug reports to the new tracker location. 2013-06-17 17:05:07 +00:00
jan.nijtmans 7b9871647a Fix [42b8083613] 2013-06-17 17:03:49 +00:00
dgp 5f13065a33 Updates to redirect bug reports to the new tracker location. 2013-06-17 17:03:18 +00:00
jan.nijtmans e80db5fa35 Use more portable TclIsSpaceProc() in stead of isspace(). 2013-06-17 13:29:39 +00:00
jan.nijtmans 3215339ef0 Use more portable TclIsSpaceProc() in stead of isspace().
Make sure that "string is space \u180e" continues to return 1 for whatever unicode version.
2013-06-17 13:23:29 +00:00
jan.nijtmans b7289f092d Fix [a876646efe]: re_expr character class [:cntrl:] should contain \u0000 - \u001f 2013-06-17 04:54:35 +00:00
jan.nijtmans ded13430f9 Fix [a876646efe]: re_expr character class [:cntrl:] should contain \u0000 - \u001f 2013-06-17 04:52:01 +00:00
jan.nijtmans 6eb0e8555d On 32-bit platforms, 12 characters for version is enough, on 64-bit platforms it will be aligned to 16 characters anyway. 2013-06-17 04:41:57 +00:00
jan.nijtmans c05b753e95 link tclsh with stub library, just like xttest and tcltest, in order to allow additional static stub-enabled libraries to be linked with it. 2013-06-16 20:48:57 +00:00
jan.nijtmans f332c17690 split off TclInitStubTable() as separate function - which does the actual stub table initialization - previously part of Tcl_InitStubs(). 2013-06-16 20:32:50 +00:00
jan.nijtmans df6a99b1f7 Don't use deprecated stricmp/strnicmp any more, but underscored variant for non-GNU compilers.
Some formatting - improved comments.
2013-06-14 10:15:50 +00:00
jan.nijtmans 07096327dc Don't use deprecated stricmp/strnicmp any more, but underscored variant for non-GNU compilers. 2013-06-14 10:11:08 +00:00
jan.nijtmans a831b299f7 Fix env.test when running mingw-w64 (AMD64 build) test-suite on wine64.
Fix some gcc warnings which become visible with -Wextra
2013-06-13 07:23:08 +00:00
jan.nijtmans b6b9185fa8 Fix some gcc warnings which become visible with -Wextra 2013-06-13 07:13:09 +00:00
jan.nijtmans bd6f6a89c6 Fix env.test when running mingw-w64 (AMD64 build) test-suite on wine64 2013-06-12 19:36:49 +00:00
jan.nijtmans 169288808b Workaround for mingw-w64 (AMD64-only) bug: It appears that zdll.lib (as produced by Microsoft tools) doesn't import the zlib symbols correctly, so use "libz.dll.a" produced with mingw-w64 tools in stead. 2013-06-12 12:24:23 +00:00
jan.nijtmans 615ab1a0d4 Silence various warnings when doing a 64-bit build with MSVC: Those warnings can only _really_ be fixed in "novem" (so, don't silence them there).
Use vsnprintf (more portable) in stead of _vsnprintf, except on MSVC
2013-06-12 10:29:01 +00:00
jan.nijtmans c961880a26 Silence various warnings when doing a 64-bit build with MSVC: Those warnings can only _really_ be fixed in "novem" (so, don't silence them there) 2013-06-12 10:24:52 +00:00
dgp f118d91a3d Revise INST_EXPAND_STKTOP so that it no longer makes use of its operand.
All the information required to do a proper expansion of the exec stack
to support expanded command invocation is already present.  The operand
doesn't provide any essential information.  By ignoring it, we eliminate
the risk that the compiler might fill in the operand with a bad stack depth
estimate value.  INST_EXPAND_STKTOP doesn't need an operand, but in order
to support loading of existing bytecodes we cannot change it now.  There's
also no need to change what the compiler tries to place in the operand,
though changing it to always be zeros would be acceptable now.
2013-06-11 22:47:22 +00:00
dgp 3c473ee0c4 Select improvements in stack depth estimates brought over from mig-review.
Mostly these are just simplifications, removing code that wasn't needed.
Some changes make the stack depth estimate more accurate instruction by
instruction.
2013-06-11 20:38:00 +00:00
dgp 67264f1e10 Repairs to compile/exec debugging output. 2013-06-11 19:41:55 +00:00
dgp 9cccd5fd91 Stack housekeeping repair for last checkin. 2013-06-11 17:58:49 +00:00
dgp 470fc04dd0 [33b7abb8a2] [7174354ecb] Rewrite TclCompileThrowCmd(). 2013-06-11 16:44:34 +00:00
jan.nijtmans 46db2c3edd Improve compatibility detection for <time.h> and <sys/stat.h>:
- Move <time.h> before other includes on Windows, so we are sure the time_t definition being checked doesn't come from <sys/types.h>. 
- Padding at the end of Tcl_StatBuf doesn't influcence binary compatibility, so relax panic check accordingly.
2013-06-11 08:12:09 +00:00
jan.nijtmans 52ce2fdeb0 Improve compatibility detection for <time.h> and <sys/stat.h>:
- Move <time.h> before other includes on Windows, so we are sure the time_t definition being checked doesn't come from <sys/types.h>. 
- Padding at the end of Tcl_StatBuf doesn't influcence binary compatibility, so relax panic check accordingly.
2013-06-11 07:58:01 +00:00
dgp cc984c4e6e merge trunk 2013-04-16 17:34:32 +00:00
dgp 64bf3c8f4a More progress. NR-enable [interp] and [$slave], completely with
invokehidden subcommand.  Test suite passes with no errors.
2013-04-11 21:30:40 +00:00
dgp 064f7e5513 More revisions let multi-interp test case work, but at cost of panics
and segfaults.  Pushing the NRE-envelope.
2013-04-11 19:36:37 +00:00
dgp 6597872335 New internal routine TclNRInvoke() - NR-enabled path through the machinery
behind invokehidden commands.
2013-04-11 14:39:56 +00:00
dgp 5044035ec0 merge trunk 2013-04-11 13:35:41 +00:00
dkf b6b0d1b8dd added some test cases, based on bug report 2013-04-09 20:01:08 +00:00
dgp 1ddb66bfda Use the double-secret iPtr->lookupNsPtr field to get post-enter-trace
re-resolutions of commands done in the right context for oo forwards.
2013-04-09 19:04:04 +00:00
dgp 6b17a1e25a Revise TclNREvalObjv so that pre-resolution of the Command by a caller
does not force suppression of exception handling.  Let those be separable
demands.  Aim is to bring TclObjInvoke*() into the fold.
2013-04-08 18:11:33 +00:00
178 changed files with 5731 additions and 4374 deletions
+112 -6
View File
@@ -1,3 +1,109 @@
A NOTE ON THE CHANGELOG:
Starting in early 2011, Tcl source code has been under the management of
fossil, hosted at http://core.tcl.tk/tcl/ . Fossil presents a "Timeline"
view of changes made that is superior in every way to a hand edited log file.
Because of this, many Tcl developers are now out of the habit of maintaining
this log file. You may still find useful things in it, but the Timeline is
a better first place to look now.
============================================================================
2013-09-19 Don Porter <dgp@users.sourceforge.net>
*** 8.6.1 TAGGED FOR RELEASE ***
* generic/tcl.h: Bump version number to 8.6.1.
* library/init.tcl:
* unix/configure.in:
* win/configure.in:
* unix/tcl.spec:
* README:
* unix/configure: autoconf-2.59
* win/configure:
2013-09-19 Donal Fellows <dkf@users.sf.net>
* doc/next.n (METHOD SEARCH ORDER): Bug [3606943]: Corrected
description of method search order.
2013-09-18 Donal Fellows <dkf@users.sf.net>
Bump TclOO version to 1.0.1 for release.
2013-09-17 Donal Fellows <dkf@users.sf.net>
* generic/tclBinary.c (BinaryEncodeUu, BinaryDecodeUu): [Bug 2152292]:
Corrected implementation of the core of uuencode handling so that the
line length processing is correctly applied.
***POTENTIAL INCOMPATIBILITY***
Existing code that was using the old versions and working around the
limitations will now need to do far less. The -maxlen option now has
strict limits on the range of supported lengths; this is a limitation
of the format itself.
2013-09-09 Donal Fellows <dkf@users.sf.net>
* generic/tclOOMethod.c (CloneProcedureMethod): [Bug 3609693]: Strip
the internal representation of method bodies during cloning in order
to ensure that any bound references to instance variables are removed.
2013-09-01 Donal Fellows <dkf@users.sf.net>
* generic/tclBinary.c (BinaryDecodeHex): [Bug b98fa55285]: Ensure that
whitespace at the end of a string don't cause the decoder to drop the
last decoded byte.
2013-08-03 Donal Fellows <dkf@users.sf.net>
* library/auto.tcl: [Patch 3611643]: Allow TclOO classes to be found
by the autoloading mechanism.
2013-08-02 Donal Fellows <dkf@users.sf.net>
* generic/tclOODefineCmds.c (ClassSuperSet): Bug [9d61624b3d]: Stop
crashes when emptying the superclass slot, even when doing elaborate
things with metaclasses.
2013-08-01 Harald Oehlmann <oehhar@users.sf.net>
* tclUnixNotify.c (Tcl_InitNotifier): Bug [a0bc856dcd]: Start notifier
thread again if we were forked, to solve Rivet bug 55153.
2013-07-05 Kevin B. Kenny <kennykb@acm.org>
* library/tzdata/Africa/Casablanca:
* library/tzdata/America/Asuncion:
* library/tzdata/Antarctica/Macquarie:
* library/tzdata/Asia/Gaza:
* library/tzdata/Asia/Hebron:
* library/tzdata/Asia/Jerusalem:
http://www.iana.org/time-zones/repository/releases/tzdata2013d.tar.gz
2013-07-03 Jan Nijtmans <nijtmans@users.sf.net>
* unix/tclXtNotify.c: Bug [817249]: bring tclXtNotify.c up to date with
Tcl_SetNotifier() change.
2013-07-02 Jan Nijtmans <nijtmans@users.sf.net>
* unix/tcl.m4: Bug [32afa6e256]: dirent64 check is incorrect in tcl.m4
* unix/configure: (thanks to Brian Griffin)
2013-06-27 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tclConfig.c: Bug [9b2e636361]: Tcl_CreateInterp() needs
* generic/tclMain.c: initialized encodings.
2013-06-18 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tclEvent.c: Bug [3611974]: InitSubsystems multiple thread
issue.
2013-06-17 Jan Nijtmans <nijtmans@users.sf.net>
* generic/regc_locale.c: Bug [a876646efe]: re_expr character class
[:cntrl:] should contain \u0000 - \u001f
2013-06-09 Donal K. Fellows <dkf@users.sf.net>
* generic/tclCompCmdsSZ.c (TclCompileTryCmd): [Bug 779d38b996]:
@@ -103,10 +209,10 @@
* generic/tclStubInit.c: Add support for Cygwin64, which has a 64-bit
* generic/tclDecls.h: "long" type. Binary compatibility with win64
requires that all stub entries use 32-bit long's, therefore the
need for various wrapper functions/macros. For Tcl 9 a better
solution is needed, but that cannot be done without introducing
binary incompatibility.
requires that all stub entries use 32-bit long's, therefore the need
for various wrapper functions/macros. For Tcl 9 a better solution is
needed, but that cannot be done without introducing binary
incompatibility.
2013-04-30 Andreas Kupries <andreask@activestate.com>
@@ -124,8 +230,8 @@
* generic/tclDecls.h: Implement Tcl_NewBooleanObj, Tcl_DbNewBooleanObj
and Tcl_SetBooleanObj as macros using Tcl_NewIntObj, Tcl_DbNewLongObj
and Tcl_SetIntObj. Starting with Tcl 8.5, this is exactly the same,
it only eliminates code duplication.
and Tcl_SetIntObj. Starting with Tcl 8.5, this is exactly the same, it
only eliminates code duplication.
* generic/tclInt.h: Eliminate use of NO_WIDE_TYPE everywhere: It's
exactly the same as TCL_WIDE_INT_IS_LONG
+15 -16
View File
@@ -1,8 +1,7 @@
README: Tcl
This is the Tcl 8.6.0 source distribution.
http://tcl.sourceforge.net/
You can get any source release of Tcl from the file distributions
link at the above URL.
This is the Tcl 8.6.1 source distribution.
http://sourceforge.net/projects/tcl/files/Tcl/
You can get any source release of Tcl from the URL above.
Contents
--------
@@ -27,9 +26,14 @@ Tcl can also be used for a variety of web-related tasks and for creating
powerful command languages for applications.
Tcl is maintained, enhanced, and distributed freely by the Tcl community.
The home for Tcl/Tk releases and bug/patch database is on SourceForge:
Source code development and tracking of bug reports and feature requests
takes place at:
http://tcl.sourceforge.net/
http://core.tcl.tk/
Tcl/Tk release and mailing list services are hosted by SourceForge:
http://sourceforge.net/projects/tcl/
with the Tcl Developer Xchange hosted at:
@@ -49,7 +53,7 @@ The home page for this release, including new features, is
Detailed release notes can be found at the file distributions page
by clicking on the relevant version.
http://sourceforge.net/projects/tcl/files/
http://sourceforge.net/projects/tcl/files/Tcl/
Information about Tcl itself can be found at
http://www.tcl.tk/about/
@@ -146,18 +150,13 @@ and go to the Mailing Lists page.
------------------------
We are very interested in receiving bug reports, patches, and suggestions
for improvements. We prefer that you send this information to us via the
bug form at SourceForge, rather than emailing us directly. The bug
database is at:
for improvements. We prefer that you send this information to us as
tickets entered into our tracker at:
http://tcl.sourceforge.net/
The bug form was designed to give uniform structure to bug reports as
well as to solicit enough information to minimize followup questions.
http://core.tcl.tk/tcl/reportlist
We will log and follow-up on each bug, although we cannot promise a
specific turn-around time. Enhancements, reported via the Feature
Requests form at the same web site, may take longer and may not happen
specific turn-around time. Enhancements may take longer and may not happen
at all unless there is widespread support for them (we're trying to
slow the rate at which Tcl/Tk turns into a kitchen sink). It's very
difficult to make incompatible changes to Tcl/Tk at this point, due to
+138 -1
View File
@@ -8164,6 +8164,143 @@ Dropped support for OS X versions less than 10.4 (Tiger) (fellows)
--- Released 8.6.0, December 20, 2012 --- See ChangeLog for details ---
2013-05-08 (bug fix)[3036566] Honor language packs on Vista+ to get initial locale (oehlmann)
2012-12-22 (bug fix)[3598150] DString to Tcl_Obj memleak (afredd)
2012-12-27 (bug fix)[3598580] Tcl_ListObjReplace() refcount fix (nijtmans)
2013-01-04 (bug fix) memleak in [format] compiler (fellows)
2013-01-08 (bug fix)[3092089,3587096] [file normalize] on junction points
2013-01-09 (bug fix)[3599395] status line processing (nijtmans)
2013-01-23 (bug fix)[2911139] repair async connection management (fellows)
=> http 2.8.6
2013-01-26 (bug fix)[3601804] Darwin segfault platformCPUID (nijtmans)
2013-01-28 (enhancement) improve ensemble bytecode (fellows)
2013-01-30 (enhancement) selected script code improvements (fradin)
=> tcltest 2.3.6
2013-01-30 (bug fix)[3599098] update to handle glibc banner changes (kupries)
=> platform 1.0.11
2013-01-31 (bug fix)[3598282] make install DESTDIR support (cassoff)
2013-02-05 (bug fix)[3603434] [file normalize a:/] flaw in VFS (porter,griffin)
2013-02-09 (bug fix)[3603695] $obj varname resolution rules (venable,fellows)
2013-02-11 (bug fix)[3603553] zlib flushing errors (vampiera,fellows)
2013-02-14 (bug fix)[3604576] msgcat use of Windows registry (oehlmann,nijtmans)
=> msgcat 1.5.1
2013-02-19 (bug fix)[2438181] report errors in trace handlers (yorick)
2013-02-21 (bug fix)[3605447] unbreak [namespace export -clear] (porter)
2013-02-23 (bug fix)[3599194] fallback IPv6 routines (afredd,max)
2013-02-27 (bug fix)[3606139] stop crash in [regexp] (lane)
2013-03-03 (bug fix)[3606258] major serial port update (english)
2013-03-06 (bug fix)[3606683] [regexp (((((a)*)*)*)*)* {}] hangs
(grathwohl,lane,porter)
2013-03-12 (enhancement) better build support for Debian arch (shadura)
2013-03-19 (bug fix)[2893771] [file stat] on locked files (thoyts,nijtmans)
2013-03-21 (bug fix)[2102614] [auto_mkindex] ensemble support (griffin)
2013-03-27 Tcl_Zlib*() routines tolerate NULL interps (porter
2013-04-04 (bug fix) Support URLs with query but no path (max)
=> http 2.8.7
2013-04-08 (bug fix)[3610026] regexp crash on color overflow (linnakangas)
2013-04-29 (enhancement) [array set] compile improvement (fellows)
2013-04-30 (enhancement) broaden glibc version detection (kupries)
=> platform 1.0.12
2013-05-06 (platform support) Cygwin64 (nijtmans)
2013-05-15 (enhancement) Improved [list {*}...] compile (fellows)
2013-05-16 (platform support) mingw-4.0 (nijtmans)
2013-05-19 (platform support) FreeBSD updates (cerutti)
2013-05-20 (bug fix)[3613567] access error temp file creation (keene)
2013-05-20 (bug fix)[3613569] temp file open fail can crash [load] (keene)
2013-05-22 (bug fix)[3613609] [lsort -nocase] failed on non-ASCII (fellows)
2013-05-28 (bug fix)[3036566] Use language packs (Vista+) locale (oehlmann)
=> msgcat 1.5.2
2013-05-29 (bug fix)[3614102] [apply {{} {list [if 1]}}] stack woes (porter)
2013-06-03 Restored lost performance appending to long strings (elby,porter)
2013-06-05 (bug fix)[2835313] [while 1 {foo [continue]}] crash (fellows)
2013-06-17 (bug fix)[a876646] [:cntrl:] includes \x00 to \x1f (nijtmans)
2013-06-27 (bug fix)[983509] missing encodings for config values (nijtmans)
2013-06-27 (bug fix)[34538b] apply DST in 2099 (lang)
2013-07-02 (bug fix)[32afa6] corrected dirent64 check (griffin)
2013-07-06 tzdata updated to Olson's tzdata2013d (kenny)
2013-07-10 (bug fix)[86fb5e] [info frame] in compiled ensembles (porter)
2013-07-18 (bug fix)[1c17fb] revisd syntax errorinfo that shows error (porter)
2013-07-26 (bug fix)[6585b2] regexp {(\w).*?\1} abb (lane)
2013-07-29 [string is space \u202f] => 1 (nijtmans)
2013-08-01 [a0bc85] Limited support for fork with threads (for Rivet) (nijtmans)
2013-08-01 (bug fix)[1905562] RE recursion limit increased to support
reported usage of large expressions (porter)
2013-08-02 (bug fix)[9d6162] superclass slot empty crash (vdgoot,fellows)2013-08-02 (bug fix)[9d6162] superclass slot empty crash (vdgoot,fellows)
2013-08-03 (enhancement)[3611643] [auto_mkindex] support TclOO (fellows)
2013-08-14 (bug fix)[a16752] Missing command delete callbacks (porter)
2013-08-15 (bug fix)[3610404] reresolve traced forwards (porter)
2013-08-15 Errors from execution traces become errors of the command (porter)
2013-08-23 (bug fix)[8ff0cb9] Tcl_NR*Eval*() schedule only, as doc'd (porter)
2013-08-29 (bug fix)[2486550] enable [interp invokehidden {} yield] (porter)
2013-09-01 (bug fix)[b98fa55] [binary decode] fail on whitespace (reche,fellows)
2013-09-07 (bug fix)[86ceb4] have tm path favor first provider (neumann,porter)
2013-09-09 (bug fix)[3609693] copied object member variable confusion (fellows)
=> TclOO 1.0.1
2013-09-17 (bug fix)[2152292] [binary encode uuencode] corrected (fellows)
2013-09-19 (bug fix)[3487626] segfaults in [dict] compilers (porter)
2013-09-19 (bug fix)[31661d2] mem leak in [lreplace] (ade,porter)
Many optmizations, improvements, and tightened stack management in bytecode.
--- Released 8.6.1, Septemer 20, 2013 --- http://core.tcl.tk/tcl/ for details
Binary file not shown.
+6 -6
View File
@@ -176,16 +176,16 @@ these return options.
The \fB\-errorinfo\fR option holds a stack trace of the
operations that were in progress when an error occurred,
and is intended to be human-readable.
The \fB\-errorcode\fR option holds a list of items that
The \fB\-errorcode\fR option holds a Tcl list of items that
are intended to be machine-readable.
The first item in the \fB\-errorcode\fR value identifies the class of
error that occurred
(e.g. POSIX means an error occurred in a POSIX system call)
(e.g., POSIX means an error occurred in a POSIX system call)
and additional elements hold additional pieces
of information that depend on the class.
See the \fBtclvars\fR manual entry for details on the various
formats for the \fB\-errorcode\fR option used by
Tcl's built-in commands.
See the manual entry on the \fBerrorCode\fR variable for details on the
various formats for the \fB\-errorcode\fR option used by Tcl's built-in
commands.
.PP
The \fB\-errorinfo\fR option value is gradually built up as an
error unwinds through the nested operations.
@@ -307,6 +307,6 @@ so they continue to hold a record of information about the
most recent error seen in an interpreter.
.SH "SEE ALSO"
Tcl_DecrRefCount(3), Tcl_IncrRefCount(3), Tcl_Interp(3), Tcl_ResetResult(3),
Tcl_SetErrno(3), tclvars(n)
Tcl_SetErrno(3), errorCode(n), errorInfo(n)
.SH KEYWORDS
error, value, value result, stack, trace, variable
+1 -1
View File
@@ -111,7 +111,7 @@ function. Note that the Tcl_Obj reference returned by \fBTcl_GetObjectName\fR
is a shared reference.
.PP
Instances of classes are created using \fBTcl_NewObjectInstance\fR, which
takes creates an object from any class (and which is internally called by both
creates an object from any class (and which is internally called by both
the \fBcreate\fR and \fBnew\fR methods of the \fBoo::class\fR class). It takes
parameters that optionally give the name of the object and namespace to
create, and which describe the arguments to pass to the class's constructor
+4 -3
View File
@@ -41,8 +41,9 @@ may only be passed to Tcl routines called from the same thread as
the original \fBTcl_CreateInterp\fR call. It is not safe for multiple
threads to pass the same token to Tcl's routines.
The new interpreter is initialized with the built-in Tcl commands
and with the variables documented in the \fBtclvars\fR manual page. To bind in
additional commands, call \fBTcl_CreateCommand\fR.
and with standard variables like \fBtcl_platform\fR and \fBenv\fR. To
bind in additional commands, call \fBTcl_CreateCommand\fR, and to
create additional variables, call \fBTcl_SetVar\fR.
.PP
\fBTcl_DeleteInterp\fR marks an interpreter as deleted; the interpreter
will eventually be deleted when all calls to \fBTcl_Preserve\fR for it have
@@ -144,6 +145,6 @@ should be used to determine when an interpreter is a candidate for deletion
due to inactivity.
.VE 8.6
.SH "SEE ALSO"
Tcl_Preserve(3), Tcl_Release(3), tclvars(n)
Tcl_Preserve(3), Tcl_Release(3)
.SH KEYWORDS
command, create, delete, interpreter
+1 -1
View File
@@ -33,6 +33,6 @@ Tcl-based applications using \fBputenv\fR should redefine it to
\fBTcl_PutEnv\fR so that they will interface properly to the Tcl
runtime.
.SH "SEE ALSO"
tclvars(n)
env(n)
.SH KEYWORDS
environment, variable
+3 -2
View File
@@ -172,8 +172,9 @@ typedef struct {
.PP
The \fIversion\fR field allows for future expansion of the structure, and
should always be declared equal to TCL_OO_METHOD_VERSION_CURRENT. The
\fIname\fR field provides a human-readable name for the type, and is reserved
for debugging.
\fIname\fR field provides a human-readable name for the type, and is the value
that is exposed via the \fBinfo class methodtype\fR and
\fBinfo object methodtype\fR Tcl commands.
.PP
The \fIcallProc\fR field gives a function that is called when the method is
invoked; it must never be NULL.
+6 -6
View File
@@ -8,7 +8,7 @@
.TH NRE 3 8.6 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_NRCreateCommand, Tcl_NRCallObjProc, Tcl_NREvalObj, Tcl_NREvalObjv, Tcl_NRCmdSwap, Tcl_NRAddCallback \- Non-Recursive (stackless) evaluation of Tcl scripts.
Tcl_NRCreateCommand, Tcl_NRCallObjProc, Tcl_NREvalObj, Tcl_NREvalObjv, Tcl_NRCmdSwap, Tcl_NRExprObj, Tcl_NRAddCallback \- Non-Recursive (stackless) evaluation of Tcl scripts.
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
@@ -207,7 +207,7 @@ is something like:
.PP
.CS
int
\fITheCmdObjProc\fR(
\fITheCmdOldObjProc\fR(
ClientData clientData,
Tcl_Interp *interp,
int objc,
@@ -225,7 +225,7 @@ int
return result;
}
\fBTcl_CreateObjCommand\fR(interp, "theCommand",
\fITheCmdObjProc\fR, clientData, TheCmdDeleteProc);
\fITheCmdOldObjProc\fR, clientData, TheCmdDeleteProc);
.CE
.PP
To enable a command like this one for trampoline-based evaluation,
@@ -255,8 +255,8 @@ int
int objc,
Tcl_Obj *const objv[])
{
return \fBTcl_NRCallObjProc\fR(interp, name,
\fITheCmdNRObjProc\fR, clientData, objc, objv);
return \fBTcl_NRCallObjProc\fR(interp, \fITheCmdNRObjProc\fR,
clientData, objc, objv);
}
.CE
.PP
@@ -317,7 +317,7 @@ and the second is for use when there is already a trampoline in place.
.PP
.CS
\fBTcl_NRCreateCommand\fR(interp, "theCommand",
\fITheCmdObjProc\fR, \fITheCmdNRObjProc\fR, clientData,
\fITheCmdNewObjProc\fR, \fITheCmdNRObjProc\fR, clientData,
TheCmdDeleteProc);
.CE
.SH "SEE ALSO"
+54
View File
@@ -0,0 +1,54 @@
'\"
'\" Copyright (c) 2012 Donal K. Fellows
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.so man.macros
.TH Tcl_OOInitStubs 3 1.0 TclOO "TclOO Library Functions"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Tcl_OOInitStubs \- initialize library access to TclOO functionality
.SH SYNOPSIS
.nf
\fB#include <tclOO.h>\fR
.sp
const char *
\fBTcl_OOInitStubs\fR(\fIinterp\fR)
.fi
.SH ARGUMENTS
.AS Tcl_Interp *interp in
.AP Tcl_Interp *interp in
The Tcl interpreter that the TclOO API is integrated with and whose C
interface is going to be used.
.BE
.SH DESCRIPTION
.PP
When an extension library is going to use the C interface exposed by TclOO, it
should use \fBTcl_OOInitStubs\fR to initialize its access to that interface
from within its \fI*\fB_Init\fR (or \fI*\fB_SafeInit\fR) function, passing in
the \fIinterp\fR that was passed into that routine as context. If the result
of calling \fBTcl_OOInitStubs\fR is NULL, the initialization failed and an
error message will have been left in the interpreter's result. Otherwise, the
initialization succeeded and the TclOO API may thereafter be used; the
version of the TclOO API is returned.
.PP
When using this function, either the C #define symbol \fBUSE_TCLOO_STUBS\fR
should be defined and your library code linked against the Tcl stub library,
or that #define symbol should \fInot\fR be defined and your library code
linked against the Tcl main library directly.
.SH "BACKWARD COMPATIBILITY NOTE"
.PP
If you are linking against the Tcl 8.5 forward compatibility package for
TclOO, \fIonly\fR the stub-enabled configuration is supported and you should
also link against the TclOO independent stub library; that library is an
integrated part of the main Tcl stub library in Tcl 8.6.
.SH KEYWORDS
stubs
.SH "SEE ALSO"
Tcl_InitStubs(3)
.\" Local variables:
.\" mode: nroff
.\" fill-column: 78
.\" End:
+4 -1
View File
@@ -85,6 +85,9 @@ proc bgerror {message} {
}
.CE
.SH "SEE ALSO"
after(n), interp(n), tclvars(n)
after(n), errorCode(n), errorInfo(n), interp(n)
.SH KEYWORDS
background error, reporting
'\" Local Variables:
'\" mode: nroff
'\" End:
+21 -5
View File
@@ -36,6 +36,13 @@ The \fBbinary encode\fR and \fBbinary decode\fR subcommands convert
binary data to or from string encodings such as base64 (used in MIME
messages for example).
.VE 8.6
.PP
Note that other operations on binary data, such as taking a subsequence of it,
getting its length, or reinterpreting it as a string in some encoding, are
done by other Tcl commands (respectively \fBstring range\fR,
\fBstring length\fR and \fBencoding convertfrom\fR in the example cases). A
binary string in Tcl is merely one where all the characters it contains are in
the range \eu0000\-\eu00FF.
.SH "BINARY ENCODE AND DECODE"
.VS 8.6
.PP
@@ -95,13 +102,14 @@ between Unix systems and on USENET, but is less common these days, having been
largely superseded by the \fBbase64\fR binary encoding.
.RS
.PP
During encoding, the following options are supported:
'\" This is wrong! The uuencode format had more complexity than this!
During encoding, the following options are supported (though changing them may
produce files that other implementations of decoders cannot process):
.TP
\fB\-maxlen \fIlength\fR
.
Indicates that the output should be split into lines of no more than
\fIlength\fR characters. By default, lines are not split.
\fIlength\fR characters. By default, lines are split every 61 characters, and
this must be in the range 3 to 85 due to limitations in the encoding.
.TP
\fB\-wrapchar \fIcharacter\fR
.
@@ -114,7 +122,11 @@ During decoding, the following options are supported:
.TP
\fB\-strict\fR
.
Instructs the decoder to throw an error if it encounters whitespace characters. Otherwise it ignores them.
Instructs the decoder to throw an error if it encounters unexpected whitespace
characters. Otherwise it ignores them.
.PP
Note that neither the encoder nor the decoder handle the header and footer of
the uuencode format.
.RE
.VE 8.6
.SH "BINARY FORMAT"
@@ -855,6 +867,7 @@ architectures, use their textual representation (as produced by
.PP
This is a procedure to write a Tcl string to a binary-encoded channel as
UTF-8 data preceded by a length word:
.PP
.CS
proc \fIwriteString\fR {channel string} {
set data [encoding convertto utf-8 $string]
@@ -865,6 +878,7 @@ proc \fIwriteString\fR {channel string} {
.PP
This procedure reads a string from a channel that was written by the
previously presented \fIwriteString\fR procedure:
.PP
.CS
proc \fIreadString\fR {channel} {
if {![\fBbinary scan\fR [read $channel 4] I length]} {
@@ -877,6 +891,7 @@ proc \fIreadString\fR {channel} {
.PP
This converts the contents of a file (named in the variable \fIfilename\fR) to
base64 and prints them:
.PP
.CS
set f [open $filename rb]
set data [read $f]
@@ -884,9 +899,10 @@ close $f
puts [\fBbinary encode\fR base64 \-maxlen 64 $data]
.CE
.SH "SEE ALSO"
format(n), scan(n), tclvars(n)
encoding(n), format(n), scan(n), string(n), tcl_platform(n)
.SH KEYWORDS
binary, format, scan
'\" Local Variables:
'\" mode: nroff
'\" fill-column: 78
'\" End:
+2 -1
View File
@@ -115,7 +115,8 @@ if { [\fBcatch\fR {open $someFile w} fid] } {
There are more complex examples of \fBcatch\fR usage in the
documentation for the \fBreturn\fR command.
.SH "SEE ALSO"
break(n), continue(n), dict(n), error(n), info(n), return(n), tclvars(n)
break(n), continue(n), dict(n), error(n), errorCode(n), errorInfo(n), info(n),
return(n)
.SH KEYWORDS
catch, error, exception
'\" Local Variables:
+2 -1
View File
@@ -75,7 +75,8 @@ However, the last line would now normally be written without
set var [linsert $var 0 {*}$args]
.CE
.SH "SEE ALSO"
catch(n), concat(n), error(n), interp(n), list(n), namespace(n), subst(n), tclvars(n), uplevel(n)
catch(n), concat(n), error(n), errorCode(n), errorInfo(n), interp(n), list(n),
namespace(n), subst(n), uplevel(n)
.SH KEYWORDS
concatenate, evaluate, script
'\" Local Variables:
+1 -1
View File
@@ -484,7 +484,7 @@ not the effective ones.
.TP
\fBWindows\fR\0\0\0\0
.
The \fbfile owned\fR subcommand currently always reports that the current user
The \fBfile owned\fR subcommand currently always reports that the current user
is the owner of the file, without regard for what the operating system
believes to be true, making an ownership test useless. This issue (#3613671)
may be fixed in a future release of Tcl.
+6 -6
View File
@@ -296,7 +296,6 @@ Returns the name of the library directory in which standard Tcl
scripts are stored.
This is actually the value of the \fBtcl_library\fR
variable and may be changed by setting \fBtcl_library\fR.
See the \fBtclvars\fR manual entry for more information.
.TP
\fBinfo loaded \fR?\fIinterp\fR?
.
@@ -336,8 +335,8 @@ described in \fBOBJECT INTROSPECTION\fR below.
.TP
\fBinfo patchlevel\fR
.
Returns the value of the global variable \fBtcl_patchLevel\fR; see
the \fBtclvars\fR manual entry for more information.
Returns the value of the global variable \fBtcl_patchLevel\fR, which holds
the exact version of the Tcl library by default.
.TP
\fBinfo procs \fR?\fIpattern\fR?
.
@@ -374,8 +373,8 @@ string is returned.
.TP
\fBinfo tclversion\fR
.
Returns the value of the global variable \fBtcl_version\fR; see
the \fBtclvars\fR manual entry for more information.
Returns the value of the global variable \fBtcl_version\fR, which holds the
major and minor version of the Tcl library by default.
.TP
\fBinfo vars\fR ?\fIpattern\fR?
.
@@ -763,8 +762,9 @@ proc getDef {obj method} {
.VE 8.6
.SH "SEE ALSO"
.VS 8.6
global(n), oo::class(n), oo::define(n), oo::object(n), proc(n), self(n)
global(n), oo::class(n), oo::define(n), oo::object(n), proc(n), self(n),
.VE 8.6
tcl_library(n), tcl_patchLevel(n), tcl_version(n)
.SH KEYWORDS
command, information, interpreter, introspection, level, namespace,
.VS 8.6
+7 -3
View File
@@ -262,13 +262,17 @@ If set to any value, then \fBunknown\fR will not attempt to auto-load
any commands.
.TP
\fBauto_path\fR
.
If set, then it must contain a valid Tcl list giving directories to
search during auto-load operations.
search during auto-load operations (including for package index
files when using the default \fBpackage unknown\fR handler).
This variable is initialized during startup to contain, in order:
the directories listed in the \fBTCLLIBPATH\fR environment variable,
the directory named by the \fBtcl_library\fR variable,
the directory named by the \fBtcl_library\fR global variable,
the parent directory of \fBtcl_library\fR,
the directories listed in the \fBtcl_pkgPath\fR variable.
Additional locations to look for files and package indices should
normally be added to this variable using \fBlappend\fR.
.TP
\fBenv(TCL_LIBRARY)\fR
If set, then it specifies the location of the directory containing
@@ -306,7 +310,7 @@ considered to be a word character. On Windows platforms, words are
comprised of any character that is not a space, tab, or newline. Under
Unix, words are comprised of numbers, letters or underscores.
.SH "SEE ALSO"
info(n), re_syntax(n), tclvars(n)
env(n), info(n), re_syntax(n)
.SH KEYWORDS
auto-exec, auto-load, library, unknown, word, whitespace
'\"Local Variables:
+7 -4
View File
@@ -62,14 +62,14 @@ The method chain is cached for future use.
When constructing the method chain, method implementations are searched for in
the following order:
.IP [1]
In the object.
.IP [2]
In the classes mixed into the object, in class traversal order. The list of
mixins is checked in natural order.
.IP [3]
.IP [2]
In the classes mixed into the classes of the object, with sources of mixing in
being searched in class traversal order. Within each class, the list of mixins
is processed in natural order.
.IP [3]
In the object itself.
.IP [4]
In the object's class.
.IP [5]
@@ -77,7 +77,10 @@ In the superclasses of the class, following each superclass in a depth-first
fashion in the natural order of the superclass list.
.PP
Any particular method implementation always comes as \fIlate\fR in the
resulting list of implementations as possible.
resulting list of implementations as possible; this means that if some class,
A, is both mixed into a class, B, and is also a superclass of B, the instances
of B will always treat A as a superclass from the perspective of inheritance.
This is true even when the multiple inheritance is processed indirectly.
.SS FILTERS
.PP
When an object has a list of filter names set upon it, or is an instance of a
+2 -2
View File
@@ -317,8 +317,8 @@ proc myReturn {args} {
}
.CE
.SH "SEE ALSO"
break(n), catch(n), continue(n), dict(n), error(n), proc(n),
source(n), tclvars(n), throw(n), try(n)
break(n), catch(n), continue(n), dict(n), error(n), errorCode(n),
errorInfo(n), proc(n), source(n), throw(n), try(n)
.SH KEYWORDS
break, catch, continue, error, exception, procedure, result, return
.\" Local Variables:
+5 -3
View File
@@ -102,7 +102,9 @@ but also the disadvantage of making it harder to write scripts that
start up uniformly across different versions of Tcl.
.SH "VARIABLES"
.PP
\fBTclsh\fR sets the following Tcl variables:
\fBTclsh\fR sets the following global Tcl variables in addition to those
created by the Tcl library itself (such as \fBenv\fR, which maps
environment variables such as \fBPATH\fR into Tcl):
.TP 15
\fBargc\fR
.
@@ -129,7 +131,7 @@ device), 0 otherwise.
When \fBtclsh\fR is invoked interactively it normally prompts for each
command with
.QW "\fB% \fR" .
You can change the prompt by setting the
You can change the prompt by setting the global
variables \fBtcl_prompt1\fR and \fBtcl_prompt2\fR. If variable
\fBtcl_prompt1\fR exists then it must consist of a Tcl script
to output a prompt; instead of outputting a prompt \fBtclsh\fR
@@ -142,6 +144,6 @@ incomplete commands.
.PP
See \fBTcl_StandardChannels\fR for more explanations.
.SH "SEE ALSO"
encoding(n), fconfigure(n), tclvars(n)
auto_path(n), encoding(n), env(n), fconfigure(n)
.SH KEYWORDS
application, argument, interpreter, prompt, script file, shell
+1 -1
View File
@@ -40,7 +40,7 @@ The following produces an error that is identical to that produced by
\fBthrow\fR {ARITH DIVZERO {divide by zero}} {divide by zero}
.CE
.SH "SEE ALSO"
catch(n), error(n), return(n), tclvars(n), try(n)
catch(n), error(n), errorCode(n), errorInfo(n), return(n), try(n)
.SH "KEYWORDS"
error, exception
'\" Local Variables:
+3 -2
View File
@@ -259,8 +259,9 @@ static const chr alphaCharTable[] = {
*/
static const crange controlRangeTable[] = {
{0x7f, 0x9f}, {0x600, 0x604}, {0x200b, 0x200f}, {0x202a, 0x202e},
{0x2060, 0x2064}, {0x206a, 0x206f}, {0xe000, 0xf8ff}, {0xfff9, 0xfffb}
{0x0, 0x1f}, {0x7f, 0x9f}, {0x600, 0x604}, {0x200b, 0x200f},
{0x202a, 0x202e}, {0x2060, 0x2064}, {0x206a, 0x206f}, {0xe000, 0xf8ff},
{0xfff9, 0xfffb}
#if TCL_UTF_MAX > 4
,{0x1d173, 0x1d17a}, {0xe0020, 0xe007f}, {0xf0000, 0xffffd}, {0x100000, 0x10fffd}
#endif
+1 -1
View File
@@ -824,7 +824,7 @@ duptraverse(
* make all normal tests (not reg-33.14) pass.
*/
#ifndef DUPTRAVERSE_MAX_DEPTH
#define DUPTRAVERSE_MAX_DEPTH 700
#define DUPTRAVERSE_MAX_DEPTH 15000
#endif
if (depth++ > DUPTRAVERSE_MAX_DEPTH) {
+1 -6
View File
@@ -504,12 +504,7 @@ complicatedFindLoop(
return er;
}
if ((shorter) ? end == estop : end == begin) {
/*
* No point in trying again.
*/
*coldp = cold;
return REG_NOMATCH;
break;
}
/*
+3 -3
View File
@@ -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 0
#define TCL_RELEASE_SERIAL 1
#define TCL_VERSION "8.6"
#define TCL_PATCH_LEVEL "8.6.0"
#define TCL_PATCH_LEVEL "8.6.1"
/*
*----------------------------------------------------------------------------
@@ -2417,7 +2417,7 @@ const char * TclTomMathInitializeStubs(Tcl_Interp *interp,
*/
#define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \
(Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)()))
((Tcl_CreateInterp)()))
EXTERN void Tcl_MainEx(int argc, char **argv,
Tcl_AppInitProc *appInitProc, Tcl_Interp *interp);
EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp,
+61 -14
View File
@@ -246,6 +246,8 @@ static void BBEmitInstInt4(AssemblyEnv* assemEnvPtr, int tblIdx,
int opnd, int count);
static void BBEmitInst1or4(AssemblyEnv* assemEnvPtr, int tblIdx,
int param, int count);
static void BBEmitInvoke1or4(AssemblyEnv* assemEnvPtr, int tblIdx,
int param, int count);
static void BBEmitOpcode(AssemblyEnv* assemEnvPtr, int tblIdx,
int count);
static int BuildExceptionRanges(AssemblyEnv* assemEnvPtr);
@@ -679,10 +681,13 @@ BBEmitInstInt4(
/*
*-----------------------------------------------------------------------------
*
* BBEmitInst1or4 --
* BBEmitInst1or4, BBEmitInvoke1or4 --
*
* Emits a 1- or 4-byte operation according to the magnitude of the
* operand
* operand. The Invoke variant generates wrapping stack-balance
* management if necessary (which is not normally required in assembled
* code, as loop exception ranges, expansions, breaks and continues can't
* be issued currently).
*
*-----------------------------------------------------------------------------
*/
@@ -714,6 +719,29 @@ BBEmitInst1or4(
TclUpdateAtCmdStart(op, envPtr);
BBUpdateStackReqs(bbPtr, tblIdx, count);
}
static void
BBEmitInvoke1or4(
AssemblyEnv* assemEnvPtr, /* Assembly environment */
int tblIdx, /* Index in TalInstructionTable of op */
int param, /* Variable-length parameter */
int count) /* Arity if variadic */
{
CompileEnv* envPtr = assemEnvPtr->envPtr;
/* Compilation environment */
BasicBlock* bbPtr = assemEnvPtr->curr_bb;
/* Current basic block */
int op = TalInstructionTable[tblIdx].tclInstCode;
if (param <= 0xff) {
op >>= 8;
} else {
op &= 0xff;
}
TclEmitInvoke(envPtr, op, param);
TclUpdateAtCmdStart(op, envPtr);
BBUpdateStackReqs(bbPtr, tblIdx, count);
}
/*
*-----------------------------------------------------------------------------
@@ -930,6 +958,10 @@ TclCompileAssembleCmd(
{
Tcl_Token *tokenPtr; /* Token in the input script */
int numCommands = envPtr->numCommands;
int offset = envPtr->codeNext - envPtr->codeStart;
int depth = envPtr->currStackDepth;
/*
* Make sure that the command has a single arg that is a simple word.
*/
@@ -943,10 +975,23 @@ TclCompileAssembleCmd(
}
/*
* Compile the code and return any error from the compilation.
* Compile the code and convert any error from the compilation into
* bytecode reporting the error;
*/
return TclAssembleCode(envPtr, tokenPtr[1].start, tokenPtr[1].size, 0);
if (TCL_ERROR == TclAssembleCode(envPtr, tokenPtr[1].start,
tokenPtr[1].size, TCL_EVAL_DIRECT)) {
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (\"%.*s\" body, line %d)",
parsePtr->tokenPtr->size, parsePtr->tokenPtr->start,
Tcl_GetErrorLine(interp)));
envPtr->numCommands = numCommands;
envPtr->codeNext = envPtr->codeStart + offset;
envPtr->currStackDepth = depth;
TclCompileSyntaxError(interp, envPtr);
}
return TCL_OK;
}
/*
@@ -985,8 +1030,6 @@ TclAssembleCode(
const char* instPtr = codePtr;
/* Where to start looking for a line of code */
int instLen; /* Length in bytes of the current line of
* code */
const char* nextPtr; /* Pointer to the end of the line of code */
int bytesLeft = codeLen; /* Number of bytes of source code remaining to
* be parsed */
@@ -1000,10 +1043,6 @@ TclAssembleCode(
*/
status = Tcl_ParseCommand(interp, instPtr, bytesLeft, 0, parsePtr);
instLen = parsePtr->commandSize;
if (parsePtr->term == parsePtr->commandStart + instLen - 1) {
--instLen;
}
/*
* Report errors in the parse.
@@ -1012,7 +1051,7 @@ TclAssembleCode(
if (status != TCL_OK) {
if (flags & TCL_EVAL_DIRECT) {
Tcl_LogCommandInfo(interp, codePtr, parsePtr->commandStart,
instLen);
parsePtr->term + 1 - parsePtr->commandStart);
}
FreeAssemblyEnv(assemEnvPtr);
return TCL_ERROR;
@@ -1032,6 +1071,13 @@ TclAssembleCode(
*/
if (parsePtr->numWords > 0) {
int instLen = parsePtr->commandSize;
/* Length in bytes of the current command */
if (parsePtr->term == parsePtr->commandStart + instLen - 1) {
--instLen;
}
/*
* If tracing, show each line assembled as it happens.
*/
@@ -1107,7 +1153,7 @@ NewAssemblyEnv(
assemEnvPtr->envPtr = envPtr;
assemEnvPtr->parsePtr = parsePtr;
assemEnvPtr->cmdLine = envPtr->line;
assemEnvPtr->cmdLine = 1;
assemEnvPtr->clNext = envPtr->clNext;
/*
@@ -1432,7 +1478,7 @@ AssembleOneLine(
goto cleanup;
}
BBEmitInst1or4(assemEnvPtr, tblIdx, opnd, opnd);
BBEmitInvoke1or4(assemEnvPtr, tblIdx, opnd, opnd);
break;
case ASSEM_JUMP:
@@ -2599,6 +2645,7 @@ AllocBB(
bb->minStackDepth = 0;
bb->maxStackDepth = 0;
bb->finalStackDepth = 0;
bb->catchDepth = 0;
bb->enclosingCatch = NULL;
bb->foreignExceptionBase = -1;
bb->foreignExceptionCount = 0;
@@ -3029,7 +3076,7 @@ ResolveJumpTableTargets(
auxDataIndex = TclGetInt4AtPtr(envPtr->codeStart + bbPtr->jumpOffset + 1);
DEBUG_PRINT("bbPtr = %p jumpOffset = %d auxDataIndex = %d\n",
bbPtr, bbPtr->jumpOffset, auxDataIndex);
realJumpTablePtr = envPtr->auxDataArrayPtr[auxDataIndex].clientData;
realJumpTablePtr = TclFetchAuxData(envPtr, auxDataIndex);
realJumpHashPtr = &realJumpTablePtr->hashTable;
/*
+350 -470
View File
File diff suppressed because it is too large Load Diff
+253 -55
View File
@@ -87,10 +87,13 @@ static int BinaryDecodeHex(ClientData clientData,
static int BinaryEncode64(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int BinaryDecodeUu(ClientData clientData,
static int BinaryDecode64(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int BinaryDecode64(ClientData clientData,
static int BinaryEncodeUu(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
static int BinaryDecodeUu(ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
@@ -139,9 +142,9 @@ static const EnsembleImplMap binaryMap[] = {
{ NULL, NULL, NULL, NULL, NULL, 0 }
};
static const EnsembleImplMap encodeMap[] = {
{ "hex", BinaryEncodeHex, TclCompileBasic1ArgCmd, NULL, (ClientData)HexDigits, 0 },
{ "uuencode", BinaryEncode64, NULL, NULL, (ClientData)UueDigits, 0 },
{ "base64", BinaryEncode64, NULL, NULL, (ClientData)B64Digits, 0 },
{ "hex", BinaryEncodeHex, TclCompileBasic1ArgCmd, NULL, NULL, 0 },
{ "uuencode", BinaryEncodeUu, NULL, NULL, NULL, 0 },
{ "base64", BinaryEncode64, NULL, NULL, NULL, 0 },
{ NULL, NULL, NULL, NULL, NULL, 0 }
};
static const EnsembleImplMap decodeMap[] = {
@@ -2312,7 +2315,6 @@ BinaryEncodeHex(
Tcl_Obj *resultObj = NULL;
unsigned char *data = NULL;
unsigned char *cursor = NULL;
const char *digits = clientData;
int offset = 0, count = 0;
if (objc != 2) {
@@ -2324,8 +2326,8 @@ BinaryEncodeHex(
data = Tcl_GetByteArrayFromObj(objv[1], &count);
cursor = Tcl_SetByteArrayLength(resultObj, count * 2);
for (offset = 0; offset < count; ++offset) {
*cursor++ = digits[((data[offset] >> 4) & 0x0f)];
*cursor++ = digits[(data[offset] & 0x0f)];
*cursor++ = HexDigits[((data[offset] >> 4) & 0x0f)];
*cursor++ = HexDigits[(data[offset] & 0x0f)];
}
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
@@ -2386,29 +2388,32 @@ BinaryDecodeHex(
while (data < dataend) {
value = 0;
for (i=0 ; i<2 ; i++) {
if (data < dataend) {
c = *data++;
if (!isxdigit((int) c)) {
if (strict || !isspace(c)) {
goto badChar;
}
i--;
continue;
}
if (data >= dataend) {
value <<= 4;
c -= '0';
if (c > 9) {
c += ('0' - 'A') + 10;
}
if (c > 16) {
c += ('A' - 'a');
}
value |= (c & 0xf);
} else {
value <<= 4;
cut++;
break;
}
c = *data++;
if (!isxdigit((int) c)) {
if (strict || !isspace(c)) {
goto badChar;
}
i--;
continue;
}
value <<= 4;
c -= '0';
if (c > 9) {
c += ('0' - 'A') + 10;
}
if (c > 16) {
c += ('A' - 'a');
}
value |= (c & 0xf);
}
if (i < 2) {
cut++;
}
*cursor++ = UCHAR(value);
value = 0;
@@ -2436,7 +2441,7 @@ BinaryDecodeHex(
* This implements a generic 6 bit binary encoding. Input is broken into
* 6 bit chunks and a lookup table passed in via clientData is used to
* turn these values into output characters. This is used to implement
* base64 and uuencode binary encodings.
* base64 binary encodings.
*
* Results:
* Interp result set to an encoded byte array object
@@ -2472,7 +2477,6 @@ BinaryEncode64(
{
Tcl_Obj *resultObj;
unsigned char *data, *cursor, *limit;
const char *digits = clientData;
int maxlen = 0;
const char *wrapchar = "\n";
int wrapcharlen = 1;
@@ -2495,6 +2499,13 @@ BinaryEncode64(
if (Tcl_GetIntFromObj(interp, objv[i+1], &maxlen) != TCL_OK) {
return TCL_ERROR;
}
if (maxlen < 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"line length out of range", -1));
Tcl_SetErrorCode(interp, "TCL", "BINARY", "ENCODE",
"LINE_LENGTH", NULL);
return TCL_ERROR;
}
break;
case OPT_WRAPCHAR:
wrapchar = Tcl_GetStringFromObj(objv[i+1], &wrapcharlen);
@@ -2525,17 +2536,17 @@ BinaryEncode64(
for (i = 0; i < 3 && offset+i < count; ++i) {
d[i] = data[offset + i];
}
OUTPUT(digits[d[0] >> 2]);
OUTPUT(digits[((d[0] & 0x03) << 4) | (d[1] >> 4)]);
OUTPUT(B64Digits[d[0] >> 2]);
OUTPUT(B64Digits[((d[0] & 0x03) << 4) | (d[1] >> 4)]);
if (offset+1 < count) {
OUTPUT(digits[((d[1] & 0x0f) << 2) | (d[2] >> 6)]);
OUTPUT(B64Digits[((d[1] & 0x0f) << 2) | (d[2] >> 6)]);
} else {
OUTPUT(digits[64]);
OUTPUT(B64Digits[64]);
}
if (offset+2 < count) {
OUTPUT(digits[d[2] & 0x3f]);
OUTPUT(B64Digits[d[2] & 0x3f]);
} else {
OUTPUT(digits[64]);
OUTPUT(B64Digits[64]);
}
}
}
@@ -2544,6 +2555,125 @@ BinaryEncode64(
}
#undef OUTPUT
/*
*----------------------------------------------------------------------
*
* BinaryEncodeUu --
*
* This implements the uuencode binary encoding. Input is broken into 6
* bit chunks and a lookup table is used to turn these values into output
* characters. This differs from the generic code above in that line
* lengths are also encoded.
*
* Results:
* Interp result set to an encoded byte array object
*
* Side effects:
* None
*
*----------------------------------------------------------------------
*/
static int
BinaryEncodeUu(
ClientData clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
{
Tcl_Obj *resultObj;
unsigned char *data, *start, *cursor;
int offset, count, rawLength, n, i, j, bits, index;
int lineLength = 61;
const unsigned char SingleNewline[] = { (unsigned char) '\n' };
const unsigned char *wrapchar = SingleNewline;
int wrapcharlen = sizeof(SingleNewline);
enum { OPT_MAXLEN, OPT_WRAPCHAR };
static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };
if (objc < 2 || objc%2 != 0) {
Tcl_WrongNumArgs(interp, 1, objv,
"?-maxlen len? ?-wrapchar char? data");
return TCL_ERROR;
}
for (i = 1; i < objc-1; i += 2) {
if (Tcl_GetIndexFromObj(interp, objv[i], optStrings, "option",
TCL_EXACT, &index) != TCL_OK) {
return TCL_ERROR;
}
switch (index) {
case OPT_MAXLEN:
if (Tcl_GetIntFromObj(interp, objv[i+1], &lineLength) != TCL_OK) {
return TCL_ERROR;
}
if (lineLength < 3 || lineLength > 85) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"line length out of range", -1));
Tcl_SetErrorCode(interp, "TCL", "BINARY", "ENCODE",
"LINE_LENGTH", NULL);
return TCL_ERROR;
}
break;
case OPT_WRAPCHAR:
wrapchar = Tcl_GetByteArrayFromObj(objv[i+1], &wrapcharlen);
break;
}
}
/*
* Allocate the buffer. This is a little bit too long, but is "good
* enough".
*/
resultObj = Tcl_NewObj();
offset = 0;
data = Tcl_GetByteArrayFromObj(objv[objc-1], &count);
rawLength = (lineLength - 1) * 3 / 4;
start = cursor = Tcl_SetByteArrayLength(resultObj,
(lineLength + wrapcharlen) *
((count + (rawLength - 1)) / rawLength));
n = bits = 0;
/*
* Encode the data. Each output line first has the length of raw data
* encoded by the output line described in it by one encoded byte, then
* the encoded data follows (encoding each 6 bits as one character).
* Encoded lines are always terminated by a newline.
*/
while (offset < count) {
int lineLen = count - offset;
if (lineLen > rawLength) {
lineLen = rawLength;
}
*cursor++ = UueDigits[lineLen];
for (i=0 ; i<lineLen ; i++) {
n <<= 8;
n |= data[offset++];
for (bits += 8; bits > 6 ; bits -= 6) {
*cursor++ = UueDigits[(n >> (bits-6)) & 0x3f];
}
}
if (bits > 0) {
n <<= 8;
*cursor++ = UueDigits[(n >> (bits + 2)) & 0x3f];
bits = 0;
}
for (j=0 ; j<wrapcharlen ; ++j) {
*cursor++ = wrapchar[j];
}
}
/*
* Fix the length of the output bytearray.
*/
Tcl_SetByteArrayLength(resultObj, cursor-start);
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
@@ -2570,8 +2700,8 @@ BinaryDecodeUu(
Tcl_Obj *resultObj = NULL;
unsigned char *data, *datastart, *dataend;
unsigned char *begin, *cursor;
int i, index, size, count = 0, cut = 0, strict = 0;
char c;
int i, index, size, count = 0, strict = 0, lineLen;
unsigned char c;
enum {OPT_STRICT };
static const char *const optStrings[] = { "-strict", NULL };
@@ -2597,44 +2727,112 @@ BinaryDecodeUu(
dataend = data + count;
size = ((count + 3) & ~3) * 3 / 4;
begin = cursor = Tcl_SetByteArrayLength(resultObj, size);
lineLen = -1;
/*
* The decoding loop. First, we get the length of line (strictly, the
* number of data bytes we expect to generate from the line) we're
* processing this time round if it is not already known (i.e., when the
* lineLen variable is set to the magic value, -1).
*/
while (data < dataend) {
char d[4] = {0, 0, 0, 0};
if (lineLen < 0) {
c = *data++;
if (c < 32 || c > 96) {
if (strict || !isspace(c)) {
goto badUu;
}
i--;
continue;
}
lineLen = (c - 32) & 0x3f;
}
/*
* Now we read a four-character grouping.
*/
for (i=0 ; i<4 ; i++) {
if (data < dataend) {
d[i] = c = *data++;
if (c < 33 || c > 96) {
if (strict || !isspace(UCHAR(c))) {
goto badUu;
if (c < 32 || c > 96) {
if (strict) {
if (!isspace(c)) {
goto badUu;
} else if (c == '\n') {
goto shortUu;
}
}
i--;
continue;
}
} else {
cut++;
}
}
if (cut > 3) {
cut = 3;
/*
* Translate that grouping into (up to) three binary bytes output.
*/
if (lineLen > 0) {
*cursor++ = (((d[0] - 0x20) & 0x3f) << 2)
| (((d[1] - 0x20) & 0x3f) >> 4);
if (--lineLen > 0) {
*cursor++ = (((d[1] - 0x20) & 0x3f) << 4)
| (((d[2] - 0x20) & 0x3f) >> 2);
if (--lineLen > 0) {
*cursor++ = (((d[2] - 0x20) & 0x3f) << 6)
| (((d[3] - 0x20) & 0x3f));
lineLen--;
}
}
}
/*
* If we've reached the end of the line, skip until we process a
* newline.
*/
if (lineLen == 0 && data < dataend) {
lineLen = -1;
do {
c = *data++;
if (c == '\n') {
break;
} else if (c >= 32 && c <= 96) {
data--;
break;
} else if (strict || !isspace(c)) {
goto badUu;
}
} while (data < dataend);
}
*cursor++ = (((d[0] - 0x20) & 0x3f) << 2)
| (((d[1] - 0x20) & 0x3f) >> 4);
*cursor++ = (((d[1] - 0x20) & 0x3f) << 4)
| (((d[2] - 0x20) & 0x3f) >> 2);
*cursor++ = (((d[2] - 0x20) & 0x3f) << 6)
| (((d[3] - 0x20) & 0x3f));
}
if (cut > size) {
cut = size;
/*
* Sanity check, clean up and finish.
*/
if (lineLen > 0 && strict) {
goto shortUu;
}
Tcl_SetByteArrayLength(resultObj, cursor - begin - cut);
Tcl_SetByteArrayLength(resultObj, cursor - begin);
Tcl_SetObjResult(interp, resultObj);
return TCL_OK;
shortUu:
Tcl_SetObjResult(interp, Tcl_ObjPrintf("short uuencode data"));
Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "SHORT", NULL);
TclDecrRefCount(resultObj);
return TCL_ERROR;
badUu:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"invalid uuencode character \"%c\" at position %d",
c, (int) (data - datastart - 1)));
Tcl_SetErrorCode(interp, "TCL", "BINARY", "DECODE", "INVALID", NULL);
TclDecrRefCount(resultObj);
return TCL_ERROR;
}
+3 -4
View File
@@ -194,8 +194,7 @@ Tcl_CaseObjCmd(
for (i = 0; i < caseObjc; i += 2) {
int patObjc, j;
const char **patObjv;
const char *pat;
unsigned char *p;
const char *pat, *p;
if (i == caseObjc-1) {
Tcl_ResetResult(interp);
@@ -210,8 +209,8 @@ Tcl_CaseObjCmd(
*/
pat = TclGetString(caseObjv[i]);
for (p = (unsigned char *) pat; *p != '\0'; p++) {
if (isspace(*p) || (*p == '\\')) { /* INTL: ISO space, UCHAR */
for (p = pat; *p != '\0'; p++) {
if (TclIsSpaceProc(*p) || (*p == '\\')) {
break;
}
}
+8 -26
View File
@@ -1302,28 +1302,12 @@ TclInfoFrame(
*/
ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], -1));
ADD_PAIR("line", Tcl_NewIntObj(framePtr->line[0]));
ADD_PAIR("cmd", Tcl_NewStringObj(framePtr->cmd.str.cmd,
framePtr->cmd.str.len));
break;
case TCL_LOCATION_EVAL_LIST:
/*
* List optimized evaluation. Type, line, cmd, the latter through
* listPtr, possibly a frame.
*/
ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], -1));
ADD_PAIR("line", Tcl_NewIntObj(1));
/*
* We put a duplicate of the command list obj into the result to
* ensure that the 'pure List'-property of the command itself is not
* destroyed. Otherwise the query here would disable the list
* optimization path in Tcl_EvalObjEx.
*/
ADD_PAIR("cmd", Tcl_DuplicateObj(framePtr->cmd.listPtr));
if (framePtr->line) {
ADD_PAIR("line", Tcl_NewIntObj(framePtr->line[0]));
} else {
ADD_PAIR("line", Tcl_NewIntObj(1));
}
ADD_PAIR("cmd", TclGetSourceFromFrame(framePtr, 0, NULL));
break;
case TCL_LOCATION_PREBC:
@@ -1371,8 +1355,7 @@ TclInfoFrame(
Tcl_DecrRefCount(fPtr->data.eval.path);
}
ADD_PAIR("cmd",
Tcl_NewStringObj(fPtr->cmd.str.cmd, fPtr->cmd.str.len));
ADD_PAIR("cmd", TclGetSourceFromFrame(fPtr, 0, NULL));
TclStackFree(interp, fPtr);
break;
}
@@ -1391,8 +1374,7 @@ TclInfoFrame(
* the result list object.
*/
ADD_PAIR("cmd", Tcl_NewStringObj(framePtr->cmd.str.cmd,
framePtr->cmd.str.len));
ADD_PAIR("cmd", TclGetSourceFromFrame(framePtr, 0, NULL));
break;
case TCL_LOCATION_PROC:
+90 -103
View File
@@ -87,6 +87,7 @@ TclCompileAppendCmd(
int isScalar, localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
if (numWords == 1) {
return TCL_ERROR;
@@ -268,7 +269,7 @@ TclCompileArraySetCmd(
if (isDataValid && !isDataEven) {
PushStringLiteral(envPtr, "list must have an even number of elements");
PushStringLiteral(envPtr, "-errorCode {TCL ARGUMENT FORMAT}");
TclEmitInstInt4(INST_RETURN_IMM, 1, envPtr);
TclEmitInstInt4(INST_RETURN_IMM, TCL_ERROR, envPtr);
TclEmitInt4( 0, envPtr);
goto done;
}
@@ -353,7 +354,7 @@ TclCompileArraySetCmd(
TclEmitInstInt1(INST_JUMP_FALSE1, 0, envPtr);
PushStringLiteral(envPtr, "list must have an even number of elements");
PushStringLiteral(envPtr, "-errorCode {TCL ARGUMENT FORMAT}");
TclEmitInstInt4(INST_RETURN_IMM, 1, envPtr);
TclEmitInstInt4(INST_RETURN_IMM, TCL_ERROR, envPtr);
TclEmitInt4( 0, envPtr);
TclAdjustStackDepth(-1, envPtr);
fwd = CurrentOffset(envPtr) - offsetFwd;
@@ -544,8 +545,6 @@ TclCompileCatchCmd(
JumpFixup jumpFixup;
Tcl_Token *cmdTokenPtr, *resultNameTokenPtr, *optsNameTokenPtr;
int resultIndex, optsIndex, range;
int initStackDepth = envPtr->currStackDepth;
int savedStackDepth;
DefineLineInformation; /* TIP #280 */
/*
@@ -611,19 +610,17 @@ TclCompileCatchCmd(
* begin by undeflowing the stack below the mark set by BEGIN_CATCH4.
*/
SetLineInformation(1);
if (cmdTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
savedStackDepth = envPtr->currStackDepth;
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
CompileBody(envPtr, cmdTokenPtr, interp);
BODY(cmdTokenPtr, 1);
} else {
SetLineInformation(1);
CompileTokens(envPtr, cmdTokenPtr, interp);
savedStackDepth = envPtr->currStackDepth;
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
TclEmitOpcode( INST_DUP, envPtr);
TclEmitOpcode( INST_EVAL_STK, envPtr);
TclEmitInvoke(envPtr, INST_EVAL_STK);
}
/* Stack at this point:
* nonsimple: script <mark> result
@@ -641,7 +638,7 @@ TclCompileCatchCmd(
TclEmitOpcode( INST_POP, envPtr);
PushStringLiteral(envPtr, "0");
TclEmitInstInt1( INST_JUMP1, 3, envPtr);
envPtr->currStackDepth = savedStackDepth;
TclAdjustStackDepth(-1, envPtr);
ExceptionRangeTarget(envPtr, range, catchOffset);
TclEmitOpcode( INST_PUSH_RETURN_CODE, envPtr);
ExceptionRangeEnds(envPtr, range);
@@ -670,7 +667,7 @@ TclCompileCatchCmd(
* return code.
*/
envPtr->currStackDepth = savedStackDepth;
TclAdjustStackDepth(-2, envPtr);
ExceptionRangeTarget(envPtr, range, catchOffset);
/* Stack at this point: ?script? */
TclEmitOpcode( INST_PUSH_RESULT, envPtr);
@@ -745,15 +742,6 @@ TclCompileCatchCmd(
TclEmitOpcode( INST_POP, envPtr);
}
/*
* Result of all this, on either branch, should have been to leave one
* operand -- the return code -- on the stack.
*/
if (envPtr->currStackDepth != initStackDepth + 1) {
Tcl_Panic("in TclCompileCatchCmd, currStackDepth = %d should be %d",
envPtr->currStackDepth, initStackDepth+1);
}
return TCL_OK;
}
@@ -851,7 +839,7 @@ TclCompileDictSetCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *tokenPtr;
int numWords, i, dictVarIndex;
int i, dictVarIndex;
DefineLineInformation; /* TIP #280 */
Tcl_Token *varTokenPtr;
@@ -880,8 +868,7 @@ TclCompileDictSetCmd(
*/
tokenPtr = TokenAfter(varTokenPtr);
numWords = parsePtr->numWords-1;
for (i=1 ; i<numWords ; i++) {
for (i=2 ; i< parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
@@ -890,7 +877,7 @@ TclCompileDictSetCmd(
* Now emit the instruction to do the dict manipulation.
*/
TclEmitInstInt4( INST_DICT_SET, numWords-2, envPtr);
TclEmitInstInt4( INST_DICT_SET, parsePtr->numWords-3, envPtr);
TclEmitInt4( dictVarIndex, envPtr);
TclAdjustStackDepth(-1, envPtr);
return TCL_OK;
@@ -962,7 +949,7 @@ TclCompileDictIncrCmd(
* Emit the key and the code to actually do the increment.
*/
CompileWord(envPtr, keyTokenPtr, interp, 3);
CompileWord(envPtr, keyTokenPtr, interp, 2);
TclEmitInstInt4( INST_DICT_INCR_IMM, incrAmount, envPtr);
TclEmitInt4( dictVarIndex, envPtr);
return TCL_OK;
@@ -978,7 +965,7 @@ TclCompileDictGetCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *tokenPtr;
int numWords, i;
int i;
DefineLineInformation; /* TIP #280 */
/*
@@ -986,21 +973,21 @@ TclCompileDictGetCmd(
* case is legal, but too special and magic for us to deal with here).
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3) {
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
numWords = parsePtr->numWords-1;
/*
* Only compile this because we need INST_DICT_GET anyway.
*/
for (i=0 ; i<numWords ; i++) {
for (i=1 ; i<parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4(INST_DICT_GET, numWords-1, envPtr);
TclEmitInstInt4(INST_DICT_GET, parsePtr->numWords-2, envPtr);
TclAdjustStackDepth(-1, envPtr);
return TCL_OK;
}
@@ -1015,7 +1002,7 @@ TclCompileDictExistsCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *tokenPtr;
int numWords, i;
int i;
DefineLineInformation; /* TIP #280 */
/*
@@ -1023,21 +1010,21 @@ TclCompileDictExistsCmd(
* case is legal, but too special and magic for us to deal with here).
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3) {
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
numWords = parsePtr->numWords-1;
/*
* Now we do the code generation.
*/
for (i=0 ; i<numWords ; i++) {
for (i=1 ; i<parsePtr->numWords ; i++) {
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4(INST_DICT_EXISTS, numWords-1, envPtr);
TclEmitInstInt4(INST_DICT_EXISTS, parsePtr->numWords-2, envPtr);
TclAdjustStackDepth(-1, envPtr);
return TCL_OK;
}
@@ -1060,6 +1047,7 @@ TclCompileDictUnsetCmd(
* compile to bytecode.
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3) {
return TCL_ERROR;
}
@@ -1205,6 +1193,7 @@ TclCompileDictMergeCmd(
* argument, the only thing to do is to verify the dict-ness.
*/
/* TODO: Consider support for compiling expanded args. (less likely) */
if (parsePtr->numWords < 2) {
PushStringLiteral(envPtr, "");
return TCL_OK;
@@ -1286,6 +1275,7 @@ TclCompileDictMergeCmd(
* subsequent) dicts. This is strictly not necessary, but it is nice.
*/
TclAdjustStackDepth(-1, envPtr);
ExceptionRangeTarget(envPtr, outLoop, catchOffset);
TclEmitOpcode( INST_PUSH_RETURN_OPTIONS, envPtr);
TclEmitOpcode( INST_PUSH_RESULT, envPtr);
@@ -1295,7 +1285,6 @@ TclCompileDictMergeCmd(
TclEmitInstInt1( INST_UNSET_SCALAR, 0, envPtr);
TclEmitInt4( infoIndex, envPtr);
TclEmitOpcode( INST_RETURN_STK, envPtr);
TclAdjustStackDepth(-1, envPtr);
return TCL_OK;
}
@@ -1345,9 +1334,6 @@ CompileDictEachCmd(
int numVars, endTargetOffset;
int collectVar = -1; /* Index of temp var holding the result
* dict. */
int savedStackDepth = envPtr->currStackDepth;
/* Needed because jumps confuse the stack
* space calculator. */
const char **argv;
Tcl_DString buffer;
@@ -1437,7 +1423,7 @@ CompileDictEachCmd(
* this point.
*/
CompileWord(envPtr, dictTokenPtr, interp, 3);
CompileWord(envPtr, dictTokenPtr, interp, 2);
/*
* Now we catch errors from here on so that we can finalize the search
@@ -1473,8 +1459,7 @@ CompileDictEachCmd(
* Compile the loop body itself. It should be stack-neutral.
*/
SetLineInformation(3);
CompileBody(envPtr, bodyTokenPtr, interp);
BODY(bodyTokenPtr, 3);
if (collect == TCL_EACH_COLLECT) {
Emit14Inst( INST_LOAD_SCALAR, keyVarIndex, envPtr);
TclEmitInstInt4(INST_OVER, 1, envPtr);
@@ -1510,6 +1495,7 @@ CompileDictEachCmd(
* and rethrows the error.
*/
TclAdjustStackDepth(-1, envPtr);
ExceptionRangeTarget(envPtr, catchRange, catchOffset);
TclEmitOpcode( INST_PUSH_RETURN_OPTIONS, envPtr);
TclEmitOpcode( INST_PUSH_RESULT, envPtr);
@@ -1528,7 +1514,6 @@ CompileDictEachCmd(
* easy!) Note that we skip the END_CATCH. [Bug 1382528]
*/
envPtr->currStackDepth = savedStackDepth + 2;
jumpDisplacement = CurrentOffset(envPtr) - emptyTargetOffset;
TclUpdateInstInt4AtPc(INST_JUMP_TRUE4, jumpDisplacement,
envPtr->codeStart + emptyTargetOffset);
@@ -1647,7 +1632,7 @@ TclCompileDictUpdateCmd(
infoIndex = TclCreateAuxData(duiPtr, &tclDictUpdateInfoType, envPtr);
for (i=0 ; i<numVars ; i++) {
CompileWord(envPtr, keyTokenPtrs[i], interp, i);
CompileWord(envPtr, keyTokenPtrs[i], interp, 2*i+2);
}
TclEmitInstInt4( INST_LIST, numVars, envPtr);
TclEmitInstInt4( INST_DICT_UPDATE_START, dictIndex, envPtr);
@@ -1657,8 +1642,7 @@ TclCompileDictUpdateCmd(
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
SetLineInformation(parsePtr->numWords - 1);
CompileBody(envPtr, bodyTokenPtr, interp);
BODY(bodyTokenPtr, parsePtr->numWords - 1);
ExceptionRangeEnds(envPtr, range);
/*
@@ -1691,7 +1675,7 @@ TclCompileDictUpdateCmd(
TclEmitInstInt4( INST_DICT_UPDATE_END, dictIndex, envPtr);
TclEmitInt4( infoIndex, envPtr);
TclEmitOpcode( INST_RETURN_STK, envPtr);
TclEmitInvoke(envPtr,INST_RETURN_STK);
if (TclFixupForwardJumpToHere(envPtr, &jumpFixup, 127)) {
Tcl_Panic("TclCompileDictCmd(update): bad jump distance %d",
@@ -1730,6 +1714,7 @@ TclCompileDictAppendCmd(
* speed quite so much. ;-)
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords<4 || parsePtr->numWords>100) {
return TCL_ERROR;
}
@@ -1782,6 +1767,8 @@ TclCompileDictLappendCmd(
* There must be three arguments after the command.
*/
/* TODO: Consider support for compiling expanded args. */
/* Probably not. Why is INST_DICT_LAPPEND limited to one value? */
if (parsePtr->numWords != 4) {
return TCL_ERROR;
}
@@ -1802,8 +1789,8 @@ TclCompileDictLappendCmd(
* Issue the implementation.
*/
CompileWord(envPtr, keyTokenPtr, interp, 3);
CompileWord(envPtr, valueTokenPtr, interp, 4);
CompileWord(envPtr, keyTokenPtr, interp, 2);
CompileWord(envPtr, valueTokenPtr, interp, 3);
TclEmitInstInt4( INST_DICT_LAPPEND, dictVarIndex, envPtr);
return TCL_OK;
}
@@ -1828,6 +1815,7 @@ TclCompileDictWithCmd(
* There must be at least one argument after the command.
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3) {
return TCL_ERROR;
}
@@ -1887,7 +1875,7 @@ TclCompileDictWithCmd(
tokenPtr = TokenAfter(varTokenPtr);
for (i=2 ; i<parsePtr->numWords-1 ; i++) {
CompileWord(envPtr, tokenPtr, interp, i-1);
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4(INST_LIST, parsePtr->numWords-3,envPtr);
@@ -1914,7 +1902,7 @@ TclCompileDictWithCmd(
tokenPtr = varTokenPtr;
for (i=1 ; i<parsePtr->numWords-1 ; i++) {
CompileWord(envPtr, tokenPtr, interp, i-1);
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4(INST_LIST, parsePtr->numWords-3,envPtr);
@@ -1928,7 +1916,7 @@ TclCompileDictWithCmd(
* Case: Direct dict in non-simple var with empty body.
*/
CompileWord(envPtr, varTokenPtr, interp, 0);
CompileWord(envPtr, varTokenPtr, interp, 1);
TclEmitOpcode( INST_DUP, envPtr);
TclEmitOpcode( INST_LOAD_STK, envPtr);
PushStringLiteral(envPtr, "");
@@ -1963,13 +1951,13 @@ TclCompileDictWithCmd(
*/
if (dictVar == -1) {
CompileWord(envPtr, varTokenPtr, interp, 0);
CompileWord(envPtr, varTokenPtr, interp, 1);
Emit14Inst( INST_STORE_SCALAR, varNameTmp, envPtr);
}
tokenPtr = TokenAfter(varTokenPtr);
if (gotPath) {
for (i=2 ; i<parsePtr->numWords-1 ; i++) {
CompileWord(envPtr, tokenPtr, interp, i-1);
CompileWord(envPtr, tokenPtr, interp, i);
tokenPtr = TokenAfter(tokenPtr);
}
TclEmitInstInt4( INST_LIST, parsePtr->numWords-3,envPtr);
@@ -1998,8 +1986,7 @@ TclCompileDictWithCmd(
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
SetLineInformation(parsePtr->numWords-1);
CompileBody(envPtr, tokenPtr, interp);
BODY(tokenPtr, parsePtr->numWords - 1);
ExceptionRangeEnds(envPtr, range);
/*
@@ -2046,7 +2033,7 @@ TclCompileDictWithCmd(
} else {
TclEmitInstInt4( INST_DICT_RECOMBINE_IMM, dictVar, envPtr);
}
TclEmitOpcode( INST_RETURN_STK, envPtr);
TclEmitInvoke(envPtr, INST_RETURN_STK);
/*
* Prepare for the start of the next command.
@@ -2148,19 +2135,48 @@ TclCompileErrorCmd(
{
/*
* General syntax: [error message ?errorInfo? ?errorCode?]
* However, we only deal with the case where there is just a message.
*/
Tcl_Token *messageTokenPtr;
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
if (parsePtr->numWords != 2) {
if (parsePtr->numWords < 2 || parsePtr->numWords > 4) {
return TCL_ERROR;
}
messageTokenPtr = TokenAfter(parsePtr->tokenPtr);
PushStringLiteral(envPtr, "-code error -level 0");
CompileWord(envPtr, messageTokenPtr, interp, 1);
TclEmitOpcode(INST_RETURN_STK, envPtr);
/*
* Handle the message.
*/
tokenPtr = TokenAfter(parsePtr->tokenPtr);
CompileWord(envPtr, tokenPtr, interp, 1);
/*
* Construct the options. Note that -code and -level are not here.
*/
if (parsePtr->numWords == 2) {
PushStringLiteral(envPtr, "");
} else {
PushStringLiteral(envPtr, "-errorinfo");
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, 2);
if (parsePtr->numWords == 3) {
TclEmitInstInt4( INST_LIST, 2, envPtr);
} else {
PushStringLiteral(envPtr, "-errorcode");
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, 3);
TclEmitInstInt4( INST_LIST, 4, envPtr);
}
}
/*
* Issue the error via 'returnImm error 0'.
*/
TclEmitInstInt4( INST_RETURN_IMM, TCL_ERROR, envPtr);
TclEmitInt4( 0, envPtr);
return TCL_OK;
}
@@ -2238,9 +2254,8 @@ TclCompileForCmd(
{
Tcl_Token *startTokenPtr, *testTokenPtr, *nextTokenPtr, *bodyTokenPtr;
JumpFixup jumpEvalCondFixup;
int testCodeOffset, bodyCodeOffset, nextCodeOffset, jumpDist;
int bodyCodeOffset, nextCodeOffset, jumpDist;
int bodyRange, nextRange;
int savedStackDepth = envPtr->currStackDepth;
DefineLineInformation; /* TIP #280 */
if (parsePtr->numWords != 5) {
@@ -2275,8 +2290,7 @@ TclCompileForCmd(
* Inline compile the initial command.
*/
SetLineInformation(1);
CompileBody(envPtr, startTokenPtr, interp);
BODY(startTokenPtr, 1);
TclEmitOpcode(INST_POP, envPtr);
/*
@@ -2299,10 +2313,8 @@ TclCompileForCmd(
bodyRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
bodyCodeOffset = ExceptionRangeStarts(envPtr, bodyRange);
SetLineInformation(4);
CompileBody(envPtr, bodyTokenPtr, interp);
BODY(bodyTokenPtr, 4);
ExceptionRangeEnds(envPtr, bodyRange);
envPtr->currStackDepth = savedStackDepth + 1;
TclEmitOpcode(INST_POP, envPtr);
/*
@@ -2313,33 +2325,23 @@ TclCompileForCmd(
nextRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
envPtr->exceptAuxArrayPtr[nextRange].supportsContinue = 0;
envPtr->currStackDepth = savedStackDepth;
nextCodeOffset = ExceptionRangeStarts(envPtr, nextRange);
SetLineInformation(3);
CompileBody(envPtr, nextTokenPtr, interp);
BODY(nextTokenPtr, 3);
ExceptionRangeEnds(envPtr, nextRange);
envPtr->currStackDepth = savedStackDepth + 1;
TclEmitOpcode(INST_POP, envPtr);
envPtr->currStackDepth = savedStackDepth;
/*
* Compile the test expression then emit the conditional jump that
* terminates the for.
*/
testCodeOffset = CurrentOffset(envPtr);
jumpDist = testCodeOffset - jumpEvalCondFixup.codeOffset;
if (TclFixupForwardJump(envPtr, &jumpEvalCondFixup, jumpDist, 127)) {
if (TclFixupForwardJumpToHere(envPtr, &jumpEvalCondFixup, 127)) {
bodyCodeOffset += 3;
nextCodeOffset += 3;
testCodeOffset += 3;
}
SetLineInformation(2);
envPtr->currStackDepth = savedStackDepth;
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
envPtr->currStackDepth = savedStackDepth + 1;
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
if (jumpDist > 127) {
@@ -2367,7 +2369,6 @@ TclCompileForCmd(
* The for command's result is an empty string.
*/
envPtr->currStackDepth = savedStackDepth;
PushStringLiteral(envPtr, "");
return TCL_OK;
@@ -2478,9 +2479,8 @@ CompileEachloopCmd(
Tcl_Token *tokenPtr, *bodyTokenPtr;
unsigned char *jumpPc;
JumpFixup jumpFalseFixup;
int jumpBackDist, jumpBackOffset, infoIndex, range, bodyIndex;
int jumpBackDist, jumpBackOffset, infoIndex, range;
int numWords, numLists, numVars, loopIndex, tempVar, i, j, code;
int savedStackDepth = envPtr->currStackDepth;
DefineLineInformation; /* TIP #280 */
/*
@@ -2519,8 +2519,6 @@ CompileEachloopCmd(
return TCL_ERROR;
}
bodyIndex = i-1;
/*
* Allocate storage for the varcList and varvList arrays if necessary.
*/
@@ -2559,7 +2557,7 @@ CompileEachloopCmd(
Tcl_DStringInit(&varList);
TclDStringAppendToken(&varList, &tokenPtr[1]);
code = Tcl_SplitList(interp, Tcl_DStringValue(&varList),
code = Tcl_SplitList(NULL, Tcl_DStringValue(&varList),
&varcList[loopIndex], &varvList[loopIndex]);
Tcl_DStringFree(&varList);
if (code != TCL_OK) {
@@ -2661,8 +2659,7 @@ CompileEachloopCmd(
i < numWords-1;
i++, tokenPtr = TokenAfter(tokenPtr)) {
if ((i%2 == 0) && (i > 0)) {
SetLineInformation(i);
CompileTokens(envPtr, tokenPtr, interp);
CompileWord(envPtr, tokenPtr, interp, i);
tempVar = (firstValueTemp + loopIndex);
Emit14Inst( INST_STORE_SCALAR, tempVar, envPtr);
TclEmitOpcode( INST_POP, envPtr);
@@ -2699,11 +2696,9 @@ CompileEachloopCmd(
* Inline compile the loop body.
*/
SetLineInformation(bodyIndex);
ExceptionRangeStarts(envPtr, range);
CompileBody(envPtr, bodyTokenPtr, interp);
BODY(bodyTokenPtr, numWords - 1);
ExceptionRangeEnds(envPtr, range);
envPtr->currStackDepth = savedStackDepth + 1;
if (collect == TCL_EACH_COLLECT) {
Emit14Inst( INST_LAPPEND_SCALAR, collectVar,envPtr);
@@ -2763,7 +2758,6 @@ CompileEachloopCmd(
* list of results from evaluating the loop body.
*/
envPtr->currStackDepth = savedStackDepth;
if (collect == TCL_EACH_COLLECT) {
Emit14Inst( INST_LOAD_SCALAR, collectVar, envPtr);
TclEmitInstInt1(INST_UNSET_SCALAR, 0, envPtr);
@@ -2771,7 +2765,6 @@ CompileEachloopCmd(
} else {
PushStringLiteral(envPtr, "");
}
envPtr->currStackDepth = savedStackDepth + 1;
done:
for (loopIndex = 0; loopIndex < numLists; loopIndex++) {
@@ -3006,7 +2999,8 @@ TclCompileFormatCmd(
ckfree(objv);
Tcl_DecrRefCount(formatObj);
if (tmpObj == NULL) {
return TCL_ERROR;
TclCompileSyntaxError(interp, envPtr);
return TCL_OK;
}
/*
@@ -3184,10 +3178,7 @@ TclPushVarName(
CompileEnv *envPtr, /* Holds resulting instructions. */
int flags, /* TCL_NO_LARGE_INDEX | TCL_NO_ELEMENT. */
int *localIndexPtr, /* Must not be NULL. */
int *isScalarPtr, /* Must not be NULL. */
int line, /* Line the token starts on. */
int *clNext) /* Reference to offset of next hidden cont.
* line. */
int *isScalarPtr) /* Must not be NULL. */
{
register const char *p;
const char *name, *elName;
@@ -3367,8 +3358,6 @@ TclPushVarName(
if (elName != NULL && !(flags & TCL_NO_ELEMENT)) {
if (elNameChars) {
envPtr->line = line;
envPtr->clNext = clNext;
TclCompileTokens(interp, elemTokenPtr, elemTokenCount,
envPtr);
} else {
@@ -3380,8 +3369,6 @@ TclPushVarName(
* The var name isn't simple: compile and push it.
*/
envPtr->line = line;
envPtr->clNext = clNext;
CompileTokens(envPtr, varTokenPtr, interp);
}
+53 -36
View File
@@ -60,6 +60,7 @@ TclCompileGlobalCmd(
int localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
if (numWords < 2) {
return TCL_ERROR;
@@ -84,14 +85,17 @@ TclCompileGlobalCmd(
*/
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
for (i=2; i<=numWords; varTokenPtr = TokenAfter(varTokenPtr),i++) {
for (i=1; i<numWords; varTokenPtr = TokenAfter(varTokenPtr),i++) {
localIndex = IndexTailVarIfKnown(interp, varTokenPtr, envPtr);
if (localIndex < 0) {
return TCL_ERROR;
}
CompileWord(envPtr, varTokenPtr, interp, 1);
/* TODO: Consider what value can pass throug the
* IndexTailVarIfKnown() screen. Full CompileWord()
* likely does not apply here. Push known value instead. */
CompileWord(envPtr, varTokenPtr, interp, i);
TclEmitInstInt4( INST_NSUPVAR, localIndex, envPtr);
}
@@ -142,10 +146,6 @@ TclCompileIfCmd(
int jumpIndex = 0; /* Avoid compiler warning. */
int jumpFalseDist, numWords, wordIdx, numBytes, j, code;
const char *word;
int savedStackDepth = envPtr->currStackDepth;
/* Saved stack depth at the start of the first
* test; the envPtr current depth is restored
* to this value at the start of each test. */
int realCond = 1; /* Set to 0 for static conditions:
* "if 0 {..}" */
int boolVal; /* Value of static condition. */
@@ -203,7 +203,6 @@ TclCompileIfCmd(
* the "then" part.
*/
envPtr->currStackDepth = savedStackDepth;
testTokenPtr = tokenPtr;
if (realCond) {
@@ -269,9 +268,7 @@ TclCompileIfCmd(
*/
if (compileScripts) {
SetLineInformation(wordIdx);
envPtr->currStackDepth = savedStackDepth;
CompileBody(envPtr, tokenPtr, interp);
BODY(tokenPtr, wordIdx);
}
if (realCond) {
@@ -295,6 +292,7 @@ TclCompileIfCmd(
* with a 4 byte jump.
*/
TclAdjustStackDepth(-1, envPtr);
if (TclFixupForwardJumpToHere(envPtr,
jumpFalseFixupArray.fixup+jumpIndex, 120)) {
/*
@@ -324,13 +322,6 @@ TclCompileIfCmd(
wordIdx++;
}
/*
* Restore the current stack depth in the environment; the "else" clause
* (or its default) will add 1 to this.
*/
envPtr->currStackDepth = savedStackDepth;
/*
* Check for the optional else clause. Do not compile anything if this was
* an "if 1 {...}" case.
@@ -357,8 +348,7 @@ TclCompileIfCmd(
* Compile the else command body.
*/
SetLineInformation(wordIdx);
CompileBody(envPtr, tokenPtr, interp);
BODY(tokenPtr, wordIdx);
}
/*
@@ -416,7 +406,6 @@ TclCompileIfCmd(
*/
done:
envPtr->currStackDepth = savedStackDepth + 1;
TclFreeJumpFixupArray(&jumpFalseFixupArray);
TclFreeJumpFixupArray(&jumpEndFixupArray);
return code;
@@ -598,6 +587,7 @@ TclCompileInfoCommandsCmd(
* that the result needs to be list-ified.
*/
/* TODO: Just push the known value */
CompileWord(envPtr, tokenPtr, interp, 1);
TclEmitOpcode( INST_RESOLVE_COMMAND, envPtr);
TclEmitOpcode( INST_DUP, envPtr);
@@ -714,8 +704,7 @@ TclCompileInfoLevelCmd(
* list of arguments.
*/
SetLineInformation(1);
CompileTokens(envPtr, TokenAfter(parsePtr->tokenPtr), interp);
CompileWord(envPtr, TokenAfter(parsePtr->tokenPtr), interp, 1);
TclEmitOpcode( INST_INFO_LEVEL_ARGS, envPtr);
}
return TCL_OK;
@@ -836,6 +825,7 @@ TclCompileLappendCmd(
return TCL_ERROR;
}
/* TODO: Consider support for compiling expanded args. */
numWords = parsePtr->numWords;
if (numWords == 1) {
return TCL_ERROR;
@@ -1077,6 +1067,7 @@ TclCompileLindexCmd(
* Quit if too few args.
*/
/* TODO: Consider support for compiling expanded args. */
if (numWords <= 1) {
return TCL_ERROR;
}
@@ -1599,6 +1590,7 @@ TclCompileLsetCmd(
* Check argument count.
*/
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3) {
/*
* Fail at run time, not in compilation.
@@ -1911,13 +1903,13 @@ TclCompileNamespaceUpvarCmd(
*/
localTokenPtr = tokenPtr;
for (i=3; i<=numWords; i+=2) {
for (i=2; i<numWords; i+=2) {
otherTokenPtr = TokenAfter(localTokenPtr);
localTokenPtr = TokenAfter(otherTokenPtr);
CompileWord(envPtr, otherTokenPtr, interp, 1);
CompileWord(envPtr, otherTokenPtr, interp, i);
PushVarNameWord(interp, localTokenPtr, envPtr, 0,
&localIndex, &isScalar, 1);
&localIndex, &isScalar, i+1);
if ((localIndex < 0) || !isScalar) {
return TCL_ERROR;
@@ -2375,7 +2367,7 @@ TclCompileReturnCmd(
CompileWord(envPtr, optsTokenPtr, interp, 2);
CompileWord(envPtr, msgTokenPtr, interp, 3);
TclEmitOpcode(INST_RETURN_STK, envPtr);
TclEmitInvoke(envPtr, INST_RETURN_STK);
return TCL_OK;
}
@@ -2389,6 +2381,10 @@ TclCompileReturnCmd(
* Scan through the return options. If any are unknown at compile time,
* there is no value in bytecompiling. Save the option values known in an
* objv array for merging into a return options dictionary.
*
* TODO: There is potential for improvement if all option keys are known
* at compile time and all option values relating to '-code' and '-level'
* are known at compile time.
*/
for (objc = 0; objc < numOptionWords; objc++) {
@@ -2396,7 +2392,7 @@ TclCompileReturnCmd(
Tcl_IncrRefCount(objv[objc]);
if (!TclWordKnownAtCompileTime(wordTokenPtr, objv[objc])) {
/*
* Non-literal, so punt to run-time.
* Non-literal, so punt to run-time assembly of the dictionary.
*/
for (; objc>=0 ; objc--) {
@@ -2517,7 +2513,7 @@ TclCompileReturnCmd(
* Issue the RETURN itself.
*/
TclEmitOpcode(INST_RETURN_STK, envPtr);
TclEmitInvoke(envPtr, INST_RETURN_STK);
return TCL_OK;
}
@@ -2529,6 +2525,23 @@ CompileReturnInternal(
int level,
Tcl_Obj *returnOpts)
{
if (level == 0 && (code == TCL_BREAK || code == TCL_CONTINUE)) {
ExceptionRange *rangePtr;
ExceptionAux *exceptAux;
rangePtr = TclGetInnermostExceptionRange(envPtr, code, &exceptAux);
if (rangePtr && rangePtr->type == LOOP_EXCEPTION_RANGE) {
TclCleanupStackForBreakContinue(envPtr, exceptAux);
if (code == TCL_BREAK) {
TclAddLoopBreakFixup(envPtr, exceptAux);
} else {
TclAddLoopContinueFixup(envPtr, exceptAux);
}
Tcl_DecrRefCount(returnOpts);
return;
}
}
TclEmitPush(TclAddLiteralObj(envPtr, returnOpts, NULL), envPtr);
TclEmitInstInt4(op, code, envPtr);
TclEmitInt4(level, envPtr);
@@ -2547,6 +2560,7 @@ TclCompileSyntaxError(
TclEmitPush(TclRegisterNewLiteral(envPtr, bytes, numBytes), envPtr);
CompileReturnInternal(envPtr, INST_SYNTAX, TCL_ERROR, 0,
TclNoErrorStack(interp, Tcl_GetReturnOptions(interp, TCL_ERROR)));
Tcl_ResetResult(interp);
}
/*
@@ -2579,16 +2593,14 @@ TclCompileUpvarCmd(
Tcl_Token *tokenPtr, *otherTokenPtr, *localTokenPtr;
int isScalar, localIndex, numWords, i;
DefineLineInformation; /* TIP #280 */
Tcl_Obj *objPtr = Tcl_NewObj();
Tcl_Obj *objPtr;
if (envPtr->procPtr == NULL) {
Tcl_DecrRefCount(objPtr);
return TCL_ERROR;
}
numWords = parsePtr->numWords;
if (numWords < 3) {
Tcl_DecrRefCount(objPtr);
return TCL_ERROR;
}
@@ -2596,6 +2608,7 @@ TclCompileUpvarCmd(
* Push the frame index if it is known at compile time
*/
objPtr = Tcl_NewObj();
tokenPtr = TokenAfter(parsePtr->tokenPtr);
if (TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
CallFrame *framePtr;
@@ -2614,16 +2627,17 @@ TclCompileUpvarCmd(
if (numWords%2) {
return TCL_ERROR;
}
/* TODO: Push the known value instead? */
CompileWord(envPtr, tokenPtr, interp, 1);
otherTokenPtr = TokenAfter(tokenPtr);
i = 4;
i = 2;
} else {
if (!(numWords%2)) {
return TCL_ERROR;
}
PushStringLiteral(envPtr, "1");
otherTokenPtr = tokenPtr;
i = 3;
i = 1;
}
} else {
Tcl_DecrRefCount(objPtr);
@@ -2636,12 +2650,12 @@ TclCompileUpvarCmd(
* be called at runtime.
*/
for (; i<=numWords; i+=2, otherTokenPtr = TokenAfter(localTokenPtr)) {
for (; i<numWords; i+=2, otherTokenPtr = TokenAfter(localTokenPtr)) {
localTokenPtr = TokenAfter(otherTokenPtr);
CompileWord(envPtr, otherTokenPtr, interp, 1);
CompileWord(envPtr, otherTokenPtr, interp, i);
PushVarNameWord(interp, localTokenPtr, envPtr, 0,
&localIndex, &isScalar, 1);
&localIndex, &isScalar, i+1);
if ((localIndex < 0) || !isScalar) {
return TCL_ERROR;
@@ -2717,6 +2731,9 @@ TclCompileVariableCmd(
return TCL_ERROR;
}
/* TODO: Consider what value can pass throug the
* IndexTailVarIfKnown() screen. Full CompileWord()
* likely does not apply here. Push known value instead. */
CompileWord(envPtr, varTokenPtr, interp, i);
TclEmitInstInt4( INST_VARIABLE, localIndex, envPtr);
+160 -170
View File
@@ -40,17 +40,14 @@ static int CompileUnaryOpCmd(Tcl_Interp *interp,
Tcl_Parse *parsePtr, int instruction,
CompileEnv *envPtr);
static void IssueSwitchChainedTests(Tcl_Interp *interp,
CompileEnv *envPtr, ExtCmdLoc *mapPtr,
int eclIndex, int mode, int noCase,
int valueIndex, Tcl_Token *valueTokenPtr,
int numWords, Tcl_Token **bodyToken,
int *bodyLines, int **bodyNext);
static void IssueSwitchJumpTable(Tcl_Interp *interp,
CompileEnv *envPtr, ExtCmdLoc *mapPtr,
int eclIndex, int valueIndex,
Tcl_Token *valueTokenPtr, int numWords,
CompileEnv *envPtr, int mode, int noCase,
int valueIndex, int numWords,
Tcl_Token **bodyToken, int *bodyLines,
int **bodyContLines);
int **bodyNext);
static void IssueSwitchJumpTable(Tcl_Interp *interp,
CompileEnv *envPtr, int valueIndex,
int numWords, Tcl_Token **bodyToken,
int *bodyLines, int **bodyContLines);
static int IssueTryClausesInstructions(Tcl_Interp *interp,
CompileEnv *envPtr, Tcl_Token *bodyToken,
int numHandlers, int *matchCodes,
@@ -88,8 +85,6 @@ const AuxDataType tclJumptableInfoType = {
TclEmitInstInt1(INST_##name,(val1),envPtr);TclEmitInt4((val2),envPtr)
#define OP44(name,val1,val2) \
TclEmitInstInt4(INST_##name,(val1),envPtr);TclEmitInt4((val2),envPtr)
#define BODY(token,index) \
SetLineInformation((index));CompileBody(envPtr,(token),interp)
#define PUSH(str) \
PushStringLiteral(envPtr, str)
#define JUMP4(name,var) \
@@ -104,6 +99,8 @@ const AuxDataType tclJumptableInfoType = {
if ((idx)<256) {OP1(LOAD_SCALAR1,(idx));} else {OP4(LOAD_SCALAR4,(idx));}
#define STORE(idx) \
if ((idx)<256) {OP1(STORE_SCALAR1,(idx));} else {OP4(STORE_SCALAR4,(idx));}
#define INVOKE(name) \
TclEmitInvoke(envPtr,INST_##name)
/*
*----------------------------------------------------------------------
@@ -748,6 +745,9 @@ TclSubstCompile(
Tcl_InterpState state = NULL;
TclSubstParse(interp, bytes, numBytes, flags, &parse, &state);
if (state != NULL) {
Tcl_ResetResult(interp);
}
/*
* Tricky point! If the first token does not result in a *guaranteed* push
@@ -865,6 +865,7 @@ TclSubstCompile(
/* Substitution produced TCL_OK */
OP( END_CATCH);
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &okFixup);
TclAdjustStackDepth(-1, envPtr);
/* Exceptional return codes processed here */
ExceptionRangeTarget(envPtr, catchRange, catchOffset);
@@ -874,7 +875,7 @@ TclSubstCompile(
OP( END_CATCH);
OP( RETURN_CODE_BRANCH);
/* ERROR -> reraise it */
/* ERROR -> reraise it; NB: can't require BREAK/CONTINUE handling */
OP( RETURN_STK);
OP( NOP);
@@ -890,6 +891,7 @@ TclSubstCompile(
/* OTHER */
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &otherFixup);
TclAdjustStackDepth(1, envPtr);
/* BREAK destination */
if (TclFixupForwardJumpToHere(envPtr, &breakFixup, 127)) {
Tcl_Panic("TclCompileSubstCmd: bad break jump distance %d",
@@ -905,6 +907,7 @@ TclSubstCompile(
OP1(JUMP1, -breakJump);
}
TclAdjustStackDepth(2, envPtr);
/* CONTINUE destination */
if (TclFixupForwardJumpToHere(envPtr, &continueFixup, 127)) {
Tcl_Panic("TclCompileSubstCmd: bad continue jump distance %d",
@@ -914,6 +917,7 @@ TclSubstCompile(
OP( POP);
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, &endFixup);
TclAdjustStackDepth(2, envPtr);
/* RETURN + other destination */
if (TclFixupForwardJumpToHere(envPtr, &returnFixup, 127)) {
Tcl_Panic("TclCompileSubstCmd: bad return jump distance %d",
@@ -931,17 +935,6 @@ TclSubstCompile(
OP4( REVERSE, 2);
OP( POP);
/*
* We've emitted several POP instructions, and the automatic
* computations for stack depth requirements have been decrementing
* for every one. However, we know that every branch actually taken
* only encounters some of those instructions. No branch passes
* through them all. So, we now have a stack requirements estimate
* that is too low. Here we manually fix that up.
*/
TclAdjustStackDepth(4, envPtr);
/* OK destination */
if (TclFixupForwardJumpToHere(envPtr, &okFixup, 127)) {
Tcl_Panic("TclCompileSubstCmd: bad ok jump distance %d",
@@ -1000,9 +993,6 @@ TclSubstCompile(
* Instructions are added to envPtr to execute the "switch" command at
* runtime.
*
* FIXME:
* Stack depths are probably not calculated correctly.
*
*----------------------------------------------------------------------
*/
@@ -1293,13 +1283,15 @@ TclCompileSwitchCmd(
* but it handles the most common case well enough.
*/
/* Both methods push the value to match against onto the stack. */
CompileWord(envPtr, valueTokenPtr, interp, valueIndex);
if (mode == Switch_Exact) {
IssueSwitchJumpTable(interp, envPtr, mapPtr, eclIndex, valueIndex,
valueTokenPtr, numWords, bodyToken, bodyLines, bodyContLines);
IssueSwitchJumpTable(interp, envPtr, valueIndex, numWords, bodyToken,
bodyLines, bodyContLines);
} else {
IssueSwitchChainedTests(interp, envPtr, mapPtr, eclIndex, mode,noCase,
valueIndex, valueTokenPtr, numWords, bodyToken, bodyLines,
bodyContLines);
IssueSwitchChainedTests(interp, envPtr, mode, noCase, valueIndex,
numWords, bodyToken, bodyLines, bodyContLines);
}
result = TCL_OK;
@@ -1337,13 +1329,9 @@ static void
IssueSwitchChainedTests(
Tcl_Interp *interp, /* Context for compiling script bodies. */
CompileEnv *envPtr, /* Holds resulting instructions. */
ExtCmdLoc *mapPtr, /* For mapping tokens to their source code
* location. */
int eclIndex,
int mode, /* Exact, Glob or Regexp */
int noCase, /* Case-insensitivity flag. */
int valueIndex, /* The value to match against. */
Tcl_Token *valueTokenPtr,
int numBodyTokens, /* Number of tokens describing things the
* switch can match against and bodies to
* execute when the match succeeds. */
@@ -1353,7 +1341,6 @@ IssueSwitchChainedTests(
int **bodyContLines) /* Array of continuation line info. */
{
enum {Switch_Exact, Switch_Glob, Switch_Regexp};
int savedStackDepth = envPtr->currStackDepth;
int foundDefault; /* Flag to indicate whether a "default" clause
* is present. */
JumpFixup *fixupArray; /* Array of forward-jump fixup records. */
@@ -1368,13 +1355,6 @@ IssueSwitchChainedTests(
int simple, exact; /* For extracting the type of regexp. */
int i;
/*
* First, we push the value we're matching against on the stack.
*/
SetLineInformation(valueIndex);
CompileTokens(envPtr, valueTokenPtr, interp);
/*
* Generate a test for each arm.
*/
@@ -1388,7 +1368,6 @@ IssueSwitchChainedTests(
foundDefault = 0;
for (i=0 ; i<numBodyTokens ; i+=2) {
nextArmFixupIndex = -1;
envPtr->currStackDepth = savedStackDepth + 1;
if (i!=numBodyTokens-2 || bodyToken[numBodyTokens-2]->size != 7 ||
memcmp(bodyToken[numBodyTokens-2]->start, "default", 7)) {
/*
@@ -1519,13 +1498,12 @@ IssueSwitchChainedTests(
}
/*
* Now do the actual compilation. Note that we do not use CompileBody
* Now do the actual compilation. Note that we do not use BODY()
* because we may have synthesized the tokens in a non-standard
* pattern.
*/
OP( POP);
envPtr->currStackDepth = savedStackDepth;
envPtr->line = bodyLines[i+1]; /* TIP #280 */
envPtr->clNext = bodyContLines[i+1]; /* TIP #280 */
TclCompileCmdWord(interp, bodyToken[i+1], 1, envPtr);
@@ -1583,8 +1561,6 @@ IssueSwitchChainedTests(
}
TclStackFree(interp, fixupTargetArray);
TclStackFree(interp, fixupArray);
envPtr->currStackDepth = savedStackDepth + 1;
}
/*
@@ -1604,11 +1580,7 @@ static void
IssueSwitchJumpTable(
Tcl_Interp *interp, /* Context for compiling script bodies. */
CompileEnv *envPtr, /* Holds resulting instructions. */
ExtCmdLoc *mapPtr, /* For mapping tokens to their source code
* location. */
int eclIndex,
int valueIndex, /* The value to match against. */
Tcl_Token *valueTokenPtr,
int numBodyTokens, /* Number of tokens describing things the
* switch can match against and bodies to
* execute when the match succeeds. */
@@ -1618,19 +1590,11 @@ IssueSwitchJumpTable(
int **bodyContLines) /* Array of continuation line info. */
{
JumptableInfo *jtPtr;
int savedStackDepth = envPtr->currStackDepth;
int infoIndex, isNew, *finalFixups, numRealBodies = 0, jumpLocation;
int mustGenerate, foundDefault, jumpToDefault, i;
Tcl_DString buffer;
Tcl_HashEntry *hPtr;
/*
* First, we push the value we're matching against on the stack.
*/
SetLineInformation(valueIndex);
CompileTokens(envPtr, valueTokenPtr, interp);
/*
* Compile the switch by using a jump table, which is basically a
* hashtable that maps from literal values to match against to the offset
@@ -1731,7 +1695,6 @@ IssueSwitchJumpTable(
* Compile the body of the arm.
*/
envPtr->currStackDepth = savedStackDepth;
envPtr->line = bodyLines[i+1]; /* TIP #280 */
envPtr->clNext = bodyContLines[i+1]; /* TIP #280 */
TclCompileCmdWord(interp, bodyToken[i+1], 1, envPtr);
@@ -1753,6 +1716,7 @@ IssueSwitchJumpTable(
*/
OP4( JUMP4, 0);
TclAdjustStackDepth(-1, envPtr);
}
}
@@ -1763,7 +1727,6 @@ IssueSwitchJumpTable(
*/
if (!foundDefault) {
envPtr->currStackDepth = savedStackDepth;
TclStoreInt4AtPtr(CurrentOffset(envPtr)-jumpToDefault,
envPtr->codeStart+jumpToDefault+1);
PUSH("");
@@ -1784,7 +1747,6 @@ IssueSwitchJumpTable(
*/
TclStackFree(interp, finalFixups);
envPtr->currStackDepth = savedStackDepth + 1;
}
/*
@@ -1904,6 +1866,7 @@ TclCompileTailcallCmd(
}
/* make room for the nsObjPtr */
/* TODO: Doesn't this have to be a known value? */
CompileWord(envPtr, tokenPtr, interp, 0);
for (i=1 ; i<parsePtr->numWords ; i++) {
tokenPtr = TokenAfter(tokenPtr);
@@ -1942,9 +1905,9 @@ TclCompileThrowCmd(
{
DefineLineInformation; /* TIP #280 */
int numWords = parsePtr->numWords;
int savedStackDepth = envPtr->currStackDepth;
Tcl_Token *codeToken, *msgToken;
Tcl_Obj *objPtr;
int codeKnown, codeIsList, codeIsValid, len;
if (numWords != 3) {
return TCL_ERROR;
@@ -1954,77 +1917,66 @@ TclCompileThrowCmd(
TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
if (TclWordKnownAtCompileTime(codeToken, objPtr)) {
codeKnown = TclWordKnownAtCompileTime(codeToken, objPtr);
/*
* First we must emit the code to substitute the arguments. This
* must come first in case substitution raises errors.
*/
if (!codeKnown) {
CompileWord(envPtr, codeToken, interp, 1);
PUSH( "-errorcode");
}
CompileWord(envPtr, msgToken, interp, 2);
codeIsList = codeKnown && (TCL_OK ==
Tcl_ListObjLength(interp, objPtr, &len));
codeIsValid = codeIsList && (len != 0);
if (codeIsValid) {
Tcl_Obj *errPtr, *dictPtr;
const char *string;
int len;
/*
* The code is known at compilation time. This allows us to issue a
* very efficient sequence of instructions.
*/
if (Tcl_ListObjLength(interp, objPtr, &len) != TCL_OK) {
/*
* Must still do this; might generate an error when getting this
* "ignored" value prepared as an argument.
*/
CompileWord(envPtr, msgToken, interp, 2);
TclCompileSyntaxError(interp, envPtr);
Tcl_DecrRefCount(objPtr);
envPtr->currStackDepth = savedStackDepth + 1;
return TCL_OK;
}
if (len == 0) {
/*
* Must still do this; might generate an error when getting this
* "ignored" value prepared as an argument.
*/
CompileWord(envPtr, msgToken, interp, 2);
goto issueErrorForEmptyCode;
}
TclNewLiteralStringObj(errPtr, "-errorcode");
TclNewObj(dictPtr);
Tcl_DictObjPut(NULL, dictPtr, errPtr, objPtr);
Tcl_IncrRefCount(dictPtr);
string = Tcl_GetStringFromObj(dictPtr, &len);
CompileWord(envPtr, msgToken, interp, 2);
PushLiteral(envPtr, string, len);
TclDecrRefCount(dictPtr);
OP44( RETURN_IMM, 1, 0);
envPtr->currStackDepth = savedStackDepth + 1;
} else {
/*
* When the code token is not known at compilation time, we need to do
* a little bit more work. The main tricky bit here is that the error
* code has to be a list (a [throw] restriction) so we must emit extra
* instructions to enforce that condition.
*/
CompileWord(envPtr, codeToken, interp, 1);
PUSH( "-errorcode");
CompileWord(envPtr, msgToken, interp, 2);
OP4( REVERSE, 3);
OP( DUP);
OP( LIST_LENGTH);
OP1( JUMP_FALSE1, 16);
OP4( LIST, 2);
OP44( RETURN_IMM, 1, 0);
/*
* Generate an error for being an empty list. Can't leverage anything
* else to do this for us.
*/
issueErrorForEmptyCode:
PUSH( "type must be non-empty list");
PUSH( "");
OP44( RETURN_IMM, 1, 0);
TclEmitPush(TclAddLiteralObj(envPtr, dictPtr, NULL), envPtr);
}
envPtr->currStackDepth = savedStackDepth + 1;
TclDecrRefCount(objPtr);
/*
* Simpler bytecodes when we detect invalid arguments at compile time.
*/
if (codeKnown && !codeIsValid) {
OP( POP);
if (codeIsList) {
/* Must be an empty list */
goto issueErrorForEmptyCode;
}
TclCompileSyntaxError(interp, envPtr);
return TCL_OK;
}
if (!codeKnown) {
/*
* Argument validity checking has to be done by bytecode at
* run time.
*/
OP4( REVERSE, 3);
OP( DUP);
OP( LIST_LENGTH);
OP1( JUMP_FALSE1, 16);
OP4( LIST, 2);
OP44( RETURN_IMM, TCL_ERROR, 0);
TclAdjustStackDepth(2, envPtr);
OP( POP);
OP( POP);
OP( POP);
issueErrorForEmptyCode:
PUSH( "type must be non-empty list");
PUSH( "-errorcode {TCL OPERATION THROW BADEXCEPTION}");
}
OP44( RETURN_IMM, TCL_ERROR, 0);
return TCL_OK;
}
@@ -2074,8 +2026,7 @@ TclCompileTryCmd(
*/
DefineLineInformation; /* TIP #280 */
SetLineInformation(1);
CompileBody(envPtr, bodyToken, interp);
BODY(bodyToken, 1);
return TCL_OK;
}
@@ -2447,7 +2398,7 @@ IssueTryClausesInstructions(
TclAdjustStackDepth(-1, envPtr);
FIXJUMP1( dontChangeOptions);
OP4( REVERSE, 2);
OP( RETURN_STK);
INVOKE( RETURN_STK);
}
JUMP4( JUMP, addrsToFix[i]);
@@ -2466,7 +2417,7 @@ IssueTryClausesInstructions(
OP( POP);
LOAD( optionsVar);
LOAD( resultVar);
OP( RETURN_STK);
INVOKE( RETURN_STK);
/*
* Fix all the jumps from taken clauses to here (which is the end of the
@@ -2703,15 +2654,13 @@ IssueTryClausesFinallyInstructions(
/* Skip POP at end; can clean up with subsequent POP */
if (i+1 < numHandlers) {
OP( POP);
} else {
TclAdjustStackDepth(-1, envPtr);
}
endOfThisArm:
if (i+1 < numHandlers) {
JUMP4( JUMP, addrsToFix[i]);
TclAdjustStackDepth(1, envPtr);
}
TclAdjustStackDepth(1, envPtr);
if (matchClauses[i]) {
FIXJUMP4( notECJumpSource);
}
@@ -2777,7 +2726,7 @@ IssueTryClausesFinallyInstructions(
FIXJUMP1( finalOK);
LOAD( optionsVar);
LOAD( resultVar);
OP( RETURN_STK);
INVOKE( RETURN_STK);
return TCL_OK;
}
@@ -2836,7 +2785,7 @@ IssueTryFinallyInstructions(
OP1( JUMP1, 7);
FIXJUMP1( jumpOK);
OP4( REVERSE, 2);
OP( RETURN_STK);
INVOKE( RETURN_STK);
return TCL_OK;
}
@@ -2868,38 +2817,81 @@ TclCompileUnsetCmd(
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *varTokenPtr;
int isScalar, localIndex, numWords, flags, i;
Tcl_Obj *leadingWord;
int isScalar, localIndex, flags = 1, i, varCount = 0, haveFlags = 0;
DefineLineInformation; /* TIP #280 */
numWords = parsePtr->numWords-1;
flags = 1;
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
leadingWord = Tcl_NewObj();
if (numWords > 0 && TclWordKnownAtCompileTime(varTokenPtr, leadingWord)) {
int len;
const char *bytes = Tcl_GetStringFromObj(leadingWord, &len);
/* TODO: Consider support for compiling expanded args. */
if (len == 11 && !strncmp("-nocomplain", bytes, 11)) {
flags = 0;
varTokenPtr = TokenAfter(varTokenPtr);
numWords--;
} else if (len == 2 && !strncmp("--", bytes, 2)) {
varTokenPtr = TokenAfter(varTokenPtr);
numWords--;
/*
* Verify that all words - except the first non-option one - are known at
* compile time so that we can handle them without needing to do a nasty
* push/rotate. [Bug 3970f54c4e]
*/
for (i=1,varTokenPtr=parsePtr->tokenPtr ; i<parsePtr->numWords ; i++) {
Tcl_Obj *leadingWord = Tcl_NewObj();
varTokenPtr = TokenAfter(varTokenPtr);
if (!TclWordKnownAtCompileTime(varTokenPtr, leadingWord)) {
TclDecrRefCount(leadingWord);
/*
* We can tolerate non-trivial substitutions in the first variable
* to be unset. If a '--' or '-nocomplain' was present, anything
* goes in that one place! (All subsequent variable names must be
* constants since we don't want to have to push them all first.)
*/
if (varCount == 0) {
if (haveFlags) {
continue;
}
/*
* In fact, we're OK as long as we're the first argument *and*
* we provably don't start with a '-'. If that is true, then
* even if everything else is varying, we still can't be a
* flag. Otherwise we'll spill to runtime to place a limit on
* the trickiness.
*/
if (varTokenPtr->type == TCL_TOKEN_WORD
&& varTokenPtr[1].type == TCL_TOKEN_TEXT
&& varTokenPtr[1].size > 0
&& varTokenPtr[1].start[0] != '-') {
continue;
}
}
return TCL_ERROR;
}
} else {
/*
* Cannot guarantee that the first word is not '-nocomplain' at
* evaluation with reasonable effort, so spill to interpreted version.
*/
if (i == 1) {
const char *bytes;
int len;
bytes = Tcl_GetStringFromObj(leadingWord, &len);
if (len == 11 && !strncmp("-nocomplain", bytes, 11)) {
flags = 0;
haveFlags = 1;
} else if (len == 2 && !strncmp("--", bytes, 2)) {
haveFlags = 1;
} else {
varCount++;
}
} else {
varCount++;
}
TclDecrRefCount(leadingWord);
return TCL_ERROR;
}
TclDecrRefCount(leadingWord);
for (i=0 ; i<numWords ; i++) {
/*
* Issue instructions to unset each of the named variables.
*/
varTokenPtr = TokenAfter(parsePtr->tokenPtr);
if (haveFlags) {
varTokenPtr = TokenAfter(varTokenPtr);
}
for (i=1+haveFlags ; i<parsePtr->numWords ; i++) {
/*
* Decide if we can use a frame slot for the var/array name or if we
* need to emit code to compute and push the name at runtime. We use a
@@ -2909,7 +2901,7 @@ TclCompileUnsetCmd(
*/
PushVarNameWord(interp, varTokenPtr, envPtr, 0,
&localIndex, &isScalar, 1);
&localIndex, &isScalar, i);
/*
* Emit instructions to unset the variable.
@@ -2965,7 +2957,6 @@ TclCompileWhileCmd(
Tcl_Token *testTokenPtr, *bodyTokenPtr;
JumpFixup jumpEvalCondFixup;
int testCodeOffset, bodyCodeOffset, jumpDist, range, code, boolVal;
int savedStackDepth = envPtr->currStackDepth;
int loopMayEnd = 1; /* This is set to 0 if it is recognized as an
* infinite loop. */
Tcl_Obj *boolObj;
@@ -3057,15 +3048,13 @@ TclCompileWhileCmd(
* Compile the loop body.
*/
SetLineInformation(2);
bodyCodeOffset = ExceptionRangeStarts(envPtr, range);
if (!loopMayEnd) {
envPtr->exceptArrayPtr[range].continueOffset = testCodeOffset;
envPtr->exceptArrayPtr[range].codeOffset = bodyCodeOffset;
}
CompileBody(envPtr, bodyTokenPtr, interp);
BODY(bodyTokenPtr, 2);
ExceptionRangeEnds(envPtr, range);
envPtr->currStackDepth = savedStackDepth + 1;
OP( POP);
/*
@@ -3080,10 +3069,8 @@ TclCompileWhileCmd(
bodyCodeOffset += 3;
testCodeOffset += 3;
}
envPtr->currStackDepth = savedStackDepth;
SetLineInformation(1);
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
envPtr->currStackDepth = savedStackDepth + 1;
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
if (jumpDist > 127) {
@@ -3114,7 +3101,6 @@ TclCompileWhileCmd(
*/
pushResult:
envPtr->currStackDepth = savedStackDepth;
PUSH("");
return TCL_OK;
}
@@ -3233,6 +3219,7 @@ CompileAssociativeBinaryOpCmd(
DefineLineInformation; /* TIP #280 */
int words;
/* TODO: Consider support for compiling expanded args. */
for (words=1 ; words<parsePtr->numWords ; words++) {
tokenPtr = TokenAfter(tokenPtr);
CompileWord(envPtr, tokenPtr, interp, words);
@@ -3316,6 +3303,7 @@ CompileComparisonOpCmd(
Tcl_Token *tokenPtr;
DefineLineInformation; /* TIP #280 */
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords < 3) {
PUSH("1");
} else if (parsePtr->numWords == 3) {
@@ -3653,6 +3641,7 @@ TclCompileMinusOpCmd(
DefineLineInformation; /* TIP #280 */
int words;
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords == 1) {
/*
* Fallback to direct eval to report syntax error.
@@ -3698,6 +3687,7 @@ TclCompileDivOpCmd(
DefineLineInformation; /* TIP #280 */
int words;
/* TODO: Consider support for compiling expanded args. */
if (parsePtr->numWords == 1) {
/*
* Fallback to direct eval to report syntax error.
+43 -66
View File
@@ -490,13 +490,6 @@ typedef struct JumpList {
JumpFixup jump; /* Pass this argument to matching calls of
* TclEmitForwardJump() and
* TclFixupForwardJump(). */
int depth; /* Remember the currStackDepth of the
* CompileEnv here. */
int offset; /* Data used to compute jump lengths to pass
* to TclFixupForwardJump() */
int convert; /* Temporary storage used to compute whether
* numeric conversion will be needed following
* the operator we're compiling. */
struct JumpList *next; /* Point to next item on the stack */
} JumpList;
@@ -2261,30 +2254,8 @@ CompileExprTree(
if (nodePtr->mark == MARK_LEFT) {
next = nodePtr->left;
switch (nodePtr->lexeme) {
case QUESTION:
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
jumpPtr->depth = envPtr->currStackDepth;
if (nodePtr->lexeme == QUESTION) {
convert = 1;
break;
case AND:
case OR:
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
jumpPtr->depth = envPtr->currStackDepth;
break;
}
} else if (nodePtr->mark == MARK_RIGHT) {
next = nodePtr->right;
@@ -2317,25 +2288,35 @@ CompileExprTree(
break;
}
case QUESTION:
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpPtr->jump);
break;
case COLON:
CLANG_ASSERT(jumpPtr);
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP,
&jumpPtr->next->jump);
envPtr->currStackDepth = jumpPtr->depth;
jumpPtr->offset = (envPtr->codeNext - envPtr->codeStart);
jumpPtr->convert = convert;
&jumpPtr->jump);
TclAdjustStackDepth(-1, envPtr);
if (convert) {
jumpPtr->jump.jumpType = TCL_TRUE_JUMP;
}
convert = 1;
break;
case AND:
TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, &jumpPtr->jump);
break;
case OR:
TclEmitForwardJump(envPtr, TCL_TRUE_JUMP, &jumpPtr->jump);
newJump = TclStackAlloc(interp, sizeof(JumpList));
newJump->next = jumpPtr;
jumpPtr = newJump;
TclEmitForwardJump(envPtr, (nodePtr->lexeme == AND)
? TCL_FALSE_JUMP : TCL_TRUE_JUMP, &jumpPtr->jump);
break;
}
} else {
int pc1, pc2, target;
switch (nodePtr->lexeme) {
case START:
case QUESTION:
@@ -2354,9 +2335,9 @@ CompileExprTree(
*/
if (numWords < 255) {
TclEmitInstInt1(INST_INVOKE_STK1, numWords, envPtr);
TclEmitInvoke(envPtr, INST_INVOKE_STK1, numWords);
} else {
TclEmitInstInt4(INST_INVOKE_STK4, numWords, envPtr);
TclEmitInvoke(envPtr, INST_INVOKE_STK4, numWords);
}
/*
@@ -2375,18 +2356,20 @@ CompileExprTree(
break;
case COLON:
CLANG_ASSERT(jumpPtr);
if (TclFixupForwardJump(envPtr, &jumpPtr->next->jump,
(envPtr->codeNext - envPtr->codeStart)
- jumpPtr->next->jump.codeOffset, 127)) {
jumpPtr->offset += 3;
if (jumpPtr->jump.jumpType == TCL_TRUE_JUMP) {
jumpPtr->jump.jumpType = TCL_UNCONDITIONAL_JUMP;
convert = 1;
}
target = jumpPtr->jump.codeOffset + 2;
if (TclFixupForwardJumpToHere(envPtr, &jumpPtr->jump, 127)) {
target += 3;
}
TclFixupForwardJump(envPtr, &jumpPtr->jump,
jumpPtr->offset - jumpPtr->jump.codeOffset, 127);
convert |= jumpPtr->convert;
envPtr->currStackDepth = jumpPtr->depth + 1;
freePtr = jumpPtr;
jumpPtr = jumpPtr->next;
TclStackFree(interp, freePtr);
TclFixupForwardJump(envPtr, &jumpPtr->jump,
target - jumpPtr->jump.codeOffset, 127);
freePtr = jumpPtr;
jumpPtr = jumpPtr->next;
TclStackFree(interp, freePtr);
@@ -2394,29 +2377,24 @@ CompileExprTree(
case AND:
case OR:
CLANG_ASSERT(jumpPtr);
TclEmitForwardJump(envPtr, (nodePtr->lexeme == AND)
? TCL_FALSE_JUMP : TCL_TRUE_JUMP,
&jumpPtr->next->jump);
pc1 = CurrentOffset(envPtr);
TclEmitInstInt1((nodePtr->lexeme == AND) ? INST_JUMP_FALSE1
: INST_JUMP_TRUE1, 0, envPtr);
TclEmitPush(TclRegisterNewLiteral(envPtr,
(nodePtr->lexeme == AND) ? "1" : "0", 1), envPtr);
TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP,
&jumpPtr->next->next->jump);
TclFixupForwardJumpToHere(envPtr, &jumpPtr->next->jump, 127);
pc2 = CurrentOffset(envPtr);
TclEmitInstInt1(INST_JUMP1, 0, envPtr);
TclAdjustStackDepth(-1, envPtr);
TclStoreInt1AtPtr(CurrentOffset(envPtr) - pc1,
envPtr->codeStart + pc1 + 1);
if (TclFixupForwardJumpToHere(envPtr, &jumpPtr->jump, 127)) {
jumpPtr->next->next->jump.codeOffset += 3;
pc2 += 3;
}
TclEmitPush(TclRegisterNewLiteral(envPtr,
(nodePtr->lexeme == AND) ? "0" : "1", 1), envPtr);
TclFixupForwardJumpToHere(envPtr, &jumpPtr->next->next->jump,
127);
TclStoreInt1AtPtr(CurrentOffset(envPtr) - pc2,
envPtr->codeStart + pc2 + 1);
convert = 0;
envPtr->currStackDepth = jumpPtr->depth + 1;
freePtr = jumpPtr;
jumpPtr = jumpPtr->next;
TclStackFree(interp, freePtr);
freePtr = jumpPtr;
jumpPtr = jumpPtr->next;
TclStackFree(interp, freePtr);
freePtr = jumpPtr;
jumpPtr = jumpPtr->next;
TclStackFree(interp, freePtr);
@@ -2485,8 +2463,7 @@ CompileExprTree(
break;
}
case OT_TOKENS:
TclCompileTokens(interp, tokenPtr+1, tokenPtr->numComponents,
envPtr);
CompileTokens(envPtr, tokenPtr, interp);
tokenPtr += tokenPtr->numComponents + 1;
break;
default:
+623 -561
View File
File diff suppressed because it is too large Load Diff
+29 -28
View File
@@ -193,13 +193,6 @@ typedef struct ExtCmdLoc {
ECL *loc; /* Command word locations (lines). */
int nloc; /* Number of allocated entries in 'loc'. */
int nuloc; /* Number of used entries in 'loc'. */
Tcl_HashTable litInfo; /* Indexed by bytecode 'PC', to have the
* information accessible per command and
* argument, not per whole bytecode. Value is
* index of command in 'loc', giving us the
* literals to associate with line information
* as command argument, see
* TclArgumentBCEnter() */
} ExtCmdLoc;
/*
@@ -372,10 +365,6 @@ typedef struct CompileEnv {
* encountered that have not yet been paired
* with a corresponding
* INST_INVOKE_EXPANDED. */
ContLineLoc *clLoc; /* If not NULL, the table holding the
* locations of the invisible continuation
* lines in the input script, to adjust the
* line counter. */
int *clNext; /* If not NULL, it refers to the next slot in
* clLoc to check for an invisible
* continuation line. */
@@ -991,6 +980,9 @@ MODULE_SCOPE ByteCode * TclCompileObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
*----------------------------------------------------------------
*/
MODULE_SCOPE int TclAttemptCompileProc(Tcl_Interp *interp,
Tcl_Parse *parsePtr, int depth, Command *cmdPtr,
CompileEnv *envPtr);
MODULE_SCOPE void TclCleanupByteCode(ByteCode *codePtr);
MODULE_SCOPE void TclCleanupStackForBreakContinue(CompileEnv *envPtr,
ExceptionAux *auxPtr);
@@ -1002,6 +994,9 @@ MODULE_SCOPE void TclCompileExpr(Tcl_Interp *interp, const char *script,
MODULE_SCOPE void TclCompileExprWords(Tcl_Interp *interp,
Tcl_Token *tokenPtr, int numWords,
CompileEnv *envPtr);
MODULE_SCOPE void TclCompileInvocation(Tcl_Interp *interp,
Tcl_Token *tokenPtr, Tcl_Obj *cmdObj, int numWords,
CompileEnv *envPtr);
MODULE_SCOPE void TclCompileScript(Tcl_Interp *interp,
const char *script, int numBytes,
CompileEnv *envPtr);
@@ -1026,6 +1021,7 @@ MODULE_SCOPE void TclDeleteLiteralTable(Tcl_Interp *interp,
LiteralTable *tablePtr);
MODULE_SCOPE void TclEmitForwardJump(CompileEnv *envPtr,
TclJumpType jumpType, JumpFixup *jumpFixupPtr);
MODULE_SCOPE void TclEmitInvoke(CompileEnv *envPtr, int opcode, ...);
MODULE_SCOPE ExceptionRange * TclGetExceptionRangeForPc(unsigned char *pc,
int catchOnly, ByteCode *codePtr);
MODULE_SCOPE void TclExpandJumpFixupArray(JumpFixupArray *fixupArrayPtr);
@@ -1074,7 +1070,7 @@ MODULE_SCOPE void TclPrintSource(FILE *outFile,
MODULE_SCOPE void TclPushVarName(Tcl_Interp *interp,
Tcl_Token *varTokenPtr, CompileEnv *envPtr,
int flags, int *localIndexPtr,
int *isScalarPtr, int line, int *clNext);
int *isScalarPtr);
MODULE_SCOPE int TclRegisterLiteral(CompileEnv *envPtr,
char *bytes, int length, int flags);
MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr);
@@ -1114,6 +1110,15 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
*----------------------------------------------------------------
*/
/*
* Simplified form to access AuxData.
*
* ClientData TclFetchAuxData(CompileEng *envPtr, int index);
*/
#define TclFetchAuxData(envPtr, index) \
(envPtr)->auxDataArrayPtr[(index)].clientData
#define LITERAL_ON_HEAP 0x01
#define LITERAL_CMD_NAME 0x02
@@ -1407,16 +1412,16 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
#define TclMax(i, j) ((((int) i) > ((int) j))? (i) : (j))
/*
* Convenience macro for use when compiling bodies of commands. The ANSI C
* "prototype" for this macro is:
* Convenience macros for use when compiling bodies of commands. The ANSI C
* "prototype" for these macros are:
*
* static void CompileBody(CompileEnv *envPtr, Tcl_Token *tokenPtr,
* Tcl_Interp *interp);
* static void BODY(Tcl_Token *tokenPtr, int word);
*/
#define CompileBody(envPtr, tokenPtr, interp) \
TclCompileCmdWord((interp), (tokenPtr)+1, (tokenPtr)->numComponents, \
(envPtr))
#define BODY(tokenPtr, word) \
SetLineInformation((word)); \
TclCompileCmdWord(interp, (tokenPtr)+1, (tokenPtr)->numComponents, \
envPtr)
/*
* Convenience macro for use when compiling tokens to be pushed. The ANSI C
@@ -1515,13 +1520,10 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
#define CompileWord(envPtr, tokenPtr, interp, word) \
if ((tokenPtr)->type == TCL_TOKEN_SIMPLE_WORD) { \
TclEmitPush(TclRegisterNewLiteral((envPtr), (tokenPtr)[1].start, \
(tokenPtr)[1].size), (envPtr)); \
PushLiteral((envPtr), (tokenPtr)[1].start, (tokenPtr)[1].size); \
} else { \
envPtr->line = mapPtr->loc[eclIndex].line[word]; \
envPtr->clNext = mapPtr->loc[eclIndex].next[word]; \
TclCompileTokens((interp), (tokenPtr)+1, (tokenPtr)->numComponents, \
(envPtr)); \
SetLineInformation((word)); \
CompileTokens((envPtr), (tokenPtr), (interp)); \
}
/*
@@ -1542,9 +1544,8 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
envPtr->clNext = mapPtr->loc[eclIndex].next[(word)]
#define PushVarNameWord(i,v,e,f,l,sc,word) \
TclPushVarName(i,v,e,f,l,sc, \
mapPtr->loc[eclIndex].line[(word)], \
mapPtr->loc[eclIndex].next[(word)])
SetLineInformation(word); \
TclPushVarName(i,v,e,f,l,sc)
/*
* Often want to issue one of two versions of an instruction based on whether
+62 -51
View File
@@ -26,14 +26,15 @@
#define ASSOC_KEY "tclPackageAboutDict"
/*
* A ClientData struct for the QueryConfig command. Store the two bits
* A ClientData struct for the QueryConfig command. Store the three bits
* of data we need; the package name for which we store a config dict,
* and the (Tcl_Interp *) in which it is stored.
* the (Tcl_Interp *) in which it is stored, and the encoding.
*/
typedef struct QCCD {
Tcl_Obj *pkg;
Tcl_Interp *interp;
char *encoding;
} QCCD;
/*
@@ -75,22 +76,28 @@ Tcl_RegisterConfig(
const char *valEncoding) /* Name of the encoding used to store the
* configuration values, ASCII, thus UTF-8. */
{
Tcl_Obj *pDB, *pkgDict;
Tcl_DString cmdName;
const Tcl_Config *cfg;
Tcl_Encoding venc = Tcl_GetEncoding(NULL, valEncoding);
QCCD *cdPtr = ckalloc(sizeof(QCCD));
cdPtr->interp = interp;
if (valEncoding) {
cdPtr->encoding = ckalloc(strlen(valEncoding)+1);
strcpy(cdPtr->encoding, valEncoding);
} else {
cdPtr->encoding = NULL;
}
cdPtr->pkg = Tcl_NewStringObj(pkgName, -1);
/*
* Phase I: Adding the provided information to the internal database of
* package meta data. Only if we have an ok encoding.
* package meta data.
*
* Phase II: Create a command for querying this database, specific to the
* package registerting its configuration. This is the approved interface
* package registering its configuration. This is the approved interface
* in TIP 59. In the future a more general interface should be done, as
* followup to TIP 59. Simply because our database is now general across
* follow-up to TIP 59. Simply because our database is now general across
* packages, and not a structure tied to one package.
*
* Note, the created command will have a reference through its clientdata.
@@ -103,52 +110,36 @@ Tcl_RegisterConfig(
* dictionaries visible at Tcl level. I.e. they are not filled
*/
if (venc != NULL) {
Tcl_Obj *pkgDict, *pDB = GetConfigDict(interp);
pDB = GetConfigDict(interp);
/*
* Retrieve package specific configuration...
*/
/*
* Retrieve package specific configuration...
*/
if (Tcl_DictObjGet(interp, pDB, cdPtr->pkg, &pkgDict) != TCL_OK
|| (pkgDict == NULL)) {
pkgDict = Tcl_NewDictObj();
} else if (Tcl_IsShared(pkgDict)) {
pkgDict = Tcl_DuplicateObj(pkgDict);
}
/*
* Extend the package configuration...
*/
for (cfg=configuration ; cfg->key!=NULL && cfg->key[0]!='\0' ; cfg++) {
Tcl_DString conv;
const char *convValue =
Tcl_ExternalToUtfDString(venc, cfg->value, -1, &conv);
/*
* We know that the keys are in ASCII/UTF-8, so for them is no
* conversion required.
*/
Tcl_DictObjPut(interp, pkgDict, Tcl_NewStringObj(cfg->key, -1),
Tcl_NewStringObj(convValue, -1));
Tcl_DStringFree(&conv);
}
/*
* We're now done with the encoding, so drop it.
*/
Tcl_FreeEncoding(venc);
/*
* Write the changes back into the overall database.
*/
Tcl_DictObjPut(interp, pDB, cdPtr->pkg, pkgDict);
if (Tcl_DictObjGet(interp, pDB, cdPtr->pkg, &pkgDict) != TCL_OK
|| (pkgDict == NULL)) {
pkgDict = Tcl_NewDictObj();
} else if (Tcl_IsShared(pkgDict)) {
pkgDict = Tcl_DuplicateObj(pkgDict);
}
/*
* Extend the package configuration...
* We cannot assume that the encodings are initialized, therefore
* store the value as-is in a byte array. See Bug [9b2e636361].
*/
for (cfg=configuration ; cfg->key!=NULL && cfg->key[0]!='\0' ; cfg++) {
Tcl_DictObjPut(interp, pkgDict, Tcl_NewStringObj(cfg->key, -1),
Tcl_NewByteArrayObj((unsigned char *)cfg->value, strlen(cfg->value)));
}
/*
* Write the changes back into the overall database.
*/
Tcl_DictObjPut(interp, pDB, cdPtr->pkg, pkgDict);
/*
* Now create the interface command for retrieval of the package
* information.
@@ -218,6 +209,9 @@ QueryConfigObjCmd(
enum subcmds {
CFG_GET, CFG_LIST
};
Tcl_DString conv;
Tcl_Encoding venc = NULL;
const char *value;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "subcommand ?arg?");
@@ -257,7 +251,21 @@ QueryConfigObjCmd(
return TCL_ERROR;
}
Tcl_SetObjResult(interp, val);
if (cdPtr->encoding) {
venc = Tcl_GetEncoding(interp, cdPtr->encoding);
if (!venc) {
return TCL_ERROR;
}
}
/*
* Value is stored as-is in a byte array, see Bug [9b2e636361],
* so we have to decode it first.
*/
value = (const char *) Tcl_GetByteArrayFromObj(val, &n);
value = Tcl_ExternalToUtfDString(venc, value, n, &conv);
Tcl_SetObjResult(interp, Tcl_NewStringObj(value,
Tcl_DStringLength(&conv)));
Tcl_DStringFree(&conv);
return TCL_OK;
case CFG_LIST:
@@ -324,7 +332,10 @@ QueryConfigDelete(
Tcl_DictObjRemove(NULL, pDB, pkgName);
Tcl_DecrRefCount(pkgName);
ckfree(cdPtr);
if (cdPtr->encoding) {
ckfree((char *)cdPtr->encoding);
}
ckfree((char *)cdPtr);
}
/*
@@ -366,7 +377,7 @@ GetConfigDict(
*
* This function is associated with the "Package About dict" assoc data
* for an interpreter; it is invoked when the interpreter is deleted in
* order to free the information assoicated with any pending error
* order to free the information associated with any pending error
* reports.
*
* Results:
+1 -1
View File
@@ -2686,7 +2686,7 @@ TclDatelex(
location->first_column = yyInput - info->dateStart;
for ( ; ; ) {
while (isspace(UCHAR(*yyInput))) {
while (TclIsSpaceProc(*yyInput)) {
yyInput++;
}
+70 -129
View File
@@ -35,9 +35,6 @@ static void MakeCachedEnsembleCommand(Tcl_Obj *objPtr,
static void FreeEnsembleCmdRep(Tcl_Obj *objPtr);
static void DupEnsembleCmdRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr);
static void StringOfEnsembleCmdRep(Tcl_Obj *objPtr);
static int CompileToCompiledCommand(Tcl_Interp *interp,
Tcl_Parse *parsePtr, int depth, Command *cmdPtr,
CompileEnv *envPtr);
static void CompileToInvokedCommand(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Tcl_Obj *replacements,
Command *cmdPtr, CompileEnv *envPtr);
@@ -88,16 +85,6 @@ const Tcl_ObjType tclEnsembleCmdType = {
NULL /* setFromAnyProc */
};
/*
* Copied from tclCompCmds.c
*/
#define DefineLineInformation \
ExtCmdLoc *mapPtr = envPtr->extCmdMapPtr; \
int eclIndex = mapPtr->nuloc - 1
#define SetLineInformation(word) \
envPtr->line = mapPtr->loc[eclIndex].line[(word)]; \
envPtr->clNext = mapPtr->loc[eclIndex].next[(word)]
static inline Tcl_Obj *
NewNsObj(
@@ -1537,6 +1524,14 @@ TclMakeEnsemble(
cmdName = nameParts[nameCount - 1];
}
}
/*
* Switch on compilation always for core ensembles now that we can do
* nice bytecode things with them. Do it now. Waiting until later will
* just cause pointless epoch bumps.
*/
ensembleFlags |= ENSEMBLE_COMPILE;
ensemble = Tcl_CreateEnsemble(interp, cmdName, ns, ensembleFlags);
/*
@@ -1588,14 +1583,6 @@ TclMakeEnsemble(
}
}
Tcl_SetEnsembleMappingDict(interp, ensemble, mapDict);
/*
* Switch on compilation always for core ensembles now that we can do
* nice bytecode things with them.
*/
Tcl_SetEnsembleFlags(interp, ensemble,
ensembleFlags | ENSEMBLE_COMPILE);
}
Tcl_DStringFree(&buf);
@@ -3004,8 +2991,8 @@ TclCompileEnsemble(
*/
invokeAnyway = 1;
if (CompileToCompiledCommand(interp, parsePtr, depth, cmdPtr,
envPtr) == TCL_OK) {
if (TCL_OK == TclAttemptCompileProc(interp, parsePtr, depth, cmdPtr,
envPtr)) {
ourResult = TCL_OK;
goto cleanup;
}
@@ -3039,95 +3026,88 @@ TclCompileEnsemble(
return ourResult;
}
/*
* How to compile a subcommand using its own command compiler. To do that, we
* have to perform some trickery to rewrite the arguments, as compilers *must*
* have parse tokens that refer to addresses in the original script.
*/
static int
CompileToCompiledCommand(
int
TclAttemptCompileProc(
Tcl_Interp *interp,
Tcl_Parse *parsePtr,
int depth,
Command *cmdPtr,
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Parse synthetic;
Tcl_Token *tokenPtr;
int result, i;
int savedNumCmds = envPtr->numCommands;
Tcl_Token *saveTokenPtr = parsePtr->tokenPtr;
int savedStackDepth = envPtr->currStackDepth;
unsigned savedCodeNext = envPtr->codeNext - envPtr->codeStart;
DefineLineInformation;
if (cmdPtr->compileProc == NULL) {
return TCL_ERROR;
}
TclParseInit(interp, NULL, 0, &synthetic);
synthetic.numWords = parsePtr->numWords - depth + 1;
TclGrowParseTokenArray(&synthetic, 2);
synthetic.numTokens = 2;
/*
* Now we have the space to work in, install something rewritten. The
* first word will "officially" be the bytes of the structured ensemble
* name. That's technically wrong, but nobody will care; we just need
* *something* here...
* Advance parsePtr->tokenPtr so that it points at the last subcommand.
* This will be wrong, but it will not matter, and it will put the
* tokens for the arguments in the right place without the needed to
* allocate a synthetic Tcl_Parse struct, or copy tokens around.
*/
synthetic.tokenPtr[0].type = TCL_TOKEN_SIMPLE_WORD;
synthetic.tokenPtr[0].start = parsePtr->tokenPtr[0].start;
synthetic.tokenPtr[0].numComponents = 1;
synthetic.tokenPtr[1].type = TCL_TOKEN_TEXT;
synthetic.tokenPtr[1].start = parsePtr->tokenPtr[0].start;
synthetic.tokenPtr[1].numComponents = 0;
for (i=0,tokenPtr=parsePtr->tokenPtr ; i<depth ; i++) {
int sclen = (tokenPtr->start - synthetic.tokenPtr[0].start)
+ tokenPtr->size;
synthetic.tokenPtr[0].size = sclen;
synthetic.tokenPtr[1].size = sclen;
tokenPtr = TokenAfter(tokenPtr);
for (i = 0; i < depth - 1; i++) {
parsePtr->tokenPtr = TokenAfter(parsePtr->tokenPtr);
}
parsePtr->numWords -= (depth - 1);
/*
* Copy over the real argument tokens.
* Shift the line information arrays to account for different word
* index values.
*/
for (i=1; i<synthetic.numWords; i++) {
int toCopy;
toCopy = tokenPtr->numComponents + 1;
TclGrowParseTokenArray(&synthetic, toCopy);
memcpy(synthetic.tokenPtr + synthetic.numTokens, tokenPtr,
sizeof(Tcl_Token) * toCopy);
synthetic.numTokens += toCopy;
tokenPtr = TokenAfter(tokenPtr);
}
mapPtr->loc[eclIndex].line += (depth - 1);
mapPtr->loc[eclIndex].next += (depth - 1);
/*
* Hand off compilation to the subcommand compiler. At last!
*/
result = cmdPtr->compileProc(interp, &synthetic, cmdPtr, envPtr);
result = cmdPtr->compileProc(interp, parsePtr, cmdPtr, envPtr);
/*
* If our target fails to compile, revert the number of commands and the
* pointer to the place to issue the next instruction. [Bug 3600328]
* Undo the shift.
*/
mapPtr->loc[eclIndex].line -= (depth - 1);
mapPtr->loc[eclIndex].next -= (depth - 1);
parsePtr->numWords += (depth - 1);
parsePtr->tokenPtr = saveTokenPtr;
/*
* If our target failed to compile, revert any data from failed partial
* compiles. Note that envPtr->numCommands need not be checked because
* we avoid compiling subcommands that recursively call TclCompileScript().
*/
if (result != TCL_OK) {
envPtr->numCommands = savedNumCmds;
envPtr->currStackDepth = savedStackDepth;
envPtr->codeNext = envPtr->codeStart + savedCodeNext;
#ifdef TCL_COMPILE_DEBUG
} else {
/*
* Confirm that the command compiler generated a single value on
* the stack as its result. This is only done in debugging mode,
* as it *should* be correct and normal users have no reasonable
* way to fix it anyway.
*/
int diff = envPtr->currStackDepth - savedStackDepth;
if (diff != 1) {
Tcl_Panic("bad stack adjustment when compiling"
" %.*s (was %d instead of 1)", parsePtr->tokenPtr->size,
parsePtr->tokenPtr->start, diff);
}
#endif
}
/*
* Clean up if necessary.
*/
Tcl_FreeParse(&synthetic);
return result;
}
@@ -3157,11 +3137,16 @@ CompileToInvokedCommand(
*/
Tcl_ListObjGetElements(NULL, replacements, &numWords, &words);
for (i=0,tokPtr=parsePtr->tokenPtr ; i<parsePtr->numWords ; i++) {
for (i = 0, tokPtr = parsePtr->tokenPtr; i < parsePtr->numWords;
i++, tokPtr = TokenAfter(tokPtr)) {
if (i > 0 && i < numWords+1) {
bytes = Tcl_GetStringFromObj(words[i-1], &length);
PushLiteral(envPtr, bytes, length);
} else if (tokPtr->type == TCL_TOKEN_SIMPLE_WORD) {
continue;
}
SetLineInformation(i);
if (tokPtr->type == TCL_TOKEN_SIMPLE_WORD) {
int literal = TclRegisterNewLiteral(envPtr,
tokPtr[1].start, tokPtr[1].size);
@@ -3169,16 +3154,12 @@ CompileToInvokedCommand(
TclContinuationsEnterDerived(
TclFetchLiteral(envPtr, literal),
tokPtr[1].start - envPtr->source,
mapPtr->loc[eclIndex].next[i]);
envPtr->clNext);
}
TclEmitPush(literal, envPtr);
} else {
if (envPtr->clNext) {
SetLineInformation(i);
}
CompileTokens(envPtr, tokPtr, interp);
}
tokPtr = TokenAfter(tokPtr);
}
/*
@@ -3198,9 +3179,7 @@ CompileToInvokedCommand(
* Do the replacing dispatch.
*/
TclEmitInstInt4(INST_INVOKE_REPLACE, parsePtr->numWords, envPtr);
TclEmitInt1(numWords+1, envPtr);
TclAdjustStackDepth(-1, envPtr); /* Correction to stack depth calcs. */
TclEmitInvoke(envPtr, INST_INVOKE_REPLACE, parsePtr->numWords,numWords+1);
}
/*
@@ -3224,51 +3203,13 @@ CompileBasicNArgCommand(
* compiled. */
CompileEnv *envPtr) /* Holds resulting instructions. */
{
Tcl_Token *tokenPtr;
Tcl_Obj *objPtr;
char *bytes;
int length, i, literal;
DefineLineInformation;
Tcl_Obj *objPtr = Tcl_NewObj();
/*
* Push the name of the command we're actually dispatching to as part of
* the implementation.
*/
objPtr = Tcl_NewObj();
Tcl_IncrRefCount(objPtr);
Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, objPtr);
bytes = Tcl_GetStringFromObj(objPtr, &length);
literal = TclRegisterNewCmdLiteral(envPtr, bytes, length);
TclSetCmdNameObj(interp, TclFetchLiteral(envPtr, literal), cmdPtr);
TclEmitPush(literal, envPtr);
TclDecrRefCount(objPtr);
/*
* Push the words of the command.
*/
tokenPtr = TokenAfter(parsePtr->tokenPtr);
for (i=1 ; i<parsePtr->numWords ; i++) {
if (envPtr->clNext) {
SetLineInformation(i);
}
if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
PushLiteral(envPtr, tokenPtr[1].start, tokenPtr[1].size);
} else {
CompileTokens(envPtr, tokenPtr, interp);
}
tokenPtr = TokenAfter(tokenPtr);
}
/*
* Do the standard dispatch.
*/
if (i <= 255) {
TclEmitInstInt1(INST_INVOKE_STK1, i, envPtr);
} else {
TclEmitInstInt4(INST_INVOKE_STK4, i, envPtr);
}
TclCompileInvocation(interp, parsePtr->tokenPtr, objPtr,
parsePtr->numWords, envPtr);
Tcl_DecrRefCount(objPtr);
return TCL_OK;
}
+65 -16
View File
@@ -76,36 +76,56 @@ TclSetupEnv(
Tcl_Interp *interp) /* Interpreter whose "env" array is to be
* managed. */
{
Var *varPtr, *arrayPtr;
Tcl_Obj *varNamePtr;
Tcl_DString envString;
char *p1, *p2;
int i;
Tcl_HashTable namesHash;
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
/*
* Synchronize the values in the environ array with the contents of the
* Tcl "env" variable. To do this:
* 1) Remove the trace that fires when the "env" var is unset.
* 2) Unset the "env" variable.
* 3) If there are no environ variables, create an empty "env" array.
* Otherwise populate the array with current values.
* 4) Add a trace that synchronizes the "env" array.
* 1) Remove the trace that fires when the "env" var is updated.
* 2) Find the existing contents of the "env", storing in a hash table.
* 3) Create/update elements for each environ variable, removing
* elements from the hash table as we go.
* 4) Remove the elements for each remaining entry in the hash table,
* which must have existed before yet have no analog in the environ
* variable.
* 5) Add a trace that synchronizes the "env" array.
*/
Tcl_UntraceVar2(interp, "env", NULL,
TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS |
TCL_TRACE_READS | TCL_TRACE_ARRAY, EnvTraceProc, NULL);
Tcl_UnsetVar2(interp, "env", NULL, TCL_GLOBAL_ONLY);
/*
* Find out what elements are currently in the global env array.
*/
if (environ[0] == NULL) {
Tcl_Obj *varNamePtr;
TclNewLiteralStringObj(varNamePtr, "env");
Tcl_IncrRefCount(varNamePtr);
Tcl_InitObjHashTable(&namesHash);
varPtr = TclObjLookupVarEx(interp, varNamePtr, NULL, TCL_GLOBAL_ONLY,
/*msg*/ 0, /*createPart1*/ 0, /*createPart2*/ 0, &arrayPtr);
TclFindArrayPtrElements(varPtr, &namesHash);
/*
* Go through the environment array and transfer its values into Tcl. At
* the same time, remove those elements we add/update from the hash table
* of existing elements, so that after this part processes, that table
* will hold just the parts to remove.
*/
if (environ[0] != NULL) {
int i;
TclNewLiteralStringObj(varNamePtr, "env");
Tcl_IncrRefCount(varNamePtr);
TclArraySet(interp, varNamePtr, NULL);
Tcl_DecrRefCount(varNamePtr);
} else {
Tcl_MutexLock(&envMutex);
for (i = 0; environ[i] != NULL; i++) {
Tcl_Obj *obj1, *obj2;
char *p1, *p2;
p1 = Tcl_ExternalToUtfDString(NULL, environ[i], -1, &envString);
p2 = strchr(p1, '=');
if (p2 == NULL) {
@@ -119,12 +139,41 @@ TclSetupEnv(
}
p2++;
p2[-1] = '\0';
Tcl_SetVar2(interp, "env", p1, p2, TCL_GLOBAL_ONLY);
obj1 = Tcl_NewStringObj(p1, -1);
obj2 = Tcl_NewStringObj(p2, -1);
Tcl_DStringFree(&envString);
Tcl_IncrRefCount(obj1);
Tcl_IncrRefCount(obj2);
Tcl_ObjSetVar2(interp, varNamePtr, obj1, obj2, TCL_GLOBAL_ONLY);
hPtr = Tcl_FindHashEntry(&namesHash, obj1);
if (hPtr != NULL) {
Tcl_DeleteHashEntry(hPtr);
}
Tcl_DecrRefCount(obj1);
Tcl_DecrRefCount(obj2);
}
Tcl_MutexUnlock(&envMutex);
}
/*
* Delete those elements that existed in the array but which had no
* counterparts in the environment array.
*/
for (hPtr=Tcl_FirstHashEntry(&namesHash, &search); hPtr!=NULL;
hPtr=Tcl_NextHashEntry(&search)) {
Tcl_Obj *elemName = Tcl_GetHashValue(hPtr);
TclObjUnsetVar2(interp, varNamePtr, elemName, TCL_GLOBAL_ONLY);
}
Tcl_DeleteHashTable(&namesHash);
Tcl_DecrRefCount(varNamePtr);
/*
* Re-establish the trace.
*/
Tcl_TraceVar2(interp, "env", NULL,
TCL_GLOBAL_ONLY | TCL_TRACE_WRITES | TCL_TRACE_UNSETS |
TCL_TRACE_READS | TCL_TRACE_ARRAY, EnvTraceProc, NULL);
+2 -9
View File
@@ -1030,14 +1030,8 @@ TclInitSubsystems(void)
TclpInitLock();
if (subsystemsInitialized == 0) {
/*
* Have to set this bit here to avoid deadlock with the routines
* below us that call into TclInitSubsystems.
*/
subsystemsInitialized = 1;
/*
/*
* Initialize locks used by the memory allocators before anything
* interesting happens so we can use the allocators in the
* implementation of self-initializing locks.
@@ -1061,6 +1055,7 @@ TclInitSubsystems(void)
TclInitEncodingSubsystem(); /* Process wide encoding init. */
TclpSetInterfaces();
TclInitNamespaceSubsystem();/* Register ns obj type (mutexed). */
subsystemsInitialized = 1;
}
TclpInitUnlock();
}
@@ -1176,8 +1171,6 @@ Tcl_Finalize(void)
TclFinalizeEncodingSubsystem();
Tcl_SetPanicProc(NULL);
/*
* Repeat finalization of the thread local storage once more. Although
* this step is already done by the Tcl_FinalizeThread call above, series
+118 -70
View File
@@ -202,6 +202,9 @@ typedef struct TEBCdata {
#define PUSH_TAUX_OBJ(objPtr) \
do { \
if (auxObjList) { \
objPtr->length += auxObjList->length; \
} \
objPtr->internalRep.ptrAndLongRep.ptr = auxObjList; \
auxObjList = objPtr; \
} while (0)
@@ -290,12 +293,14 @@ VarHashCreateVar(
switch (nCleanup) { \
case 1: goto cleanup1_pushObjResultPtr; \
case 2: goto cleanup2_pushObjResultPtr; \
case 0: break; \
} \
} else { \
pc += (pcAdjustment); \
switch (nCleanup) { \
case 1: goto cleanup1; \
case 2: goto cleanup2; \
case 0: break; \
} \
} \
} while (0)
@@ -357,6 +362,8 @@ VarHashCreateVar(
#define CURR_DEPTH ((ptrdiff_t) (tosPtr - initTosPtr))
#define STACK_BASE(esPtr) ((esPtr)->stackWords - 1)
/*
* Macros used to trace instruction execution. The macros TRACE,
* TRACE_WITH_OBJ, and O2S are only used inside TclNRExecuteByteCode. O2S is
@@ -448,7 +455,7 @@ VarHashCreateVar(
(&((objPtr)->internalRep.doubleValue)), TCL_OK) : \
((((objPtr)->typePtr == NULL) && ((objPtr)->bytes == NULL)) || \
(((objPtr)->bytes != NULL) && ((objPtr)->length == 0))) \
? TCL_ERROR : \
? (*(tPtr) = TCL_NUMBER_LONG),TCL_ERROR : \
TclGetNumberFromObj((interp), (objPtr), (ptrPtr), (tPtr)))
#else /* !TCL_WIDE_INT_IS_LONG */
#define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \
@@ -468,7 +475,7 @@ VarHashCreateVar(
(&((objPtr)->internalRep.doubleValue)), TCL_OK) : \
((((objPtr)->typePtr == NULL) && ((objPtr)->bytes == NULL)) || \
(((objPtr)->bytes != NULL) && ((objPtr)->length == 0))) \
? TCL_ERROR : \
? (*(tPtr) = TCL_NUMBER_LONG),TCL_ERROR : \
TclGetNumberFromObj((interp), (objPtr), (ptrPtr), (tPtr)))
#endif /* TCL_WIDE_INT_IS_LONG */
@@ -718,7 +725,7 @@ static ExceptionRange * GetExceptRangeForPc(const unsigned char *pc,
int catchOnly, ByteCode *codePtr);
static const char * GetSrcInfoForPc(const unsigned char *pc,
ByteCode *codePtr, int *lengthPtr,
const unsigned char **pcBeg);
const unsigned char **pcBeg, int *cmdIdxPtr);
static Tcl_Obj ** GrowEvaluationStack(ExecEnv *eePtr, int growth,
int move);
static void IllegalExprOperandType(Tcl_Interp *interp,
@@ -882,7 +889,7 @@ TclCreateExecEnv(
esPtr->nextPtr = NULL;
esPtr->markerPtr = NULL;
esPtr->endPtr = &esPtr->stackWords[size-1];
esPtr->tosPtr = &esPtr->stackWords[-1];
esPtr->tosPtr = STACK_BASE(esPtr);
Tcl_MutexLock(&execMutex);
if (!execInitialized) {
@@ -1103,8 +1110,8 @@ GrowEvaluationStack(
if (esPtr->nextPtr) {
oldPtr = esPtr;
esPtr = oldPtr->nextPtr;
currElems = esPtr->endPtr - &esPtr->stackWords[-1];
if (esPtr->markerPtr || (esPtr->tosPtr != &esPtr->stackWords[-1])) {
currElems = esPtr->endPtr - STACK_BASE(esPtr);
if (esPtr->markerPtr || (esPtr->tosPtr != STACK_BASE(esPtr))) {
Tcl_Panic("STACK: Stack after current is in use");
}
if (esPtr->nextPtr) {
@@ -1116,7 +1123,7 @@ GrowEvaluationStack(
DeleteExecStack(esPtr);
esPtr = oldPtr;
} else {
currElems = esPtr->endPtr - &esPtr->stackWords[-1];
currElems = esPtr->endPtr - STACK_BASE(esPtr);
}
/*
@@ -1270,10 +1277,10 @@ TclStackFree(
while (esPtr->nextPtr) {
esPtr = esPtr->nextPtr;
}
esPtr->tosPtr = &esPtr->stackWords[-1];
esPtr->tosPtr = STACK_BASE(esPtr);
while (esPtr->prevPtr) {
ExecStack *tmpPtr = esPtr->prevPtr;
if (tmpPtr->tosPtr == &tmpPtr->stackWords[-1]) {
if (tmpPtr->tosPtr == STACK_BASE(tmpPtr)) {
DeleteExecStack(tmpPtr);
} else {
break;
@@ -1423,17 +1430,12 @@ Tcl_NRExprObj(
Tcl_Obj *resultPtr)
{
ByteCode *codePtr;
Tcl_InterpState state = Tcl_SaveInterpState(interp, TCL_OK);
/* TODO: consider saving whole state? */
Tcl_Obj *saveObjPtr = Tcl_GetObjResult(interp);
Tcl_IncrRefCount(saveObjPtr);
Tcl_ResetResult(interp);
codePtr = CompileExprObj(interp, objPtr);
/* TODO: Confirm reset not required? */
/*Tcl_ResetResult(interp);*/
Tcl_NRAddCallback(interp, ExprObjCallback, saveObjPtr, resultPtr,
Tcl_NRAddCallback(interp, ExprObjCallback, state, resultPtr,
NULL, NULL);
return TclNRExecuteByteCode(interp, codePtr);
}
@@ -1444,14 +1446,15 @@ ExprObjCallback(
Tcl_Interp *interp,
int result)
{
Tcl_Obj *saveObjPtr = data[0];
Tcl_InterpState state = data[0];
Tcl_Obj *resultPtr = data[1];
if (result == TCL_OK) {
TclSetDuplicateObj(resultPtr, Tcl_GetObjResult(interp));
Tcl_SetObjResult(interp, saveObjPtr);
(void) Tcl_RestoreInterpState(interp, state);
} else {
Tcl_DiscardInterpState(state);
}
TclDecrRefCount(saveObjPtr);
return result;
}
@@ -1999,7 +2002,6 @@ TclNRExecuteByteCode(
bcFramePtr->type = ((codePtr->flags & TCL_BYTECODE_PRECOMPILED)
? TCL_LOCATION_PREBC : TCL_LOCATION_BC);
bcFramePtr->level = (iPtr->cmdFramePtr ? iPtr->cmdFramePtr->level+1 : 1);
bcFramePtr->numLevels = iPtr->numLevels;
bcFramePtr->framePtr = iPtr->framePtr;
bcFramePtr->nextPtr = iPtr->cmdFramePtr;
bcFramePtr->nline = 0;
@@ -2007,8 +2009,9 @@ TclNRExecuteByteCode(
bcFramePtr->litarg = NULL;
bcFramePtr->data.tebc.codePtr = codePtr;
bcFramePtr->data.tebc.pc = NULL;
bcFramePtr->cmd.str.cmd = NULL;
bcFramePtr->cmd.str.len = 0;
bcFramePtr->cmdObj = NULL;
bcFramePtr->cmd = NULL;
bcFramePtr->len = 0;
#ifdef TCL_COMPILE_STATS
iPtr->stats.numExecutions++;
@@ -2131,6 +2134,11 @@ TEBCresume(
result = TCL_ERROR;
}
NRE_ASSERT(iPtr->cmdFramePtr == bcFramePtr);
if (bcFramePtr->cmdObj) {
Tcl_DecrRefCount(bcFramePtr->cmdObj);
bcFramePtr->cmdObj = NULL;
bcFramePtr->cmd = NULL;
}
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
if (iPtr->flags & INTERP_DEBUG_FRAME) {
TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);
@@ -2320,7 +2328,7 @@ TEBCresume(
goto instLoadScalar1;
} else if (inst == INST_PUSH1) {
PUSH_OBJECT(codePtr->objArrayPtr[TclGetUInt1AtPtr(pc+1)]);
TRACE_WITH_OBJ(("%u => ", TclGetInt1AtPtr(pc+1)), OBJ_AT_TOS);
TRACE_WITH_OBJ(("%u => ", TclGetUInt1AtPtr(pc+1)), OBJ_AT_TOS);
inst = *(pc += 2);
goto peepholeStart;
} else if (inst == INST_START_CMD) {
@@ -2362,7 +2370,7 @@ TEBCresume(
TRACE(("%u %u => ", code, level));
result = TclProcessReturn(interp, code, level, OBJ_AT_TOS);
if (result == TCL_OK) {
TRACE_APPEND(("continuing to next instruction (result=\"%.30s\")",
TRACE_APPEND(("continuing to next instruction (result=\"%.30s\")\n",
O2S(objResultPtr)));
NEXT_INST_F(9, 1, 0);
}
@@ -2371,6 +2379,7 @@ TEBCresume(
iPtr->flags &= ~ERR_ALREADY_LOGGED;
}
cleanup = 2;
TRACE_APPEND(("\n"));
goto processExceptionReturn;
}
@@ -2381,7 +2390,7 @@ TEBCresume(
if (result == TCL_OK) {
Tcl_DecrRefCount(OBJ_AT_TOS);
OBJ_AT_TOS = objResultPtr;
TRACE_APPEND(("continuing to next instruction (result=\"%.30s\")",
TRACE_APPEND(("continuing to next instruction (result=\"%.30s\")\n",
O2S(objResultPtr)));
NEXT_INST_F(1, 0, 0);
} else if (result == TCL_ERROR) {
@@ -2401,6 +2410,7 @@ TEBCresume(
Tcl_SetObjResult(interp, objResultPtr);
}
cleanup = 1;
TRACE_APPEND(("\n"));
goto processExceptionReturn;
case INST_YIELD: {
@@ -2430,8 +2440,11 @@ TEBCresume(
iPtr->cmdFramePtr = bcFramePtr;
if (iPtr->flags & INTERP_DEBUG_FRAME) {
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
codePtr, bcFramePtr, pc - codePtr->codeStart);
int cmd;
if (GetSrcInfoForPc(pc, codePtr, NULL, NULL, &cmd)) {
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
codePtr, bcFramePtr, cmd, pc - codePtr->codeStart);
}
}
pc++;
@@ -2715,6 +2728,7 @@ TEBCresume(
TclNewObj(objPtr);
objPtr->internalRep.ptrAndLongRep.value = CURR_DEPTH;
objPtr->length = 0;
PUSH_TAUX_OBJ(objPtr);
NEXT_INST_F(1, 0, 0);
@@ -2759,22 +2773,27 @@ TEBCresume(
* stack depth, as seen by the compiler.
*/
length = objc + (codePtr->maxStackDepth - TclGetInt4AtPtr(pc+1));
DECACHE_STACK_INFO();
moved = GrowEvaluationStack(iPtr->execEnvPtr, length, 1)
- (Tcl_Obj **) TD;
if (moved) {
/*
* Change the global data to point to the new stack: move the
* TEBCdataPtr TD, recompute the position of every other
* stack-allocated parameter, update the stack pointers.
*/
auxObjList->length += objc - 1;
if ((objc > 1) && (auxObjList->length > 0)) {
length = auxObjList->length /* Total expansion room we need */
+ codePtr->maxStackDepth /* Beyond the original max */
- CURR_DEPTH; /* Relative to where we are */
DECACHE_STACK_INFO();
moved = GrowEvaluationStack(iPtr->execEnvPtr, length, 1)
- (Tcl_Obj **) TD;
if (moved) {
/*
* Change the global data to point to the new stack: move the
* TEBCdataPtr TD, recompute the position of every other
* stack-allocated parameter, update the stack pointers.
*/
esPtr = iPtr->execEnvPtr->execStackPtr;
TD = (TEBCdata *) (((Tcl_Obj **)TD) + moved);
esPtr = iPtr->execEnvPtr->execStackPtr;
TD = (TEBCdata *) (((Tcl_Obj **)TD) + moved);
catchTop += moved;
tosPtr += moved;
catchTop += moved;
tosPtr += moved;
}
}
/*
@@ -2878,8 +2897,11 @@ TEBCresume(
iPtr->cmdFramePtr = bcFramePtr;
if (iPtr->flags & INTERP_DEBUG_FRAME) {
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
codePtr, bcFramePtr, pc - codePtr->codeStart);
int cmd;
if (GetSrcInfoForPc(pc, codePtr, NULL, NULL, &cmd)) {
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
codePtr, bcFramePtr, cmd, pc - codePtr->codeStart);
}
}
DECACHE_STACK_INFO();
@@ -2887,7 +2909,7 @@ TEBCresume(
pc += pcAdjustment;
TEBC_YIELD();
return TclNREvalObjv(interp, objc, objv,
TCL_EVAL_NOERR, NULL);
TCL_EVAL_NOERR | TCL_EVAL_SOURCE_IN_FRAME, NULL);
#if TCL_SUPPORT_84_BYTECODE
case INST_CALL_BUILTIN_FUNC1:
@@ -3024,8 +3046,11 @@ TEBCresume(
bcFramePtr->data.tebc.pc = (char *) pc;
iPtr->cmdFramePtr = bcFramePtr;
if (iPtr->flags & INTERP_DEBUG_FRAME) {
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
codePtr, bcFramePtr, pc - codePtr->codeStart);
int cmd;
if (GetSrcInfoForPc(pc, codePtr, NULL, NULL, &cmd)) {
TclArgumentBCEnter((Tcl_Interp *) iPtr, objv, objc,
codePtr, bcFramePtr, cmd, pc - codePtr->codeStart);
}
}
iPtr->ensembleRewrite.sourceObjs = objv;
iPtr->ensembleRewrite.numRemovedObjs = opnd;
@@ -3662,7 +3687,7 @@ TEBCresume(
arrayPtr = NULL;
part1Ptr = part2Ptr = NULL;
cleanup = 0;
TRACE(("%u %ld => ", opnd, increment));
TRACE(("%u %s => ", opnd, Tcl_GetString(incrPtr)));
doIncrVar:
if (TclIsVarDirectModifyable2(varPtr, arrayPtr)) {
@@ -4227,7 +4252,7 @@ TEBCresume(
} else {
TRACE(("%d => %.20s false, new pc %u\n", jmpOffset[0],
O2S(valuePtr),
(unsigned)(pc + jmpOffset[1] - codePtr->codeStart)));
(unsigned)(pc + jmpOffset[0] - codePtr->codeStart)));
}
}
#endif
@@ -4717,7 +4742,7 @@ TEBCresume(
if (listPtr->refCount == 1) {
TRACE(("\"%.30s\" %d %d => ", O2S(valuePtr),
TclGetInt4AtPtr(pc+1), TclGetInt4AtPtr(pc+5)));
for (index=toIdx+1 ; index<objc-1 ; index++) {
for (index=toIdx+1; index<objc ; index++) {
TclDecrRefCount(objv[index]);
}
listPtr->elemCount = toIdx+1;
@@ -6610,7 +6635,7 @@ TEBCresume(
}
#endif
TRACE_APPEND(("\"%.30s\" \"%.30s\" %d",
TRACE_APPEND(("\"%.30s\" \"%.30s\" %d\n",
O2S(OBJ_UNDER_TOS), O2S(OBJ_AT_TOS), done));
objResultPtr = TCONST(done);
/* TODO: consider opt like INST_FOREACH_STEP4 */
@@ -6624,7 +6649,7 @@ TEBCresume(
while (TclIsVarLink(varPtr)) {
varPtr = varPtr->value.linkPtr;
}
TRACE(("%u => ", opnd));
TRACE(("%u => \n", opnd));
if (TclIsVarDirectReadable(varPtr)) {
dictPtr = varPtr->value.objPtr;
} else {
@@ -6753,6 +6778,7 @@ TEBCresume(
O2S(dictPtr), O2S(listPtr)), Tcl_GetObjResult(interp));
goto gotError;
}
TRACE((" => "));
TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
NEXT_INST_F(1, 2, 1);
@@ -6959,7 +6985,7 @@ TEBCresume(
if ((result == TCL_ERROR) && !(iPtr->flags & ERR_ALREADY_LOGGED)) {
const unsigned char *pcBeg;
bytes = GetSrcInfoForPc(pc, codePtr, &length, &pcBeg);
bytes = GetSrcInfoForPc(pc, codePtr, &length, &pcBeg, NULL);
DECACHE_STACK_INFO();
TclLogCommandInfo(interp, codePtr->source, bytes,
bytes ? length : 0, pcBeg, tosPtr);
@@ -7141,7 +7167,7 @@ TEBCresume(
}
codePtr->flags |= TCL_BYTECODE_RECOMPILE;
bytes = GetSrcInfoForPc(pc, codePtr, &length, NULL);
bytes = GetSrcInfoForPc(pc, codePtr, &length, NULL, NULL);
opnd = TclGetUInt4AtPtr(pc+1);
pc += (opnd-1);
PUSH_OBJECT(Tcl_NewStringObj(bytes, length));
@@ -8634,7 +8660,7 @@ ValidatePcAndStackTop(
if (checkStack &&
((stackTop < 0) || (stackTop > stackUpperBound))) {
int numChars;
const char *cmd = GetSrcInfoForPc(pc, codePtr, &numChars, NULL);
const char *cmd = GetSrcInfoForPc(pc, codePtr, &numChars, NULL, NULL);
fprintf(stderr, "\nBad stack top %d at pc %u in TclNRExecuteByteCode (min 0, max %i)",
stackTop, relativePc, stackUpperBound);
@@ -8718,7 +8744,7 @@ IllegalExprOperandType(
/*
*----------------------------------------------------------------------
*
* TclGetSrcInfoForPc, GetSrcInfoForPc, TclGetSrcInfoForCmd --
* TclGetSrcInfoForPc, GetSrcInfoForPc, TclGetSourceFromFrame --
*
* Given a program counter value, finds the closest command in the
* bytecode code unit's CmdLocation array and returns information about
@@ -8739,16 +8765,26 @@ IllegalExprOperandType(
*----------------------------------------------------------------------
*/
const char *
TclGetSrcInfoForCmd(
Interp *iPtr,
int *lenPtr)
Tcl_Obj *
TclGetSourceFromFrame(
CmdFrame *cfPtr,
int objc,
Tcl_Obj *const objv[])
{
CmdFrame *cfPtr = iPtr->cmdFramePtr;
ByteCode *codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
if (cfPtr == NULL) {
return Tcl_NewListObj(objc, objv);
}
if (cfPtr->cmdObj == NULL) {
if (cfPtr->cmd == NULL) {
ByteCode *codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
return GetSrcInfoForPc((unsigned char *) cfPtr->data.tebc.pc,
codePtr, lenPtr, NULL);
cfPtr->cmd = GetSrcInfoForPc((unsigned char *)
cfPtr->data.tebc.pc, codePtr, &cfPtr->len, NULL, NULL);
}
cfPtr->cmdObj = Tcl_NewStringObj(cfPtr->cmd, cfPtr->len);
Tcl_IncrRefCount(cfPtr->cmdObj);
}
return cfPtr->cmdObj;
}
void
@@ -8757,13 +8793,16 @@ TclGetSrcInfoForPc(
{
ByteCode *codePtr = (ByteCode *) cfPtr->data.tebc.codePtr;
if (cfPtr->cmd.str.cmd == NULL) {
cfPtr->cmd.str.cmd = GetSrcInfoForPc(
assert(cfPtr->type == TCL_LOCATION_BC);
if (cfPtr->cmd == NULL) {
cfPtr->cmd = GetSrcInfoForPc(
(unsigned char *) cfPtr->data.tebc.pc, codePtr,
&cfPtr->cmd.str.len, NULL);
&cfPtr->len, NULL, NULL);
}
if (cfPtr->cmd.str.cmd != NULL) {
if (cfPtr->cmd != NULL) {
/*
* We now have the command. We can get the srcOffset back and from
* there find the list of word locations for this command.
@@ -8780,7 +8819,7 @@ TclGetSrcInfoForPc(
return;
}
srcOffset = cfPtr->cmd.str.cmd - codePtr->source;
srcOffset = cfPtr->cmd - codePtr->source;
eclPtr = Tcl_GetHashValue(hePtr);
for (i=0; i < eclPtr->nuloc; i++) {
@@ -8820,9 +8859,12 @@ GetSrcInfoForPc(
int *lengthPtr, /* If non-NULL, the location where the length
* of the command's source should be stored.
* If NULL, no length is stored. */
const unsigned char **pcBeg)/* If non-NULL, the bytecode location
const unsigned char **pcBeg,/* If non-NULL, the bytecode location
* where the current instruction starts.
* If NULL; no pointer is stored. */
int *cmdIdxPtr) /* If non-NULL, the location where the index
* of the command containing the pc should
* be stored. */
{
register int pcOffset = (pc - codePtr->codeStart);
int numCmds = codePtr->numCommands;
@@ -8832,6 +8874,7 @@ GetSrcInfoForPc(
int bestDist = INT_MAX; /* Distance of pc to best cmd's start pc. */
int bestSrcOffset = -1; /* Initialized to avoid compiler warning. */
int bestSrcLength = -1; /* Initialized to avoid compiler warning. */
int bestCmdIdx = -1;
if ((pcOffset < 0) || (pcOffset >= codePtr->numCodeBytes)) {
if (pcBeg != NULL) *pcBeg = NULL;
@@ -8899,6 +8942,7 @@ GetSrcInfoForPc(
bestDist = dist;
bestSrcOffset = srcOffset;
bestSrcLength = srcLen;
bestCmdIdx = i;
}
}
}
@@ -8928,6 +8972,10 @@ GetSrcInfoForPc(
*lengthPtr = bestSrcLength;
}
if (cmdIdxPtr != NULL) {
*cmdIdxPtr = bestCmdIdx;
}
return (codePtr->source + bestSrcOffset);
}
+2 -2
View File
@@ -139,7 +139,7 @@ int
TclCreateSocketAddress(
Tcl_Interp *interp, /* Interpreter for querying
* the desired socket family */
struct addrinfo **addrlist, /* Socket address list */
void **addrlist, /* Socket address list */
const char *host, /* Host. NULL implies INADDR_ANY */
int port, /* Port number */
int willBind, /* Is this an address to bind() to or
@@ -213,7 +213,7 @@ TclCreateSocketAddress(
hints.ai_flags |= AI_PASSIVE;
}
result = getaddrinfo(native, portstring, &hints, addrlist);
result = getaddrinfo(native, portstring, &hints, (struct addrinfo **) addrlist);
if (host != NULL) {
Tcl_DStringFree(&ds);
+39 -44
View File
@@ -30,8 +30,7 @@
* here, so that system-dependent personalizations for the include files only
* have to be made in once place. This results in a few extra includes, but
* greater modularity. The order of the three groups of #includes is
* important. For example, stdio.h is needed by tcl.h, and the _ANSI_ARGS_
* declaration in tcl.h is needed by stdlib.h in some configurations.
* important. For example, stdio.h is needed by tcl.h.
*/
#include "tclPort.h"
@@ -119,6 +118,10 @@ typedef int ptrdiff_t;
# endif
#endif
#if defined(_WIN32) && defined(_MSC_VER)
# define vsnprintf _vsnprintf
#endif
/*
* The following procedures allow namespaces to be customized to support
* special name resolution rules for commands/variables.
@@ -1172,29 +1175,27 @@ typedef struct CmdFrame {
*
* EXECUTION CONTEXTS and usage of CmdFrame
*
* Field TEBC EvalEx EvalObjEx
* ======= ==== ====== =========
* level yes yes yes
* type BC/PREBC SRC/EVAL EVAL_LIST
* line0 yes yes yes
* framePtr yes yes yes
* ======= ==== ====== =========
* Field TEBC EvalEx
* ======= ==== ======
* level yes yes
* type BC/PREBC SRC/EVAL
* line0 yes yes
* framePtr yes yes
* ======= ==== ======
*
* ======= ==== ====== ========= union data
* line1 - yes -
* line3 - yes -
* path - yes -
* ------- ---- ------ ---------
* codePtr yes - -
* pc yes - -
* ======= ==== ====== =========
* ======= ==== ========= union data
* line1 - yes
* line3 - yes
* path - yes
* ------- ---- ------
* codePtr yes -
* pc yes -
* ======= ==== ======
*
* ======= ==== ====== ========= | union cmd
* listPtr - - yes |
* ------- ---- ------ --------- |
* cmd yes yes - |
* cmdlen yes yes - |
* ------- ---- ------ --------- |
* ======= ==== ========= union cmd
* str.cmd yes yes
* str.len yes yes
* ------- ---- ------
*/
union {
@@ -1207,15 +1208,9 @@ typedef struct CmdFrame {
const char *pc; /* ... and instruction pointer. */
} tebc;
} data;
union {
struct {
const char *cmd; /* The executed command, if possible... */
int len; /* ... and its length. */
} str;
Tcl_Obj *listPtr; /* Tcl_EvalObjEx, cmd list. */
} cmd;
int numLevels; /* Value of interp's numLevels when the frame
* was pushed. */
Tcl_Obj *cmdObj;
const char *cmd; /* The executed command, if possible... */
int len; /* ... and its length. */
const struct CFWordBC *litarg;
/* Link to set of literal arguments which have
* ben pushed on the lineLABCPtr stack by
@@ -1279,8 +1274,6 @@ typedef struct ContLineLoc {
* location data referenced via the 'baseLocPtr'.
*
* TCL_LOCATION_EVAL : Frame is for a script evaluated by EvalEx.
* TCL_LOCATION_EVAL_LIST : Frame is for a script evaluated by the list
* optimization path of EvalObjEx.
* TCL_LOCATION_BC : Frame is for bytecode.
* TCL_LOCATION_PREBC : Frame is for precompiled bytecode.
* TCL_LOCATION_SOURCE : Frame is for a script evaluated by EvalEx, from a
@@ -1292,8 +1285,6 @@ typedef struct ContLineLoc {
*/
#define TCL_LOCATION_EVAL (0) /* Location in a dynamic eval script. */
#define TCL_LOCATION_EVAL_LIST (1) /* Location in a dynamic eval script,
* list-path. */
#define TCL_LOCATION_BC (2) /* Location in byte code. */
#define TCL_LOCATION_PREBC (3) /* Location in precompiled byte code, no
* location. */
@@ -2207,9 +2198,10 @@ typedef struct Interp {
* other than these should be turned into errors.
*/
#define TCL_ALLOW_EXCEPTIONS 4
#define TCL_EVAL_FILE 2
#define TCL_EVAL_CTX 8
#define TCL_ALLOW_EXCEPTIONS 0x04
#define TCL_EVAL_FILE 0x02
#define TCL_EVAL_SOURCE_IN_FRAME 0x10
#define TCL_EVAL_NORESOLVE 0x20
/*
* Flag bits for Interp structures:
@@ -2734,6 +2726,7 @@ MODULE_SCOPE Tcl_ObjCmdProc TclNRCoroutineObjCmd;
MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldObjCmd;
MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldmObjCmd;
MODULE_SCOPE Tcl_ObjCmdProc TclNRYieldToObjCmd;
MODULE_SCOPE Tcl_ObjCmdProc TclNRInvoke;
MODULE_SCOPE void TclSetTailcall(Tcl_Interp *interp, Tcl_Obj *tailcallPtr);
MODULE_SCOPE void TclPushTailcallPoint(Tcl_Interp *interp);
@@ -2825,7 +2818,7 @@ MODULE_SCOPE void TclArgumentRelease(Tcl_Interp *interp,
Tcl_Obj *objv[], int objc);
MODULE_SCOPE void TclArgumentBCEnter(Tcl_Interp *interp,
Tcl_Obj *objv[], int objc,
void *codePtr, CmdFrame *cfPtr, int pc);
void *codePtr, CmdFrame *cfPtr, int cmd, int pc);
MODULE_SCOPE void TclArgumentBCRelease(Tcl_Interp *interp,
CmdFrame *cfPtr);
MODULE_SCOPE void TclArgumentGet(Tcl_Interp *interp, Tcl_Obj *obj,
@@ -2916,7 +2909,8 @@ MODULE_SCOPE int TclGetOpenModeEx(Tcl_Interp *interp,
const char *modeString, int *seekFlagPtr,
int *binaryPtr);
MODULE_SCOPE Tcl_Obj * TclGetProcessGlobalValue(ProcessGlobalValue *pgvPtr);
MODULE_SCOPE const char *TclGetSrcInfoForCmd(Interp *iPtr, int *lenPtr);
MODULE_SCOPE Tcl_Obj * TclGetSourceFromFrame(CmdFrame *cfPtr, int objc,
Tcl_Obj *const objv[]);
MODULE_SCOPE int TclGlob(Tcl_Interp *interp, char *pattern,
Tcl_Obj *unquotedPrefix, int globFlags,
Tcl_GlobTypeData *types);
@@ -3007,9 +3001,8 @@ MODULE_SCOPE void TclpFinalizeMutex(Tcl_Mutex *mutexPtr);
MODULE_SCOPE void TclpFinalizePipes(void);
MODULE_SCOPE void TclpFinalizeSockets(void);
MODULE_SCOPE int TclCreateSocketAddress(Tcl_Interp *interp,
struct addrinfo **addrlist,
const char *host, int port, int willBind,
const char **errorMsgPtr);
void **addrlist, const char *host, int port,
int willBind, const char **errorMsgPtr);
MODULE_SCOPE int TclpThreadCreate(Tcl_ThreadId *idPtr,
Tcl_ThreadCreateProc *proc, ClientData clientData,
int stackSize, int flags);
@@ -3864,6 +3857,8 @@ MODULE_SCOPE int TclPtrUnsetVar(Tcl_Interp *interp, Var *varPtr,
Tcl_Obj *part2Ptr, const int flags,
int index);
MODULE_SCOPE void TclInvalidateNsPath(Namespace *nsPtr);
MODULE_SCOPE void TclFindArrayPtrElements(Var *arrayPtr,
Tcl_HashTable *tablePtr);
/*
* The new extended interface to the variable traces.
+2
View File
@@ -545,6 +545,8 @@ extern const TclIntPlatStubs *tclIntPlatStubsPtr;
#undef TclpGmtime_unix
#undef TclWinConvertWSAError
#define TclWinConvertWSAError TclWinConvertError
#undef TclpInetNtoa
#define TclpInetNtoa inet_ntoa
#if defined(__WIN32__) || defined(__CYGWIN__)
# undef TclWinNToHS
+52 -4
View File
@@ -279,6 +279,12 @@ static void DeleteScriptLimitCallback(ClientData clientData);
static void RunLimitHandlers(LimitHandler *handlerPtr,
Tcl_Interp *interp);
static void TimeLimitCallback(ClientData clientData);
/* NRE enabling */
static Tcl_NRPostProc NRPostInvokeHidden;
static Tcl_ObjCmdProc NRInterpCmd;
static Tcl_ObjCmdProc NRSlaveCmd;
/*
*----------------------------------------------------------------------
@@ -481,7 +487,8 @@ TclInterpInit(
slavePtr->interpCmd = NULL;
Tcl_InitHashTable(&slavePtr->aliasTable, TCL_STRING_KEYS);
Tcl_CreateObjCommand(interp, "interp", Tcl_InterpObjCmd, NULL, NULL);
Tcl_NRCreateCommand(interp, "interp", Tcl_InterpObjCmd, NRInterpCmd,
NULL, NULL);
Tcl_CallWhenDeleted(interp, InterpInfoDeleteProc, NULL);
return TCL_OK;
@@ -589,6 +596,16 @@ Tcl_InterpObjCmd(
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
return Tcl_NRCallObjProc(interp, NRInterpCmd, clientData, objc, objv);
}
static int
NRInterpCmd(
ClientData clientData, /* Unused. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Interp *slaveInterp;
int index;
@@ -2372,8 +2389,8 @@ SlaveCreate(
slavePtr->masterInterp = masterInterp;
slavePtr->slaveEntryPtr = hPtr;
slavePtr->slaveInterp = slaveInterp;
slavePtr->interpCmd = Tcl_CreateObjCommand(masterInterp, path,
SlaveObjCmd, slaveInterp, SlaveObjCmdDeleteProc);
slavePtr->interpCmd = Tcl_NRCreateCommand(masterInterp, path,
SlaveObjCmd, NRSlaveCmd, slaveInterp, SlaveObjCmdDeleteProc);
Tcl_InitHashTable(&slavePtr->aliasTable, TCL_STRING_KEYS);
Tcl_SetHashValue(hPtr, slavePtr);
Tcl_SetVar(slaveInterp, "tcl_interactive", "0", TCL_GLOBAL_ONLY);
@@ -2461,6 +2478,16 @@ SlaveObjCmd(
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
return Tcl_NRCallObjProc(interp, NRSlaveCmd, clientData, objc, objv);
}
static int
NRSlaveCmd(
ClientData clientData, /* Slave interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tcl_Interp *slaveInterp = clientData;
int index;
@@ -3052,7 +3079,11 @@ SlaveInvokeHidden(
Tcl_AllowExceptions(slaveInterp);
if (namespaceName == NULL) {
result = TclObjInvoke(slaveInterp, objc, objv, TCL_INVOKE_HIDDEN);
NRE_callback *rootPtr = TOP_CB(slaveInterp);
Tcl_NRAddCallback(interp, NRPostInvokeHidden, slaveInterp,
rootPtr, NULL, NULL);
return TclNRInvoke(NULL, slaveInterp, objc, objv);
} else {
Namespace *nsPtr, *dummy1, *dummy2;
const char *tail;
@@ -3071,6 +3102,23 @@ SlaveInvokeHidden(
Tcl_Release(slaveInterp);
return result;
}
static int
NRPostInvokeHidden(
ClientData data[],
Tcl_Interp *interp,
int result)
{
Tcl_Interp *slaveInterp = (Tcl_Interp *)data[0];
NRE_callback *rootPtr = (NRE_callback *)data[1];
if (interp != slaveInterp) {
result = TclNRRunCallbacks(slaveInterp, result, rootPtr);
Tcl_TransferResult(slaveInterp, result, interp);
}
Tcl_Release(slaveInterp);
return result;
}
/*
*----------------------------------------------------------------------
+3 -1
View File
@@ -313,6 +313,9 @@ Tcl_MainEx(
Tcl_Channel chan;
InteractiveState is;
TclpSetInitialEncodings();
TclpFindExecutable((const char *)argv[0]);
Tcl_InitMemory(interp);
is.interp = interp;
@@ -640,7 +643,6 @@ Tcl_Main(
* function to call after most initialization
* but before starting to execute commands. */
{
Tcl_FindExecutable(argv[0]);
Tcl_MainEx(argc, argv, appInitProc, Tcl_CreateInterp());
}
#endif /* TCL_MAJOR_VERSION == 8 && !UNICODE */
+66 -31
View File
@@ -673,6 +673,10 @@ Tcl_CreateNamespace(
Tcl_DString *namePtr, *buffPtr;
int newEntry, nameLen;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
const char *nameStr;
Tcl_DString tmpBuffer;
Tcl_DStringInit(&tmpBuffer);
/*
* If there is no active namespace, the interpreter is being initialized.
@@ -686,49 +690,78 @@ Tcl_CreateNamespace(
parentPtr = NULL;
simpleName = "";
} else if (*name == '\0') {
goto doCreate;
}
/*
* Ensure that there are no trailing colons as that causes chaos when a
* deleteProc is specified. [Bug d614d63989]
*/
if (deleteProc != NULL) {
nameStr = name + strlen(name) - 2;
if (nameStr >= name && nameStr[1] == ':' && nameStr[0] == ':') {
Tcl_DStringAppend(&tmpBuffer, name, -1);
while ((nameLen = Tcl_DStringLength(&tmpBuffer)) > 0
&& Tcl_DStringValue(&tmpBuffer)[nameLen-1] == ':') {
Tcl_DStringSetLength(&tmpBuffer, nameLen-1);
}
name = Tcl_DStringValue(&tmpBuffer);
}
}
/*
* If we've ended up with an empty string now, we're attempting to create
* the global namespace despite the global namespace existing. That's
* naughty!
*/
if (*name == '\0') {
Tcl_SetObjResult(interp, Tcl_NewStringObj("can't create namespace"
" \"\": only global namespace can have empty name", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NAMESPACE",
"CREATEGLOBAL", NULL);
Tcl_DStringFree(&tmpBuffer);
return NULL;
} else {
/*
* Find the parent for the new namespace.
*/
}
TclGetNamespaceForQualName(interp, name, NULL, TCL_CREATE_NS_IF_UNKNOWN,
&parentPtr, &dummy1Ptr, &dummy2Ptr, &simpleName);
/*
* Find the parent for the new namespace.
*/
/*
* If the unqualified name at the end is empty, there were trailing
* "::"s after the namespace's name which we ignore. The new namespace
* was already (recursively) created and is pointed to by parentPtr.
*/
TclGetNamespaceForQualName(interp, name, NULL, TCL_CREATE_NS_IF_UNKNOWN,
&parentPtr, &dummy1Ptr, &dummy2Ptr, &simpleName);
if (*simpleName == '\0') {
return (Tcl_Namespace *) parentPtr;
}
/*
* If the unqualified name at the end is empty, there were trailing "::"s
* after the namespace's name which we ignore. The new namespace was
* already (recursively) created and is pointed to by parentPtr.
*/
/*
* Check for a bad namespace name and make sure that the name does not
* already exist in the parent namespace.
*/
if (*simpleName == '\0') {
Tcl_DStringFree(&tmpBuffer);
return (Tcl_Namespace *) parentPtr;
}
if (
/*
* Check for a bad namespace name and make sure that the name does not
* already exist in the parent namespace.
*/
if (
#ifndef BREAK_NAMESPACE_COMPAT
Tcl_FindHashEntry(&parentPtr->childTable, simpleName) != NULL
Tcl_FindHashEntry(&parentPtr->childTable, simpleName) != NULL
#else
parentPtr->childTablePtr != NULL &&
Tcl_FindHashEntry(parentPtr->childTablePtr, simpleName) != NULL
parentPtr->childTablePtr != NULL &&
Tcl_FindHashEntry(parentPtr->childTablePtr, simpleName) != NULL
#endif
) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't create namespace \"%s\": already exists", name));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NAMESPACE",
"CREATEEXISTING", NULL);
return NULL;
}
) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't create namespace \"%s\": already exists", name));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NAMESPACE",
"CREATEEXISTING", NULL);
Tcl_DStringFree(&tmpBuffer);
return NULL;
}
/*
@@ -736,6 +769,7 @@ Tcl_CreateNamespace(
* of namespaces created.
*/
doCreate:
nsPtr = ckalloc(sizeof(Namespace));
nameLen = strlen(simpleName) + 1;
nsPtr->name = ckalloc(nameLen);
@@ -831,6 +865,7 @@ Tcl_CreateNamespace(
Tcl_DStringFree(&buffer1);
Tcl_DStringFree(&buffer2);
Tcl_DStringFree(&tmpBuffer);
/*
* If compilation of commands originating from the parent NS is
@@ -1942,7 +1977,7 @@ InvokeImportedNRCmd(
Command *realCmdPtr = dataPtr->realCmdPtr;
TclSkipTailcall(interp);
return Tcl_NRCmdSwap(interp, (Tcl_Command) realCmdPtr, objc, objv, 0);
return TclNREvalObjv(interp, objc, objv, TCL_EVAL_NOERR, realCmdPtr);
}
static int
+17 -3
View File
@@ -1,12 +1,24 @@
# tclOO.decls --
#
# This file contains the declarations for all supported public functions
# that are exported by the TclOO package that is embedded within the Tcl
# library via the stubs table. This file is used to generate the
# tclOODecls.h, tclOOIntDecls.h, tclOOStubInit.c, and tclOOStubLib.c
# files.
#
# Copyright (c) 2008-2013 by Donal K. Fellows.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
library tclOO
######################################################################
# public API
# Public API, exposed for general users of TclOO.
#
interface tclOO
hooks tclOOInt
scspec TCLOOAPI
declare 0 {
Tcl_Object Tcl_CopyObjectInstance(Tcl_Interp *interp,
@@ -116,7 +128,9 @@ declare 28 {
}
######################################################################
# private API, exposed to support advanced OO systems that plug in on top
# Private API, exposed to support advanced OO systems that plug in on top of
# TclOO; not intended for general use and does not have any commitment to
# long-term support.
#
interface tclOOInt
+23 -16
View File
@@ -12,21 +12,6 @@
#ifndef TCLOO_H_INCLUDED
#define TCLOO_H_INCLUDED
#include "tcl.h"
#ifndef TCLOOAPI
# if defined(BUILD_tcl) || defined(BUILD_TclOO)
# define TCLOOAPI MODULE_SCOPE
# else
# define TCLOOAPI extern
# undef USE_TCLOO_STUBS
# define USE_TCLOO_STUBS 1
# endif
#endif
extern const char *TclOOInitializeStubs(
Tcl_Interp *, const char *version);
#define Tcl_OOInitStubs(interp) TclOOInitializeStubs((interp), TCLOO_VERSION)
/*
* Be careful when it comes to versioning; need to make sure that the
@@ -39,9 +24,28 @@ extern const char *TclOOInitializeStubs(
* win/tclooConfig.sh
*/
#define TCLOO_VERSION "1.0"
#define TCLOO_VERSION "1.0.1"
#define TCLOO_PATCHLEVEL TCLOO_VERSION
#include "tcl.h"
/*
* For C++ compilers, use extern "C"
*/
#ifdef __cplusplus
extern "C" {
#endif
#if (defined(USE_TCLOO_STUBS) || defined(USE_TCL_STUBS))
extern const char *TclOOInitializeStubs(
Tcl_Interp *, const char *version);
#define Tcl_OOInitStubs(interp) \
TclOOInitializeStubs((interp), TCLOO_VERSION)
#else
#define Tcl_OOInitStubs(interp) (TCLOO_PATCHLEVEL)
#endif
/*
* These are opaque types.
*/
@@ -130,6 +134,9 @@ typedef struct {
#include "tclOODecls.h"
#ifdef __cplusplus
}
#endif
#endif
/*
+10 -6
View File
@@ -4,7 +4,7 @@
* This file contains implementations of the "simple" commands and
* methods from the object-system core.
*
* Copyright (c) 2005-2012 by Donal K. Fellows
* Copyright (c) 2005-2013 by Donal K. Fellows
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -88,7 +88,7 @@ TclOO_Class_Constructor(
Tcl_Obj *const *objv)
{
Object *oPtr = (Object *) Tcl_ObjectContextObject(context);
Tcl_Obj *invoke[3];
Tcl_Obj **invoke;
if (objc-1 > Tcl_ObjectContextSkippedArgs(context)) {
Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
@@ -102,6 +102,7 @@ TclOO_Class_Constructor(
* Delegate to [oo::define] to do the work.
*/
invoke = ckalloc(3 * sizeof(Tcl_Obj *));
invoke[0] = oPtr->fPtr->defineName;
invoke[1] = TclOOObjectName(interp, oPtr);
invoke[2] = objv[objc-1];
@@ -115,7 +116,7 @@ TclOO_Class_Constructor(
Tcl_IncrRefCount(invoke[1]);
Tcl_IncrRefCount(invoke[2]);
TclNRAddCallback(interp, DecrRefsPostClassConstructor,
invoke[0], invoke[1], invoke[2], NULL);
invoke, NULL, NULL, NULL);
/*
* Tricky point: do not want the extra reported level in the Tcl stack
@@ -131,9 +132,12 @@ DecrRefsPostClassConstructor(
Tcl_Interp *interp,
int result)
{
TclDecrRefCount((Tcl_Obj *) data[0]);
TclDecrRefCount((Tcl_Obj *) data[1]);
TclDecrRefCount((Tcl_Obj *) data[2]);
Tcl_Obj **invoke = data[0];
TclDecrRefCount(invoke[0]);
TclDecrRefCount(invoke[1]);
TclDecrRefCount(invoke[2]);
ckfree(invoke);
return result;
}
+43 -29
View File
@@ -5,6 +5,17 @@
#ifndef _TCLOODECLS
#define _TCLOODECLS
#undef TCL_STORAGE_CLASS
#ifdef BUILD_tcl
# define TCL_STORAGE_CLASS DLLEXPORT
#else
# ifdef USE_TCL_STUBS
# define TCL_STORAGE_CLASS
# else
# define TCL_STORAGE_CLASS DLLIMPORT
# endif
#endif
/* !BEGIN!: Do not edit below this line. */
/*
@@ -12,92 +23,92 @@
*/
/* 0 */
TCLOOAPI Tcl_Object Tcl_CopyObjectInstance(Tcl_Interp *interp,
EXTERN Tcl_Object Tcl_CopyObjectInstance(Tcl_Interp *interp,
Tcl_Object sourceObject,
const char *targetName,
const char *targetNamespaceName);
/* 1 */
TCLOOAPI Tcl_Object Tcl_GetClassAsObject(Tcl_Class clazz);
EXTERN Tcl_Object Tcl_GetClassAsObject(Tcl_Class clazz);
/* 2 */
TCLOOAPI Tcl_Class Tcl_GetObjectAsClass(Tcl_Object object);
EXTERN Tcl_Class Tcl_GetObjectAsClass(Tcl_Object object);
/* 3 */
TCLOOAPI Tcl_Command Tcl_GetObjectCommand(Tcl_Object object);
EXTERN Tcl_Command Tcl_GetObjectCommand(Tcl_Object object);
/* 4 */
TCLOOAPI Tcl_Object Tcl_GetObjectFromObj(Tcl_Interp *interp,
EXTERN Tcl_Object Tcl_GetObjectFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr);
/* 5 */
TCLOOAPI Tcl_Namespace * Tcl_GetObjectNamespace(Tcl_Object object);
EXTERN Tcl_Namespace * Tcl_GetObjectNamespace(Tcl_Object object);
/* 6 */
TCLOOAPI Tcl_Class Tcl_MethodDeclarerClass(Tcl_Method method);
EXTERN Tcl_Class Tcl_MethodDeclarerClass(Tcl_Method method);
/* 7 */
TCLOOAPI Tcl_Object Tcl_MethodDeclarerObject(Tcl_Method method);
EXTERN Tcl_Object Tcl_MethodDeclarerObject(Tcl_Method method);
/* 8 */
TCLOOAPI int Tcl_MethodIsPublic(Tcl_Method method);
EXTERN int Tcl_MethodIsPublic(Tcl_Method method);
/* 9 */
TCLOOAPI int Tcl_MethodIsType(Tcl_Method method,
EXTERN int Tcl_MethodIsType(Tcl_Method method,
const Tcl_MethodType *typePtr,
ClientData *clientDataPtr);
/* 10 */
TCLOOAPI Tcl_Obj * Tcl_MethodName(Tcl_Method method);
EXTERN Tcl_Obj * Tcl_MethodName(Tcl_Method method);
/* 11 */
TCLOOAPI Tcl_Method Tcl_NewInstanceMethod(Tcl_Interp *interp,
EXTERN Tcl_Method Tcl_NewInstanceMethod(Tcl_Interp *interp,
Tcl_Object object, Tcl_Obj *nameObj,
int isPublic, const Tcl_MethodType *typePtr,
ClientData clientData);
/* 12 */
TCLOOAPI Tcl_Method Tcl_NewMethod(Tcl_Interp *interp, Tcl_Class cls,
EXTERN Tcl_Method Tcl_NewMethod(Tcl_Interp *interp, Tcl_Class cls,
Tcl_Obj *nameObj, int isPublic,
const Tcl_MethodType *typePtr,
ClientData clientData);
/* 13 */
TCLOOAPI Tcl_Object Tcl_NewObjectInstance(Tcl_Interp *interp,
EXTERN Tcl_Object Tcl_NewObjectInstance(Tcl_Interp *interp,
Tcl_Class cls, const char *nameStr,
const char *nsNameStr, int objc,
Tcl_Obj *const *objv, int skip);
/* 14 */
TCLOOAPI int Tcl_ObjectDeleted(Tcl_Object object);
EXTERN int Tcl_ObjectDeleted(Tcl_Object object);
/* 15 */
TCLOOAPI int Tcl_ObjectContextIsFiltering(
EXTERN int Tcl_ObjectContextIsFiltering(
Tcl_ObjectContext context);
/* 16 */
TCLOOAPI Tcl_Method Tcl_ObjectContextMethod(Tcl_ObjectContext context);
EXTERN Tcl_Method Tcl_ObjectContextMethod(Tcl_ObjectContext context);
/* 17 */
TCLOOAPI Tcl_Object Tcl_ObjectContextObject(Tcl_ObjectContext context);
EXTERN Tcl_Object Tcl_ObjectContextObject(Tcl_ObjectContext context);
/* 18 */
TCLOOAPI int Tcl_ObjectContextSkippedArgs(
EXTERN int Tcl_ObjectContextSkippedArgs(
Tcl_ObjectContext context);
/* 19 */
TCLOOAPI ClientData Tcl_ClassGetMetadata(Tcl_Class clazz,
EXTERN ClientData Tcl_ClassGetMetadata(Tcl_Class clazz,
const Tcl_ObjectMetadataType *typePtr);
/* 20 */
TCLOOAPI void Tcl_ClassSetMetadata(Tcl_Class clazz,
EXTERN void Tcl_ClassSetMetadata(Tcl_Class clazz,
const Tcl_ObjectMetadataType *typePtr,
ClientData metadata);
/* 21 */
TCLOOAPI ClientData Tcl_ObjectGetMetadata(Tcl_Object object,
EXTERN ClientData Tcl_ObjectGetMetadata(Tcl_Object object,
const Tcl_ObjectMetadataType *typePtr);
/* 22 */
TCLOOAPI void Tcl_ObjectSetMetadata(Tcl_Object object,
EXTERN void Tcl_ObjectSetMetadata(Tcl_Object object,
const Tcl_ObjectMetadataType *typePtr,
ClientData metadata);
/* 23 */
TCLOOAPI int Tcl_ObjectContextInvokeNext(Tcl_Interp *interp,
EXTERN int Tcl_ObjectContextInvokeNext(Tcl_Interp *interp,
Tcl_ObjectContext context, int objc,
Tcl_Obj *const *objv, int skip);
/* 24 */
TCLOOAPI Tcl_ObjectMapMethodNameProc * Tcl_ObjectGetMethodNameMapper(
EXTERN Tcl_ObjectMapMethodNameProc * Tcl_ObjectGetMethodNameMapper(
Tcl_Object object);
/* 25 */
TCLOOAPI void Tcl_ObjectSetMethodNameMapper(Tcl_Object object,
EXTERN void Tcl_ObjectSetMethodNameMapper(Tcl_Object object,
Tcl_ObjectMapMethodNameProc *mapMethodNameProc);
/* 26 */
TCLOOAPI void Tcl_ClassSetConstructor(Tcl_Interp *interp,
EXTERN void Tcl_ClassSetConstructor(Tcl_Interp *interp,
Tcl_Class clazz, Tcl_Method method);
/* 27 */
TCLOOAPI void Tcl_ClassSetDestructor(Tcl_Interp *interp,
EXTERN void Tcl_ClassSetDestructor(Tcl_Interp *interp,
Tcl_Class clazz, Tcl_Method method);
/* 28 */
TCLOOAPI Tcl_Obj * Tcl_GetObjectName(Tcl_Interp *interp,
EXTERN Tcl_Obj * Tcl_GetObjectName(Tcl_Interp *interp,
Tcl_Object object);
typedef struct {
@@ -215,4 +226,7 @@ extern const TclOOStubs *tclOOStubsPtr;
#endif /* defined(USE_TCLOO_STUBS) */
/* !END!: Do not edit above this line. */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TCLOODECLS */
+32 -19
View File
@@ -4,7 +4,7 @@
* This file contains the implementation of the ::oo::define command,
* part of the object-system core (NB: not Tcl_Obj, but ::oo).
*
* Copyright (c) 2006-2012 by Donal K. Fellows
* Copyright (c) 2006-2013 by Donal K. Fellows
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -2206,29 +2206,42 @@ ClassSuperSet(
/*
* Parse the arguments to get the class to use as superclasses.
*
* Note that zero classes is special, as it is equivalent to just the
* class of objects. [Bug 9d61624b3d]
*/
for (i=0 ; i<superc ; i++) {
superclasses[i] = GetClassInOuterContext(interp, superv[i],
"only a class can be a superclass");
if (superclasses[i] == NULL) {
goto failedAfterAlloc;
if (superc == 0) {
superclasses = ckrealloc(superclasses, sizeof(Class *));
superclasses[0] = oPtr->fPtr->objectCls;
superc = 1;
if (TclOOIsReachable(oPtr->fPtr->classCls, oPtr->classPtr)) {
superclasses[0] = oPtr->fPtr->classCls;
}
for (j=0 ; j<i ; j++) {
if (superclasses[j] == superclasses[i]) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"class should only be a direct superclass once", -1));
Tcl_SetErrorCode(interp, "TCL", "OO", "REPETITIOUS", NULL);
} else {
for (i=0 ; i<superc ; i++) {
superclasses[i] = GetClassInOuterContext(interp, superv[i],
"only a class can be a superclass");
if (superclasses[i] == NULL) {
goto failedAfterAlloc;
}
}
if (TclOOIsReachable(oPtr->classPtr, superclasses[i])) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"attempt to form circular dependency graph", -1));
Tcl_SetErrorCode(interp, "TCL", "OO", "CIRCULARITY", NULL);
failedAfterAlloc:
ckfree((char *) superclasses);
return TCL_ERROR;
for (j=0 ; j<i ; j++) {
if (superclasses[j] == superclasses[i]) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"class should only be a direct superclass once",
-1));
Tcl_SetErrorCode(interp, "TCL", "OO", "REPETITIOUS",NULL);
goto failedAfterAlloc;
}
}
if (TclOOIsReachable(oPtr->classPtr, superclasses[i])) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"attempt to form circular dependency graph", -1));
Tcl_SetErrorCode(interp, "TCL", "OO", "CIRCULARITY", NULL);
failedAfterAlloc:
ckfree((char *) superclasses);
return TCL_ERROR;
}
}
}
-6
View File
@@ -122,12 +122,6 @@ typedef struct ForwardMethod {
Tcl_Obj *prefixObj; /* The list of values to use to replace the
* object and method name with. Will be a
* non-empty list. */
int fullyQualified; /* If 1, the command name is fully qualified
* and we should let the default Tcl mechanism
* handle the command lookup because it is
* more efficient. If 0, we need to do a
* specialized lookup based on the current
* object's namespace. */
} ForwardMethod;
/*
+30 -16
View File
@@ -5,6 +5,17 @@
#ifndef _TCLOOINTDECLS
#define _TCLOOINTDECLS
#undef TCL_STORAGE_CLASS
#ifdef BUILD_tcl
# define TCL_STORAGE_CLASS DLLEXPORT
#else
# ifdef USE_TCL_STUBS
# define TCL_STORAGE_CLASS
# else
# define TCL_STORAGE_CLASS DLLIMPORT
# endif
#endif
/* !BEGIN!: Do not edit below this line. */
/*
@@ -12,46 +23,46 @@
*/
/* 0 */
TCLOOAPI Tcl_Object TclOOGetDefineCmdContext(Tcl_Interp *interp);
EXTERN Tcl_Object TclOOGetDefineCmdContext(Tcl_Interp *interp);
/* 1 */
TCLOOAPI Tcl_Method TclOOMakeProcInstanceMethod(Tcl_Interp *interp,
EXTERN Tcl_Method TclOOMakeProcInstanceMethod(Tcl_Interp *interp,
Object *oPtr, int flags, Tcl_Obj *nameObj,
Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
const Tcl_MethodType *typePtr,
ClientData clientData, Proc **procPtrPtr);
/* 2 */
TCLOOAPI Tcl_Method TclOOMakeProcMethod(Tcl_Interp *interp,
EXTERN Tcl_Method TclOOMakeProcMethod(Tcl_Interp *interp,
Class *clsPtr, int flags, Tcl_Obj *nameObj,
const char *namePtr, Tcl_Obj *argsObj,
Tcl_Obj *bodyObj,
const Tcl_MethodType *typePtr,
ClientData clientData, Proc **procPtrPtr);
/* 3 */
TCLOOAPI Method * TclOONewProcInstanceMethod(Tcl_Interp *interp,
EXTERN Method * TclOONewProcInstanceMethod(Tcl_Interp *interp,
Object *oPtr, int flags, Tcl_Obj *nameObj,
Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
ProcedureMethod **pmPtrPtr);
/* 4 */
TCLOOAPI Method * TclOONewProcMethod(Tcl_Interp *interp, Class *clsPtr,
EXTERN Method * TclOONewProcMethod(Tcl_Interp *interp, Class *clsPtr,
int flags, Tcl_Obj *nameObj,
Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
ProcedureMethod **pmPtrPtr);
/* 5 */
TCLOOAPI int TclOOObjectCmdCore(Object *oPtr, Tcl_Interp *interp,
EXTERN int TclOOObjectCmdCore(Object *oPtr, Tcl_Interp *interp,
int objc, Tcl_Obj *const *objv,
int publicOnly, Class *startCls);
/* 6 */
TCLOOAPI int TclOOIsReachable(Class *targetPtr, Class *startPtr);
EXTERN int TclOOIsReachable(Class *targetPtr, Class *startPtr);
/* 7 */
TCLOOAPI Method * TclOONewForwardMethod(Tcl_Interp *interp,
EXTERN Method * TclOONewForwardMethod(Tcl_Interp *interp,
Class *clsPtr, int isPublic,
Tcl_Obj *nameObj, Tcl_Obj *prefixObj);
/* 8 */
TCLOOAPI Method * TclOONewForwardInstanceMethod(Tcl_Interp *interp,
EXTERN Method * TclOONewForwardInstanceMethod(Tcl_Interp *interp,
Object *oPtr, int isPublic, Tcl_Obj *nameObj,
Tcl_Obj *prefixObj);
/* 9 */
TCLOOAPI Tcl_Method TclOONewProcInstanceMethodEx(Tcl_Interp *interp,
EXTERN Tcl_Method TclOONewProcInstanceMethodEx(Tcl_Interp *interp,
Tcl_Object oPtr,
TclOO_PreCallProc *preCallPtr,
TclOO_PostCallProc *postCallPtr,
@@ -60,7 +71,7 @@ TCLOOAPI Tcl_Method TclOONewProcInstanceMethodEx(Tcl_Interp *interp,
Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
int flags, void **internalTokenPtr);
/* 10 */
TCLOOAPI Tcl_Method TclOONewProcMethodEx(Tcl_Interp *interp,
EXTERN Tcl_Method TclOONewProcMethodEx(Tcl_Interp *interp,
Tcl_Class clsPtr,
TclOO_PreCallProc *preCallPtr,
TclOO_PostCallProc *postCallPtr,
@@ -69,22 +80,22 @@ TCLOOAPI Tcl_Method TclOONewProcMethodEx(Tcl_Interp *interp,
Tcl_Obj *argsObj, Tcl_Obj *bodyObj,
int flags, void **internalTokenPtr);
/* 11 */
TCLOOAPI int TclOOInvokeObject(Tcl_Interp *interp,
EXTERN int TclOOInvokeObject(Tcl_Interp *interp,
Tcl_Object object, Tcl_Class startCls,
int publicPrivate, int objc,
Tcl_Obj *const *objv);
/* 12 */
TCLOOAPI void TclOOObjectSetFilters(Object *oPtr, int numFilters,
EXTERN void TclOOObjectSetFilters(Object *oPtr, int numFilters,
Tcl_Obj *const *filters);
/* 13 */
TCLOOAPI void TclOOClassSetFilters(Tcl_Interp *interp,
EXTERN void TclOOClassSetFilters(Tcl_Interp *interp,
Class *classPtr, int numFilters,
Tcl_Obj *const *filters);
/* 14 */
TCLOOAPI void TclOOObjectSetMixins(Object *oPtr, int numMixins,
EXTERN void TclOOObjectSetMixins(Object *oPtr, int numMixins,
Class *const *mixins);
/* 15 */
TCLOOAPI void TclOOClassSetMixins(Tcl_Interp *interp,
EXTERN void TclOOClassSetMixins(Tcl_Interp *interp,
Class *classPtr, int numMixins,
Class *const *mixins);
@@ -160,4 +171,7 @@ extern const TclOOIntStubs *tclOOIntStubsPtr;
#endif /* defined(USE_TCLOO_STUBS) */
/* !END!: Do not edit above this line. */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TCLOOINTDECLS */
+55 -18
View File
@@ -513,8 +513,8 @@ TclOOMakeProcInstanceMethod(
cfPtr->data.eval.path = context.data.eval.path;
Tcl_IncrRefCount(cfPtr->data.eval.path);
cfPtr->cmd.str.cmd = NULL;
cfPtr->cmd.str.len = 0;
cfPtr->cmd = NULL;
cfPtr->len = 0;
hPtr = Tcl_CreateHashEntry(iPtr->linePBodyPtr,
(char *) procPtr, &isNew);
@@ -626,8 +626,8 @@ TclOOMakeProcMethod(
cfPtr->data.eval.path = context.data.eval.path;
Tcl_IncrRefCount(cfPtr->data.eval.path);
cfPtr->cmd.str.cmd = NULL;
cfPtr->cmd.str.len = 0;
cfPtr->cmd = NULL;
cfPtr->len = 0;
hPtr = Tcl_CreateHashEntry(iPtr->linePBodyPtr,
(char *) procPtr, &isNew);
@@ -1290,11 +1290,57 @@ CloneProcedureMethod(
ClientData *newClientData)
{
ProcedureMethod *pmPtr = clientData;
ProcedureMethod *pm2Ptr = ckalloc(sizeof(ProcedureMethod));
ProcedureMethod *pm2Ptr;
Tcl_Obj *bodyObj, *argsObj;
CompiledLocal *localPtr;
/*
* Copy the argument list.
*/
argsObj = Tcl_NewObj();
for (localPtr=pmPtr->procPtr->firstLocalPtr; localPtr!=NULL;
localPtr=localPtr->nextPtr) {
if (TclIsVarArgument(localPtr)) {
Tcl_Obj *argObj = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, argObj,
Tcl_NewStringObj(localPtr->name, -1));
if (localPtr->defValuePtr != NULL) {
Tcl_ListObjAppendElement(NULL, argObj, localPtr->defValuePtr);
}
Tcl_ListObjAppendElement(NULL, argsObj, argObj);
}
}
/*
* Must strip the internal representation in order to ensure that any
* bound references to instance variables are removed. [Bug 3609693]
*/
bodyObj = Tcl_DuplicateObj(pmPtr->procPtr->bodyPtr);
TclFreeIntRep(bodyObj);
/*
* Create the actual copy of the method record, manufacturing a new proc
* record.
*/
pm2Ptr = ckalloc(sizeof(ProcedureMethod));
memcpy(pm2Ptr, pmPtr, sizeof(ProcedureMethod));
pm2Ptr->refCount = 1;
pm2Ptr->procPtr->refCount++;
Tcl_IncrRefCount(argsObj);
Tcl_IncrRefCount(bodyObj);
if (TclCreateProc(interp, NULL, "", argsObj, bodyObj,
&pm2Ptr->procPtr) != TCL_OK) {
Tcl_DecrRefCount(argsObj);
Tcl_DecrRefCount(bodyObj);
ckfree(pm2Ptr);
return TCL_ERROR;
}
Tcl_DecrRefCount(argsObj);
Tcl_DecrRefCount(bodyObj);
if (pmPtr->cloneClientdataProc) {
pm2Ptr->clientData = pmPtr->cloneClientdataProc(pmPtr->clientData);
}
@@ -1338,7 +1384,6 @@ TclOONewForwardInstanceMethod(
fmPtr = ckalloc(sizeof(ForwardMethod));
fmPtr->prefixObj = prefixObj;
Tcl_ListObjIndex(interp, prefixObj, 0, &cmdObj);
fmPtr->fullyQualified = (strncmp(TclGetString(cmdObj), "::", 2) == 0);
Tcl_IncrRefCount(prefixObj);
return (Method *) Tcl_NewInstanceMethod(interp, (Tcl_Object) oPtr,
nameObj, flags, &fwdMethodType, fmPtr);
@@ -1380,7 +1425,6 @@ TclOONewForwardMethod(
fmPtr = ckalloc(sizeof(ForwardMethod));
fmPtr->prefixObj = prefixObj;
Tcl_ListObjIndex(interp, prefixObj, 0, &cmdObj);
fmPtr->fullyQualified = (strncmp(TclGetString(cmdObj), "::", 2) == 0);
Tcl_IncrRefCount(prefixObj);
return (Method *) Tcl_NewMethod(interp, (Tcl_Class) clsPtr, nameObj,
flags, &fwdMethodType, fmPtr);
@@ -1409,7 +1453,6 @@ InvokeForwardMethod(
ForwardMethod *fmPtr = clientData;
Tcl_Obj **argObjs, **prefixObjs;
int numPrefixes, len, skip = contextPtr->skip;
Command *cmdPtr;
/*
* Build the real list of arguments to use. Note that we know that the
@@ -1421,15 +1464,10 @@ InvokeForwardMethod(
Tcl_ListObjGetElements(NULL, fmPtr->prefixObj, &numPrefixes, &prefixObjs);
argObjs = InitEnsembleRewrite(interp, objc, objv, skip,
numPrefixes, prefixObjs, &len);
if (fmPtr->fullyQualified) {
cmdPtr = NULL;
} else {
cmdPtr = (Command *) Tcl_FindCommand(interp, TclGetString(argObjs[0]),
contextPtr->oPtr->namespacePtr, 0 /* normal lookup */);
}
Tcl_NRAddCallback(interp, FinalizeForwardCall, argObjs, NULL, NULL, NULL);
return TclNREvalObjv(interp, len, argObjs, TCL_EVAL_INVOKE, cmdPtr);
((Interp *)interp)->lookupNsPtr
= (Namespace *) contextPtr->oPtr->namespacePtr;
return TclNREvalObjv(interp, len, argObjs, TCL_EVAL_NOERR, NULL);
}
static int
@@ -1474,7 +1512,6 @@ CloneForwardMethod(
ForwardMethod *fm2Ptr = ckalloc(sizeof(ForwardMethod));
fm2Ptr->prefixObj = fmPtr->prefixObj;
fm2Ptr->fullyQualified = fmPtr->fullyQualified;
Tcl_IncrRefCount(fm2Ptr->prefixObj);
*newClientData = fm2Ptr;
return TCL_OK;
+3 -35
View File
@@ -97,7 +97,6 @@ typedef struct ThreadSpecificData {
static Tcl_ThreadDataKey dataKey;
static void ContLineLocFree(char *clientData);
static void TclThreadFinalizeContLines(ClientData clientData);
static ThreadSpecificData *TclGetContLineTable(void);
@@ -805,14 +804,7 @@ TclThreadFinalizeContLines(
for (hPtr = Tcl_FirstHashEntry(tsdPtr->lineCLPtr, &hSearch);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) {
/*
* We are not using Tcl_EventuallyFree (as in TclFreeObj()) because
* here we can be sure that the compiler will not hold references to
* the data in the hashtable, and using TEF might bork the
* finalization sequence.
*/
ContLineLocFree(Tcl_GetHashValue(hPtr));
ckfree(Tcl_GetHashValue(hPtr));
Tcl_DeleteHashEntry(hPtr);
}
Tcl_DeleteHashTable(tsdPtr->lineCLPtr);
@@ -820,30 +812,6 @@ TclThreadFinalizeContLines(
tsdPtr->lineCLPtr = NULL;
}
/*
*----------------------------------------------------------------------
*
* ContLineLocFree --
*
* The freProc for continuation line location tables.
*
* Results:
* None.
*
* Side effects:
* Releases memory.
*
* TIP #280
*----------------------------------------------------------------------
*/
static void
ContLineLocFree(
char *clientData)
{
ckfree(clientData);
}
/*
*--------------------------------------------------------------
*
@@ -1405,7 +1373,7 @@ TclFreeObj(
if (tsdPtr->lineCLPtr) {
hPtr = Tcl_FindHashEntry(tsdPtr->lineCLPtr, objPtr);
if (hPtr) {
Tcl_EventuallyFree(Tcl_GetHashValue(hPtr), ContLineLocFree);
ckfree(Tcl_GetHashValue(hPtr));
Tcl_DeleteHashEntry(hPtr);
}
}
@@ -1496,7 +1464,7 @@ TclFreeObj(
if (tsdPtr->lineCLPtr) {
hPtr = Tcl_FindHashEntry(tsdPtr->lineCLPtr, objPtr);
if (hPtr) {
Tcl_EventuallyFree(Tcl_GetHashValue(hPtr), ContLineLocFree);
ckfree(Tcl_GetHashValue(hPtr));
Tcl_DeleteHashEntry(hPtr);
}
}
+20 -4
View File
@@ -86,6 +86,7 @@ LocateTargetAddresses(
case INST_JUMP4:
case INST_JUMP_TRUE4:
case INST_JUMP_FALSE4:
case INST_START_CMD:
targetInstPtr = currentInstPtr+TclGetInt4AtPtr(currentInstPtr+1);
goto storeTarget;
case INST_BEGIN_CATCH4:
@@ -109,8 +110,6 @@ LocateTargetAddresses(
DefineTargetAddress(tablePtr, currentInstPtr + 2*i - 1);
}
break;
case INST_START_CMD:
assert (envPtr->atCmdStart < 2);
}
}
@@ -213,7 +212,8 @@ ConvertZeroEffectToNOP(
int blank = 0, i, nextInst;
size = AddrLength(currentInstPtr);
while (*(currentInstPtr+size) == INST_NOP) {
while ((currentInstPtr + size < envPtr->codeNext)
&& *(currentInstPtr+size) == INST_NOP) {
if (IsTargetAddress(&targets, currentInstPtr + size)) {
break;
}
@@ -344,21 +344,28 @@ AdvanceJumps(
CompileEnv *envPtr)
{
unsigned char *currentInstPtr;
Tcl_HashTable jumps;
for (currentInstPtr = envPtr->codeStart ;
currentInstPtr < envPtr->codeNext-1 ;
currentInstPtr += AddrLength(currentInstPtr)) {
int offset, delta;
int offset, delta, isNew;
switch (*currentInstPtr) {
case INST_JUMP1:
case INST_JUMP_TRUE1:
case INST_JUMP_FALSE1:
offset = TclGetInt1AtPtr(currentInstPtr + 1);
Tcl_InitHashTable(&jumps, TCL_ONE_WORD_KEYS);
for (delta=0 ; offset+delta != 0 ;) {
if (offset + delta < -128 || offset + delta > 127) {
break;
}
Tcl_CreateHashEntry(&jumps, INT2PTR(offset), &isNew);
if (!isNew) {
offset = TclGetInt1AtPtr(currentInstPtr + 1);
break;
}
offset += delta;
switch (*(currentInstPtr + offset)) {
case INST_NOP:
@@ -373,13 +380,21 @@ AdvanceJumps(
}
break;
}
Tcl_DeleteHashTable(&jumps);
TclStoreInt1AtPtr(offset, currentInstPtr + 1);
continue;
case INST_JUMP4:
case INST_JUMP_TRUE4:
case INST_JUMP_FALSE4:
Tcl_InitHashTable(&jumps, TCL_ONE_WORD_KEYS);
Tcl_CreateHashEntry(&jumps, INT2PTR(0), &isNew);
for (offset = TclGetInt4AtPtr(currentInstPtr + 1); offset!=0 ;) {
Tcl_CreateHashEntry(&jumps, INT2PTR(offset), &isNew);
if (!isNew) {
offset = TclGetInt4AtPtr(currentInstPtr + 1);
break;
}
switch (*(currentInstPtr + offset)) {
case INST_NOP:
offset += InstLength(INST_NOP);
@@ -393,6 +408,7 @@ AdvanceJumps(
}
break;
}
Tcl_DeleteHashTable(&jumps);
TclStoreInt4AtPtr(offset, currentInstPtr + 1);
continue;
}
+4
View File
@@ -52,6 +52,10 @@ Tcl_SetPanicProc(
#if defined(_WIN32)
/* tclWinDebugPanic only installs if there is no panicProc yet. */
if ((proc != tclWinDebugPanic) || (panicProc == NULL))
#elif defined(__CYGWIN__)
if (proc == NULL)
panicProc = tclWinDebugPanic;
else
#endif
panicProc = proc;
}
+7 -8
View File
@@ -15,6 +15,7 @@
#include "tclInt.h"
#include "tclParse.h"
#include <assert.h>
/*
* The following table provides parsing information about each possible 8-bit
@@ -1567,6 +1568,7 @@ Tcl_ParseVar(
code = TclSubstTokens(interp, parsePtr->tokenPtr, parsePtr->numTokens,
NULL, 1, NULL, NULL);
Tcl_FreeParse(parsePtr);
TclStackFree(interp, parsePtr);
if (code != TCL_OK) {
return NULL;
@@ -1577,16 +1579,13 @@ Tcl_ParseVar(
* At this point we should have an object containing the value of a
* variable. Just return the string from that object.
*
* This should have returned the object for the user to manage, but
* instead we have some weak reference to the string value in the object,
* which is why we make sure the object exists after resetting the result.
* This isn't ideal, but it's the best we can do with the current
* documented interface. -- hobbs
* Since TclSubstTokens above returned TCL_OK, we know that objPtr
* is shared. It is in both the interp result and the value of the
* variable. Returning the string relies on that to be true.
*/
if (!Tcl_IsShared(objPtr)) {
Tcl_IncrRefCount(objPtr);
}
assert( Tcl_IsShared(objPtr) );
Tcl_ResetResult(interp);
return TclGetString(objPtr);
}
+4 -4
View File
@@ -271,8 +271,8 @@ Tcl_ProcObjCmd(
cfPtr->data.eval.path = contextPtr->data.eval.path;
Tcl_IncrRefCount(cfPtr->data.eval.path);
cfPtr->cmd.str.cmd = NULL;
cfPtr->cmd.str.len = 0;
cfPtr->cmd = NULL;
cfPtr->len = 0;
hePtr = Tcl_CreateHashEntry(iPtr->linePBodyPtr,
procPtr, &isNew);
@@ -2595,8 +2595,8 @@ SetLambdaFromAny(
cfPtr->data.eval.path = contextPtr->data.eval.path;
Tcl_IncrRefCount(cfPtr->data.eval.path);
cfPtr->cmd.str.cmd = NULL;
cfPtr->cmd.str.len = 0;
cfPtr->cmd = NULL;
cfPtr->len = 0;
}
/*
+2
View File
@@ -1112,6 +1112,7 @@ Tcl_SetObjErrorCode(
*----------------------------------------------------------------------
*/
#undef Tcl_GetErrorLine
int
Tcl_GetErrorLine(
Tcl_Interp *interp)
@@ -1129,6 +1130,7 @@ Tcl_GetErrorLine(
*----------------------------------------------------------------------
*/
#undef Tcl_SetErrorLine
void
Tcl_SetErrorLine(
Tcl_Interp *interp,
+1
View File
@@ -43,6 +43,7 @@
#undef TclSockMinimumBuffers
#define TclBackgroundException Tcl_BackgroundException
#undef Tcl_SetIntObj
#undef TclpInetNtoa
/* See bug 510001: TclSockMinimumBuffers needs plat imp */
#ifdef _WIN64
+58
View File
@@ -0,0 +1,58 @@
/*
* tclStubLibTbl.c --
*
* Stub object that will be statically linked into extensions that want
* to access Tcl.
*
* Copyright (c) 1998-1999 by Scriptics Corporation.
* Copyright (c) 1998 Paul Duffin.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include "tclInt.h"
/*
*----------------------------------------------------------------------
*
* TclInitStubTable --
*
* Initialize the stub table, using the structure pointed at
* by the "version" argument.
*
* Results:
* Outputs the value of the "version" argument.
*
* Side effects:
* Sets the stub table pointers.
*
*----------------------------------------------------------------------
*/
MODULE_SCOPE const char *
TclInitStubTable(
const char *version) /* points to the version field of a
TclStubInfoType structure variable. */
{
tclStubsPtr = ((const TclStubInfoType *) version)->stubs;
if (tclStubsPtr->hooks) {
tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs;
tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs;
tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs;
} else {
tclPlatStubsPtr = NULL;
tclIntStubsPtr = NULL;
tclIntPlatStubsPtr = NULL;
}
return version;
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/
+24 -6
View File
@@ -1555,14 +1555,14 @@ DelCallbackProc(
*
* TestdelCmd --
*
* This procedure implements the "testdcall" command. It is used
* to test Tcl_CallWhenDeleted.
* This procedure implements the "testdel" command. It is used
* to test calling of command deletion callbacks.
*
* Results:
* A standard Tcl result.
*
* Side effects:
* Creates and deletes interpreters.
* Creates a command.
*
*----------------------------------------------------------------------
*/
@@ -1856,7 +1856,7 @@ TestdstringCmd(
if (Tcl_GetInt(interp, argv[2], &count) != TCL_OK) {
return TCL_ERROR;
}
Tcl_DStringTrunc(&dstring, count);
Tcl_DStringSetLength(&dstring, count);
} else if (strcmp(argv[1], "start") == 0) {
if (argc != 2) {
goto wrongNumArgs;
@@ -4408,8 +4408,26 @@ TestseterrorcodeCmd(
Tcl_SetResult(interp, "too many args", TCL_STATIC);
return TCL_ERROR;
}
Tcl_SetErrorCode(interp, argv[1], argv[2], argv[3], argv[4],
argv[5], NULL);
switch (argc) {
case 1:
Tcl_SetErrorCode(interp, "NONE", NULL);
break;
case 2:
Tcl_SetErrorCode(interp, argv[1], NULL);
break;
case 3:
Tcl_SetErrorCode(interp, argv[1], argv[2], NULL);
break;
case 4:
Tcl_SetErrorCode(interp, argv[1], argv[2], argv[3], NULL);
break;
case 5:
Tcl_SetErrorCode(interp, argv[1], argv[2], argv[3], argv[4], NULL);
break;
case 6:
Tcl_SetErrorCode(interp, argv[1], argv[2], argv[3], argv[4],
argv[5], NULL);
}
return TCL_ERROR;
}
+9 -9
View File
@@ -337,7 +337,7 @@ ThreadObjCmd(
*/
if (objc == 2) {
idObj = Tcl_NewLongObj((long)(size_t)Tcl_GetCurrentThread());
idObj = Tcl_NewWideIntObj((Tcl_WideInt)(size_t)Tcl_GetCurrentThread());
} else if (objc == 3
&& strcmp("-main", Tcl_GetString(objv[2])) == 0) {
Tcl_MutexLock(&threadMutex);
@@ -355,14 +355,14 @@ ThreadObjCmd(
return TCL_ERROR;
}
case THREAD_JOIN: {
long id;
Tcl_WideInt id;
int result, status;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "id");
return TCL_ERROR;
}
if (Tcl_GetLongFromObj(interp, objv[2], &id) != TCL_OK) {
if (Tcl_GetWideIntFromObj(interp, objv[2], &id) != TCL_OK) {
return TCL_ERROR;
}
@@ -372,7 +372,7 @@ ThreadObjCmd(
} else {
char buf[20];
TclFormatInt(buf, id);
sprintf(buf, "%" TCL_LL_MODIFIER "d", id);
Tcl_AppendResult(interp, "cannot join thread ", buf, NULL);
}
return result;
@@ -384,7 +384,7 @@ ThreadObjCmd(
}
return ThreadList(interp);
case THREAD_SEND: {
long id;
Tcl_WideInt id;
const char *script;
int wait, arg;
@@ -403,7 +403,7 @@ ThreadObjCmd(
wait = 1;
arg = 2;
}
if (Tcl_GetLongFromObj(interp, objv[arg], &id) != TCL_OK) {
if (Tcl_GetWideIntFromObj(interp, objv[arg], &id) != TCL_OK) {
return TCL_ERROR;
}
arg++;
@@ -523,7 +523,7 @@ ThreadCreate(
Tcl_ConditionWait(&ctrl.condWait, &threadMutex, NULL);
Tcl_MutexUnlock(&threadMutex);
Tcl_ConditionFinalize(&ctrl.condWait);
Tcl_SetObjResult(interp, Tcl_NewLongObj((long)(size_t)id));
Tcl_SetObjResult(interp, Tcl_NewWideIntObj((Tcl_WideInt)(size_t)id));
return TCL_OK;
}
@@ -655,7 +655,7 @@ ThreadErrorProc(
char *script;
char buf[TCL_DOUBLE_SPACE+1];
TclFormatInt(buf, (size_t) Tcl_GetCurrentThread());
sprintf(buf, "%" TCL_LL_MODIFIER "d", (Tcl_WideInt)(size_t)Tcl_GetCurrentThread());
errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
if (errorProcString == NULL) {
@@ -773,7 +773,7 @@ ThreadList(
Tcl_MutexLock(&threadMutex);
for (tsdPtr = threadList ; tsdPtr ; tsdPtr = tsdPtr->nextPtr) {
Tcl_ListObjAppendElement(interp, listPtr,
Tcl_NewLongObj((long)(size_t)tsdPtr->threadId));
Tcl_NewWideIntObj((Tcl_WideInt)(size_t)tsdPtr->threadId));
}
Tcl_MutexUnlock(&threadMutex);
Tcl_SetObjResult(interp, listPtr);
+2 -2
View File
@@ -1555,10 +1555,10 @@ Tcl_UniCharIsSpace(
*/
if (((Tcl_UniChar) ch) < ((Tcl_UniChar) 0x80)) {
return isspace(UCHAR(ch)); /* INTL: ISO space */
return TclIsSpaceProc((char) ch);
} else if ((Tcl_UniChar) ch == 0x0085 || (Tcl_UniChar) ch == 0x180e
|| (Tcl_UniChar) ch == 0x200b || (Tcl_UniChar) ch == 0x2060
|| (Tcl_UniChar) ch == 0xfeff) {
|| (Tcl_UniChar) ch == 0x202f || (Tcl_UniChar) ch == 0xfeff) {
return 1;
} else {
return ((SPACE_BITS >> GetCategory(ch)) & 1);
+1 -2
View File
@@ -3580,10 +3580,9 @@ UpdateStringOfEndOffset(
register Tcl_Obj *objPtr)
{
char buffer[TCL_INTEGER_SPACE + 5];
register int len;
register int len = 3;
memcpy(buffer, "end", 4);
len = sizeof("end") - 1;
if (objPtr->internalRep.longValue != 0) {
buffer[len++] = '-';
len += TclFormatInt(buffer+len, -(objPtr->internalRep.longValue));
+47
View File
@@ -3847,6 +3847,53 @@ ArrayNamesCmd(
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TclFindArrayPtrElements --
*
* Fill out a hash table (which *must* use Tcl_Obj* keys) with an entry
* for each existing element of the given array. The provided hash table
* is assumed to be initially empty.
*
* Result:
* none
*
* Side effects:
* The keys of the array gain an extra reference. The supplied hash table
* has elements added to it.
*
*----------------------------------------------------------------------
*/
void
TclFindArrayPtrElements(
Var *arrayPtr,
Tcl_HashTable *tablePtr)
{
Var *varPtr;
Tcl_HashSearch search;
if ((arrayPtr == NULL) || !TclIsVarArray(arrayPtr)
|| TclIsVarUndefined(arrayPtr)) {
return;
}
for (varPtr=VarHashFirstVar(arrayPtr->value.tablePtr, &search);
varPtr!=NULL ; varPtr=VarHashNextVar(&search)) {
Tcl_HashEntry *hPtr;
Tcl_Obj *nameObj;
int dummy;
if (TclIsVarUndefined(varPtr)) {
continue;
}
nameObj = VarHashGetKey(varPtr);
hPtr = Tcl_CreateHashEntry(tablePtr, (char *) nameObj, &dummy);
Tcl_SetHashValue(hPtr, nameObj);
}
}
/*
*----------------------------------------------------------------------
*
+48 -17
View File
@@ -513,6 +513,32 @@ proc auto_mkindex_parser::fullname {name} {
return [string map [list \0 \$] $name]
}
# auto_mkindex_parser::indexEntry --
#
# Used by commands like "proc" within the auto_mkindex parser to add a
# correctly-quoted entry to the index. This is shared code so it is done
# *right*, in one place.
#
# Arguments:
# name - Name that is being added to index.
proc auto_mkindex_parser::indexEntry {name} {
variable index
variable scriptFile
# We convert all metacharacters to their backslashed form, and pre-split
# the file name that we know about (which will be a proper list, and so
# correctly quoted).
set name [string range [list \}[fullname $name]] 2 end]
set filenameParts [file split $scriptFile]
append index [format \
{set auto_index(%s) [list source [file join $dir %s]]%s} \
$name $filenameParts \n]
return
}
if {[llength $::auto_mkindex_parser::initCommands]} {
return
}
@@ -524,15 +550,7 @@ if {[llength $::auto_mkindex_parser::initCommands]} {
# Adds an entry to the auto index list for the given procedure name.
auto_mkindex_parser::command proc {name args} {
variable index
variable scriptFile
# Do some fancy reformatting on the "source" call to handle platform
# differences with respect to pathnames. Use format just so that the
# command is a little easier to read (otherwise it'd be full of
# backslashed dollar signs, etc.
append index [list set auto_index([fullname $name])] \
[format { [list source [file join $dir %s]]} \
[file split $scriptFile]] "\n"
indexEntry $name
}
# Conditionally add support for Tcl byte code files. There are some tricky
@@ -559,14 +577,7 @@ auto_mkindex_parser::hook {
# procedure name.
auto_mkindex_parser::commandInit tbcload::bcproc {name args} {
variable index
variable scriptFile
# Do some nice reformatting of the "source" call, to get around
# path differences on different platforms. We use the format
# command just so that the code is a little easier to read.
append index [list set auto_index([fullname $name])] \
[format { [list source [file join $dir %s]]} \
[file split $scriptFile]] "\n"
indexEntry $name
}
}
}
@@ -610,6 +621,13 @@ auto_mkindex_parser::command namespace {op args} {
variable contextStack
if {[lindex $args 0] eq "create"} {
set name ::[join [lreverse $contextStack] ::]
catch {
set name [dict get [lrange $args 1 end] -command]
if {![string match ::* $name]} {
set name ::[join [lreverse $contextStack] ::]$name
}
regsub -all ::+ $name :: name
}
# create artifical proc to force an entry in the tclIndex
$parser eval [list ::proc $name {} {}]
}
@@ -617,4 +635,17 @@ auto_mkindex_parser::command namespace {op args} {
}
}
# AUTO MKINDEX: oo::class create name ?definition?
# Adds an entry to the auto index list for the given class name.
auto_mkindex_parser::command oo::class {op name {body ""}} {
if {$op eq "create"} {
indexEntry $name
}
}
auto_mkindex_parser::command class {op name {body ""}} {
if {$op eq "create"} {
indexEntry $name
}
}
return
+2 -2
View File
@@ -324,7 +324,7 @@ proc ::tcl::clock::Initialize {} {
{-10800 0 3600 0 2 0 2 2 0 0 0 0 10 0 3 2 0 0 0} :America/Sao_Paulo
{-10800 0 3600 0 10 0 5 2 0 0 0 0 4 0 1 2 0 0 0} :America/Godthab
{-10800 0 3600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} :America/Buenos_Aires
{-10800 0 3600 0 2 0 5 2 0 0 0 0 11 0 1 2 0 0 0} :America/Brasilia
{-10800 0 3600 0 2 0 5 2 0 0 0 0 11 0 1 2 0 0 0} :America/Bahia
{-10800 0 3600 0 3 0 2 2 0 0 0 0 10 0 1 2 0 0 0} :America/Montevideo
{-7200 0 3600 0 9 0 5 2 0 0 0 0 3 0 5 2 0 0 0} :America/Noronha
{-3600 0 3600 0 10 0 5 3 0 0 0 0 3 0 5 2 0 0 0} :Atlantic/Azores
@@ -3861,7 +3861,7 @@ proc ::tcl::clock::ProcessPosixTimeZone { z } {
# Put DST in effect in all years from 1916 to 2099.
for { set y 1916 } { $y < 2099 } { incr y } {
for { set y 1916 } { $y < 2100 } { incr y } {
set startTime [DeterminePosixDSTTime $z start $y]
incr startTime [expr { - wide($stdOffset) }]
set endTime [DeterminePosixDSTTime $z end $y]
+1 -1
View File
@@ -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.0
package require -exact Tcl 8.6.1
# Compute the auto path to use in this interpreter.
# The values on the path come from several locations:
+1 -1
View File
@@ -9,4 +9,4 @@
# full path name of this file's directory.
if {![package vsatisfies [package provide Tcl] 8.5]} {return}
package ifneeded tcltest 2.3.5 [list source [file join $dir tcltest.tcl]]
package ifneeded tcltest 2.3.6 [list source [file join $dir tcltest.tcl]]
+1 -1
View File
@@ -22,7 +22,7 @@ namespace eval tcltest {
# When the version number changes, be sure to update the pkgIndex.tcl file,
# and the install directory in the Makefiles. When the minor version
# changes (new feature) be sure to update the man page as well.
variable Version 2.3.5
variable Version 2.3.6
# Compatibility support for dumb variables defined in tcltest 1
# Do not use these. Call [package provide Tcl] and [info patchlevel]
+9
View File
@@ -238,6 +238,15 @@ proc ::tcl::tm::UnknownHandler {original name args} {
continue
}
if {[package ifneeded $pkgname $pkgversion] ne {}} {
# There's already a provide script registered for
# this version of this package. Since all units of
# code claiming to be the same version of the same
# package ought to be identical, just stick with
# the one we already have.
continue
}
# We have found a candidate, generate a "provide script"
# for it, and remember it. Note that we are using ::list
# to do this; locally [list] means something else without
+116 -172
View File
@@ -34,191 +34,135 @@ set TZData(:Africa/Casablanca) {
{1345428000 3600 1 WEST}
{1348970400 0 0 WET}
{1367114400 3600 1 WEST}
{1373335200 0 0 WET}
{1375927200 3600 1 WEST}
{1380420000 0 0 WET}
{1398564000 3600 1 WEST}
{1373162400 0 0 WET}
{1376100000 3600 1 WEST}
{1382839200 0 0 WET}
{1396144800 3600 1 WEST}
{1404007200 0 0 WET}
{1406599200 3600 1 WEST}
{1411869600 0 0 WET}
{1430013600 3600 1 WEST}
{1414288800 0 0 WET}
{1427594400 3600 1 WEST}
{1434592800 0 0 WET}
{1437184800 3600 1 WEST}
{1443319200 0 0 WET}
{1461463200 3600 1 WEST}
{1445738400 0 0 WET}
{1459044000 3600 1 WEST}
{1465264800 0 0 WET}
{1467856800 3600 1 WEST}
{1474768800 0 0 WET}
{1493517600 3600 1 WEST}
{1477792800 0 0 WET}
{1490493600 3600 1 WEST}
{1495850400 0 0 WET}
{1498442400 3600 1 WEST}
{1506218400 0 0 WET}
{1524967200 3600 1 WEST}
{1509242400 0 0 WET}
{1521943200 3600 1 WEST}
{1526436000 0 0 WET}
{1529028000 3600 1 WEST}
{1538272800 0 0 WET}
{1556416800 3600 1 WEST}
{1540692000 0 0 WET}
{1553997600 3600 1 WEST}
{1557108000 0 0 WET}
{1559700000 3600 1 WEST}
{1569722400 0 0 WET}
{1572141600 0 0 WET}
{1585447200 3600 1 WEST}
{1587693600 0 0 WET}
{1590285600 3600 1 WEST}
{1601172000 0 0 WET}
{1603591200 0 0 WET}
{1616896800 3600 1 WEST}
{1618279200 0 0 WET}
{1620871200 3600 1 WEST}
{1632621600 0 0 WET}
{1635645600 0 0 WET}
{1648346400 3600 1 WEST}
{1648951200 0 0 WET}
{1651543200 3600 1 WEST}
{1664071200 0 0 WET}
{1682820000 3600 1 WEST}
{1695520800 0 0 WET}
{1714269600 3600 1 WEST}
{1727575200 0 0 WET}
{1745719200 3600 1 WEST}
{1759024800 0 0 WET}
{1777168800 3600 1 WEST}
{1790474400 0 0 WET}
{1808618400 3600 1 WEST}
{1821924000 0 0 WET}
{1840672800 3600 1 WEST}
{1853373600 0 0 WET}
{1872122400 3600 1 WEST}
{1885428000 0 0 WET}
{1903572000 3600 1 WEST}
{1916877600 0 0 WET}
{1935021600 3600 1 WEST}
{1948327200 0 0 WET}
{1966471200 3600 1 WEST}
{1979776800 0 0 WET}
{1997920800 3600 1 WEST}
{2011226400 0 0 WET}
{2029975200 3600 1 WEST}
{2042676000 0 0 WET}
{2061424800 3600 1 WEST}
{2074730400 0 0 WET}
{2092874400 3600 1 WEST}
{2106180000 0 0 WET}
{2124324000 3600 1 WEST}
{2137629600 0 0 WET}
{2155773600 3600 1 WEST}
{2169079200 0 0 WET}
{2187223200 3600 1 WEST}
{2200528800 0 0 WET}
{2219277600 3600 1 WEST}
{2232583200 0 0 WET}
{2250727200 3600 1 WEST}
{2264032800 0 0 WET}
{2282176800 3600 1 WEST}
{2295482400 0 0 WET}
{2313626400 3600 1 WEST}
{2326932000 0 0 WET}
{2345076000 3600 1 WEST}
{2358381600 0 0 WET}
{2377130400 3600 1 WEST}
{2389831200 0 0 WET}
{2408580000 3600 1 WEST}
{2421885600 0 0 WET}
{2440029600 3600 1 WEST}
{2453335200 0 0 WET}
{2471479200 3600 1 WEST}
{2484784800 0 0 WET}
{2502928800 3600 1 WEST}
{2516234400 0 0 WET}
{2534378400 3600 1 WEST}
{2547684000 0 0 WET}
{2566432800 3600 1 WEST}
{2579133600 0 0 WET}
{2597882400 3600 1 WEST}
{2611188000 0 0 WET}
{2629332000 3600 1 WEST}
{2642637600 0 0 WET}
{2660781600 3600 1 WEST}
{2674087200 0 0 WET}
{2692231200 3600 1 WEST}
{2705536800 0 0 WET}
{2724285600 3600 1 WEST}
{2736986400 0 0 WET}
{2755735200 3600 1 WEST}
{2769040800 0 0 WET}
{2787184800 3600 1 WEST}
{2800490400 0 0 WET}
{2818634400 3600 1 WEST}
{2831940000 0 0 WET}
{2850084000 3600 1 WEST}
{2863389600 0 0 WET}
{2881533600 3600 1 WEST}
{2894839200 0 0 WET}
{2913588000 3600 1 WEST}
{2926288800 0 0 WET}
{2945037600 3600 1 WEST}
{2958343200 0 0 WET}
{2976487200 3600 1 WEST}
{2989792800 0 0 WET}
{3007936800 3600 1 WEST}
{3021242400 0 0 WET}
{3039386400 3600 1 WEST}
{3052692000 0 0 WET}
{3070836000 3600 1 WEST}
{3084141600 0 0 WET}
{3102890400 3600 1 WEST}
{3116196000 0 0 WET}
{3134340000 3600 1 WEST}
{3147645600 0 0 WET}
{3165789600 3600 1 WEST}
{3179095200 0 0 WET}
{3197239200 3600 1 WEST}
{3210544800 0 0 WET}
{3228688800 3600 1 WEST}
{3241994400 0 0 WET}
{3260743200 3600 1 WEST}
{3273444000 0 0 WET}
{3292192800 3600 1 WEST}
{3305498400 0 0 WET}
{3323642400 3600 1 WEST}
{3336948000 0 0 WET}
{3355092000 3600 1 WEST}
{3368397600 0 0 WET}
{3386541600 3600 1 WEST}
{3399847200 0 0 WET}
{3417991200 3600 1 WEST}
{3431296800 0 0 WET}
{3450045600 3600 1 WEST}
{3462746400 0 0 WET}
{3481495200 3600 1 WEST}
{3494800800 0 0 WET}
{3512944800 3600 1 WEST}
{3526250400 0 0 WET}
{3544394400 3600 1 WEST}
{3557700000 0 0 WET}
{3575844000 3600 1 WEST}
{3589149600 0 0 WET}
{3607898400 3600 1 WEST}
{3620599200 0 0 WET}
{3639348000 3600 1 WEST}
{3652653600 0 0 WET}
{3670797600 3600 1 WEST}
{3684103200 0 0 WET}
{3702247200 3600 1 WEST}
{3715552800 0 0 WET}
{3733696800 3600 1 WEST}
{3747002400 0 0 WET}
{3765146400 3600 1 WEST}
{3778452000 0 0 WET}
{3797200800 3600 1 WEST}
{3809901600 0 0 WET}
{3828650400 3600 1 WEST}
{3841956000 0 0 WET}
{3860100000 3600 1 WEST}
{3873405600 0 0 WET}
{3891549600 3600 1 WEST}
{3904855200 0 0 WET}
{3922999200 3600 1 WEST}
{3936304800 0 0 WET}
{3954448800 3600 1 WEST}
{3967754400 0 0 WET}
{3986503200 3600 1 WEST}
{3999808800 0 0 WET}
{4017952800 3600 1 WEST}
{4031258400 0 0 WET}
{4049402400 3600 1 WEST}
{4062708000 0 0 WET}
{4080852000 3600 1 WEST}
{4094157600 0 0 WET}
{1667095200 0 0 WET}
{1682128800 3600 1 WEST}
{1698544800 0 0 WET}
{1712714400 3600 1 WEST}
{1729994400 0 0 WET}
{1743386400 3600 1 WEST}
{1761444000 0 0 WET}
{1774749600 3600 1 WEST}
{1792893600 0 0 WET}
{1806199200 3600 1 WEST}
{1824948000 0 0 WET}
{1837648800 3600 1 WEST}
{1856397600 0 0 WET}
{1869098400 3600 1 WEST}
{1887847200 0 0 WET}
{1901152800 3600 1 WEST}
{1919296800 0 0 WET}
{1932602400 3600 1 WEST}
{1950746400 0 0 WET}
{1964052000 3600 1 WEST}
{1982800800 0 0 WET}
{1995501600 3600 1 WEST}
{2014250400 0 0 WET}
{2026951200 3600 1 WEST}
{2045700000 0 0 WET}
{2058400800 3600 1 WEST}
{2077149600 0 0 WET}
{2090455200 3600 1 WEST}
{2108167200 0 0 WET}
{2121904800 3600 1 WEST}
{2138839200 0 0 WET}
{2153354400 3600 1 WEST}
{2184800400 3600 1 WEST}
{2216250000 3600 1 WEST}
{2248304400 3600 1 WEST}
{2279754000 3600 1 WEST}
{2311203600 3600 1 WEST}
{2342653200 3600 1 WEST}
{2374102800 3600 1 WEST}
{2405552400 3600 1 WEST}
{2437606800 3600 1 WEST}
{2469056400 3600 1 WEST}
{2500506000 3600 1 WEST}
{2531955600 3600 1 WEST}
{2563405200 3600 1 WEST}
{2595459600 3600 1 WEST}
{2626909200 3600 1 WEST}
{2658358800 3600 1 WEST}
{2689808400 3600 1 WEST}
{2721258000 3600 1 WEST}
{2752707600 3600 1 WEST}
{2784762000 3600 1 WEST}
{2816211600 3600 1 WEST}
{2847661200 3600 1 WEST}
{2879110800 3600 1 WEST}
{2910560400 3600 1 WEST}
{2942010000 3600 1 WEST}
{2974064400 3600 1 WEST}
{3005514000 3600 1 WEST}
{3036963600 3600 1 WEST}
{3068413200 3600 1 WEST}
{3099862800 3600 1 WEST}
{3131917200 3600 1 WEST}
{3163366800 3600 1 WEST}
{3194816400 3600 1 WEST}
{3226266000 3600 1 WEST}
{3257715600 3600 1 WEST}
{3289165200 3600 1 WEST}
{3321219600 3600 1 WEST}
{3352669200 3600 1 WEST}
{3384118800 3600 1 WEST}
{3415568400 3600 1 WEST}
{3447018000 3600 1 WEST}
{3479072400 3600 1 WEST}
{3510522000 3600 1 WEST}
{3541971600 3600 1 WEST}
{3573421200 3600 1 WEST}
{3604870800 3600 1 WEST}
{3636320400 3600 1 WEST}
{3668374800 3600 1 WEST}
{3699824400 3600 1 WEST}
{3731274000 3600 1 WEST}
{3762723600 3600 1 WEST}
{3794173200 3600 1 WEST}
{3825622800 3600 1 WEST}
{3857677200 3600 1 WEST}
{3889126800 3600 1 WEST}
{3920576400 3600 1 WEST}
{3952026000 3600 1 WEST}
{3983475600 3600 1 WEST}
{4015530000 3600 1 WEST}
{4046979600 3600 1 WEST}
{4078429200 3600 1 WEST}
}
+3 -37
View File
@@ -1,39 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:Africa/Juba) {
{-9223372036854775808 7584 0 LMT}
{-1230775584 7200 0 CAT}
{10360800 10800 1 CAST}
{24786000 7200 0 CAT}
{41810400 10800 1 CAST}
{56322000 7200 0 CAT}
{73432800 10800 1 CAST}
{87944400 7200 0 CAT}
{104882400 10800 1 CAST}
{119480400 7200 0 CAT}
{136332000 10800 1 CAST}
{151016400 7200 0 CAT}
{167781600 10800 1 CAST}
{182552400 7200 0 CAT}
{199231200 10800 1 CAST}
{214174800 7200 0 CAT}
{230680800 10800 1 CAST}
{245710800 7200 0 CAT}
{262735200 10800 1 CAST}
{277246800 7200 0 CAT}
{294184800 10800 1 CAST}
{308782800 7200 0 CAT}
{325634400 10800 1 CAST}
{340405200 7200 0 CAT}
{357084000 10800 1 CAST}
{371941200 7200 0 CAT}
{388533600 10800 1 CAST}
{403477200 7200 0 CAT}
{419983200 10800 1 CAST}
{435013200 7200 0 CAT}
{452037600 10800 1 CAST}
{466635600 7200 0 CAT}
{483487200 10800 1 CAST}
{498171600 7200 0 CAT}
{947930400 10800 0 EAT}
if {![info exists TZData(Africa/Khartoum)]} {
LoadTimeZoneFile Africa/Khartoum
}
set TZData(:Africa/Juba) $TZData(:Africa/Khartoum)
+3 -4
View File
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Anguilla) {
{-9223372036854775808 -15136 0 LMT}
{-1825098464 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/Anguilla) $TZData(:America/Port_of_Spain)
+1 -173
View File
@@ -56,177 +56,5 @@ set TZData(:America/Araguaina) {
{1064368800 -10800 0 BRT}
{1350788400 -7200 0 BRST}
{1361066400 -10800 0 BRT}
{1382238000 -7200 1 BRST}
{1392516000 -10800 0 BRT}
{1413687600 -7200 1 BRST}
{1424570400 -10800 0 BRT}
{1445137200 -7200 1 BRST}
{1456020000 -10800 0 BRT}
{1476586800 -7200 1 BRST}
{1487469600 -10800 0 BRT}
{1508036400 -7200 1 BRST}
{1518919200 -10800 0 BRT}
{1540090800 -7200 1 BRST}
{1550368800 -10800 0 BRT}
{1571540400 -7200 1 BRST}
{1581818400 -10800 0 BRT}
{1602990000 -7200 1 BRST}
{1613872800 -10800 0 BRT}
{1634439600 -7200 1 BRST}
{1645322400 -10800 0 BRT}
{1665889200 -7200 1 BRST}
{1677376800 -10800 0 BRT}
{1697338800 -7200 1 BRST}
{1708221600 -10800 0 BRT}
{1729393200 -7200 1 BRST}
{1739671200 -10800 0 BRT}
{1760842800 -7200 1 BRST}
{1771725600 -10800 0 BRT}
{1792292400 -7200 1 BRST}
{1803175200 -10800 0 BRT}
{1823742000 -7200 1 BRST}
{1834624800 -10800 0 BRT}
{1855191600 -7200 1 BRST}
{1866074400 -10800 0 BRT}
{1887246000 -7200 1 BRST}
{1897524000 -10800 0 BRT}
{1918695600 -7200 1 BRST}
{1928973600 -10800 0 BRT}
{1950145200 -7200 1 BRST}
{1960423200 -10800 0 BRT}
{1981594800 -7200 1 BRST}
{1992477600 -10800 0 BRT}
{2013044400 -7200 1 BRST}
{2024532000 -10800 0 BRT}
{2044494000 -7200 1 BRST}
{2055376800 -10800 0 BRT}
{2076548400 -7200 1 BRST}
{2086826400 -10800 0 BRT}
{2107998000 -7200 1 BRST}
{2118880800 -10800 0 BRT}
{2139447600 -7200 1 BRST}
{2150330400 -10800 0 BRT}
{2170897200 -7200 1 BRST}
{2181780000 -10800 0 BRT}
{2202346800 -7200 1 BRST}
{2213229600 -10800 0 BRT}
{2234401200 -7200 1 BRST}
{2244679200 -10800 0 BRT}
{2265850800 -7200 1 BRST}
{2276128800 -10800 0 BRT}
{2297300400 -7200 1 BRST}
{2307578400 -10800 0 BRT}
{2328750000 -7200 1 BRST}
{2339632800 -10800 0 BRT}
{2360199600 -7200 1 BRST}
{2371082400 -10800 0 BRT}
{2391649200 -7200 1 BRST}
{2402532000 -10800 0 BRT}
{2423703600 -7200 1 BRST}
{2433981600 -10800 0 BRT}
{2455153200 -7200 1 BRST}
{2465431200 -10800 0 BRT}
{2486602800 -7200 1 BRST}
{2497485600 -10800 0 BRT}
{2518052400 -7200 1 BRST}
{2528935200 -10800 0 BRT}
{2549502000 -7200 1 BRST}
{2560384800 -10800 0 BRT}
{2580951600 -7200 1 BRST}
{2591834400 -10800 0 BRT}
{2613006000 -7200 1 BRST}
{2623284000 -10800 0 BRT}
{2644455600 -7200 1 BRST}
{2654733600 -10800 0 BRT}
{2675905200 -7200 1 BRST}
{2686788000 -10800 0 BRT}
{2707354800 -7200 1 BRST}
{2718237600 -10800 0 BRT}
{2738804400 -7200 1 BRST}
{2749687200 -10800 0 BRT}
{2770858800 -7200 1 BRST}
{2781136800 -10800 0 BRT}
{2802308400 -7200 1 BRST}
{2812586400 -10800 0 BRT}
{2833758000 -7200 1 BRST}
{2844036000 -10800 0 BRT}
{2865207600 -7200 1 BRST}
{2876090400 -10800 0 BRT}
{2896657200 -7200 1 BRST}
{2907540000 -10800 0 BRT}
{2928106800 -7200 1 BRST}
{2938989600 -10800 0 BRT}
{2960161200 -7200 1 BRST}
{2970439200 -10800 0 BRT}
{2991610800 -7200 1 BRST}
{3001888800 -10800 0 BRT}
{3023060400 -7200 1 BRST}
{3033943200 -10800 0 BRT}
{3054510000 -7200 1 BRST}
{3065392800 -10800 0 BRT}
{3085959600 -7200 1 BRST}
{3096842400 -10800 0 BRT}
{3118014000 -7200 1 BRST}
{3128292000 -10800 0 BRT}
{3149463600 -7200 1 BRST}
{3159741600 -10800 0 BRT}
{3180913200 -7200 1 BRST}
{3191191200 -10800 0 BRT}
{3212362800 -7200 1 BRST}
{3223245600 -10800 0 BRT}
{3243812400 -7200 1 BRST}
{3254695200 -10800 0 BRT}
{3275262000 -7200 1 BRST}
{3286144800 -10800 0 BRT}
{3307316400 -7200 1 BRST}
{3317594400 -10800 0 BRT}
{3338766000 -7200 1 BRST}
{3349044000 -10800 0 BRT}
{3370215600 -7200 1 BRST}
{3381098400 -10800 0 BRT}
{3401665200 -7200 1 BRST}
{3412548000 -10800 0 BRT}
{3433114800 -7200 1 BRST}
{3443997600 -10800 0 BRT}
{3464564400 -7200 1 BRST}
{3475447200 -10800 0 BRT}
{3496618800 -7200 1 BRST}
{3506896800 -10800 0 BRT}
{3528068400 -7200 1 BRST}
{3538346400 -10800 0 BRT}
{3559518000 -7200 1 BRST}
{3570400800 -10800 0 BRT}
{3590967600 -7200 1 BRST}
{3601850400 -10800 0 BRT}
{3622417200 -7200 1 BRST}
{3633300000 -10800 0 BRT}
{3654471600 -7200 1 BRST}
{3664749600 -10800 0 BRT}
{3685921200 -7200 1 BRST}
{3696199200 -10800 0 BRT}
{3717370800 -7200 1 BRST}
{3727648800 -10800 0 BRT}
{3748820400 -7200 1 BRST}
{3759703200 -10800 0 BRT}
{3780270000 -7200 1 BRST}
{3791152800 -10800 0 BRT}
{3811719600 -7200 1 BRST}
{3822602400 -10800 0 BRT}
{3843774000 -7200 1 BRST}
{3854052000 -10800 0 BRT}
{3875223600 -7200 1 BRST}
{3885501600 -10800 0 BRT}
{3906673200 -7200 1 BRST}
{3917556000 -10800 0 BRT}
{3938122800 -7200 1 BRST}
{3949005600 -10800 0 BRT}
{3969572400 -7200 1 BRST}
{3980455200 -10800 0 BRT}
{4001626800 -7200 1 BRST}
{4011904800 -10800 0 BRT}
{4033076400 -7200 1 BRST}
{4043354400 -10800 0 BRT}
{4064526000 -7200 1 BRST}
{4074804000 -10800 0 BRT}
{4095975600 -7200 1 BRST}
{1378000800 -10800 0 BRT}
}
+1 -1
View File
@@ -64,5 +64,5 @@ set TZData(:America/Argentina/San_Luis) {
{1205031600 -14400 0 WART}
{1223784000 -10800 1 WARST}
{1236481200 -14400 0 WART}
{1255233600 -10800 1 WARST}
{1255233600 -10800 0 ART}
}
+3 -5
View File
@@ -1,7 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Aruba) {
{-9223372036854775808 -16824 0 LMT}
{-1826738376 -16200 0 ANT}
{-157750200 -14400 0 AST}
if {![info exists TZData(America/Curacao)]} {
LoadTimeZoneFile America/Curacao
}
set TZData(:America/Aruba) $TZData(:America/Curacao)
+86 -87
View File
@@ -83,178 +83,177 @@ set TZData(:America/Asuncion) {
{1333854000 -14400 0 PYT}
{1349582400 -10800 1 PYST}
{1364094000 -14400 0 PYT}
{1365912000 -14400 0 PYT}
{1381032000 -10800 1 PYST}
{1397358000 -14400 0 PYT}
{1395543600 -14400 0 PYT}
{1412481600 -10800 1 PYST}
{1428807600 -14400 0 PYT}
{1426993200 -14400 0 PYT}
{1443931200 -10800 1 PYST}
{1460257200 -14400 0 PYT}
{1459047600 -14400 0 PYT}
{1475380800 -10800 1 PYST}
{1491706800 -14400 0 PYT}
{1490497200 -14400 0 PYT}
{1506830400 -10800 1 PYST}
{1523156400 -14400 0 PYT}
{1521946800 -14400 0 PYT}
{1538884800 -10800 1 PYST}
{1555210800 -14400 0 PYT}
{1553396400 -14400 0 PYT}
{1570334400 -10800 1 PYST}
{1586660400 -14400 0 PYT}
{1584846000 -14400 0 PYT}
{1601784000 -10800 1 PYST}
{1618110000 -14400 0 PYT}
{1616900400 -14400 0 PYT}
{1633233600 -10800 1 PYST}
{1649559600 -14400 0 PYT}
{1648350000 -14400 0 PYT}
{1664683200 -10800 1 PYST}
{1681009200 -14400 0 PYT}
{1679799600 -14400 0 PYT}
{1696132800 -10800 1 PYST}
{1713063600 -14400 0 PYT}
{1711249200 -14400 0 PYT}
{1728187200 -10800 1 PYST}
{1744513200 -14400 0 PYT}
{1742698800 -14400 0 PYT}
{1759636800 -10800 1 PYST}
{1775962800 -14400 0 PYT}
{1774148400 -14400 0 PYT}
{1791086400 -10800 1 PYST}
{1807412400 -14400 0 PYT}
{1806202800 -14400 0 PYT}
{1822536000 -10800 1 PYST}
{1838862000 -14400 0 PYT}
{1837652400 -14400 0 PYT}
{1853985600 -10800 1 PYST}
{1870311600 -14400 0 PYT}
{1869102000 -14400 0 PYT}
{1886040000 -10800 1 PYST}
{1902366000 -14400 0 PYT}
{1900551600 -14400 0 PYT}
{1917489600 -10800 1 PYST}
{1933815600 -14400 0 PYT}
{1932001200 -14400 0 PYT}
{1948939200 -10800 1 PYST}
{1965265200 -14400 0 PYT}
{1964055600 -14400 0 PYT}
{1980388800 -10800 1 PYST}
{1996714800 -14400 0 PYT}
{1995505200 -14400 0 PYT}
{2011838400 -10800 1 PYST}
{2028164400 -14400 0 PYT}
{2026954800 -14400 0 PYT}
{2043288000 -10800 1 PYST}
{2059614000 -14400 0 PYT}
{2058404400 -14400 0 PYT}
{2075342400 -10800 1 PYST}
{2091668400 -14400 0 PYT}
{2089854000 -14400 0 PYT}
{2106792000 -10800 1 PYST}
{2123118000 -14400 0 PYT}
{2121303600 -14400 0 PYT}
{2138241600 -10800 1 PYST}
{2154567600 -14400 0 PYT}
{2153358000 -14400 0 PYT}
{2169691200 -10800 1 PYST}
{2186017200 -14400 0 PYT}
{2184807600 -14400 0 PYT}
{2201140800 -10800 1 PYST}
{2217466800 -14400 0 PYT}
{2216257200 -14400 0 PYT}
{2233195200 -10800 1 PYST}
{2249521200 -14400 0 PYT}
{2247706800 -14400 0 PYT}
{2264644800 -10800 1 PYST}
{2280970800 -14400 0 PYT}
{2279156400 -14400 0 PYT}
{2296094400 -10800 1 PYST}
{2312420400 -14400 0 PYT}
{2310606000 -14400 0 PYT}
{2327544000 -10800 1 PYST}
{2343870000 -14400 0 PYT}
{2342660400 -14400 0 PYT}
{2358993600 -10800 1 PYST}
{2375319600 -14400 0 PYT}
{2374110000 -14400 0 PYT}
{2390443200 -10800 1 PYST}
{2406769200 -14400 0 PYT}
{2405559600 -14400 0 PYT}
{2422497600 -10800 1 PYST}
{2438823600 -14400 0 PYT}
{2437009200 -14400 0 PYT}
{2453947200 -10800 1 PYST}
{2470273200 -14400 0 PYT}
{2468458800 -14400 0 PYT}
{2485396800 -10800 1 PYST}
{2501722800 -14400 0 PYT}
{2500513200 -14400 0 PYT}
{2516846400 -10800 1 PYST}
{2533172400 -14400 0 PYT}
{2531962800 -14400 0 PYT}
{2548296000 -10800 1 PYST}
{2564622000 -14400 0 PYT}
{2563412400 -14400 0 PYT}
{2579745600 -10800 1 PYST}
{2596676400 -14400 0 PYT}
{2594862000 -14400 0 PYT}
{2611800000 -10800 1 PYST}
{2628126000 -14400 0 PYT}
{2626311600 -14400 0 PYT}
{2643249600 -10800 1 PYST}
{2659575600 -14400 0 PYT}
{2657761200 -14400 0 PYT}
{2674699200 -10800 1 PYST}
{2691025200 -14400 0 PYT}
{2689815600 -14400 0 PYT}
{2706148800 -10800 1 PYST}
{2722474800 -14400 0 PYT}
{2721265200 -14400 0 PYT}
{2737598400 -10800 1 PYST}
{2753924400 -14400 0 PYT}
{2752714800 -14400 0 PYT}
{2769652800 -10800 1 PYST}
{2785978800 -14400 0 PYT}
{2784164400 -14400 0 PYT}
{2801102400 -10800 1 PYST}
{2817428400 -14400 0 PYT}
{2815614000 -14400 0 PYT}
{2832552000 -10800 1 PYST}
{2848878000 -14400 0 PYT}
{2847668400 -14400 0 PYT}
{2864001600 -10800 1 PYST}
{2880327600 -14400 0 PYT}
{2879118000 -14400 0 PYT}
{2895451200 -10800 1 PYST}
{2911777200 -14400 0 PYT}
{2910567600 -14400 0 PYT}
{2926900800 -10800 1 PYST}
{2943226800 -14400 0 PYT}
{2942017200 -14400 0 PYT}
{2958955200 -10800 1 PYST}
{2975281200 -14400 0 PYT}
{2973466800 -14400 0 PYT}
{2990404800 -10800 1 PYST}
{3006730800 -14400 0 PYT}
{3004916400 -14400 0 PYT}
{3021854400 -10800 1 PYST}
{3038180400 -14400 0 PYT}
{3036970800 -14400 0 PYT}
{3053304000 -10800 1 PYST}
{3069630000 -14400 0 PYT}
{3068420400 -14400 0 PYT}
{3084753600 -10800 1 PYST}
{3101079600 -14400 0 PYT}
{3099870000 -14400 0 PYT}
{3116808000 -10800 1 PYST}
{3133134000 -14400 0 PYT}
{3131319600 -14400 0 PYT}
{3148257600 -10800 1 PYST}
{3164583600 -14400 0 PYT}
{3162769200 -14400 0 PYT}
{3179707200 -10800 1 PYST}
{3196033200 -14400 0 PYT}
{3194218800 -14400 0 PYT}
{3211156800 -10800 1 PYST}
{3227482800 -14400 0 PYT}
{3226273200 -14400 0 PYT}
{3242606400 -10800 1 PYST}
{3258932400 -14400 0 PYT}
{3257722800 -14400 0 PYT}
{3274056000 -10800 1 PYST}
{3290382000 -14400 0 PYT}
{3289172400 -14400 0 PYT}
{3306110400 -10800 1 PYST}
{3322436400 -14400 0 PYT}
{3320622000 -14400 0 PYT}
{3337560000 -10800 1 PYST}
{3353886000 -14400 0 PYT}
{3352071600 -14400 0 PYT}
{3369009600 -10800 1 PYST}
{3385335600 -14400 0 PYT}
{3384126000 -14400 0 PYT}
{3400459200 -10800 1 PYST}
{3416785200 -14400 0 PYT}
{3415575600 -14400 0 PYT}
{3431908800 -10800 1 PYST}
{3448234800 -14400 0 PYT}
{3447025200 -14400 0 PYT}
{3463358400 -10800 1 PYST}
{3480289200 -14400 0 PYT}
{3478474800 -14400 0 PYT}
{3495412800 -10800 1 PYST}
{3511738800 -14400 0 PYT}
{3509924400 -14400 0 PYT}
{3526862400 -10800 1 PYST}
{3543188400 -14400 0 PYT}
{3541374000 -14400 0 PYT}
{3558312000 -10800 1 PYST}
{3574638000 -14400 0 PYT}
{3573428400 -14400 0 PYT}
{3589761600 -10800 1 PYST}
{3606087600 -14400 0 PYT}
{3604878000 -14400 0 PYT}
{3621211200 -10800 1 PYST}
{3637537200 -14400 0 PYT}
{3636327600 -14400 0 PYT}
{3653265600 -10800 1 PYST}
{3669591600 -14400 0 PYT}
{3667777200 -14400 0 PYT}
{3684715200 -10800 1 PYST}
{3701041200 -14400 0 PYT}
{3699226800 -14400 0 PYT}
{3716164800 -10800 1 PYST}
{3732490800 -14400 0 PYT}
{3731281200 -14400 0 PYT}
{3747614400 -10800 1 PYST}
{3763940400 -14400 0 PYT}
{3762730800 -14400 0 PYT}
{3779064000 -10800 1 PYST}
{3795390000 -14400 0 PYT}
{3794180400 -14400 0 PYT}
{3810513600 -10800 1 PYST}
{3826839600 -14400 0 PYT}
{3825630000 -14400 0 PYT}
{3842568000 -10800 1 PYST}
{3858894000 -14400 0 PYT}
{3857079600 -14400 0 PYT}
{3874017600 -10800 1 PYST}
{3890343600 -14400 0 PYT}
{3888529200 -14400 0 PYT}
{3905467200 -10800 1 PYST}
{3921793200 -14400 0 PYT}
{3920583600 -14400 0 PYT}
{3936916800 -10800 1 PYST}
{3953242800 -14400 0 PYT}
{3952033200 -14400 0 PYT}
{3968366400 -10800 1 PYST}
{3984692400 -14400 0 PYT}
{3983482800 -14400 0 PYT}
{4000420800 -10800 1 PYST}
{4016746800 -14400 0 PYT}
{4014932400 -14400 0 PYT}
{4031870400 -10800 1 PYST}
{4048196400 -14400 0 PYT}
{4046382000 -14400 0 PYT}
{4063320000 -10800 1 PYST}
{4079646000 -14400 0 PYT}
{4077831600 -14400 0 PYT}
{4094769600 -10800 1 PYST}
}
+2 -2
View File
@@ -2,6 +2,6 @@
set TZData(:America/Cayman) {
{-9223372036854775808 -19532 0 LMT}
{-2524502068 -18432 0 KMT}
{-1827687168 -18000 0 EST}
{-2524502068 -18431 0 KMT}
{-1827687169 -18000 0 EST}
}
+3 -4
View File
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Dominica) {
{-9223372036854775808 -14736 0 LMT}
{-1846266804 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/Dominica) $TZData(:America/Port_of_Spain)
+2 -2
View File
@@ -2,8 +2,8 @@
set TZData(:America/Grand_Turk) {
{-9223372036854775808 -17072 0 LMT}
{-2524504528 -18432 0 KMT}
{-1827687168 -18000 0 EST}
{-2524504528 -18431 0 KMT}
{-1827687169 -18000 0 EST}
{294217200 -14400 1 EDT}
{309938400 -18000 0 EST}
{325666800 -14400 1 EDT}
+3 -4
View File
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Grenada) {
{-9223372036854775808 -14820 0 LMT}
{-1846266780 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/Grenada) $TZData(:America/Port_of_Spain)
+3 -4
View File
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Guadeloupe) {
{-9223372036854775808 -14768 0 LMT}
{-1848254032 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/Guadeloupe) $TZData(:America/Port_of_Spain)
+3 -3
View File
@@ -1,9 +1,9 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Jamaica) {
{-9223372036854775808 -18432 0 LMT}
{-2524503168 -18432 0 KMT}
{-1827687168 -18000 0 EST}
{-9223372036854775808 -18431 0 LMT}
{-2524503169 -18431 0 KMT}
{-1827687169 -18000 0 EST}
{136364400 -14400 0 EDT}
{152085600 -18000 0 EST}
{162370800 -14400 1 EDT}
+3 -3
View File
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
if {![info exists TZData(America/Guadeloupe)]} {
LoadTimeZoneFile America/Guadeloupe
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/Marigot) $TZData(:America/Guadeloupe)
set TZData(:America/Marigot) $TZData(:America/Port_of_Spain)
+3 -4
View File
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Montserrat) {
{-9223372036854775808 -14932 0 LMT}
{-1846266608 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/Montserrat) $TZData(:America/Port_of_Spain)
+3 -3
View File
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
if {![info exists TZData(America/Guadeloupe)]} {
LoadTimeZoneFile America/Guadeloupe
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/St_Barthelemy) $TZData(:America/Guadeloupe)
set TZData(:America/St_Barthelemy) $TZData(:America/Port_of_Spain)
+3 -4
View File
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/St_Kitts) {
{-9223372036854775808 -15052 0 LMT}
{-1825098548 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/St_Kitts) $TZData(:America/Port_of_Spain)
+3 -5
View File
@@ -1,7 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/St_Lucia) {
{-9223372036854775808 -14640 0 LMT}
{-2524506960 -14640 0 CMT}
{-1830369360 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/St_Lucia) $TZData(:America/Port_of_Spain)
+3 -4
View File
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/St_Thomas) {
{-9223372036854775808 -15584 0 LMT}
{-1846266016 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/St_Thomas) $TZData(:America/Port_of_Spain)
+3 -5
View File
@@ -1,7 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/St_Vincent) {
{-9223372036854775808 -14696 0 LMT}
{-2524506904 -14696 0 KMT}
{-1830369304 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/St_Vincent) $TZData(:America/Port_of_Spain)
+3 -4
View File
@@ -1,6 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:America/Tortola) {
{-9223372036854775808 -15508 0 LMT}
{-1846266092 -14400 0 AST}
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/Tortola) $TZData(:America/Port_of_Spain)
+3 -3
View File
@@ -1,5 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
if {![info exists TZData(America/St_Thomas)]} {
LoadTimeZoneFile America/St_Thomas
if {![info exists TZData(America/Port_of_Spain)]} {
LoadTimeZoneFile America/Port_of_Spain
}
set TZData(:America/Virgin) $TZData(:America/St_Thomas)
set TZData(:America/Virgin) $TZData(:America/Port_of_Spain)
+2 -7
View File
@@ -2,16 +2,11 @@
set TZData(:Antarctica/Macquarie) {
{-9223372036854775808 0 0 zzz}
{-1861920000 36000 0 EST}
{-2214259200 36000 0 EST}
{-1680508800 39600 1 EST}
{-1669892400 39600 0 EST}
{-1665392400 36000 0 EST}
{-883641600 39600 1 EST}
{-876128400 36000 0 EST}
{-860400000 39600 1 EST}
{-844678800 36000 0 EST}
{-828345600 39600 1 EST}
{-813229200 36000 0 EST}
{-1601719200 0 0 zzz}
{-94730400 36000 0 EST}
{-71136000 39600 1 EST}
{-55411200 36000 0 EST}
+3 -255
View File
@@ -1,257 +1,5 @@
# created by tools/tclZIC.tcl - do not edit
set TZData(:Antarctica/McMurdo) {
{-9223372036854775808 0 0 zzz}
{-441849600 43200 0 NZST}
{152632800 46800 1 NZDT}
{162309600 43200 0 NZST}
{183477600 46800 1 NZDT}
{194968800 43200 0 NZST}
{215532000 46800 1 NZDT}
{226418400 43200 0 NZST}
{246981600 46800 1 NZDT}
{257868000 43200 0 NZST}
{278431200 46800 1 NZDT}
{289317600 43200 0 NZST}
{309880800 46800 1 NZDT}
{320767200 43200 0 NZST}
{341330400 46800 1 NZDT}
{352216800 43200 0 NZST}
{372780000 46800 1 NZDT}
{384271200 43200 0 NZST}
{404834400 46800 1 NZDT}
{415720800 43200 0 NZST}
{436284000 46800 1 NZDT}
{447170400 43200 0 NZST}
{467733600 46800 1 NZDT}
{478620000 43200 0 NZST}
{499183200 46800 1 NZDT}
{510069600 43200 0 NZST}
{530632800 46800 1 NZDT}
{541519200 43200 0 NZST}
{562082400 46800 1 NZDT}
{573573600 43200 0 NZST}
{594136800 46800 1 NZDT}
{605023200 43200 0 NZST}
{623772000 46800 1 NZDT}
{637682400 43200 0 NZST}
{655221600 46800 1 NZDT}
{669132000 43200 0 NZST}
{686671200 46800 1 NZDT}
{700581600 43200 0 NZST}
{718120800 46800 1 NZDT}
{732636000 43200 0 NZST}
{749570400 46800 1 NZDT}
{764085600 43200 0 NZST}
{781020000 46800 1 NZDT}
{795535200 43200 0 NZST}
{812469600 46800 1 NZDT}
{826984800 43200 0 NZST}
{844524000 46800 1 NZDT}
{858434400 43200 0 NZST}
{875973600 46800 1 NZDT}
{889884000 43200 0 NZST}
{907423200 46800 1 NZDT}
{921938400 43200 0 NZST}
{938872800 46800 1 NZDT}
{953388000 43200 0 NZST}
{970322400 46800 1 NZDT}
{984837600 43200 0 NZST}
{1002376800 46800 1 NZDT}
{1016287200 43200 0 NZST}
{1033826400 46800 1 NZDT}
{1047736800 43200 0 NZST}
{1065276000 46800 1 NZDT}
{1079791200 43200 0 NZST}
{1096725600 46800 1 NZDT}
{1111240800 43200 0 NZST}
{1128175200 46800 1 NZDT}
{1142690400 43200 0 NZST}
{1159624800 46800 1 NZDT}
{1174140000 43200 0 NZST}
{1191074400 46800 1 NZDT}
{1207404000 43200 0 NZST}
{1222524000 46800 1 NZDT}
{1238853600 43200 0 NZST}
{1253973600 46800 1 NZDT}
{1270303200 43200 0 NZST}
{1285423200 46800 1 NZDT}
{1301752800 43200 0 NZST}
{1316872800 46800 1 NZDT}
{1333202400 43200 0 NZST}
{1348927200 46800 1 NZDT}
{1365256800 43200 0 NZST}
{1380376800 46800 1 NZDT}
{1396706400 43200 0 NZST}
{1411826400 46800 1 NZDT}
{1428156000 43200 0 NZST}
{1443276000 46800 1 NZDT}
{1459605600 43200 0 NZST}
{1474725600 46800 1 NZDT}
{1491055200 43200 0 NZST}
{1506175200 46800 1 NZDT}
{1522504800 43200 0 NZST}
{1538229600 46800 1 NZDT}
{1554559200 43200 0 NZST}
{1569679200 46800 1 NZDT}
{1586008800 43200 0 NZST}
{1601128800 46800 1 NZDT}
{1617458400 43200 0 NZST}
{1632578400 46800 1 NZDT}
{1648908000 43200 0 NZST}
{1664028000 46800 1 NZDT}
{1680357600 43200 0 NZST}
{1695477600 46800 1 NZDT}
{1712412000 43200 0 NZST}
{1727532000 46800 1 NZDT}
{1743861600 43200 0 NZST}
{1758981600 46800 1 NZDT}
{1775311200 43200 0 NZST}
{1790431200 46800 1 NZDT}
{1806760800 43200 0 NZST}
{1821880800 46800 1 NZDT}
{1838210400 43200 0 NZST}
{1853330400 46800 1 NZDT}
{1869660000 43200 0 NZST}
{1885384800 46800 1 NZDT}
{1901714400 43200 0 NZST}
{1916834400 46800 1 NZDT}
{1933164000 43200 0 NZST}
{1948284000 46800 1 NZDT}
{1964613600 43200 0 NZST}
{1979733600 46800 1 NZDT}
{1996063200 43200 0 NZST}
{2011183200 46800 1 NZDT}
{2027512800 43200 0 NZST}
{2042632800 46800 1 NZDT}
{2058962400 43200 0 NZST}
{2074687200 46800 1 NZDT}
{2091016800 43200 0 NZST}
{2106136800 46800 1 NZDT}
{2122466400 43200 0 NZST}
{2137586400 46800 1 NZDT}
{2153916000 43200 0 NZST}
{2169036000 46800 1 NZDT}
{2185365600 43200 0 NZST}
{2200485600 46800 1 NZDT}
{2216815200 43200 0 NZST}
{2232540000 46800 1 NZDT}
{2248869600 43200 0 NZST}
{2263989600 46800 1 NZDT}
{2280319200 43200 0 NZST}
{2295439200 46800 1 NZDT}
{2311768800 43200 0 NZST}
{2326888800 46800 1 NZDT}
{2343218400 43200 0 NZST}
{2358338400 46800 1 NZDT}
{2374668000 43200 0 NZST}
{2389788000 46800 1 NZDT}
{2406117600 43200 0 NZST}
{2421842400 46800 1 NZDT}
{2438172000 43200 0 NZST}
{2453292000 46800 1 NZDT}
{2469621600 43200 0 NZST}
{2484741600 46800 1 NZDT}
{2501071200 43200 0 NZST}
{2516191200 46800 1 NZDT}
{2532520800 43200 0 NZST}
{2547640800 46800 1 NZDT}
{2563970400 43200 0 NZST}
{2579090400 46800 1 NZDT}
{2596024800 43200 0 NZST}
{2611144800 46800 1 NZDT}
{2627474400 43200 0 NZST}
{2642594400 46800 1 NZDT}
{2658924000 43200 0 NZST}
{2674044000 46800 1 NZDT}
{2690373600 43200 0 NZST}
{2705493600 46800 1 NZDT}
{2721823200 43200 0 NZST}
{2736943200 46800 1 NZDT}
{2753272800 43200 0 NZST}
{2768997600 46800 1 NZDT}
{2785327200 43200 0 NZST}
{2800447200 46800 1 NZDT}
{2816776800 43200 0 NZST}
{2831896800 46800 1 NZDT}
{2848226400 43200 0 NZST}
{2863346400 46800 1 NZDT}
{2879676000 43200 0 NZST}
{2894796000 46800 1 NZDT}
{2911125600 43200 0 NZST}
{2926245600 46800 1 NZDT}
{2942575200 43200 0 NZST}
{2958300000 46800 1 NZDT}
{2974629600 43200 0 NZST}
{2989749600 46800 1 NZDT}
{3006079200 43200 0 NZST}
{3021199200 46800 1 NZDT}
{3037528800 43200 0 NZST}
{3052648800 46800 1 NZDT}
{3068978400 43200 0 NZST}
{3084098400 46800 1 NZDT}
{3100428000 43200 0 NZST}
{3116152800 46800 1 NZDT}
{3132482400 43200 0 NZST}
{3147602400 46800 1 NZDT}
{3163932000 43200 0 NZST}
{3179052000 46800 1 NZDT}
{3195381600 43200 0 NZST}
{3210501600 46800 1 NZDT}
{3226831200 43200 0 NZST}
{3241951200 46800 1 NZDT}
{3258280800 43200 0 NZST}
{3273400800 46800 1 NZDT}
{3289730400 43200 0 NZST}
{3305455200 46800 1 NZDT}
{3321784800 43200 0 NZST}
{3336904800 46800 1 NZDT}
{3353234400 43200 0 NZST}
{3368354400 46800 1 NZDT}
{3384684000 43200 0 NZST}
{3399804000 46800 1 NZDT}
{3416133600 43200 0 NZST}
{3431253600 46800 1 NZDT}
{3447583200 43200 0 NZST}
{3462703200 46800 1 NZDT}
{3479637600 43200 0 NZST}
{3494757600 46800 1 NZDT}
{3511087200 43200 0 NZST}
{3526207200 46800 1 NZDT}
{3542536800 43200 0 NZST}
{3557656800 46800 1 NZDT}
{3573986400 43200 0 NZST}
{3589106400 46800 1 NZDT}
{3605436000 43200 0 NZST}
{3620556000 46800 1 NZDT}
{3636885600 43200 0 NZST}
{3652610400 46800 1 NZDT}
{3668940000 43200 0 NZST}
{3684060000 46800 1 NZDT}
{3700389600 43200 0 NZST}
{3715509600 46800 1 NZDT}
{3731839200 43200 0 NZST}
{3746959200 46800 1 NZDT}
{3763288800 43200 0 NZST}
{3778408800 46800 1 NZDT}
{3794738400 43200 0 NZST}
{3809858400 46800 1 NZDT}
{3826188000 43200 0 NZST}
{3841912800 46800 1 NZDT}
{3858242400 43200 0 NZST}
{3873362400 46800 1 NZDT}
{3889692000 43200 0 NZST}
{3904812000 46800 1 NZDT}
{3921141600 43200 0 NZST}
{3936261600 46800 1 NZDT}
{3952591200 43200 0 NZST}
{3967711200 46800 1 NZDT}
{3984040800 43200 0 NZST}
{3999765600 46800 1 NZDT}
{4016095200 43200 0 NZST}
{4031215200 46800 1 NZDT}
{4047544800 43200 0 NZST}
{4062664800 46800 1 NZDT}
{4078994400 43200 0 NZST}
{4094114400 46800 1 NZDT}
if {![info exists TZData(Pacific/Auckland)]} {
LoadTimeZoneFile Pacific/Auckland
}
set TZData(:Antarctica/McMurdo) $TZData(:Pacific/Auckland)

Some files were not shown because too many files have changed in this diff Show More