Check-in [93ad5b0c95]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge
Timelines: family | ancestors | descendants | both | dgp-refactor
Files: files | file ages | folders
SHA1: 93ad5b0c958326c070873eb22c0eeff87b30dd72
User & Date: dgp 2010-04-29 23:32:22.000
Context
2010-04-30
00:19
merge check-in: 0271b14a9b user: dgp tags: dgp-refactor
2010-04-29
23:32
merge check-in: 93ad5b0c95 user: dgp tags: dgp-refactor
2010-04-26
13:46
merge check-in: 6707900dc0 user: dgp tags: dgp-refactor
Changes
Unified Diff Ignore Whitespace Patch
Changes to ChangeLog.



































































































1




2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48



































































































2010-04-26  Donal K. Fellows  <dkf@users.sf.net>





	* generic/tclStubInit.c:   Add a small amount of gcc-isms (with #ifdef
	* generic/tclOOStubInit.c: guards) to ensure that warnings are issued
	when these files are older than the various *.decls files.

2010-04-25  Miguel Sofer  <msofer@users.sf.net>

	* generic/tclBasic.c:    Add unsupported [yieldm] command. 
	* generic/tclInt.h:      

2010-04-24  Miguel Sofer  <msofer@users.sf.net>

	* generic/tclBasic.c:    Modify api of TclSpliceTailcall() to fix
	* generic/tclExecute.c:  yieldTo, which had not survived the latest
	* generic/tclInt.h:      mods to tailcall. Thanks kbk for detecting
	the problem.

2010-04-23  Jan Nijtmans  <nijtmans@users.sf.net>

	* unix/tclUnixPort.h: [Bug 2991415]: tclport.h #included before
	limits.h

2010-04-22  Jan Nijtmans  <nijtmans@users.sf.net>

	* generic/tclPlatDecls.h   Move TCHAR fallback typedef from tcl.h to
	* generic/tcl.h            tclPlatDecls.h (as suggested by dgp)
	* generic/tclInt.h         fix typo
	* generic/tclIOUtil.c      Eliminate various unnecessary
	* unix/tclUnixFile.c       type casts.
	* unix/tclUnixPipe.c
	* win/tclWinChan.c
	* win/tclWinFCmd.c
	* win/tclWinFile.c
	* win/tclWinLoad.c
	* win/tclWinPipe.c

2010-04-20  Jan Nijtmans  <nijtmans@users.sf.net>

	* generic/tclTest.c   Use function prototypes from the FS API.
	* compat/zlib/*       Upgrade to zlib 1.2.5

2010-04-19  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclExecute.c (TclExecuteByteCode): Improve commenting and
	reduce indentation for the Invocation Block.

2010-04-18  Donal K. Fellows  <dkf@users.sf.net>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>







|
|




|










|
|
|
|
|
|
|
|
|
|
|



|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
2010-04-29  Andreas Kupries  <andreask@activestate.com>

	* library/platform/platform.tcl: Another stab at getting the /lib,
	* library/platform/pkgIndex.tcl: /lib64 difference right for
	* unix/Makefile.in: linux. Package updated to version 1.0.7.
	* win/Makefile.in:

2010-04-29  Kevin B. Kenny  <kennykb@acm.org>
	
	* library/tzdata/Antarctica/Macquarie:
	* library/tzdata/Africa/Casablanca:
	* library/tzdata/Africa/Tunis:
	* library/tzdata/America/Santiago:
	* library/tzdata/America/Argentina/San_Luis:
	* library/tzdata/Antarctica/Casey:
	* library/tzdata/Antarctica/Davis:
	* library/tzdata/Asia/Anadyr:
	* library/tzdata/Asia/Damascus:
	* library/tzdata/Asia/Dhaka:
	* library/tzdata/Asia/Gaza:
	* library/tzdata/Asia/Kamchatka:
	* library/tzdata/Asia/Karachi:
	* library/tzdata/Asia/Taipei:
	* library/tzdata/Europe/Samara:
	* library/tzdata/Pacific/Apia:
	* library/tzdata/Pacific/Easter:
	* library/tzdata/Pacific/Fiji:   Olson's tzdata2010i.
	
2010-04-29  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclBinary.c (TclAppendBytesToByteArray): [Bug 2992970]: Make
	* generic/tclStringObj.c (Tcl_AppendObjToObj): an append of a byte
	array to another into an efficent operation. The problem was the (lack
	of) a proper growth management strategy for the byte array.

2010-04-29  Jan Nijtmans  <nijtmans@users.sf.net>

	* compat/dirent2.h:	Include "tcl.h", not <tcl.h>, like everywhere
	* compat/dlfcn.h:	else, to ensure that the version in the Tcl
	* compat/stdlib.h:	distribution is used, not some version from
	* compat/string.h:	somewhere else.
	* compat/unistd.h:

2010-04-28  Jan Nijtmans  <nijtmans@users.sf.net>

	* win/Makefile.in:	Remove unused @MAN2TCLFLAGS@
	* win/tclWinPort.h:	Move <limits.h> include from tclInt.h to
	* generic/tclInt.h:	tclWinPort.h, and eliminate unneeded
	* generic/tclEnv.c:	<stdlib.h>, <stdio.h> and <string.h>, which
				are already in tclInt.h
	* generic/regcustom.h:	Move "tclInt.h" from regcustom.h up to
	* generic/regex.h:	regex.h.
	* generic/tclAlloc.c:	Unneeded <stdio.h> include.
	* generic/tclExecute.c:	Fix gcc warning: comparison between signed and
				unsigned.

2010-04-28  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclInt.h (TclIsVarDirectUnsettable): Corrected flags so that
	deletion of traces is not optimized out...

	* generic/tclExecute.c (ExecuteExtendedBinaryMathOp)
	(TclCompareTwoNumbers,ExecuteExtendedUnaryMathOp,TclExecuteByteCode):
	[Patch 2981677]: Move the less common arithmetic operations (i.e.,
	exponentiation and operations on non-longs) out of TEBC for a big drop
	in the overall size of the stack frame for most code. Net effect on
	speed is minimal (slightly faster overall in tclbench). Also extended
	the number of places where TRESULT handling is replaced with a jump to
	dedicated code.

2010-04-27  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclExecute.c (TclExecuteByteCode): Rearrange location of an
	assignment to shorten the object code.

2010-04-27  Jan Nijtmans  <nijtmans@users.sf.net>

	* generic/tclIOUtil.c (Tcl_FSGetNativePath): [Bug 2992292]:
	tclIOUtil.c assignment type mismatch compiler warning
	* generic/regguts.h:     If tclInt.h or tclPort.h is already
	* generic/tclBasic.c:    included, don't include <limits.h>
	* generic/tclExecute.c:  again. Follow-up to [Bug 2991415]:
	* generic/tclIORChan.c:  tclport.h #included before limits.h
	* generic/tclIORTrans.c: See comments in [Bug 2991415]
	* generic/tclObj.c:
	* generic/tclOOInt.h:
	* generic/tclStrToD.c:
	* generic/tclTomMath.h:
	* generic/tclTomMathInterface.c:
	* generic/tclUtil.c:
	* compat/strtod.c:
	* compat/strtol.c:

2010-04-27  Kevin B. Kenny  <kennykb@acm.org>

	* unix/tclLoadDl.c (FindSymbol): [Bug 2992295]: Simplified the logic
	so that the casts added in Donal Fellows's change for the same bug are
	no longer necessary.

2010-04-26  Donal K. Fellows  <dkf@users.sf.net>

	* unix/tclLoadDl.c (FindSymbol): [Bug 2992295]: Added an explicit cast
	because auto-casting between function and non-function types is never
	naturally warning-free.

	* generic/tclStubInit.c:   Add a small amount of gcc-isms (with #ifdef
	* generic/tclOOStubInit.c: guards) to ensure that warnings are issued
	when these files are older than the various *.decls files.

2010-04-25  Miguel Sofer  <msofer@users.sf.net>

	* generic/tclBasic.c:    Add unsupported [yieldm] command. Credit
	* generic/tclInt.h:      Lars Hellstrom for the basic idea.

2010-04-24  Miguel Sofer  <msofer@users.sf.net>

	* generic/tclBasic.c:    Modify api of TclSpliceTailcall() to fix
	* generic/tclExecute.c:  [yieldTo], which had not survived the latest
	* generic/tclInt.h:      mods to tailcall. Thanks kbk for detecting
	the problem.

2010-04-23  Jan Nijtmans  <nijtmans@users.sf.net>

	* unix/tclUnixPort.h: [Bug 2991415]: tclport.h #included before
	limits.h

2010-04-22  Jan Nijtmans  <nijtmans@users.sf.net>

	* generic/tclPlatDecls.h:  Move TCHAR fallback typedef from tcl.h to
	* generic/tcl.h:           tclPlatDecls.h (as suggested by dgp)
	* generic/tclInt.h:        fix typo
	* generic/tclIOUtil.c:     Eliminate various unnecessary
	* unix/tclUnixFile.c:      type casts.
	* unix/tclUnixPipe.c:
	* win/tclWinChan.c:
	* win/tclWinFCmd.c:
	* win/tclWinFile.c:
	* win/tclWinLoad.c:
	* win/tclWinPipe.c:

2010-04-20  Jan Nijtmans  <nijtmans@users.sf.net>

	* generic/tclTest.c:  Use function prototypes from the FS API.
	* compat/zlib/*:      Upgrade to zlib 1.2.5

2010-04-19  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclExecute.c (TclExecuteByteCode): Improve commenting and
	reduce indentation for the Invocation Block.

2010-04-18  Donal K. Fellows  <dkf@users.sf.net>
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
	* generic/tclIOUtil.c (Tcl_LoadFile): Corrections to previous commit
	* unix/tclLoadDyld.c (TclpDlopen):    to make it build on OSX.

2010-04-02  Kevin B. Kenny  <kennykb@acm.org>

	TIP #357 IMPLEMENTATION
	TIP #362 IMPLEMENTATION
	
	* generic/tclStrToD.c: [Bug 2952904]: Defer creation of the smallest
	floating point number until it is actually used. (This change avoids a
	bogus syslog message regarding a 'floating point software assist
	fault' on SGI systems.)

	* library/reg/pkgIndex.tcl:	[TIP #362]: Fixed first round of bugs
	* tests/registry.test:		resulting from the recent commits of







|







258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
	* generic/tclIOUtil.c (Tcl_LoadFile): Corrections to previous commit
	* unix/tclLoadDyld.c (TclpDlopen):    to make it build on OSX.

2010-04-02  Kevin B. Kenny  <kennykb@acm.org>

	TIP #357 IMPLEMENTATION
	TIP #362 IMPLEMENTATION

	* generic/tclStrToD.c: [Bug 2952904]: Defer creation of the smallest
	floating point number until it is actually used. (This change avoids a
	bogus syslog message regarding a 'floating point software assist
	fault' on SGI systems.)

	* library/reg/pkgIndex.tcl:	[TIP #362]: Fixed first round of bugs
	* tests/registry.test:		resulting from the recent commits of
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
	* unix/tclLoadDyld.c:
	* unix/tclLoadNext.c:
	* unix/tclLoadOSF.c:
	* unix/tclLoadShl.c:
	* unix/tclUnixPipe.c:
	* win/Makefile.in:
	* win/tclWinLoad.c:
	
2010-03-31  Donal K. Fellows  <dkf@users.sf.net>

	* doc/registry.n: Added missing documentation of TIP#362 flags.

	* doc/package.n: [Bug 2980210]: Document the arguments taken by
	the [package present] command correctly.








|







287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
	* unix/tclLoadDyld.c:
	* unix/tclLoadNext.c:
	* unix/tclLoadOSF.c:
	* unix/tclLoadShl.c:
	* unix/tclUnixPipe.c:
	* win/Makefile.in:
	* win/tclWinLoad.c:

2010-03-31  Donal K. Fellows  <dkf@users.sf.net>

	* doc/registry.n: Added missing documentation of TIP#362 flags.

	* doc/package.n: [Bug 2980210]: Document the arguments taken by
	the [package present] command correctly.

263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
	* generic/tclExecute.c: [Bug 2976508]: Tcl HEAD fails on HP-UX

2010-03-25  Donal K. Fellows  <dkf@users.sf.net>

	* unix/tclUnixFCmd.c (TclUnixCopyFile): [Bug 2976504]: Corrected
	number of arguments to fstatfs() call.

	* macosx/tclMacOSXBundle.c, macosx/tclMacOSXFCmd.c: 
	* macosx/tclMacOSXNotify.c: Reduce the level of ifdeffery in the
	functions of these files to improve readability. They need to be
	audited for whether complexity can be removed based on the minimum
	supported version of OSX, but that requires a real expert.

2010-03-24  Don Porter  <dgp@users.sourceforge.net>








|







366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
	* generic/tclExecute.c: [Bug 2976508]: Tcl HEAD fails on HP-UX

2010-03-25  Donal K. Fellows  <dkf@users.sf.net>

	* unix/tclUnixFCmd.c (TclUnixCopyFile): [Bug 2976504]: Corrected
	number of arguments to fstatfs() call.

	* macosx/tclMacOSXBundle.c, macosx/tclMacOSXFCmd.c:
	* macosx/tclMacOSXNotify.c: Reduce the level of ifdeffery in the
	functions of these files to improve readability. They need to be
	audited for whether complexity can be removed based on the minimum
	supported version of OSX, but that requires a real expert.

2010-03-24  Don Porter  <dgp@users.sourceforge.net>

881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
	* generic/tcl.h: [Bug 2942081]: Reverted Tcl_ThreadDataKey type change
				Changed some Tcl_CallFrame fields from "char *"
				to "void *". This saves unnecessary space on
				Cray's (and it's simply more correct).

	* tools/genStubs.tcl:	No longer generate a space after "*" and
				immediately after a function name, so the
				format of function definitions in tcl*Decls.h 
				match all other tcl*.h header files.
	* doc/ParseArgs.3:	Change Tcl_ArgvFuncProc, Tcl_ArgvGenFuncProc
	* generic/tcl.h:	and GetFrameInfoValueProc to be function
	* generic/tclInt.h:	definitions, not pointers, for consistency
	* generic/tclOOInt.h:	with all other Tcl function definitions.
	* generic/tclIndexObj.c:
	* generic/regguts.h:	CONST -> const







|







984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
	* generic/tcl.h: [Bug 2942081]: Reverted Tcl_ThreadDataKey type change
				Changed some Tcl_CallFrame fields from "char *"
				to "void *". This saves unnecessary space on
				Cray's (and it's simply more correct).

	* tools/genStubs.tcl:	No longer generate a space after "*" and
				immediately after a function name, so the
				format of function definitions in tcl*Decls.h
				match all other tcl*.h header files.
	* doc/ParseArgs.3:	Change Tcl_ArgvFuncProc, Tcl_ArgvGenFuncProc
	* generic/tcl.h:	and GetFrameInfoValueProc to be function
	* generic/tclInt.h:	definitions, not pointers, for consistency
	* generic/tclOOInt.h:	with all other Tcl function definitions.
	* generic/tclIndexObj.c:
	* generic/regguts.h:	CONST -> const
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
2010-01-22  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclExecute.c (TclExecuteByteCode): Improve error code
	generation from some of the tailcall-related bits of TEBC.

2010-01-21  Miguel Sofer  <msofer@users.sf.net>

	* generic/tclCompile.h: NRE-enable direct eval on BC spoilage 
	* generic/tclExecute.c: [Bug 2910748]
	* tests/nre.test:

2010-01-19  Donal K. Fellows  <dkf@users.sf.net>

	* doc/dict.n: [Bug 2929546]: Clarify just what [dict with] and [dict
	update] are doing with variables.







|







1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
2010-01-22  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclExecute.c (TclExecuteByteCode): Improve error code
	generation from some of the tailcall-related bits of TEBC.

2010-01-21  Miguel Sofer  <msofer@users.sf.net>

	* generic/tclCompile.h: NRE-enable direct eval on BC spoilage
	* generic/tclExecute.c: [Bug 2910748]
	* tests/nre.test:

2010-01-19  Donal K. Fellows  <dkf@users.sf.net>

	* doc/dict.n: [Bug 2929546]: Clarify just what [dict with] and [dict
	update] are doing with variables.
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
2010-01-03  Miguel Sofer  <msofer@users.sf.net>

	* generic/tclBasic.c:	[Bug 2724403]: Fix leak of coroutines on
	* generic/tclCompile.h: namespace deletion. Added a test for this
	* generic/tclNamesp.c:	leak, and also a test for leaks on namespace
	* tests/coroutine.test: deletion.
	* tests/namespace.test:
	
2009-12-30  Donal K. Fellows  <dkf@users.sf.net>

	* library/safe.tcl (AliasSource): [Bug 2923613]: Make the safer
	* tests/safe.test (safe-8.9):	  [source] handle a [return] at the
					  end of the file correctly.

2009-12-30  Miguel Sofer  <msofer@users.sf.net>







|







1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
2010-01-03  Miguel Sofer  <msofer@users.sf.net>

	* generic/tclBasic.c:	[Bug 2724403]: Fix leak of coroutines on
	* generic/tclCompile.h: namespace deletion. Added a test for this
	* generic/tclNamesp.c:	leak, and also a test for leaks on namespace
	* tests/coroutine.test: deletion.
	* tests/namespace.test:

2009-12-30  Donal K. Fellows  <dkf@users.sf.net>

	* library/safe.tcl (AliasSource): [Bug 2923613]: Make the safer
	* tests/safe.test (safe-8.9):	  [source] handle a [return] at the
					  end of the file correctly.

2009-12-30  Miguel Sofer  <msofer@users.sf.net>
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132

	* library/safe.tcl (AliasSource, AliasExeName): [Bug 2913625]: Stop
	information about paths from leaking through [info script] and [info
	nameofexecutable].

2009-12-23  Jan Nijtmans  <nijtmans@users.sf.net>

	* unix/tcl.m4:		Install libtcl8.6.dll in bin directory 
	* unix/Makefile.in:
	* unix/configure:	(regenerated)

2009-12-22  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclCmdIL.c (Tcl_LsortObjCmd): [Bug 2918962]: Stop crash when
	-index and -stride are used together.







|







1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235

	* library/safe.tcl (AliasSource, AliasExeName): [Bug 2913625]: Stop
	information about paths from leaking through [info script] and [info
	nameofexecutable].

2009-12-23  Jan Nijtmans  <nijtmans@users.sf.net>

	* unix/tcl.m4:		Install libtcl8.6.dll in bin directory
	* unix/Makefile.in:
	* unix/configure:	(regenerated)

2009-12-22  Donal K. Fellows  <dkf@users.sf.net>

	* generic/tclCmdIL.c (Tcl_LsortObjCmd): [Bug 2918962]: Stop crash when
	-index and -stride are used together.
Changes to compat/dirent2.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * dirent.h --
 *
 *	Declarations of a library of directory-reading procedures
 *	in the POSIX style ("struct dirent").
 *
 * Copyright (c) 1991 The Regents of the University of California.
 * Copyright (c) 1994 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: dirent2.h,v 1.2.42.1 2008/09/03 06:05:23 dgp Exp $
 */

#ifndef _DIRENT
#define _DIRENT

#ifndef _TCL
#include <tcl.h>
#endif

/*
 * Dirent structure, which holds information about a single
 * directory entry.
 */

#define MAXNAMLEN 255












|





<
|
<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

19

20
21
22
23
24
25
26
/*
 * dirent.h --
 *
 *	Declarations of a library of directory-reading procedures
 *	in the POSIX style ("struct dirent").
 *
 * Copyright (c) 1991 The Regents of the University of California.
 * Copyright (c) 1994 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: dirent2.h,v 1.2.42.2 2010/04/29 23:32:23 dgp Exp $
 */

#ifndef _DIRENT
#define _DIRENT


#include "tcl.h"


/*
 * Dirent structure, which holds information about a single
 * directory entry.
 */

#define MAXNAMLEN 255
Changes to compat/dlfcn.h.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 *	Not derived from licensed software.
 *
 *	Permission is granted to freely use, copy, modify, and redistribute
 *	this software, provided that the author is not construed to be liable
 *	for any results of using the software, alterations are clearly marked
 *	as such, and this notice is not modified.
 *
 * RCS: @(#) $Id: dlfcn.h,v 1.2.42.2 2008/12/18 18:18:33 dgp Exp $
 */

/*
 * @(#)dlfcn.h	1.4 revision of 95/04/25  09:36:52
 * This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
 * 30159 Hannover, Germany
 */

#ifndef __dlfcn_h__
#define __dlfcn_h__

#ifndef _TCL
#include <tcl.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Mode flags for the dlopen routine.







|











<
|
<







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

32

33
34
35
36
37
38
39
 *	Not derived from licensed software.
 *
 *	Permission is granted to freely use, copy, modify, and redistribute
 *	this software, provided that the author is not construed to be liable
 *	for any results of using the software, alterations are clearly marked
 *	as such, and this notice is not modified.
 *
 * RCS: @(#) $Id: dlfcn.h,v 1.2.42.3 2010/04/29 23:32:23 dgp Exp $
 */

/*
 * @(#)dlfcn.h	1.4 revision of 95/04/25  09:36:52
 * This is an unpublished work copyright (c) 1992 HELIOS Software GmbH
 * 30159 Hannover, Germany
 */

#ifndef __dlfcn_h__
#define __dlfcn_h__


#include "tcl.h"


#ifdef __cplusplus
extern "C" {
#endif

/*
 * Mode flags for the dlopen routine.
Changes to compat/stdlib.h.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 *
 * Copyright (c) 1991 The Regents of the University of California.
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: stdlib.h,v 1.3.36.1 2008/05/11 04:22:34 dgp Exp $
 */

#ifndef _STDLIB
#define _STDLIB

#include <tcl.h>
/* TODO: Do we need tcl.h any more? */

extern void		abort(void);
extern double		atof(const char *string);
extern int		atoi(const char *string);
extern long		atol(const char *string);
extern char *		calloc(unsigned int numElements, unsigned int size);
extern void		exit(int status);
extern int		free(char *blockPtr);







|





<
<
<







9
10
11
12
13
14
15
16
17
18
19
20
21



22
23
24
25
26
27
28
 *
 * Copyright (c) 1991 The Regents of the University of California.
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: stdlib.h,v 1.3.36.2 2010/04/29 23:32:23 dgp Exp $
 */

#ifndef _STDLIB
#define _STDLIB




extern void		abort(void);
extern double		atof(const char *string);
extern int		atoi(const char *string);
extern long		atol(const char *string);
extern char *		calloc(unsigned int numElements, unsigned int size);
extern void		exit(int status);
extern int		free(char *blockPtr);
Changes to compat/string.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * string.h --
 *
 *	Declarations of ANSI C library procedures for string handling.
 *
 * Copyright (c) 1991-1993 The Regents of the University of California.
 * Copyright (c) 1994-1996 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: string.h,v 1.4.20.3 2008/05/11 04:22:34 dgp Exp $
 */

#ifndef _STRING
#define _STRING

#include <tcl.h>

/*
 * The following #include is needed to define size_t. (This used to include
 * sys/stdtypes.h but that doesn't exist on older versions of SunOS, e.g.
 * 4.0.2, so I'm trying sys/types.h now.... hopefully it exists everywhere)
 */












|





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * string.h --
 *
 *	Declarations of ANSI C library procedures for string handling.
 *
 * Copyright (c) 1991-1993 The Regents of the University of California.
 * Copyright (c) 1994-1996 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: string.h,v 1.4.20.4 2010/04/29 23:32:23 dgp Exp $
 */

#ifndef _STRING
#define _STRING

#include "tcl.h"

/*
 * The following #include is needed to define size_t. (This used to include
 * sys/stdtypes.h but that doesn't exist on older versions of SunOS, e.g.
 * 4.0.2, so I'm trying sys/types.h now.... hopefully it exists everywhere)
 */

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
extern char *		strcpy(char *dst, const char *src);
extern size_t		strcspn(const char *string, const char *chars);
extern char *		strdup(const char *string);
extern char *		strerror(int error);
extern size_t		strlen(const char *string);
extern int		strncasecmp(const char *s1, const char *s2, size_t n);
extern char *		strncat(char *dst, const char *src, size_t numChars);
extern int		strncmp(const char *s1, const char *s2,size_t nChars);
extern char *		strncpy(char *dst, const char *src, size_t numChars);
extern char *		strpbrk(const char *string, const char *chars);
extern char *		strrchr(const char *string, int c);
extern size_t		strspn(const char *string, const char *chars);
extern char *		strstr(const char *string, const char *substring);
extern char *		strtok(char *s, const char *delim);

#endif /* _STRING */







|








46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
extern char *		strcpy(char *dst, const char *src);
extern size_t		strcspn(const char *string, const char *chars);
extern char *		strdup(const char *string);
extern char *		strerror(int error);
extern size_t		strlen(const char *string);
extern int		strncasecmp(const char *s1, const char *s2, size_t n);
extern char *		strncat(char *dst, const char *src, size_t numChars);
extern int		strncmp(const char *s1, const char *s2, size_t nChars);
extern char *		strncpy(char *dst, const char *src, size_t numChars);
extern char *		strpbrk(const char *string, const char *chars);
extern char *		strrchr(const char *string, int c);
extern size_t		strspn(const char *string, const char *chars);
extern char *		strstr(const char *string, const char *substring);
extern char *		strtok(char *s, const char *delim);

#endif /* _STRING */
Changes to compat/strtod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* 
 * strtod.c --
 *
 *	Source code for the "strtod" library procedure.
 *
 * Copyright (c) 1988-1993 The Regents of the University of California.
 * Copyright (c) 1994 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: strtod.c,v 1.6.4.4 2010/03/05 04:21:34 dgp Exp $
 */

#include "tclInt.h"
#include <ctype.h>

#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#ifndef NULL
#define NULL 0











|



<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

16
17
18
19
20
21
22
/* 
 * strtod.c --
 *
 *	Source code for the "strtod" library procedure.
 *
 * Copyright (c) 1988-1993 The Regents of the University of California.
 * Copyright (c) 1994 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: strtod.c,v 1.6.4.5 2010/04/29 23:32:23 dgp Exp $
 */

#include "tclInt.h"


#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#ifndef NULL
#define NULL 0
Changes to compat/strtol.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* 
 * strtol.c --
 *
 *	Source code for the "strtol" library procedure.
 *
 * Copyright (c) 1988 The Regents of the University of California.
 * Copyright (c) 1994 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: strtol.c,v 1.4.4.3 2008/05/11 04:22:34 dgp Exp $
 */

#include <ctype.h>
#include "tclInt.h"

/*
 *----------------------------------------------------------------------
 *
 * strtol --
 *











|


<







1
2
3
4
5
6
7
8
9
10
11
12
13
14

15
16
17
18
19
20
21
/* 
 * strtol.c --
 *
 *	Source code for the "strtol" library procedure.
 *
 * Copyright (c) 1988 The Regents of the University of California.
 * Copyright (c) 1994 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: strtol.c,v 1.4.4.4 2010/04/29 23:32:23 dgp Exp $
 */


#include "tclInt.h"

/*
 *----------------------------------------------------------------------
 *
 * strtol --
 *
Changes to compat/unistd.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * unistd.h --
 *
 *      Macros, constants and prototypes for Posix conformance.
 *
 * Copyright 1989 Regents of the University of California Permission to use,
 * copy, modify, and distribute this software and its documentation for any
 * purpose and without fee is hereby granted, provided that the above
 * copyright notice appear in all copies. The University of California makes
 * no representations about the suitability of this software for any purpose.
 * It is provided "as is" without express or implied warranty.
 *
 * RCS: @(#) $Id: unistd.h,v 1.2.42.1 2008/05/11 04:22:34 dgp Exp $
 */

#ifndef _UNISTD
#define _UNISTD

#include <sys/types.h>
#ifndef _TCL
#   include "tcl.h"
#endif

#ifndef NULL
#define NULL    0
#endif

/* 
 * Strict POSIX stuff goes here. Extensions go down below, in the ifndef












|





|
<
|
<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

20

21
22
23
24
25
26
27
/*
 * unistd.h --
 *
 *      Macros, constants and prototypes for Posix conformance.
 *
 * Copyright 1989 Regents of the University of California Permission to use,
 * copy, modify, and distribute this software and its documentation for any
 * purpose and without fee is hereby granted, provided that the above
 * copyright notice appear in all copies. The University of California makes
 * no representations about the suitability of this software for any purpose.
 * It is provided "as is" without express or implied warranty.
 *
 * RCS: @(#) $Id: unistd.h,v 1.2.42.2 2010/04/29 23:32:23 dgp Exp $
 */

#ifndef _UNISTD
#define _UNISTD

#include "tcl.h"

#include <sys/types.h>


#ifndef NULL
#define NULL    0
#endif

/* 
 * Strict POSIX stuff goes here. Extensions go down below, in the ifndef
Changes to generic/regcustom.h.
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Headers if any.
 */

#include "tclInt.h"

/*
 * Overrides for regguts.h definitions, if any.
 */

#define	FUNCPTR(name, args)	(*name)args
#define	MALLOC(n)		VS(attemptckalloc(n))







|







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Headers if any.
 */

#include "regex.h"

/*
 * Overrides for regguts.h definitions, if any.
 */

#define	FUNCPTR(name, args)	(*name)args
#define	MALLOC(n)		VS(attemptckalloc(n))
151
152
153
154
155
156
157

158



159
160
161
#define AllocVars(vPtr) \
    register struct vars *vPtr = (struct vars *) MALLOC(sizeof(struct vars))
#define FreeVars(vPtr) \
    FREE(vPtr)
#endif

/*

 * And pick up the standard header.



 */

#include "regex.h"







>
|
>
>
>

<
<
151
152
153
154
155
156
157
158
159
160
161
162
163


#define AllocVars(vPtr) \
    register struct vars *vPtr = (struct vars *) MALLOC(sizeof(struct vars))
#define FreeVars(vPtr) \
    FREE(vPtr)
#endif

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */


Changes to generic/regex.h.
1
2



3
4
5
6
7
8
9
#ifndef _REGEX_H_
#define	_REGEX_H_	/* never again */



/*
 * regular expressions
 *
 * Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
 *
 * Development of this software was funded, in part, by Cray Research Inc.,
 * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics


>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
#ifndef _REGEX_H_
#define	_REGEX_H_	/* never again */

#include "tclInt.h"

/*
 * regular expressions
 *
 * Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
 *
 * Development of this software was funded, in part, by Cray Research Inc.,
 * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
315
316
317
318
319
320
321








 * more C++ voodoo
 */
#ifdef __cplusplus
}
#endif

#endif















>
>
>
>
>
>
>
>
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
 * more C++ voodoo
 */
#ifdef __cplusplus
}
#endif

#endif

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */
Changes to generic/regguts.h.
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 */
#include "regcustom.h"

/*
 * Things that regcustom.h might override.
 */

/* standard header files (NULL is a reasonable indicator for them) */
#ifndef NULL
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
#include <string.h>
#endif

/* assertions */
#ifndef assert
#ifndef REG_DEBUG
#ifndef NDEBUG
#define	NDEBUG		/* no assertions */
#endif
#endif /* !REG_DEBUG */







<
<
<
<
<
<
<
<
<







35
36
37
38
39
40
41









42
43
44
45
46
47
48
 */
#include "regcustom.h"

/*
 * Things that regcustom.h might override.
 */










/* assertions */
#ifndef assert
#ifndef REG_DEBUG
#ifndef NDEBUG
#define	NDEBUG		/* no assertions */
#endif
#endif /* !REG_DEBUG */
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#define	REALLOC(p, n)	realloc(VS(p), n)
#endif
#ifndef FREE
#define	FREE(p)		free(VS(p))
#endif

/* want size of a char in bits, and max value in bounded quantifiers */
#ifndef CHAR_BIT
#include <limits.h>
#endif
#ifndef _POSIX2_RE_DUP_MAX
#define	_POSIX2_RE_DUP_MAX 255	/* normally from <limits.h> */
#endif

/*
 * misc
 */







<
<
<







83
84
85
86
87
88
89



90
91
92
93
94
95
96
#define	REALLOC(p, n)	realloc(VS(p), n)
#endif
#ifndef FREE
#define	FREE(p)		free(VS(p))
#endif

/* want size of a char in bits, and max value in bounded quantifiers */



#ifndef _POSIX2_RE_DUP_MAX
#define	_POSIX2_RE_DUP_MAX 255	/* normally from <limits.h> */
#endif

/*
 * misc
 */
Changes to generic/tclAlloc.c.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * Copyright (c) 1998-1999 by Scriptics Corporation.
 *
 * Portions contributed by Chris Kingsley, Jack Jansen and Ray Johnson.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclAlloc.c,v 1.16.4.12 2010/02/25 21:53:06 dgp Exp $
 */

/*
 * Windows and Unix use an alternative allocator when building with threads
 * that has significantly reduced lock contention.
 */








|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * Copyright (c) 1998-1999 by Scriptics Corporation.
 *
 * Portions contributed by Chris Kingsley, Jack Jansen and Ray Johnson.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclAlloc.c,v 1.16.4.13 2010/04/29 23:32:23 dgp Exp $
 */

/*
 * Windows and Unix use an alternative allocator when building with threads
 * that has significantly reduced lock contention.
 */

138
139
140
141
142
143
144
145
146
147
148
149
150
151
152

/*
 * numMallocs[i] is the difference between the number of mallocs and frees for
 * a given block size.
 */

static	unsigned int numMallocs[NBUCKETS+1];
#include <stdio.h>
#endif

#if defined(DEBUG) || defined(RCHECK)
#define	ASSERT(p)	if (!(p)) Tcl_Panic(# p)
#define RANGE_ASSERT(p) if (!(p)) Tcl_Panic(# p)
#else
#define	ASSERT(p)







<







138
139
140
141
142
143
144

145
146
147
148
149
150
151

/*
 * numMallocs[i] is the difference between the number of mallocs and frees for
 * a given block size.
 */

static	unsigned int numMallocs[NBUCKETS+1];

#endif

#if defined(DEBUG) || defined(RCHECK)
#define	ASSERT(p)	if (!(p)) Tcl_Panic(# p)
#define RANGE_ASSERT(p) if (!(p)) Tcl_Panic(# p)
#else
#define	ASSERT(p)
Changes to generic/tclBasic.c.
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
 * Copyright (c) 2008 Miguel Sofer <msofer@users.sourceforge.net>
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclBasic.c,v 1.82.2.168 2010/04/25 15:40:54 dgp Exp $
 */

#include "tclInt.h"
#include "tclOOInt.h"
#include "tclCompile.h"
#include <float.h>
#include <limits.h>
#include <math.h>
#include "tommath.h"

#if NRE_ENABLE_ASSERTS
#include <assert.h>
#endif

#define INTERP_STACK_INITIAL_SIZE 2000
#define CORO_STACK_INITIAL_SIZE    200







|





|
<

<







12
13
14
15
16
17
18
19
20
21
22
23
24
25

26

27
28
29
30
31
32
33
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
 * Copyright (c) 2008 Miguel Sofer <msofer@users.sourceforge.net>
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclBasic.c,v 1.82.2.169 2010/04/29 23:32:23 dgp Exp $
 */

#include "tclInt.h"
#include "tclOOInt.h"
#include "tclCompile.h"
#include "tommath.h"

#include <math.h>


#if NRE_ENABLE_ASSERTS
#include <assert.h>
#endif

#define INTERP_STACK_INITIAL_SIZE 2000
#define CORO_STACK_INITIAL_SIZE    200
Changes to generic/tclBinary.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * tclBinary.c --
 *
 *	This file contains the implementation of the "binary" Tcl built-in
 *	command and the Tcl binary data object.
 *
 * Copyright (c) 1997 by Sun Microsystems, Inc.
 * Copyright (c) 1998-1999 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclBinary.c,v 1.13.4.33 2010/03/06 03:40:55 dgp Exp $
 */

#include "tclInt.h"
#include "tommath.h"

#include <math.h>













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * tclBinary.c --
 *
 *	This file contains the implementation of the "binary" Tcl built-in
 *	command and the Tcl binary data object.
 *
 * Copyright (c) 1997 by Sun Microsystems, Inc.
 * Copyright (c) 1998-1999 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclBinary.c,v 1.13.4.34 2010/04/29 23:32:24 dgp Exp $
 */

#include "tclInt.h"
#include "tommath.h"

#include <math.h>

569
570
571
572
573
574
575











































































576
577
578
579
580
581
582
    } else {
	for (i = 0; i < length; i++) {
	    dst += Tcl_UniCharToUtf(src[i], dst);
	}
	*dst = '\0';
    }
}












































































/*
 *----------------------------------------------------------------------
 *
 * TclInitBinaryCmd --
 *
 *	This function is called to create the "binary" Tcl command. See the







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
    } else {
	for (i = 0; i < length; i++) {
	    dst += Tcl_UniCharToUtf(src[i], dst);
	}
	*dst = '\0';
    }
}

/*
 *----------------------------------------------------------------------
 *
 * TclAppendBytesToByteArray --
 *
 *	This function appends an array of bytes to a byte array object. Note
 *	that the object *must* be unshared, and the array of bytes *must not*
 *	refer to the object being appended to.
 *
 * Results:
 *	None.
 *
 * Side effects:
 *	Allocates enough memory for an array of bytes of the requested total
 *	size, or possibly larger. [Bug 2992970]
 *
 *----------------------------------------------------------------------
 */

void
TclAppendBytesToByteArray(
    Tcl_Obj *objPtr,
    const unsigned char *bytes,
    unsigned len)
{
    ByteArray *byteArrayPtr;

    if (Tcl_IsShared(objPtr)) {
	Tcl_Panic("%s called with shared object","TclAppendBytesToByteArray");
    }
    if (objPtr->typePtr != &tclByteArrayType) {
	SetByteArrayFromAny(NULL, objPtr);
    }
    byteArrayPtr = GET_BYTEARRAY(objPtr);

    /*
     * If we need to, resize the allocated space in the byte array.
     */

    if (byteArrayPtr->used + (int)len > byteArrayPtr->allocated) {
	unsigned int attempt, used = byteArrayPtr->used;
	ByteArray *tmpByteArrayPtr;

	attempt = byteArrayPtr->allocated;
	do {
	    attempt *= 2;
	} while (attempt < used+len);

	tmpByteArrayPtr = (ByteArray *)
		attemptckrealloc((char *) byteArrayPtr,
			BYTEARRAY_SIZE(attempt));

	if (tmpByteArrayPtr == NULL) {
	    attempt = used + len;
	    tmpByteArrayPtr = (ByteArray *) ckrealloc((char *) byteArrayPtr,
		    BYTEARRAY_SIZE(attempt));
	}

	byteArrayPtr = tmpByteArrayPtr;
	byteArrayPtr->allocated = attempt;
	byteArrayPtr->used = used;
	SET_BYTEARRAY(objPtr, byteArrayPtr);
    }

    /*
     * Do the append if there's any point.
     */

    if (len > 0) {
	memcpy(byteArrayPtr->bytes + byteArrayPtr->used, bytes, len);
	byteArrayPtr->used += len;
	Tcl_InvalidateStringRep(objPtr);
    }
}

/*
 *----------------------------------------------------------------------
 *
 * TclInitBinaryCmd --
 *
 *	This function is called to create the "binary" Tcl command. See the
Changes to generic/tclEnv.c.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 *
 * Copyright (c) 1991-1994 The Regents of the University of California.
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclEnv.c,v 1.21.2.16 2010/03/06 03:40:56 dgp Exp $
 */

#include "tclInt.h"

TCL_DECLARE_MUTEX(envMutex)	/* To serialize access to environ. */

static struct {







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 *
 * Copyright (c) 1991-1994 The Regents of the University of California.
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclEnv.c,v 1.21.2.17 2010/04/29 23:32:24 dgp Exp $
 */

#include "tclInt.h"

TCL_DECLARE_MUTEX(envMutex)	/* To serialize access to environ. */

static struct {
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
	/*
	 * If this is Path, eliminate any PATH variable, to prevent any
	 * confusion.
	 */

	if (strcmp(name, "Path") == 0) {
#ifdef __WIN32__
	    SetEnvironmentVariable("PATH", NULL);
#endif
	    unsetenv("PATH");
	}

#ifdef __WIN32__
	SetEnvironmentVariable(name, value);
#endif
    } else {
	char *buf;

	/*
	 * Eliminate any Path variable, to prevent any confusion.
	 */

#ifdef __WIN32__
	SetEnvironmentVariable("Path", NULL);
#endif
	unsetenv("Path");

	if (value == NULL) {
	    buf = NULL;
	} else {
	    int size;

	    size = cygwin_posix_to_win32_path_list_buf_size(value);
	    buf = alloca(size + 1);
	    cygwin_posix_to_win32_path_list(value, buf);
	}

#ifdef __WIN32__
	SetEnvironmentVariable(name, buf);
#endif
    }
}
#endif /* __CYGWIN__ */

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */







|





|









|














|












751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
	/*
	 * If this is Path, eliminate any PATH variable, to prevent any
	 * confusion.
	 */

	if (strcmp(name, "Path") == 0) {
#ifdef __WIN32__
	    SetEnvironmentVariableA("PATH", NULL);
#endif
	    unsetenv("PATH");
	}

#ifdef __WIN32__
	SetEnvironmentVariableA(name, value);
#endif
    } else {
	char *buf;

	/*
	 * Eliminate any Path variable, to prevent any confusion.
	 */

#ifdef __WIN32__
	SetEnvironmentVariableA("Path", NULL);
#endif
	unsetenv("Path");

	if (value == NULL) {
	    buf = NULL;
	} else {
	    int size;

	    size = cygwin_posix_to_win32_path_list_buf_size(value);
	    buf = alloca(size + 1);
	    cygwin_posix_to_win32_path_list(value, buf);
	}

#ifdef __WIN32__
	SetEnvironmentVariableA(name, buf);
#endif
    }
}
#endif /* __CYGWIN__ */

/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */
Changes to generic/tclExecute.c.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 * Copyright (c) 2005-2007 by Donal K. Fellows.
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclExecute.c,v 1.101.2.141 2010/04/25 15:40:54 dgp Exp $
 */

#include "tclInt.h"
#include "tclCompile.h"
#include "tommath.h"

#include <math.h>
#include <float.h>

#if NRE_ENABLE_ASSERTS
#include <assert.h>
#endif

/*
 * Hack to determine whether we may expect IEEE floating point. The hack is







|





<

<







10
11
12
13
14
15
16
17
18
19
20
21
22

23

24
25
26
27
28
29
30
 * Copyright (c) 2005-2007 by Donal K. Fellows.
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclExecute.c,v 1.101.2.142 2010/04/29 23:32:24 dgp Exp $
 */

#include "tclInt.h"
#include "tclCompile.h"
#include "tommath.h"

#include <math.h>


#if NRE_ENABLE_ASSERTS
#include <assert.h>
#endif

/*
 * Hack to determine whether we may expect IEEE floating point. The hack is
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
    do {							\
	objPtr->internalRep.twoPtrValue.ptr2 = auxObjList;	\
	auxObjList = objPtr;					\
    } while (0)

#define POP_TAUX_OBJ() \
    do {								\
	Tcl_Obj *tmpPtr = auxObjList;					\
	auxObjList = (Tcl_Obj *) tmpPtr->internalRep.twoPtrValue.ptr2;	\
	Tcl_DecrRefCount(tmpPtr);					\
    } while (0)

/*
 * These variable-access macros have to coincide with those in tclVar.c
 */







|







210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
    do {							\
	objPtr->internalRep.twoPtrValue.ptr2 = auxObjList;	\
	auxObjList = objPtr;					\
    } while (0)

#define POP_TAUX_OBJ() \
    do {								\
	tmpPtr = auxObjList;						\
	auxObjList = (Tcl_Obj *) tmpPtr->internalRep.twoPtrValue.ptr2;	\
	Tcl_DecrRefCount(tmpPtr);					\
    } while (0)

/*
 * These variable-access macros have to coincide with those in tclVar.c
 */
678
679
680
681
682
683
684








685
686
687
688
689
690
691
    (Tcl_WideInt)161051*161051*161051*11*11,
    (Tcl_WideInt)161051*161051*161051*11*11*11,
    (Tcl_WideInt)248832*248832*248832*12*12,
    (Tcl_WideInt)371293*371293*371293*13*13
};
static const size_t Exp64ValueSize = sizeof(Exp64Value) / sizeof(Tcl_WideInt);
#endif /* (LONG_MAX > 0x7fffffff) || !defined(TCL_WIDE_INT_IS_LONG) */









/*
 * Declarations for local procedures to this file:
 */

#ifdef TCL_COMPILE_STATS
static int		EvalStatsCmd(ClientData clientData,







>
>
>
>
>
>
>
>







676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
    (Tcl_WideInt)161051*161051*161051*11*11,
    (Tcl_WideInt)161051*161051*161051*11*11*11,
    (Tcl_WideInt)248832*248832*248832*12*12,
    (Tcl_WideInt)371293*371293*371293*13*13
};
static const size_t Exp64ValueSize = sizeof(Exp64Value) / sizeof(Tcl_WideInt);
#endif /* (LONG_MAX > 0x7fffffff) || !defined(TCL_WIDE_INT_IS_LONG) */

/*
 * Markers for ExecuteExtendedBinaryMathOp.
 */

#define DIVIDED_BY_ZERO		((Tcl_Obj *) -1)
#define EXPONENT_OF_ZERO	((Tcl_Obj *) -2)
#define GENERAL_ARITHMETIC_ERROR ((Tcl_Obj *) -3)

/*
 * Declarations for local procedures to this file:
 */

#ifdef TCL_COMPILE_STATS
static int		EvalStatsCmd(ClientData clientData,
700
701
702
703
704
705
706







707
708
709
710
711
712
713
			    const unsigned char *pc, int stackTop,
			    int stackLowerBound, int checkStack);
#endif /* TCL_COMPILE_DEBUG */
static ByteCode *	CompileExprObj(Tcl_Interp *interp, Tcl_Obj *objPtr);
static void		DeleteExecStack(ExecStack *esPtr);
static void		DupExprCodeInternalRep(Tcl_Obj *srcPtr,
			    Tcl_Obj *copyPtr);







static void		FreeExprCodeInternalRep(Tcl_Obj *objPtr);
static ExceptionRange *	GetExceptRangeForPc(const unsigned char *pc,
			    int catchOnly, ByteCode *codePtr);
static const char *	GetSrcInfoForPc(const unsigned char *pc,
			    ByteCode *codePtr, int *lengthPtr);
static Tcl_Obj **	GrowEvaluationStack(ExecEnv *eePtr, int growth,
			    int move);







>
>
>
>
>
>
>







706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
			    const unsigned char *pc, int stackTop,
			    int stackLowerBound, int checkStack);
#endif /* TCL_COMPILE_DEBUG */
static ByteCode *	CompileExprObj(Tcl_Interp *interp, Tcl_Obj *objPtr);
static void		DeleteExecStack(ExecStack *esPtr);
static void		DupExprCodeInternalRep(Tcl_Obj *srcPtr,
			    Tcl_Obj *copyPtr);
MODULE_SCOPE int	TclCompareTwoNumbers(Tcl_Obj *valuePtr,
			    Tcl_Obj *value2Ptr);
static Tcl_Obj *	ExecuteExtendedBinaryMathOp(Tcl_Interp *interp,
			    int opcode, Tcl_Obj **constants,
			    Tcl_Obj *valuePtr, Tcl_Obj *value2Ptr);
static Tcl_Obj *	ExecuteExtendedUnaryMathOp(int opcode,
			    Tcl_Obj *valuePtr);
static void		FreeExprCodeInternalRep(Tcl_Obj *objPtr);
static ExceptionRange *	GetExceptRangeForPc(const unsigned char *pc,
			    int catchOnly, ByteCode *codePtr);
static const char *	GetSrcInfoForPc(const unsigned char *pc,
			    ByteCode *codePtr, int *lengthPtr);
static Tcl_Obj **	GrowEvaluationStack(ExecEnv *eePtr, int growth,
			    int move);
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
	int instructionCount;	/* Counter that is used to work out when to
				 * call Tcl_AsyncReady() */
	int checkInterp;	/* Indicates when a check of interp readyness
				 * is necessary. Set by CACHE_STACK_INFO() */
	const char *curInstName;
	int result;		/* Return code returned after execution.
				 * Result variable - needed only when going to
				 * checkForcatch or other error handlers; also
				 * used as local in some opcodes. */
    } TAUX = {
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,







|







1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
	int instructionCount;	/* Counter that is used to work out when to
				 * call Tcl_AsyncReady() */
	int checkInterp;	/* Indicates when a check of interp readyness
				 * is necessary. Set by CACHE_STACK_INFO() */
	const char *curInstName;
	int result;		/* Return code returned after execution.
				 * Result variable - needed only when going to
				 * checkForCatch or other error handlers; also
				 * used as local in some opcodes. */
    } TAUX = {
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
1965
1966
1967
1968
1969
1970
1971
1972

1973
1974
1975
1976
1977
1978
1979
1980

    /*
     * Locals - variables that are used within opcodes or bounded sections of
     * the file (jumps between opcodes within a family).
     * NOTE: These are now mostly defined locally where needed.
     */

    Tcl_Obj *objPtr, *valuePtr, *value2Ptr, *part1Ptr, *part2Ptr;

    int opnd, length;
    Var *varPtr, *arrayPtr;
#ifdef TCL_COMPILE_DEBUG
    int traceInstructions = (tclTraceExec == 3);
    char cmdNameBuf[21];
#endif

    TAUX.constants = &iPtr->execEnvPtr->constants[0];







|
>
|







1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994

    /*
     * Locals - variables that are used within opcodes or bounded sections of
     * the file (jumps between opcodes within a family).
     * NOTE: These are now mostly defined locally where needed.
     */

    Tcl_Obj *objPtr, *valuePtr, *value2Ptr, *part1Ptr, *part2Ptr, *tmpPtr;
    Tcl_Obj **objv;
    int opnd, objc, length, pcAdjustment;
    Var *varPtr, *arrayPtr;
#ifdef TCL_COMPILE_DEBUG
    int traceInstructions = (tclTraceExec == 3);
    char cmdNameBuf[21];
#endif

    TAUX.constants = &iPtr->execEnvPtr->constants[0];
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187

2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212

2213
2214
2215
2216
2217
2218
2219

    /*
     * Check for asynchronous handlers [Bug 746722]; we do the check every
     * ASYNC_CHECK_COUNT_MASK instruction, of the form (2**n-1).
     */

    if ((TAUX.instructionCount++ & ASYNC_CHECK_COUNT_MASK) == 0) {
	int localResult;

	if (TclAsyncReady(iPtr)) {
	    DECACHE_STACK_INFO();
	    localResult = Tcl_AsyncInvoke(interp, TRESULT);

	    CACHE_STACK_INFO();
	    if (localResult == TCL_ERROR) {
		TRESULT = localResult;
		goto checkForCatch;
	    }
	}

	DECACHE_STACK_INFO();
	localResult = Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG);
	CACHE_STACK_INFO();

	if (localResult == TCL_ERROR) {
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}

	if (TclLimitReady(iPtr->limit)) {
	    DECACHE_STACK_INFO();
	    localResult = Tcl_LimitCheck(interp);
	    CACHE_STACK_INFO();
	    if (localResult == TCL_ERROR) {
		TRESULT = localResult;
		goto checkForCatch;
	    }
	}

    }

    TCL_DTRACE_INST_NEXT();

    /*
     * These two instructions account for 26% of all instructions (according
     * to measurements on tclbench by Ben Vitale







<
|

<
|
>
|
<
<
|



<
|
|
|
<
<
<



<
|
|
<
<
|


>







2190
2191
2192
2193
2194
2195
2196

2197
2198

2199
2200
2201


2202
2203
2204
2205

2206
2207
2208



2209
2210
2211

2212
2213


2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224

    /*
     * Check for asynchronous handlers [Bug 746722]; we do the check every
     * ASYNC_CHECK_COUNT_MASK instruction, of the form (2**n-1).
     */

    if ((TAUX.instructionCount++ & ASYNC_CHECK_COUNT_MASK) == 0) {

	DECACHE_STACK_INFO();
	if (TclAsyncReady(iPtr)) {

	    TRESULT = Tcl_AsyncInvoke(interp, TRESULT);
	    if (TRESULT == TCL_ERROR) {
		CACHE_STACK_INFO();


		goto gotError;
	    }
	}


	if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) {
	    CACHE_STACK_INFO();
	    goto gotError;



	}

	if (TclLimitReady(iPtr->limit)) {

	    if (Tcl_LimitCheck(interp) == TCL_ERROR) {
		CACHE_STACK_INFO();


		goto gotError;
	    }
	}
	CACHE_STACK_INFO();
    }

    TCL_DTRACE_INST_NEXT();

    /*
     * These two instructions account for 26% of all instructions (according
     * to measurements on tclbench by Ben Vitale
2241
2242
2243
2244
2245
2246
2247
2248

2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268

2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292

2293
2294
2295
2296
2297
2298
2299
2300
2301
2302

	TRACE(("%u %u => ", code, level));
	TRESULT = TclProcessReturn(interp, code, level, OBJ_AT_TOS);
	if (TRESULT == TCL_OK) {
	    TRACE_APPEND(("continuing to next instruction (TRESULT=\"%.30s\")",
		    O2S(objResultPtr)));
	    NEXT_INST_F(9, 1, 0);
	} else {

	    Tcl_SetObjResult(interp, OBJ_UNDER_TOS);
	    if (*pc == INST_SYNTAX) {
		iPtr->flags &= ~ERR_ALREADY_LOGGED;
	    }
	    cleanup = 2;
	    goto processExceptionReturn;
	}
    }

    case INST_RETURN_STK:
	TRACE(("=> "));
	objResultPtr = POP_OBJECT();
	TRESULT = Tcl_SetReturnOptions(interp, OBJ_AT_TOS);
	Tcl_DecrRefCount(OBJ_AT_TOS);
	OBJ_AT_TOS = objResultPtr;
	if (TRESULT == TCL_OK) {
	    TRACE_APPEND(("continuing to next instruction (TRESULT=\"%.30s\")",
		    O2S(objResultPtr)));
	    NEXT_INST_F(1, 0, 0);
	} else {

	    Tcl_SetObjResult(interp, objResultPtr);
	    cleanup = 1;
	    goto processExceptionReturn;
	}

    case INST_DONE:
	if (tosPtr > initTosPtr) {
	    /*
	     * Set the interpreter's object result to point to the topmost
	     * object from the stack, and check for a possible [catch]. The
	     * stackTop's level and refCount will be handled by "processCatch"
	     * or "abnormalReturn".
	     */

	    Tcl_SetObjResult(interp, OBJ_AT_TOS);
#ifdef TCL_COMPILE_DEBUG
	    TRACE_WITH_OBJ(("=> return code=%d, result=", TRESULT),
		    iPtr->objResultPtr);
	    if (traceInstructions) {
		fprintf(stdout, "\n");
	    }
#endif
	    goto checkForCatch;
	} else {

	    (void) POP_OBJECT();
	    goto abnormalReturn;
	}

    case INST_PUSH1:
    instPush1Peephole:
	PUSH_OBJECT(codePtr->objArrayPtr[TclGetUInt1AtPtr(pc+1)]);
	TRACE_WITH_OBJ(("%u => ", TclGetInt1AtPtr(pc+1)), OBJ_AT_TOS);
	pc += 2;
#if !TCL_COMPILE_DEBUG







<
>
|
|
|
|
|
|
<












<
>
|
|
|
<



















<
>
|
|
<







2246
2247
2248
2249
2250
2251
2252

2253
2254
2255
2256
2257
2258
2259

2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271

2272
2273
2274
2275

2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294

2295
2296
2297

2298
2299
2300
2301
2302
2303
2304

	TRACE(("%u %u => ", code, level));
	TRESULT = TclProcessReturn(interp, code, level, OBJ_AT_TOS);
	if (TRESULT == TCL_OK) {
	    TRACE_APPEND(("continuing to next instruction (TRESULT=\"%.30s\")",
		    O2S(objResultPtr)));
	    NEXT_INST_F(9, 1, 0);

	}
	Tcl_SetObjResult(interp, OBJ_UNDER_TOS);
	if (*pc == INST_SYNTAX) {
	    iPtr->flags &= ~ERR_ALREADY_LOGGED;
	}
	cleanup = 2;
	goto processExceptionReturn;

    }

    case INST_RETURN_STK:
	TRACE(("=> "));
	objResultPtr = POP_OBJECT();
	TRESULT = Tcl_SetReturnOptions(interp, OBJ_AT_TOS);
	Tcl_DecrRefCount(OBJ_AT_TOS);
	OBJ_AT_TOS = objResultPtr;
	if (TRESULT == TCL_OK) {
	    TRACE_APPEND(("continuing to next instruction (TRESULT=\"%.30s\")",
		    O2S(objResultPtr)));
	    NEXT_INST_F(1, 0, 0);

	}
	Tcl_SetObjResult(interp, objResultPtr);
	cleanup = 1;
	goto processExceptionReturn;


    case INST_DONE:
	if (tosPtr > initTosPtr) {
	    /*
	     * Set the interpreter's object result to point to the topmost
	     * object from the stack, and check for a possible [catch]. The
	     * stackTop's level and refCount will be handled by "processCatch"
	     * or "abnormalReturn".
	     */

	    Tcl_SetObjResult(interp, OBJ_AT_TOS);
#ifdef TCL_COMPILE_DEBUG
	    TRACE_WITH_OBJ(("=> return code=%d, result=", TRESULT),
		    iPtr->objResultPtr);
	    if (traceInstructions) {
		fprintf(stdout, "\n");
	    }
#endif
	    goto checkForCatch;

	}
	(void) POP_OBJECT();
	goto abnormalReturn;


    case INST_PUSH1:
    instPush1Peephole:
	PUSH_OBJECT(codePtr->objArrayPtr[TclGetUInt1AtPtr(pc+1)]);
	TRACE_WITH_OBJ(("%u => ", TclGetInt1AtPtr(pc+1)), OBJ_AT_TOS);
	pc += 2;
#if !TCL_COMPILE_DEBUG
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358

2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
	 * compileEpoch is modified, so that the epoch check also verifies
	 * that the interp is not deleted. If no outside call has been made
	 * since the last check, it is safe to omit the check.
	 */

	iPtr->cmdCount += TclGetUInt4AtPtr(pc+5);
	if (!TAUX.checkInterp) {
	instStartCmdOK:
	    NEXT_INST_F(9, 0, 0);
	} else if (((codePtr->compileEpoch == iPtr->compileEpoch)
		&& (codePtr->nsEpoch == iPtr->varFramePtr->nsPtr->resolverEpoch))
		|| (codePtr->flags & TCL_BYTECODE_PRECOMPILED)) {
	    TAUX.checkInterp = 0;
	    goto instStartCmdOK;

	} else {
	    const char *bytes;

	    length = 0;

	    /*
	     * We used to switch to direct eval; for NRE-awareness we now
	     * compile and eval the command so that this evaluation does not
	     * add a new TEBC instance. [Bug 2910748]
	     */

	    if (TclInterpReady(interp) == TCL_ERROR) {
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }

	    codePtr->flags |= TCL_BYTECODE_RECOMPILE;
	    bytes = GetSrcInfoForPc(pc, codePtr, &length);
	    opnd = TclGetUInt4AtPtr(pc+1);
	    pc += (opnd-1);
	    PUSH_OBJECT(Tcl_NewStringObj(bytes, length));







|
<




|
>












<
|







2347
2348
2349
2350
2351
2352
2353
2354

2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372

2373
2374
2375
2376
2377
2378
2379
2380
	 * compileEpoch is modified, so that the epoch check also verifies
	 * that the interp is not deleted. If no outside call has been made
	 * since the last check, it is safe to omit the check.
	 */

	iPtr->cmdCount += TclGetUInt4AtPtr(pc+5);
	if (!TAUX.checkInterp) {
	    goto instStartCmdOK;

	} else if (((codePtr->compileEpoch == iPtr->compileEpoch)
		&& (codePtr->nsEpoch == iPtr->varFramePtr->nsPtr->resolverEpoch))
		|| (codePtr->flags & TCL_BYTECODE_PRECOMPILED)) {
	    TAUX.checkInterp = 0;
	instStartCmdOK:
	    NEXT_INST_F(9, 0, 0);
	} else {
	    const char *bytes;

	    length = 0;

	    /*
	     * We used to switch to direct eval; for NRE-awareness we now
	     * compile and eval the command so that this evaluation does not
	     * add a new TEBC instance. [Bug 2910748]
	     */

	    if (TclInterpReady(interp) == TCL_ERROR) {

		goto gotError;
	    }

	    codePtr->flags |= TCL_BYTECODE_RECOMPILE;
	    bytes = GetSrcInfoForPc(pc, codePtr, &length);
	    opnd = TclGetUInt4AtPtr(pc+1);
	    pc += (opnd-1);
	    PUSH_OBJECT(Tcl_NewStringObj(bytes, length));
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
    case INST_REVERSE: {
	Tcl_Obj **a, **b;

	opnd = TclGetUInt4AtPtr(pc+1);
	a = tosPtr-(opnd-1);
	b = tosPtr;
	while (a<b) {
	    Tcl_Obj *temp = *a;

	    *a = *b;
	    *b = temp;
	    a++; b--;
	}
	NEXT_INST_F(5, 0, 0);
    }

    case INST_CONCAT1: {
	int appendLen = 0;







|
<

|







2399
2400
2401
2402
2403
2404
2405
2406

2407
2408
2409
2410
2411
2412
2413
2414
2415
    case INST_REVERSE: {
	Tcl_Obj **a, **b;

	opnd = TclGetUInt4AtPtr(pc+1);
	a = tosPtr-(opnd-1);
	b = tosPtr;
	while (a<b) {
	    tmpPtr = *a;

	    *a = *b;
	    *b = tmpPtr;
	    a++; b--;
	}
	NEXT_INST_F(5, 0, 0);
    }

    case INST_CONCAT1: {
	int appendLen = 0;
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606

	TclNewObj(objPtr);
	objPtr->internalRep.twoPtrValue.ptr1 = (void *) CURR_DEPTH;
	PUSH_TAUX_OBJ(objPtr);
	NEXT_INST_F(1, 0, 0);

    case INST_EXPAND_STKTOP: {
	int objc, i;
	Tcl_Obj **objv;
	ptrdiff_t moved;

	/*
	 * Make sure that the element at stackTop is a list; if not, just
	 * leave with an error. Note that the element from the expand list
	 * will be removed at checkForCatch.
	 */

	objPtr = OBJ_AT_TOS;
	if (TclListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK){
	    TRACE_WITH_OBJ(("%.30s => ERROR: ", O2S(objPtr)),
		    Tcl_GetObjResult(interp));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}
	(void) POP_OBJECT();

	/*
	 * Make sure there is enough room in the stack to expand this list
	 * *and* process the rest of the command (at least up to the next
	 * argument expansion or command end). The operand is the current







|
<









|


<
|







2577
2578
2579
2580
2581
2582
2583
2584

2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596

2597
2598
2599
2600
2601
2602
2603
2604

	TclNewObj(objPtr);
	objPtr->internalRep.twoPtrValue.ptr1 = (void *) CURR_DEPTH;
	PUSH_TAUX_OBJ(objPtr);
	NEXT_INST_F(1, 0, 0);

    case INST_EXPAND_STKTOP: {
	int i;

	ptrdiff_t moved;

	/*
	 * Make sure that the element at stackTop is a list; if not, just
	 * leave with an error. Note that the element from the expand list
	 * will be removed at checkForCatch.
	 */

	objPtr = OBJ_AT_TOS;
	if (TclListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
	    TRACE_WITH_OBJ(("%.30s => ERROR: ", O2S(objPtr)),
		    Tcl_GetObjResult(interp));

	    goto gotError;
	}
	(void) POP_OBJECT();

	/*
	 * Make sure there is enough room in the stack to expand this list
	 * *and* process the rest of the command (at least up to the next
	 * argument expansion or command end). The operand is the current
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
	goto nonRecursiveCallStart;
    }

	/*
	 * INVOCATION BLOCK
	 */

    {
	int objc, pcAdjustment;
	Tcl_Obj **objv;

    instEvalStk:
    case INST_EVAL_STK:
	/*
	 * Moved here to support transforming the eval of objects to a simple
	 * command invocation (for canonical lists) or a non-recursive TEBC
	 * call (compiled scripts).
	 */







<
<
<
<







2657
2658
2659
2660
2661
2662
2663




2664
2665
2666
2667
2668
2669
2670
	goto nonRecursiveCallStart;
    }

	/*
	 * INVOCATION BLOCK
	 */





    instEvalStk:
    case INST_EVAL_STK:
	/*
	 * Moved here to support transforming the eval of objects to a simple
	 * command invocation (for canonical lists) or a non-recursive TEBC
	 * call (compiled scripts).
	 */
2697
2698
2699
2700
2701
2702
2703
2704







2705
2706
2707
2708
2709
2710
2711

	    if (objPtr->bytes == NULL || listRepPtr->canonicalFlag) {
		if (Tcl_IsShared(objPtr)) {
		    copyPtr = TclListObjCopy(interp, objPtr);
		    Tcl_IncrRefCount(copyPtr);
		    OBJ_AT_TOS = copyPtr;
		    listRepPtr = copyPtr->internalRep.twoPtrValue.ptr1;
		    Tcl_DecrRefCount(objPtr);







		}
		objc = listRepPtr->elemCount;
		objv = &listRepPtr->elements;

		/*
		 * Fix for [Bug 2102930]
		 */







|
>
>
>
>
>
>
>







2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712

	    if (objPtr->bytes == NULL || listRepPtr->canonicalFlag) {
		if (Tcl_IsShared(objPtr)) {
		    copyPtr = TclListObjCopy(interp, objPtr);
		    Tcl_IncrRefCount(copyPtr);
		    OBJ_AT_TOS = copyPtr;
		    listRepPtr = copyPtr->internalRep.twoPtrValue.ptr1;

		    /*
		     * Decrement the refcount on the *original* copy of the
		     * list directly; we know it was greater than 1 here so it
		     * can't be deallocated.
		     */

		    objPtr->refCount--;
		}
		objc = listRepPtr->elemCount;
		objv = &listRepPtr->elements;

		/*
		 * Fix for [Bug 2102930]
		 */
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
#endif /* TCL_COMPILE_DEBUG */
		iPtr->cmdFramePtr = bcFramePtr->nextPtr;
		TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);

		if (catchTop != initCatchTop) {
		    TclClearTailcall(interp, param);
		    iPtr->varFramePtr->tailcallPtr = NULL;
		    TRESULT = TCL_ERROR;
		    Tcl_SetResult(interp,
			    "tailcall called from within a catch environment",
			    TCL_STATIC);
		    Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL",
			    NULL);
		    pc--;
		    goto checkForCatch;
		}
		iPtr->varFramePtr->tailcallPtr = param;
		TclSpliceTailcall(interp, param, 1);
		goto abnormalReturn;
	    case TCL_NR_YIELD_TYPE: {		/* [yield] */
		CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;

		if (!corPtr) {
		    Tcl_SetResult(interp,
			    "yield can only be called in a coroutine",
			    TCL_STATIC);
		    Tcl_SetErrorCode(interp, "TCL", "COROUTINE",
			    "ILLEGAL_YIELD", NULL);
		    TRESULT = TCL_ERROR;
		    pc--;
		    goto checkForCatch;
		}

		NRE_ASSERT(iPtr->execEnvPtr == corPtr->eePtr);
		NRE_ASSERT(corPtr->stackLevel != NULL);
		NRE_ASSERT(BP == corPtr->eePtr->bottomPtr);
		if (corPtr->stackLevel != &TAUX) {
		    Tcl_SetResult(interp, "cannot yield: C stack busy",
			    TCL_STATIC);
		    Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD",
			    NULL);
		    TRESULT = TCL_ERROR;
		    pc--;
		    goto checkForCatch;
		}

		/*
		 * Mark suspended, save our state and return
		 */

		corPtr->stackLevel = NULL;







<






|













<

|










<

|







2859
2860
2861
2862
2863
2864
2865

2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885

2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897

2898
2899
2900
2901
2902
2903
2904
2905
2906
#endif /* TCL_COMPILE_DEBUG */
		iPtr->cmdFramePtr = bcFramePtr->nextPtr;
		TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);

		if (catchTop != initCatchTop) {
		    TclClearTailcall(interp, param);
		    iPtr->varFramePtr->tailcallPtr = NULL;

		    Tcl_SetResult(interp,
			    "tailcall called from within a catch environment",
			    TCL_STATIC);
		    Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL",
			    NULL);
		    pc--;
		    goto gotError;
		}
		iPtr->varFramePtr->tailcallPtr = param;
		TclSpliceTailcall(interp, param, 1);
		goto abnormalReturn;
	    case TCL_NR_YIELD_TYPE: {		/* [yield] */
		CoroutineData *corPtr = iPtr->execEnvPtr->corPtr;

		if (!corPtr) {
		    Tcl_SetResult(interp,
			    "yield can only be called in a coroutine",
			    TCL_STATIC);
		    Tcl_SetErrorCode(interp, "TCL", "COROUTINE",
			    "ILLEGAL_YIELD", NULL);

		    pc--;
		    goto gotError;
		}

		NRE_ASSERT(iPtr->execEnvPtr == corPtr->eePtr);
		NRE_ASSERT(corPtr->stackLevel != NULL);
		NRE_ASSERT(BP == corPtr->eePtr->bottomPtr);
		if (corPtr->stackLevel != &TAUX) {
		    Tcl_SetResult(interp, "cannot yield: C stack busy",
			    TCL_STATIC);
		    Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD",
			    NULL);

		    pc--;
		    goto gotError;
		}

		/*
		 * Mark suspended, save our state and return
		 */

		corPtr->stackLevel = NULL;
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
	if (iPtr->varFramePtr->tailcallPtr) {
	    if (catchTop == initCatchTop) {
		goto abnormalReturn;
	    }

	    TclClearTailcall(interp, iPtr->varFramePtr->tailcallPtr);
	    iPtr->varFramePtr->tailcallPtr = NULL;
	    TRESULT = TCL_ERROR;
	    Tcl_SetResult(interp,
		    "tailcall called from within a catch environment",
		    TCL_STATIC);
	    Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL);
	    pc--;
	    goto checkForCatch;
	}

	if (iPtr->execEnvPtr->rewind) {
	    TRESULT = TCL_ERROR;
	    goto abnormalReturn;
	}








<





|







2931
2932
2933
2934
2935
2936
2937

2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
	if (iPtr->varFramePtr->tailcallPtr) {
	    if (catchTop == initCatchTop) {
		goto abnormalReturn;
	    }

	    TclClearTailcall(interp, iPtr->varFramePtr->tailcallPtr);
	    iPtr->varFramePtr->tailcallPtr = NULL;

	    Tcl_SetResult(interp,
		    "tailcall called from within a catch environment",
		    TCL_STATIC);
	    Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL);
	    pc--;
	    goto gotError;
	}

	if (iPtr->execEnvPtr->rewind) {
	    TRESULT = TCL_ERROR;
	    goto abnormalReturn;
	}

2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014

3015


3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033

3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052

3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099

	TclNewObj(objPtr);
	Tcl_IncrRefCount(objPtr);
	iPtr->objResultPtr = objPtr;
	NEXT_INST_V(0, cleanup, -1);

#if TCL_SUPPORT_84_BYTECODE
    case INST_CALL_BUILTIN_FUNC1: {
	/*
	 * Call one of the built-in pre-8.5 Tcl math functions. This
	 * translates to INST_INVOKE_STK1 with the first argument of
	 * ::tcl::mathfunc::$objv[0]. We need to insert the named math
	 * function into the stack.
	 */

	int numArgs;
	Tcl_Obj *tmpPtr1, *tmpPtr2;

	opnd = TclGetUInt1AtPtr(pc+1);
	if ((opnd < 0) || (opnd > LAST_BUILTIN_FUNC)) {
	    TRACE(("UNRECOGNIZED BUILTIN FUNC CODE %d\n", opnd));
	    Tcl_Panic("TclExecuteByteCode: unrecognized builtin function code %d", opnd);
	}

	TclNewLiteralStringObj(objPtr, "::tcl::mathfunc::");
	Tcl_AppendToObj(objPtr, tclBuiltinFuncTable[opnd].name, -1);

	/*
	 * Only 0, 1 or 2 args.
	 */


	numArgs = tclBuiltinFuncTable[opnd].numArgs;


	if (numArgs == 0) {
	    PUSH_OBJECT(objPtr);
	} else if (numArgs == 1) {
	    tmpPtr1 = POP_OBJECT();
	    PUSH_OBJECT(objPtr);
	    PUSH_OBJECT(tmpPtr1);
	    Tcl_DecrRefCount(tmpPtr1);
	} else {
	    tmpPtr2 = POP_OBJECT();
	    tmpPtr1 = POP_OBJECT();
	    PUSH_OBJECT(objPtr);
	    PUSH_OBJECT(tmpPtr1);
	    PUSH_OBJECT(tmpPtr2);
	    Tcl_DecrRefCount(tmpPtr1);
	    Tcl_DecrRefCount(tmpPtr2);
	}

	objc = numArgs + 1;

	pcAdjustment = 2;
	goto doInvocation;
    }

    case INST_CALL_FUNC1: {
	/*
	 * Call a non-builtin Tcl math function previously registered by a
	 * call to Tcl_CreateMathFunc pre-8.5. This is essentially
	 * INST_INVOKE_STK1 converting the first arg to
	 * ::tcl::mathfunc::$objv[0].
	 */

	Tcl_Obj *tmpPtr;

	/*
	 * Number of arguments. The function name is the 0-th argument.
	 */

	objc = TclGetUInt1AtPtr(pc+1);


	objPtr = OBJ_AT_DEPTH(objc-1);
	TclNewLiteralStringObj(tmpPtr, "::tcl::mathfunc::");
	Tcl_AppendObjToObj(tmpPtr, objPtr);
	Tcl_DecrRefCount(objPtr);

	/*
	 * Variation of PUSH_OBJECT.
	 */

	OBJ_AT_DEPTH(objc-1) = tmpPtr;
	Tcl_IncrRefCount(tmpPtr);

	pcAdjustment = 2;
	goto doInvocation;
    }
#else
    /*
     * INST_CALL_BUILTIN_FUNC1 and INST_CALL_FUNC1 were made obsolete by the
     * changes to add a ::tcl::mathfunc namespace in 8.5. Optional support
     * remains for existing bytecode precompiled files.
     */

    case INST_CALL_BUILTIN_FUNC1:
	Tcl_Panic("TclExecuteByteCode: obsolete INST_CALL_BUILTIN_FUNC1 found");
    case INST_CALL_FUNC1:
	Tcl_Panic("TclExecuteByteCode: obsolete INST_CALL_FUNC1 found");
#endif
    }

    /*
     * -----------------------------------------------------------------
     *	   Start of INST_LOAD instructions.
     *
     * WARNING: more 'goto' here than your doctor recommended! The different
     * instructions set the value of some variables and then jump to some
     * common execution code.
     */
    {
	int pcAdjustment;

    case INST_LOAD_SCALAR1:
    instLoadScalar1:
	opnd = TclGetUInt1AtPtr(pc+1);
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;







|







<
<
<













>
|
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
>


|
<
|







<
<
<
<
<
<
|
>















<












<









<
<







2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995



2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028

3029
3030
3031
3032
3033

3034
3035
3036
3037
3038
3039
3040
3041






3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058

3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070

3071
3072
3073
3074
3075
3076
3077
3078
3079


3080
3081
3082
3083
3084
3085
3086

	TclNewObj(objPtr);
	Tcl_IncrRefCount(objPtr);
	iPtr->objResultPtr = objPtr;
	NEXT_INST_V(0, cleanup, -1);

#if TCL_SUPPORT_84_BYTECODE
    case INST_CALL_BUILTIN_FUNC1:
	/*
	 * Call one of the built-in pre-8.5 Tcl math functions. This
	 * translates to INST_INVOKE_STK1 with the first argument of
	 * ::tcl::mathfunc::$objv[0]. We need to insert the named math
	 * function into the stack.
	 */




	opnd = TclGetUInt1AtPtr(pc+1);
	if ((opnd < 0) || (opnd > LAST_BUILTIN_FUNC)) {
	    TRACE(("UNRECOGNIZED BUILTIN FUNC CODE %d\n", opnd));
	    Tcl_Panic("TclExecuteByteCode: unrecognized builtin function code %d", opnd);
	}

	TclNewLiteralStringObj(objPtr, "::tcl::mathfunc::");
	Tcl_AppendToObj(objPtr, tclBuiltinFuncTable[opnd].name, -1);

	/*
	 * Only 0, 1 or 2 args.
	 */

	{
	    int numArgs = tclBuiltinFuncTable[opnd].numArgs;
	    Tcl_Obj *tmpPtr1, *tmpPtr2;

	    if (numArgs == 0) {
		PUSH_OBJECT(objPtr);
	    } else if (numArgs == 1) {
		tmpPtr1 = POP_OBJECT();
		PUSH_OBJECT(objPtr);
		PUSH_OBJECT(tmpPtr1);
		Tcl_DecrRefCount(tmpPtr1);
	    } else {
		tmpPtr2 = POP_OBJECT();
		tmpPtr1 = POP_OBJECT();
		PUSH_OBJECT(objPtr);
		PUSH_OBJECT(tmpPtr1);
		PUSH_OBJECT(tmpPtr2);
		Tcl_DecrRefCount(tmpPtr1);
		Tcl_DecrRefCount(tmpPtr2);
	    }

	    objc = numArgs + 1;
	}
	pcAdjustment = 2;
	goto doInvocation;


    case INST_CALL_FUNC1:
	/*
	 * Call a non-builtin Tcl math function previously registered by a
	 * call to Tcl_CreateMathFunc pre-8.5. This is essentially
	 * INST_INVOKE_STK1 converting the first arg to
	 * ::tcl::mathfunc::$objv[0].
	 */







	objc = TclGetUInt1AtPtr(pc+1);	/* Number of arguments. The function
					 * name is the 0-th argument. */

	objPtr = OBJ_AT_DEPTH(objc-1);
	TclNewLiteralStringObj(tmpPtr, "::tcl::mathfunc::");
	Tcl_AppendObjToObj(tmpPtr, objPtr);
	Tcl_DecrRefCount(objPtr);

	/*
	 * Variation of PUSH_OBJECT.
	 */

	OBJ_AT_DEPTH(objc-1) = tmpPtr;
	Tcl_IncrRefCount(tmpPtr);

	pcAdjustment = 2;
	goto doInvocation;

#else
    /*
     * INST_CALL_BUILTIN_FUNC1 and INST_CALL_FUNC1 were made obsolete by the
     * changes to add a ::tcl::mathfunc namespace in 8.5. Optional support
     * remains for existing bytecode precompiled files.
     */

    case INST_CALL_BUILTIN_FUNC1:
	Tcl_Panic("TclExecuteByteCode: obsolete INST_CALL_BUILTIN_FUNC1 found");
    case INST_CALL_FUNC1:
	Tcl_Panic("TclExecuteByteCode: obsolete INST_CALL_FUNC1 found");
#endif


    /*
     * -----------------------------------------------------------------
     *	   Start of INST_LOAD instructions.
     *
     * WARNING: more 'goto' here than your doctor recommended! The different
     * instructions set the value of some variables and then jump to some
     * common execution code.
     */



    case INST_LOAD_SCALAR1:
    instLoadScalar1:
	opnd = TclGetUInt1AtPtr(pc+1);
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
		TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
		NEXT_INST_F(pcAdjustment, 1, 1);
	    }
	}
	varPtr = TclLookupArrayElement(interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "read", 0, 1, arrayPtr, opnd);
	if (varPtr == NULL) {
	    TRACE_APPEND(("ERROR: %.30s\n",
				 O2S(Tcl_GetObjResult(interp))));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}
	cleanup = 1;
	goto doCallPtrGetVar;

    case INST_LOAD_ARRAY_STK:
	cleanup = 2;
	part2Ptr = OBJ_AT_TOS;		/* element name */







|
<
<
|







3151
3152
3153
3154
3155
3156
3157
3158


3159
3160
3161
3162
3163
3164
3165
3166
		TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
		NEXT_INST_F(pcAdjustment, 1, 1);
	    }
	}
	varPtr = TclLookupArrayElement(interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "read", 0, 1, arrayPtr, opnd);
	if (varPtr == NULL) {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));


	    goto gotError;
	}
	cleanup = 1;
	goto doCallPtrGetVar;

    case INST_LOAD_ARRAY_STK:
	cleanup = 2;
	part2Ptr = OBJ_AT_TOS;		/* element name */
3191
3192
3193
3194
3195
3196
3197
3198




3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235


3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
	TRACE(("\"%.30s\" => ", O2S(objPtr)));

    doLoadStk:
	part1Ptr = objPtr;
	varPtr = TclObjLookupVarEx(interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "read", /*createPart1*/0, /*createPart2*/1,
		&arrayPtr);
	if (varPtr) {




	    if (TclIsVarDirectReadable2(varPtr, arrayPtr)) {
		/*
		 * No errors, no traces: just get the value.
		 */

		objResultPtr = varPtr->value.objPtr;
		TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
		NEXT_INST_V(1, cleanup, 1);
	    }
	    pcAdjustment = 1;
	    opnd = -1;
	    goto doCallPtrGetVar;
	} else {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}

    doCallPtrGetVar:
	/*
	 * There are either errors or the variable is traced: call
	 * TclPtrGetVar to process fully.
	 */

	DECACHE_STACK_INFO();
	objResultPtr = TclPtrGetVar(interp, varPtr, arrayPtr,
		part1Ptr, part2Ptr, TCL_LEAVE_ERR_MSG, opnd);
	CACHE_STACK_INFO();
	if (objResultPtr) {
	    TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	    NEXT_INST_V(pcAdjustment, cleanup, 1);
	} else {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}
    }



    /*
     *	   End of INST_LOAD instructions.
     * -----------------------------------------------------------------
     *	   Start of INST_STORE and related instructions.
     *
     * WARNING: more 'goto' here than your doctor recommended! The different
     * instructions set the value of some variables and then jump to somme
     * common execution code.
     */

    {
	int pcAdjustment, storeFlags;

    case INST_STORE_ARRAY4:
	opnd = TclGetUInt4AtPtr(pc+1);
	pcAdjustment = 5;
	goto doStoreArrayDirect;

    case INST_STORE_ARRAY1:







|
>
>
>
>
|
|
|
|

|
|
|
|
|
|
<
<
<
<
<
<











|
<
<
<

<
|

<
>
>












|







3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198






3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210



3211

3212
3213

3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
	TRACE(("\"%.30s\" => ", O2S(objPtr)));

    doLoadStk:
	part1Ptr = objPtr;
	varPtr = TclObjLookupVarEx(interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "read", /*createPart1*/0, /*createPart2*/1,
		&arrayPtr);
	if (!varPtr) {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    goto gotError;
	}

	if (TclIsVarDirectReadable2(varPtr, arrayPtr)) {
	    /*
	     * No errors, no traces: just get the value.
	     */

	    objResultPtr = varPtr->value.objPtr;
	    TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	    NEXT_INST_V(1, cleanup, 1);
	}
	pcAdjustment = 1;
	opnd = -1;







    doCallPtrGetVar:
	/*
	 * There are either errors or the variable is traced: call
	 * TclPtrGetVar to process fully.
	 */

	DECACHE_STACK_INFO();
	objResultPtr = TclPtrGetVar(interp, varPtr, arrayPtr,
		part1Ptr, part2Ptr, TCL_LEAVE_ERR_MSG, opnd);
	CACHE_STACK_INFO();
	if (!objResultPtr) {



	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));

	    goto gotError;
	}

	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	NEXT_INST_V(pcAdjustment, cleanup, 1);

    /*
     *	   End of INST_LOAD instructions.
     * -----------------------------------------------------------------
     *	   Start of INST_STORE and related instructions.
     *
     * WARNING: more 'goto' here than your doctor recommended! The different
     * instructions set the value of some variables and then jump to somme
     * common execution code.
     */

    {
	int storeFlags;

    case INST_STORE_ARRAY4:
	opnd = TclGetUInt4AtPtr(pc+1);
	pcAdjustment = 5;
	goto doStoreArrayDirect;

    case INST_STORE_ARRAY1:
3291
3292
3293
3294
3295
3296
3297
3298


3299


3300
3301
3302
3303
3304
3305

3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
    doStoreScalarDirect:
	valuePtr = OBJ_AT_TOS;
	varPtr = LOCAL(opnd);
	TRACE(("%u <- \"%.30s\" => ", opnd, O2S(valuePtr)));
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	if (TclIsVarDirectWritable(varPtr)) {


    doStoreVarDirect:


	    /*
	     * No traces, no errors, plain 'set': we can safely inline. The
	     * value *will* be set to what's requested, so that the stack top
	     * remains pointing to the same Tcl_Obj.
	     */


	    valuePtr = varPtr->value.objPtr;
	    if (valuePtr != NULL) {
		TclDecrRefCount(valuePtr);
	    }
	    objResultPtr = OBJ_AT_TOS;
	    varPtr->value.objPtr = objResultPtr;
#ifndef TCL_COMPILE_DEBUG
	    if (*(pc+pcAdjustment) == INST_POP) {
		tosPtr--;
		NEXT_INST_F((pcAdjustment+1), 0, 0);
	    }
#else
	    TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
#endif
	    Tcl_IncrRefCount(objResultPtr);
	    NEXT_INST_F(pcAdjustment, 0, 0);
	}
	storeFlags = TCL_LEAVE_ERR_MSG;
	part1Ptr = NULL;
	goto doStoreScalar;

    case INST_LAPPEND_STK:
	valuePtr = OBJ_AT_TOS; /* value to append */
	part2Ptr = NULL;
	storeFlags = (TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
		| TCL_LIST_ELEMENT | TCL_TRACE_READS);
	goto doStoreStk;







|
>
>
|
>
>
|
|
|
|
|

>
|
|
|
|
|
|

|
|
|
|

|

|
|
<
<
<
<







3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306




3307
3308
3309
3310
3311
3312
3313
    doStoreScalarDirect:
	valuePtr = OBJ_AT_TOS;
	varPtr = LOCAL(opnd);
	TRACE(("%u <- \"%.30s\" => ", opnd, O2S(valuePtr)));
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	if (!TclIsVarDirectWritable(varPtr)) {
	    storeFlags = TCL_LEAVE_ERR_MSG;
	    part1Ptr = NULL;
	    goto doStoreScalar;
	}

	/*
	 * No traces, no errors, plain 'set': we can safely inline. The value
	 * *will* be set to what's requested, so that the stack top remains
	 * pointing to the same Tcl_Obj.
	 */

    doStoreVarDirect:
	valuePtr = varPtr->value.objPtr;
	if (valuePtr != NULL) {
	    TclDecrRefCount(valuePtr);
	}
	objResultPtr = OBJ_AT_TOS;
	varPtr->value.objPtr = objResultPtr;
#ifndef TCL_COMPILE_DEBUG
	if (*(pc+pcAdjustment) == INST_POP) {
	    tosPtr--;
	    NEXT_INST_F((pcAdjustment+1), 0, 0);
	}
#else
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
#endif
	Tcl_IncrRefCount(objResultPtr);
	NEXT_INST_F(pcAdjustment, 0, 0);





    case INST_LAPPEND_STK:
	valuePtr = OBJ_AT_TOS; /* value to append */
	part2Ptr = NULL;
	storeFlags = (TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
		| TCL_LIST_ELEMENT | TCL_TRACE_READS);
	goto doStoreStk;
3371
3372
3373
3374
3375
3376
3377
3378



3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
	} else {
	    TRACE(("\"%.30s(%.30s)\" <- \"%.30s\" => ",
		    O2S(part1Ptr), O2S(part2Ptr), O2S(valuePtr)));
	}
#endif
	varPtr = TclObjLookupVarEx(interp, objPtr,part2Ptr, TCL_LEAVE_ERR_MSG,
		"set", /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr);
	if (varPtr) {



	    cleanup = ((part2Ptr == NULL)? 2 : 3);
	    pcAdjustment = 1;
	    opnd = -1;
	    goto doCallPtrSetVar;
	} else {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}

    case INST_LAPPEND_ARRAY4:
	opnd = TclGetUInt4AtPtr(pc+1);
	pcAdjustment = 5;
	storeFlags = (TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
		| TCL_LIST_ELEMENT | TCL_TRACE_READS);
	goto doStoreArray;







|
>
>
>
|
|
|
|
<
<
<
<
<







3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366





3367
3368
3369
3370
3371
3372
3373
	} else {
	    TRACE(("\"%.30s(%.30s)\" <- \"%.30s\" => ",
		    O2S(part1Ptr), O2S(part2Ptr), O2S(valuePtr)));
	}
#endif
	varPtr = TclObjLookupVarEx(interp, objPtr,part2Ptr, TCL_LEAVE_ERR_MSG,
		"set", /*createPart1*/ 1, /*createPart2*/ 1, &arrayPtr);
	if (!varPtr) {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    goto gotError;
	}
	cleanup = ((part2Ptr == NULL)? 2 : 3);
	pcAdjustment = 1;
	opnd = -1;
	goto doCallPtrSetVar;






    case INST_LAPPEND_ARRAY4:
	opnd = TclGetUInt4AtPtr(pc+1);
	pcAdjustment = 5;
	storeFlags = (TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
		| TCL_LIST_ELEMENT | TCL_TRACE_READS);
	goto doStoreArray;
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436

3437
3438
3439
3440
3441
3442
3443
	}
	cleanup = 2;
	part1Ptr = NULL;

    doStoreArrayDirectFailed:
	varPtr = TclLookupArrayElement(interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "set", 1, 1, arrayPtr, opnd);
	if (varPtr) {
	    goto doCallPtrSetVar;
	} else {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}


    case INST_LAPPEND_SCALAR4:
	opnd = TclGetUInt4AtPtr(pc+1);
	pcAdjustment = 5;
	storeFlags = (TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
		| TCL_LIST_ELEMENT | TCL_TRACE_READS);
	goto doStoreScalar;







|
<
<

<
|

>







3402
3403
3404
3405
3406
3407
3408
3409


3410

3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
	}
	cleanup = 2;
	part1Ptr = NULL;

    doStoreArrayDirectFailed:
	varPtr = TclLookupArrayElement(interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "set", 1, 1, arrayPtr, opnd);
	if (!varPtr) {


	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));

	    goto gotError;
	}
	goto doCallPtrSetVar;

    case INST_LAPPEND_SCALAR4:
	opnd = TclGetUInt4AtPtr(pc+1);
	pcAdjustment = 5;
	storeFlags = (TCL_LEAVE_ERR_MSG | TCL_APPEND_VALUE
		| TCL_LIST_ELEMENT | TCL_TRACE_READS);
	goto doStoreScalar;
3473
3474
3475
3476
3477
3478
3479
3480



3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
	part1Ptr = part2Ptr = NULL;

    doCallPtrSetVar:
	DECACHE_STACK_INFO();
	objResultPtr = TclPtrSetVar(interp, varPtr, arrayPtr,
		part1Ptr, part2Ptr, valuePtr, storeFlags, opnd);
	CACHE_STACK_INFO();
	if (objResultPtr) {



#ifndef TCL_COMPILE_DEBUG
	    if (*(pc+pcAdjustment) == INST_POP) {
		NEXT_INST_V((pcAdjustment+1), cleanup, 0);
	    }
#endif
	    TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	    NEXT_INST_V(pcAdjustment, cleanup, 1);
	} else {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}
    }

    /*
     *	   End of INST_STORE and related instructions.
     * -----------------------------------------------------------------
     *	   Start of INST_INCR instructions.
     *
     * WARNING: more 'goto' here than your doctor recommended! The different
     * instructions set the value of some variables and then jump to somme
     * common execution code.
     */

/*TODO: Consider more untangling here; merge with LOAD and STORE ? */

    {
	Tcl_Obj *incrPtr;
	int pcAdjustment;
#ifndef NO_WIDE_TYPE
	Tcl_WideInt w;
#endif
	long i;

    case INST_INCR_SCALAR1:
    case INST_INCR_ARRAY1:
    case INST_INCR_ARRAY_STK:
    case INST_INCR_SCALAR_STK:
    case INST_INCR_STK:
	opnd = TclGetUInt1AtPtr(pc+1);







|
>
>
>

|
|
|

|
|
<
<
<
<
<
















<



|







3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467





3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483

3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
	part1Ptr = part2Ptr = NULL;

    doCallPtrSetVar:
	DECACHE_STACK_INFO();
	objResultPtr = TclPtrSetVar(interp, varPtr, arrayPtr,
		part1Ptr, part2Ptr, valuePtr, storeFlags, opnd);
	CACHE_STACK_INFO();
	if (!objResultPtr) {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    goto gotError;
	}
#ifndef TCL_COMPILE_DEBUG
	if (*(pc+pcAdjustment) == INST_POP) {
	    NEXT_INST_V((pcAdjustment+1), cleanup, 0);
	}
#endif
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	NEXT_INST_V(pcAdjustment, cleanup, 1);





    }

    /*
     *	   End of INST_STORE and related instructions.
     * -----------------------------------------------------------------
     *	   Start of INST_INCR instructions.
     *
     * WARNING: more 'goto' here than your doctor recommended! The different
     * instructions set the value of some variables and then jump to somme
     * common execution code.
     */

/*TODO: Consider more untangling here; merge with LOAD and STORE ? */

    {
	Tcl_Obj *incrPtr;

#ifndef NO_WIDE_TYPE
	Tcl_WideInt w;
#endif
	long increment;

    case INST_INCR_SCALAR1:
    case INST_INCR_ARRAY1:
    case INST_INCR_ARRAY_STK:
    case INST_INCR_SCALAR_STK:
    case INST_INCR_STK:
	opnd = TclGetUInt1AtPtr(pc+1);
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568


3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595

3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
	    pcAdjustment = 1;
	    goto doIncrStk;
	}

    case INST_INCR_ARRAY_STK_IMM:
    case INST_INCR_SCALAR_STK_IMM:
    case INST_INCR_STK_IMM:
	i = TclGetInt1AtPtr(pc+1);
	incrPtr = Tcl_NewIntObj(i);
	Tcl_IncrRefCount(incrPtr);
	pcAdjustment = 2;

    doIncrStk:
	if ((*pc == INST_INCR_ARRAY_STK_IMM)
		|| (*pc == INST_INCR_ARRAY_STK)) {
	    part2Ptr = OBJ_AT_TOS;
	    objPtr = OBJ_UNDER_TOS;
	    TRACE(("\"%.30s(%.30s)\" (by %ld) => ",
		    O2S(objPtr), O2S(part2Ptr), i));
	} else {
	    part2Ptr = NULL;
	    objPtr = OBJ_AT_TOS;
	    TRACE(("\"%.30s\" (by %ld) => ", O2S(objPtr), i));
	}
	part1Ptr = objPtr;
	opnd = -1;
	varPtr = TclObjLookupVarEx(interp, objPtr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "read", 1, 1, &arrayPtr);
	if (varPtr) {
	    cleanup = ((part2Ptr == NULL)? 1 : 2);
	    goto doIncrVar;
	} else {
	    Tcl_AddObjErrorInfo(interp,
		    "\n    (reading value of variable to increment)", -1);
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    TRESULT = TCL_ERROR;
	    Tcl_DecrRefCount(incrPtr);
	    goto checkForCatch;
	}



    case INST_INCR_ARRAY1_IMM:
	opnd = TclGetUInt1AtPtr(pc+1);
	i = TclGetInt1AtPtr(pc+2);
	incrPtr = Tcl_NewIntObj(i);
	Tcl_IncrRefCount(incrPtr);
	pcAdjustment = 3;

    doIncrArray:
	part1Ptr = NULL;
	part2Ptr = OBJ_AT_TOS;
	arrayPtr = LOCAL(opnd);
	cleanup = 1;
	while (TclIsVarLink(arrayPtr)) {
	    arrayPtr = arrayPtr->value.linkPtr;
	}
	TRACE(("%u \"%.30s\" (by %ld) => ", opnd, O2S(part2Ptr), i));
	varPtr = TclLookupArrayElement(interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "read", 1, 1, arrayPtr, opnd);
	if (varPtr) {
	    goto doIncrVar;
	} else {
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	    TRESULT = TCL_ERROR;
	    Tcl_DecrRefCount(incrPtr);
	    goto checkForCatch;
	}


    case INST_INCR_SCALAR1_IMM:
	opnd = TclGetUInt1AtPtr(pc+1);
	i = TclGetInt1AtPtr(pc+2);
	pcAdjustment = 3;
	cleanup = 0;
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}

	if (TclIsVarDirectModifyable(varPtr)) {
	    ClientData ptr;
	    int type;

	    objPtr = varPtr->value.objPtr;
	    if (GetNumberFromObj(NULL, objPtr, &ptr, &type) == TCL_OK) {
		if (type == TCL_NUMBER_LONG) {
		    long augend = *((const long *)ptr);
		    long sum = augend + i;

		    /*
		     * Overflow when (augend and sum have different sign) and
		     * (augend and i have the same sign). This is encapsulated
		     * in the Overflowing macro.
		     */

		    if (!Overflowing(augend, i, sum)) {
			TRACE(("%u %ld => ", opnd, i));
			if (Tcl_IsShared(objPtr)) {
			    objPtr->refCount--;	/* We know it's shared. */
			    TclNewLongObj(objResultPtr, sum);
			    Tcl_IncrRefCount(objResultPtr);
			    varPtr->value.objPtr = objResultPtr;
			} else {
			    objResultPtr = objPtr;
			    TclSetLongObj(objPtr, sum);
			}
			goto doneIncr;
		    }
#ifndef NO_WIDE_TYPE
		    w = (Tcl_WideInt)augend;

		    TRACE(("%u %ld => ", opnd, i));
		    if (Tcl_IsShared(objPtr)) {
			objPtr->refCount--;	/* We know it's shared. */
			objResultPtr = Tcl_NewWideIntObj(w+i);
			Tcl_IncrRefCount(objResultPtr);
			varPtr->value.objPtr = objResultPtr;
		    } else {
			objResultPtr = objPtr;

			/*
			 * We know the sum value is outside the long range;
			 * use macro form that doesn't range test again.
			 */

			TclSetWideIntObj(objPtr, w+i);
		    }
		    goto doneIncr;
#endif
		}	/* end if (type == TCL_NUMBER_LONG) */
#ifndef NO_WIDE_TYPE
		if (type == TCL_NUMBER_WIDE) {
		    Tcl_WideInt sum;

		    w = *((const Tcl_WideInt *) ptr);
		    sum = w + i;

		    /*
		     * Check for overflow.
		     */

		    if (!Overflowing(w, i, sum)) {
			TRACE(("%u %ld => ", opnd, i));
			if (Tcl_IsShared(objPtr)) {
			    objPtr->refCount--;	/* We know it's shared. */
			    objResultPtr = Tcl_NewWideIntObj(sum);
			    Tcl_IncrRefCount(objResultPtr);
			    varPtr->value.objPtr = objResultPtr;
			} else {
			    objResultPtr = objPtr;







|
|









|



|





|
<
<
<



<

|

>
>



|
|











|


|
<
<

<

|

>



|















|



|
|


|
|














|


|










|









|





|
|







3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532



3533
3534
3535

3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560


3561

3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
	    pcAdjustment = 1;
	    goto doIncrStk;
	}

    case INST_INCR_ARRAY_STK_IMM:
    case INST_INCR_SCALAR_STK_IMM:
    case INST_INCR_STK_IMM:
	increment = TclGetInt1AtPtr(pc+1);
	incrPtr = Tcl_NewIntObj(increment);
	Tcl_IncrRefCount(incrPtr);
	pcAdjustment = 2;

    doIncrStk:
	if ((*pc == INST_INCR_ARRAY_STK_IMM)
		|| (*pc == INST_INCR_ARRAY_STK)) {
	    part2Ptr = OBJ_AT_TOS;
	    objPtr = OBJ_UNDER_TOS;
	    TRACE(("\"%.30s(%.30s)\" (by %ld) => ",
		    O2S(objPtr), O2S(part2Ptr), increment));
	} else {
	    part2Ptr = NULL;
	    objPtr = OBJ_AT_TOS;
	    TRACE(("\"%.30s\" (by %ld) => ", O2S(objPtr), increment));
	}
	part1Ptr = objPtr;
	opnd = -1;
	varPtr = TclObjLookupVarEx(interp, objPtr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "read", 1, 1, &arrayPtr);
	if (!varPtr) {



	    Tcl_AddObjErrorInfo(interp,
		    "\n    (reading value of variable to increment)", -1);
	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));

	    Tcl_DecrRefCount(incrPtr);
	    goto gotError;
	}
	cleanup = ((part2Ptr == NULL)? 1 : 2);
	goto doIncrVar;

    case INST_INCR_ARRAY1_IMM:
	opnd = TclGetUInt1AtPtr(pc+1);
	increment = TclGetInt1AtPtr(pc+2);
	incrPtr = Tcl_NewIntObj(increment);
	Tcl_IncrRefCount(incrPtr);
	pcAdjustment = 3;

    doIncrArray:
	part1Ptr = NULL;
	part2Ptr = OBJ_AT_TOS;
	arrayPtr = LOCAL(opnd);
	cleanup = 1;
	while (TclIsVarLink(arrayPtr)) {
	    arrayPtr = arrayPtr->value.linkPtr;
	}
	TRACE(("%u \"%.30s\" (by %ld) => ", opnd, O2S(part2Ptr), increment));
	varPtr = TclLookupArrayElement(interp, part1Ptr, part2Ptr,
		TCL_LEAVE_ERR_MSG, "read", 1, 1, arrayPtr, opnd);
	if (!varPtr) {


	    TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));

	    Tcl_DecrRefCount(incrPtr);
	    goto gotError;
	}
	goto doIncrVar;

    case INST_INCR_SCALAR1_IMM:
	opnd = TclGetUInt1AtPtr(pc+1);
	increment = TclGetInt1AtPtr(pc+2);
	pcAdjustment = 3;
	cleanup = 0;
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}

	if (TclIsVarDirectModifyable(varPtr)) {
	    ClientData ptr;
	    int type;

	    objPtr = varPtr->value.objPtr;
	    if (GetNumberFromObj(NULL, objPtr, &ptr, &type) == TCL_OK) {
		if (type == TCL_NUMBER_LONG) {
		    long augend = *((const long *)ptr);
		    long sum = augend + increment;

		    /*
		     * Overflow when (augend and sum have different sign) and
		     * (augend and increment have the same sign). This is
		     * encapsulated in the Overflowing macro.
		     */

		    if (!Overflowing(augend, increment, sum)) {
			TRACE(("%u %ld => ", opnd, increment));
			if (Tcl_IsShared(objPtr)) {
			    objPtr->refCount--;	/* We know it's shared. */
			    TclNewLongObj(objResultPtr, sum);
			    Tcl_IncrRefCount(objResultPtr);
			    varPtr->value.objPtr = objResultPtr;
			} else {
			    objResultPtr = objPtr;
			    TclSetLongObj(objPtr, sum);
			}
			goto doneIncr;
		    }
#ifndef NO_WIDE_TYPE
		    w = (Tcl_WideInt)augend;

		    TRACE(("%u %ld => ", opnd, increment));
		    if (Tcl_IsShared(objPtr)) {
			objPtr->refCount--;	/* We know it's shared. */
			objResultPtr = Tcl_NewWideIntObj(w+increment);
			Tcl_IncrRefCount(objResultPtr);
			varPtr->value.objPtr = objResultPtr;
		    } else {
			objResultPtr = objPtr;

			/*
			 * We know the sum value is outside the long range;
			 * use macro form that doesn't range test again.
			 */

			TclSetWideIntObj(objPtr, w+increment);
		    }
		    goto doneIncr;
#endif
		}	/* end if (type == TCL_NUMBER_LONG) */
#ifndef NO_WIDE_TYPE
		if (type == TCL_NUMBER_WIDE) {
		    Tcl_WideInt sum;

		    w = *((const Tcl_WideInt *) ptr);
		    sum = w + increment;

		    /*
		     * Check for overflow.
		     */

		    if (!Overflowing(w, increment, sum)) {
			TRACE(("%u %ld => ", opnd, increment));
			if (Tcl_IsShared(objPtr)) {
			    objPtr->refCount--;	/* We know it's shared. */
			    objResultPtr = Tcl_NewWideIntObj(sum);
			    Tcl_IncrRefCount(objResultPtr);
			    varPtr->value.objPtr = objResultPtr;
			} else {
			    objResultPtr = objPtr;
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709


3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748

3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
		objPtr->refCount--;	/* We know it's shared */
		objResultPtr = Tcl_DuplicateObj(objPtr);
		Tcl_IncrRefCount(objResultPtr);
		varPtr->value.objPtr = objResultPtr;
	    } else {
		objResultPtr = objPtr;
	    }
	    TclNewLongObj(incrPtr, i);
	    TRESULT = TclIncrObj(interp, objResultPtr, incrPtr);
	    Tcl_DecrRefCount(incrPtr);
	    if (TRESULT == TCL_OK) {
		goto doneIncr;
	    } else {
		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));
		goto checkForCatch;
	    }


	}

	/*
	 * All other cases, flow through to generic handling.
	 */

	TclNewLongObj(incrPtr, i);
	Tcl_IncrRefCount(incrPtr);

    doIncrScalar:
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	arrayPtr = NULL;
	part1Ptr = part2Ptr = NULL;
	cleanup = 0;
	TRACE(("%u %ld => ", opnd, i));

    doIncrVar:
	if (TclIsVarDirectModifyable2(varPtr, arrayPtr)) {
	    objPtr = varPtr->value.objPtr;
	    if (Tcl_IsShared(objPtr)) {
		objPtr->refCount--;	/* We know it's shared */
		objResultPtr = Tcl_DuplicateObj(objPtr);
		Tcl_IncrRefCount(objResultPtr);
		varPtr->value.objPtr = objResultPtr;
	    } else {
		objResultPtr = objPtr;
	    }
	    TRESULT = TclIncrObj(interp, objResultPtr, incrPtr);
	    Tcl_DecrRefCount(incrPtr);
	    if (TRESULT == TCL_OK) {
		goto doneIncr;
	    } else {
		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));
		goto checkForCatch;
	    }

	} else {
	    DECACHE_STACK_INFO();
	    objResultPtr = TclPtrIncrObjVar(interp, varPtr, arrayPtr,
		    part1Ptr, part2Ptr, incrPtr, TCL_LEAVE_ERR_MSG, opnd);
	    CACHE_STACK_INFO();
	    Tcl_DecrRefCount(incrPtr);
	    if (objResultPtr == NULL) {
		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }
	}
    doneIncr:
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
#ifndef TCL_COMPILE_DEBUG
	if (*(pc+pcAdjustment) == INST_POP) {
	    NEXT_INST_V((pcAdjustment+1), cleanup, 0);







|
|
|
<
<
<


|

>
>






|










|












|
|
<
<
<


|

>









<
|







3663
3664
3665
3666
3667
3668
3669
3670
3671
3672



3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710



3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724

3725
3726
3727
3728
3729
3730
3731
3732
		objPtr->refCount--;	/* We know it's shared */
		objResultPtr = Tcl_DuplicateObj(objPtr);
		Tcl_IncrRefCount(objResultPtr);
		varPtr->value.objPtr = objResultPtr;
	    } else {
		objResultPtr = objPtr;
	    }
	    TclNewLongObj(incrPtr, increment);
	    if (TclIncrObj(interp, objResultPtr, incrPtr) != TCL_OK) {
		Tcl_DecrRefCount(incrPtr);



		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));
		goto gotError;
	    }
	    Tcl_DecrRefCount(incrPtr);
	    goto doneIncr;
	}

	/*
	 * All other cases, flow through to generic handling.
	 */

	TclNewLongObj(incrPtr, increment);
	Tcl_IncrRefCount(incrPtr);

    doIncrScalar:
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	arrayPtr = NULL;
	part1Ptr = part2Ptr = NULL;
	cleanup = 0;
	TRACE(("%u %ld => ", opnd, increment));

    doIncrVar:
	if (TclIsVarDirectModifyable2(varPtr, arrayPtr)) {
	    objPtr = varPtr->value.objPtr;
	    if (Tcl_IsShared(objPtr)) {
		objPtr->refCount--;	/* We know it's shared */
		objResultPtr = Tcl_DuplicateObj(objPtr);
		Tcl_IncrRefCount(objResultPtr);
		varPtr->value.objPtr = objResultPtr;
	    } else {
		objResultPtr = objPtr;
	    }
	    if (TclIncrObj(interp, objResultPtr, incrPtr) != TCL_OK) {
		Tcl_DecrRefCount(incrPtr);



		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));
		goto gotError;
	    }
	    Tcl_DecrRefCount(incrPtr);
	} else {
	    DECACHE_STACK_INFO();
	    objResultPtr = TclPtrIncrObjVar(interp, varPtr, arrayPtr,
		    part1Ptr, part2Ptr, incrPtr, TCL_LEAVE_ERR_MSG, opnd);
	    CACHE_STACK_INFO();
	    Tcl_DecrRefCount(incrPtr);
	    if (objResultPtr == NULL) {
		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));

		goto gotError;
	    }
	}
    doneIncr:
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
#ifndef TCL_COMPILE_DEBUG
	if (*(pc+pcAdjustment) == INST_POP) {
	    NEXT_INST_V((pcAdjustment+1), cleanup, 0);
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899

3900
3901
3902
3903
3904
3905
3906
3907

3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918

3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932






3933
3934
3935
3936
3937
3938
3939

3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953

3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978

3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997


3998

3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013

4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
    /*
     *	   End of INST_EXIST instructions.
     * -----------------------------------------------------------------
     *	   Start of INST_UNSET instructions.
     */

    {
	int flags, localResult;

    case INST_UNSET_SCALAR:
	flags = TclGetUInt1AtPtr(pc+1) ? TCL_LEAVE_ERR_MSG : 0;
	opnd = TclGetUInt4AtPtr(pc+2);
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	TRACE(("%s %u\n", (flags?"normal":"noerr"), opnd));
	if (TclIsVarDirectUnsettable(varPtr) && !TclIsVarInHash(varPtr)) {
	    /*
	     * No errors, no traces, no searches: just make the variable cease
	     * to exist.
	     */

	    if (!TclIsVarUndefined(varPtr)) {
		Tcl_DecrRefCount(varPtr->value.objPtr);
	    } else if (flags & TCL_LEAVE_ERR_MSG) {
		goto slowUnsetScalar;
	    }
	    varPtr->value.objPtr = NULL;
	    NEXT_INST_F(6, 0, 0);
	}

    slowUnsetScalar:
	DECACHE_STACK_INFO();
	localResult = TclPtrUnsetVar(interp, varPtr, NULL, NULL, NULL, flags,
		opnd);
	CACHE_STACK_INFO();
	if (localResult != TCL_OK && flags) {
	    goto errorInUnset;
	}

	NEXT_INST_F(6, 0, 0);

    case INST_UNSET_ARRAY:
	flags = TclGetUInt1AtPtr(pc+1) ? TCL_LEAVE_ERR_MSG : 0;
	opnd = TclGetUInt4AtPtr(pc+2);
	part2Ptr = OBJ_AT_TOS;
	arrayPtr = LOCAL(opnd);
	while (TclIsVarLink(arrayPtr)) {
	    arrayPtr = arrayPtr->value.linkPtr;
	}
	TRACE(("%s %u \"%.30s\"\n", (flags?"normal":"noerr"), opnd, O2S(part2Ptr)));

	if (TclIsVarArray(arrayPtr) && !UnsetTraced(arrayPtr)) {
	    varPtr = VarHashFindVar(arrayPtr->value.tablePtr, part2Ptr);
	    if (varPtr && TclIsVarDirectUnsettable(varPtr)) {
		/*
		 * No nasty traces and element exists, so we can proceed to
		 * unset it. Might still not exist though...
		 */

		if (!TclIsVarUndefined(varPtr)) {
		    Tcl_DecrRefCount(varPtr->value.objPtr);
		} else if (flags & TCL_LEAVE_ERR_MSG) {
		    goto slowUnsetArray;
		}
		varPtr->value.objPtr = NULL;






		NEXT_INST_F(6, 1, 0);
	    }
	}
    slowUnsetArray:
	DECACHE_STACK_INFO();
	varPtr = TclLookupArrayElement(interp, NULL, part2Ptr, flags, "unset",
		0, 0, arrayPtr, opnd);

	if (!varPtr && (flags & TCL_LEAVE_ERR_MSG)) {
	    CACHE_STACK_INFO();
	    goto errorInUnset;
	}
	if (varPtr) {
	    localResult = TclPtrUnsetVar(interp, varPtr, arrayPtr, NULL,
		    part2Ptr, flags, opnd);
	} else {
	    localResult = TCL_OK;
	}
	CACHE_STACK_INFO();
	if (localResult != TCL_OK && (flags & TCL_LEAVE_ERR_MSG)) {
	    goto errorInUnset;
	}

	NEXT_INST_F(6, 1, 0);

    case INST_UNSET_ARRAY_STK:
	flags = TclGetUInt1AtPtr(pc+1) ? TCL_LEAVE_ERR_MSG : 0;
	cleanup = 2;
	part2Ptr = OBJ_AT_TOS;		/* element name */
	part1Ptr = OBJ_UNDER_TOS;	/* array name */
	TRACE(("%s \"%.30s(%.30s)\"\n", (flags?"normal":"noerr"),
		O2S(part1Ptr), O2S(part2Ptr)));
	goto doUnsetStk;

    case INST_UNSET_STK:
	flags = TclGetUInt1AtPtr(pc+1) ? TCL_LEAVE_ERR_MSG : 0;
	cleanup = 1;
	part2Ptr = NULL;
	part1Ptr = OBJ_AT_TOS;		/* variable name */
	TRACE(("%s \"%.30s\"\n", (flags?"normal":"noerr"), O2S(part1Ptr)));

    doUnsetStk:
	DECACHE_STACK_INFO();
	localResult = TclObjUnsetVar2(interp, part1Ptr, part2Ptr, flags);
	CACHE_STACK_INFO();
	if (localResult != TCL_OK && (flags & TCL_LEAVE_ERR_MSG)) {
	    goto errorInUnset;
	}

	NEXT_INST_V(2, cleanup, 0);

    errorInUnset:
	TRESULT = TCL_ERROR;
	TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	goto checkForCatch;
    }

    /*
     *	   End of INST_UNSET instructions.
     * -----------------------------------------------------------------
     *	   Start of variable linking instructions.
     */

    {
	Var *otherPtr;

    case INST_UPVAR: {
	CallFrame *framePtr, *savedFramePtr;




	TRACE_WITH_OBJ(("upvar "), OBJ_UNDER_TOS);

	TRESULT = TclObjGetFrame(interp, OBJ_UNDER_TOS, &framePtr);
	if (TRESULT == -1) {
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}

	/*
	 * Locate the other variable.
	 */

	savedFramePtr = iPtr->varFramePtr;
	iPtr->varFramePtr = framePtr;
	otherPtr = TclObjLookupVarEx(interp, OBJ_AT_TOS, NULL, TCL_LEAVE_ERR_MSG,

		"access", /*createPart1*/ 1, /*createPart2*/ 1, &varPtr);
	iPtr->varFramePtr = savedFramePtr;
	if (otherPtr) {
	    goto doLinkVars;
	}
	TRESULT = TCL_ERROR;
	goto checkForCatch;
    }

    case INST_NSUPVAR: {
	Tcl_Namespace *nsPtr;
	Namespace *savedNsPtr;

	TRACE_WITH_OBJ(("nsupvar "), OBJ_UNDER_TOS);
	TRESULT = TclGetNamespaceFromObj(interp, OBJ_UNDER_TOS, &nsPtr);
	if (TRESULT != TCL_OK) {
	    goto checkForCatch;
	}

	/*
	 * Locate the other variable.
	 */

	savedNsPtr = iPtr->varFramePtr->nsPtr;
	iPtr->varFramePtr->nsPtr = (Namespace *) nsPtr;
	otherPtr = TclObjLookupVarEx(interp, OBJ_AT_TOS, NULL,
		(TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG), "access",
		/*createPart1*/ 1, /*createPart2*/ 1, &varPtr);
	iPtr->varFramePtr->nsPtr = savedNsPtr;
	if (otherPtr) {
	    goto doLinkVars;
	}

	TRESULT = TCL_ERROR;
	goto checkForCatch;
    }

    case INST_VARIABLE:
	TRACE(("variable "));
	otherPtr = TclObjLookupVarEx(interp, OBJ_AT_TOS, NULL,
		(TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG), "access",
		/*createPart1*/ 1, /*createPart2*/ 1, &varPtr);
	if (!otherPtr) {
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}

	/*
	 * Do the [variable] magic.
	 */

	TclSetVarNamespaceVar(otherPtr);

    doLinkVars:

	/*
	 * If we are here, the local variable has already been created: do the
	 * little work of TclPtrMakeUpvar that remains to be done right here
	 * if there are no errors; otherwise, let it handle the case.
	 */

	opnd = TclGetInt4AtPtr(pc+1);;
	varPtr = LOCAL(opnd);
	if ((varPtr != otherPtr) && !TclIsVarTraced(varPtr)
		&& (TclIsVarUndefined(varPtr) || TclIsVarLink(varPtr))) {
	    TRESULT = TCL_OK;
	    if (!TclIsVarUndefined(varPtr)) {
		/*
		 * Then it is a defined link.
		 */

		Var *linkPtr = varPtr->value.linkPtr;








|
















|






>


|
<
<
|


>










|
>









|




>
>
>
>
>
>







>
|
<
|
|
<
|
<
<
<
<
<
|


>




















|
<
|


>



|

|










<
<

>
>

>


|
<
<
|








|
>
|

|
|

<
|
|
<
|
<
<
<

|
<
|












|
|

|
<
<
<







<
|




















<







3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869


3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914

3915
3916

3917





3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942

3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962


3963
3964
3965
3966
3967
3968
3969
3970


3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986

3987
3988

3989



3990
3991

3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008



4009
4010
4011
4012
4013
4014
4015

4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036

4037
4038
4039
4040
4041
4042
4043
    /*
     *	   End of INST_EXIST instructions.
     * -----------------------------------------------------------------
     *	   Start of INST_UNSET instructions.
     */

    {
	int flags;

    case INST_UNSET_SCALAR:
	flags = TclGetUInt1AtPtr(pc+1) ? TCL_LEAVE_ERR_MSG : 0;
	opnd = TclGetUInt4AtPtr(pc+2);
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	TRACE(("%s %u\n", (flags?"normal":"noerr"), opnd));
	if (TclIsVarDirectUnsettable(varPtr) && !TclIsVarInHash(varPtr)) {
	    /*
	     * No errors, no traces, no searches: just make the variable cease
	     * to exist.
	     */

	    if (!TclIsVarUndefined(varPtr)) {
		TclDecrRefCount(varPtr->value.objPtr);
	    } else if (flags & TCL_LEAVE_ERR_MSG) {
		goto slowUnsetScalar;
	    }
	    varPtr->value.objPtr = NULL;
	    NEXT_INST_F(6, 0, 0);
	}

    slowUnsetScalar:
	DECACHE_STACK_INFO();
	if (TclPtrUnsetVar(interp, varPtr, NULL, NULL, NULL, flags,


		opnd) != TCL_OK && flags) {
	    goto errorInUnset;
	}
	CACHE_STACK_INFO();
	NEXT_INST_F(6, 0, 0);

    case INST_UNSET_ARRAY:
	flags = TclGetUInt1AtPtr(pc+1) ? TCL_LEAVE_ERR_MSG : 0;
	opnd = TclGetUInt4AtPtr(pc+2);
	part2Ptr = OBJ_AT_TOS;
	arrayPtr = LOCAL(opnd);
	while (TclIsVarLink(arrayPtr)) {
	    arrayPtr = arrayPtr->value.linkPtr;
	}
	TRACE(("%s %u \"%.30s\"\n",
		(flags ? "normal" : "noerr"), opnd, O2S(part2Ptr)));
	if (TclIsVarArray(arrayPtr) && !UnsetTraced(arrayPtr)) {
	    varPtr = VarHashFindVar(arrayPtr->value.tablePtr, part2Ptr);
	    if (varPtr && TclIsVarDirectUnsettable(varPtr)) {
		/*
		 * No nasty traces and element exists, so we can proceed to
		 * unset it. Might still not exist though...
		 */

		if (!TclIsVarUndefined(varPtr)) {
		    TclDecrRefCount(varPtr->value.objPtr);
		} else if (flags & TCL_LEAVE_ERR_MSG) {
		    goto slowUnsetArray;
		}
		varPtr->value.objPtr = NULL;
		NEXT_INST_F(6, 1, 0);
	    } else if (!varPtr && !(flags & TCL_LEAVE_ERR_MSG)) {
		/*
		 * Don't need to do anything here.
		 */

		NEXT_INST_F(6, 1, 0);
	    }
	}
    slowUnsetArray:
	DECACHE_STACK_INFO();
	varPtr = TclLookupArrayElement(interp, NULL, part2Ptr, flags, "unset",
		0, 0, arrayPtr, opnd);
	if (!varPtr) {
	    if (flags & TCL_LEAVE_ERR_MSG) {

		goto errorInUnset;
	    }

	} else if (TclPtrUnsetVar(interp, varPtr, arrayPtr, NULL, part2Ptr,





		flags, opnd) != TCL_OK && (flags & TCL_LEAVE_ERR_MSG)) {
	    goto errorInUnset;
	}
	CACHE_STACK_INFO();
	NEXT_INST_F(6, 1, 0);

    case INST_UNSET_ARRAY_STK:
	flags = TclGetUInt1AtPtr(pc+1) ? TCL_LEAVE_ERR_MSG : 0;
	cleanup = 2;
	part2Ptr = OBJ_AT_TOS;		/* element name */
	part1Ptr = OBJ_UNDER_TOS;	/* array name */
	TRACE(("%s \"%.30s(%.30s)\"\n", (flags?"normal":"noerr"),
		O2S(part1Ptr), O2S(part2Ptr)));
	goto doUnsetStk;

    case INST_UNSET_STK:
	flags = TclGetUInt1AtPtr(pc+1) ? TCL_LEAVE_ERR_MSG : 0;
	cleanup = 1;
	part2Ptr = NULL;
	part1Ptr = OBJ_AT_TOS;		/* variable name */
	TRACE(("%s \"%.30s\"\n", (flags?"normal":"noerr"), O2S(part1Ptr)));

    doUnsetStk:
	DECACHE_STACK_INFO();
	if (TclObjUnsetVar2(interp, part1Ptr, part2Ptr, flags) != TCL_OK

		&& (flags & TCL_LEAVE_ERR_MSG)) {
	    goto errorInUnset;
	}
	CACHE_STACK_INFO();
	NEXT_INST_V(2, cleanup, 0);

    errorInUnset:
	CACHE_STACK_INFO();
	TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp))));
	goto gotError;
    }

    /*
     *	   End of INST_UNSET instructions.
     * -----------------------------------------------------------------
     *	   Start of variable linking instructions.
     */

    {
	Var *otherPtr;


	CallFrame *framePtr, *savedFramePtr;
	Tcl_Namespace *nsPtr;
	Namespace *savedNsPtr;

    case INST_UPVAR:
	TRACE_WITH_OBJ(("upvar "), OBJ_UNDER_TOS);

	if (TclObjGetFrame(interp, OBJ_UNDER_TOS, &framePtr) == -1) {


	    goto gotError;
	}

	/*
	 * Locate the other variable.
	 */

	savedFramePtr = iPtr->varFramePtr;
	iPtr->varFramePtr = framePtr;
	otherPtr = TclObjLookupVarEx(interp, OBJ_AT_TOS, NULL,
		TCL_LEAVE_ERR_MSG, "access", /*createPart1*/ 1,
		/*createPart2*/ 1, &varPtr);
	iPtr->varFramePtr = savedFramePtr;
	if (!otherPtr) {
	    goto gotError;
	}

	goto doLinkVars;


    case INST_NSUPVAR:



	TRACE_WITH_OBJ(("nsupvar "), OBJ_UNDER_TOS);
	if (TclGetNamespaceFromObj(interp, OBJ_UNDER_TOS, &nsPtr) != TCL_OK) {

	    goto gotError;
	}

	/*
	 * Locate the other variable.
	 */

	savedNsPtr = iPtr->varFramePtr->nsPtr;
	iPtr->varFramePtr->nsPtr = (Namespace *) nsPtr;
	otherPtr = TclObjLookupVarEx(interp, OBJ_AT_TOS, NULL,
		(TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG), "access",
		/*createPart1*/ 1, /*createPart2*/ 1, &varPtr);
	iPtr->varFramePtr->nsPtr = savedNsPtr;
	if (!otherPtr) {
	    goto gotError;
	}
	goto doLinkVars;




    case INST_VARIABLE:
	TRACE(("variable "));
	otherPtr = TclObjLookupVarEx(interp, OBJ_AT_TOS, NULL,
		(TCL_NAMESPACE_ONLY | TCL_LEAVE_ERR_MSG), "access",
		/*createPart1*/ 1, /*createPart2*/ 1, &varPtr);
	if (!otherPtr) {

	    goto gotError;
	}

	/*
	 * Do the [variable] magic.
	 */

	TclSetVarNamespaceVar(otherPtr);

    doLinkVars:

	/*
	 * If we are here, the local variable has already been created: do the
	 * little work of TclPtrMakeUpvar that remains to be done right here
	 * if there are no errors; otherwise, let it handle the case.
	 */

	opnd = TclGetInt4AtPtr(pc+1);;
	varPtr = LOCAL(opnd);
	if ((varPtr != otherPtr) && !TclIsVarTraced(varPtr)
		&& (TclIsVarUndefined(varPtr) || TclIsVarLink(varPtr))) {

	    if (!TclIsVarUndefined(varPtr)) {
		/*
		 * Then it is a defined link.
		 */

		Var *linkPtr = varPtr->value.linkPtr;

4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
		}
	    }
	    TclSetVarLink(varPtr);
	    varPtr->value.linkPtr = otherPtr;
	    if (TclIsVarInHash(otherPtr)) {
		VarHashRefCount(otherPtr)++;
	    }
	} else {
	    TRESULT = TclPtrObjMakeUpvar(interp, otherPtr, NULL, 0, opnd);
	    if (TRESULT != TCL_OK) {
		goto checkForCatch;
	    }
	}

	/*
	 * Do not pop the namespace or frame index, it may be needed for other
	 * variables - and [variable] did not push it at all.
	 */








<
|
|
|
<







4052
4053
4054
4055
4056
4057
4058

4059
4060
4061

4062
4063
4064
4065
4066
4067
4068
		}
	    }
	    TclSetVarLink(varPtr);
	    varPtr->value.linkPtr = otherPtr;
	    if (TclIsVarInHash(otherPtr)) {
		VarHashRefCount(otherPtr)++;
	    }

	} else if (TclPtrObjMakeUpvar(interp, otherPtr, NULL, 0,
		opnd) != TCL_OK) {
	    goto gotError;

	}

	/*
	 * Do not pop the namespace or frame index, it may be needed for other
	 * variables - and [variable] did not push it at all.
	 */

4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
	jmpOffset[1] = TclGetInt1AtPtr(pc+1);

    doCondJump:
	valuePtr = OBJ_AT_TOS;

	/* TODO - check claim that taking address of b harms performance */
	/* TODO - consider optimization search for constants */
	TRESULT = TclGetBooleanFromObj(interp, valuePtr, &b);
	if (TRESULT != TCL_OK) {
	    TRACE_WITH_OBJ(("%d => ERROR: ", jmpOffset[
		    ((*pc == INST_JUMP_FALSE1) || (*pc == INST_JUMP_FALSE4))
		    ? 0 : 1]), Tcl_GetObjResult(interp));
	    goto checkForCatch;
	}

#ifdef TCL_COMPILE_DEBUG
	if (b) {
	    if ((*pc == INST_JUMP_TRUE1) || (*pc == INST_JUMP_TRUE4)) {
		TRACE(("%d => %.20s true, new pc %u\n", jmpOffset[1],
			O2S(valuePtr),







|
<



|







4111
4112
4113
4114
4115
4116
4117
4118

4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
	jmpOffset[1] = TclGetInt1AtPtr(pc+1);

    doCondJump:
	valuePtr = OBJ_AT_TOS;

	/* TODO - check claim that taking address of b harms performance */
	/* TODO - consider optimization search for constants */
	if (TclGetBooleanFromObj(interp, valuePtr, &b) != TCL_OK) {

	    TRACE_WITH_OBJ(("%d => ERROR: ", jmpOffset[
		    ((*pc == INST_JUMP_FALSE1) || (*pc == INST_JUMP_FALSE4))
		    ? 0 : 1]), Tcl_GetObjResult(interp));
	    goto gotError;
	}

#ifdef TCL_COMPILE_DEBUG
	if (b) {
	    if ((*pc == INST_JUMP_TRUE1) || (*pc == INST_JUMP_TRUE4)) {
		TRACE(("%d => %.20s true, new pc %u\n", jmpOffset[1],
			O2S(valuePtr),
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264





4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319





4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368

4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400



4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448



4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
	 * performed.
	 */

	int i1, i2, iResult;

	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;
	TRESULT = TclGetBooleanFromObj(NULL, valuePtr, &i1);
	if (TRESULT != TCL_OK) {
	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto checkForCatch;
	}

	TRESULT = TclGetBooleanFromObj(NULL, value2Ptr, &i2);
	if (TRESULT != TCL_OK) {
	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(value2Ptr),
		    (value2Ptr->typePtr? value2Ptr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, value2Ptr);
	    goto checkForCatch;
	}

	if (*pc == INST_LOR) {
	    iResult = (i1 || i2);
	} else {
	    iResult = (i1 && i2);
	}
	objResultPtr = TCONST(iResult);
	TRACE(("%.20s %.20s => %d\n", O2S(valuePtr),O2S(value2Ptr),iResult));
	NEXT_INST_F(1, 2, 1);
    }

    /*
     * -----------------------------------------------------------------
     *	   Start of INST_LIST and related instructions.
     */






    case INST_LIST:
	/*
	 * Pop the opnd (objc) top stack elements into a new list obj and then
	 * decrement their ref counts.
	 */

	opnd = TclGetUInt4AtPtr(pc+1);
	objResultPtr = Tcl_NewListObj(opnd, &OBJ_AT_DEPTH(opnd-1));
	TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
	NEXT_INST_V(5, opnd, 1);

    case INST_LIST_LENGTH:
	valuePtr = OBJ_AT_TOS;

	TRESULT = TclListObjLength(interp, valuePtr, &length);
	if (TRESULT != TCL_OK) {
	    TRACE_WITH_OBJ(("%.30s => ERROR: ", O2S(valuePtr)),
		    Tcl_GetObjResult(interp));
	    goto checkForCatch;
	}
	TclNewIntObj(objResultPtr, length);
	TRACE(("%.20s => %d\n", O2S(valuePtr), length));
	NEXT_INST_F(1, 1, 1);

    case INST_LIST_INDEX: {
	/*** lindex with objc == 3 ***/

	/* Variables also for INST_LIST_INDEX_IMM */

	int listc, idx, pcAdjustment;
	Tcl_Obj **listv;

	/*
	 * Pop the two operands.
	 */

	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	/*
	 * Extract the desired list element.
	 */

	TRESULT = TclListObjGetElements(interp, valuePtr, &listc, &listv);
	if ((TRESULT == TCL_OK) && (value2Ptr->typePtr != &tclListType)
		&& (TclGetIntForIndexM(NULL , value2Ptr, listc-1,
			&idx) == TCL_OK)) {
	    TclDecrRefCount(value2Ptr);
	    tosPtr--;
	    pcAdjustment = 1;
	    goto lindexFastPath;
	}

	objResultPtr = TclLindexList(interp, valuePtr, value2Ptr);
	if (objResultPtr) {





	    /*
	     * Stash the list element on the stack.
	     */

	    TRACE(("%.20s %.20s => %s\n",
		    O2S(valuePtr), O2S(value2Ptr), O2S(objResultPtr)));
	    NEXT_INST_F(1, 2, -1);	/* Already has the correct refCount */
	} else {
	    TRACE_WITH_OBJ(("%.30s %.30s => ERROR: ", O2S(valuePtr),
		    O2S(value2Ptr)), Tcl_GetObjResult(interp));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}

    case INST_LIST_INDEX_IMM:
	/*** lindex with objc==3 and index in bytecode stream ***/

	pcAdjustment = 5;

	/*
	 * Pop the list and get the index.
	 */

	valuePtr = OBJ_AT_TOS;
	opnd = TclGetInt4AtPtr(pc+1);

	/*
	 * Get the contents of the list, making sure that it really is a list
	 * in the process.
	 */

	TRESULT = TclListObjGetElements(interp, valuePtr, &listc, &listv);

	if (TRESULT != TCL_OK) {
	    TRACE_WITH_OBJ(("\"%.30s\" %d => ERROR: ", O2S(valuePtr), opnd),
		    Tcl_GetObjResult(interp));
	    goto checkForCatch;
	}

	/*
	 * Select the list item based on the index. Negative operand means
	 * end-based indexing.
	 */

	if (opnd < -1) {
	    idx = opnd+1 + listc;
	} else {
	    idx = opnd;
	}


    lindexFastPath:
	if (idx >= 0 && idx < listc) {
	    objResultPtr = listv[idx];
	} else {
	    TclNewObj(objResultPtr);
	}

	TRACE_WITH_OBJ(("\"%.30s\" %d => ", O2S(valuePtr), opnd),
		objResultPtr);
	NEXT_INST_F(pcAdjustment, 1, 1);
    }

    {
	int numIdx;

    case INST_LIST_INDEX_MULTI:
	/*
	 * 'lindex' with multiple index args:
	 *
	 * Determine the count of index args.
	 */

	opnd = TclGetUInt4AtPtr(pc+1);
	numIdx = opnd-1;

	/*
	 * Do the 'lindex' operation.
	 */

	objResultPtr = TclLindexFlat(interp, OBJ_AT_DEPTH(numIdx),
		numIdx, &OBJ_AT_DEPTH(numIdx - 1));




	/*
	 * Check for errors.
	 */

	if (objResultPtr) {
	    /*
	     * Set result.
	     */

	    TRACE(("%d => %s\n", opnd, O2S(objResultPtr)));
	    NEXT_INST_V(5, opnd, -1);
	} else {
	    TRACE_WITH_OBJ(("%d => ERROR: ", opnd), Tcl_GetObjResult(interp));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}

    case INST_LSET_FLAT:
	/*
	 * Lset with 3, 5, or more args. Get the number of index args.
	 */

	opnd = TclGetUInt4AtPtr(pc + 1);
	numIdx = opnd - 2;

	/*
	 * Get the old value of variable, and remove the stack ref. This is
	 * safe because the variable still references the object; the ref
	 * count will never go zero here - we can use the smaller macro
	 * Tcl_DecrRefCount.
	 */

	value2Ptr = POP_OBJECT();
	Tcl_DecrRefCount(value2Ptr); /* This one should be done here */

	/*
	 * Get the new element value.
	 */

	valuePtr = OBJ_AT_TOS;

	/*
	 * Compute the new variable value.
	 */

	objResultPtr = TclLsetFlat(interp, value2Ptr, numIdx,
		&OBJ_AT_DEPTH(numIdx), valuePtr);




	/*
	 * Check for errors.
	 */

	if (objResultPtr) {
	    /*
	     * Set result.
	     */

	    TRACE(("%d => %s\n", opnd, O2S(objResultPtr)));
	    NEXT_INST_V(5, (numIdx+1), -1);
	} else {
	    TRACE_WITH_OBJ(("%d => ERROR: ", opnd), Tcl_GetObjResult(interp));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}
    }

    case INST_LSET_LIST:
	/*
	 * 'lset' with 4 args.
	 *
	 * Get the old value of variable, and remove the stack ref. This is
	 * safe because the variable still references the object; the ref
	 * count will never go zero here - we can use the smaller macro
	 * Tcl_DecrRefCount.
	 */

	objPtr = POP_OBJECT();







|
<



|


|
<



|

















>
>
>
>
>













<
|
<


|





|
<
<
<
<
<
<
<
<
<
<
<







|
|
|
|







|
>
>
>
>
>
|
|
|

|
|
|
<
<
<
<
<
|
<
|
<
|
<













|
<
<


|








|

|

>


|
|







|
<
<
<
<
|

<
<




|





|
|
>
>
>
|
<
<
<

<
|
|
|

|
|
<
<
<
<
|
<






|








|
|
<
<
<
<
<
<





|
|
>
>
>
|
<
<
<

<
|
|
|

|
|
<
<
<
<
|
<
<
|

<
<







4181
4182
4183
4184
4185
4186
4187
4188

4189
4190
4191
4192
4193
4194
4195

4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234

4235

4236
4237
4238
4239
4240
4241
4242
4243
4244











4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275





4276

4277

4278

4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292


4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320




4321
4322


4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338



4339

4340
4341
4342
4343
4344
4345




4346

4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363






4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374



4375

4376
4377
4378
4379
4380
4381




4382


4383
4384


4385
4386
4387
4388
4389
4390
4391
	 * performed.
	 */

	int i1, i2, iResult;

	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;
	if (TclGetBooleanFromObj(NULL, valuePtr, &i1) != TCL_OK) {

	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto gotError;
	}

	if (TclGetBooleanFromObj(NULL, value2Ptr, &i2) != TCL_OK) {

	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(value2Ptr),
		    (value2Ptr->typePtr? value2Ptr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, value2Ptr);
	    goto gotError;
	}

	if (*pc == INST_LOR) {
	    iResult = (i1 || i2);
	} else {
	    iResult = (i1 && i2);
	}
	objResultPtr = TCONST(iResult);
	TRACE(("%.20s %.20s => %d\n", O2S(valuePtr),O2S(value2Ptr),iResult));
	NEXT_INST_F(1, 2, 1);
    }

    /*
     * -----------------------------------------------------------------
     *	   Start of INST_LIST and related instructions.
     */

    {
	int index, numIndices, fromIdx, toIdx;
	int nocase, match, length2, cflags, s1len, s2len;
	const char *s1, *s2;

    case INST_LIST:
	/*
	 * Pop the opnd (objc) top stack elements into a new list obj and then
	 * decrement their ref counts.
	 */

	opnd = TclGetUInt4AtPtr(pc+1);
	objResultPtr = Tcl_NewListObj(opnd, &OBJ_AT_DEPTH(opnd-1));
	TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
	NEXT_INST_V(5, opnd, 1);

    case INST_LIST_LENGTH:
	valuePtr = OBJ_AT_TOS;

	if (TclListObjLength(interp, valuePtr, &length) != TCL_OK) {

	    TRACE_WITH_OBJ(("%.30s => ERROR: ", O2S(valuePtr)),
		    Tcl_GetObjResult(interp));
	    goto gotError;
	}
	TclNewIntObj(objResultPtr, length);
	TRACE(("%.20s => %d\n", O2S(valuePtr), length));
	NEXT_INST_F(1, 1, 1);

    case INST_LIST_INDEX:	/* lindex with objc == 3 */











	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	/*
	 * Extract the desired list element.
	 */

	if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
		&& (value2Ptr->typePtr != &tclListType)
		&& (TclGetIntForIndexM(NULL , value2Ptr, objc-1,
			&index) == TCL_OK)) {
	    TclDecrRefCount(value2Ptr);
	    tosPtr--;
	    pcAdjustment = 1;
	    goto lindexFastPath;
	}

	objResultPtr = TclLindexList(interp, valuePtr, value2Ptr);
	if (!objResultPtr) {
	    TRACE_WITH_OBJ(("%.30s %.30s => ERROR: ", O2S(valuePtr),
		    O2S(value2Ptr)), Tcl_GetObjResult(interp));
	    goto gotError;
	}

	/*
	 * Stash the list element on the stack.
	 */

	TRACE(("%.20s %.20s => %s\n",
		O2S(valuePtr), O2S(value2Ptr), O2S(objResultPtr)));
	NEXT_INST_F(1, 2, -1);	/* Already has the correct refCount */







    case INST_LIST_INDEX_IMM:	/* lindex with objc==3 and index in bytecode

				 * stream */


	/*
	 * Pop the list and get the index.
	 */

	valuePtr = OBJ_AT_TOS;
	opnd = TclGetInt4AtPtr(pc+1);

	/*
	 * Get the contents of the list, making sure that it really is a list
	 * in the process.
	 */

	if (TclListObjGetElements(interp, valuePtr, &objc, &objv) != TCL_OK) {


	    TRACE_WITH_OBJ(("\"%.30s\" %d => ERROR: ", O2S(valuePtr), opnd),
		    Tcl_GetObjResult(interp));
	    goto gotError;
	}

	/*
	 * Select the list item based on the index. Negative operand means
	 * end-based indexing.
	 */

	if (opnd < -1) {
	    index = opnd+1 + objc;
	} else {
	    index = opnd;
	}
	pcAdjustment = 5;

    lindexFastPath:
	if (index >= 0 && index < objc) {
	    objResultPtr = objv[index];
	} else {
	    TclNewObj(objResultPtr);
	}

	TRACE_WITH_OBJ(("\"%.30s\" %d => ", O2S(valuePtr), opnd),
		objResultPtr);
	NEXT_INST_F(pcAdjustment, 1, 1);





    case INST_LIST_INDEX_MULTI:	/* 'lindex' with multiple index args */
	/*


	 * Determine the count of index args.
	 */

	opnd = TclGetUInt4AtPtr(pc+1);
	numIndices = opnd-1;

	/*
	 * Do the 'lindex' operation.
	 */

	objResultPtr = TclLindexFlat(interp, OBJ_AT_DEPTH(numIndices),
		numIndices, &OBJ_AT_DEPTH(numIndices - 1));
	if (!objResultPtr) {
	    TRACE_WITH_OBJ(("%d => ERROR: ", opnd), Tcl_GetObjResult(interp));
	    goto gotError;
	}





	/*
	 * Set result.
	 */

	TRACE(("%d => %s\n", opnd, O2S(objResultPtr)));
	NEXT_INST_V(5, opnd, -1);






    case INST_LSET_FLAT:
	/*
	 * Lset with 3, 5, or more args. Get the number of index args.
	 */

	opnd = TclGetUInt4AtPtr(pc + 1);
	numIndices = opnd - 2;

	/*
	 * Get the old value of variable, and remove the stack ref. This is
	 * safe because the variable still references the object; the ref
	 * count will never go zero here - we can use the smaller macro
	 * Tcl_DecrRefCount.
	 */

	valuePtr = POP_OBJECT();
	Tcl_DecrRefCount(valuePtr); /* This one should be done here */







	/*
	 * Compute the new variable value.
	 */

	objResultPtr = TclLsetFlat(interp, valuePtr, numIndices,
		&OBJ_AT_DEPTH(numIndices), OBJ_AT_TOS);
	if (!objResultPtr) {
	    TRACE_WITH_OBJ(("%d => ERROR: ", opnd), Tcl_GetObjResult(interp));
	    goto gotError;
	}





	/*
	 * Set result.
	 */

	TRACE(("%d => %s\n", opnd, O2S(objResultPtr)));
	NEXT_INST_V(5, numIndices+1, -1);







    case INST_LSET_LIST:	/* 'lset' with 4 args */
	/*


	 * Get the old value of variable, and remove the stack ref. This is
	 * safe because the variable still references the object; the ref
	 * count will never go zero here - we can use the smaller macro
	 * Tcl_DecrRefCount.
	 */

	objPtr = POP_OBJECT();
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531




4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613



4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627

4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840

4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872

4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
	value2Ptr = OBJ_UNDER_TOS;

	/*
	 * Compute the new variable value.
	 */

	objResultPtr = TclLsetList(interp, objPtr, value2Ptr, valuePtr);

	/*
	 * Check for errors.
	 */

	if (!objResultPtr) {
	    TRACE_WITH_OBJ(("\"%.30s\" => ERROR: ", O2S(value2Ptr)),
		    Tcl_GetObjResult(interp));
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}

	/*
	 * Set result.
	 */

	TRACE(("=> %s\n", O2S(objResultPtr)));
	NEXT_INST_F(1, 2, -1);

    case INST_LIST_RANGE_IMM: {
	/*** lrange with objc==4 and both indices in bytecode stream ***/

	int listc, fromIdx, toIdx;
	Tcl_Obj **listv;

	/*
	 * Pop the list and get the indices.
	 */

	valuePtr = OBJ_AT_TOS;
	fromIdx = TclGetInt4AtPtr(pc+1);
	toIdx = TclGetInt4AtPtr(pc+5);

	/*
	 * Get the contents of the list, making sure that it really is a list
	 * in the process.
	 */

	TRESULT = TclListObjGetElements(interp, valuePtr, &listc, &listv);





	/*
	 * Skip a lot of work if we're about to throw the result away (common
	 * with uses of [lassign]).
	 */

	if (TRESULT == TCL_OK) {
#ifndef TCL_COMPILE_DEBUG
	    if (*(pc+9) == INST_POP) {
		NEXT_INST_F(10, 1, 0);
	    }
#endif
	} else {
	    TRACE_WITH_OBJ(("\"%.30s\" %d %d => ERROR: ", O2S(valuePtr),
		    fromIdx, toIdx), Tcl_GetObjResult(interp));
	    goto checkForCatch;
	}

	/*
	 * Adjust the indices for end-based handling.
	 */

	if (fromIdx < -1) {
	    fromIdx += 1+listc;
	    if (fromIdx < -1) {
		fromIdx = -1;
	    }
	} else if (fromIdx > listc) {
	    fromIdx = listc;
	}
	if (toIdx < -1) {
	    toIdx += 1+listc;
	    if (toIdx < -1) {
		toIdx = -1;
	    }
	} else if (toIdx > listc) {
	    toIdx = listc;
	}

	/*
	 * Check if we are referring to a valid, non-empty list range, and if
	 * so, build the list of elements in that range.
	 */

	if (fromIdx<=toIdx && fromIdx<listc && toIdx>=0) {
	    if (fromIdx<0) {
		fromIdx = 0;
	    }
	    if (toIdx >= listc) {
		toIdx = listc-1;
	    }
	    objResultPtr = Tcl_NewListObj(toIdx-fromIdx+1, listv+fromIdx);
	} else {
	    TclNewObj(objResultPtr);
	}

	TRACE_WITH_OBJ(("\"%.30s\" %d %d => ", O2S(valuePtr),
		TclGetInt4AtPtr(pc+1), TclGetInt4AtPtr(pc+5)), objResultPtr);
	NEXT_INST_F(9, 1, 1);
    }

    case INST_LIST_IN:
    case INST_LIST_NOT_IN: {
	/*
	 * Basic list containment operators.
	 */

	int found, s1len, s2len, llen, i;
	const char *s1, *s2;

	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	/* TODO: Consider more efficient tests than strcmp() */
	s1 = TclGetStringFromObj(valuePtr, &s1len);
	TRESULT = TclListObjLength(interp, value2Ptr, &llen);
	if (TRESULT != TCL_OK) {
	    TRACE_WITH_OBJ(("\"%.30s\" \"%.30s\" => ERROR: ", O2S(valuePtr),
		    O2S(value2Ptr)), Tcl_GetObjResult(interp));
	    goto checkForCatch;
	}
	found = 0;



	if (llen > 0) {
	    /*
	     * An empty list doesn't match anything.
	     */

	    i = 0;
	    do {
		Tcl_Obj *o;

		Tcl_ListObjIndex(NULL, value2Ptr, i, &o);
		if (o != NULL) {
		    s2 = TclGetStringFromObj(o, &s2len);
		} else {
		    s2 = ""; s2len = 0;

		}
		if (s1len == s2len) {
		    found = (strcmp(s1, s2) == 0);
		}
		i++;
	    } while (i < llen && found == 0);
	}

	if (*pc == INST_LIST_NOT_IN) {
	    found = !found;
	}

	TRACE(("%.20s %.20s => %d\n", O2S(valuePtr), O2S(value2Ptr), found));

	/*
	 * Peep-hole optimisation: if you're about to jump, do jump from here.
	 * We're saving the effort of pushing a boolean value only to pop it
	 * for branching.
	 */

	pc++;
#ifndef TCL_COMPILE_DEBUG
	switch (*pc) {
	case INST_JUMP_FALSE1:
	    NEXT_INST_F((found ? 2 : TclGetInt1AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE1:
	    NEXT_INST_F((found ? TclGetInt1AtPtr(pc+1) : 2), 2, 0);
	case INST_JUMP_FALSE4:
	    NEXT_INST_F((found ? 5 : TclGetInt4AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE4:
	    NEXT_INST_F((found ? TclGetInt4AtPtr(pc+1) : 5), 2, 0);
	}
#endif
	objResultPtr = TCONST(found);
	NEXT_INST_F(0, 2, 1);
    }

    /*
     *	   End of INST_LIST and related instructions.
     * -----------------------------------------------------------------
     *	   Start of string-related instructions.
     */

    case INST_STR_EQ:
    case INST_STR_NEQ: {
	/*
	 * String (in)equality check
	 * TODO: Consider merging into INST_STR_CMP
	 */

	int iResult;

	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	if (valuePtr == value2Ptr) {
	    /*
	     * On the off-chance that the objects are the same, we don't
	     * really have to think hard about equality.
	     */

	    iResult = (*pc == INST_STR_EQ);
	} else {
	    const char *s1, *s2;
	    int s1len, s2len;

	    s1 = TclGetStringFromObj(valuePtr, &s1len);
	    s2 = TclGetStringFromObj(value2Ptr, &s2len);
	    if (s1len == s2len) {
		/*
		 * We only need to check (in)equality when we have equal
		 * length strings.
		 */

		if (*pc == INST_STR_NEQ) {
		    iResult = (strcmp(s1, s2) != 0);
		} else {
		    /* INST_STR_EQ */
		    iResult = (strcmp(s1, s2) == 0);
		}
	    } else {
		iResult = (*pc == INST_STR_NEQ);
	    }
	}

	TRACE(("%.20s %.20s => %d\n", O2S(valuePtr),O2S(value2Ptr),iResult));

	/*
	 * Peep-hole optimisation: if you're about to jump, do jump from here.
	 */

	pc++;
#ifndef TCL_COMPILE_DEBUG
	switch (*pc) {
	case INST_JUMP_FALSE1:
	    NEXT_INST_F((iResult? 2 : TclGetInt1AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE1:
	    NEXT_INST_F((iResult? TclGetInt1AtPtr(pc+1) : 2), 2, 0);
	case INST_JUMP_FALSE4:
	    NEXT_INST_F((iResult? 5 : TclGetInt4AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE4:
	    NEXT_INST_F((iResult? TclGetInt4AtPtr(pc+1) : 5), 2, 0);
	}
#endif
	objResultPtr = TCONST(iResult);
	NEXT_INST_F(0, 2, 1);
    }

    case INST_STR_CMP: {
	/*
	 * String compare.
	 */

	const char *s1, *s2;
	int s1len, s2len, iResult;

    stringCompare:
	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	/*
	 * The comparison function should compare up to the minimum byte
	 * length only.
	 */

	if (valuePtr == value2Ptr) {
	    /*
	     * In the pure equality case, set lengths too for the checks below
	     * (or we could goto beyond it).
	     */

	    iResult = s1len = s2len = 0;
	} else if (TclIsPureByteArray(valuePtr)
		&& TclIsPureByteArray(value2Ptr)) {
	    s1 = (char *) Tcl_GetByteArrayFromObj(valuePtr, &s1len);
	    s2 = (char *) Tcl_GetByteArrayFromObj(value2Ptr, &s2len);
	    iResult = memcmp(s1, s2,
		    (size_t) ((s1len < s2len) ? s1len : s2len));
	} else if (((valuePtr->typePtr == &tclStringType)
		&& (value2Ptr->typePtr == &tclStringType))) {
	    /*
	     * Do a unicode-specific comparison if both of the args are of
	     * String type. If the char length == byte length, we can do a
	     * memcmp. In benchmark testing this proved the most efficient
	     * check between the unicode and string comparison operations.
	     */

	    s1len = Tcl_GetCharLength(valuePtr);
	    s2len = Tcl_GetCharLength(value2Ptr);
	    if ((s1len == valuePtr->length) && (s2len == value2Ptr->length)) {
		iResult = memcmp(valuePtr->bytes, value2Ptr->bytes,
			(unsigned) ((s1len < s2len) ? s1len : s2len));
	    } else {
		iResult = TclUniCharNcmp(Tcl_GetUnicode(valuePtr),
			Tcl_GetUnicode(value2Ptr),
			(unsigned) ((s1len < s2len) ? s1len : s2len));
	    }
	} else {
	    /*
	     * We can't do a simple memcmp in order to handle the special Tcl
	     * \xC0\x80 null encoding for utf-8.
	     */

	    s1 = TclGetStringFromObj(valuePtr, &s1len);
	    s2 = TclGetStringFromObj(value2Ptr, &s2len);
	    iResult = TclpUtfNcmp2(s1, s2,
		    (size_t) ((s1len < s2len) ? s1len : s2len));
	}

	/*
	 * Make sure only -1,0,1 is returned
	 * TODO: consider peephole opt.
	 */

	if (iResult == 0) {
	    iResult = s1len - s2len;
	}

	if (*pc != INST_STR_CMP) {
	    /*
	     * Take care of the opcodes that goto'ed into here.
	     */

	    switch (*pc) {
	    case INST_EQ:
		iResult = (iResult == 0);
		break;
	    case INST_NEQ:
		iResult = (iResult != 0);
		break;
	    case INST_LT:
		iResult = (iResult < 0);
		break;
	    case INST_GT:
		iResult = (iResult > 0);
		break;
	    case INST_LE:
		iResult = (iResult <= 0);
		break;
	    case INST_GE:
		iResult = (iResult >= 0);
		break;
	    }
	}
	if (iResult < 0) {
	    TclNewIntObj(objResultPtr, -1);
	    TRACE(("%.20s %.20s => %d\n", O2S(valuePtr), O2S(value2Ptr), -1));
	} else {
	    objResultPtr = TCONST(iResult>0);
	    TRACE(("%.20s %.20s => %d\n", O2S(valuePtr), O2S(value2Ptr),
		(iResult > 0)));
	}


	NEXT_INST_F(1, 2, 1);
    }

    case INST_STR_LEN:
	valuePtr = OBJ_AT_TOS;

	length = Tcl_GetCharLength(valuePtr);
	TclNewIntObj(objResultPtr, length);
	TRACE(("%.20s => %d\n", O2S(valuePtr), length));
	NEXT_INST_F(1, 1, 1);

    case INST_STR_INDEX: {
	/*
	 * String compare.
	 */

	int index;

	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	/*
	 * Get char length to calulate what 'end' means.
	 */

	length = Tcl_GetCharLength(valuePtr);
	TRESULT = TclGetIntForIndexM(interp, value2Ptr, length - 1, &index);
	if (TRESULT != TCL_OK) {
	    goto checkForCatch;
	}

	if ((index >= 0) && (index < length)) {

	    if (TclIsPureByteArray(valuePtr)) {
		objResultPtr = Tcl_NewByteArrayObj(
			Tcl_GetByteArrayFromObj(valuePtr, &length)+index, 1);
	    } else if (valuePtr->bytes && length == valuePtr->length) {
		objResultPtr = Tcl_NewStringObj((const char *)
			(&valuePtr->bytes[index]), 1);
	    } else {
		char buf[TCL_UTF_MAX];
		Tcl_UniChar ch;

		ch = Tcl_GetUniChar(valuePtr, index);

		/*
		 * This could be: Tcl_NewUnicodeObj((const Tcl_UniChar *)&ch,
		 * 1) but creating the object as a string seems to be faster
		 * in practical use.
		 */

		length = Tcl_UniCharToUtf(ch, buf);
		objResultPtr = Tcl_NewStringObj(buf, length);
	    }
	} else {
	    TclNewObj(objResultPtr);
	}

	TRACE(("%.20s %.20s => %s\n", O2S(valuePtr), O2S(value2Ptr),
		O2S(objResultPtr)));
	NEXT_INST_F(1, 2, 1);
    }

    case INST_STR_MATCH: {
	int nocase, match, length2;

	nocase = TclGetInt1AtPtr(pc+1);
	valuePtr = OBJ_AT_TOS;		/* String */
	value2Ptr = OBJ_UNDER_TOS;	/* Pattern */

	/*
	 * Check that at least one of the objects is Unicode before promoting
	 * both.
	 */

	if ((valuePtr->typePtr == &tclStringType)
		|| (value2Ptr->typePtr == &tclStringType)) {
	    Tcl_UniChar *ustring1, *ustring2;

	    ustring1 = Tcl_GetUnicodeFromObj(valuePtr, &length);
	    ustring2 = Tcl_GetUnicodeFromObj(value2Ptr, &length2);
	    match = TclUniCharMatch(ustring1, length, ustring2, length2,
		    nocase);
	} else if (TclIsPureByteArray(valuePtr) && !nocase) {
	    unsigned char *string1, *string2;

	    string1 = Tcl_GetByteArrayFromObj(valuePtr, &length);
	    string2 = Tcl_GetByteArrayFromObj(value2Ptr, &length2);
	    match = TclByteArrayMatch(string1, length, string2, length2, 0);
	} else {
	    match = Tcl_StringCaseMatch(TclGetString(valuePtr),
		    TclGetString(value2Ptr), nocase);
	}

	/*
	 * Reuse value2Ptr object already on stack if possible. Adjustment is







<
<
<
<
<



<
|









|
|
<
<
<














|
>
>
>
>






<

|
|
|

<
<
<
<
<






|



|
|


|



|
|







|



|
|

|







|
<

|
<
<
<
<
<
<
<





|
<


|

|
>
>
>
|




<

<
<




|
>


|


|



|


|











|

|

|

|


|

<








|

<



<
<









|

<
<
<









|


|


|



|









|

|

|

|


|

|
|
|
<
<
<
<
<
<
<
<














|




|













|


|











|








|
|









|


|


|


|


|


|



|

<

|
<
<

|
>

<



<





|
<
<
<
<
<
<








|
<
|


|
>
|
|
|
|
|
|
|
|
<
<
|

|
|
|
|
|

|
|
<
<
<





|
<
|
<
<


















|

|
|
|







4399
4400
4401
4402
4403
4404
4405





4406
4407
4408

4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420



4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445

4446
4447
4448
4449
4450





4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493

4494
4495







4496
4497
4498
4499
4500
4501

4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514

4515


4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556

4557
4558
4559
4560
4561
4562
4563
4564
4565
4566

4567
4568
4569


4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580



4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623








4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712

4713
4714


4715
4716
4717
4718

4719
4720
4721

4722
4723
4724
4725
4726
4727






4728
4729
4730
4731
4732
4733
4734
4735
4736

4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749


4750
4751
4752
4753
4754
4755
4756
4757
4758
4759



4760
4761
4762
4763
4764
4765

4766


4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
	value2Ptr = OBJ_UNDER_TOS;

	/*
	 * Compute the new variable value.
	 */

	objResultPtr = TclLsetList(interp, objPtr, value2Ptr, valuePtr);





	if (!objResultPtr) {
	    TRACE_WITH_OBJ(("\"%.30s\" => ERROR: ", O2S(value2Ptr)),
		    Tcl_GetObjResult(interp));

	    goto gotError;
	}

	/*
	 * Set result.
	 */

	TRACE(("=> %s\n", O2S(objResultPtr)));
	NEXT_INST_F(1, 2, -1);

    case INST_LIST_RANGE_IMM:	/* lrange with objc==4 and both indices in
				 * bytecode stream */




	/*
	 * Pop the list and get the indices.
	 */

	valuePtr = OBJ_AT_TOS;
	fromIdx = TclGetInt4AtPtr(pc+1);
	toIdx = TclGetInt4AtPtr(pc+5);

	/*
	 * Get the contents of the list, making sure that it really is a list
	 * in the process.
	 */

	if (TclListObjGetElements(interp, valuePtr, &objc, &objv) != TCL_OK) {
	    TRACE_WITH_OBJ(("\"%.30s\" %d %d => ERROR: ", O2S(valuePtr),
		    fromIdx, toIdx), Tcl_GetObjResult(interp));
	    goto gotError;
	}

	/*
	 * Skip a lot of work if we're about to throw the result away (common
	 * with uses of [lassign]).
	 */


#ifndef TCL_COMPILE_DEBUG
	if (*(pc+9) == INST_POP) {
	    NEXT_INST_F(10, 1, 0);
	}
#endif






	/*
	 * Adjust the indices for end-based handling.
	 */

	if (fromIdx < -1) {
	    fromIdx += 1+objc;
	    if (fromIdx < -1) {
		fromIdx = -1;
	    }
	} else if (fromIdx > objc) {
	    fromIdx = objc;
	}
	if (toIdx < -1) {
	    toIdx += 1 + objc;
	    if (toIdx < -1) {
		toIdx = -1;
	    }
	} else if (toIdx > objc) {
	    toIdx = objc;
	}

	/*
	 * Check if we are referring to a valid, non-empty list range, and if
	 * so, build the list of elements in that range.
	 */

	if (fromIdx<=toIdx && fromIdx<objc && toIdx>=0) {
	    if (fromIdx<0) {
		fromIdx = 0;
	    }
	    if (toIdx >= objc) {
		toIdx = objc-1;
	    }
	    objResultPtr = Tcl_NewListObj(toIdx-fromIdx+1, objv+fromIdx);
	} else {
	    TclNewObj(objResultPtr);
	}

	TRACE_WITH_OBJ(("\"%.30s\" %d %d => ", O2S(valuePtr),
		TclGetInt4AtPtr(pc+1), TclGetInt4AtPtr(pc+5)), objResultPtr);
	NEXT_INST_F(9, 1, 1);


    case INST_LIST_IN:
    case INST_LIST_NOT_IN:	/* Basic list containment operators. */







	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	/* TODO: Consider more efficient tests than strcmp() */
	s1 = TclGetStringFromObj(valuePtr, &s1len);
	if (TclListObjLength(interp, value2Ptr, &length) != TCL_OK) {

	    TRACE_WITH_OBJ(("\"%.30s\" \"%.30s\" => ERROR: ", O2S(valuePtr),
		    O2S(value2Ptr)), Tcl_GetObjResult(interp));
	    goto gotError;
	}
	match = 0;
	if (length > 0) {
	    int i = 0;
	    Tcl_Obj *o;

	    /*
	     * An empty list doesn't match anything.
	     */


	    do {


		Tcl_ListObjIndex(NULL, value2Ptr, i, &o);
		if (o != NULL) {
		    s2 = TclGetStringFromObj(o, &s2len);
		} else {
		    s2 = "";
		    s2len = 0;
		}
		if (s1len == s2len) {
		    match = (strcmp(s1, s2) == 0);
		}
		i++;
	    } while (i < length && match == 0);
	}

	if (*pc == INST_LIST_NOT_IN) {
	    match = !match;
	}

	TRACE(("%.20s %.20s => %d\n", O2S(valuePtr), O2S(value2Ptr), match));

	/*
	 * Peep-hole optimisation: if you're about to jump, do jump from here.
	 * We're saving the effort of pushing a boolean value only to pop it
	 * for branching.
	 */

	pc++;
#ifndef TCL_COMPILE_DEBUG
	switch (*pc) {
	case INST_JUMP_FALSE1:
	    NEXT_INST_F((match ? 2 : TclGetInt1AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE1:
	    NEXT_INST_F((match ? TclGetInt1AtPtr(pc+1) : 2), 2, 0);
	case INST_JUMP_FALSE4:
	    NEXT_INST_F((match ? 5 : TclGetInt4AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE4:
	    NEXT_INST_F((match ? TclGetInt4AtPtr(pc+1) : 5), 2, 0);
	}
#endif
	objResultPtr = TCONST(match);
	NEXT_INST_F(0, 2, 1);


    /*
     *	   End of INST_LIST and related instructions.
     * -----------------------------------------------------------------
     *	   Start of string-related instructions.
     */

    case INST_STR_EQ:
    case INST_STR_NEQ:		/* String (in)equality check */
	/*

	 * TODO: Consider merging into INST_STR_CMP
	 */



	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	if (valuePtr == value2Ptr) {
	    /*
	     * On the off-chance that the objects are the same, we don't
	     * really have to think hard about equality.
	     */

	    match = (*pc == INST_STR_EQ);
	} else {



	    s1 = TclGetStringFromObj(valuePtr, &s1len);
	    s2 = TclGetStringFromObj(value2Ptr, &s2len);
	    if (s1len == s2len) {
		/*
		 * We only need to check (in)equality when we have equal
		 * length strings.
		 */

		if (*pc == INST_STR_NEQ) {
		    match = (strcmp(s1, s2) != 0);
		} else {
		    /* INST_STR_EQ */
		    match = (strcmp(s1, s2) == 0);
		}
	    } else {
		match = (*pc == INST_STR_NEQ);
	    }
	}

	TRACE(("%.20s %.20s => %d\n", O2S(valuePtr),O2S(value2Ptr),match));

	/*
	 * Peep-hole optimisation: if you're about to jump, do jump from here.
	 */

	pc++;
#ifndef TCL_COMPILE_DEBUG
	switch (*pc) {
	case INST_JUMP_FALSE1:
	    NEXT_INST_F((match? 2 : TclGetInt1AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE1:
	    NEXT_INST_F((match? TclGetInt1AtPtr(pc+1) : 2), 2, 0);
	case INST_JUMP_FALSE4:
	    NEXT_INST_F((match? 5 : TclGetInt4AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE4:
	    NEXT_INST_F((match? TclGetInt4AtPtr(pc+1) : 5), 2, 0);
	}
#endif
	objResultPtr = TCONST(match);
	NEXT_INST_F(0, 2, 1);

    stringCompare:
    case INST_STR_CMP:		/* String compare. */








	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	/*
	 * The comparison function should compare up to the minimum byte
	 * length only.
	 */

	if (valuePtr == value2Ptr) {
	    /*
	     * In the pure equality case, set lengths too for the checks below
	     * (or we could goto beyond it).
	     */

	    match = s1len = s2len = 0;
	} else if (TclIsPureByteArray(valuePtr)
		&& TclIsPureByteArray(value2Ptr)) {
	    s1 = (char *) Tcl_GetByteArrayFromObj(valuePtr, &s1len);
	    s2 = (char *) Tcl_GetByteArrayFromObj(value2Ptr, &s2len);
	    match = memcmp(s1, s2,
		    (size_t) ((s1len < s2len) ? s1len : s2len));
	} else if (((valuePtr->typePtr == &tclStringType)
		&& (value2Ptr->typePtr == &tclStringType))) {
	    /*
	     * Do a unicode-specific comparison if both of the args are of
	     * String type. If the char length == byte length, we can do a
	     * memcmp. In benchmark testing this proved the most efficient
	     * check between the unicode and string comparison operations.
	     */

	    s1len = Tcl_GetCharLength(valuePtr);
	    s2len = Tcl_GetCharLength(value2Ptr);
	    if ((s1len == valuePtr->length) && (s2len == value2Ptr->length)) {
		match = memcmp(valuePtr->bytes, value2Ptr->bytes,
			(unsigned) ((s1len < s2len) ? s1len : s2len));
	    } else {
		match = TclUniCharNcmp(Tcl_GetUnicode(valuePtr),
			Tcl_GetUnicode(value2Ptr),
			(unsigned) ((s1len < s2len) ? s1len : s2len));
	    }
	} else {
	    /*
	     * We can't do a simple memcmp in order to handle the special Tcl
	     * \xC0\x80 null encoding for utf-8.
	     */

	    s1 = TclGetStringFromObj(valuePtr, &s1len);
	    s2 = TclGetStringFromObj(value2Ptr, &s2len);
	    match = TclpUtfNcmp2(s1, s2,
		    (size_t) ((s1len < s2len) ? s1len : s2len));
	}

	/*
	 * Make sure only -1,0,1 is returned
	 * TODO: consider peephole opt.
	 */

	if (match == 0) {
	    match = s1len - s2len;
	}

	if (*pc != INST_STR_CMP) {
	    /*
	     * Take care of the opcodes that goto'ed into here.
	     */

	    switch (*pc) {
	    case INST_EQ:
		match = (match == 0);
		break;
	    case INST_NEQ:
		match = (match != 0);
		break;
	    case INST_LT:
		match = (match < 0);
		break;
	    case INST_GT:
		match = (match > 0);
		break;
	    case INST_LE:
		match = (match <= 0);
		break;
	    case INST_GE:
		match = (match >= 0);
		break;
	    }
	}
	if (match < 0) {
	    TclNewIntObj(objResultPtr, -1);

	} else {
	    objResultPtr = TCONST(match > 0);


	}
	TRACE(("%.20s %.20s => %s\n", O2S(valuePtr), O2S(value2Ptr),
		O2S(objResultPtr)));
	NEXT_INST_F(1, 2, 1);


    case INST_STR_LEN:
	valuePtr = OBJ_AT_TOS;

	length = Tcl_GetCharLength(valuePtr);
	TclNewIntObj(objResultPtr, length);
	TRACE(("%.20s => %d\n", O2S(valuePtr), length));
	NEXT_INST_F(1, 1, 1);

    case INST_STR_INDEX:






	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	/*
	 * Get char length to calulate what 'end' means.
	 */

	length = Tcl_GetCharLength(valuePtr);
	if (TclGetIntForIndexM(interp, value2Ptr, length-1, &index)!=TCL_OK) {

	    goto gotError;
	}

	if ((index < 0) || (index >= length)) {
	    TclNewObj(objResultPtr);
	} else if (TclIsPureByteArray(valuePtr)) {
	    objResultPtr = Tcl_NewByteArrayObj(
		    Tcl_GetByteArrayFromObj(valuePtr, &length)+index, 1);
	} else if (valuePtr->bytes && length == valuePtr->length) {
	    objResultPtr = Tcl_NewStringObj((const char *)
		    valuePtr->bytes+index, 1);
	} else {
	    char buf[TCL_UTF_MAX];


	    Tcl_UniChar ch = Tcl_GetUniChar(valuePtr, index);

	    /*
	     * This could be: Tcl_NewUnicodeObj((const Tcl_UniChar *)&ch, 1)
	     * but creating the object as a string seems to be faster in
	     * practical use.
	     */

	    length = Tcl_UniCharToUtf(ch, buf);
	    objResultPtr = Tcl_NewStringObj(buf, length);



	}

	TRACE(("%.20s %.20s => %s\n", O2S(valuePtr), O2S(value2Ptr),
		O2S(objResultPtr)));
	NEXT_INST_F(1, 2, 1);


    case INST_STR_MATCH:


	nocase = TclGetInt1AtPtr(pc+1);
	valuePtr = OBJ_AT_TOS;		/* String */
	value2Ptr = OBJ_UNDER_TOS;	/* Pattern */

	/*
	 * Check that at least one of the objects is Unicode before promoting
	 * both.
	 */

	if ((valuePtr->typePtr == &tclStringType)
		|| (value2Ptr->typePtr == &tclStringType)) {
	    Tcl_UniChar *ustring1, *ustring2;

	    ustring1 = Tcl_GetUnicodeFromObj(valuePtr, &length);
	    ustring2 = Tcl_GetUnicodeFromObj(value2Ptr, &length2);
	    match = TclUniCharMatch(ustring1, length, ustring2, length2,
		    nocase);
	} else if (TclIsPureByteArray(valuePtr) && !nocase) {
	    unsigned char *bytes1, *bytes2;

	    bytes1 = Tcl_GetByteArrayFromObj(valuePtr, &length);
	    bytes2 = Tcl_GetByteArrayFromObj(value2Ptr, &length2);
	    match = TclByteArrayMatch(bytes1, length, bytes2, length2, 0);
	} else {
	    match = Tcl_StringCaseMatch(TclGetString(valuePtr),
		    TclGetString(value2Ptr), nocase);
	}

	/*
	 * Reuse value2Ptr object already on stack if possible. Adjustment is
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969






4970

4971
4972
4973
4974
4975
4976
4977
4978
4979

4980
4981


4982
4983
4984
4985

4986

4987
4988
4989
4990
4991
4992

4993
4994
4995
4996
4997
4998
4999
	    NEXT_INST_F((match? 5 : TclGetInt4AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE4:
	    NEXT_INST_F((match? TclGetInt4AtPtr(pc+1) : 5), 2, 0);
	}
#endif
	objResultPtr = TCONST(match);
	NEXT_INST_F(0, 2, 1);
    }

    case INST_REGEXP: {
	int cflags, match;
	Tcl_RegExp regExpr;

	cflags = TclGetInt1AtPtr(pc+1); /* RE compile flages like NOCASE */
	valuePtr = OBJ_AT_TOS;		/* String */
	value2Ptr = OBJ_UNDER_TOS;	/* Pattern */







	regExpr = Tcl_GetRegExpFromObj(interp, value2Ptr, cflags);

	if (regExpr == NULL) {
	    match = -1;
	} else {
	    match = Tcl_RegExpExecObj(interp, regExpr, valuePtr, 0, 0, 0);
	}

	/*
	 * Adjustment is 2 due to the nocase byte
	 */


	if (match < 0) {


	    objResultPtr = Tcl_GetObjResult(interp);
	    TRACE_WITH_OBJ(("%.20s %.20s => ERROR: ",
		    O2S(valuePtr), O2S(value2Ptr)), objResultPtr);
	    TRESULT = TCL_ERROR;

	    goto checkForCatch;

	}

	TRACE(("%.20s %.20s => %d\n", O2S(valuePtr), O2S(value2Ptr), match));

	/*
	 * Peep-hole optimisation: if you're about to jump, do jump from here.

	 */

	pc += 2;
#ifndef TCL_COMPILE_DEBUG
	switch (*pc) {
	case INST_JUMP_FALSE1:
	    NEXT_INST_F((match? 2 : TclGetInt1AtPtr(pc+1)), 2, 0);







|
<
|
<
<
<




>
>
>
>
>
>
|
>
|
<
<
|
|

<
<
<
>

|
>
>
|
|
|
<
>
|
>






>







4814
4815
4816
4817
4818
4819
4820
4821

4822



4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835


4836
4837
4838



4839
4840
4841
4842
4843
4844
4845
4846

4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
	    NEXT_INST_F((match? 5 : TclGetInt4AtPtr(pc+1)), 2, 0);
	case INST_JUMP_TRUE4:
	    NEXT_INST_F((match? TclGetInt4AtPtr(pc+1) : 5), 2, 0);
	}
#endif
	objResultPtr = TCONST(match);
	NEXT_INST_F(0, 2, 1);


    case INST_REGEXP:



	cflags = TclGetInt1AtPtr(pc+1); /* RE compile flages like NOCASE */
	valuePtr = OBJ_AT_TOS;		/* String */
	value2Ptr = OBJ_UNDER_TOS;	/* Pattern */

	/*
	 * Compile and match the regular expression.
	 */

	{
	    Tcl_RegExp regExpr =
		    Tcl_GetRegExpFromObj(interp, value2Ptr, cflags);

	    if (regExpr == NULL) {


		goto regexpFailure;
	    }




	    match = Tcl_RegExpExecObj(interp, regExpr, valuePtr, 0, 0, 0);

	    if (match < 0) {
	    regexpFailure:
#ifdef TCL_COMPILE_DEBUG
		objResultPtr = Tcl_GetObjResult(interp);
		TRACE_WITH_OBJ(("%.20s %.20s => ERROR: ",
			O2S(valuePtr), O2S(value2Ptr)), objResultPtr);

#endif
		goto gotError;
	    }
	}

	TRACE(("%.20s %.20s => %d\n", O2S(valuePtr), O2S(value2Ptr), match));

	/*
	 * Peep-hole optimisation: if you're about to jump, do jump from here.
	 * Adjustment is 2 due to the nocase byte.
	 */

	pc += 2;
#ifndef TCL_COMPILE_DEBUG
	switch (*pc) {
	case INST_JUMP_FALSE1:
	    NEXT_INST_F((match? 2 : TclGetInt1AtPtr(pc+1)), 2, 0);
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
     * -----------------------------------------------------------------
     *	   Start of numeric operator instructions.
     */

    {
	ClientData ptr1, ptr2;
	int type1, type2;
	double d1, d2, dResult;
	long l1, l2, lResult;
	mp_int big1, big2, bigResult, bigRemainder;
	Tcl_WideInt w1, w2, wResult;

    case INST_EQ:
    case INST_NEQ:
    case INST_LT:
    case INST_GT:
    case INST_LE:
    case INST_GE: {
	int iResult = 0, compare = 0;
	double tmp;

	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	if (GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK) {
	    /*
	     * At least one non-numeric argument - compare as strings.







<

<
<








<







4878
4879
4880
4881
4882
4883
4884

4885


4886
4887
4888
4889
4890
4891
4892
4893

4894
4895
4896
4897
4898
4899
4900
     * -----------------------------------------------------------------
     *	   Start of numeric operator instructions.
     */

    {
	ClientData ptr1, ptr2;
	int type1, type2;

	long l1, l2, lResult;



    case INST_EQ:
    case INST_NEQ:
    case INST_LT:
    case INST_GT:
    case INST_LE:
    case INST_GE: {
	int iResult = 0, compare = 0;


	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	if (GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK) {
	    /*
	     * At least one non-numeric argument - compare as strings.
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
	    /*
	     * NaN 2nd arg: NaN != to everything, other compares are false.
	     */

	    iResult = (*pc == INST_NEQ);
	    goto foundResult;
	}
	switch (type1) {
	case TCL_NUMBER_LONG:
	    l1 = *((const long *)ptr1);
	    switch (type2) {
	    case TCL_NUMBER_LONG:
		l2 = *((const long *)ptr2);
	    longCompare:
		compare = (l1 < l2) ? MP_LT : ((l1 > l2) ? MP_GT : MP_EQ);
		break;
#ifndef NO_WIDE_TYPE
	    case TCL_NUMBER_WIDE:
		w2 = *((const Tcl_WideInt *)ptr2);
		w1 = (Tcl_WideInt)l1;
		goto wideCompare;
#endif
	    case TCL_NUMBER_DOUBLE:
		d2 = *((const double *)ptr2);
		d1 = (double) l1;

		/*
		 * If the double has a fractional part, or if the long can be
		 * converted to double without loss of precision, then compare
		 * as doubles.
		 */

		if (DBL_MANT_DIG > CHAR_BIT*sizeof(long)
			|| l1 == (long) d1
			|| modf(d2, &tmp) != 0.0) {
		    goto doubleCompare;
		}

		/*
		 * Otherwise, to make comparision based on full precision,
		 * need to convert the double to a suitably sized integer.
		 *
		 * Need this to get comparsions like
		 *	expr 20000000000000003 < 20000000000000004.0
		 * right. Converting the first argument to double will yield
		 * two double values that are equivalent within double
		 * precision. Converting the double to an integer gets done
		 * exactly, then integer comparison can tell the difference.
		 */

		if (d2 < (double)LONG_MIN) {
		    compare = MP_GT;
		    break;
		}
		if (d2 > (double)LONG_MAX) {
		    compare = MP_LT;
		    break;
		}
		l2 = (long) d2;
		goto longCompare;
	    case TCL_NUMBER_BIG:
		Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
		if (mp_cmp_d(&big2, 0) == MP_LT) {
		    compare = MP_GT;
		} else {
		    compare = MP_LT;
		}
		mp_clear(&big2);
	    }
	    break;

#ifndef NO_WIDE_TYPE
	case TCL_NUMBER_WIDE:
	    w1 = *((const Tcl_WideInt *)ptr1);
	    switch (type2) {
	    case TCL_NUMBER_WIDE:
		w2 = *((const Tcl_WideInt *)ptr2);
	    wideCompare:
		compare = (w1 < w2) ? MP_LT : ((w1 > w2) ? MP_GT : MP_EQ);
		break;
	    case TCL_NUMBER_LONG:
		l2 = *((const long *)ptr2);
		w2 = (Tcl_WideInt)l2;
		goto wideCompare;
	    case TCL_NUMBER_DOUBLE:
		d2 = *((const double *)ptr2);
		d1 = (double) w1;
		if (DBL_MANT_DIG > CHAR_BIT*sizeof(Tcl_WideInt)
			|| w1 == (Tcl_WideInt) d1
			|| modf(d2, &tmp) != 0.0) {
		    goto doubleCompare;
		}
		if (d2 < (double)LLONG_MIN) {
		    compare = MP_GT;
		    break;
		}
		if (d2 > (double)LLONG_MAX) {
		    compare = MP_LT;
		    break;
		}
		w2 = (Tcl_WideInt) d2;
		goto wideCompare;
	    case TCL_NUMBER_BIG:
		Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
		if (mp_cmp_d(&big2, 0) == MP_LT) {
		    compare = MP_GT;
		} else {
		    compare = MP_LT;
		}
		mp_clear(&big2);
	    }
	    break;
#endif

	case TCL_NUMBER_DOUBLE:
	    d1 = *((const double *)ptr1);
	    switch (type2) {
	    case TCL_NUMBER_DOUBLE:
		d2 = *((const double *)ptr2);
	    doubleCompare:
		compare = (d1 < d2) ? MP_LT : ((d1 > d2) ? MP_GT : MP_EQ);
		break;
	    case TCL_NUMBER_LONG:
		l2 = *((const long *)ptr2);
		d2 = (double) l2;
		if (DBL_MANT_DIG > CHAR_BIT*sizeof(long)
			|| l2 == (long) d2
			|| modf(d1, &tmp) != 0.0) {
		    goto doubleCompare;
		}
		if (d1 < (double)LONG_MIN) {
		    compare = MP_LT;
		    break;
		}
		if (d1 > (double)LONG_MAX) {
		    compare = MP_GT;
		    break;
		}
		l1 = (long) d1;
		goto longCompare;
#ifndef NO_WIDE_TYPE
	    case TCL_NUMBER_WIDE:
		w2 = *((const Tcl_WideInt *)ptr2);
		d2 = (double) w2;
		if (DBL_MANT_DIG > CHAR_BIT*sizeof(Tcl_WideInt)
			|| w2 == (Tcl_WideInt) d2
			|| modf(d1, &tmp) != 0.0) {
		    goto doubleCompare;
		}
		if (d1 < (double)LLONG_MIN) {
		    compare = MP_LT;
		    break;
		}
		if (d1 > (double)LLONG_MAX) {
		    compare = MP_GT;
		    break;
		}
		w1 = (Tcl_WideInt) d1;
		goto wideCompare;
#endif
	    case TCL_NUMBER_BIG:
		if (TclIsInfinite(d1)) {
		    compare = (d1 > 0.0) ? MP_GT : MP_LT;
		    break;
		}
		Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
		if ((d1 < (double)LONG_MAX) && (d1 > (double)LONG_MIN)) {
		    if (mp_cmp_d(&big2, 0) == MP_LT) {
			compare = MP_GT;
		    } else {
			compare = MP_LT;
		    }
		    mp_clear(&big2);
		    break;
		}
		if (DBL_MANT_DIG > CHAR_BIT*sizeof(long)
			&& modf(d1, &tmp) != 0.0) {
		    d2 = TclBignumToDouble(&big2);
		    mp_clear(&big2);
		    goto doubleCompare;
		}
		Tcl_InitBignumFromDouble(NULL, d1, &big1);
		goto bigCompare;
	    }
	    break;

	case TCL_NUMBER_BIG:
	    Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	    switch (type2) {
#ifndef NO_WIDE_TYPE
	    case TCL_NUMBER_WIDE:
#endif
	    case TCL_NUMBER_LONG:
		compare = mp_cmp_d(&big1, 0);
		mp_clear(&big1);
		break;
	    case TCL_NUMBER_DOUBLE:
		d2 = *((const double *)ptr2);
		if (TclIsInfinite(d2)) {
		    compare = (d2 > 0.0) ? MP_LT : MP_GT;
		    mp_clear(&big1);
		    break;
		}
		if ((d2 < (double)LONG_MAX) && (d2 > (double)LONG_MIN)) {
		    compare = mp_cmp_d(&big1, 0);
		    mp_clear(&big1);
		    break;
		}
		if (DBL_MANT_DIG > CHAR_BIT*sizeof(long)
			&& modf(d2, &tmp) != 0.0) {
		    d1 = TclBignumToDouble(&big1);
		    mp_clear(&big1);
		    goto doubleCompare;
		}
		Tcl_InitBignumFromDouble(NULL, d2, &big2);
		goto bigCompare;
	    case TCL_NUMBER_BIG:
		Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	    bigCompare:
		compare = mp_cmp(&big1, &big2);
		mp_clear(&big1);
		mp_clear(&big2);
	    }
	}

	/*
	 * Turn comparison outcome into appropriate result for opcode.
	 */

    convertComparison:







<
|

<
<
|
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







4925
4926
4927
4928
4929
4930
4931

4932
4933


4934

4935

















































4936
4937





























































































































































4938
4939
4940
4941
4942
4943
4944
	    /*
	     * NaN 2nd arg: NaN != to everything, other compares are false.
	     */

	    iResult = (*pc == INST_NEQ);
	    goto foundResult;
	}

	if ((type1 == TCL_NUMBER_LONG) && (type2 == TCL_NUMBER_LONG)) {
	    l1 = *((const long *)ptr1);


	    l2 = *((const long *)ptr2);

	    compare = (l1 < l2) ? MP_LT : ((l1 > l2) ? MP_GT : MP_EQ);

















































	} else {
	    compare = TclCompareTwoNumbers(valuePtr, value2Ptr);





























































































































































	}

	/*
	 * Turn comparison outcome into appropriate result for opcode.
	 */

    convertComparison:
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369

5370

5371
5372
5373

5374



5375
5376
5377
5378
5379
5380
5381
5382
5383
5384

5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396

5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564


5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663


5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694









































5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982

5983
5984
5985

5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002


























6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055

6056
6057
6058

6059
6060


6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082

6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133








6134
6135

6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149

6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441

6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654







6655

6656
6657
6658
6659
6660
6661
6662
6663
6664
6665

6666

6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708

6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722


6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
#endif
	objResultPtr = TCONST(iResult);
	NEXT_INST_F(0, 2, 1);
    }

    case INST_MOD:
    case INST_LSHIFT:
    case INST_RSHIFT: {
	int invalid, shift;

	l1 = 0;
	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	TRESULT = GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
	if ((TRESULT != TCL_OK) || (type1 == TCL_NUMBER_DOUBLE)
		|| (type1 == TCL_NUMBER_NAN)) {
	    TRESULT = TCL_ERROR;
	    TRACE(("%.20s %.20s => ILLEGAL 1st TYPE %s\n", O2S(valuePtr),
		    O2S(value2Ptr), (valuePtr->typePtr?
		    valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto checkForCatch;
	}

	TRESULT = GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);
	if ((TRESULT != TCL_OK) || (type2 == TCL_NUMBER_DOUBLE)
		|| (type2 == TCL_NUMBER_NAN)) {
	    TRESULT = TCL_ERROR;
	    TRACE(("%.20s %.20s => ILLEGAL 2nd TYPE %s\n", O2S(valuePtr),
		    O2S(value2Ptr), (value2Ptr->typePtr?
		    value2Ptr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, value2Ptr);
	    goto checkForCatch;
	}

	if (*pc == INST_MOD) {

	    /* TODO: Attempts to re-use unshared operands on stack */


	    l2 = 0;		/* silence gcc warning */
	    if (type2 == TCL_NUMBER_LONG) {

		l2 = *((const long *)ptr2);



		if (l2 == 0) {
		    TRACE(("%s %s => DIVIDE BY ZERO\n", O2S(valuePtr),
			    O2S(value2Ptr)));
		    goto divideByZero;
		}
		if ((l2 == 1) || (l2 == -1)) {
		    /*
		     * Div. by |1| always yields remainder of 0.
		     */


		    objResultPtr = TCONST(0);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		}
	    }
	    if (type1 == TCL_NUMBER_LONG) {
		l1 = *((const long *)ptr1);
		if (l1 == 0) {
		    /*
		     * 0 % (non-zero) always yields remainder of 0.
		     */


		    objResultPtr = TCONST(0);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		}
		if (type2 == TCL_NUMBER_LONG) {
		    /*
		     * Both operands are long; do native calculation.
		     */

		    long lRemainder, lQuotient = l1 / l2;

		    /*
		     * Force Tcl's integer division rules.
		     * TODO: examine for logic simplification
		     */

		    if ((lQuotient < 0 || (lQuotient == 0 &&
			    ((l1 < 0 && l2 > 0) || (l1 > 0 && l2 < 0)))) &&
			    (lQuotient * l2 != l1)) {
			lQuotient -= 1;
		    }
		    lRemainder = l1 - l2*lQuotient;
		    TclNewLongObj(objResultPtr, lRemainder);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		}

		/*
		 * First operand fits in long; second does not, so the second
		 * has greater magnitude than first. No need to divide to
		 * determine the remainder.
		 */

#ifndef NO_WIDE_TYPE
		if (type2 == TCL_NUMBER_WIDE) {
		    w2 = *((const Tcl_WideInt *)ptr2);
		    if ((l1 > 0) ^ (w2 > (Tcl_WideInt)0)) {
			/*
			 * Arguments are opposite sign; remainder is sum.
			 */

			objResultPtr = Tcl_NewWideIntObj(w2+(Tcl_WideInt)l1);
			TRACE(("%s\n", O2S(objResultPtr)));
			NEXT_INST_F(1, 2, 1);
		    }

		    /*
		     * Arguments are same sign; remainder is first operand.
		     */

		    TRACE(("%s\n", O2S(valuePtr)));
		    NEXT_INST_F(1, 1, 0);
		}
#endif
		Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);

		/* TODO: internals intrusion */
		if ((l1 > 0) ^ (big2.sign == MP_ZPOS)) {
		    /*
		     * Arguments are opposite sign; remainder is sum.
		     */

		    TclBNInitBignumFromLong(&big1, l1);
		    mp_add(&big2, &big1, &big2);
		    mp_clear(&big1);
		    objResultPtr = Tcl_NewBignumObj(&big2);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		}

		/*
		 * Arguments are same sign; remainder is first operand.
		 */

		mp_clear(&big2);
		TRACE(("%s\n", O2S(valuePtr)));
		NEXT_INST_F(1, 1, 0);
	    }
#ifndef NO_WIDE_TYPE
	    if (type1 == TCL_NUMBER_WIDE) {
		w1 = *((const Tcl_WideInt *)ptr1);
		if (type2 != TCL_NUMBER_BIG) {
		    Tcl_WideInt wQuotient, wRemainder;

		    Tcl_GetWideIntFromObj(NULL, value2Ptr, &w2);
		    wQuotient = w1 / w2;

		    /*
		     * Force Tcl's integer division rules.
		     * TODO: examine for logic simplification
		     */

		    if (((wQuotient < (Tcl_WideInt) 0)
			    || ((wQuotient == (Tcl_WideInt) 0)
			    && ((w1 < (Tcl_WideInt)0 && w2 > (Tcl_WideInt)0)
			    || (w1 > (Tcl_WideInt)0 && w2 < (Tcl_WideInt)0))))
			    && (wQuotient * w2 != w1)) {
			wQuotient -= (Tcl_WideInt) 1;
		    }
		    wRemainder = w1 - w2*wQuotient;
		    objResultPtr = Tcl_NewWideIntObj(wRemainder);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		}

		Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);

		/* TODO: internals intrusion */
		if ((w1 > ((Tcl_WideInt) 0)) ^ (big2.sign == MP_ZPOS)) {
		    /*
		     * Arguments are opposite sign; remainder is sum.
		     */

		    TclBNInitBignumFromWideInt(&big1, w1);
		    mp_add(&big2, &big1, &big2);
		    mp_clear(&big1);
		    objResultPtr = Tcl_NewBignumObj(&big2);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		}

		/*
		 * Arguments are same sign; remainder is first operand.
		 */

		mp_clear(&big2);
		TRACE(("%s\n", O2S(valuePtr)));
		NEXT_INST_F(1, 1, 0);
	    }
#endif
	    Tcl_GetBignumFromObj(NULL, valuePtr, &big1);
	    Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
	    mp_init(&bigResult);
	    mp_init(&bigRemainder);
	    mp_div(&big1, &big2, &bigResult, &bigRemainder);
	    if (!mp_iszero(&bigRemainder)
		    && (bigRemainder.sign != big2.sign)) {
		/*
		 * Convert to Tcl's integer division rules.
		 */

		mp_sub_d(&bigResult, 1, &bigResult);
		mp_add(&bigRemainder, &big2, &bigRemainder);
	    }
	    mp_copy(&bigRemainder, &bigResult);
	    mp_clear(&bigRemainder);
	    mp_clear(&big1);
	    mp_clear(&big2);
	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    if (Tcl_IsShared(valuePtr)) {
		objResultPtr = Tcl_NewBignumObj(&bigResult);
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }
	    Tcl_SetBignumObj(valuePtr, &bigResult);
	    TRACE(("%s\n", O2S(valuePtr)));
	    NEXT_INST_F(1, 1, 0);
	}

	/*
	 * Reject negative shift argument.
	 */

	switch (type2) {
	case TCL_NUMBER_LONG:
	    invalid = (*((const long *)ptr2) < (long)0);
	    break;
#ifndef NO_WIDE_TYPE


	case TCL_NUMBER_WIDE:
	    invalid = (*((const Tcl_WideInt *)ptr2) < (Tcl_WideInt)0);
	    break;
#endif
	case TCL_NUMBER_BIG:
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	    invalid = (mp_cmp_d(&big2, 0) == MP_LT);
	    mp_clear(&big2);
	    break;
	default:
	    /* Unused, here to silence compiler warning */
	    invalid = 0;
	}
	if (invalid) {
	    Tcl_SetResult(interp, "negative shift argument", TCL_STATIC);
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}

	/*
	 * Zero shifted any number of bits is still zero.
	 */

	if ((type1==TCL_NUMBER_LONG) && (*((const long *)ptr1) == (long)0)) {
	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    objResultPtr = TCONST(0);
	    TRACE(("%s\n", O2S(objResultPtr)));
	    NEXT_INST_F(1, 2, 1);
	}

	if (*pc == INST_LSHIFT) {
	    /*
	     * Large left shifts create integer overflow.
	     *
	     * BEWARE! Can't use Tcl_GetIntFromObj() here because that
	     * converts values in the (unsigned) range to their signed int
	     * counterparts, leading to incorrect results.
	     */

	    if ((type2 != TCL_NUMBER_LONG)
		    || (*((const long *)ptr2) > (long) INT_MAX)) {
		/*
		 * Technically, we could hold the value (1 << (INT_MAX+1)) in
		 * an mp_int, but since we're using mp_mul_2d() to do the
		 * work, and it takes only an int argument, that's a good
		 * place to draw the line.
		 */

		Tcl_SetResult(interp, "integer value too large to represent",
			TCL_STATIC);
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }
	    shift = (int)(*((const long *)ptr2));

	    /*
	     * Handle shifts within the native long range.
	     */

	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    if ((type1 == TCL_NUMBER_LONG)
		    && (size_t) shift < CHAR_BIT*sizeof(long)
		    && ((l1 = *(const long *)ptr1) != 0)
		    && !((l1>0 ? l1 : ~l1)
			    & -(1L<<(CHAR_BIT*sizeof(long) - 1 - shift)))) {
		TclNewLongObj(objResultPtr, (l1<<shift));
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }

	    /*
	     * Handle shifts within the native wide range.
	     */

	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    if ((type1 != TCL_NUMBER_BIG)
		    && ((size_t)shift < CHAR_BIT*sizeof(Tcl_WideInt))) {
		TclGetWideIntFromObj(NULL, valuePtr, &w1);
		if (!((w1>0 ? w1 : ~w1)
			& -(((Tcl_WideInt)1)
			<< (CHAR_BIT*sizeof(Tcl_WideInt) - 1 - shift)))) {
		    objResultPtr = Tcl_NewWideIntObj(w1<<shift);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		}
	    }
	} else {
	    /*
	     * Quickly force large right shifts to 0 or -1.
	     */

	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    if ((type2 != TCL_NUMBER_LONG)
		    || (*(const long *)ptr2 > INT_MAX)) {
		/*
		 * Again, technically, the value to be shifted could be an
		 * mp_int so huge that a right shift by (INT_MAX+1) bits could
		 * not take us to the result of 0 or -1, but since we're using
		 * mp_div_2d to do the work, and it takes only an int


		 * argument, we draw the line there.
		 */

		int zero;

		switch (type1) {
		case TCL_NUMBER_LONG:
		    zero = (*(const long *)ptr1 > 0L);
		    break;
#ifndef NO_WIDE_TYPE
		case TCL_NUMBER_WIDE:
		    zero = (*(const Tcl_WideInt *)ptr1 > (Tcl_WideInt)0);
		    break;
#endif
		case TCL_NUMBER_BIG:
		    Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
		    zero = (mp_cmp_d(&big1, 0) == MP_GT);
		    mp_clear(&big1);
		    break;
		default:
		    /* Unused, here to silence compiler warning. */
		    zero = 0;
		}
		if (zero) {
		    objResultPtr = TCONST(0);
		} else {
		    TclNewIntObj(objResultPtr, -1);
		}
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }









































	    shift = (int)(*(const long *)ptr2);

	    /*
	     * Handle shifts within the native long range.
	     */

	    if (type1 == TCL_NUMBER_LONG) {
		l1 = *((const long *)ptr1);
		if ((size_t)shift >= CHAR_BIT*sizeof(long)) {
		    if (l1 >= (long)0) {
			objResultPtr = TCONST(0);
		    } else {
			TclNewIntObj(objResultPtr, -1);
		    }
		} else {
		    TclNewLongObj(objResultPtr, (l1 >> shift));
		}
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }

#ifndef NO_WIDE_TYPE
	    /*
	     * Handle shifts within the native wide range.
	     */

	    if (type1 == TCL_NUMBER_WIDE) {
		w1 = *(const Tcl_WideInt *)ptr1;
		if ((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideInt)) {
		    if (w1 >= (Tcl_WideInt)0) {
			objResultPtr = TCONST(0);
		    } else {
			TclNewIntObj(objResultPtr, -1);
		    }
		} else {
		    objResultPtr = Tcl_NewWideIntObj(w1 >> shift);
		}
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }
#endif
	}

	Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);

	mp_init(&bigResult);
	if (*pc == INST_LSHIFT) {
	    mp_mul_2d(&big1, shift, &bigResult);
	} else {
	    mp_init(&bigRemainder);
	    mp_div_2d(&big1, shift, &bigResult, &bigRemainder);
	    if (mp_cmp_d(&bigRemainder, 0) == MP_LT) {
		/*
		 * Convert to Tcl's integer division rules.
		 */

		mp_sub_d(&bigResult, 1, &bigResult);
	    }
	    mp_clear(&bigRemainder);
	}
	mp_clear(&big1);

	if (!Tcl_IsShared(valuePtr)) {
	    Tcl_SetBignumObj(valuePtr, &bigResult);
	    TRACE(("%s\n", O2S(valuePtr)));
	    NEXT_INST_F(1, 1, 0);
	}
	objResultPtr = Tcl_NewBignumObj(&bigResult);
	TRACE(("%s\n", O2S(objResultPtr)));
	NEXT_INST_F(1, 2, 1);
    }

    case INST_BITOR:
    case INST_BITXOR:
    case INST_BITAND:
	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	TRESULT = GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
	if ((TRESULT != TCL_OK)
		|| (type1 == TCL_NUMBER_NAN)
		|| (type1 == TCL_NUMBER_DOUBLE)) {
	    TRESULT = TCL_ERROR;
	    TRACE(("%.20s %.20s => ILLEGAL 1st TYPE %s\n", O2S(valuePtr),
		    O2S(value2Ptr), (valuePtr->typePtr?
		    valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto checkForCatch;
	}
	TRESULT = GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);
	if ((TRESULT != TCL_OK) || (type2 == TCL_NUMBER_NAN)
		|| (type2 == TCL_NUMBER_DOUBLE)) {
	    TRESULT = TCL_ERROR;
	    TRACE(("%.20s %.20s => ILLEGAL 2nd TYPE %s\n", O2S(valuePtr),
		    O2S(value2Ptr), (value2Ptr->typePtr?
		    value2Ptr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, value2Ptr);
	    goto checkForCatch;
	}

	if ((type1 == TCL_NUMBER_BIG) || (type2 == TCL_NUMBER_BIG)) {
	    mp_int *First, *Second;
	    int numPos;

	    Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);

	    /*
	     * Count how many positive arguments we have. If only one of the
	     * arguments is negative, store it in 'Second'.
	     */

	    if (mp_cmp_d(&big1, 0) != MP_LT) {
		numPos = 1 + (mp_cmp_d(&big2, 0) != MP_LT);
		First = &big1;
		Second = &big2;
	    } else {
		First = &big2;
		Second = &big1;
		numPos = (mp_cmp_d(First, 0) != MP_LT);
	    }
	    mp_init(&bigResult);

	    switch (*pc) {
	    case INST_BITAND:
		switch (numPos) {
		case 2:
		    /*
		     * Both arguments positive, base case.
		     */

		    mp_and(First, Second, &bigResult);
		    break;
		case 1:
		    /*
		     * First is positive; second negative:
		     * P & N = P & ~~N = P&~(-N-1) = P & (P ^ (-N-1))
		     */

		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    mp_and(First, &bigResult, &bigResult);
		    break;
		case 0:
		    /*
		     * Both arguments negative:
		     * a & b = ~ (~a | ~b) = -(-a-1|-b-1)-1
		     */

		    mp_neg(First, First);
		    mp_sub_d(First, 1, First);
		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_or(First, Second, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		}
		break;

	    case INST_BITOR:
		switch (numPos) {
		case 2:
		    /*
		     * Both arguments positive, base case.
		     */

		    mp_or(First, Second, &bigResult);
		    break;
		case 1:
		    /*
		     * First is positive; second negative:
		     * N|P = ~(~N&~P) = ~((-N-1)&~P) = -((-N-1)&((-N-1)^P))-1
		     */

		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    mp_and(Second, &bigResult, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		case 0:
		    /*
		     * Both arguments negative:
		     * a | b = ~ (~a & ~b) = -(-a-1&-b-1)-1
		     */

		    mp_neg(First, First);
		    mp_sub_d(First, 1, First);
		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_and(First, Second, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		}
		break;

	    case INST_BITXOR:
		switch (numPos) {
		case 2:
		    /*
		     * Both arguments positive, base case.
		     */

		    mp_xor(First, Second, &bigResult);
		    break;
		case 1:
		    /*
		     * First is positive; second negative:
		     * P^N = ~(P^~N) = -(P^(-N-1))-1
		     */

		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		case 0:
		    /*
		     * Both arguments negative:
		     * a ^ b = (~a ^ ~b) = (-a-1^-b-1)
		     */

		    mp_neg(First, First);
		    mp_sub_d(First, 1, First);
		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    break;
		}
		break;
	    }

	    mp_clear(&big1);
	    mp_clear(&big2);
	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    if (Tcl_IsShared(valuePtr)) {
		objResultPtr = Tcl_NewBignumObj(&bigResult);
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }
	    Tcl_SetBignumObj(valuePtr, &bigResult);
	    TRACE(("%s\n", O2S(valuePtr)));
	    NEXT_INST_F(1, 1, 0);
	}

#ifndef NO_WIDE_TYPE
	if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE)) {
	    TclGetWideIntFromObj(NULL, valuePtr, &w1);
	    TclGetWideIntFromObj(NULL, value2Ptr, &w2);

	    switch (*pc) {
	    case INST_BITAND:
		wResult = w1 & w2;
		break;
	    case INST_BITOR:
		wResult = w1 | w2;
		break;
	    case INST_BITXOR:
		wResult = w1 ^ w2;
		break;
	    default:
		/* Unused, here to silence compiler warning. */
		wResult = 0;
	    }

	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    if (Tcl_IsShared(valuePtr)) {
		objResultPtr = Tcl_NewWideIntObj(wResult);
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }
	    Tcl_SetWideIntObj(valuePtr, wResult);
	    TRACE(("%s\n", O2S(valuePtr)));
	    NEXT_INST_F(1, 1, 0);
	}
#endif
	l1 = *((const long *)ptr1);
	l2 = *((const long *)ptr2);

	switch (*pc) {
	case INST_BITAND:
	    lResult = l1 & l2;
	    break;

	case INST_BITOR:
	    lResult = l1 | l2;
	    break;

	case INST_BITXOR:
	    lResult = l1 ^ l2;
	    break;
	default:
	    /* Unused, here to silence compiler warning. */
	    lResult = 0;
	}

	TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	if (Tcl_IsShared(valuePtr)) {
	    TclNewLongObj(objResultPtr, lResult);
	    TRACE(("%s\n", O2S(objResultPtr)));
	    NEXT_INST_F(1, 2, 1);
	}
	TclSetLongObj(valuePtr, lResult);
	TRACE(("%s\n", O2S(valuePtr)));
	NEXT_INST_F(1, 1, 0);



























    case INST_EXPON:
    case INST_ADD:
    case INST_SUB:
    case INST_DIV:
    case INST_MULT:
	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	TRESULT = GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
	if ((TRESULT != TCL_OK) || IsErroringNaNType(type1)) {
	    TRESULT = TCL_ERROR;
	    TRACE(("%.20s %.20s => ILLEGAL 1st TYPE %s\n",
		    O2S(value2Ptr), O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name: "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto checkForCatch;
	}

#ifdef ACCEPT_NAN
	if (type1 == TCL_NUMBER_NAN) {
	    /*
	     * NaN first argument -> result is also NaN.
	     */

	    NEXT_INST_F(1, 1, 0);
	}
#endif

	TRESULT = GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);
	if ((TRESULT != TCL_OK) || IsErroringNaNType(type2)) {
	    TRESULT = TCL_ERROR;
	    TRACE(("%.20s %.20s => ILLEGAL 2nd TYPE %s\n",
		    O2S(value2Ptr), O2S(valuePtr),
		    (value2Ptr->typePtr? value2Ptr->typePtr->name: "null")));
	    IllegalExprOperandType(interp, pc, value2Ptr);
	    goto checkForCatch;
	}

#ifdef ACCEPT_NAN
	if (type2 == TCL_NUMBER_NAN) {
	    /*
	     * NaN second argument -> result is also NaN.
	     */

	    objResultPtr = value2Ptr;
	    NEXT_INST_F(1, 2, 1);
	}
#endif

	if ((type1 == TCL_NUMBER_DOUBLE) || (type2 == TCL_NUMBER_DOUBLE)) {
	    /*
	     * At least one of the values is floating-point, so perform

	     * floating point calculations.
	     */


	    Tcl_GetDoubleFromObj(NULL, valuePtr, &d1);
	    Tcl_GetDoubleFromObj(NULL, value2Ptr, &d2);



	    switch (*pc) {
	    case INST_ADD:
		dResult = d1 + d2;
		break;
	    case INST_SUB:
		dResult = d1 - d2;
		break;
	    case INST_MULT:
		dResult = d1 * d2;
		break;
	    case INST_DIV:
#ifndef IEEE_FLOATING_POINT
		if (d2 == 0.0) {
		    TRACE(("%.6g %.6g => DIVIDE BY ZERO\n", d1, d2));
		    goto divideByZero;
		}
#endif
		/*
		 * We presume that we are running with zero-divide unmasked if
		 * we're on an IEEE box. Otherwise, this statement might cause
		 * demons to fly out our noses.

		 */

		dResult = d1 / d2;
		break;
	    case INST_EXPON:
		if (d1==0.0 && d2<0.0) {
		    TRACE(("%.6g %.6g => EXPONENT OF ZERO\n", d1, d2));
		    goto exponOfZero;
		}
		dResult = pow(d1, d2);
		break;
	    default:
		/* Unused, here to silence compiler warning. */
		dResult = 0;
	    }

#ifndef ACCEPT_NAN
	    /*
	     * Check now for IEEE floating-point error.
	     */

	    if (TclIsNaN(dResult)) {
		TRACE(("%.20s %.20s => IEEE FLOATING PT ERROR\n",
			O2S(valuePtr), O2S(value2Ptr)));
		TclExprFloatError(interp, dResult);
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }
#endif
	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    if (Tcl_IsShared(valuePtr)) {
		TclNewDoubleObj(objResultPtr, dResult);
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }
	    TclSetDoubleObj(valuePtr, dResult);
	    TRACE(("%s\n", O2S(valuePtr)));
	    NEXT_INST_F(1, 1, 0);
	}

	if ((sizeof(long) >= 2*sizeof(int)) && (*pc == INST_MULT)
		&& (type1 == TCL_NUMBER_LONG) && (type2 == TCL_NUMBER_LONG)) {
	    l1 = *((const long *)ptr1);
	    l2 = *((const long *)ptr2);

	    if ((l1 <= INT_MAX) && (l1 >= INT_MIN)
		    && (l2 <= INT_MAX) && (l2 >= INT_MIN)) {
		lResult = l1 * l2;
		TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		if (Tcl_IsShared(valuePtr)) {
		    TclNewLongObj(objResultPtr, lResult);








		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);

		}
		TclSetLongObj(valuePtr, lResult);
		TRACE(("%s\n", O2S(valuePtr)));
		NEXT_INST_F(1, 1, 0);
	    }
	}

	if ((sizeof(Tcl_WideInt) >= 2*sizeof(long)) && (*pc == INST_MULT)
		&& (type1 == TCL_NUMBER_LONG) && (type2 == TCL_NUMBER_LONG)) {
	    TclGetWideIntFromObj(NULL, valuePtr, &w1);
	    TclGetWideIntFromObj(NULL, value2Ptr, &w2);

	    wResult = w1 * w2;


	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    if (Tcl_IsShared(valuePtr)) {
		objResultPtr = Tcl_NewWideIntObj(wResult);
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }
	    Tcl_SetWideIntObj(valuePtr, wResult);
	    TRACE(("%s\n", O2S(valuePtr)));
	    NEXT_INST_F(1, 1, 0);
	}

	/* TODO: Attempts to re-use unshared operands on stack. */
	if (*pc == INST_EXPON) {
	    int oddExponent = 0, negativeExponent = 0;
	    unsigned short base;

	    l1 = l2 = 0;
	    if (type2 == TCL_NUMBER_LONG) {
		l2 = *((const long *) ptr2);
		if (l2 == 0) {
		    /*
		     * Anything to the zero power is 1.
		     */

		    objResultPtr = TCONST(1);
		    NEXT_INST_F(1, 2, 1);
		} else if (l2 == 1) {
		    /*
		     * Anything to the first power is itself
		     */
		    NEXT_INST_F(1, 1, 0);
		}
	    }

	    switch (type2) {
	    case TCL_NUMBER_LONG: {
		negativeExponent = (l2 < 0);
		oddExponent = (int) (l2 & 1);
		break;
	    }
#ifndef NO_WIDE_TYPE
	    case TCL_NUMBER_WIDE:
		w2 = *((const Tcl_WideInt *)ptr2);
		negativeExponent = (w2 < 0);
		oddExponent = (int) (w2 & (Tcl_WideInt)1);
		break;
#endif
	    case TCL_NUMBER_BIG:
		Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
		negativeExponent = (mp_cmp_d(&big2, 0) == MP_LT);
		mp_mod_2d(&big2, 1, &big2);
		oddExponent = !mp_iszero(&big2);
		mp_clear(&big2);
		break;
	    }

	    if (type1 == TCL_NUMBER_LONG) {
		l1 = *((const long *)ptr1);
	    }
	    if (negativeExponent) {
		if (type1 == TCL_NUMBER_LONG) {
		    switch (l1) {
		    case 0:
			/*
			 * Zero to a negative power is div by zero error.
			 */

			TRACE(("%s %s => EXPONENT OF ZERO\n", O2S(valuePtr),
				O2S(value2Ptr)));
			goto exponOfZero;
		    case -1:
			if (oddExponent) {
			    TclNewIntObj(objResultPtr, -1);
			} else {
			    objResultPtr = TCONST(1);
			}
			NEXT_INST_F(1, 2, 1);
		    case 1:
			/*
			 * 1 to any power is 1.
			 */

			objResultPtr = TCONST(1);
			NEXT_INST_F(1, 2, 1);
		    }
		}

		/*
		 * Integers with magnitude greater than 1 raise to a negative
		 * power yield the answer zero (see TIP 123).
		 */

		objResultPtr = TCONST(0);
		NEXT_INST_F(1, 2, 1);
	    }

	    if (type1 == TCL_NUMBER_LONG) {
		switch (l1) {
		case 0:
		    /*
		     * Zero to a positive power is zero.
		     */

		    objResultPtr = TCONST(0);
		    NEXT_INST_F(1, 2, 1);
		case 1:
		    /*
		     * 1 to any power is 1.
		     */

		    objResultPtr = TCONST(1);
		    NEXT_INST_F(1, 2, 1);
		case -1:
		    if (oddExponent) {
			TclNewIntObj(objResultPtr, -1);
		    } else {
			objResultPtr = TCONST(1);
		    }
		    NEXT_INST_F(1, 2, 1);
		}
	    }

	    /*
	     * We refuse to accept exponent arguments that exceed one mp_digit
	     * which means the max exponent value is 2**28-1 = 0x0fffffff =
	     * 268435455, which fits into a signed 32 bit int which is within
	     * the range of the long int type. This means any numeric Tcl_Obj
	     * value not using TCL_NUMBER_LONG type must hold a value larger
	     * than we accept.
	     */

	    if (type2 != TCL_NUMBER_LONG) {
		Tcl_SetResult(interp, "exponent too large", TCL_STATIC);
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }

	    if (type1 == TCL_NUMBER_LONG) {
		if (l1 == 2) {
		    /*
		     * Reduce small powers of 2 to shifts.
		     */

		    if ((unsigned long) l2 < CHAR_BIT * sizeof(long) - 1) {
			TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
			TclNewLongObj(objResultPtr, (1L << l2));
			TRACE(("%s\n", O2S(objResultPtr)));
			NEXT_INST_F(1, 2, 1);
		    }
#if !defined(TCL_WIDE_INT_IS_LONG)
		    if ((unsigned long)l2 < CHAR_BIT*sizeof(Tcl_WideInt) - 1){
			TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
			objResultPtr =
				Tcl_NewWideIntObj(((Tcl_WideInt) 1) << l2);
			TRACE(("%s\n", O2S(objResultPtr)));
			NEXT_INST_F(1, 2, 1);
		    }
#endif
		    goto overflow;
		}
		if (l1 == -2) {
		    int signum = oddExponent ? -1 : 1;

		    /*
		     * Reduce small powers of 2 to shifts.
		     */

		    if ((unsigned long) l2 < CHAR_BIT * sizeof(long) - 1) {
			TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
			TclNewLongObj(objResultPtr, signum * (1L << l2));
			TRACE(("%s\n", O2S(objResultPtr)));
			NEXT_INST_F(1, 2, 1);
		    }
#if !defined(TCL_WIDE_INT_IS_LONG)
		    if ((unsigned long)l2 < CHAR_BIT*sizeof(Tcl_WideInt) - 1){
			TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
			objResultPtr = Tcl_NewWideIntObj(
				signum * (((Tcl_WideInt) 1) << l2));
			TRACE(("%s\n", O2S(objResultPtr)));
			NEXT_INST_F(1, 2, 1);
		    }
#endif
		    goto overflow;
		}
#if (LONG_MAX == 0x7fffffff)
		if (l2 - 2 < (long)MaxBase32Size
			&& l1 <= MaxBase32[l2 - 2]
			&& l1 >= -MaxBase32[l2 - 2]) {
		    /*
		     * Small powers of 32-bit integers.
		     */

		    lResult = l1 * l1;		/* b**2 */
		    switch (l2) {
		    case 2:
			break;
		    case 3:
			lResult *= l1;		/* b**3 */
			break;
		    case 4:
			lResult *= lResult;	/* b**4 */
			break;
		    case 5:
			lResult *= lResult;	/* b**4 */
			lResult *= l1;		/* b**5 */
			break;
		    case 6:
			lResult *= l1;		/* b**3 */
			lResult *= lResult;	/* b**6 */
			break;
		    case 7:
			lResult *= l1;		/* b**3 */
			lResult *= lResult;	/* b**6 */
			lResult *= l1;		/* b**7 */
			break;
		    case 8:
			lResult *= lResult;	/* b**4 */
			lResult *= lResult;	/* b**8 */
			break;
		    }
		    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		    if (Tcl_IsShared(valuePtr)) {
			TclNewLongObj(objResultPtr, lResult);
			TRACE(("%s\n", O2S(objResultPtr)));
			NEXT_INST_F(1, 2, 1);
		    }
		    Tcl_SetLongObj(valuePtr, lResult);
		    TRACE(("%s\n", O2S(valuePtr)));
		    NEXT_INST_F(1, 1, 0);
		}

		if (l1 - 3 >= 0 && l1 -2 < (long)Exp32IndexSize
			&& l2 - 2 < (long)(Exp32ValueSize + MaxBase32Size)) {
		    base = Exp32Index[l1 - 3]
			    + (unsigned short) (l2 - 2 - MaxBase32Size);
		    if (base < Exp32Index[l1 - 2]) {
			/*
			 * 32-bit number raised to intermediate power, done by
			 * table lookup.
			 */

			TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
			if (Tcl_IsShared(valuePtr)) {
			    TclNewLongObj(objResultPtr, Exp32Value[base]);
			    TRACE(("%s\n", O2S(objResultPtr)));
			    NEXT_INST_F(1, 2, 1);
			}
			Tcl_SetLongObj(valuePtr, Exp32Value[base]);
			TRACE(("%s\n", O2S(valuePtr)));
			NEXT_INST_F(1, 1, 0);
		    }
		}
		if (-l1 - 3 >= 0 && -l1 - 2 < (long)Exp32IndexSize
			&& l2 - 2 < (long)(Exp32ValueSize + MaxBase32Size)) {
		    base = Exp32Index[-l1 - 3]
			    + (unsigned short) (l2 - 2 - MaxBase32Size);
		    if (base < Exp32Index[-l1 - 2]) {
			/*
			 * 32-bit number raised to intermediate power, done by
			 * table lookup.
			 */

			lResult = (oddExponent) ?
				-Exp32Value[base] : Exp32Value[base];
			TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
			if (Tcl_IsShared(valuePtr)) {
			    TclNewLongObj(objResultPtr, lResult);
			    TRACE(("%s\n", O2S(objResultPtr)));
			    NEXT_INST_F(1, 2, 1);
			}
			Tcl_SetLongObj(valuePtr, lResult);
			TRACE(("%s\n", O2S(valuePtr)));
			NEXT_INST_F(1, 1, 0);
		    }
		}
#endif
	    }
#if (LONG_MAX > 0x7fffffff) || !defined(TCL_WIDE_INT_IS_LONG)
	    if (type1 == TCL_NUMBER_LONG) {
		w1 = l1;
#ifndef NO_WIDE_TYPE
	    } else if (type1 == TCL_NUMBER_WIDE) {
		w1 = *((const Tcl_WideInt *) ptr1);
#endif
	    } else {
		goto overflow;
	    }
	    if (l2 - 2 < (long)MaxBase64Size
		    && w1 <=  MaxBase64[l2 - 2]
		    && w1 >= -MaxBase64[l2 - 2]) {
		/*
		 * Small powers of integers whose result is wide.

		 */

		wResult = w1 * w1;	/* b**2 */
		switch (l2) {
		case 2:
		    break;
		case 3:
		    wResult *= l1;	/* b**3 */
		    break;
		case 4:
		    wResult *= wResult;	/* b**4 */
		    break;
		case 5:
		    wResult *= wResult;	/* b**4 */
		    wResult *= w1;	/* b**5 */
		    break;
		case 6:
		    wResult *= w1;	/* b**3 */
		    wResult *= wResult;	/* b**6 */
		    break;
		case 7:
		    wResult *= w1;	/* b**3 */
		    wResult *= wResult;	/* b**6 */
		    wResult *= w1;	/* b**7 */
		    break;
		case 8:
		    wResult *= wResult;	/* b**4 */
		    wResult *= wResult;	/* b**8 */
		    break;
		case 9:
		    wResult *= wResult;	/* b**4 */
		    wResult *= wResult;	/* b**8 */
		    wResult *= w1;	/* b**9 */
		    break;
		case 10:
		    wResult *= wResult;	/* b**4 */
		    wResult *= w1;	/* b**5 */
		    wResult *= wResult;	/* b**10 */
		    break;
		case 11:
		    wResult *= wResult;	/* b**4 */
		    wResult *= w1;	/* b**5 */
		    wResult *= wResult;	/* b**10 */
		    wResult *= w1;	/* b**11 */
		    break;
		case 12:
		    wResult *= w1;	/* b**3 */
		    wResult *= wResult;	/* b**6 */
		    wResult *= wResult;	/* b**12 */
		    break;
		case 13:
		    wResult *= w1;	/* b**3 */
		    wResult *= wResult;	/* b**6 */
		    wResult *= wResult;	/* b**12 */
		    wResult *= w1;	/* b**13 */
		    break;
		case 14:
		    wResult *= w1;	/* b**3 */
		    wResult *= wResult;	/* b**6 */
		    wResult *= w1;	/* b**7 */
		    wResult *= wResult;	/* b**14 */
		    break;
		case 15:
		    wResult *= w1;	/* b**3 */
		    wResult *= wResult;	/* b**6 */
		    wResult *= w1;	/* b**7 */
		    wResult *= wResult;	/* b**14 */
		    wResult *= w1;	/* b**15 */
		    break;
		case 16:
		    wResult *= wResult;	/* b**4 */
		    wResult *= wResult;	/* b**8 */
		    wResult *= wResult;	/* b**16 */
		    break;
		}
		TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		objResultPtr = Tcl_NewWideIntObj(wResult);
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }

	    /*
	     * Handle cases of powers > 16 that still fit in a 64-bit word by
	     * doing table lookup.
	     */

	    if (w1 - 3 >= 0 && w1 - 2 < (long)Exp64IndexSize
		    && l2 - 2 < (long)(Exp64ValueSize + MaxBase64Size)) {
		base = Exp64Index[w1 - 3]
			+ (unsigned short) (l2 - 2 - MaxBase64Size);
		if (base < Exp64Index[w1 - 2]) {
		    /*
		     * 64-bit number raised to intermediate power, done by
		     * table lookup.
		     */

		    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		    if (Tcl_IsShared(valuePtr)) {
			objResultPtr = Tcl_NewWideIntObj(Exp64Value[base]);
			TRACE(("%s\n", O2S(objResultPtr)));
			NEXT_INST_F(1, 2, 1);
		    }
		    Tcl_SetWideIntObj(valuePtr, Exp64Value[base]);
		    TRACE(("%s\n", O2S(valuePtr)));
		    NEXT_INST_F(1, 1, 0);
		}
	    }

	    if (-w1 - 3 >= 0 && -w1 - 2 < (long)Exp64IndexSize
		    && l2 - 2 < (long)(Exp64ValueSize + MaxBase64Size)) {
		base = Exp64Index[-w1 - 3]
			+ (unsigned short) (l2 - 2 - MaxBase64Size);
		if (base < Exp64Index[-w1 - 2]) {
		    /*
		     * 64-bit number raised to intermediate power, done by
		     * table lookup.
		     */

		    wResult = (oddExponent) ?
			    -Exp64Value[base] : Exp64Value[base];
		    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		    if (Tcl_IsShared(valuePtr)) {
			objResultPtr = Tcl_NewWideIntObj(wResult);
			TRACE(("%s\n", O2S(objResultPtr)));
			NEXT_INST_F(1, 2, 1);
		    }
		    Tcl_SetWideIntObj(valuePtr, wResult);
		    TRACE(("%s\n", O2S(valuePtr)));
		    NEXT_INST_F(1, 1, 0);
		}
	    }
#endif

	    goto overflow;
	}

	if ((*pc != INST_MULT)
		&& (type1 != TCL_NUMBER_BIG) && (type2 != TCL_NUMBER_BIG)) {
	    TclGetWideIntFromObj(NULL, valuePtr, &w1);
	    TclGetWideIntFromObj(NULL, value2Ptr, &w2);

	    switch (*pc) {
	    case INST_ADD:
		wResult = w1 + w2;
#ifndef NO_WIDE_TYPE
		if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE))
#endif
		{
		    /*
		     * Check for overflow.
		     */

		    if (Overflowing(w1, w2, wResult)) {
			goto overflow;
		    }
		}
		break;

	    case INST_SUB:
		wResult = w1 - w2;
#ifndef NO_WIDE_TYPE
		if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE))
#endif
		{
		    /*
		     * Must check for overflow. The macro tests for overflows
		     * in sums by looking at the sign bits. As we have a
		     * subtraction here, we are adding -w2. As -w2 could in
		     * turn overflow, we test with ~w2 instead: it has the
		     * opposite sign bit to w2 so it does the job. Note that
		     * the only "bad" case (w2==0) is irrelevant for this
		     * macro, as in that case w1 and wResult have the same
		     * sign and there is no overflow anyway.
		     */

		    if (Overflowing(w1, ~w2, wResult)) {
			goto overflow;
		    }
		}
		break;

	    case INST_DIV:
		if (w2 == 0) {
		    TRACE(("%s %s => DIVIDE BY ZERO\n",
			    O2S(valuePtr), O2S(value2Ptr)));
		    goto divideByZero;
		}

		/*
		 * Need a bignum to represent (LLONG_MIN / -1)
		 */

		if ((w1 == LLONG_MIN) && (w2 == -1)) {
		    goto overflow;
		}
		wResult = w1 / w2;

		/*
		 * Force Tcl's integer division rules.
		 * TODO: examine for logic simplification
		 */

		if (((wResult < 0) || ((wResult == 0) &&
			((w1 < 0 && w2 > 0) || (w1 > 0 && w2 < 0)))) &&
			((wResult * w2) != w1)) {
		    wResult -= 1;
		}
		break;
	    default:
		/*
		 * Unused, here to silence compiler warning.
		 */








		wResult = 0;

	    }

	    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	    if (Tcl_IsShared(valuePtr)) {
		objResultPtr = Tcl_NewWideIntObj(wResult);
		TRACE(("%s\n", O2S(objResultPtr)));
		NEXT_INST_F(1, 2, 1);
	    }
	    Tcl_SetWideIntObj(valuePtr, wResult);
	    TRACE(("%s\n", O2S(valuePtr)));

	    NEXT_INST_F(1, 1, 0);

	}

    overflow:
	TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	mp_init(&bigResult);
	switch (*pc) {
	case INST_ADD:
	    mp_add(&big1, &big2, &bigResult);
	    break;
	case INST_SUB:
	    mp_sub(&big1, &big2, &bigResult);
	    break;
	case INST_MULT:
	    mp_mul(&big1, &big2, &bigResult);
	    break;
	case INST_DIV:
	    if (mp_iszero(&big2)) {
		TRACE(("%s %s => DIVIDE BY ZERO\n", O2S(valuePtr),
			O2S(value2Ptr)));
		mp_clear(&big1);
		mp_clear(&big2);
		mp_clear(&bigResult);
		goto divideByZero;
	    }
	    mp_init(&bigRemainder);
	    mp_div(&big1, &big2, &bigResult, &bigRemainder);
	    /* TODO: internals intrusion */
	    if (!mp_iszero(&bigRemainder)
		    && (bigRemainder.sign != big2.sign)) {
		/*
		 * Convert to Tcl's integer division rules.
		 */

		mp_sub_d(&bigResult, 1, &bigResult);
		mp_add(&bigRemainder, &big2, &bigRemainder);
	    }
	    mp_clear(&bigRemainder);
	    break;
	case INST_EXPON:
	    if (big2.used > 1) {

		Tcl_SetResult(interp, "exponent too large", TCL_STATIC);
		mp_clear(&big1);
		mp_clear(&big2);
		mp_clear(&bigResult);
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }
	    mp_expt_d(&big1, big2.dp[0], &bigResult);
	    break;
	}
	mp_clear(&big1);
	mp_clear(&big2);
	if (Tcl_IsShared(valuePtr)) {
	    objResultPtr = Tcl_NewBignumObj(&bigResult);


	    TRACE(("%s\n", O2S(objResultPtr)));
	    NEXT_INST_F(1, 2, 1);
	}
	Tcl_SetBignumObj(valuePtr, &bigResult);
	TRACE(("%s\n", O2S(valuePtr)));
	NEXT_INST_F(1, 1, 0);

    case INST_LNOT: {
	int b;

	valuePtr = OBJ_AT_TOS;

	/* TODO - check claim that taking address of b harms performance */
	/* TODO - consider optimization search for constants */
	TRESULT = TclGetBooleanFromObj(NULL, valuePtr, &b);
	if (TRESULT != TCL_OK) {
	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s\n", O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto checkForCatch;
	}
	/* TODO: Consider peephole opt. */
	objResultPtr = TCONST(!b);
	NEXT_INST_F(1, 1, 1);
    }

    case INST_BITNOT:
	valuePtr = OBJ_AT_TOS;
	TRESULT = GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
	if ((TRESULT != TCL_OK) || (type1 == TCL_NUMBER_NAN)
		|| (type1 == TCL_NUMBER_DOUBLE)) {
	    /*
	     * ... ~$NonInteger => raise an error.
	     */

	    TRESULT = TCL_ERROR;
	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto checkForCatch;
	}
	if (type1 == TCL_NUMBER_LONG) {
	    l1 = *((const long *) ptr1);
	    if (Tcl_IsShared(valuePtr)) {
		TclNewLongObj(objResultPtr, ~l1);
		NEXT_INST_F(1, 1, 1);
	    }
	    TclSetLongObj(valuePtr, ~l1);
	    NEXT_INST_F(1, 0, 0);
	}
#ifndef NO_WIDE_TYPE
	if (type1 == TCL_NUMBER_WIDE) {
	    w1 = *((const Tcl_WideInt *) ptr1);
	    if (Tcl_IsShared(valuePtr)) {
		objResultPtr = Tcl_NewWideIntObj(~w1);
		NEXT_INST_F(1, 1, 1);
	    }
	    Tcl_SetWideIntObj(valuePtr, ~w1);
	    NEXT_INST_F(1, 0, 0);
	}
#endif
	Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	/* ~a = - a - 1 */
	mp_neg(&big1, &big1);
	mp_sub_d(&big1, 1, &big1);
	if (Tcl_IsShared(valuePtr)) {
	    objResultPtr = Tcl_NewBignumObj(&big1);
	    NEXT_INST_F(1, 1, 1);
	}
	Tcl_SetBignumObj(valuePtr, &big1);
	NEXT_INST_F(1, 0, 0);

    case INST_UMINUS:
	valuePtr = OBJ_AT_TOS;
	TRESULT = GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
	if ((TRESULT != TCL_OK) || IsErroringNaNType(type1)) {
	    TRESULT = TCL_ERROR;
	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto checkForCatch;
	}
	switch (type1) {
	case TCL_NUMBER_DOUBLE:
	    if (Tcl_IsShared(valuePtr)) {
		TclNewDoubleObj(objResultPtr, -(*((const double *) ptr1)));
		NEXT_INST_F(1, 1, 1);
	    }
	    d1 = *((const double *) ptr1);
	    TclSetDoubleObj(valuePtr, -d1);
	    NEXT_INST_F(1, 0, 0);
	case TCL_NUMBER_LONG:
	    l1 = *((const long *) ptr1);
	    if (l1 != LONG_MIN) {
		if (Tcl_IsShared(valuePtr)) {
		    TclNewLongObj(objResultPtr, -l1);
		    NEXT_INST_F(1, 1, 1);
		}
		TclSetLongObj(valuePtr, -l1);
		NEXT_INST_F(1, 0, 0);
	    }
	    /* FALLTHROUGH */
#ifndef NO_WIDE_TYPE
	case TCL_NUMBER_WIDE:
	    if (type1 == TCL_NUMBER_LONG) {
		w1 = (Tcl_WideInt)(*((const long *) ptr1));
	    } else {
		w1 = *((const Tcl_WideInt *) ptr1);
	    }
	    if (w1 != LLONG_MIN) {
		if (Tcl_IsShared(valuePtr)) {
		    objResultPtr = Tcl_NewWideIntObj(-w1);
		    NEXT_INST_F(1, 1, 1);
		}
		Tcl_SetWideIntObj(valuePtr, -w1);
		NEXT_INST_F(1, 0, 0);
	    }
	    /* FALLTHROUGH */
#endif
	case TCL_NUMBER_BIG:
	    switch (type1) {
#ifdef NO_WIDE_TYPE
	    case TCL_NUMBER_LONG:
		TclBNInitBignumFromLong(&big1, *(const long *) ptr1);
		break;
#else
	    case TCL_NUMBER_WIDE:
		TclBNInitBignumFromWideInt(&big1, *(const Tcl_WideInt *)ptr1);
		break;
#endif
	    case TCL_NUMBER_BIG:
		Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	    }
	    mp_neg(&big1, &big1);
	    if (Tcl_IsShared(valuePtr)) {
		objResultPtr = Tcl_NewBignumObj(&big1);
		NEXT_INST_F(1, 1, 1);
	    }
	    Tcl_SetBignumObj(valuePtr, &big1);
	    NEXT_INST_F(1, 0, 0);
	case TCL_NUMBER_NAN:
	    /* -NaN => NaN */
	    NEXT_INST_F(1, 0, 0);
	}

    case INST_UPLUS:
    case INST_TRY_CVT_TO_NUMERIC:
	/*
	 * Try to convert the topmost stack object to numeric object. This is
	 * done in order to support [expr]'s policy of interpreting operands
	 * if at all possible as numbers first, then strings.
	 */

	valuePtr = OBJ_AT_TOS;

	if (GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK) {
	    if (*pc == INST_UPLUS) {
		/*
		 * ... +$NonNumeric => raise an error.
		 */

		TRESULT = TCL_ERROR;
		TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
			(valuePtr->typePtr? valuePtr->typePtr->name:"null")));
		IllegalExprOperandType(interp, pc, valuePtr);
		goto checkForCatch;
	    }

	    /* ... TryConvertToNumeric($NonNumeric) is acceptable */
	    TRACE(("\"%.20s\" => not numeric\n", O2S(valuePtr)));
	    NEXT_INST_F(1, 0, 0);
	}
	if (IsErroringNaNType(type1)) {
	    TRESULT = TCL_ERROR;
	    if (*pc == INST_UPLUS) {
		/*
		 * ... +$NonNumeric => raise an error.
		 */

		TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
			(valuePtr->typePtr? valuePtr->typePtr->name:"null")));
		IllegalExprOperandType(interp, pc, valuePtr);
	    } else {
		/*
		 * Numeric conversion of NaN -> error.
		 */

		TRACE(("\"%.20s\" => IEEE FLOATING PT ERROR\n",
			O2S(objResultPtr)));
		TclExprFloatError(interp, *((const double *) ptr1));
	    }
	    goto checkForCatch;
	}

	/*
	 * Ensure that the numeric value has a string rep the same as the
	 * formatted version of its internal rep. This is used, e.g., to make
	 * sure that "expr {0001}" yields "1", not "0001". We implement this
	 * by _discarding_ the string rep since we know it will be







|
|
|
|



|
<
|
<




|


|
<
|
<




|


<
>
|
>

<
|
>
|
>
>
>




<
|




>



<
<
<
<
|




>



<
<
<
<
<
|
|






|

|
|

|
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
|
<
|
<
|
<
<
<
<
|
>
>
|
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
|
<
|
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|
|

<
|
<
|
<
|
<
<
>
>
|
|

<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

|
|
|

<
<
|
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
|
<
<
<
<
<
<
<
<
<
<
|
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
|
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
>
|
|
<
>
|
|
<
<
<
|
<
<
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









|
|
<




|












|
|
<




|













<
|
<
>
|
|

>
|
|
>
>



|
<
<
|
<
<
|
<
<
|
<
<
<
<
<

<
<
<
>

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

|
<
<
<
<
|
|

<
<
<
<
<
<
<
<
<
<
|
<
<
<
<

|
<
|
<
|
|
>
>
>
>
>
>
>
>
|
<
>
|
|
<
<
<
<
|
<
<
<
<
|
<
|
>
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
|
<
<
<
<
<
|
<
>
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






|
|
|
|

<
|
<
<
<

>
>
>
>
>
>
>
|
>
|
|
<
<
<
<
<
|
<
<
>
|
>




|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
|
<
<
|
<
<
<
<
<
<
|
<
<
<
|
<
<
|
>
|
<
<
<
<
|
<
|
<
<
<
<
|
<
>
>
|


<
<
<








|
<



|






|

|
<
|




<



|










<
<
<
|
|
|
|
<


<
<
<
<
<
<
<
<
|
<
<
<


|
|
<



|


|
|
<
<
<
<
<












<
<
<
<
<
<
|
<
|
|
|
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



















<



|







<

















|







4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997

4998

4999
5000
5001
5002
5003
5004
5005
5006

5007

5008
5009
5010
5011
5012
5013
5014

5015
5016
5017
5018

5019
5020
5021
5022
5023
5024
5025
5026
5027
5028

5029
5030
5031
5032
5033
5034
5035
5036
5037




5038
5039
5040
5041
5042
5043
5044
5045
5046





5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060




5061





5062











































































































5063











5064





5065

5066

5067




5068
5069
5070
5071


5072














5073



5074

5075
5076
5077
5078


























































5079
5080
5081
5082
5083

5084

5085

5086


5087
5088
5089
5090
5091

5092


















5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147


5148











5149




5150
















5151

5152










5153

5154






























5155


















5156



5157

















5158




























5159

5160








5161
























































5162





























5163





























5164

5165
5166
5167

5168
5169
5170



5171


5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217

5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236

5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254

5255

5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268


5269


5270


5271





5272



5273
5274



















5275
5276




5277
5278
5279










5280




5281
5282

5283

5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294

5295
5296
5297




5298




5299

5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312








5313















































5314




































































































































































































5315










5316








5317





5318

5319
5320














































































5321





















































5322
5323








5324




















































5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335

5336



5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348





5349


5350
5351
5352
5353
5354
5355
5356
5357
5358
5359












5360




5361


5362






5363



5364


5365
5366
5367




5368

5369




5370

5371
5372
5373
5374
5375



5376
5377
5378
5379
5380
5381
5382
5383
5384

5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397

5398
5399
5400
5401
5402

5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416



5417
5418
5419
5420

5421
5422








5423



5424
5425
5426
5427

5428
5429
5430
5431
5432
5433
5434
5435





5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447






5448

5449
5450
5451












5452
















5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471

5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482

5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
#endif
	objResultPtr = TCONST(iResult);
	NEXT_INST_F(0, 2, 1);
    }

    case INST_MOD:
    case INST_LSHIFT:
    case INST_RSHIFT:
    case INST_BITOR:
    case INST_BITXOR:
    case INST_BITAND:
	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	if ((GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK)

		|| (type1==TCL_NUMBER_DOUBLE) || (type1==TCL_NUMBER_NAN)) {

	    TRACE(("%.20s %.20s => ILLEGAL 1st TYPE %s\n", O2S(valuePtr),
		    O2S(value2Ptr), (valuePtr->typePtr?
		    valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto gotError;
	}

	if ((GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2) != TCL_OK)

		|| (type2==TCL_NUMBER_DOUBLE) || (type2==TCL_NUMBER_NAN)) {

	    TRACE(("%.20s %.20s => ILLEGAL 2nd TYPE %s\n", O2S(valuePtr),
		    O2S(value2Ptr), (value2Ptr->typePtr?
		    value2Ptr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, value2Ptr);
	    goto gotError;
	}


	/*
	 * Check for common, simple case.
	 */


	if ((type1 == TCL_NUMBER_LONG) && (type2 == TCL_NUMBER_LONG)) {
	    l1 = *((const long *)ptr1);
	    l2 = *((const long *)ptr2);

	    switch (*pc) {
	    case INST_MOD:
		if (l2 == 0) {
		    TRACE(("%s %s => DIVIDE BY ZERO\n", O2S(valuePtr),
			    O2S(value2Ptr)));
		    goto divideByZero;

		} else if ((l2 == 1) || (l2 == -1)) {
		    /*
		     * Div. by |1| always yields remainder of 0.
		     */

		    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		    objResultPtr = TCONST(0);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);




		} else if (l1 == 0) {
		    /*
		     * 0 % (non-zero) always yields remainder of 0.
		     */

		    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		    objResultPtr = TCONST(0);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);





		} else {
		    lResult = l1 / l2;

		    /*
		     * Force Tcl's integer division rules.
		     * TODO: examine for logic simplification
		     */

		    if ((lResult < 0 || (lResult == 0 &&
			    ((l1 < 0 && l2 > 0) || (l1 > 0 && l2 < 0)))) &&
			    (lResult * l2 != l1)) {
			lResult -= 1;
		    }
		    lResult = l1 - l2*lResult;




		    goto longResultOfArithmetic;





		}























































































































	    case INST_RSHIFT:





		if (l2 < 0) {

		    Tcl_SetResult(interp, "negative shift argument",

			    TCL_STATIC);




#if 0
		    Tcl_SetErrorCode(interp, "ARITH", "DOMAIN",
			    "domain error: argument not in valid range",
			    NULL);


#endif














		    goto gotError;



		} else if (l1 == 0) {

		    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		    objResultPtr = TCONST(0);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);


























































		} else {
		    /*
		     * Quickly force large right shifts to 0 or -1.
		     */


		    if (l2 >= (long)(CHAR_BIT*sizeof(long))) {

			/*

			 * We assume that INT_MAX is much larger than the


			 * number of bits in a long. This is a pretty safe
			 * assumption, given that the former is usually around
			 * 4e9 and the latter 32 or 64...
			 */


			TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));


















			if (l1 > 0L) {
			    objResultPtr = TCONST(0);
			} else {
			    TclNewIntObj(objResultPtr, -1);
			}
			TRACE(("%s\n", O2S(objResultPtr)));
			NEXT_INST_F(1, 2, 1);
		    }

		    /*
		     * Handle shifts within the native long range.
		     */

		    lResult = l1 >> ((int) l2);
		    goto longResultOfArithmetic;
		}

	    case INST_LSHIFT:
		if (l2 < 0) {
		    Tcl_SetResult(interp, "negative shift argument",
			    TCL_STATIC);
#if 0
		    Tcl_SetErrorCode(interp, "ARITH", "DOMAIN",
			    "domain error: argument not in valid range",
			    NULL);
#endif
		    goto gotError;
		} else if (l1 == 0) {
		    TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		    objResultPtr = TCONST(0);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		} else if (l2 > (long) INT_MAX) {
		    /*
		     * Technically, we could hold the value (1 << (INT_MAX+1))
		     * in an mp_int, but since we're using mp_mul_2d() to do
		     * the work, and it takes only an int argument, that's a
		     * good place to draw the line.
		     */

		    Tcl_SetResult(interp,
			    "integer value too large to represent",
			    TCL_STATIC);
#if 0
		    Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW",
			    "integer value too large to represent", NULL);
#endif
		    goto gotError;
		} else {
		    int shift = (int) l2;

		    /*
		     * Handle shifts within the native long range.
		     */



		    if ((size_t) shift < CHAR_BIT*sizeof(long) && (l1 != 0)











			    && !((l1>0 ? l1 : ~l1) &




				-(1L<<(CHAR_BIT*sizeof(long) - 1 - shift)))) {
















			lResult = l1 << shift;

			goto longResultOfArithmetic;










		    }

		}

















































		/*



		 * Too large; need to use the broken-out function.

















		 */






























		TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));








		break;






















































































	    case INST_BITAND:





























		lResult = l1 & l2;

		goto longResultOfArithmetic;
	    case INST_BITOR:
		lResult = l1 | l2;

		goto longResultOfArithmetic;
	    case INST_BITXOR:
		lResult = l1 ^ l2;



	    longResultOfArithmetic:


		TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		if (Tcl_IsShared(valuePtr)) {
		    TclNewLongObj(objResultPtr, lResult);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		}
		TclSetLongObj(valuePtr, lResult);
		TRACE(("%s\n", O2S(valuePtr)));
		NEXT_INST_F(1, 1, 0);
	    }
	}

	/*
	 * DO NOT MERGE THIS WITH THE EQUIVALENT SECTION LATER! That would
	 * encourage the compiler to inline ExecuteExtendedBinaryMathOp, which
	 * is highly undesirable due to the overall impact on size.
	 */

	TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	objResultPtr = ExecuteExtendedBinaryMathOp(interp, *pc, &TCONST(0),
		valuePtr, value2Ptr);
	if (objResultPtr == DIVIDED_BY_ZERO) {
	    TRACE_APPEND(("DIVIDE BY ZERO\n"));
	    goto divideByZero;
	} else if (objResultPtr == GENERAL_ARITHMETIC_ERROR) {
	    TRACE_APPEND(("ERROR: %s\n",
		    TclGetString(Tcl_GetObjResult(interp))));
	    goto gotError;
	} else if (objResultPtr == NULL) {
	    TRACE_APPEND(("%s\n", O2S(valuePtr)));
	    NEXT_INST_F(1, 1, 0);
	} else {
	    TRACE_APPEND(("%s\n", O2S(objResultPtr)));
	    NEXT_INST_F(1, 2, 1);
	}

    case INST_EXPON:
    case INST_ADD:
    case INST_SUB:
    case INST_DIV:
    case INST_MULT:
	value2Ptr = OBJ_AT_TOS;
	valuePtr = OBJ_UNDER_TOS;

	if ((GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK)
		|| IsErroringNaNType(type1)) {

	    TRACE(("%.20s %.20s => ILLEGAL 1st TYPE %s\n",
		    O2S(value2Ptr), O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name: "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto gotError;
	}

#ifdef ACCEPT_NAN
	if (type1 == TCL_NUMBER_NAN) {
	    /*
	     * NaN first argument -> result is also NaN.
	     */

	    NEXT_INST_F(1, 1, 0);
	}
#endif

	if ((GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2) != TCL_OK)
		|| IsErroringNaNType(type2)) {

	    TRACE(("%.20s %.20s => ILLEGAL 2nd TYPE %s\n",
		    O2S(value2Ptr), O2S(valuePtr),
		    (value2Ptr->typePtr? value2Ptr->typePtr->name: "null")));
	    IllegalExprOperandType(interp, pc, value2Ptr);
	    goto gotError;
	}

#ifdef ACCEPT_NAN
	if (type2 == TCL_NUMBER_NAN) {
	    /*
	     * NaN second argument -> result is also NaN.
	     */

	    objResultPtr = value2Ptr;
	    NEXT_INST_F(1, 2, 1);
	}
#endif


	/*

	 * Handle (long,long) arithmetic as best we can without going out to
	 * an external function.
	 */

	if ((type1 == TCL_NUMBER_LONG) && (type2 == TCL_NUMBER_LONG)) {
	    Tcl_WideInt w1, w2, wResult;

	    l1 = *((const long *)ptr1);
	    l2 = *((const long *)ptr2);

	    switch (*pc) {
	    case INST_ADD:
		w1 = (Tcl_WideInt) l1;


		w2 = (Tcl_WideInt) l2;


		wResult = w1 + w2;


#ifdef NO_WIDE_TYPE





		/*



		 * Check for overflow.
		 */




















		if (Overflowing(w1, w2, wResult)) {




		    goto overflow;
		}
#endif










		goto wideResultOfArithmetic;





	    case INST_SUB:

		w1 = (Tcl_WideInt) l1;

		w2 = (Tcl_WideInt) l2;
		wResult = w1 - w2;
#ifdef NO_WIDE_TYPE
		/*
		 * Must check for overflow. The macro tests for overflows in
		 * sums by looking at the sign bits. As we have a subtraction
		 * here, we are adding -w2. As -w2 could in turn overflow, we
		 * test with ~w2 instead: it has the opposite sign bit to w2
		 * so it does the job. Note that the only "bad" case (w2==0)
		 * is irrelevant for this macro, as in that case w1 and
		 * wResult have the same sign and there is no overflow anyway.

		 */

		if (Overflowing(w1, ~w2, wResult)) {




		    goto overflow;




		}

#endif
	    wideResultOfArithmetic:
		TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
		if (Tcl_IsShared(valuePtr)) {
		    objResultPtr = Tcl_NewWideIntObj(wResult);
		    TRACE(("%s\n", O2S(objResultPtr)));
		    NEXT_INST_F(1, 2, 1);
		}
		Tcl_SetWideIntObj(valuePtr, wResult);
		TRACE(("%s\n", O2S(valuePtr)));
		NEXT_INST_F(1, 1, 0);

	    case INST_DIV:








		if (l2 == 0) {















































		    TRACE(("%s %s => DIVIDE BY ZERO\n",




































































































































































































			    O2S(valuePtr), O2S(value2Ptr)));










		    goto divideByZero;








		} else if ((l1 == LONG_MIN) && (l2 == -1)) {





		    /*

		     * Can't represent (-LONG_MIN) as a long.
		     */




































































































































		    goto overflow;
		}








		lResult = l1 / l2;





















































		/*
		 * Force Tcl's integer division rules.
		 * TODO: examine for logic simplification
		 */

		if (((lResult < 0) || ((lResult == 0) &&
			((l1 < 0 && l2 > 0) || (l1 > 0 && l2 < 0)))) &&
			((lResult * l2) != l1)) {
		    lResult -= 1;
		}

		goto longResultOfArithmetic;




	    case INST_MULT:
		if (((sizeof(long) >= 2*sizeof(int))
			&& (l1 <= INT_MAX) && (l1 >= INT_MIN)
			&& (l2 <= INT_MAX) && (l2 >= INT_MIN))
			|| ((sizeof(long) >= 2*sizeof(short))
			&& (l1 <= SHRT_MAX) && (l1 >= SHRT_MIN)
			&& (l2 <= SHRT_MAX) && (l2 >= SHRT_MIN))) {
		    lResult = l1 * l2;
		    goto longResultOfArithmetic;
		}
	    }








	    /*
	     * Fall through with INST_EXPON, INST_DIV and large multiplies.
	     */
	}

    overflow:
	TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
	objResultPtr = ExecuteExtendedBinaryMathOp(interp, *pc, &TCONST(0),
		valuePtr, value2Ptr);
	if (objResultPtr == DIVIDED_BY_ZERO) {












	    TRACE_APPEND(("DIVIDE BY ZERO\n"));




	    goto divideByZero;


	} else if (objResultPtr == EXPONENT_OF_ZERO) {






	    TRACE_APPEND(("EXPONENT OF ZERO\n"));



	    goto exponOfZero;


	} else if (objResultPtr == GENERAL_ARITHMETIC_ERROR) {
	    TRACE_APPEND(("ERROR: %s\n",
		    TclGetString(Tcl_GetObjResult(interp))));




	    goto gotError;

	} else if (objResultPtr == NULL) {




	    TRACE_APPEND(("%s\n", O2S(valuePtr)));

	    NEXT_INST_F(1, 1, 0);
	} else {
	    TRACE_APPEND(("%s\n", O2S(objResultPtr)));
	    NEXT_INST_F(1, 2, 1);
	}




    case INST_LNOT: {
	int b;

	valuePtr = OBJ_AT_TOS;

	/* TODO - check claim that taking address of b harms performance */
	/* TODO - consider optimization search for constants */
	if (TclGetBooleanFromObj(NULL, valuePtr, &b) != TCL_OK) {

	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s\n", O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto gotError;
	}
	/* TODO: Consider peephole opt. */
	objResultPtr = TCONST(!b);
	NEXT_INST_F(1, 1, 1);
    }

   case INST_BITNOT:
	valuePtr = OBJ_AT_TOS;
	if ((GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK)

		|| (type1==TCL_NUMBER_NAN) || (type1==TCL_NUMBER_DOUBLE)) {
	    /*
	     * ... ~$NonInteger => raise an error.
	     */


	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto gotError;
	}
	if (type1 == TCL_NUMBER_LONG) {
	    l1 = *((const long *) ptr1);
	    if (Tcl_IsShared(valuePtr)) {
		TclNewLongObj(objResultPtr, ~l1);
		NEXT_INST_F(1, 1, 1);
	    }
	    TclSetLongObj(valuePtr, ~l1);
	    NEXT_INST_F(1, 0, 0);
	}



	objResultPtr = ExecuteExtendedUnaryMathOp(*pc, valuePtr);
	if (objResultPtr != NULL) {
	    NEXT_INST_F(1, 1, 1);
	} else {

	    NEXT_INST_F(1, 0, 0);
	}












    case INST_UMINUS:
	valuePtr = OBJ_AT_TOS;
	if ((GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK)
		|| IsErroringNaNType(type1)) {

	    TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
		    (valuePtr->typePtr? valuePtr->typePtr->name : "null")));
	    IllegalExprOperandType(interp, pc, valuePtr);
	    goto gotError;
	}
	switch (type1) {
	case TCL_NUMBER_NAN:
	    /* -NaN => NaN */





	    NEXT_INST_F(1, 0, 0);
	case TCL_NUMBER_LONG:
	    l1 = *((const long *) ptr1);
	    if (l1 != LONG_MIN) {
		if (Tcl_IsShared(valuePtr)) {
		    TclNewLongObj(objResultPtr, -l1);
		    NEXT_INST_F(1, 1, 1);
		}
		TclSetLongObj(valuePtr, -l1);
		NEXT_INST_F(1, 0, 0);
	    }
	    /* FALLTHROUGH */






	}

	objResultPtr = ExecuteExtendedUnaryMathOp(*pc, valuePtr);
	if (objResultPtr != NULL) {
	    NEXT_INST_F(1, 1, 1);












	} else {
















	    NEXT_INST_F(1, 0, 0);
	}

    case INST_UPLUS:
    case INST_TRY_CVT_TO_NUMERIC:
	/*
	 * Try to convert the topmost stack object to numeric object. This is
	 * done in order to support [expr]'s policy of interpreting operands
	 * if at all possible as numbers first, then strings.
	 */

	valuePtr = OBJ_AT_TOS;

	if (GetNumberFromObj(NULL, valuePtr, &ptr1, &type1) != TCL_OK) {
	    if (*pc == INST_UPLUS) {
		/*
		 * ... +$NonNumeric => raise an error.
		 */


		TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
			(valuePtr->typePtr? valuePtr->typePtr->name:"null")));
		IllegalExprOperandType(interp, pc, valuePtr);
		goto gotError;
	    }

	    /* ... TryConvertToNumeric($NonNumeric) is acceptable */
	    TRACE(("\"%.20s\" => not numeric\n", O2S(valuePtr)));
	    NEXT_INST_F(1, 0, 0);
	}
	if (IsErroringNaNType(type1)) {

	    if (*pc == INST_UPLUS) {
		/*
		 * ... +$NonNumeric => raise an error.
		 */

		TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr),
			(valuePtr->typePtr? valuePtr->typePtr->name:"null")));
		IllegalExprOperandType(interp, pc, valuePtr);
	    } else {
		/*
		 * Numeric conversion of NaN -> error.
		 */

		TRACE(("\"%.20s\" => IEEE FLOATING PT ERROR\n",
			O2S(objResultPtr)));
		TclExprFloatError(interp, *((const double *) ptr1));
	    }
	    goto gotError;
	}

	/*
	 * Ensure that the numeric value has a string rep the same as the
	 * formatted version of its internal rep. This is used, e.g., to make
	 * sure that "expr {0001}" yields "1", not "0001". We implement this
	 * by _discarding_ the string rep since we know it will be
6968
6969
6970
6971
6972
6973
6974









6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
	Tcl_ResetResult(interp);
	CACHE_STACK_INFO();
	*/
	TRESULT = TCL_CONTINUE;
	cleanup = 0;
	goto processExceptionReturn;










    case INST_FOREACH_START4: {
	/*
	 * Initialize the temporary local var that holds the count of the
	 * number of iterations of the loop body to -1.
	 */

	int iterTmpIndex;
	ForeachInfo *infoPtr;
	Var *iterVarPtr;
	Tcl_Obj *oldValuePtr;

	opnd = TclGetUInt4AtPtr(pc+1);
	infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
	iterTmpIndex = infoPtr->loopCtTemp;
	iterVarPtr = LOCAL(iterTmpIndex);
	oldValuePtr = iterVarPtr->value.objPtr;

	if (oldValuePtr == NULL) {







>
>
>
>
>
>
>
>
>
|





<
<
<
<
<







5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575





5576
5577
5578
5579
5580
5581
5582
	Tcl_ResetResult(interp);
	CACHE_STACK_INFO();
	*/
	TRESULT = TCL_CONTINUE;
	cleanup = 0;
	goto processExceptionReturn;

    {
	ForeachInfo *infoPtr;
	Var *iterVarPtr, *listVarPtr;
	Tcl_Obj *oldValuePtr, *listPtr, **elements;
	ForeachVarList *varListPtr;
	int numLists, iterNum, listTmpIndex, listLen, numVars;
	int varIndex, valIndex, continueLoop, j, iterTmpIndex;
	long i;

    case INST_FOREACH_START4:
	/*
	 * Initialize the temporary local var that holds the count of the
	 * number of iterations of the loop body to -1.
	 */






	opnd = TclGetUInt4AtPtr(pc+1);
	infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
	iterTmpIndex = infoPtr->loopCtTemp;
	iterVarPtr = LOCAL(iterTmpIndex);
	oldValuePtr = iterVarPtr->value.objPtr;

	if (oldValuePtr == NULL) {
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055



7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
	 */

	pc += 5;
	TCL_DTRACE_INST_NEXT();
#else
	NEXT_INST_F(5, 0, 0);
#endif
    }

    case INST_FOREACH_STEP4: {
	/*
	 * "Step" a foreach loop (i.e., begin its next iteration) by assigning
	 * the next value list element to each loop var.
	 */

	ForeachInfo *infoPtr;
	ForeachVarList *varListPtr;
	Tcl_Obj *listPtr, **elements;
	Var *iterVarPtr, *listVarPtr;
	int numLists, iterNum, listTmpIndex, listLen, numVars;
	int varIndex, valIndex, continueLoop, j;
	long i;

	opnd = TclGetUInt4AtPtr(pc+1);
	infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
	numLists = infoPtr->numLists;

	/*
	 * Increment the temp holding the loop iteration number.
	 */

	iterVarPtr = LOCAL(infoPtr->loopCtTemp);
	valuePtr = iterVarPtr->value.objPtr;
	iterNum = (valuePtr->internalRep.longValue + 1);
	TclSetLongObj(valuePtr, iterNum);

	/*
	 * Check whether all value lists are exhausted and we should stop the
	 * loop.
	 */

	continueLoop = 0;
	listTmpIndex = infoPtr->firstValueTemp;
	for (i = 0;  i < numLists;  i++) {
	    varListPtr = infoPtr->varLists[i];
	    numVars = varListPtr->numVars;

	    listVarPtr = LOCAL(listTmpIndex);
	    listPtr = listVarPtr->value.objPtr;
	    TRESULT = TclListObjLength(interp, listPtr, &listLen);
	    if (TRESULT == TCL_OK) {



		if (listLen > (iterNum * numVars)) {
		    continueLoop = 1;
		}
		listTmpIndex++;
	    } else {
		TRACE_WITH_OBJ(("%u => ERROR converting list %ld, \"%s\": ",
			opnd, i, O2S(listPtr)), Tcl_GetObjResult(interp));
		goto checkForCatch;
	    }
	}

	/*
	 * If some var in some var list still has a remaining list element
	 * iterate one more time. Assign to var the next element from its
	 * value list. We already checked above that each list temp holds a
	 * valid list object (by calling Tcl_ListObjLength), but cannot rely







|
<
|





<
<
<
<
<
<
<
<










|















|
|
>
>
>
|
|
|
|
<
<
<
<
<







5595
5596
5597
5598
5599
5600
5601
5602

5603
5604
5605
5606
5607
5608








5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643





5644
5645
5646
5647
5648
5649
5650
	 */

	pc += 5;
	TCL_DTRACE_INST_NEXT();
#else
	NEXT_INST_F(5, 0, 0);
#endif


    case INST_FOREACH_STEP4:
	/*
	 * "Step" a foreach loop (i.e., begin its next iteration) by assigning
	 * the next value list element to each loop var.
	 */









	opnd = TclGetUInt4AtPtr(pc+1);
	infoPtr = codePtr->auxDataArrayPtr[opnd].clientData;
	numLists = infoPtr->numLists;

	/*
	 * Increment the temp holding the loop iteration number.
	 */

	iterVarPtr = LOCAL(infoPtr->loopCtTemp);
	valuePtr = iterVarPtr->value.objPtr;
	iterNum = valuePtr->internalRep.longValue + 1;
	TclSetLongObj(valuePtr, iterNum);

	/*
	 * Check whether all value lists are exhausted and we should stop the
	 * loop.
	 */

	continueLoop = 0;
	listTmpIndex = infoPtr->firstValueTemp;
	for (i = 0;  i < numLists;  i++) {
	    varListPtr = infoPtr->varLists[i];
	    numVars = varListPtr->numVars;

	    listVarPtr = LOCAL(listTmpIndex);
	    listPtr = listVarPtr->value.objPtr;
	    if (TclListObjLength(interp, listPtr, &listLen) != TCL_OK) {
		TRACE_WITH_OBJ(("%u => ERROR converting list %ld, \"%s\": ",
			opnd, i, O2S(listPtr)), Tcl_GetObjResult(interp));
		goto gotError;
	    }
	    if (listLen > iterNum * numVars) {
		continueLoop = 1;
	    }
	    listTmpIndex++;





	}

	/*
	 * If some var in some var list still has a remaining list element
	 * iterate one more time. Assign to var the next element from its
	 * value list. We already checked above that each list temp holds a
	 * valid list object (by calling Tcl_ListObjLength), but cannot rely
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120

7121
7122
7123
7124
7125
7126
7127
				TclDecrRefCount(value2Ptr);
			    }
			    varPtr->value.objPtr = valuePtr;
			    Tcl_IncrRefCount(valuePtr);
			}
		    } else {
			DECACHE_STACK_INFO();
			value2Ptr = TclPtrSetVar(interp, varPtr, NULL, NULL,
				NULL, valuePtr, TCL_LEAVE_ERR_MSG, varIndex);
			CACHE_STACK_INFO();
			if (value2Ptr == NULL) {
			    TRACE_WITH_OBJ((
				    "%u => ERROR init. index temp %d: ",
				    opnd,varIndex), Tcl_GetObjResult(interp));
			    TRESULT = TCL_ERROR;
			    TclDecrRefCount(listPtr);
			    goto checkForCatch;
			}

		    }
		    valIndex++;
		}
		TclDecrRefCount(listPtr);
		listTmpIndex++;
	    }
	}







|
|
|
<



<

|

>







5682
5683
5684
5685
5686
5687
5688
5689
5690
5691

5692
5693
5694

5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
				TclDecrRefCount(value2Ptr);
			    }
			    varPtr->value.objPtr = valuePtr;
			    Tcl_IncrRefCount(valuePtr);
			}
		    } else {
			DECACHE_STACK_INFO();
			if (TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
				valuePtr, TCL_LEAVE_ERR_MSG, varIndex)==NULL){
			    CACHE_STACK_INFO();

			    TRACE_WITH_OBJ((
				    "%u => ERROR init. index temp %d: ",
				    opnd,varIndex), Tcl_GetObjResult(interp));

			    TclDecrRefCount(listPtr);
			    goto gotError;
			}
			CACHE_STACK_INFO();
		    }
		    valIndex++;
		}
		TclDecrRefCount(listPtr);
		listTmpIndex++;
	    }
	}
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231

7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244


7245

7246
7247
7248
7249
7250
7251
7252
7253
7254
	    dictPtr = TclTraceDictPath(interp, dictPtr, opnd-1,
		    &OBJ_AT_DEPTH(opnd-1), DICT_PATH_READ);
	    if (dictPtr == NULL) {
		TRACE_WITH_OBJ((
			"%u => ERROR tracing dictionary path into \"%s\": ",
			opnd, O2S(OBJ_AT_DEPTH(opnd))),
			Tcl_GetObjResult(interp));
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }
	}
	TRESULT = Tcl_DictObjGet(interp, dictPtr, OBJ_AT_TOS, &objResultPtr);

	if ((TRESULT == TCL_OK) && objResultPtr) {
	    TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	    NEXT_INST_V(5, opnd+1, 1);
	}
	if (TRESULT != TCL_OK) {
	    TRACE_WITH_OBJ((
		    "%u => ERROR reading leaf dictionary key \"%s\": ",
		    opnd, O2S(dictPtr)), Tcl_GetObjResult(interp));
	} else {
		Tcl_ResetResult(interp);
	    Tcl_AppendResult(interp, "key \"", TclGetString(OBJ_AT_TOS),
		    "\" not known in dictionary", NULL);
	    TRACE_WITH_OBJ(("%u => ERROR ", opnd), Tcl_GetObjResult(interp));


	    TRESULT = TCL_ERROR;

	}
	goto checkForCatch;

    case INST_DICT_SET:
    case INST_DICT_UNSET:
    case INST_DICT_INCR_IMM:
	opnd = TclGetUInt4AtPtr(pc+1);
	opnd2 = TclGetUInt4AtPtr(pc+5);








<
|


|
>
|
|
|
|
<
<
<
<
<
|



>
>
|
>

|







5798
5799
5800
5801
5802
5803
5804

5805
5806
5807
5808
5809
5810
5811
5812
5813





5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
	    dictPtr = TclTraceDictPath(interp, dictPtr, opnd-1,
		    &OBJ_AT_DEPTH(opnd-1), DICT_PATH_READ);
	    if (dictPtr == NULL) {
		TRACE_WITH_OBJ((
			"%u => ERROR tracing dictionary path into \"%s\": ",
			opnd, O2S(OBJ_AT_DEPTH(opnd))),
			Tcl_GetObjResult(interp));

		goto gotError;
	    }
	}
	if (Tcl_DictObjGet(interp, dictPtr, OBJ_AT_TOS,
		&objResultPtr) == TCL_OK) {
	    if (objResultPtr) {
		TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
		NEXT_INST_V(5, opnd+1, 1);
	    }





	    Tcl_ResetResult(interp);
	    Tcl_AppendResult(interp, "key \"", TclGetString(OBJ_AT_TOS),
		    "\" not known in dictionary", NULL);
	    TRACE_WITH_OBJ(("%u => ERROR ", opnd), Tcl_GetObjResult(interp));
	} else {
	    TRACE_WITH_OBJ((
		    "%u => ERROR reading leaf dictionary key \"%s\": ",
		    opnd, O2S(dictPtr)), Tcl_GetObjResult(interp));
	}
	goto gotError;

    case INST_DICT_SET:
    case INST_DICT_UNSET:
    case INST_DICT_INCR_IMM:
	opnd = TclGetUInt4AtPtr(pc+1);
	opnd2 = TclGetUInt4AtPtr(pc+5);

7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
	    objResultPtr = TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
		    dictPtr, TCL_LEAVE_ERR_MSG, opnd2);
	    CACHE_STACK_INFO();
	    TclDecrRefCount(dictPtr);
	    if (objResultPtr == NULL) {
		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }
	}
#ifndef TCL_COMPILE_DEBUG
	if (*(pc+9) == INST_POP) {
	    NEXT_INST_V(10, cleanup, 0);
	}
#endif
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	NEXT_INST_V(9, cleanup, 1);

    case INST_DICT_APPEND:
    case INST_DICT_LAPPEND:
	opnd = TclGetUInt4AtPtr(pc+1);

	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	TRACE(("%u => ", opnd));
	if (TclIsVarDirectReadable(varPtr)) {
	    dictPtr = varPtr->value.objPtr;







<
|













<







5914
5915
5916
5917
5918
5919
5920

5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934

5935
5936
5937
5938
5939
5940
5941
	    objResultPtr = TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
		    dictPtr, TCL_LEAVE_ERR_MSG, opnd2);
	    CACHE_STACK_INFO();
	    TclDecrRefCount(dictPtr);
	    if (objResultPtr == NULL) {
		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));

		goto gotError;
	    }
	}
#ifndef TCL_COMPILE_DEBUG
	if (*(pc+9) == INST_POP) {
	    NEXT_INST_V(10, cleanup, 0);
	}
#endif
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	NEXT_INST_V(9, cleanup, 1);

    case INST_DICT_APPEND:
    case INST_DICT_LAPPEND:
	opnd = TclGetUInt4AtPtr(pc+1);

	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	TRACE(("%u => ", opnd));
	if (TclIsVarDirectReadable(varPtr)) {
	    dictPtr = varPtr->value.objPtr;
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403


7404
7405
7406
7407
7408
7409
7410
7411
7412
7413

7414
7415
7416
7417
7418
7419
7420

7421
7422
7423



7424
7425
7426
7427
7428
7429
7430
7431
7432

7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
	} else {
	    allocateDict = Tcl_IsShared(dictPtr);
	    if (allocateDict) {
		dictPtr = Tcl_DuplicateObj(dictPtr);
	    }
	}

	TRESULT = Tcl_DictObjGet(interp, dictPtr, OBJ_UNDER_TOS, &valuePtr);
	if (TRESULT != TCL_OK) {
	    if (allocateDict) {
		TclDecrRefCount(dictPtr);
	    }
	    goto checkForCatch;
	}

	/*
	 * Note that a non-existent key results in a NULL valuePtr, which is a
	 * case handled separately below. What we *can* say at this point is
	 * that the write-back will always succeed.
	 */

	switch (*pc) {
	case INST_DICT_APPEND:
	    if (valuePtr == NULL) {
		valuePtr = OBJ_AT_TOS;
	    } else {
		if (Tcl_IsShared(valuePtr)) {
		    valuePtr = Tcl_DuplicateObj(valuePtr);


		}
		Tcl_AppendObjToObj(valuePtr, OBJ_AT_TOS);
	    }
	    break;
	case INST_DICT_LAPPEND:
	    /*
	     * More complex because list-append can fail.
	     */

	    if (valuePtr == NULL) {

		valuePtr = Tcl_NewListObj(1, &OBJ_AT_TOS);
		break;
	    }
	    if (Tcl_IsShared(valuePtr)) {
		valuePtr = Tcl_DuplicateObj(valuePtr);
		TRESULT = Tcl_ListObjAppendElement(interp, valuePtr,
			OBJ_AT_TOS);

		if (TRESULT != TCL_OK) {
		    TclDecrRefCount(valuePtr);
		}



	    } else {
		TRESULT = Tcl_ListObjAppendElement(interp, valuePtr,
			OBJ_AT_TOS);
	    }
	    if (TRESULT != TCL_OK) {
		if (allocateDict) {
		    TclDecrRefCount(dictPtr);
		}
		goto checkForCatch;

	    }
	    break;
	default:
	    Tcl_Panic("Should not happen!");
	}

	Tcl_DictObjPut(NULL, dictPtr, OBJ_UNDER_TOS, valuePtr);

	if (TclIsVarDirectWritable(varPtr)) {
	    if (allocateDict) {
		value2Ptr = varPtr->value.objPtr;
		Tcl_IncrRefCount(dictPtr);
		if (value2Ptr != NULL) {
		    TclDecrRefCount(value2Ptr);
		}
		varPtr->value.objPtr = dictPtr;
	    }
	    objResultPtr = dictPtr;
	} else {
	    Tcl_IncrRefCount(dictPtr);
	    DECACHE_STACK_INFO();
	    objResultPtr = TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
		    dictPtr, TCL_LEAVE_ERR_MSG, opnd);
	    CACHE_STACK_INFO();
	    TclDecrRefCount(dictPtr);
	    if (objResultPtr == NULL) {
		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }
	}
#ifndef TCL_COMPILE_DEBUG
	if (*(pc+5) == INST_POP) {
	    NEXT_INST_F(6, 2, 0);
	}
#endif
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	NEXT_INST_F(5, 2, 1);

    case INST_DICT_FIRST:
	opnd = TclGetUInt4AtPtr(pc+1);
	TRACE(("%u => ", opnd));
	dictPtr = POP_OBJECT();
	searchPtr = (Tcl_DictSearch *) ckalloc(sizeof(Tcl_DictSearch));
	TRESULT = Tcl_DictObjFirst(interp, dictPtr, searchPtr, &keyPtr,
		&valuePtr, &done);
	if (TRESULT != TCL_OK) {
	    ckfree((char *) searchPtr);
	    goto checkForCatch;
	}
	TclNewObj(statePtr);
	statePtr->typePtr = &dictIteratorType;
	statePtr->internalRep.twoPtrValue.ptr1 = searchPtr;
	statePtr->internalRep.twoPtrValue.ptr2 = dictPtr;
	varPtr = LOCAL(opnd);
	if (varPtr->value.objPtr) {







|
|



|











|
<
|
|
>
>
|









>
|

<
|

|
|
>
|
|
|
>
>
>

|
|
<
<
|
|
|
|
>






<
<




















<
|















|
|
<

|







5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974

5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991

5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005


6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016


6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036

6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054

6055
6056
6057
6058
6059
6060
6061
6062
6063
	} else {
	    allocateDict = Tcl_IsShared(dictPtr);
	    if (allocateDict) {
		dictPtr = Tcl_DuplicateObj(dictPtr);
	    }
	}

	if (Tcl_DictObjGet(interp, dictPtr, OBJ_UNDER_TOS,
		&valuePtr) != TCL_OK) {
	    if (allocateDict) {
		TclDecrRefCount(dictPtr);
	    }
	    goto gotError;
	}

	/*
	 * Note that a non-existent key results in a NULL valuePtr, which is a
	 * case handled separately below. What we *can* say at this point is
	 * that the write-back will always succeed.
	 */

	switch (*pc) {
	case INST_DICT_APPEND:
	    if (valuePtr == NULL) {
		Tcl_DictObjPut(NULL, dictPtr, OBJ_UNDER_TOS, OBJ_AT_TOS);

	    } else if (Tcl_IsShared(valuePtr)) {
		valuePtr = Tcl_DuplicateObj(valuePtr);
		Tcl_AppendObjToObj(valuePtr, OBJ_AT_TOS);
		Tcl_DictObjPut(NULL, dictPtr, OBJ_UNDER_TOS, valuePtr);
	    } else {
		Tcl_AppendObjToObj(valuePtr, OBJ_AT_TOS);
	    }
	    break;
	case INST_DICT_LAPPEND:
	    /*
	     * More complex because list-append can fail.
	     */

	    if (valuePtr == NULL) {
		Tcl_DictObjPut(NULL, dictPtr, OBJ_UNDER_TOS,
			Tcl_NewListObj(1, &OBJ_AT_TOS));
		break;

	    } else if (Tcl_IsShared(valuePtr)) {
		valuePtr = Tcl_DuplicateObj(valuePtr);
		if (Tcl_ListObjAppendElement(interp, valuePtr,
			OBJ_AT_TOS) != TCL_OK) {
		    TclDecrRefCount(valuePtr);
		    if (allocateDict) {
			TclDecrRefCount(dictPtr);
		    }
		    goto gotError;
		}
		Tcl_DictObjPut(NULL, dictPtr, OBJ_UNDER_TOS, valuePtr);
	    } else {
		if (Tcl_ListObjAppendElement(interp, valuePtr,
			OBJ_AT_TOS) != TCL_OK) {


		    if (allocateDict) {
			TclDecrRefCount(dictPtr);
		    }
		    goto gotError;
		}
	    }
	    break;
	default:
	    Tcl_Panic("Should not happen!");
	}



	if (TclIsVarDirectWritable(varPtr)) {
	    if (allocateDict) {
		value2Ptr = varPtr->value.objPtr;
		Tcl_IncrRefCount(dictPtr);
		if (value2Ptr != NULL) {
		    TclDecrRefCount(value2Ptr);
		}
		varPtr->value.objPtr = dictPtr;
	    }
	    objResultPtr = dictPtr;
	} else {
	    Tcl_IncrRefCount(dictPtr);
	    DECACHE_STACK_INFO();
	    objResultPtr = TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
		    dictPtr, TCL_LEAVE_ERR_MSG, opnd);
	    CACHE_STACK_INFO();
	    TclDecrRefCount(dictPtr);
	    if (objResultPtr == NULL) {
		TRACE_APPEND(("ERROR: %.30s\n",
			O2S(Tcl_GetObjResult(interp))));

		goto gotError;
	    }
	}
#ifndef TCL_COMPILE_DEBUG
	if (*(pc+5) == INST_POP) {
	    NEXT_INST_F(6, 2, 0);
	}
#endif
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	NEXT_INST_F(5, 2, 1);

    case INST_DICT_FIRST:
	opnd = TclGetUInt4AtPtr(pc+1);
	TRACE(("%u => ", opnd));
	dictPtr = POP_OBJECT();
	searchPtr = (Tcl_DictSearch *) ckalloc(sizeof(Tcl_DictSearch));
	if (Tcl_DictObjFirst(interp, dictPtr, searchPtr, &keyPtr,
		&valuePtr, &done) != TCL_OK) {

	    ckfree((char *) searchPtr);
	    goto gotError;
	}
	TclNewObj(statePtr);
	statePtr->typePtr = &dictIteratorType;
	statePtr->internalRep.twoPtrValue.ptr1 = searchPtr;
	statePtr->internalRep.twoPtrValue.ptr2 = dictPtr;
	varPtr = LOCAL(opnd);
	if (varPtr->value.objPtr) {
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
	    dictPtr = varPtr->value.objPtr;
	} else {
	    DECACHE_STACK_INFO();
	    dictPtr = TclPtrGetVar(interp, varPtr, NULL, NULL, NULL,
		    TCL_LEAVE_ERR_MSG, opnd);
	    CACHE_STACK_INFO();
	    if (dictPtr == NULL) {
		goto dictUpdateStartFailed;
	    }
	}
	if (TclListObjGetElements(interp, OBJ_AT_TOS, &length,
		&keyPtrPtr) != TCL_OK) {
	    goto dictUpdateStartFailed;
	}
	if (length != duiPtr->length) {
	    Tcl_Panic("dictUpdateStart argument length mismatch");
	}
	for (i=0 ; i<length ; i++) {
	    if (Tcl_DictObjGet(interp, dictPtr, keyPtrPtr[i],
		    &valuePtr) != TCL_OK) {
		goto dictUpdateStartFailed;
	    }
	    varPtr = LOCAL(duiPtr->varIndices[i]);
	    while (TclIsVarLink(varPtr)) {
		varPtr = varPtr->value.linkPtr;
	    }
	    DECACHE_STACK_INFO();
	    if (valuePtr == NULL) {
		TclObjUnsetVar2(interp,
			localName(iPtr->varFramePtr, duiPtr->varIndices[i]),
			NULL, 0);
	    } else if (TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
		    valuePtr, TCL_LEAVE_ERR_MSG,
		    duiPtr->varIndices[i]) == NULL) {
		CACHE_STACK_INFO();
		goto dictUpdateStartFailed;
	    }
	    CACHE_STACK_INFO();
	}
	NEXT_INST_F(9, 0, 0);
    dictUpdateStartFailed:
	TRESULT = TCL_ERROR;
	goto checkForCatch;

    case INST_DICT_UPDATE_END:
	opnd = TclGetUInt4AtPtr(pc+1);
	opnd2 = TclGetUInt4AtPtr(pc+5);
	varPtr = LOCAL(opnd);
	duiPtr = codePtr->auxDataArrayPtr[opnd2].clientData;
	while (TclIsVarLink(varPtr)) {







|




|







|














|




<
<
<







6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179



6180
6181
6182
6183
6184
6185
6186
	    dictPtr = varPtr->value.objPtr;
	} else {
	    DECACHE_STACK_INFO();
	    dictPtr = TclPtrGetVar(interp, varPtr, NULL, NULL, NULL,
		    TCL_LEAVE_ERR_MSG, opnd);
	    CACHE_STACK_INFO();
	    if (dictPtr == NULL) {
		goto gotError;
	    }
	}
	if (TclListObjGetElements(interp, OBJ_AT_TOS, &length,
		&keyPtrPtr) != TCL_OK) {
	    goto gotError;
	}
	if (length != duiPtr->length) {
	    Tcl_Panic("dictUpdateStart argument length mismatch");
	}
	for (i=0 ; i<length ; i++) {
	    if (Tcl_DictObjGet(interp, dictPtr, keyPtrPtr[i],
		    &valuePtr) != TCL_OK) {
		goto gotError;
	    }
	    varPtr = LOCAL(duiPtr->varIndices[i]);
	    while (TclIsVarLink(varPtr)) {
		varPtr = varPtr->value.linkPtr;
	    }
	    DECACHE_STACK_INFO();
	    if (valuePtr == NULL) {
		TclObjUnsetVar2(interp,
			localName(iPtr->varFramePtr, duiPtr->varIndices[i]),
			NULL, 0);
	    } else if (TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
		    valuePtr, TCL_LEAVE_ERR_MSG,
		    duiPtr->varIndices[i]) == NULL) {
		CACHE_STACK_INFO();
		goto gotError;
	    }
	    CACHE_STACK_INFO();
	}
	NEXT_INST_F(9, 0, 0);




    case INST_DICT_UPDATE_END:
	opnd = TclGetUInt4AtPtr(pc+1);
	opnd2 = TclGetUInt4AtPtr(pc+5);
	varPtr = LOCAL(opnd);
	duiPtr = codePtr->auxDataArrayPtr[opnd2].clientData;
	while (TclIsVarLink(varPtr)) {
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
	}
	if (dictPtr == NULL) {
	    NEXT_INST_F(9, 1, 0);
	}
	if (Tcl_DictObjSize(interp, dictPtr, &length) != TCL_OK
		|| TclListObjGetElements(interp, OBJ_AT_TOS, &length,
			&keyPtrPtr) != TCL_OK) {
	    TRESULT = TCL_ERROR;
	    goto checkForCatch;
	}
	allocdict = Tcl_IsShared(dictPtr);
	if (allocdict) {
	    dictPtr = Tcl_DuplicateObj(dictPtr);
	}
	for (i=0 ; i<length ; i++) {
	    Var *var2Ptr = LOCAL(duiPtr->varIndices[i]);







<
|







6196
6197
6198
6199
6200
6201
6202

6203
6204
6205
6206
6207
6208
6209
6210
	}
	if (dictPtr == NULL) {
	    NEXT_INST_F(9, 1, 0);
	}
	if (Tcl_DictObjSize(interp, dictPtr, &length) != TCL_OK
		|| TclListObjGetElements(interp, OBJ_AT_TOS, &length,
			&keyPtrPtr) != TCL_OK) {

	    goto gotError;
	}
	allocdict = Tcl_IsShared(dictPtr);
	if (allocdict) {
	    dictPtr = Tcl_DuplicateObj(dictPtr);
	}
	for (i=0 ; i<length ; i++) {
	    Var *var2Ptr = LOCAL(duiPtr->varIndices[i]);
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
	    objResultPtr = TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
		    dictPtr, TCL_LEAVE_ERR_MSG, opnd);
	    CACHE_STACK_INFO();
	    if (objResultPtr == NULL) {
		if (allocdict) {
		    TclDecrRefCount(dictPtr);
		}
		TRESULT = TCL_ERROR;
		goto checkForCatch;
	    }
	}
	NEXT_INST_F(9, 1, 0);
    }

    /*
     *	   End of dictionary-related instructions.
     * -----------------------------------------------------------------
     */

    default:
	Tcl_Panic("TclExecuteByteCode: unrecognized opCode %u", *pc);
    } /* end of switch on opCode */

    /*
     * Division by zero in an expression. Control only reaches this point by
     * "goto divideByZero".
     */

  divideByZero:
    Tcl_SetResult(interp, "divide by zero", TCL_STATIC);
    Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero", NULL);

    TRESULT = TCL_ERROR;
    goto checkForCatch;

    /*
     * Exponentiation of zero by negative number in an expression. Control
     * only reaches this point by "goto exponOfZero".
     */

  exponOfZero:
    Tcl_SetResult(interp, "exponentiation of zero by negative power",
	    TCL_STATIC);
    Tcl_SetErrorCode(interp, "ARITH", "DOMAIN",
	    "exponentiation of zero by negative power", NULL);
    TRESULT = TCL_ERROR;
    goto checkForCatch;

    /*
     * Block for variables needed to process exception returns.
     */

    {
	ExceptionRange *rangePtr;
				/* Points to closest loop or catch exception







<
|














<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







6238
6239
6240
6241
6242
6243
6244

6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259

























6260
6261
6262
6263
6264
6265
6266
	    objResultPtr = TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
		    dictPtr, TCL_LEAVE_ERR_MSG, opnd);
	    CACHE_STACK_INFO();
	    if (objResultPtr == NULL) {
		if (allocdict) {
		    TclDecrRefCount(dictPtr);
		}

		goto gotError;
	    }
	}
	NEXT_INST_F(9, 1, 0);
    }

    /*
     *	   End of dictionary-related instructions.
     * -----------------------------------------------------------------
     */

    default:
	Tcl_Panic("TclExecuteByteCode: unrecognized opCode %u", *pc);
    } /* end of switch on opCode */


























    /*
     * Block for variables needed to process exception returns.
     */

    {
	ExceptionRange *rangePtr;
				/* Points to closest loop or catch exception
7772
7773
7774
7775
7776
7777
7778
7779

7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802

7803

7804




























7805
7806
7807
7808
7809
7810
7811
	    if (TRESULT == TCL_BREAK) {
		TRESULT = TCL_OK;
		pc = (codePtr->codeStart + rangePtr->breakOffset);
		TRACE_APPEND(("%s, range at %d, new pc %d\n",
			StringForResultCode(TRESULT),
			rangePtr->codeOffset, rangePtr->breakOffset));
		NEXT_INST_F(0, 0, 0);
	    } else {

		if (rangePtr->continueOffset == -1) {
		    TRACE_APPEND((
			    "%s, loop w/o continue, checking for catch\n",
			    StringForResultCode(TRESULT)));
		    goto checkForCatch;
		}
		TRESULT = TCL_OK;
		pc = (codePtr->codeStart + rangePtr->continueOffset);
		TRACE_APPEND(("%s, range at %d, new pc %d\n",
			StringForResultCode(TRESULT),
			rangePtr->codeOffset, rangePtr->continueOffset));
		NEXT_INST_F(0, 0, 0);
	    }
#if TCL_COMPILE_DEBUG
	} else if (traceInstructions) {
	    objPtr = Tcl_GetObjResult(interp);
	    if ((TRESULT != TCL_ERROR) && (TRESULT != TCL_RETURN)) {
		TRACE_APPEND(("OTHER RETURN CODE %d, result= \"%s\"\n ",
			TRESULT, O2S(objPtr)));
	    } else {
		TRACE_APPEND(("%s, result= \"%s\"\n",
			StringForResultCode(TRESULT), O2S(objPtr)));
	    }

#endif

	}





























	/*
	 * Execution has generated an "exception" such as TCL_ERROR. If the
	 * exception is an error, record information about what was being
	 * executed when the error occurred. Find the closest enclosing catch
	 * range, if any. If no enclosing catch range is found, stop execution
	 * and return the "exception" code.







<
>
|
<
|
|
|
|
|
|
|
|
|
|
|

|








>

>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







6316
6317
6318
6319
6320
6321
6322

6323
6324

6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
	    if (TRESULT == TCL_BREAK) {
		TRESULT = TCL_OK;
		pc = (codePtr->codeStart + rangePtr->breakOffset);
		TRACE_APPEND(("%s, range at %d, new pc %d\n",
			StringForResultCode(TRESULT),
			rangePtr->codeOffset, rangePtr->breakOffset));
		NEXT_INST_F(0, 0, 0);

	    }
	    if (rangePtr->continueOffset == -1) {

		TRACE_APPEND(("%s, loop w/o continue, checking for catch\n",
			StringForResultCode(TRESULT)));
		goto checkForCatch;
	    }
	    TRESULT = TCL_OK;
	    pc = (codePtr->codeStart + rangePtr->continueOffset);
	    TRACE_APPEND(("%s, range at %d, new pc %d\n",
		    StringForResultCode(TRESULT),
		    rangePtr->codeOffset, rangePtr->continueOffset));
	    NEXT_INST_F(0, 0, 0);
	}
#if TCL_COMPILE_DEBUG
	if (traceInstructions) {
	    objPtr = Tcl_GetObjResult(interp);
	    if ((TRESULT != TCL_ERROR) && (TRESULT != TCL_RETURN)) {
		TRACE_APPEND(("OTHER RETURN CODE %d, result= \"%s\"\n ",
			TRESULT, O2S(objPtr)));
	    } else {
		TRACE_APPEND(("%s, result= \"%s\"\n",
			StringForResultCode(TRESULT), O2S(objPtr)));
	    }
	}
#endif
	goto checkForCatch;

	/*
	 * Division by zero in an expression. Control only reaches this point
	 * by "goto divideByZero".
	 */

    divideByZero:
	Tcl_SetResult(interp, "divide by zero", TCL_STATIC);
	Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero", NULL);
	goto gotError;

	/*
	 * Exponentiation of zero by negative number in an expression. Control
	 * only reaches this point by "goto exponOfZero".
	 */

    exponOfZero:
	Tcl_SetResult(interp, "exponentiation of zero by negative power",
		TCL_STATIC);
	Tcl_SetErrorCode(interp, "ARITH", "DOMAIN",
		"exponentiation of zero by negative power", NULL);

	/*
	 * Almost all error paths feed through here rather than assigning to
	 * TRESULT themselves (for a small but consistent saving).
	 */

    gotError:
	TRESULT = TCL_ERROR;

	/*
	 * Execution has generated an "exception" such as TCL_ERROR. If the
	 * exception is an error, record information about what was being
	 * executed when the error occurred. Find the closest enclosing catch
	 * range, if any. If no enclosing catch range is found, stop execution
	 * and return the "exception" code.
8036
8037
8038
8039
8040
8041
8042











































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































8043
8044
8045
8046
8047
8048
8049
}
#undef iPtr
#undef bcFramePtr
#undef initCatchTop
#undef initTosPtr
#undef auxObjList
#undef catchTop












































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































#ifdef TCL_COMPILE_DEBUG
/*
 *----------------------------------------------------------------------
 *
 * PrintByteCodeInfo --
 *







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
}
#undef iPtr
#undef bcFramePtr
#undef initCatchTop
#undef initTosPtr
#undef auxObjList
#undef catchTop
#undef TCONST

/*
 *----------------------------------------------------------------------
 *
 * ExecuteExtendedBinaryMathOp, ExecuteExtendedUnaryMathOp --
 *
 *	These functions do advanced math for binary and unary operators
 *	respectively, so that the main TEBC code does not bear the cost of
 *	them.
 *
 * Results:
 *	A Tcl_Obj* result, or a NULL (in which case valuePtr is updated to
 *	hold the result value), or one of the special flag values
 *	GENERAL_ARITHMETIC_ERROR, EXPONENT_OF_ZERO or DIVIDED_BY_ZERO. The
 *	latter two signify a zero value raised to a negative power or a value
 *	divided by zero, respectively. With GENERAL_ARITHMETIC_ERROR, all
 *	error information will have already been reported in the interpreter
 *	result.
 *
 * Side effects:
 *	May update the Tcl_Obj indicated valuePtr if it is unshared. Will
 *	return a NULL when that happens.
 *
 *----------------------------------------------------------------------
 */

static Tcl_Obj *
ExecuteExtendedBinaryMathOp(
    Tcl_Interp *interp,		/* Where to report errors. */
    int opcode,			/* What operation to perform. */
    Tcl_Obj **constants,	/* The execution environment's constants. */
    Tcl_Obj *valuePtr,		/* The first operand on the stack. */
    Tcl_Obj *value2Ptr)		/* The second operand on the stack. */
{
#define LONG_RESULT(l) \
    if (Tcl_IsShared(valuePtr)) {		\
	TclNewLongObj(objResultPtr, l);		\
	return objResultPtr;			\
    } else {					\
	Tcl_SetLongObj(valuePtr, l);		\
	return NULL;				\
    }
#define WIDE_RESULT(w) \
    if (Tcl_IsShared(valuePtr)) {		\
	return Tcl_NewWideIntObj(w);		\
    } else {					\
	Tcl_SetWideIntObj(valuePtr, w);		\
	return NULL;				\
    }
#define BIG_RESULT(b) \
    if (Tcl_IsShared(valuePtr)) {		\
	return Tcl_NewBignumObj(b);		\
    } else {					\
	Tcl_SetBignumObj(valuePtr, b);		\
	return NULL;				\
    }
#define DOUBLE_RESULT(d) \
    if (Tcl_IsShared(valuePtr)) {		\
	TclNewDoubleObj(objResultPtr, (d));	\
	return objResultPtr;			\
    } else {					\
	Tcl_SetDoubleObj(valuePtr, (d));	\
	return NULL;				\
    }

    int type1, type2;
    ClientData ptr1, ptr2;
    double d1, d2, dResult;
    long l1, l2, lResult;
    Tcl_WideInt w1, w2, wResult, wQuotient, wRemainder;
    mp_int big1, big2, bigResult, bigRemainder;
    Tcl_Obj *objResultPtr;
    int invalid, numPos, zero;
    long shift;

    (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
    (void) GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);

    switch (opcode) {
    case INST_MOD:
	/* TODO: Attempts to re-use unshared operands on stack */

	l2 = 0;			/* silence gcc warning */
	if (type2 == TCL_NUMBER_LONG) {
	    l2 = *((const long *)ptr2);
	    if (l2 == 0) {
		return DIVIDED_BY_ZERO;
	    }
	    if ((l2 == 1) || (l2 == -1)) {
		/*
		 * Div. by |1| always yields remainder of 0.
		 */

		return constants[0];
	    }
	}
#ifndef NO_WIDE_TYPE
	if (type1 == TCL_NUMBER_WIDE) {
	    w1 = *((const Tcl_WideInt *)ptr1);
	    if (type2 != TCL_NUMBER_BIG) {
		Tcl_GetWideIntFromObj(NULL, value2Ptr, &w2);
		wQuotient = w1 / w2;

		/*
		 * Force Tcl's integer division rules.
		 * TODO: examine for logic simplification
		 */

		if (((wQuotient < (Tcl_WideInt) 0)
			|| ((wQuotient == (Tcl_WideInt) 0)
			&& ((w1 < (Tcl_WideInt)0 && w2 > (Tcl_WideInt)0)
			|| (w1 > (Tcl_WideInt)0 && w2 < (Tcl_WideInt)0))))
			&& (wQuotient * w2 != w1)) {
		    wQuotient -= (Tcl_WideInt) 1;
		}
		wRemainder = w1 - w2*wQuotient;
		WIDE_RESULT(wRemainder);
	    }

	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);

	    /* TODO: internals intrusion */
	    if ((w1 > ((Tcl_WideInt) 0)) ^ (big2.sign == MP_ZPOS)) {
		/*
		 * Arguments are opposite sign; remainder is sum.
		 */

		TclBNInitBignumFromWideInt(&big1, w1);
		mp_add(&big2, &big1, &big2);
		mp_clear(&big1);
		BIG_RESULT(&big2);
	    }

	    /*
	     * Arguments are same sign; remainder is first operand.
	     */

	    mp_clear(&big2);
	    return NULL;
	}
#endif
	Tcl_GetBignumFromObj(NULL, valuePtr, &big1);
	Tcl_GetBignumFromObj(NULL, value2Ptr, &big2);
	mp_init(&bigResult);
	mp_init(&bigRemainder);
	mp_div(&big1, &big2, &bigResult, &bigRemainder);
	if (!mp_iszero(&bigRemainder) && (bigRemainder.sign != big2.sign)) {
	    /*
	     * Convert to Tcl's integer division rules.
	     */

	    mp_sub_d(&bigResult, 1, &bigResult);
	    mp_add(&bigRemainder, &big2, &bigRemainder);
	}
	mp_copy(&bigRemainder, &bigResult);
	mp_clear(&bigRemainder);
	mp_clear(&big1);
	mp_clear(&big2);
	BIG_RESULT(&bigResult);

    case INST_LSHIFT:
    case INST_RSHIFT: {
	/*
	 * Reject negative shift argument.
	 */

	switch (type2) {
	case TCL_NUMBER_LONG:
	    invalid = (*((const long *)ptr2) < 0L);
	    break;
#ifndef NO_WIDE_TYPE
	case TCL_NUMBER_WIDE:
	    invalid = (*((const Tcl_WideInt *)ptr2) < (Tcl_WideInt)0);
	    break;
#endif
	case TCL_NUMBER_BIG:
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	    invalid = (mp_cmp_d(&big2, 0) == MP_LT);
	    mp_clear(&big2);
	    break;
	default:
	    /* Unused, here to silence compiler warning */
	    invalid = 0;
	}
	if (invalid) {
	    Tcl_SetResult(interp, "negative shift argument", TCL_STATIC);
	    return GENERAL_ARITHMETIC_ERROR;
	}

	/*
	 * Zero shifted any number of bits is still zero.
	 */

	if ((type1==TCL_NUMBER_LONG) && (*((const long *)ptr1) == (long)0)) {
	    return constants[0];
	}

	if (opcode == INST_LSHIFT) {
	    /*
	     * Large left shifts create integer overflow.
	     *
	     * BEWARE! Can't use Tcl_GetIntFromObj() here because that
	     * converts values in the (unsigned) range to their signed int
	     * counterparts, leading to incorrect results.
	     */

	    if ((type2 != TCL_NUMBER_LONG)
		    || (*((const long *)ptr2) > (long) INT_MAX)) {
		/*
		 * Technically, we could hold the value (1 << (INT_MAX+1)) in
		 * an mp_int, but since we're using mp_mul_2d() to do the
		 * work, and it takes only an int argument, that's a good
		 * place to draw the line.
		 */

		Tcl_SetResult(interp, "integer value too large to represent",
			TCL_STATIC);
		return GENERAL_ARITHMETIC_ERROR;
	    }
	    shift = (int)(*((const long *)ptr2));

	    /*
	     * Handle shifts within the native wide range.
	     */

	    if ((type1 != TCL_NUMBER_BIG)
		    && ((size_t)shift < CHAR_BIT*sizeof(Tcl_WideInt))) {
		TclGetWideIntFromObj(NULL, valuePtr, &w1);
		if (!((w1>0 ? w1 : ~w1)
			& -(((Tcl_WideInt)1)
			<< (CHAR_BIT*sizeof(Tcl_WideInt) - 1 - shift)))) {
		    WIDE_RESULT(w1 << shift);
		}
	    }
	} else {
	    /*
	     * Quickly force large right shifts to 0 or -1.
	     */

	    if ((type2 != TCL_NUMBER_LONG)
		    || (*(const long *)ptr2 > INT_MAX)) {
		/*
		 * Again, technically, the value to be shifted could be an
		 * mp_int so huge that a right shift by (INT_MAX+1) bits could
		 * not take us to the result of 0 or -1, but since we're using
		 * mp_div_2d to do the work, and it takes only an int
		 * argument, we draw the line there.
		 */

		switch (type1) {
		case TCL_NUMBER_LONG:
		    zero = (*(const long *)ptr1 > 0L);
		    break;
#ifndef NO_WIDE_TYPE
		case TCL_NUMBER_WIDE:
		    zero = (*(const Tcl_WideInt *)ptr1 > (Tcl_WideInt)0);
		    break;
#endif
		case TCL_NUMBER_BIG:
		    Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
		    zero = (mp_cmp_d(&big1, 0) == MP_GT);
		    mp_clear(&big1);
		    break;
		default:
		    /* Unused, here to silence compiler warning. */
		    zero = 0;
		}
		if (zero) {
		    return constants[0];
		}
		LONG_RESULT(-1);
	    }
	    shift = (int)(*(const long *)ptr2);

#ifndef NO_WIDE_TYPE
	    /*
	     * Handle shifts within the native wide range.
	     */

	    if (type1 == TCL_NUMBER_WIDE) {
		w1 = *(const Tcl_WideInt *)ptr1;
		if ((size_t)shift >= CHAR_BIT*sizeof(Tcl_WideInt)) {
		    if (w1 >= (Tcl_WideInt)0) {
			return constants[0];
		    }
		    LONG_RESULT(-1);
		}
		WIDE_RESULT(w1 >> shift);
	    }
#endif
	}

	Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);

	mp_init(&bigResult);
	if (opcode == INST_LSHIFT) {
	    mp_mul_2d(&big1, shift, &bigResult);
	} else {
	    mp_init(&bigRemainder);
	    mp_div_2d(&big1, shift, &bigResult, &bigRemainder);
	    if (mp_cmp_d(&bigRemainder, 0) == MP_LT) {
		/*
		 * Convert to Tcl's integer division rules.
		 */

		mp_sub_d(&bigResult, 1, &bigResult);
	    }
	    mp_clear(&bigRemainder);
	}
	mp_clear(&big1);
	BIG_RESULT(&bigResult);
    }

    case INST_BITOR:
    case INST_BITXOR:
    case INST_BITAND:
	if ((type1 == TCL_NUMBER_BIG) || (type2 == TCL_NUMBER_BIG)) {
	    mp_int *First, *Second;

	    Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);

	    /*
	     * Count how many positive arguments we have. If only one of the
	     * arguments is negative, store it in 'Second'.
	     */

	    if (mp_cmp_d(&big1, 0) != MP_LT) {
		numPos = 1 + (mp_cmp_d(&big2, 0) != MP_LT);
		First = &big1;
		Second = &big2;
	    } else {
		First = &big2;
		Second = &big1;
		numPos = (mp_cmp_d(First, 0) != MP_LT);
	    }
	    mp_init(&bigResult);

	    switch (opcode) {
	    case INST_BITAND:
		switch (numPos) {
		case 2:
		    /*
		     * Both arguments positive, base case.
		     */

		    mp_and(First, Second, &bigResult);
		    break;
		case 1:
		    /*
		     * First is positive; second negative:
		     * P & N = P & ~~N = P&~(-N-1) = P & (P ^ (-N-1))
		     */

		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    mp_and(First, &bigResult, &bigResult);
		    break;
		case 0:
		    /*
		     * Both arguments negative:
		     * a & b = ~ (~a | ~b) = -(-a-1|-b-1)-1
		     */

		    mp_neg(First, First);
		    mp_sub_d(First, 1, First);
		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_or(First, Second, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		}
		break;

	    case INST_BITOR:
		switch (numPos) {
		case 2:
		    /*
		     * Both arguments positive, base case.
		     */

		    mp_or(First, Second, &bigResult);
		    break;
		case 1:
		    /*
		     * First is positive; second negative:
		     * N|P = ~(~N&~P) = ~((-N-1)&~P) = -((-N-1)&((-N-1)^P))-1
		     */

		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    mp_and(Second, &bigResult, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		case 0:
		    /*
		     * Both arguments negative:
		     * a | b = ~ (~a & ~b) = -(-a-1&-b-1)-1
		     */

		    mp_neg(First, First);
		    mp_sub_d(First, 1, First);
		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_and(First, Second, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		}
		break;

	    case INST_BITXOR:
		switch (numPos) {
		case 2:
		    /*
		     * Both arguments positive, base case.
		     */

		    mp_xor(First, Second, &bigResult);
		    break;
		case 1:
		    /*
		     * First is positive; second negative:
		     * P^N = ~(P^~N) = -(P^(-N-1))-1
		     */

		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		case 0:
		    /*
		     * Both arguments negative:
		     * a ^ b = (~a ^ ~b) = (-a-1^-b-1)
		     */

		    mp_neg(First, First);
		    mp_sub_d(First, 1, First);
		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    break;
		}
		break;
	    }

	    mp_clear(&big1);
	    mp_clear(&big2);
	    BIG_RESULT(&bigResult);
	}

#ifndef NO_WIDE_TYPE
	if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE)) {
	    TclGetWideIntFromObj(NULL, valuePtr, &w1);
	    TclGetWideIntFromObj(NULL, value2Ptr, &w2);

	    switch (opcode) {
	    case INST_BITAND:
		wResult = w1 & w2;
		break;
	    case INST_BITOR:
		wResult = w1 | w2;
		break;
	    case INST_BITXOR:
		wResult = w1 ^ w2;
		break;
	    default:
		/* Unused, here to silence compiler warning. */
		wResult = 0;
	    }
	    WIDE_RESULT(wResult);
	}
#endif
	l1 = *((const long *)ptr1);
	l2 = *((const long *)ptr2);

	switch (opcode) {
	case INST_BITAND:
	    lResult = l1 & l2;
	    break;
	case INST_BITOR:
	    lResult = l1 | l2;
	    break;
	case INST_BITXOR:
	    lResult = l1 ^ l2;
	    break;
	default:
	    /* Unused, here to silence compiler warning. */
	    lResult = 0;
	}
	LONG_RESULT(lResult);

    case INST_EXPON: {
	int oddExponent = 0, negativeExponent = 0;
	unsigned short base;

	if ((type1 == TCL_NUMBER_DOUBLE) || (type2 == TCL_NUMBER_DOUBLE)) {
	    Tcl_GetDoubleFromObj(NULL, valuePtr, &d1);
	    Tcl_GetDoubleFromObj(NULL, value2Ptr, &d2);

	    if (d1==0.0 && d2<0.0) {
		return EXPONENT_OF_ZERO;
	    }
	    dResult = pow(d1, d2);
	    goto doubleResult;
	}
	l1 = l2 = 0;
	if (type2 == TCL_NUMBER_LONG) {
	    l2 = *((const long *) ptr2);
	    if (l2 == 0) {
		/*
		 * Anything to the zero power is 1.
		 */

		return constants[1];
	    } else if (l2 == 1) {
		/*
		 * Anything to the first power is itself
		 */

		return NULL;
	    }
	}

	switch (type2) {
	case TCL_NUMBER_LONG:
	    negativeExponent = (l2 < 0);
	    oddExponent = (int) (l2 & 1);
	    break;
#ifndef NO_WIDE_TYPE
	case TCL_NUMBER_WIDE:
	    w2 = *((const Tcl_WideInt *)ptr2);
	    negativeExponent = (w2 < 0);
	    oddExponent = (int) (w2 & (Tcl_WideInt)1);
	    break;
#endif
	case TCL_NUMBER_BIG:
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	    negativeExponent = (mp_cmp_d(&big2, 0) == MP_LT);
	    mp_mod_2d(&big2, 1, &big2);
	    oddExponent = !mp_iszero(&big2);
	    mp_clear(&big2);
	    break;
	}

	if (type1 == TCL_NUMBER_LONG) {
	    l1 = *((const long *)ptr1);
	}
	if (negativeExponent) {
	    if (type1 == TCL_NUMBER_LONG) {
		switch (l1) {
		case 0:
		    /*
		     * Zero to a negative power is div by zero error.
		     */

		    return EXPONENT_OF_ZERO;
		case -1:
		    if (oddExponent) {
			LONG_RESULT(-1);
		    }
		    /* fallthrough */
		case 1:
		    /*
		     * 1 to any power is 1.
		     */

		    return constants[1];
		}
	    }

	    /*
	     * Integers with magnitude greater than 1 raise to a negative
	     * power yield the answer zero (see TIP 123).
	     */

	    return constants[0];
	}

	if (type1 == TCL_NUMBER_LONG) {
	    switch (l1) {
	    case 0:
		/*
		 * Zero to a positive power is zero.
		 */

		return constants[0];
	    case 1:
		/*
		 * 1 to any power is 1.
		 */

		return constants[1];
	    case -1:
		if (!oddExponent) {
		    return constants[1];
		}
		LONG_RESULT(-1);
	    }
	}

	/*
	 * We refuse to accept exponent arguments that exceed one mp_digit
	 * which means the max exponent value is 2**28-1 = 0x0fffffff =
	 * 268435455, which fits into a signed 32 bit int which is within the
	 * range of the long int type. This means any numeric Tcl_Obj value
	 * not using TCL_NUMBER_LONG type must hold a value larger than we
	 * accept.
	 */

	if (type2 != TCL_NUMBER_LONG) {
	    Tcl_SetResult(interp, "exponent too large", TCL_STATIC);
	    return GENERAL_ARITHMETIC_ERROR;
	}

	if (type1 == TCL_NUMBER_LONG) {
	    if (l1 == 2) {
		/*
		 * Reduce small powers of 2 to shifts.
		 */

		if ((unsigned long) l2 < CHAR_BIT * sizeof(long) - 1) {
		    LONG_RESULT(1L << l2);
		}
#if !defined(TCL_WIDE_INT_IS_LONG)
		if ((unsigned long)l2 < CHAR_BIT*sizeof(Tcl_WideInt) - 1) {
		    WIDE_RESULT(((Tcl_WideInt) 1) << l2);
		}
#endif
		goto overflowExpon;
	    }
	    if (l1 == -2) {
		int signum = oddExponent ? -1 : 1;

		/*
		 * Reduce small powers of 2 to shifts.
		 */

		if ((unsigned long) l2 < CHAR_BIT * sizeof(long) - 1) {
		    LONG_RESULT(signum * (1L << l2));
		}
#if !defined(TCL_WIDE_INT_IS_LONG)
		if ((unsigned long)l2 < CHAR_BIT*sizeof(Tcl_WideInt) - 1){
		    WIDE_RESULT(signum * (((Tcl_WideInt) 1) << l2));
		}
#endif
		goto overflowExpon;
	    }
#if (LONG_MAX == 0x7fffffff)
	    if (l2 - 2 < (long)MaxBase32Size
		    && l1 <= MaxBase32[l2 - 2]
		    && l1 >= -MaxBase32[l2 - 2]) {
		/*
		 * Small powers of 32-bit integers.
		 */

		lResult = l1 * l1;		/* b**2 */
		switch (l2) {
		case 2:
		    break;
		case 3:
		    lResult *= l1;		/* b**3 */
		    break;
		case 4:
		    lResult *= lResult;		/* b**4 */
		    break;
		case 5:
		    lResult *= lResult;		/* b**4 */
		    lResult *= l1;		/* b**5 */
		    break;
		case 6:
		    lResult *= l1;		/* b**3 */
		    lResult *= lResult;		/* b**6 */
		    break;
		case 7:
		    lResult *= l1;		/* b**3 */
		    lResult *= lResult;		/* b**6 */
		    lResult *= l1;		/* b**7 */
		    break;
		case 8:
		    lResult *= lResult;		/* b**4 */
		    lResult *= lResult;		/* b**8 */
		    break;
		}
		LONG_RESULT(lResult);
	    }

	    if (l1 - 3 >= 0 && l1 -2 < (long)Exp32IndexSize
		    && l2 - 2 < (long)(Exp32ValueSize + MaxBase32Size)) {
		base = Exp32Index[l1 - 3]
			+ (unsigned short) (l2 - 2 - MaxBase32Size);
		if (base < Exp32Index[l1 - 2]) {
		    /*
		     * 32-bit number raised to intermediate power, done by
		     * table lookup.
		     */

		    LONG_RESULT(Exp32Value[base]);
		}
	    }
	    if (-l1 - 3 >= 0 && -l1 - 2 < (long)Exp32IndexSize
		    && l2 - 2 < (long)(Exp32ValueSize + MaxBase32Size)) {
		base = Exp32Index[-l1 - 3]
			+ (unsigned short) (l2 - 2 - MaxBase32Size);
		if (base < Exp32Index[-l1 - 2]) {
		    /*
		     * 32-bit number raised to intermediate power, done by
		     * table lookup.
		     */

		    lResult = (oddExponent) ?
			    -Exp32Value[base] : Exp32Value[base];
		    LONG_RESULT(lResult);
		}
	    }
#endif
	}
#if (LONG_MAX > 0x7fffffff) || !defined(TCL_WIDE_INT_IS_LONG)
	if (type1 == TCL_NUMBER_LONG) {
	    w1 = l1;
#ifndef NO_WIDE_TYPE
	} else if (type1 == TCL_NUMBER_WIDE) {
	    w1 = *((const Tcl_WideInt *) ptr1);
#endif
	} else {
	    goto overflowExpon;
	}
	if (l2 - 2 < (long)MaxBase64Size
		&& w1 <=  MaxBase64[l2 - 2]
		&& w1 >= -MaxBase64[l2 - 2]) {
	    /*
	     * Small powers of integers whose result is wide.
	     */

	    wResult = w1 * w1;		/* b**2 */
	    switch (l2) {
	    case 2:
		break;
	    case 3:
		wResult *= l1;		/* b**3 */
		break;
	    case 4:
		wResult *= wResult;	/* b**4 */
		break;
	    case 5:
		wResult *= wResult;	/* b**4 */
		wResult *= w1;		/* b**5 */
		break;
	    case 6:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		break;
	    case 7:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= w1;		/* b**7 */
		break;
	    case 8:
		wResult *= wResult;	/* b**4 */
		wResult *= wResult;	/* b**8 */
		break;
	    case 9:
		wResult *= wResult;	/* b**4 */
		wResult *= wResult;	/* b**8 */
		wResult *= w1;		/* b**9 */
		break;
	    case 10:
		wResult *= wResult;	/* b**4 */
		wResult *= w1;		/* b**5 */
		wResult *= wResult;	/* b**10 */
		break;
	    case 11:
		wResult *= wResult;	/* b**4 */
		wResult *= w1;		/* b**5 */
		wResult *= wResult;	/* b**10 */
		wResult *= w1;		/* b**11 */
		break;
	    case 12:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= wResult;	/* b**12 */
		break;
	    case 13:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= wResult;	/* b**12 */
		wResult *= w1;		/* b**13 */
		break;
	    case 14:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= w1;		/* b**7 */
		wResult *= wResult;	/* b**14 */
		break;
	    case 15:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= w1;		/* b**7 */
		wResult *= wResult;	/* b**14 */
		wResult *= w1;		/* b**15 */
		break;
	    case 16:
		wResult *= wResult;	/* b**4 */
		wResult *= wResult;	/* b**8 */
		wResult *= wResult;	/* b**16 */
		break;
	    }
	    WIDE_RESULT(wResult);
	}

	/*
	 * Handle cases of powers > 16 that still fit in a 64-bit word by
	 * doing table lookup.
	 */

	if (w1 - 3 >= 0 && w1 - 2 < (long)Exp64IndexSize
		&& l2 - 2 < (long)(Exp64ValueSize + MaxBase64Size)) {
	    base = Exp64Index[w1 - 3]
		    + (unsigned short) (l2 - 2 - MaxBase64Size);
	    if (base < Exp64Index[w1 - 2]) {
		/*
		 * 64-bit number raised to intermediate power, done by
		 * table lookup.
		 */

		WIDE_RESULT(Exp64Value[base]);
	    }
	}

	if (-w1 - 3 >= 0 && -w1 - 2 < (long)Exp64IndexSize
		&& l2 - 2 < (long)(Exp64ValueSize + MaxBase64Size)) {
	    base = Exp64Index[-w1 - 3]
		    + (unsigned short) (l2 - 2 - MaxBase64Size);
	    if (base < Exp64Index[-w1 - 2]) {
		/*
		 * 64-bit number raised to intermediate power, done by
		 * table lookup.
		 */

		wResult = oddExponent ? -Exp64Value[base] : Exp64Value[base];
		WIDE_RESULT(wResult);
	    }
	}
#endif

    overflowExpon:
	Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	if (big2.used > 1) {
	    mp_clear(&big2);
	    Tcl_SetResult(interp, "exponent too large", TCL_STATIC);
	    return GENERAL_ARITHMETIC_ERROR;
	}
	Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	mp_init(&bigResult);
	mp_expt_d(&big1, big2.dp[0], &bigResult);
	mp_clear(&big1);
	mp_clear(&big2);
	BIG_RESULT(&bigResult);
    }

    case INST_ADD:
    case INST_SUB:
    case INST_MULT:
    case INST_DIV:
	if ((type1 == TCL_NUMBER_DOUBLE) || (type2 == TCL_NUMBER_DOUBLE)) {
	    /*
	     * At least one of the values is floating-point, so perform
	     * floating point calculations.
	     */

	    Tcl_GetDoubleFromObj(NULL, valuePtr, &d1);
	    Tcl_GetDoubleFromObj(NULL, value2Ptr, &d2);

	    switch (opcode) {
	    case INST_ADD:
		dResult = d1 + d2;
		break;
	    case INST_SUB:
		dResult = d1 - d2;
		break;
	    case INST_MULT:
		dResult = d1 * d2;
		break;
	    case INST_DIV:
#ifndef IEEE_FLOATING_POINT
		if (d2 == 0.0) {
		    return DIVIDED_BY_ZERO;
		}
#endif
		/*
		 * We presume that we are running with zero-divide unmasked if
		 * we're on an IEEE box. Otherwise, this statement might cause
		 * demons to fly out our noses.
		 */

		dResult = d1 / d2;
		break;
	    default:
		/* Unused, here to silence compiler warning. */
		dResult = 0;
	    }

	doubleResult:
#ifndef ACCEPT_NAN
	    /*
	     * Check now for IEEE floating-point error.
	     */

	    if (TclIsNaN(dResult)) {
		TclExprFloatError(interp, dResult);
		return GENERAL_ARITHMETIC_ERROR;
	    }
#endif
	    DOUBLE_RESULT(dResult);
	}
	if ((type1 != TCL_NUMBER_BIG) && (type2 != TCL_NUMBER_BIG)) {
	    TclGetWideIntFromObj(NULL, valuePtr, &w1);
	    TclGetWideIntFromObj(NULL, value2Ptr, &w2);

	    switch (opcode) {
	    case INST_ADD:
		wResult = w1 + w2;
#ifndef NO_WIDE_TYPE
		if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE))
#endif
		{
		    /*
		     * Check for overflow.
		     */

		    if (Overflowing(w1, w2, wResult)) {
			goto overflowBasic;
		    }
		}
		break;

	    case INST_SUB:
		wResult = w1 - w2;
#ifndef NO_WIDE_TYPE
		if ((type1 == TCL_NUMBER_WIDE) || (type2 == TCL_NUMBER_WIDE))
#endif
		{
		    /*
		     * Must check for overflow. The macro tests for overflows
		     * in sums by looking at the sign bits. As we have a
		     * subtraction here, we are adding -w2. As -w2 could in
		     * turn overflow, we test with ~w2 instead: it has the
		     * opposite sign bit to w2 so it does the job. Note that
		     * the only "bad" case (w2==0) is irrelevant for this
		     * macro, as in that case w1 and wResult have the same
		     * sign and there is no overflow anyway.
		     */

		    if (Overflowing(w1, ~w2, wResult)) {
			goto overflowBasic;
		    }
		}
		break;

	    case INST_MULT:
		if ((type1 != TCL_NUMBER_LONG) || (type2 != TCL_NUMBER_LONG)
			|| (sizeof(Tcl_WideInt) < 2*sizeof(long))) {
		    goto overflowBasic;
		}
		wResult = w1 * w2;
		break;

	    case INST_DIV:
		if (w2 == 0) {
		    return DIVIDED_BY_ZERO;
		}

		/*
		 * Need a bignum to represent (LLONG_MIN / -1)
		 */

		if ((w1 == LLONG_MIN) && (w2 == -1)) {
		    goto overflowBasic;
		}
		wResult = w1 / w2;

		/*
		 * Force Tcl's integer division rules.
		 * TODO: examine for logic simplification
		 */

		if (((wResult < 0) || ((wResult == 0) &&
			((w1 < 0 && w2 > 0) || (w1 > 0 && w2 < 0)))) &&
			(wResult*w2 != w1)) {
		    wResult -= 1;
		}
		break;

	    default:
		/*
		 * Unused, here to silence compiler warning.
		 */

		wResult = 0;
	    }

	    WIDE_RESULT(wResult);
	}

    overflowBasic:
	Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	mp_init(&bigResult);
	switch (opcode) {
	case INST_ADD:
	    mp_add(&big1, &big2, &bigResult);
	    break;
	case INST_SUB:
	    mp_sub(&big1, &big2, &bigResult);
	    break;
	case INST_MULT:
	    mp_mul(&big1, &big2, &bigResult);
	    break;
	case INST_DIV:
	    if (mp_iszero(&big2)) {
		mp_clear(&big1);
		mp_clear(&big2);
		mp_clear(&bigResult);
		return DIVIDED_BY_ZERO;
	    }
	    mp_init(&bigRemainder);
	    mp_div(&big1, &big2, &bigResult, &bigRemainder);
	    /* TODO: internals intrusion */
	    if (!mp_iszero(&bigRemainder)
		    && (bigRemainder.sign != big2.sign)) {
		/*
		 * Convert to Tcl's integer division rules.
		 */

		mp_sub_d(&bigResult, 1, &bigResult);
		mp_add(&bigRemainder, &big2, &bigRemainder);
	    }
	    mp_clear(&bigRemainder);
	    break;
	}
	mp_clear(&big1);
	mp_clear(&big2);
	BIG_RESULT(&bigResult);
    }

    Tcl_Panic("unexpected opcode");
    return NULL;
}

static Tcl_Obj *
ExecuteExtendedUnaryMathOp(
    int opcode,			/* What operation to perform. */
    Tcl_Obj *valuePtr)		/* The operand on the stack. */
{
    ClientData ptr;
    int type;
    Tcl_WideInt w;
    mp_int big;
    Tcl_Obj *objResultPtr;

    (void) GetNumberFromObj(NULL, valuePtr, &ptr, &type);

    switch (opcode) {
    case INST_BITNOT:
#ifndef NO_WIDE_TYPE
	if (type == TCL_NUMBER_WIDE) {
	    w = *((const Tcl_WideInt *) ptr);
	    WIDE_RESULT(~w);
	}
#endif
	Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
	/* ~a = - a - 1 */
	mp_neg(&big, &big);
	mp_sub_d(&big, 1, &big);
	BIG_RESULT(&big);
    case INST_UMINUS:
	switch (type) {
	case TCL_NUMBER_DOUBLE:
	    DOUBLE_RESULT(-(*((const double *) ptr)));
	case TCL_NUMBER_LONG:
	    w = (Tcl_WideInt) (*((const long *) ptr));
	    if (w != LLONG_MIN) {
		WIDE_RESULT(-w);
	    }
	    TclBNInitBignumFromLong(&big, *(const long *) ptr);
	    break;
#ifndef NO_WIDE_TYPE
	case TCL_NUMBER_WIDE:
	    w = *((const Tcl_WideInt *) ptr);
	    if (w != LLONG_MIN) {
		WIDE_RESULT(-w);
	    }
	    TclBNInitBignumFromWideInt(&big, w);
	    break;
#endif
	default:
	    Tcl_TakeBignumFromObj(NULL, valuePtr, &big);
	}
	mp_neg(&big, &big);
	BIG_RESULT(&big);
    }

    Tcl_Panic("unexpected opcode");
    return NULL;
}
#undef LONG_RESULT
#undef WIDE_RESULT
#undef BIG_RESULT
#undef DOUBLE_RESULT

/*
 *----------------------------------------------------------------------
 *
 * CompareTwoNumbers --
 *
 *	This function compares a pair of numbers in Tcl_Objs. Each argument
 *	must already be known to be numeric and not NaN.
 *
 * Results:
 *	One of MP_LT, MP_EQ or MP_GT, depending on whether valuePtr is less
 *	than, equal to, or greater than value2Ptr (respectively).
 *
 * Side effects:
 *	None, provided both values are numeric.
 *
 *----------------------------------------------------------------------
 */

int
TclCompareTwoNumbers(
    Tcl_Obj *valuePtr,
    Tcl_Obj *value2Ptr)
{
    int type1, type2, compare;
    ClientData ptr1, ptr2;
    mp_int big1, big2;
    double d1, d2, tmp;
    long l1, l2;
    Tcl_WideInt w1, w2;

    (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
    (void) GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);

    switch (type1) {
    case TCL_NUMBER_LONG:
	l1 = *((const long *)ptr1);
	switch (type2) {
	case TCL_NUMBER_LONG:
	    l2 = *((const long *)ptr2);
	longCompare:
	    return (l1 < l2) ? MP_LT : ((l1 > l2) ? MP_GT : MP_EQ);
#ifndef NO_WIDE_TYPE
	case TCL_NUMBER_WIDE:
	    w2 = *((const Tcl_WideInt *)ptr2);
	    w1 = (Tcl_WideInt)l1;
	    goto wideCompare;
#endif
	case TCL_NUMBER_DOUBLE:
	    d2 = *((const double *)ptr2);
	    d1 = (double) l1;

	    /*
	     * If the double has a fractional part, or if the long can be
	     * converted to double without loss of precision, then compare as
	     * doubles.
	     */

	    if (DBL_MANT_DIG > CHAR_BIT*sizeof(long) || l1 == (long) d1
		    || modf(d2, &tmp) != 0.0) {
		goto doubleCompare;
	    }

	    /*
	     * Otherwise, to make comparision based on full precision, need to
	     * convert the double to a suitably sized integer.
	     *
	     * Need this to get comparsions like
	     *	  expr 20000000000000003 < 20000000000000004.0
	     * right. Converting the first argument to double will yield two
	     * double values that are equivalent within double precision.
	     * Converting the double to an integer gets done exactly, then
	     * integer comparison can tell the difference.
	     */

	    if (d2 < (double)LONG_MIN) {
		return MP_GT;
	    }
	    if (d2 > (double)LONG_MAX) {
		return MP_LT;
	    }
	    l2 = (long) d2;
	    goto longCompare;
	case TCL_NUMBER_BIG:
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	    if (mp_cmp_d(&big2, 0) == MP_LT) {
		compare = MP_GT;
	    } else {
		compare = MP_LT;
	    }
	    mp_clear(&big2);
	    return compare;
	}

#ifndef NO_WIDE_TYPE
    case TCL_NUMBER_WIDE:
	w1 = *((const Tcl_WideInt *)ptr1);
	switch (type2) {
	case TCL_NUMBER_WIDE:
	    w2 = *((const Tcl_WideInt *)ptr2);
	wideCompare:
	    return (w1 < w2) ? MP_LT : ((w1 > w2) ? MP_GT : MP_EQ);
	case TCL_NUMBER_LONG:
	    l2 = *((const long *)ptr2);
	    w2 = (Tcl_WideInt)l2;
	    goto wideCompare;
	case TCL_NUMBER_DOUBLE:
	    d2 = *((const double *)ptr2);
	    d1 = (double) w1;
	    if (DBL_MANT_DIG > CHAR_BIT*sizeof(Tcl_WideInt)
		    || w1 == (Tcl_WideInt) d1 || modf(d2, &tmp) != 0.0) {
		goto doubleCompare;
	    }
	    if (d2 < (double)LLONG_MIN) {
		return MP_GT;
	    }
	    if (d2 > (double)LLONG_MAX) {
		return MP_LT;
	    }
	    w2 = (Tcl_WideInt) d2;
	    goto wideCompare;
	case TCL_NUMBER_BIG:
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	    if (mp_cmp_d(&big2, 0) == MP_LT) {
		compare = MP_GT;
	    } else {
		compare = MP_LT;
	    }
	    mp_clear(&big2);
	    return compare;
	}
#endif

    case TCL_NUMBER_DOUBLE:
	d1 = *((const double *)ptr1);
	switch (type2) {
	case TCL_NUMBER_DOUBLE:
	    d2 = *((const double *)ptr2);
	doubleCompare:
	    return (d1 < d2) ? MP_LT : ((d1 > d2) ? MP_GT : MP_EQ);
	case TCL_NUMBER_LONG:
	    l2 = *((const long *)ptr2);
	    d2 = (double) l2;
	    if (DBL_MANT_DIG > CHAR_BIT*sizeof(long) || l2 == (long) d2
		    || modf(d1, &tmp) != 0.0) {
		goto doubleCompare;
	    }
	    if (d1 < (double)LONG_MIN) {
		return MP_LT;
	    }
	    if (d1 > (double)LONG_MAX) {
		return MP_GT;
	    }
	    l1 = (long) d1;
	    goto longCompare;
#ifndef NO_WIDE_TYPE
	case TCL_NUMBER_WIDE:
	    w2 = *((const Tcl_WideInt *)ptr2);
	    d2 = (double) w2;
	    if (DBL_MANT_DIG > CHAR_BIT*sizeof(Tcl_WideInt)
		    || w2 == (Tcl_WideInt) d2 || modf(d1, &tmp) != 0.0) {
		goto doubleCompare;
	    }
	    if (d1 < (double)LLONG_MIN) {
		return MP_LT;
	    }
	    if (d1 > (double)LLONG_MAX) {
		return MP_GT;
	    }
	    w1 = (Tcl_WideInt) d1;
	    goto wideCompare;
#endif
	case TCL_NUMBER_BIG:
	    if (TclIsInfinite(d1)) {
		return (d1 > 0.0) ? MP_GT : MP_LT;
	    }
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	    if ((d1 < (double)LONG_MAX) && (d1 > (double)LONG_MIN)) {
		if (mp_cmp_d(&big2, 0) == MP_LT) {
		    compare = MP_GT;
		} else {
		    compare = MP_LT;
		}
		mp_clear(&big2);
		return compare;
	    }
	    if (DBL_MANT_DIG > CHAR_BIT*sizeof(long)
		    && modf(d1, &tmp) != 0.0) {
		d2 = TclBignumToDouble(&big2);
		mp_clear(&big2);
		goto doubleCompare;
	    }
	    Tcl_InitBignumFromDouble(NULL, d1, &big1);
	    goto bigCompare;
	}

    case TCL_NUMBER_BIG:
	Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	switch (type2) {
#ifndef NO_WIDE_TYPE
	case TCL_NUMBER_WIDE:
#endif
	case TCL_NUMBER_LONG:
	    compare = mp_cmp_d(&big1, 0);
	    mp_clear(&big1);
	    return compare;
	case TCL_NUMBER_DOUBLE:
	    d2 = *((const double *)ptr2);
	    if (TclIsInfinite(d2)) {
		compare = (d2 > 0.0) ? MP_LT : MP_GT;
		mp_clear(&big1);
		return compare;
	    }
	    if ((d2 < (double)LONG_MAX) && (d2 > (double)LONG_MIN)) {
		compare = mp_cmp_d(&big1, 0);
		mp_clear(&big1);
		return compare;
	    }
	    if (DBL_MANT_DIG > CHAR_BIT*sizeof(long)
		    && modf(d2, &tmp) != 0.0) {
		d1 = TclBignumToDouble(&big1);
		mp_clear(&big1);
		goto doubleCompare;
	    }
	    Tcl_InitBignumFromDouble(NULL, d2, &big2);
	    goto bigCompare;
	case TCL_NUMBER_BIG:
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	bigCompare:
	    compare = mp_cmp(&big1, &big2);
	    mp_clear(&big1);
	    mp_clear(&big2);
	    return compare;
	}
    default:
	Tcl_Panic("unexpected number type");
	return TCL_ERROR;
    }
}

#ifdef TCL_COMPILE_DEBUG
/*
 *----------------------------------------------------------------------
 *
 * PrintByteCodeInfo --
 *
Changes to generic/tclIORChan.c.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 *	See TIP #219 for the specification of this functionality.
 *
 * Copyright (c) 2004-2005 ActiveState, a divison of Sophos
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclIORChan.c,v 1.3.2.31 2010/03/30 22:48:46 dgp Exp $
 */

#include <tclInt.h>
#include <tclIO.h>
#include <assert.h>

#ifndef EINVAL
#define EINVAL	9
#endif
#ifndef EOK







|


|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 *	See TIP #219 for the specification of this functionality.
 *
 * Copyright (c) 2004-2005 ActiveState, a divison of Sophos
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclIORChan.c,v 1.3.2.32 2010/04/29 23:32:24 dgp Exp $
 */

#include "tclInt.h"
#include <tclIO.h>
#include <assert.h>

#ifndef EINVAL
#define EINVAL	9
#endif
#ifndef EOK
Changes to generic/tclIORTrans.c.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 *	See TIP #230 for the specification of this functionality.
 *
 * Copyright (c) 2007-2008 ActiveState.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclIORTrans.c,v 1.3.2.12 2010/03/17 17:26:33 dgp Exp $
 */

#include <tclInt.h>
#include <tclIO.h>
#include <assert.h>

#ifndef EINVAL
#define EINVAL	9
#endif
#ifndef EOK







|


|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 *	See TIP #230 for the specification of this functionality.
 *
 * Copyright (c) 2007-2008 ActiveState.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclIORTrans.c,v 1.3.2.13 2010/04/29 23:32:24 dgp Exp $
 */

#include "tclInt.h"
#include <tclIO.h>
#include <assert.h>

#ifndef EINVAL
#define EINVAL	9
#endif
#ifndef EOK
Changes to generic/tclIOUtil.c.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Copyright (c) 1991-1994 The Regents of the University of California.
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright (c) 2001-2004 Vincent Darley.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclIOUtil.c,v 1.81.2.57 2010/04/25 15:40:54 dgp Exp $
 */

#include "tclInt.h"
#ifdef __WIN32__
#   include "tclWinInt.h"
#endif
#include "tclFileSystem.h"







|







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Copyright (c) 1991-1994 The Regents of the University of California.
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright (c) 2001-2004 Vincent Darley.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclIOUtil.c,v 1.81.2.58 2010/04/29 23:32:24 dgp Exp $
 */

#include "tclInt.h"
#ifdef __WIN32__
#   include "tclWinInt.h"
#endif
#include "tclFileSystem.h"
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475

    if (handle == NULL) {
	return TCL_ERROR;
    }

    *clientDataPtr = handle;

    *proc1Ptr = Tcl_FindSymbol(interp, handle, sym1);
    *proc2Ptr = Tcl_FindSymbol(interp, handle, sym2);
    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_FindSymbol --







|
|







3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475

    if (handle == NULL) {
	return TCL_ERROR;
    }

    *clientDataPtr = handle;

    *proc1Ptr = (Tcl_PackageInitProc*) Tcl_FindSymbol(interp, handle, sym1);
    *proc2Ptr = (Tcl_PackageInitProc*) Tcl_FindSymbol(interp, handle, sym2);
    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_FindSymbol --
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
 *	functions. They basically act as a safety net around
 *	Tcl_FSGetInternalRep. Normally your file-system functions will always
 *	be called with path objects already converted to the correct
 *	filesystem, but if for some reason they are called directly (i.e. by
 *	functions not in this file), then one cannot necessarily guarantee
 *	that the path object pointer is from the correct filesystem.
 *
 *	Note: in the future it might be desireable to have separate versions
 *	of this function with different signatures, for example
 *	Tcl_FSGetNativeWinPath, Tcl_FSGetNativeUnixPath etc. Right now, since
 *	native paths are all string based, we use just one function.
 *
 * Results:
 *	NULL or a valid native path.
 *







|







4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
 *	functions. They basically act as a safety net around
 *	Tcl_FSGetInternalRep. Normally your file-system functions will always
 *	be called with path objects already converted to the correct
 *	filesystem, but if for some reason they are called directly (i.e. by
 *	functions not in this file), then one cannot necessarily guarantee
 *	that the path object pointer is from the correct filesystem.
 *
 *	Note: in the future it might be desirable to have separate versions
 *	of this function with different signatures, for example
 *	Tcl_FSGetNativeWinPath, Tcl_FSGetNativeUnixPath etc. Right now, since
 *	native paths are all string based, we use just one function.
 *
 * Results:
 *	NULL or a valid native path.
 *
Changes to generic/tclInt.h.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
 * Copyright (c) 2008 by Miguel Sofer. All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclInt.h,v 1.127.2.145 2010/04/25 15:40:54 dgp Exp $
 */

#ifndef _TCLINT
#define _TCLINT

/*
 * Some numerics configuration options.







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 * Copyright (c) 2006-2008 by Joe Mistachkin.  All rights reserved.
 * Copyright (c) 2008 by Miguel Sofer. All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclInt.h,v 1.127.2.146 2010/04/29 23:32:24 dgp Exp $
 */

#ifndef _TCLINT
#define _TCLINT

/*
 * Some numerics configuration options.
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 */

#include "tclPort.h"

#include <stdio.h>

#include <ctype.h>
#ifdef NO_LIMITS_H
#   include "../compat/limits.h"
#else
#   include <limits.h>
#endif
#ifdef NO_STDLIB_H
#   include "../compat/stdlib.h"
#else
#   include <stdlib.h>
#endif
#ifdef NO_STRING_H
#include "../compat/string.h"







<
<
<
<
<







38
39
40
41
42
43
44





45
46
47
48
49
50
51
 */

#include "tclPort.h"

#include <stdio.h>

#include <ctype.h>





#ifdef NO_STDLIB_H
#   include "../compat/stdlib.h"
#else
#   include <stdlib.h>
#endif
#ifdef NO_STRING_H
#include "../compat/string.h"
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
    (   !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ)) \
    &&  (varPtr)->value.objPtr)

#define TclIsVarDirectWritable(varPtr) \
    !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH))

#define TclIsVarDirectUnsettable(varPtr) \
    !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_UNSET|VAR_DEAD_HASH))

#define TclIsVarDirectModifyable(varPtr) \
    (   !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE)) \
    &&  (varPtr)->value.objPtr)

#define TclIsVarDirectReadable2(varPtr, arrayPtr) \
    (TclIsVarDirectReadable(varPtr) &&\







|







881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
    (   !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ)) \
    &&  (varPtr)->value.objPtr)

#define TclIsVarDirectWritable(varPtr) \
    !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_WRITE|VAR_DEAD_HASH))

#define TclIsVarDirectUnsettable(varPtr) \
    !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE|VAR_TRACED_UNSET|VAR_DEAD_HASH))

#define TclIsVarDirectModifyable(varPtr) \
    (   !((varPtr)->flags & (VAR_ARRAY|VAR_LINK|VAR_TRACED_READ|VAR_TRACED_WRITE)) \
    &&  (varPtr)->value.objPtr)

#define TclIsVarDirectReadable2(varPtr, arrayPtr) \
    (TclIsVarDirectReadable(varPtr) &&\
2878
2879
2880
2881
2882
2883
2884


2885
2886
2887
2888
2889
2890
2891

/*
 *----------------------------------------------------------------
 * Procedures shared among Tcl modules but not used by the outside world:
 *----------------------------------------------------------------
 */



MODULE_SCOPE int	TclNREvalCmd(Tcl_Interp *interp, Tcl_Obj *objPtr,
			    int flags);
MODULE_SCOPE void	TclPushTailcallPoint(Tcl_Interp *interp);
MODULE_SCOPE void	TclAdvanceContinuations(int *line, int **next,
			    int loc);
MODULE_SCOPE void	TclAdvanceLines(int *line, const char *start,
			    const char *end);







>
>







2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888

/*
 *----------------------------------------------------------------
 * Procedures shared among Tcl modules but not used by the outside world:
 *----------------------------------------------------------------
 */

MODULE_SCOPE void	TclAppendBytesToByteArray(Tcl_Obj *objPtr,
			    const unsigned char *bytes, unsigned len);
MODULE_SCOPE int	TclNREvalCmd(Tcl_Interp *interp, Tcl_Obj *objPtr,
			    int flags);
MODULE_SCOPE void	TclPushTailcallPoint(Tcl_Interp *interp);
MODULE_SCOPE void	TclAdvanceContinuations(int *line, int **next,
			    int loc);
MODULE_SCOPE void	TclAdvanceLines(int *line, const char *start,
			    const char *end);
Changes to generic/tclOOInt.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * tclOOInt.h --
 *
 *	This file contains the structure definitions and some of the function
 *	declarations for the object-system (NB: not Tcl_Obj, but ::oo).
 *
 * Copyright (c) 2006 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.
 *
 * RCS: @(#) $Id: tclOOInt.h,v 1.2.2.15 2010/03/06 03:40:56 dgp Exp $
 */

#ifndef TCL_OO_INTERNAL_H
#define TCL_OO_INTERNAL_H 1

#include <tclInt.h>
#include "tclOO.h"

/*
 * Hack to make things work with Objective C. Note that ObjC isn't really
 * supported, but we don't want to to be actively hostile to it. [Bug 2163447]
 */












|





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * tclOOInt.h --
 *
 *	This file contains the structure definitions and some of the function
 *	declarations for the object-system (NB: not Tcl_Obj, but ::oo).
 *
 * Copyright (c) 2006 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.
 *
 * RCS: @(#) $Id: tclOOInt.h,v 1.2.2.16 2010/04/29 23:32:24 dgp Exp $
 */

#ifndef TCL_OO_INTERNAL_H
#define TCL_OO_INTERNAL_H 1

#include "tclInt.h"
#include "tclOO.h"

/*
 * Hack to make things work with Objective C. Note that ObjC isn't really
 * supported, but we don't want to to be actively hostile to it. [Bug 2163447]
 */

Changes to generic/tclObj.c.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 * Copyright (c) 2001 by ActiveState Corporation.
 * Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclObj.c,v 1.46.2.73 2010/03/30 16:51:04 dgp Exp $
 */

#include "tclInt.h"
#include "tommath.h"
#include <float.h>
#include <math.h>

/*
 * Table of all object types.
 */

static Tcl_HashTable typeTable;







|




<







9
10
11
12
13
14
15
16
17
18
19
20

21
22
23
24
25
26
27
 * Copyright (c) 2001 by ActiveState Corporation.
 * Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
 * Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclObj.c,v 1.46.2.74 2010/04/29 23:32:24 dgp Exp $
 */

#include "tclInt.h"
#include "tommath.h"

#include <math.h>

/*
 * Table of all object types.
 */

static Tcl_HashTable typeTable;
Changes to generic/tclStrToD.c.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 *	'double' and 'mp_int' types.
 *
 * Copyright (c) 2005 by Kevin B. Kenny. All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclStrToD.c,v 1.4.2.27 2010/04/02 23:48:14 dgp Exp $
 *
 *----------------------------------------------------------------------
 */

#include <tclInt.h>
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <ctype.h>
#include <tommath.h>

/*
 * Define KILL_OCTAL to suppress interpretation of numbers with leading zero
 * as octal. (Ceterum censeo: numeros octonarios delendos esse.)
 */

#undef	KILL_OCTAL







|




<
|
<
<
<
|
|
<







10
11
12
13
14
15
16
17
18
19
20
21

22



23
24

25
26
27
28
29
30
31
 *	'double' and 'mp_int' types.
 *
 * Copyright (c) 2005 by Kevin B. Kenny. All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclStrToD.c,v 1.4.2.28 2010/04/29 23:32:24 dgp Exp $
 *
 *----------------------------------------------------------------------
 */


#include "tclInt.h"



#include "tommath.h"
#include <math.h>


/*
 * Define KILL_OCTAL to suppress interpretation of numbers with leading zero
 * as octal. (Ceterum censeo: numeros octonarios delendos esse.)
 */

#undef	KILL_OCTAL
Changes to generic/tclStringObj.c.
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 *
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 * Copyright (c) 1999 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclStringObj.c,v 1.32.4.49 2010/03/30 02:29:18 dgp Exp $ */

#include "tclInt.h"
#include "tommath.h"

/*
 * Set COMPAT to 1 to restore the shimmering patterns to those of Tcl 8.5.
 * This is an escape hatch in case the changes have some unexpected unwelcome







|







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 *
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 * Copyright (c) 1999 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclStringObj.c,v 1.32.4.50 2010/04/29 23:32:24 dgp Exp $ */

#include "tclInt.h"
#include "tommath.h"

/*
 * Set COMPAT to 1 to restore the shimmering patterns to those of Tcl 8.5.
 * This is an escape hatch in case the changes have some unexpected unwelcome
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
     * Handle append of one bytearray object to another as a special case.
     * Note that we only do this when the objects don't have string reps; if
     * it did, then appending the byte arrays together could well lose
     * information; this is a special-case optimization only.
     */

    if (TclIsPureByteArray(objPtr) && TclIsPureByteArray(appendObjPtr)) {
	unsigned char *bytesDst, *bytesSrc;
	int lengthSrc, lengthTotal;

	/*
	 * We do not assume that objPtr and appendObjPtr must be distinct!
	 * This makes this code a bit more complex than it otherwise would be,
	 * but in turn makes it much safer.
	 */

	(void) Tcl_GetByteArrayFromObj(objPtr, &length);
	(void) Tcl_GetByteArrayFromObj(appendObjPtr, &lengthSrc);
	lengthTotal = length + lengthSrc;
	if (((length > lengthSrc) ? length : lengthSrc) > lengthTotal) {
	    Tcl_Panic("overflow when calculating byte array size");
	}
	bytesDst = Tcl_SetByteArrayLength(objPtr, lengthTotal);
	bytesSrc = Tcl_GetByteArrayFromObj(appendObjPtr, NULL);
	memcpy(bytesDst + length, bytesSrc, lengthSrc);
	return;
    }

    /*
     * Must append as strings.
     */








|














<

|







1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252

1253
1254
1255
1256
1257
1258
1259
1260
1261
     * Handle append of one bytearray object to another as a special case.
     * Note that we only do this when the objects don't have string reps; if
     * it did, then appending the byte arrays together could well lose
     * information; this is a special-case optimization only.
     */

    if (TclIsPureByteArray(objPtr) && TclIsPureByteArray(appendObjPtr)) {
	unsigned char *bytesSrc;
	int lengthSrc, lengthTotal;

	/*
	 * We do not assume that objPtr and appendObjPtr must be distinct!
	 * This makes this code a bit more complex than it otherwise would be,
	 * but in turn makes it much safer.
	 */

	(void) Tcl_GetByteArrayFromObj(objPtr, &length);
	(void) Tcl_GetByteArrayFromObj(appendObjPtr, &lengthSrc);
	lengthTotal = length + lengthSrc;
	if (((length > lengthSrc) ? length : lengthSrc) > lengthTotal) {
	    Tcl_Panic("overflow when calculating byte array size");
	}

	bytesSrc = Tcl_GetByteArrayFromObj(appendObjPtr, NULL);
	TclAppendBytesToByteArray(objPtr, bytesSrc, (unsigned) lengthSrc);
	return;
    }

    /*
     * Must append as strings.
     */

Changes to generic/tclTomMath.h.
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 * guarantee it works.
 *
 * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
 */
#ifndef BN_H_
#define BN_H_


#include <tclTomMathDecls.h>
#ifndef MODULE_SCOPE
#define MODULE_SCOPE extern
#endif

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>

#ifndef MIN
   #define MIN(x,y) ((x)<(y)?(x):(y))
#endif

#ifndef MAX
   #define MAX(x,y) ((x)>(y)?(x):(y))
#endif







>





<
<
<
<
<
<







11
12
13
14
15
16
17
18
19
20
21
22
23






24
25
26
27
28
29
30
 * guarantee it works.
 *
 * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
 */
#ifndef BN_H_
#define BN_H_

#include "tclInt.h"
#include <tclTomMathDecls.h>
#ifndef MODULE_SCOPE
#define MODULE_SCOPE extern
#endif







#ifndef MIN
   #define MIN(x,y) ((x)<(y)?(x):(y))
#endif

#ifndef MAX
   #define MAX(x,y) ((x)>(y)?(x):(y))
#endif
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
*/

#if defined(BUILD_tcl) || !defined(_WIN32)
MODULE_SCOPE const char *mp_s_rmap;
#endif

#ifdef __cplusplus
   }
#endif

#endif


/* $Source: /root/tcl/repos-to-convert/tcl/generic/tclTomMath.h,v $ */
/* Based on Tom's version 1.8 */
/* $Revision: 1.2.2.8 $ */
/* $Date: 2009/10/07 23:17:04 $ */








|







|
|

821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
*/

#if defined(BUILD_tcl) || !defined(_WIN32)
MODULE_SCOPE const char *mp_s_rmap;
#endif

#ifdef __cplusplus
}
#endif

#endif


/* $Source: /root/tcl/repos-to-convert/tcl/generic/tclTomMath.h,v $ */
/* Based on Tom's version 1.8 */
/* $Revision: 1.2.2.9 $ */
/* $Date: 2010/04/29 23:32:24 $ */

Changes to generic/tclTomMathInterface.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 *----------------------------------------------------------------------
 *
 * tclTomMathInterface.c --
 *
 *	This file contains procedures that are used as a 'glue' layer between
 *	Tcl and libtommath.
 *
 * Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclTomMathInterface.c,v 1.2.2.11 2010/02/25 21:53:08 dgp Exp $
 */

#include "tclInt.h"
#include "tommath.h"
#include <limits.h>

MODULE_SCOPE const TclTomMathStubs tclTomMathStubs;

/*
 *----------------------------------------------------------------------
 *
 * TclTommath_Init --













|




<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
/*
 *----------------------------------------------------------------------
 *
 * tclTomMathInterface.c --
 *
 *	This file contains procedures that are used as a 'glue' layer between
 *	Tcl and libtommath.
 *
 * Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclTomMathInterface.c,v 1.2.2.12 2010/04/29 23:32:24 dgp Exp $
 */

#include "tclInt.h"
#include "tommath.h"


MODULE_SCOPE const TclTomMathStubs tclTomMathStubs;

/*
 *----------------------------------------------------------------------
 *
 * TclTommath_Init --
Changes to generic/tclUtil.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * tclUtil.c --
 *
 *	This file contains utility functions that are used by many Tcl
 *	commands.
 *
 * Copyright (c) 1987-1993 The Regents of the University of California.
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 * Copyright (c) 2001 by Kevin B. Kenny. All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclUtil.c,v 1.37.2.44 2010/03/06 03:40:56 dgp Exp $
 */

#include "tclInt.h"
#include <float.h>
#include <math.h>

/*
 * The absolute pathname of the executable in which this Tcl library is
 * running.
 */














|



<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
/*
 * tclUtil.c --
 *
 *	This file contains utility functions that are used by many Tcl
 *	commands.
 *
 * Copyright (c) 1987-1993 The Regents of the University of California.
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 * Copyright (c) 2001 by Kevin B. Kenny. All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclUtil.c,v 1.37.2.45 2010/04/29 23:32:24 dgp Exp $
 */

#include "tclInt.h"

#include <math.h>

/*
 * The absolute pathname of the executable in which this Tcl library is
 * running.
 */

Changes to library/platform/pkgIndex.tcl.
1
2
3
package ifneeded platform        1.0.6 [list source [file join $dir platform.tcl]]
package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]]

|


1
2
3
package ifneeded platform        1.0.7 [list source [file join $dir platform.tcl]]
package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]]

Changes to library/platform/platform.tcl.
171
172
173
174
175
176
177









178

179

180

181
182

183
184




185
186
187
188
189
190
191
	}
	linux {
	    # Look for the libc*.so and determine its version
	    # (libc5/6, libc6 further glibc 2.X)

	    set v unknown










	    if {[file exists /lib64] &&

		[file isdirectory /lib64] &&

		[llength [glob -nocomplain -directory /lib64 libc*]]

	    } {
		set base /lib64

	    } else {
		set base /lib




	    }

	    set libclist [lsort [glob -nocomplain -directory $base libc*]]
	    if {[llength $libclist]} {
		set libc [lindex $libclist 0]

		# Try executing the library first. This should suceed







>
>
>
>
>
>
>
>
>
|
>
|
>
|
>
|
|
>
|
|
>
>
>
>







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
	}
	linux {
	    # Look for the libc*.so and determine its version
	    # (libc5/6, libc6 further glibc 2.X)

	    set v unknown

	    # Determine in which directory to look. /lib, or /lib64.
	    # For that we use the tcl_platform(wordSize).
	    #
	    # We could use the 'cpu' info, per the equivalence below,
	    # that however would be restricted to intel. And this may
	    # be a arm, mips, etc. system. The wordsize is more
	    # fundamental.
	    #
	    # ix86   <=> (wordSize == 4) <=> 32 bit ==> /lib
	    # x86_64 <=> (wordSize == 8) <=> 64 bit ==> /lib64
	    #
	    # Do not look into /lib64 even if present, if the cpu
	    # doesn't fit.

	    switch -exact -- $tcl_platform(wordSize) {
		4 {
		    set base /lib
		}
		8 {
		    set base /lib64
		}
		default {
		    return -code error "Bad wordSize $tcl_platform(wordSize), expected 4 or 8"
		}
	    }

	    set libclist [lsort [glob -nocomplain -directory $base libc*]]
	    if {[llength $libclist]} {
		set libc [lindex $libclist 0]

		# Try executing the library first. This should suceed
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
    return $res
}


# ### ### ### ######### ######### #########
## Ready

package provide platform 1.0.6

# ### ### ### ######### ######### #########
## Demo application

if {[info exists argv0] && ($argv0 eq [info script])} {
    puts ====================================
    parray tcl_platform







|







305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
    return $res
}


# ### ### ### ######### ######### #########
## Ready

package provide platform 1.0.7

# ### ### ### ######### ######### #########
## Demo application

if {[info exists argv0] && ($argv0 eq [info script])} {
    puts ====================================
    parray tcl_platform
Changes to library/tzdata/Africa/Casablanca.
21
22
23
24
25
26
27


28
    {271033200 0 0 WET}
    {448243200 3600 0 CET}
    {504918000 0 0 WET}
    {1212278400 3600 1 WEST}
    {1220223600 0 0 WET}
    {1243814400 3600 1 WEST}
    {1250809200 0 0 WET}


}







>
>

21
22
23
24
25
26
27
28
29
30
    {271033200 0 0 WET}
    {448243200 3600 0 CET}
    {504918000 0 0 WET}
    {1212278400 3600 1 WEST}
    {1220223600 0 0 WET}
    {1243814400 3600 1 WEST}
    {1250809200 0 0 WET}
    {1272758400 3600 1 WEST}
    {1281222000 0 0 WET}
}
Changes to library/tzdata/Africa/Tunis.
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
    {1128038400 3600 0 CET}
    {1143334800 7200 1 CEST}
    {1162083600 3600 0 CET}
    {1174784400 7200 1 CEST}
    {1193533200 3600 0 CET}
    {1206838800 7200 1 CEST}
    {1224982800 3600 0 CET}
    {1269738000 7200 1 CEST}
    {1288486800 3600 0 CET}
    {1301187600 7200 1 CEST}
    {1319936400 3600 0 CET}
    {1332637200 7200 1 CEST}
    {1351386000 3600 0 CET}
    {1364691600 7200 1 CEST}
    {1382835600 3600 0 CET}
    {1396141200 7200 1 CEST}
    {1414285200 3600 0 CET}
    {1427590800 7200 1 CEST}
    {1445734800 3600 0 CET}
    {1459040400 7200 1 CEST}
    {1477789200 3600 0 CET}
    {1490490000 7200 1 CEST}
    {1509238800 3600 0 CET}
    {1521939600 7200 1 CEST}
    {1540688400 3600 0 CET}
    {1553994000 7200 1 CEST}
    {1572138000 3600 0 CET}
    {1585443600 7200 1 CEST}
    {1603587600 3600 0 CET}
    {1616893200 7200 1 CEST}
    {1635642000 3600 0 CET}
    {1648342800 7200 1 CEST}
    {1667091600 3600 0 CET}
    {1679792400 7200 1 CEST}
    {1698541200 3600 0 CET}
    {1711846800 7200 1 CEST}
    {1729990800 3600 0 CET}
    {1743296400 7200 1 CEST}
    {1761440400 3600 0 CET}
    {1774746000 7200 1 CEST}
    {1792890000 3600 0 CET}
    {1806195600 7200 1 CEST}
    {1824944400 3600 0 CET}
    {1837645200 7200 1 CEST}
    {1856394000 3600 0 CET}
    {1869094800 7200 1 CEST}
    {1887843600 3600 0 CET}
    {1901149200 7200 1 CEST}
    {1919293200 3600 0 CET}
    {1932598800 7200 1 CEST}
    {1950742800 3600 0 CET}
    {1964048400 7200 1 CEST}
    {1982797200 3600 0 CET}
    {1995498000 7200 1 CEST}
    {2014246800 3600 0 CET}
    {2026947600 7200 1 CEST}
    {2045696400 3600 0 CET}
    {2058397200 7200 1 CEST}
    {2077146000 3600 0 CET}
    {2090451600 7200 1 CEST}
    {2108595600 3600 0 CET}
    {2121901200 7200 1 CEST}
    {2140045200 3600 0 CET}
    {2153350800 7200 1 CEST}
    {2172099600 3600 0 CET}
    {2184800400 7200 1 CEST}
    {2203549200 3600 0 CET}
    {2216250000 7200 1 CEST}
    {2234998800 3600 0 CET}
    {2248304400 7200 1 CEST}
    {2266448400 3600 0 CET}
    {2279754000 7200 1 CEST}
    {2297898000 3600 0 CET}
    {2311203600 7200 1 CEST}
    {2329347600 3600 0 CET}
    {2342653200 7200 1 CEST}
    {2361402000 3600 0 CET}
    {2374102800 7200 1 CEST}
    {2392851600 3600 0 CET}
    {2405552400 7200 1 CEST}
    {2424301200 3600 0 CET}
    {2437606800 7200 1 CEST}
    {2455750800 3600 0 CET}
    {2469056400 7200 1 CEST}
    {2487200400 3600 0 CET}
    {2500506000 7200 1 CEST}
    {2519254800 3600 0 CET}
    {2531955600 7200 1 CEST}
    {2550704400 3600 0 CET}
    {2563405200 7200 1 CEST}
    {2582154000 3600 0 CET}
    {2595459600 7200 1 CEST}
    {2613603600 3600 0 CET}
    {2626909200 7200 1 CEST}
    {2645053200 3600 0 CET}
    {2658358800 7200 1 CEST}
    {2676502800 3600 0 CET}
    {2689808400 7200 1 CEST}
    {2708557200 3600 0 CET}
    {2721258000 7200 1 CEST}
    {2740006800 3600 0 CET}
    {2752707600 7200 1 CEST}
    {2771456400 3600 0 CET}
    {2784762000 7200 1 CEST}
    {2802906000 3600 0 CET}
    {2816211600 7200 1 CEST}
    {2834355600 3600 0 CET}
    {2847661200 7200 1 CEST}
    {2866410000 3600 0 CET}
    {2879110800 7200 1 CEST}
    {2897859600 3600 0 CET}
    {2910560400 7200 1 CEST}
    {2929309200 3600 0 CET}
    {2942010000 7200 1 CEST}
    {2960758800 3600 0 CET}
    {2974064400 7200 1 CEST}
    {2992208400 3600 0 CET}
    {3005514000 7200 1 CEST}
    {3023658000 3600 0 CET}
    {3036963600 7200 1 CEST}
    {3055712400 3600 0 CET}
    {3068413200 7200 1 CEST}
    {3087162000 3600 0 CET}
    {3099862800 7200 1 CEST}
    {3118611600 3600 0 CET}
    {3131917200 7200 1 CEST}
    {3150061200 3600 0 CET}
    {3163366800 7200 1 CEST}
    {3181510800 3600 0 CET}
    {3194816400 7200 1 CEST}
    {3212960400 3600 0 CET}
    {3226266000 7200 1 CEST}
    {3245014800 3600 0 CET}
    {3257715600 7200 1 CEST}
    {3276464400 3600 0 CET}
    {3289165200 7200 1 CEST}
    {3307914000 3600 0 CET}
    {3321219600 7200 1 CEST}
    {3339363600 3600 0 CET}
    {3352669200 7200 1 CEST}
    {3370813200 3600 0 CET}
    {3384118800 7200 1 CEST}
    {3402867600 3600 0 CET}
    {3415568400 7200 1 CEST}
    {3434317200 3600 0 CET}
    {3447018000 7200 1 CEST}
    {3465766800 3600 0 CET}
    {3479072400 7200 1 CEST}
    {3497216400 3600 0 CET}
    {3510522000 7200 1 CEST}
    {3528666000 3600 0 CET}
    {3541971600 7200 1 CEST}
    {3560115600 3600 0 CET}
    {3573421200 7200 1 CEST}
    {3592170000 3600 0 CET}
    {3604870800 7200 1 CEST}
    {3623619600 3600 0 CET}
    {3636320400 7200 1 CEST}
    {3655069200 3600 0 CET}
    {3668374800 7200 1 CEST}
    {3686518800 3600 0 CET}
    {3699824400 7200 1 CEST}
    {3717968400 3600 0 CET}
    {3731274000 7200 1 CEST}
    {3750022800 3600 0 CET}
    {3762723600 7200 1 CEST}
    {3781472400 3600 0 CET}
    {3794173200 7200 1 CEST}
    {3812922000 3600 0 CET}
    {3825622800 7200 1 CEST}
    {3844371600 3600 0 CET}
    {3857677200 7200 1 CEST}
    {3875821200 3600 0 CET}
    {3889126800 7200 1 CEST}
    {3907270800 3600 0 CET}
    {3920576400 7200 1 CEST}
    {3939325200 3600 0 CET}
    {3952026000 7200 1 CEST}
    {3970774800 3600 0 CET}
    {3983475600 7200 1 CEST}
    {4002224400 3600 0 CET}
    {4015530000 7200 1 CEST}
    {4033674000 3600 0 CET}
    {4046979600 7200 1 CEST}
    {4065123600 3600 0 CET}
    {4078429200 7200 1 CEST}
    {4096573200 3600 0 CET}
}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

32
33
34
35
36
37
38




















































































































































































39
    {1128038400 3600 0 CET}
    {1143334800 7200 1 CEST}
    {1162083600 3600 0 CET}
    {1174784400 7200 1 CEST}
    {1193533200 3600 0 CET}
    {1206838800 7200 1 CEST}
    {1224982800 3600 0 CET}




















































































































































































}
Changes to library/tzdata/America/Argentina/San_Luis.
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
    {1090728000 -10800 0 ART}
    {1198983600 -7200 1 ARST}
    {1200880800 -10800 0 WART}
    {1205031600 -14400 0 WART}
    {1223784000 -10800 1 WARST}
    {1236481200 -14400 0 WART}
    {1255233600 -10800 1 WARST}
    {1268535600 -14400 0 WART}
    {1286683200 -10800 1 WARST}
    {1299985200 -14400 0 WART}
    {1318132800 -10800 1 WARST}
    {1331434800 -14400 0 WART}
    {1350187200 -10800 1 WARST}
    {1362884400 -14400 0 WART}
    {1381636800 -10800 1 WARST}
    {1394334000 -14400 0 WART}
    {1413086400 -10800 1 WARST}
    {1425783600 -14400 0 WART}
    {1444536000 -10800 1 WARST}
    {1457838000 -14400 0 WART}
    {1475985600 -10800 1 WARST}
    {1489287600 -14400 0 WART}
    {1507435200 -10800 1 WARST}
    {1520737200 -14400 0 WART}
    {1539489600 -10800 1 WARST}
    {1552186800 -14400 0 WART}
    {1570939200 -10800 1 WARST}
    {1583636400 -14400 0 WART}
    {1602388800 -10800 1 WARST}
    {1615690800 -14400 0 WART}
    {1633838400 -10800 1 WARST}
    {1647140400 -14400 0 WART}
    {1665288000 -10800 1 WARST}
    {1678590000 -14400 0 WART}
    {1696737600 -10800 1 WARST}
    {1710039600 -14400 0 WART}
    {1728792000 -10800 1 WARST}
    {1741489200 -14400 0 WART}
    {1760241600 -10800 1 WARST}
    {1772938800 -14400 0 WART}
    {1791691200 -10800 1 WARST}
    {1804993200 -14400 0 WART}
    {1823140800 -10800 1 WARST}
    {1836442800 -14400 0 WART}
    {1854590400 -10800 1 WARST}
    {1867892400 -14400 0 WART}
    {1886644800 -10800 1 WARST}
    {1899342000 -14400 0 WART}
    {1918094400 -10800 1 WARST}
    {1930791600 -14400 0 WART}
    {1949544000 -10800 1 WARST}
    {1962846000 -14400 0 WART}
    {1980993600 -10800 1 WARST}
    {1994295600 -14400 0 WART}
    {2012443200 -10800 1 WARST}
    {2025745200 -14400 0 WART}
    {2043892800 -10800 1 WARST}
    {2057194800 -14400 0 WART}
    {2075947200 -10800 1 WARST}
    {2088644400 -14400 0 WART}
    {2107396800 -10800 1 WARST}
    {2120094000 -14400 0 WART}
    {2138846400 -10800 1 WARST}
    {2152148400 -14400 0 WART}
    {2170296000 -10800 1 WARST}
    {2183598000 -14400 0 WART}
    {2201745600 -10800 1 WARST}
    {2215047600 -14400 0 WART}
    {2233800000 -10800 1 WARST}
    {2246497200 -14400 0 WART}
    {2265249600 -10800 1 WARST}
    {2277946800 -14400 0 WART}
    {2296699200 -10800 1 WARST}
    {2309396400 -14400 0 WART}
    {2328148800 -10800 1 WARST}
    {2341450800 -14400 0 WART}
    {2359598400 -10800 1 WARST}
    {2372900400 -14400 0 WART}
    {2391048000 -10800 1 WARST}
    {2404350000 -14400 0 WART}
    {2423102400 -10800 1 WARST}
    {2435799600 -14400 0 WART}
    {2454552000 -10800 1 WARST}
    {2467249200 -14400 0 WART}
    {2486001600 -10800 1 WARST}
    {2499303600 -14400 0 WART}
    {2517451200 -10800 1 WARST}
    {2530753200 -14400 0 WART}
    {2548900800 -10800 1 WARST}
    {2562202800 -14400 0 WART}
    {2580350400 -10800 1 WARST}
    {2593652400 -14400 0 WART}
    {2612404800 -10800 1 WARST}
    {2625102000 -14400 0 WART}
    {2643854400 -10800 1 WARST}
    {2656551600 -14400 0 WART}
    {2675304000 -10800 1 WARST}
    {2688606000 -14400 0 WART}
    {2706753600 -10800 1 WARST}
    {2720055600 -14400 0 WART}
    {2738203200 -10800 1 WARST}
    {2751505200 -14400 0 WART}
    {2770257600 -10800 1 WARST}
    {2782954800 -14400 0 WART}
    {2801707200 -10800 1 WARST}
    {2814404400 -14400 0 WART}
    {2833156800 -10800 1 WARST}
    {2846458800 -14400 0 WART}
    {2864606400 -10800 1 WARST}
    {2877908400 -14400 0 WART}
    {2896056000 -10800 1 WARST}
    {2909358000 -14400 0 WART}
    {2927505600 -10800 1 WARST}
    {2940807600 -14400 0 WART}
    {2959560000 -10800 1 WARST}
    {2972257200 -14400 0 WART}
    {2991009600 -10800 1 WARST}
    {3003706800 -14400 0 WART}
    {3022459200 -10800 1 WARST}
    {3035761200 -14400 0 WART}
    {3053908800 -10800 1 WARST}
    {3067210800 -14400 0 WART}
    {3085358400 -10800 1 WARST}
    {3098660400 -14400 0 WART}
    {3117412800 -10800 1 WARST}
    {3130110000 -14400 0 WART}
    {3148862400 -10800 1 WARST}
    {3161559600 -14400 0 WART}
    {3180312000 -10800 1 WARST}
    {3193009200 -14400 0 WART}
    {3211761600 -10800 1 WARST}
    {3225063600 -14400 0 WART}
    {3243211200 -10800 1 WARST}
    {3256513200 -14400 0 WART}
    {3274660800 -10800 1 WARST}
    {3287962800 -14400 0 WART}
    {3306715200 -10800 1 WARST}
    {3319412400 -14400 0 WART}
    {3338164800 -10800 1 WARST}
    {3350862000 -14400 0 WART}
    {3369614400 -10800 1 WARST}
    {3382916400 -14400 0 WART}
    {3401064000 -10800 1 WARST}
    {3414366000 -14400 0 WART}
    {3432513600 -10800 1 WARST}
    {3445815600 -14400 0 WART}
    {3463963200 -10800 1 WARST}
    {3477265200 -14400 0 WART}
    {3496017600 -10800 1 WARST}
    {3508714800 -14400 0 WART}
    {3527467200 -10800 1 WARST}
    {3540164400 -14400 0 WART}
    {3558916800 -10800 1 WARST}
    {3572218800 -14400 0 WART}
    {3590366400 -10800 1 WARST}
    {3603668400 -14400 0 WART}
    {3621816000 -10800 1 WARST}
    {3635118000 -14400 0 WART}
    {3653870400 -10800 1 WARST}
    {3666567600 -14400 0 WART}
    {3685320000 -10800 1 WARST}
    {3698017200 -14400 0 WART}
    {3716769600 -10800 1 WARST}
    {3730071600 -14400 0 WART}
    {3748219200 -10800 1 WARST}
    {3761521200 -14400 0 WART}
    {3779668800 -10800 1 WARST}
    {3792970800 -14400 0 WART}
    {3811118400 -10800 1 WARST}
    {3824420400 -14400 0 WART}
    {3843172800 -10800 1 WARST}
    {3855870000 -14400 0 WART}
    {3874622400 -10800 1 WARST}
    {3887319600 -14400 0 WART}
    {3906072000 -10800 1 WARST}
    {3919374000 -14400 0 WART}
    {3937521600 -10800 1 WARST}
    {3950823600 -14400 0 WART}
    {3968971200 -10800 1 WARST}
    {3982273200 -14400 0 WART}
    {4001025600 -10800 1 WARST}
    {4013722800 -14400 0 WART}
    {4032475200 -10800 1 WARST}
    {4045172400 -14400 0 WART}
    {4063924800 -10800 1 WARST}
    {4076622000 -14400 0 WART}
    {4095374400 -10800 1 WARST}
}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

61
62
63
64
65
66
67




















































































































































































68
    {1090728000 -10800 0 ART}
    {1198983600 -7200 1 ARST}
    {1200880800 -10800 0 WART}
    {1205031600 -14400 0 WART}
    {1223784000 -10800 1 WARST}
    {1236481200 -14400 0 WART}
    {1255233600 -10800 1 WARST}




















































































































































































}
Changes to library/tzdata/America/Santiago.
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
    {1160884800 -10800 1 CLST}
    {1173582000 -14400 0 CLT}
    {1192334400 -10800 1 CLST}
    {1206846000 -14400 0 CLT}
    {1223784000 -10800 1 CLST}
    {1237086000 -14400 0 CLT}
    {1255233600 -10800 1 CLST}
    {1268535600 -14400 0 CLT}
    {1286683200 -10800 1 CLST}
    {1299985200 -14400 0 CLT}
    {1318132800 -10800 1 CLST}
    {1331434800 -14400 0 CLT}
    {1350187200 -10800 1 CLST}
    {1362884400 -14400 0 CLT}
    {1381636800 -10800 1 CLST}







|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
    {1160884800 -10800 1 CLST}
    {1173582000 -14400 0 CLT}
    {1192334400 -10800 1 CLST}
    {1206846000 -14400 0 CLT}
    {1223784000 -10800 1 CLST}
    {1237086000 -14400 0 CLT}
    {1255233600 -10800 1 CLST}
    {1270350000 -14400 0 CLT}
    {1286683200 -10800 1 CLST}
    {1299985200 -14400 0 CLT}
    {1318132800 -10800 1 CLST}
    {1331434800 -14400 0 CLT}
    {1350187200 -10800 1 CLST}
    {1362884400 -14400 0 CLT}
    {1381636800 -10800 1 CLST}
Changes to library/tzdata/Antarctica/Casey.
1
2
3
4
5
6

7
# created by tools/tclZIC.tcl - do not edit

set TZData(:Antarctica/Casey) {
    {-9223372036854775808 0 0 zzz}
    {-31536000 28800 0 WST}
    {1255802400 39600 0 CAST}

}






>

1
2
3
4
5
6
7
8
# created by tools/tclZIC.tcl - do not edit

set TZData(:Antarctica/Casey) {
    {-9223372036854775808 0 0 zzz}
    {-31536000 28800 0 WST}
    {1255802400 39600 0 CAST}
    {1267714800 28800 0 WST}
}
Changes to library/tzdata/Antarctica/Davis.
1
2
3
4
5
6
7
8

9
# created by tools/tclZIC.tcl - do not edit

set TZData(:Antarctica/Davis) {
    {-9223372036854775808 0 0 zzz}
    {-409190400 25200 0 DAVT}
    {-163062000 0 0 zzz}
    {-28857600 25200 0 DAVT}
    {1255806000 18000 0 DAVT}

}








>

1
2
3
4
5
6
7
8
9
10
# created by tools/tclZIC.tcl - do not edit

set TZData(:Antarctica/Davis) {
    {-9223372036854775808 0 0 zzz}
    {-409190400 25200 0 DAVT}
    {-163062000 0 0 zzz}
    {-28857600 25200 0 DAVT}
    {1255806000 18000 0 DAVT}
    {1268251200 25200 0 DAVT}
}
Added library/tzdata/Antarctica/Macquarie.












































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# created by tools/tclZIC.tcl - do not edit

set TZData(:Antarctica/Macquarie) {
    {-9223372036854775808 0 0 zzz}
    {-1861920000 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}
    {-94730400 36000 0 EST}
    {-71136000 39600 1 EST}
    {-55411200 36000 0 EST}
    {-37267200 39600 1 EST}
    {-25776000 36000 0 EST}
    {-5817600 39600 1 EST}
    {5673600 36000 0 EST}
    {25632000 39600 1 EST}
    {37728000 36000 0 EST}
    {57686400 39600 1 EST}
    {67968000 36000 0 EST}
    {89136000 39600 1 EST}
    {100022400 36000 0 EST}
    {120585600 39600 1 EST}
    {131472000 36000 0 EST}
    {152035200 39600 1 EST}
    {162921600 36000 0 EST}
    {183484800 39600 1 EST}
    {194976000 36000 0 EST}
    {215539200 39600 1 EST}
    {226425600 36000 0 EST}
    {246988800 39600 1 EST}
    {257875200 36000 0 EST}
    {278438400 39600 1 EST}
    {289324800 36000 0 EST}
    {309888000 39600 1 EST}
    {320774400 36000 0 EST}
    {341337600 39600 1 EST}
    {352224000 36000 0 EST}
    {372787200 39600 1 EST}
    {386092800 36000 0 EST}
    {404841600 39600 1 EST}
    {417542400 36000 0 EST}
    {436291200 39600 1 EST}
    {447177600 36000 0 EST}
    {467740800 39600 1 EST}
    {478627200 36000 0 EST}
    {499190400 39600 1 EST}
    {510076800 36000 0 EST}
    {530035200 39600 1 EST}
    {542736000 36000 0 EST}
    {562089600 39600 1 EST}
    {574790400 36000 0 EST}
    {594144000 39600 1 EST}
    {606240000 36000 0 EST}
    {625593600 39600 1 EST}
    {637689600 36000 0 EST}
    {657043200 39600 1 EST}
    {670348800 36000 0 EST}
    {686678400 39600 1 EST}
    {701798400 36000 0 EST}
    {718128000 39600 1 EST}
    {733248000 36000 0 EST}
    {749577600 39600 1 EST}
    {764697600 36000 0 EST}
    {781027200 39600 1 EST}
    {796147200 36000 0 EST}
    {812476800 39600 1 EST}
    {828201600 36000 0 EST}
    {844531200 39600 1 EST}
    {859651200 36000 0 EST}
    {875980800 39600 1 EST}
    {891100800 36000 0 EST}
    {907430400 39600 1 EST}
    {922550400 36000 0 EST}
    {938880000 39600 1 EST}
    {954000000 36000 0 EST}
    {967305600 39600 1 EST}
    {985449600 36000 0 EST}
    {1002384000 39600 1 EST}
    {1017504000 36000 0 EST}
    {1033833600 39600 1 EST}
    {1048953600 36000 0 EST}
    {1065283200 39600 1 EST}
    {1080403200 36000 0 EST}
    {1096732800 39600 1 EST}
    {1111852800 36000 0 EST}
    {1128182400 39600 1 EST}
    {1143907200 36000 0 EST}
    {1159632000 39600 1 EST}
    {1174752000 36000 0 EST}
    {1191686400 39600 1 EST}
    {1207411200 36000 0 EST}
    {1223136000 39600 1 EST}
    {1238860800 36000 0 EST}
    {1254585600 39600 1 EST}
    {1270310400 39600 0 MIST}
}
Changes to library/tzdata/Asia/Anadyr.
61
62
63
64
65
66
67
68
69

70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
    {1162044000 43200 0 ANAT}
    {1174744800 46800 1 ANAST}
    {1193493600 43200 0 ANAT}
    {1206799200 46800 1 ANAST}
    {1224943200 43200 0 ANAT}
    {1238248800 46800 1 ANAST}
    {1256392800 43200 0 ANAT}
    {1269698400 46800 1 ANAST}
    {1288447200 43200 0 ANAT}

    {1301148000 46800 1 ANAST}
    {1319896800 43200 0 ANAT}
    {1332597600 46800 1 ANAST}
    {1351346400 43200 0 ANAT}
    {1364652000 46800 1 ANAST}
    {1382796000 43200 0 ANAT}
    {1396101600 46800 1 ANAST}
    {1414245600 43200 0 ANAT}
    {1427551200 46800 1 ANAST}
    {1445695200 43200 0 ANAT}
    {1459000800 46800 1 ANAST}
    {1477749600 43200 0 ANAT}
    {1490450400 46800 1 ANAST}
    {1509199200 43200 0 ANAT}
    {1521900000 46800 1 ANAST}
    {1540648800 43200 0 ANAT}
    {1553954400 46800 1 ANAST}
    {1572098400 43200 0 ANAT}
    {1585404000 46800 1 ANAST}
    {1603548000 43200 0 ANAT}
    {1616853600 46800 1 ANAST}
    {1635602400 43200 0 ANAT}
    {1648303200 46800 1 ANAST}
    {1667052000 43200 0 ANAT}
    {1679752800 46800 1 ANAST}
    {1698501600 43200 0 ANAT}
    {1711807200 46800 1 ANAST}
    {1729951200 43200 0 ANAT}
    {1743256800 46800 1 ANAST}
    {1761400800 43200 0 ANAT}
    {1774706400 46800 1 ANAST}
    {1792850400 43200 0 ANAT}
    {1806156000 46800 1 ANAST}
    {1824904800 43200 0 ANAT}
    {1837605600 46800 1 ANAST}
    {1856354400 43200 0 ANAT}
    {1869055200 46800 1 ANAST}
    {1887804000 43200 0 ANAT}
    {1901109600 46800 1 ANAST}
    {1919253600 43200 0 ANAT}
    {1932559200 46800 1 ANAST}
    {1950703200 43200 0 ANAT}
    {1964008800 46800 1 ANAST}
    {1982757600 43200 0 ANAT}

    {1995458400 46800 1 ANAST}
    {2014207200 43200 0 ANAT}
    {2026908000 46800 1 ANAST}
    {2045656800 43200 0 ANAT}
    {2058357600 46800 1 ANAST}
    {2077106400 43200 0 ANAT}
    {2090412000 46800 1 ANAST}
    {2108556000 43200 0 ANAT}
    {2121861600 46800 1 ANAST}
    {2140005600 43200 0 ANAT}
    {2153311200 46800 1 ANAST}
    {2172060000 43200 0 ANAT}
    {2184760800 46800 1 ANAST}
    {2203509600 43200 0 ANAT}
    {2216210400 46800 1 ANAST}
    {2234959200 43200 0 ANAT}
    {2248264800 46800 1 ANAST}
    {2266408800 43200 0 ANAT}
    {2279714400 46800 1 ANAST}

    {2297858400 43200 0 ANAT}
    {2311164000 46800 1 ANAST}
    {2329308000 43200 0 ANAT}
    {2342613600 46800 1 ANAST}
    {2361362400 43200 0 ANAT}
    {2374063200 46800 1 ANAST}
    {2392812000 43200 0 ANAT}
    {2405512800 46800 1 ANAST}
    {2424261600 43200 0 ANAT}
    {2437567200 46800 1 ANAST}
    {2455711200 43200 0 ANAT}
    {2469016800 46800 1 ANAST}
    {2487160800 43200 0 ANAT}
    {2500466400 46800 1 ANAST}
    {2519215200 43200 0 ANAT}
    {2531916000 46800 1 ANAST}
    {2550664800 43200 0 ANAT}
    {2563365600 46800 1 ANAST}
    {2582114400 43200 0 ANAT}
    {2595420000 46800 1 ANAST}
    {2613564000 43200 0 ANAT}
    {2626869600 46800 1 ANAST}
    {2645013600 43200 0 ANAT}
    {2658319200 46800 1 ANAST}
    {2676463200 43200 0 ANAT}
    {2689768800 46800 1 ANAST}
    {2708517600 43200 0 ANAT}
    {2721218400 46800 1 ANAST}
    {2739967200 43200 0 ANAT}
    {2752668000 46800 1 ANAST}
    {2771416800 43200 0 ANAT}
    {2784722400 46800 1 ANAST}
    {2802866400 43200 0 ANAT}
    {2816172000 46800 1 ANAST}
    {2834316000 43200 0 ANAT}
    {2847621600 46800 1 ANAST}
    {2866370400 43200 0 ANAT}
    {2879071200 46800 1 ANAST}
    {2897820000 43200 0 ANAT}
    {2910520800 46800 1 ANAST}
    {2929269600 43200 0 ANAT}
    {2941970400 46800 1 ANAST}
    {2960719200 43200 0 ANAT}
    {2974024800 46800 1 ANAST}
    {2992168800 43200 0 ANAT}
    {3005474400 46800 1 ANAST}
    {3023618400 43200 0 ANAT}
    {3036924000 46800 1 ANAST}
    {3055672800 43200 0 ANAT}
    {3068373600 46800 1 ANAST}
    {3087122400 43200 0 ANAT}
    {3099823200 46800 1 ANAST}
    {3118572000 43200 0 ANAT}
    {3131877600 46800 1 ANAST}
    {3150021600 43200 0 ANAT}
    {3163327200 46800 1 ANAST}
    {3181471200 43200 0 ANAT}
    {3194776800 46800 1 ANAST}
    {3212920800 43200 0 ANAT}
    {3226226400 46800 1 ANAST}
    {3244975200 43200 0 ANAT}
    {3257676000 46800 1 ANAST}
    {3276424800 43200 0 ANAT}
    {3289125600 46800 1 ANAST}
    {3307874400 43200 0 ANAT}
    {3321180000 46800 1 ANAST}
    {3339324000 43200 0 ANAT}
    {3352629600 46800 1 ANAST}
    {3370773600 43200 0 ANAT}
    {3384079200 46800 1 ANAST}
    {3402828000 43200 0 ANAT}
    {3415528800 46800 1 ANAST}
    {3434277600 43200 0 ANAT}
    {3446978400 46800 1 ANAST}
    {3465727200 43200 0 ANAT}
    {3479032800 46800 1 ANAST}
    {3497176800 43200 0 ANAT}
    {3510482400 46800 1 ANAST}
    {3528626400 43200 0 ANAT}
    {3541932000 46800 1 ANAST}
    {3560076000 43200 0 ANAT}
    {3573381600 46800 1 ANAST}
    {3592130400 43200 0 ANAT}
    {3604831200 46800 1 ANAST}
    {3623580000 43200 0 ANAT}
    {3636280800 46800 1 ANAST}
    {3655029600 43200 0 ANAT}
    {3668335200 46800 1 ANAST}
    {3686479200 43200 0 ANAT}
    {3699784800 46800 1 ANAST}
    {3717928800 43200 0 ANAT}
    {3731234400 46800 1 ANAST}
    {3749983200 43200 0 ANAT}
    {3762684000 46800 1 ANAST}
    {3781432800 43200 0 ANAT}
    {3794133600 46800 1 ANAST}
    {3812882400 43200 0 ANAT}
    {3825583200 46800 1 ANAST}
    {3844332000 43200 0 ANAT}
    {3857637600 46800 1 ANAST}
    {3875781600 43200 0 ANAT}
    {3889087200 46800 1 ANAST}
    {3907231200 43200 0 ANAT}
    {3920536800 46800 1 ANAST}
    {3939285600 43200 0 ANAT}
    {3951986400 46800 1 ANAST}
    {3970735200 43200 0 ANAT}
    {3983436000 46800 1 ANAST}
    {4002184800 43200 0 ANAT}
    {4015490400 46800 1 ANAST}
    {4033634400 43200 0 ANAT}
    {4046940000 46800 1 ANAST}
    {4065084000 43200 0 ANAT}
    {4078389600 46800 1 ANAST}
    {4096533600 43200 0 ANAT}
}







|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
    {1162044000 43200 0 ANAT}
    {1174744800 46800 1 ANAST}
    {1193493600 43200 0 ANAT}
    {1206799200 46800 1 ANAST}
    {1224943200 43200 0 ANAT}
    {1238248800 46800 1 ANAST}
    {1256392800 43200 0 ANAT}
    {1269698400 39600 0 ANAMMTT}
    {1269702000 43200 1 ANAST}
    {1288450800 39600 0 ANAT}
    {1301151600 43200 1 ANAST}
    {1319900400 39600 0 ANAT}
    {1332601200 43200 1 ANAST}
    {1351350000 39600 0 ANAT}
    {1364655600 43200 1 ANAST}
    {1382799600 39600 0 ANAT}
    {1396105200 43200 1 ANAST}
    {1414249200 39600 0 ANAT}
    {1427554800 43200 1 ANAST}
    {1445698800 39600 0 ANAT}
    {1459004400 43200 1 ANAST}
    {1477753200 39600 0 ANAT}
    {1490454000 43200 1 ANAST}
    {1509202800 39600 0 ANAT}
    {1521903600 43200 1 ANAST}
    {1540652400 39600 0 ANAT}
    {1553958000 43200 1 ANAST}
    {1572102000 39600 0 ANAT}
    {1585407600 43200 1 ANAST}
    {1603551600 39600 0 ANAT}
    {1616857200 43200 1 ANAST}
    {1635606000 39600 0 ANAT}
    {1648306800 43200 1 ANAST}
    {1667055600 39600 0 ANAT}
    {1679756400 43200 1 ANAST}
    {1698505200 39600 0 ANAT}
    {1711810800 43200 1 ANAST}
    {1729954800 39600 0 ANAT}
    {1743260400 43200 1 ANAST}
    {1761404400 39600 0 ANAT}
    {1774710000 43200 1 ANAST}
    {1792854000 39600 0 ANAT}
    {1806159600 43200 1 ANAST}
    {1824908400 39600 0 ANAT}
    {1837609200 43200 1 ANAST}
    {1856358000 39600 0 ANAT}
    {1869058800 43200 1 ANAST}
    {1887807600 39600 0 ANAT}
    {1901113200 43200 1 ANAST}
    {1919257200 39600 0 ANAT}

    {1932562800 43200 1 ANAST}
    {1950706800 39600 0 ANAT}
    {1964012400 43200 1 ANAST}
    {1982761200 39600 0 ANAT}
    {1995462000 43200 1 ANAST}
    {2014210800 39600 0 ANAT}
    {2026911600 43200 1 ANAST}
    {2045660400 39600 0 ANAT}
    {2058361200 43200 1 ANAST}
    {2077110000 39600 0 ANAT}
    {2090415600 43200 1 ANAST}
    {2108559600 39600 0 ANAT}
    {2121865200 43200 1 ANAST}
    {2140009200 39600 0 ANAT}
    {2153314800 43200 1 ANAST}
    {2172063600 39600 0 ANAT}
    {2184764400 43200 1 ANAST}
    {2203513200 39600 0 ANAT}
    {2216214000 43200 1 ANAST}
    {2234962800 39600 0 ANAT}
    {2248268400 43200 1 ANAST}
    {2266412400 39600 0 ANAT}
    {2279718000 43200 1 ANAST}
    {2297862000 39600 0 ANAT}
    {2311167600 43200 1 ANAST}

    {2329311600 39600 0 ANAT}
    {2342617200 43200 1 ANAST}
    {2361366000 39600 0 ANAT}
    {2374066800 43200 1 ANAST}
    {2392815600 39600 0 ANAT}
    {2405516400 43200 1 ANAST}
    {2424265200 39600 0 ANAT}
    {2437570800 43200 1 ANAST}
    {2455714800 39600 0 ANAT}
    {2469020400 43200 1 ANAST}
    {2487164400 39600 0 ANAT}
    {2500470000 43200 1 ANAST}
    {2519218800 39600 0 ANAT}
    {2531919600 43200 1 ANAST}
    {2550668400 39600 0 ANAT}
    {2563369200 43200 1 ANAST}
    {2582118000 39600 0 ANAT}
    {2595423600 43200 1 ANAST}
    {2613567600 39600 0 ANAT}
    {2626873200 43200 1 ANAST}
    {2645017200 39600 0 ANAT}
    {2658322800 43200 1 ANAST}
    {2676466800 39600 0 ANAT}
    {2689772400 43200 1 ANAST}
    {2708521200 39600 0 ANAT}
    {2721222000 43200 1 ANAST}
    {2739970800 39600 0 ANAT}
    {2752671600 43200 1 ANAST}
    {2771420400 39600 0 ANAT}
    {2784726000 43200 1 ANAST}
    {2802870000 39600 0 ANAT}
    {2816175600 43200 1 ANAST}
    {2834319600 39600 0 ANAT}
    {2847625200 43200 1 ANAST}
    {2866374000 39600 0 ANAT}
    {2879074800 43200 1 ANAST}
    {2897823600 39600 0 ANAT}
    {2910524400 43200 1 ANAST}
    {2929273200 39600 0 ANAT}
    {2941974000 43200 1 ANAST}
    {2960722800 39600 0 ANAT}
    {2974028400 43200 1 ANAST}
    {2992172400 39600 0 ANAT}
    {3005478000 43200 1 ANAST}
    {3023622000 39600 0 ANAT}
    {3036927600 43200 1 ANAST}
    {3055676400 39600 0 ANAT}
    {3068377200 43200 1 ANAST}
    {3087126000 39600 0 ANAT}
    {3099826800 43200 1 ANAST}
    {3118575600 39600 0 ANAT}
    {3131881200 43200 1 ANAST}
    {3150025200 39600 0 ANAT}
    {3163330800 43200 1 ANAST}
    {3181474800 39600 0 ANAT}
    {3194780400 43200 1 ANAST}
    {3212924400 39600 0 ANAT}
    {3226230000 43200 1 ANAST}
    {3244978800 39600 0 ANAT}
    {3257679600 43200 1 ANAST}
    {3276428400 39600 0 ANAT}
    {3289129200 43200 1 ANAST}
    {3307878000 39600 0 ANAT}
    {3321183600 43200 1 ANAST}
    {3339327600 39600 0 ANAT}
    {3352633200 43200 1 ANAST}
    {3370777200 39600 0 ANAT}
    {3384082800 43200 1 ANAST}
    {3402831600 39600 0 ANAT}
    {3415532400 43200 1 ANAST}
    {3434281200 39600 0 ANAT}
    {3446982000 43200 1 ANAST}
    {3465730800 39600 0 ANAT}
    {3479036400 43200 1 ANAST}
    {3497180400 39600 0 ANAT}
    {3510486000 43200 1 ANAST}
    {3528630000 39600 0 ANAT}
    {3541935600 43200 1 ANAST}
    {3560079600 39600 0 ANAT}
    {3573385200 43200 1 ANAST}
    {3592134000 39600 0 ANAT}
    {3604834800 43200 1 ANAST}
    {3623583600 39600 0 ANAT}
    {3636284400 43200 1 ANAST}
    {3655033200 39600 0 ANAT}
    {3668338800 43200 1 ANAST}
    {3686482800 39600 0 ANAT}
    {3699788400 43200 1 ANAST}
    {3717932400 39600 0 ANAT}
    {3731238000 43200 1 ANAST}
    {3749986800 39600 0 ANAT}
    {3762687600 43200 1 ANAST}
    {3781436400 39600 0 ANAT}
    {3794137200 43200 1 ANAST}
    {3812886000 39600 0 ANAT}
    {3825586800 43200 1 ANAST}
    {3844335600 39600 0 ANAT}
    {3857641200 43200 1 ANAST}
    {3875785200 39600 0 ANAT}
    {3889090800 43200 1 ANAST}
    {3907234800 39600 0 ANAT}
    {3920540400 43200 1 ANAST}
    {3939289200 39600 0 ANAT}
    {3951990000 43200 1 ANAST}
    {3970738800 39600 0 ANAT}
    {3983439600 43200 1 ANAST}
    {4002188400 39600 0 ANAT}
    {4015494000 43200 1 ANAST}
    {4033638000 39600 0 ANAT}
    {4046943600 43200 1 ANAST}
    {4065087600 39600 0 ANAT}
    {4078393200 43200 1 ANAST}
    {4096537200 39600 0 ANAT}
}
Changes to library/tzdata/Asia/Damascus.
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
    {1158872400 7200 0 EET}
    {1175205600 10800 1 EEST}
    {1193950800 7200 0 EET}
    {1207260000 10800 1 EEST}
    {1225486800 7200 0 EET}
    {1238104800 10800 1 EEST}
    {1256850000 7200 0 EET}
    {1269554400 10800 1 EEST}
    {1288299600 7200 0 EET}
    {1301004000 10800 1 EEST}
    {1319749200 7200 0 EET}
    {1333058400 10800 1 EEST}
    {1351198800 7200 0 EET}
    {1364508000 10800 1 EEST}
    {1382648400 7200 0 EET}
    {1395957600 10800 1 EEST}
    {1414702800 7200 0 EET}
    {1427407200 10800 1 EEST}
    {1446152400 7200 0 EET}
    {1458856800 10800 1 EEST}
    {1477602000 7200 0 EET}
    {1490911200 10800 1 EEST}
    {1509051600 7200 0 EET}
    {1522360800 10800 1 EEST}
    {1540501200 7200 0 EET}
    {1553810400 10800 1 EEST}
    {1571950800 7200 0 EET}
    {1585260000 10800 1 EEST}
    {1604005200 7200 0 EET}
    {1616709600 10800 1 EEST}
    {1635454800 7200 0 EET}
    {1648159200 10800 1 EEST}
    {1666904400 7200 0 EET}
    {1680213600 10800 1 EEST}
    {1698354000 7200 0 EET}
    {1711663200 10800 1 EEST}
    {1729803600 7200 0 EET}
    {1743112800 10800 1 EEST}
    {1761858000 7200 0 EET}
    {1774562400 10800 1 EEST}
    {1793307600 7200 0 EET}
    {1806012000 10800 1 EEST}
    {1824757200 7200 0 EET}
    {1838066400 10800 1 EEST}
    {1856206800 7200 0 EET}
    {1869516000 10800 1 EEST}
    {1887656400 7200 0 EET}
    {1900965600 10800 1 EEST}
    {1919106000 7200 0 EET}
    {1932415200 10800 1 EEST}
    {1951160400 7200 0 EET}
    {1963864800 10800 1 EEST}
    {1982610000 7200 0 EET}
    {1995314400 10800 1 EEST}
    {2014059600 7200 0 EET}
    {2027368800 10800 1 EEST}
    {2045509200 7200 0 EET}
    {2058818400 10800 1 EEST}
    {2076958800 7200 0 EET}
    {2090268000 10800 1 EEST}
    {2109013200 7200 0 EET}
    {2121717600 10800 1 EEST}
    {2140462800 7200 0 EET}
    {2153167200 10800 1 EEST}
    {2171912400 7200 0 EET}
    {2184616800 10800 1 EEST}
    {2203362000 7200 0 EET}
    {2216671200 10800 1 EEST}
    {2234811600 7200 0 EET}
    {2248120800 10800 1 EEST}
    {2266261200 7200 0 EET}
    {2279570400 10800 1 EEST}
    {2298315600 7200 0 EET}
    {2311020000 10800 1 EEST}
    {2329765200 7200 0 EET}
    {2342469600 10800 1 EEST}
    {2361214800 7200 0 EET}
    {2374524000 10800 1 EEST}
    {2392664400 7200 0 EET}
    {2405973600 10800 1 EEST}
    {2424114000 7200 0 EET}
    {2437423200 10800 1 EEST}
    {2455563600 7200 0 EET}
    {2468872800 10800 1 EEST}
    {2487618000 7200 0 EET}
    {2500322400 10800 1 EEST}
    {2519067600 7200 0 EET}
    {2531772000 10800 1 EEST}
    {2550517200 7200 0 EET}
    {2563826400 10800 1 EEST}
    {2581966800 7200 0 EET}
    {2595276000 10800 1 EEST}
    {2613416400 7200 0 EET}
    {2626725600 10800 1 EEST}
    {2645470800 7200 0 EET}
    {2658175200 10800 1 EEST}
    {2676920400 7200 0 EET}
    {2689624800 10800 1 EEST}
    {2708370000 7200 0 EET}
    {2721679200 10800 1 EEST}
    {2739819600 7200 0 EET}
    {2753128800 10800 1 EEST}
    {2771269200 7200 0 EET}
    {2784578400 10800 1 EEST}
    {2802718800 7200 0 EET}
    {2816028000 10800 1 EEST}
    {2834773200 7200 0 EET}
    {2847477600 10800 1 EEST}
    {2866222800 7200 0 EET}
    {2878927200 10800 1 EEST}
    {2897672400 7200 0 EET}
    {2910981600 10800 1 EEST}
    {2929122000 7200 0 EET}
    {2942431200 10800 1 EEST}
    {2960571600 7200 0 EET}
    {2973880800 10800 1 EEST}
    {2992626000 7200 0 EET}
    {3005330400 10800 1 EEST}
    {3024075600 7200 0 EET}
    {3036780000 10800 1 EEST}
    {3055525200 7200 0 EET}
    {3068229600 10800 1 EEST}
    {3086974800 7200 0 EET}
    {3100284000 10800 1 EEST}
    {3118424400 7200 0 EET}
    {3131733600 10800 1 EEST}
    {3149874000 7200 0 EET}
    {3163183200 10800 1 EEST}
    {3181928400 7200 0 EET}
    {3194632800 10800 1 EEST}
    {3213378000 7200 0 EET}
    {3226082400 10800 1 EEST}
    {3244827600 7200 0 EET}
    {3258136800 10800 1 EEST}
    {3276277200 7200 0 EET}
    {3289586400 10800 1 EEST}
    {3307726800 7200 0 EET}
    {3321036000 10800 1 EEST}
    {3339176400 7200 0 EET}
    {3352485600 10800 1 EEST}
    {3371230800 7200 0 EET}
    {3383935200 10800 1 EEST}
    {3402680400 7200 0 EET}
    {3415384800 10800 1 EEST}
    {3434130000 7200 0 EET}
    {3447439200 10800 1 EEST}
    {3465579600 7200 0 EET}
    {3478888800 10800 1 EEST}
    {3497029200 7200 0 EET}
    {3510338400 10800 1 EEST}
    {3529083600 7200 0 EET}
    {3541788000 10800 1 EEST}
    {3560533200 7200 0 EET}
    {3573237600 10800 1 EEST}
    {3591982800 7200 0 EET}
    {3605292000 10800 1 EEST}
    {3623432400 7200 0 EET}
    {3636741600 10800 1 EEST}
    {3654882000 7200 0 EET}
    {3668191200 10800 1 EEST}
    {3686331600 7200 0 EET}
    {3699640800 10800 1 EEST}
    {3718386000 7200 0 EET}
    {3731090400 10800 1 EEST}
    {3749835600 7200 0 EET}
    {3762540000 10800 1 EEST}
    {3781285200 7200 0 EET}
    {3794594400 10800 1 EEST}
    {3812734800 7200 0 EET}
    {3826044000 10800 1 EEST}
    {3844184400 7200 0 EET}
    {3857493600 10800 1 EEST}
    {3876238800 7200 0 EET}
    {3888943200 10800 1 EEST}
    {3907688400 7200 0 EET}
    {3920392800 10800 1 EEST}
    {3939138000 7200 0 EET}
    {3951842400 10800 1 EEST}
    {3970587600 7200 0 EET}
    {3983896800 10800 1 EEST}
    {4002037200 7200 0 EET}
    {4015346400 10800 1 EEST}
    {4033486800 7200 0 EET}
    {4046796000 10800 1 EEST}
    {4065541200 7200 0 EET}
    {4078245600 10800 1 EEST}
    {4096990800 7200 0 EET}
}







|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|


93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
    {1158872400 7200 0 EET}
    {1175205600 10800 1 EEST}
    {1193950800 7200 0 EET}
    {1207260000 10800 1 EEST}
    {1225486800 7200 0 EET}
    {1238104800 10800 1 EEST}
    {1256850000 7200 0 EET}
    {1270159200 10800 1 EEST}
    {1288299600 7200 0 EET}
    {1301608800 10800 1 EEST}
    {1319749200 7200 0 EET}
    {1333663200 10800 1 EEST}
    {1351198800 7200 0 EET}
    {1365112800 10800 1 EEST}
    {1382648400 7200 0 EET}
    {1396562400 10800 1 EEST}
    {1414702800 7200 0 EET}
    {1428012000 10800 1 EEST}
    {1446152400 7200 0 EET}
    {1459461600 10800 1 EEST}
    {1477602000 7200 0 EET}
    {1491516000 10800 1 EEST}
    {1509051600 7200 0 EET}
    {1522965600 10800 1 EEST}
    {1540501200 7200 0 EET}
    {1554415200 10800 1 EEST}
    {1571950800 7200 0 EET}
    {1585864800 10800 1 EEST}
    {1604005200 7200 0 EET}
    {1617314400 10800 1 EEST}
    {1635454800 7200 0 EET}
    {1648764000 10800 1 EEST}
    {1666904400 7200 0 EET}
    {1680818400 10800 1 EEST}
    {1698354000 7200 0 EET}
    {1712268000 10800 1 EEST}
    {1729803600 7200 0 EET}
    {1743717600 10800 1 EEST}
    {1761858000 7200 0 EET}
    {1775167200 10800 1 EEST}
    {1793307600 7200 0 EET}
    {1806616800 10800 1 EEST}
    {1824757200 7200 0 EET}
    {1838671200 10800 1 EEST}
    {1856206800 7200 0 EET}
    {1870120800 10800 1 EEST}
    {1887656400 7200 0 EET}
    {1901570400 10800 1 EEST}
    {1919106000 7200 0 EET}
    {1933020000 10800 1 EEST}
    {1951160400 7200 0 EET}
    {1964469600 10800 1 EEST}
    {1982610000 7200 0 EET}
    {1995919200 10800 1 EEST}
    {2014059600 7200 0 EET}
    {2027973600 10800 1 EEST}
    {2045509200 7200 0 EET}
    {2059423200 10800 1 EEST}
    {2076958800 7200 0 EET}
    {2090872800 10800 1 EEST}
    {2109013200 7200 0 EET}
    {2122322400 10800 1 EEST}
    {2140462800 7200 0 EET}
    {2153772000 10800 1 EEST}
    {2171912400 7200 0 EET}
    {2185221600 10800 1 EEST}
    {2203362000 7200 0 EET}
    {2217276000 10800 1 EEST}
    {2234811600 7200 0 EET}
    {2248725600 10800 1 EEST}
    {2266261200 7200 0 EET}
    {2280175200 10800 1 EEST}
    {2298315600 7200 0 EET}
    {2311624800 10800 1 EEST}
    {2329765200 7200 0 EET}
    {2343074400 10800 1 EEST}
    {2361214800 7200 0 EET}
    {2375128800 10800 1 EEST}
    {2392664400 7200 0 EET}
    {2406578400 10800 1 EEST}
    {2424114000 7200 0 EET}
    {2438028000 10800 1 EEST}
    {2455563600 7200 0 EET}
    {2469477600 10800 1 EEST}
    {2487618000 7200 0 EET}
    {2500927200 10800 1 EEST}
    {2519067600 7200 0 EET}
    {2532376800 10800 1 EEST}
    {2550517200 7200 0 EET}
    {2564431200 10800 1 EEST}
    {2581966800 7200 0 EET}
    {2595880800 10800 1 EEST}
    {2613416400 7200 0 EET}
    {2627330400 10800 1 EEST}
    {2645470800 7200 0 EET}
    {2658780000 10800 1 EEST}
    {2676920400 7200 0 EET}
    {2690229600 10800 1 EEST}
    {2708370000 7200 0 EET}
    {2722284000 10800 1 EEST}
    {2739819600 7200 0 EET}
    {2753733600 10800 1 EEST}
    {2771269200 7200 0 EET}
    {2785183200 10800 1 EEST}
    {2802718800 7200 0 EET}
    {2816632800 10800 1 EEST}
    {2834773200 7200 0 EET}
    {2848082400 10800 1 EEST}
    {2866222800 7200 0 EET}
    {2879532000 10800 1 EEST}
    {2897672400 7200 0 EET}
    {2911586400 10800 1 EEST}
    {2929122000 7200 0 EET}
    {2943036000 10800 1 EEST}
    {2960571600 7200 0 EET}
    {2974485600 10800 1 EEST}
    {2992626000 7200 0 EET}
    {3005935200 10800 1 EEST}
    {3024075600 7200 0 EET}
    {3037384800 10800 1 EEST}
    {3055525200 7200 0 EET}
    {3068834400 10800 1 EEST}
    {3086974800 7200 0 EET}
    {3100888800 10800 1 EEST}
    {3118424400 7200 0 EET}
    {3132338400 10800 1 EEST}
    {3149874000 7200 0 EET}
    {3163788000 10800 1 EEST}
    {3181928400 7200 0 EET}
    {3195237600 10800 1 EEST}
    {3213378000 7200 0 EET}
    {3226687200 10800 1 EEST}
    {3244827600 7200 0 EET}
    {3258741600 10800 1 EEST}
    {3276277200 7200 0 EET}
    {3290191200 10800 1 EEST}
    {3307726800 7200 0 EET}
    {3321640800 10800 1 EEST}
    {3339176400 7200 0 EET}
    {3353090400 10800 1 EEST}
    {3371230800 7200 0 EET}
    {3384540000 10800 1 EEST}
    {3402680400 7200 0 EET}
    {3415989600 10800 1 EEST}
    {3434130000 7200 0 EET}
    {3448044000 10800 1 EEST}
    {3465579600 7200 0 EET}
    {3479493600 10800 1 EEST}
    {3497029200 7200 0 EET}
    {3510943200 10800 1 EEST}
    {3529083600 7200 0 EET}
    {3542392800 10800 1 EEST}
    {3560533200 7200 0 EET}
    {3573842400 10800 1 EEST}
    {3591982800 7200 0 EET}
    {3605896800 10800 1 EEST}
    {3623432400 7200 0 EET}
    {3637346400 10800 1 EEST}
    {3654882000 7200 0 EET}
    {3668796000 10800 1 EEST}
    {3686331600 7200 0 EET}
    {3700245600 10800 1 EEST}
    {3718386000 7200 0 EET}
    {3731695200 10800 1 EEST}
    {3749835600 7200 0 EET}
    {3763144800 10800 1 EEST}
    {3781285200 7200 0 EET}
    {3795199200 10800 1 EEST}
    {3812734800 7200 0 EET}
    {3826648800 10800 1 EEST}
    {3844184400 7200 0 EET}
    {3858098400 10800 1 EEST}
    {3876238800 7200 0 EET}
    {3889548000 10800 1 EEST}
    {3907688400 7200 0 EET}
    {3920997600 10800 1 EEST}
    {3939138000 7200 0 EET}
    {3952447200 10800 1 EEST}
    {3970587600 7200 0 EET}
    {3984501600 10800 1 EEST}
    {4002037200 7200 0 EET}
    {4015951200 10800 1 EEST}
    {4033486800 7200 0 EET}
    {4047400800 10800 1 EEST}
    {4065541200 7200 0 EET}
    {4078850400 10800 1 EEST}
    {4096990800 7200 0 EET}
}
Changes to library/tzdata/Asia/Dhaka.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# created by tools/tclZIC.tcl - do not edit

set TZData(:Asia/Dhaka) {
    {-9223372036854775808 21700 0 LMT}
    {-2524543300 21200 0 HMT}
    {-891582800 23400 0 BURT}
    {-872058600 19800 0 IST}
    {-862637400 23400 0 BURT}
    {-576138600 21600 0 DACT}
    {38772000 21600 0 BDT}
    {1230746400 21600 0 BDT}
    {1245430800 25200 1 BDST}
    {1270054800 25200 1 BDST}
    {1288544400 21600 0 BDT}
    {1301590800 25200 1 BDST}
    {1320080400 21600 0 BDT}
    {1333213200 25200 1 BDST}
    {1351702800 21600 0 BDT}
    {1364749200 25200 1 BDST}
    {1383238800 21600 0 BDT}
    {1396285200 25200 1 BDST}
    {1414774800 21600 0 BDT}
    {1427821200 25200 1 BDST}
    {1446310800 21600 0 BDT}
    {1459443600 25200 1 BDST}
    {1477933200 21600 0 BDT}
    {1490979600 25200 1 BDST}
    {1509469200 21600 0 BDT}
    {1522515600 25200 1 BDST}
    {1541005200 21600 0 BDT}
    {1554051600 25200 1 BDST}
    {1572541200 21600 0 BDT}
    {1585674000 25200 1 BDST}
    {1604163600 21600 0 BDT}
    {1617210000 25200 1 BDST}
    {1635699600 21600 0 BDT}
    {1648746000 25200 1 BDST}
    {1667235600 21600 0 BDT}
    {1680282000 25200 1 BDST}
    {1698771600 21600 0 BDT}
    {1711904400 25200 1 BDST}
    {1730394000 21600 0 BDT}
    {1743440400 25200 1 BDST}
    {1761930000 21600 0 BDT}
    {1774976400 25200 1 BDST}
    {1793466000 21600 0 BDT}
    {1806512400 25200 1 BDST}
    {1825002000 21600 0 BDT}
    {1838134800 25200 1 BDST}
    {1856624400 21600 0 BDT}
    {1869670800 25200 1 BDST}
    {1888160400 21600 0 BDT}
    {1901206800 25200 1 BDST}
    {1919696400 21600 0 BDT}
    {1932742800 25200 1 BDST}
    {1951232400 21600 0 BDT}
    {1964365200 25200 1 BDST}
    {1982854800 21600 0 BDT}
    {1995901200 25200 1 BDST}
    {2014390800 21600 0 BDT}
    {2027437200 25200 1 BDST}
    {2045926800 21600 0 BDT}
    {2058973200 25200 1 BDST}
    {2077462800 21600 0 BDT}
    {2090595600 25200 1 BDST}
    {2109085200 21600 0 BDT}
    {2122131600 25200 1 BDST}
    {2140621200 21600 0 BDT}
    {2153667600 25200 1 BDST}
    {2172157200 21600 0 BDT}
    {2185203600 25200 1 BDST}
    {2203693200 21600 0 BDT}
    {2216826000 25200 1 BDST}
    {2235315600 21600 0 BDT}
    {2248362000 25200 1 BDST}
    {2266851600 21600 0 BDT}
    {2279898000 25200 1 BDST}
    {2298387600 21600 0 BDT}
    {2311434000 25200 1 BDST}
    {2329923600 21600 0 BDT}
    {2343056400 25200 1 BDST}
    {2361546000 21600 0 BDT}
    {2374592400 25200 1 BDST}
    {2393082000 21600 0 BDT}
    {2406128400 25200 1 BDST}
    {2424618000 21600 0 BDT}
    {2437664400 25200 1 BDST}
    {2456154000 21600 0 BDT}
    {2469286800 25200 1 BDST}
    {2487776400 21600 0 BDT}
    {2500822800 25200 1 BDST}
    {2519312400 21600 0 BDT}
    {2532358800 25200 1 BDST}
    {2550848400 21600 0 BDT}
    {2563894800 25200 1 BDST}
    {2582384400 21600 0 BDT}
    {2595517200 25200 1 BDST}
    {2614006800 21600 0 BDT}
    {2627053200 25200 1 BDST}
    {2645542800 21600 0 BDT}
    {2658589200 25200 1 BDST}
    {2677078800 21600 0 BDT}
    {2690125200 25200 1 BDST}
    {2708614800 21600 0 BDT}
    {2721747600 25200 1 BDST}
    {2740237200 21600 0 BDT}
    {2753283600 25200 1 BDST}
    {2771773200 21600 0 BDT}
    {2784819600 25200 1 BDST}
    {2803309200 21600 0 BDT}
    {2816355600 25200 1 BDST}
    {2834845200 21600 0 BDT}
    {2847978000 25200 1 BDST}
    {2866467600 21600 0 BDT}
    {2879514000 25200 1 BDST}
    {2898003600 21600 0 BDT}
    {2911050000 25200 1 BDST}
    {2929539600 21600 0 BDT}
    {2942586000 25200 1 BDST}
    {2961075600 21600 0 BDT}
    {2974208400 25200 1 BDST}
    {2992698000 21600 0 BDT}
    {3005744400 25200 1 BDST}
    {3024234000 21600 0 BDT}
    {3037280400 25200 1 BDST}
    {3055770000 21600 0 BDT}
    {3068816400 25200 1 BDST}
    {3087306000 21600 0 BDT}
    {3100438800 25200 1 BDST}
    {3118928400 21600 0 BDT}
    {3131974800 25200 1 BDST}
    {3150464400 21600 0 BDT}
    {3163510800 25200 1 BDST}
    {3182000400 21600 0 BDT}
    {3195046800 25200 1 BDST}
    {3213536400 21600 0 BDT}
    {3226669200 25200 1 BDST}
    {3245158800 21600 0 BDT}
    {3258205200 25200 1 BDST}
    {3276694800 21600 0 BDT}
    {3289741200 25200 1 BDST}
    {3308230800 21600 0 BDT}
    {3321277200 25200 1 BDST}
    {3339766800 21600 0 BDT}
    {3352899600 25200 1 BDST}
    {3371389200 21600 0 BDT}
    {3384435600 25200 1 BDST}
    {3402925200 21600 0 BDT}
    {3415971600 25200 1 BDST}
    {3434461200 21600 0 BDT}
    {3447507600 25200 1 BDST}
    {3465997200 21600 0 BDT}
    {3479130000 25200 1 BDST}
    {3497619600 21600 0 BDT}
    {3510666000 25200 1 BDST}
    {3529155600 21600 0 BDT}
    {3542202000 25200 1 BDST}
    {3560691600 21600 0 BDT}
    {3573738000 25200 1 BDST}
    {3592227600 21600 0 BDT}
    {3605360400 25200 1 BDST}
    {3623850000 21600 0 BDT}
    {3636896400 25200 1 BDST}
    {3655386000 21600 0 BDT}
    {3668432400 25200 1 BDST}
    {3686922000 21600 0 BDT}
    {3699968400 25200 1 BDST}
    {3718458000 21600 0 BDT}
    {3731590800 25200 1 BDST}
    {3750080400 21600 0 BDT}
    {3763126800 25200 1 BDST}
    {3781616400 21600 0 BDT}
    {3794662800 25200 1 BDST}
    {3813152400 21600 0 BDT}
    {3826198800 25200 1 BDST}
    {3844688400 21600 0 BDT}
    {3857821200 25200 1 BDST}
    {3876310800 21600 0 BDT}
    {3889357200 25200 1 BDST}
    {3907846800 21600 0 BDT}
    {3920893200 25200 1 BDST}
    {3939382800 21600 0 BDT}
    {3952429200 25200 1 BDST}
    {3970918800 21600 0 BDT}
    {3984051600 25200 1 BDST}
    {4002541200 21600 0 BDT}
    {4015587600 25200 1 BDST}
    {4034077200 21600 0 BDT}
    {4047123600 25200 1 BDST}
    {4065613200 21600 0 BDT}
    {4078659600 25200 1 BDST}
    {4097149200 21600 0 BDT}
}












<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

1
2
3
4
5
6
7
8
9
10
11
12

13


















































































































































































14
# created by tools/tclZIC.tcl - do not edit

set TZData(:Asia/Dhaka) {
    {-9223372036854775808 21700 0 LMT}
    {-2524543300 21200 0 HMT}
    {-891582800 23400 0 BURT}
    {-872058600 19800 0 IST}
    {-862637400 23400 0 BURT}
    {-576138600 21600 0 DACT}
    {38772000 21600 0 BDT}
    {1230746400 21600 0 BDT}
    {1245430800 25200 1 BDST}

    {1262278740 21600 0 BDT}


















































































































































































}
Changes to library/tzdata/Asia/Gaza.
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
    {1158872400 7200 0 EET}
    {1175378400 10800 1 EEST}
    {1189638000 7200 0 EET}
    {1207000800 10800 1 EEST}
    {1219964400 7200 0 EET}
    {1238104800 10800 1 EEST}
    {1252018800 7200 0 EET}
    {1269554400 10800 1 EEST}
    {1283468400 7200 0 EET}
    {1301004000 10800 1 EEST}
    {1314918000 7200 0 EET}
    {1333058400 10800 1 EEST}
    {1346972400 7200 0 EET}
    {1364508000 10800 1 EEST}
    {1378422000 7200 0 EET}
    {1395957600 10800 1 EEST}
    {1409871600 7200 0 EET}
    {1427407200 10800 1 EEST}
    {1441321200 7200 0 EET}
    {1458856800 10800 1 EEST}
    {1472770800 7200 0 EET}
    {1490911200 10800 1 EEST}
    {1504220400 7200 0 EET}
    {1522360800 10800 1 EEST}
    {1536274800 7200 0 EET}
    {1553810400 10800 1 EEST}
    {1567724400 7200 0 EET}
    {1585260000 10800 1 EEST}
    {1599174000 7200 0 EET}
    {1616709600 10800 1 EEST}
    {1630623600 7200 0 EET}
    {1648159200 10800 1 EEST}
    {1662073200 7200 0 EET}
    {1680213600 10800 1 EEST}
    {1693522800 7200 0 EET}
    {1711663200 10800 1 EEST}
    {1725577200 7200 0 EET}
    {1743112800 10800 1 EEST}
    {1757026800 7200 0 EET}
    {1774562400 10800 1 EEST}
    {1788476400 7200 0 EET}
    {1806012000 10800 1 EEST}
    {1819926000 7200 0 EET}
    {1838066400 10800 1 EEST}
    {1851375600 7200 0 EET}
    {1869516000 10800 1 EEST}
    {1883430000 7200 0 EET}
    {1900965600 10800 1 EEST}
    {1914879600 7200 0 EET}
    {1932415200 10800 1 EEST}
    {1946329200 7200 0 EET}
    {1963864800 10800 1 EEST}
    {1977778800 7200 0 EET}
    {1995314400 10800 1 EEST}
    {2009228400 7200 0 EET}
    {2027368800 10800 1 EEST}
    {2040678000 7200 0 EET}
    {2058818400 10800 1 EEST}
    {2072732400 7200 0 EET}
    {2090268000 10800 1 EEST}
    {2104182000 7200 0 EET}
    {2121717600 10800 1 EEST}
    {2135631600 7200 0 EET}
    {2153167200 10800 1 EEST}
    {2167081200 7200 0 EET}
    {2184616800 10800 1 EEST}
    {2198530800 7200 0 EET}
    {2216671200 10800 1 EEST}
    {2230585200 7200 0 EET}
    {2248120800 10800 1 EEST}
    {2262034800 7200 0 EET}
    {2279570400 10800 1 EEST}
    {2293484400 7200 0 EET}
    {2311020000 10800 1 EEST}
    {2324934000 7200 0 EET}
    {2342469600 10800 1 EEST}
    {2356383600 7200 0 EET}
    {2374524000 10800 1 EEST}
    {2387833200 7200 0 EET}
    {2405973600 10800 1 EEST}
    {2419887600 7200 0 EET}
    {2437423200 10800 1 EEST}
    {2451337200 7200 0 EET}
    {2468872800 10800 1 EEST}
    {2482786800 7200 0 EET}
    {2500322400 10800 1 EEST}
    {2514236400 7200 0 EET}
    {2531772000 10800 1 EEST}
    {2545686000 7200 0 EET}
    {2563826400 10800 1 EEST}
    {2577135600 7200 0 EET}
    {2595276000 10800 1 EEST}
    {2609190000 7200 0 EET}
    {2626725600 10800 1 EEST}
    {2640639600 7200 0 EET}
    {2658175200 10800 1 EEST}
    {2672089200 7200 0 EET}
    {2689624800 10800 1 EEST}
    {2703538800 7200 0 EET}
    {2721679200 10800 1 EEST}
    {2734988400 7200 0 EET}
    {2753128800 10800 1 EEST}
    {2767042800 7200 0 EET}
    {2784578400 10800 1 EEST}
    {2798492400 7200 0 EET}
    {2816028000 10800 1 EEST}
    {2829942000 7200 0 EET}
    {2847477600 10800 1 EEST}
    {2861391600 7200 0 EET}
    {2878927200 10800 1 EEST}
    {2892841200 7200 0 EET}
    {2910981600 10800 1 EEST}
    {2924290800 7200 0 EET}
    {2942431200 10800 1 EEST}
    {2956345200 7200 0 EET}
    {2973880800 10800 1 EEST}
    {2987794800 7200 0 EET}
    {3005330400 10800 1 EEST}
    {3019244400 7200 0 EET}
    {3036780000 10800 1 EEST}
    {3050694000 7200 0 EET}
    {3068229600 10800 1 EEST}
    {3082143600 7200 0 EET}
    {3100284000 10800 1 EEST}
    {3114198000 7200 0 EET}
    {3131733600 10800 1 EEST}
    {3145647600 7200 0 EET}
    {3163183200 10800 1 EEST}
    {3177097200 7200 0 EET}
    {3194632800 10800 1 EEST}
    {3208546800 7200 0 EET}
    {3226082400 10800 1 EEST}
    {3239996400 7200 0 EET}
    {3258136800 10800 1 EEST}
    {3271446000 7200 0 EET}
    {3289586400 10800 1 EEST}
    {3303500400 7200 0 EET}
    {3321036000 10800 1 EEST}
    {3334950000 7200 0 EET}
    {3352485600 10800 1 EEST}
    {3366399600 7200 0 EET}
    {3383935200 10800 1 EEST}
    {3397849200 7200 0 EET}
    {3415384800 10800 1 EEST}
    {3429298800 7200 0 EET}
    {3447439200 10800 1 EEST}
    {3460748400 7200 0 EET}
    {3478888800 10800 1 EEST}
    {3492802800 7200 0 EET}
    {3510338400 10800 1 EEST}
    {3524252400 7200 0 EET}
    {3541788000 10800 1 EEST}
    {3555702000 7200 0 EET}
    {3573237600 10800 1 EEST}
    {3587151600 7200 0 EET}
    {3605292000 10800 1 EEST}
    {3618601200 7200 0 EET}
    {3636741600 10800 1 EEST}
    {3650655600 7200 0 EET}
    {3668191200 10800 1 EEST}
    {3682105200 7200 0 EET}
    {3699640800 10800 1 EEST}
    {3713554800 7200 0 EET}
    {3731090400 10800 1 EEST}
    {3745004400 7200 0 EET}
    {3762540000 10800 1 EEST}
    {3776454000 7200 0 EET}
    {3794594400 10800 1 EEST}
    {3807903600 7200 0 EET}
    {3826044000 10800 1 EEST}
    {3839958000 7200 0 EET}
    {3857493600 10800 1 EEST}
    {3871407600 7200 0 EET}
    {3888943200 10800 1 EEST}
    {3902857200 7200 0 EET}
    {3920392800 10800 1 EEST}
    {3934306800 7200 0 EET}
    {3951842400 10800 1 EEST}
    {3965756400 7200 0 EET}
    {3983896800 10800 1 EEST}
    {3997810800 7200 0 EET}
    {4015346400 10800 1 EEST}
    {4029260400 7200 0 EET}
    {4046796000 10800 1 EEST}
    {4060710000 7200 0 EET}
    {4078245600 10800 1 EEST}
    {4092159600 7200 0 EET}
}







|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|


88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
    {1158872400 7200 0 EET}
    {1175378400 10800 1 EEST}
    {1189638000 7200 0 EET}
    {1207000800 10800 1 EEST}
    {1219964400 7200 0 EET}
    {1238104800 10800 1 EEST}
    {1252018800 7200 0 EET}
    {1269640860 10800 1 EEST}
    {1283468400 7200 0 EET}
    {1301090460 10800 1 EEST}
    {1314918000 7200 0 EET}
    {1333144860 10800 1 EEST}
    {1346972400 7200 0 EET}
    {1364594460 10800 1 EEST}
    {1378422000 7200 0 EET}
    {1396044060 10800 1 EEST}
    {1409871600 7200 0 EET}
    {1427493660 10800 1 EEST}
    {1441321200 7200 0 EET}
    {1458943260 10800 1 EEST}
    {1472770800 7200 0 EET}
    {1490392860 10800 1 EEST}
    {1504220400 7200 0 EET}
    {1522447260 10800 1 EEST}
    {1536274800 7200 0 EET}
    {1553896860 10800 1 EEST}
    {1567724400 7200 0 EET}
    {1585346460 10800 1 EEST}
    {1599174000 7200 0 EET}
    {1616796060 10800 1 EEST}
    {1630623600 7200 0 EET}
    {1648245660 10800 1 EEST}
    {1662073200 7200 0 EET}
    {1679695260 10800 1 EEST}
    {1693522800 7200 0 EET}
    {1711749660 10800 1 EEST}
    {1725577200 7200 0 EET}
    {1743199260 10800 1 EEST}
    {1757026800 7200 0 EET}
    {1774648860 10800 1 EEST}
    {1788476400 7200 0 EET}
    {1806098460 10800 1 EEST}
    {1819926000 7200 0 EET}
    {1837548060 10800 1 EEST}
    {1851375600 7200 0 EET}
    {1869602460 10800 1 EEST}
    {1883430000 7200 0 EET}
    {1901052060 10800 1 EEST}
    {1914879600 7200 0 EET}
    {1932501660 10800 1 EEST}
    {1946329200 7200 0 EET}
    {1963951260 10800 1 EEST}
    {1977778800 7200 0 EET}
    {1995400860 10800 1 EEST}
    {2009228400 7200 0 EET}
    {2026850460 10800 1 EEST}
    {2040678000 7200 0 EET}
    {2058904860 10800 1 EEST}
    {2072732400 7200 0 EET}
    {2090354460 10800 1 EEST}
    {2104182000 7200 0 EET}
    {2121804060 10800 1 EEST}
    {2135631600 7200 0 EET}
    {2153253660 10800 1 EEST}
    {2167081200 7200 0 EET}
    {2184703260 10800 1 EEST}
    {2198530800 7200 0 EET}
    {2216757660 10800 1 EEST}
    {2230585200 7200 0 EET}
    {2248207260 10800 1 EEST}
    {2262034800 7200 0 EET}
    {2279656860 10800 1 EEST}
    {2293484400 7200 0 EET}
    {2311106460 10800 1 EEST}
    {2324934000 7200 0 EET}
    {2342556060 10800 1 EEST}
    {2356383600 7200 0 EET}
    {2374005660 10800 1 EEST}
    {2387833200 7200 0 EET}
    {2406060060 10800 1 EEST}
    {2419887600 7200 0 EET}
    {2437509660 10800 1 EEST}
    {2451337200 7200 0 EET}
    {2468959260 10800 1 EEST}
    {2482786800 7200 0 EET}
    {2500408860 10800 1 EEST}
    {2514236400 7200 0 EET}
    {2531858460 10800 1 EEST}
    {2545686000 7200 0 EET}
    {2563308060 10800 1 EEST}
    {2577135600 7200 0 EET}
    {2595362460 10800 1 EEST}
    {2609190000 7200 0 EET}
    {2626812060 10800 1 EEST}
    {2640639600 7200 0 EET}
    {2658261660 10800 1 EEST}
    {2672089200 7200 0 EET}
    {2689711260 10800 1 EEST}
    {2703538800 7200 0 EET}
    {2721160860 10800 1 EEST}
    {2734988400 7200 0 EET}
    {2753215260 10800 1 EEST}
    {2767042800 7200 0 EET}
    {2784664860 10800 1 EEST}
    {2798492400 7200 0 EET}
    {2816114460 10800 1 EEST}
    {2829942000 7200 0 EET}
    {2847564060 10800 1 EEST}
    {2861391600 7200 0 EET}
    {2879013660 10800 1 EEST}
    {2892841200 7200 0 EET}
    {2910463260 10800 1 EEST}
    {2924290800 7200 0 EET}
    {2942517660 10800 1 EEST}
    {2956345200 7200 0 EET}
    {2973967260 10800 1 EEST}
    {2987794800 7200 0 EET}
    {3005416860 10800 1 EEST}
    {3019244400 7200 0 EET}
    {3036866460 10800 1 EEST}
    {3050694000 7200 0 EET}
    {3068316060 10800 1 EEST}
    {3082143600 7200 0 EET}
    {3100370460 10800 1 EEST}
    {3114198000 7200 0 EET}
    {3131820060 10800 1 EEST}
    {3145647600 7200 0 EET}
    {3163269660 10800 1 EEST}
    {3177097200 7200 0 EET}
    {3194719260 10800 1 EEST}
    {3208546800 7200 0 EET}
    {3226168860 10800 1 EEST}
    {3239996400 7200 0 EET}
    {3257618460 10800 1 EEST}
    {3271446000 7200 0 EET}
    {3289672860 10800 1 EEST}
    {3303500400 7200 0 EET}
    {3321122460 10800 1 EEST}
    {3334950000 7200 0 EET}
    {3352572060 10800 1 EEST}
    {3366399600 7200 0 EET}
    {3384021660 10800 1 EEST}
    {3397849200 7200 0 EET}
    {3415471260 10800 1 EEST}
    {3429298800 7200 0 EET}
    {3446920860 10800 1 EEST}
    {3460748400 7200 0 EET}
    {3478975260 10800 1 EEST}
    {3492802800 7200 0 EET}
    {3510424860 10800 1 EEST}
    {3524252400 7200 0 EET}
    {3541874460 10800 1 EEST}
    {3555702000 7200 0 EET}
    {3573324060 10800 1 EEST}
    {3587151600 7200 0 EET}
    {3604773660 10800 1 EEST}
    {3618601200 7200 0 EET}
    {3636828060 10800 1 EEST}
    {3650655600 7200 0 EET}
    {3668277660 10800 1 EEST}
    {3682105200 7200 0 EET}
    {3699727260 10800 1 EEST}
    {3713554800 7200 0 EET}
    {3731176860 10800 1 EEST}
    {3745004400 7200 0 EET}
    {3762626460 10800 1 EEST}
    {3776454000 7200 0 EET}
    {3794076060 10800 1 EEST}
    {3807903600 7200 0 EET}
    {3826130460 10800 1 EEST}
    {3839958000 7200 0 EET}
    {3857580060 10800 1 EEST}
    {3871407600 7200 0 EET}
    {3889029660 10800 1 EEST}
    {3902857200 7200 0 EET}
    {3920479260 10800 1 EEST}
    {3934306800 7200 0 EET}
    {3951928860 10800 1 EEST}
    {3965756400 7200 0 EET}
    {3983983260 10800 1 EEST}
    {3997810800 7200 0 EET}
    {4015432860 10800 1 EEST}
    {4029260400 7200 0 EET}
    {4046882460 10800 1 EEST}
    {4060710000 7200 0 EET}
    {4078332060 10800 1 EEST}
    {4092159600 7200 0 EET}
}
Changes to library/tzdata/Asia/Kamchatka.
60
61
62
63
64
65
66
67
68

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
    {1162044000 43200 0 PETT}
    {1174744800 46800 1 PETST}
    {1193493600 43200 0 PETT}
    {1206799200 46800 1 PETST}
    {1224943200 43200 0 PETT}
    {1238248800 46800 1 PETST}
    {1256392800 43200 0 PETT}
    {1269698400 46800 1 PETST}
    {1288447200 43200 0 PETT}

    {1301148000 46800 1 PETST}
    {1319896800 43200 0 PETT}
    {1332597600 46800 1 PETST}
    {1351346400 43200 0 PETT}
    {1364652000 46800 1 PETST}
    {1382796000 43200 0 PETT}
    {1396101600 46800 1 PETST}
    {1414245600 43200 0 PETT}
    {1427551200 46800 1 PETST}
    {1445695200 43200 0 PETT}
    {1459000800 46800 1 PETST}
    {1477749600 43200 0 PETT}
    {1490450400 46800 1 PETST}
    {1509199200 43200 0 PETT}
    {1521900000 46800 1 PETST}
    {1540648800 43200 0 PETT}
    {1553954400 46800 1 PETST}
    {1572098400 43200 0 PETT}
    {1585404000 46800 1 PETST}
    {1603548000 43200 0 PETT}
    {1616853600 46800 1 PETST}
    {1635602400 43200 0 PETT}
    {1648303200 46800 1 PETST}
    {1667052000 43200 0 PETT}
    {1679752800 46800 1 PETST}
    {1698501600 43200 0 PETT}
    {1711807200 46800 1 PETST}
    {1729951200 43200 0 PETT}
    {1743256800 46800 1 PETST}
    {1761400800 43200 0 PETT}
    {1774706400 46800 1 PETST}
    {1792850400 43200 0 PETT}
    {1806156000 46800 1 PETST}
    {1824904800 43200 0 PETT}
    {1837605600 46800 1 PETST}
    {1856354400 43200 0 PETT}
    {1869055200 46800 1 PETST}
    {1887804000 43200 0 PETT}
    {1901109600 46800 1 PETST}
    {1919253600 43200 0 PETT}
    {1932559200 46800 1 PETST}
    {1950703200 43200 0 PETT}
    {1964008800 46800 1 PETST}
    {1982757600 43200 0 PETT}

    {1995458400 46800 1 PETST}
    {2014207200 43200 0 PETT}
    {2026908000 46800 1 PETST}
    {2045656800 43200 0 PETT}
    {2058357600 46800 1 PETST}
    {2077106400 43200 0 PETT}
    {2090412000 46800 1 PETST}
    {2108556000 43200 0 PETT}
    {2121861600 46800 1 PETST}
    {2140005600 43200 0 PETT}
    {2153311200 46800 1 PETST}
    {2172060000 43200 0 PETT}
    {2184760800 46800 1 PETST}
    {2203509600 43200 0 PETT}
    {2216210400 46800 1 PETST}
    {2234959200 43200 0 PETT}
    {2248264800 46800 1 PETST}
    {2266408800 43200 0 PETT}
    {2279714400 46800 1 PETST}

    {2297858400 43200 0 PETT}
    {2311164000 46800 1 PETST}
    {2329308000 43200 0 PETT}
    {2342613600 46800 1 PETST}
    {2361362400 43200 0 PETT}
    {2374063200 46800 1 PETST}
    {2392812000 43200 0 PETT}
    {2405512800 46800 1 PETST}
    {2424261600 43200 0 PETT}
    {2437567200 46800 1 PETST}
    {2455711200 43200 0 PETT}
    {2469016800 46800 1 PETST}
    {2487160800 43200 0 PETT}
    {2500466400 46800 1 PETST}
    {2519215200 43200 0 PETT}
    {2531916000 46800 1 PETST}
    {2550664800 43200 0 PETT}
    {2563365600 46800 1 PETST}
    {2582114400 43200 0 PETT}
    {2595420000 46800 1 PETST}
    {2613564000 43200 0 PETT}
    {2626869600 46800 1 PETST}
    {2645013600 43200 0 PETT}
    {2658319200 46800 1 PETST}
    {2676463200 43200 0 PETT}
    {2689768800 46800 1 PETST}
    {2708517600 43200 0 PETT}
    {2721218400 46800 1 PETST}
    {2739967200 43200 0 PETT}
    {2752668000 46800 1 PETST}
    {2771416800 43200 0 PETT}
    {2784722400 46800 1 PETST}
    {2802866400 43200 0 PETT}
    {2816172000 46800 1 PETST}
    {2834316000 43200 0 PETT}
    {2847621600 46800 1 PETST}
    {2866370400 43200 0 PETT}
    {2879071200 46800 1 PETST}
    {2897820000 43200 0 PETT}
    {2910520800 46800 1 PETST}
    {2929269600 43200 0 PETT}
    {2941970400 46800 1 PETST}
    {2960719200 43200 0 PETT}
    {2974024800 46800 1 PETST}
    {2992168800 43200 0 PETT}
    {3005474400 46800 1 PETST}
    {3023618400 43200 0 PETT}
    {3036924000 46800 1 PETST}
    {3055672800 43200 0 PETT}
    {3068373600 46800 1 PETST}
    {3087122400 43200 0 PETT}
    {3099823200 46800 1 PETST}
    {3118572000 43200 0 PETT}
    {3131877600 46800 1 PETST}
    {3150021600 43200 0 PETT}
    {3163327200 46800 1 PETST}
    {3181471200 43200 0 PETT}
    {3194776800 46800 1 PETST}
    {3212920800 43200 0 PETT}
    {3226226400 46800 1 PETST}
    {3244975200 43200 0 PETT}
    {3257676000 46800 1 PETST}
    {3276424800 43200 0 PETT}
    {3289125600 46800 1 PETST}
    {3307874400 43200 0 PETT}
    {3321180000 46800 1 PETST}
    {3339324000 43200 0 PETT}
    {3352629600 46800 1 PETST}
    {3370773600 43200 0 PETT}
    {3384079200 46800 1 PETST}
    {3402828000 43200 0 PETT}
    {3415528800 46800 1 PETST}
    {3434277600 43200 0 PETT}
    {3446978400 46800 1 PETST}
    {3465727200 43200 0 PETT}
    {3479032800 46800 1 PETST}
    {3497176800 43200 0 PETT}
    {3510482400 46800 1 PETST}
    {3528626400 43200 0 PETT}
    {3541932000 46800 1 PETST}
    {3560076000 43200 0 PETT}
    {3573381600 46800 1 PETST}
    {3592130400 43200 0 PETT}
    {3604831200 46800 1 PETST}
    {3623580000 43200 0 PETT}
    {3636280800 46800 1 PETST}
    {3655029600 43200 0 PETT}
    {3668335200 46800 1 PETST}
    {3686479200 43200 0 PETT}
    {3699784800 46800 1 PETST}
    {3717928800 43200 0 PETT}
    {3731234400 46800 1 PETST}
    {3749983200 43200 0 PETT}
    {3762684000 46800 1 PETST}
    {3781432800 43200 0 PETT}
    {3794133600 46800 1 PETST}
    {3812882400 43200 0 PETT}
    {3825583200 46800 1 PETST}
    {3844332000 43200 0 PETT}
    {3857637600 46800 1 PETST}
    {3875781600 43200 0 PETT}
    {3889087200 46800 1 PETST}
    {3907231200 43200 0 PETT}
    {3920536800 46800 1 PETST}
    {3939285600 43200 0 PETT}
    {3951986400 46800 1 PETST}
    {3970735200 43200 0 PETT}
    {3983436000 46800 1 PETST}
    {4002184800 43200 0 PETT}
    {4015490400 46800 1 PETST}
    {4033634400 43200 0 PETT}
    {4046940000 46800 1 PETST}
    {4065084000 43200 0 PETT}
    {4078389600 46800 1 PETST}
    {4096533600 43200 0 PETT}
}







|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109

110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
    {1162044000 43200 0 PETT}
    {1174744800 46800 1 PETST}
    {1193493600 43200 0 PETT}
    {1206799200 46800 1 PETST}
    {1224943200 43200 0 PETT}
    {1238248800 46800 1 PETST}
    {1256392800 43200 0 PETT}
    {1269698400 39600 0 PETMMTT}
    {1269702000 43200 1 PETST}
    {1288450800 39600 0 PETT}
    {1301151600 43200 1 PETST}
    {1319900400 39600 0 PETT}
    {1332601200 43200 1 PETST}
    {1351350000 39600 0 PETT}
    {1364655600 43200 1 PETST}
    {1382799600 39600 0 PETT}
    {1396105200 43200 1 PETST}
    {1414249200 39600 0 PETT}
    {1427554800 43200 1 PETST}
    {1445698800 39600 0 PETT}
    {1459004400 43200 1 PETST}
    {1477753200 39600 0 PETT}
    {1490454000 43200 1 PETST}
    {1509202800 39600 0 PETT}
    {1521903600 43200 1 PETST}
    {1540652400 39600 0 PETT}
    {1553958000 43200 1 PETST}
    {1572102000 39600 0 PETT}
    {1585407600 43200 1 PETST}
    {1603551600 39600 0 PETT}
    {1616857200 43200 1 PETST}
    {1635606000 39600 0 PETT}
    {1648306800 43200 1 PETST}
    {1667055600 39600 0 PETT}
    {1679756400 43200 1 PETST}
    {1698505200 39600 0 PETT}
    {1711810800 43200 1 PETST}
    {1729954800 39600 0 PETT}
    {1743260400 43200 1 PETST}
    {1761404400 39600 0 PETT}
    {1774710000 43200 1 PETST}
    {1792854000 39600 0 PETT}
    {1806159600 43200 1 PETST}
    {1824908400 39600 0 PETT}
    {1837609200 43200 1 PETST}
    {1856358000 39600 0 PETT}
    {1869058800 43200 1 PETST}
    {1887807600 39600 0 PETT}
    {1901113200 43200 1 PETST}
    {1919257200 39600 0 PETT}

    {1932562800 43200 1 PETST}
    {1950706800 39600 0 PETT}
    {1964012400 43200 1 PETST}
    {1982761200 39600 0 PETT}
    {1995462000 43200 1 PETST}
    {2014210800 39600 0 PETT}
    {2026911600 43200 1 PETST}
    {2045660400 39600 0 PETT}
    {2058361200 43200 1 PETST}
    {2077110000 39600 0 PETT}
    {2090415600 43200 1 PETST}
    {2108559600 39600 0 PETT}
    {2121865200 43200 1 PETST}
    {2140009200 39600 0 PETT}
    {2153314800 43200 1 PETST}
    {2172063600 39600 0 PETT}
    {2184764400 43200 1 PETST}
    {2203513200 39600 0 PETT}
    {2216214000 43200 1 PETST}
    {2234962800 39600 0 PETT}
    {2248268400 43200 1 PETST}
    {2266412400 39600 0 PETT}
    {2279718000 43200 1 PETST}
    {2297862000 39600 0 PETT}
    {2311167600 43200 1 PETST}

    {2329311600 39600 0 PETT}
    {2342617200 43200 1 PETST}
    {2361366000 39600 0 PETT}
    {2374066800 43200 1 PETST}
    {2392815600 39600 0 PETT}
    {2405516400 43200 1 PETST}
    {2424265200 39600 0 PETT}
    {2437570800 43200 1 PETST}
    {2455714800 39600 0 PETT}
    {2469020400 43200 1 PETST}
    {2487164400 39600 0 PETT}
    {2500470000 43200 1 PETST}
    {2519218800 39600 0 PETT}
    {2531919600 43200 1 PETST}
    {2550668400 39600 0 PETT}
    {2563369200 43200 1 PETST}
    {2582118000 39600 0 PETT}
    {2595423600 43200 1 PETST}
    {2613567600 39600 0 PETT}
    {2626873200 43200 1 PETST}
    {2645017200 39600 0 PETT}
    {2658322800 43200 1 PETST}
    {2676466800 39600 0 PETT}
    {2689772400 43200 1 PETST}
    {2708521200 39600 0 PETT}
    {2721222000 43200 1 PETST}
    {2739970800 39600 0 PETT}
    {2752671600 43200 1 PETST}
    {2771420400 39600 0 PETT}
    {2784726000 43200 1 PETST}
    {2802870000 39600 0 PETT}
    {2816175600 43200 1 PETST}
    {2834319600 39600 0 PETT}
    {2847625200 43200 1 PETST}
    {2866374000 39600 0 PETT}
    {2879074800 43200 1 PETST}
    {2897823600 39600 0 PETT}
    {2910524400 43200 1 PETST}
    {2929273200 39600 0 PETT}
    {2941974000 43200 1 PETST}
    {2960722800 39600 0 PETT}
    {2974028400 43200 1 PETST}
    {2992172400 39600 0 PETT}
    {3005478000 43200 1 PETST}
    {3023622000 39600 0 PETT}
    {3036927600 43200 1 PETST}
    {3055676400 39600 0 PETT}
    {3068377200 43200 1 PETST}
    {3087126000 39600 0 PETT}
    {3099826800 43200 1 PETST}
    {3118575600 39600 0 PETT}
    {3131881200 43200 1 PETST}
    {3150025200 39600 0 PETT}
    {3163330800 43200 1 PETST}
    {3181474800 39600 0 PETT}
    {3194780400 43200 1 PETST}
    {3212924400 39600 0 PETT}
    {3226230000 43200 1 PETST}
    {3244978800 39600 0 PETT}
    {3257679600 43200 1 PETST}
    {3276428400 39600 0 PETT}
    {3289129200 43200 1 PETST}
    {3307878000 39600 0 PETT}
    {3321183600 43200 1 PETST}
    {3339327600 39600 0 PETT}
    {3352633200 43200 1 PETST}
    {3370777200 39600 0 PETT}
    {3384082800 43200 1 PETST}
    {3402831600 39600 0 PETT}
    {3415532400 43200 1 PETST}
    {3434281200 39600 0 PETT}
    {3446982000 43200 1 PETST}
    {3465730800 39600 0 PETT}
    {3479036400 43200 1 PETST}
    {3497180400 39600 0 PETT}
    {3510486000 43200 1 PETST}
    {3528630000 39600 0 PETT}
    {3541935600 43200 1 PETST}
    {3560079600 39600 0 PETT}
    {3573385200 43200 1 PETST}
    {3592134000 39600 0 PETT}
    {3604834800 43200 1 PETST}
    {3623583600 39600 0 PETT}
    {3636284400 43200 1 PETST}
    {3655033200 39600 0 PETT}
    {3668338800 43200 1 PETST}
    {3686482800 39600 0 PETT}
    {3699788400 43200 1 PETST}
    {3717932400 39600 0 PETT}
    {3731238000 43200 1 PETST}
    {3749986800 39600 0 PETT}
    {3762687600 43200 1 PETST}
    {3781436400 39600 0 PETT}
    {3794137200 43200 1 PETST}
    {3812886000 39600 0 PETT}
    {3825586800 43200 1 PETST}
    {3844335600 39600 0 PETT}
    {3857641200 43200 1 PETST}
    {3875785200 39600 0 PETT}
    {3889090800 43200 1 PETST}
    {3907234800 39600 0 PETT}
    {3920540400 43200 1 PETST}
    {3939289200 39600 0 PETT}
    {3951990000 43200 1 PETST}
    {3970738800 39600 0 PETT}
    {3983439600 43200 1 PETST}
    {4002188400 39600 0 PETT}
    {4015494000 43200 1 PETST}
    {4033638000 39600 0 PETT}
    {4046943600 43200 1 PETST}
    {4065087600 39600 0 PETT}
    {4078393200 43200 1 PETST}
    {4096537200 39600 0 PETT}
}
Changes to library/tzdata/Asia/Karachi.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
    {38775600 18000 0 PKT}
    {1018119660 21600 1 PKST}
    {1033840860 18000 0 PKT}
    {1212260400 21600 1 PKST}
    {1225476000 18000 0 PKT}
    {1239735600 21600 1 PKST}
    {1257012000 18000 0 PKT}
    {1271271600 21600 1 PKST}
    {1288548000 18000 0 PKT}
    {1302807600 21600 1 PKST}
    {1320084000 18000 0 PKT}
    {1334430000 21600 1 PKST}
    {1351706400 18000 0 PKT}
    {1365966000 21600 1 PKST}
    {1383242400 18000 0 PKT}
    {1397502000 21600 1 PKST}
    {1414778400 18000 0 PKT}
    {1429038000 21600 1 PKST}
    {1446314400 18000 0 PKT}
    {1460660400 21600 1 PKST}
    {1477936800 18000 0 PKT}
    {1492196400 21600 1 PKST}
    {1509472800 18000 0 PKT}
    {1523732400 21600 1 PKST}
    {1541008800 18000 0 PKT}
    {1555268400 21600 1 PKST}
    {1572544800 18000 0 PKT}
    {1586890800 21600 1 PKST}
    {1604167200 18000 0 PKT}
    {1618426800 21600 1 PKST}
    {1635703200 18000 0 PKT}
    {1649962800 21600 1 PKST}
    {1667239200 18000 0 PKT}
    {1681498800 21600 1 PKST}
    {1698775200 18000 0 PKT}
    {1713121200 21600 1 PKST}
    {1730397600 18000 0 PKT}
    {1744657200 21600 1 PKST}
    {1761933600 18000 0 PKT}
    {1776193200 21600 1 PKST}
    {1793469600 18000 0 PKT}
    {1807729200 21600 1 PKST}
    {1825005600 18000 0 PKT}
    {1839351600 21600 1 PKST}
    {1856628000 18000 0 PKT}
    {1870887600 21600 1 PKST}
    {1888164000 18000 0 PKT}
    {1902423600 21600 1 PKST}
    {1919700000 18000 0 PKT}
    {1933959600 21600 1 PKST}
    {1951236000 18000 0 PKT}
    {1965582000 21600 1 PKST}
    {1982858400 18000 0 PKT}
    {1997118000 21600 1 PKST}
    {2014394400 18000 0 PKT}
    {2028654000 21600 1 PKST}
    {2045930400 18000 0 PKT}
    {2060190000 21600 1 PKST}
    {2077466400 18000 0 PKT}
    {2091812400 21600 1 PKST}
    {2109088800 18000 0 PKT}
    {2123348400 21600 1 PKST}
    {2140624800 18000 0 PKT}
    {2154884400 21600 1 PKST}
    {2172160800 18000 0 PKT}
    {2186420400 21600 1 PKST}
    {2203696800 18000 0 PKT}
    {2218042800 21600 1 PKST}
    {2235319200 18000 0 PKT}
    {2249578800 21600 1 PKST}
    {2266855200 18000 0 PKT}
    {2281114800 21600 1 PKST}
    {2298391200 18000 0 PKT}
    {2312650800 21600 1 PKST}
    {2329927200 18000 0 PKT}
    {2344273200 21600 1 PKST}
    {2361549600 18000 0 PKT}
    {2375809200 21600 1 PKST}
    {2393085600 18000 0 PKT}
    {2407345200 21600 1 PKST}
    {2424621600 18000 0 PKT}
    {2438881200 21600 1 PKST}
    {2456157600 18000 0 PKT}
    {2470503600 21600 1 PKST}
    {2487780000 18000 0 PKT}
    {2502039600 21600 1 PKST}
    {2519316000 18000 0 PKT}
    {2533575600 21600 1 PKST}
    {2550852000 18000 0 PKT}
    {2565111600 21600 1 PKST}
    {2582388000 18000 0 PKT}
    {2596734000 21600 1 PKST}
    {2614010400 18000 0 PKT}
    {2628270000 21600 1 PKST}
    {2645546400 18000 0 PKT}
    {2659806000 21600 1 PKST}
    {2677082400 18000 0 PKT}
    {2691342000 21600 1 PKST}
    {2708618400 18000 0 PKT}
    {2722964400 21600 1 PKST}
    {2740240800 18000 0 PKT}
    {2754500400 21600 1 PKST}
    {2771776800 18000 0 PKT}
    {2786036400 21600 1 PKST}
    {2803312800 18000 0 PKT}
    {2817572400 21600 1 PKST}
    {2834848800 18000 0 PKT}
    {2849194800 21600 1 PKST}
    {2866471200 18000 0 PKT}
    {2880730800 21600 1 PKST}
    {2898007200 18000 0 PKT}
    {2912266800 21600 1 PKST}
    {2929543200 18000 0 PKT}
    {2943802800 21600 1 PKST}
    {2961079200 18000 0 PKT}
    {2975425200 21600 1 PKST}
    {2992701600 18000 0 PKT}
    {3006961200 21600 1 PKST}
    {3024237600 18000 0 PKT}
    {3038497200 21600 1 PKST}
    {3055773600 18000 0 PKT}
    {3070033200 21600 1 PKST}
    {3087309600 18000 0 PKT}
    {3101655600 21600 1 PKST}
    {3118932000 18000 0 PKT}
    {3133191600 21600 1 PKST}
    {3150468000 18000 0 PKT}
    {3164727600 21600 1 PKST}
    {3182004000 18000 0 PKT}
    {3196263600 21600 1 PKST}
    {3213540000 18000 0 PKT}
    {3227886000 21600 1 PKST}
    {3245162400 18000 0 PKT}
    {3259422000 21600 1 PKST}
    {3276698400 18000 0 PKT}
    {3290958000 21600 1 PKST}
    {3308234400 18000 0 PKT}
    {3322494000 21600 1 PKST}
    {3339770400 18000 0 PKT}
    {3354116400 21600 1 PKST}
    {3371392800 18000 0 PKT}
    {3385652400 21600 1 PKST}
    {3402928800 18000 0 PKT}
    {3417188400 21600 1 PKST}
    {3434464800 18000 0 PKT}
    {3448724400 21600 1 PKST}
    {3466000800 18000 0 PKT}
    {3480346800 21600 1 PKST}
    {3497623200 18000 0 PKT}
    {3511882800 21600 1 PKST}
    {3529159200 18000 0 PKT}
    {3543418800 21600 1 PKST}
    {3560695200 18000 0 PKT}
    {3574954800 21600 1 PKST}
    {3592231200 18000 0 PKT}
    {3606577200 21600 1 PKST}
    {3623853600 18000 0 PKT}
    {3638113200 21600 1 PKST}
    {3655389600 18000 0 PKT}
    {3669649200 21600 1 PKST}
    {3686925600 18000 0 PKT}
    {3701185200 21600 1 PKST}
    {3718461600 18000 0 PKT}
    {3732807600 21600 1 PKST}
    {3750084000 18000 0 PKT}
    {3764343600 21600 1 PKST}
    {3781620000 18000 0 PKT}
    {3795879600 21600 1 PKST}
    {3813156000 18000 0 PKT}
    {3827415600 21600 1 PKST}
    {3844692000 18000 0 PKT}
    {3859038000 21600 1 PKST}
    {3876314400 18000 0 PKT}
    {3890574000 21600 1 PKST}
    {3907850400 18000 0 PKT}
    {3922110000 21600 1 PKST}
    {3939386400 18000 0 PKT}
    {3953646000 21600 1 PKST}
    {3970922400 18000 0 PKT}
    {3985268400 21600 1 PKST}
    {4002544800 18000 0 PKT}
    {4016804400 21600 1 PKST}
    {4034080800 18000 0 PKT}
    {4048340400 21600 1 PKST}
    {4065616800 18000 0 PKT}
    {4079876400 21600 1 PKST}
    {4097152800 18000 0 PKT}
}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

9
10
11
12
13
14
15




















































































































































































16
    {38775600 18000 0 PKT}
    {1018119660 21600 1 PKST}
    {1033840860 18000 0 PKT}
    {1212260400 21600 1 PKST}
    {1225476000 18000 0 PKT}
    {1239735600 21600 1 PKST}
    {1257012000 18000 0 PKT}




















































































































































































}
Changes to library/tzdata/Asia/Taipei.
37
38
39
40
41
42
43
44
45
46
    {-291978000 28800 0 CST}
    {-270979200 32400 1 CDT}
    {-260442000 28800 0 CST}
    {133977600 32400 1 CDT}
    {149785200 28800 0 CST}
    {165513600 32400 1 CDT}
    {181321200 28800 0 CST}
    {331142400 32400 1 CDT}
    {339087600 28800 0 CST}
}







|
|

37
38
39
40
41
42
43
44
45
46
    {-291978000 28800 0 CST}
    {-270979200 32400 1 CDT}
    {-260442000 28800 0 CST}
    {133977600 32400 1 CDT}
    {149785200 28800 0 CST}
    {165513600 32400 1 CDT}
    {181321200 28800 0 CST}
    {299520000 32400 1 CDT}
    {307465200 28800 0 CST}
}
Changes to library/tzdata/Europe/Samara.
62
63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197

198

199

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217

218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
    {1162072800 14400 0 SAMT}
    {1174773600 18000 1 SAMST}
    {1193522400 14400 0 SAMT}
    {1206828000 18000 1 SAMST}
    {1224972000 14400 0 SAMT}
    {1238277600 18000 1 SAMST}
    {1256421600 14400 0 SAMT}
    {1269727200 18000 1 SAMST}
    {1288476000 14400 0 SAMT}

    {1301176800 18000 1 SAMST}
    {1319925600 14400 0 SAMT}
    {1332626400 18000 1 SAMST}
    {1351375200 14400 0 SAMT}
    {1364680800 18000 1 SAMST}
    {1382824800 14400 0 SAMT}
    {1396130400 18000 1 SAMST}
    {1414274400 14400 0 SAMT}
    {1427580000 18000 1 SAMST}
    {1445724000 14400 0 SAMT}
    {1459029600 18000 1 SAMST}
    {1477778400 14400 0 SAMT}
    {1490479200 18000 1 SAMST}
    {1509228000 14400 0 SAMT}
    {1521928800 18000 1 SAMST}
    {1540677600 14400 0 SAMT}
    {1553983200 18000 1 SAMST}
    {1572127200 14400 0 SAMT}
    {1585432800 18000 1 SAMST}
    {1603576800 14400 0 SAMT}
    {1616882400 18000 1 SAMST}
    {1635631200 14400 0 SAMT}
    {1648332000 18000 1 SAMST}
    {1667080800 14400 0 SAMT}
    {1679781600 18000 1 SAMST}
    {1698530400 14400 0 SAMT}
    {1711836000 18000 1 SAMST}
    {1729980000 14400 0 SAMT}
    {1743285600 18000 1 SAMST}
    {1761429600 14400 0 SAMT}
    {1774735200 18000 1 SAMST}
    {1792879200 14400 0 SAMT}
    {1806184800 18000 1 SAMST}
    {1824933600 14400 0 SAMT}
    {1837634400 18000 1 SAMST}
    {1856383200 14400 0 SAMT}
    {1869084000 18000 1 SAMST}
    {1887832800 14400 0 SAMT}
    {1901138400 18000 1 SAMST}
    {1919282400 14400 0 SAMT}
    {1932588000 18000 1 SAMST}
    {1950732000 14400 0 SAMT}
    {1964037600 18000 1 SAMST}
    {1982786400 14400 0 SAMT}

    {1995487200 18000 1 SAMST}
    {2014236000 14400 0 SAMT}
    {2026936800 18000 1 SAMST}
    {2045685600 14400 0 SAMT}
    {2058386400 18000 1 SAMST}
    {2077135200 14400 0 SAMT}
    {2090440800 18000 1 SAMST}
    {2108584800 14400 0 SAMT}
    {2121890400 18000 1 SAMST}
    {2140034400 14400 0 SAMT}
    {2153340000 18000 1 SAMST}
    {2172088800 14400 0 SAMT}
    {2184789600 18000 1 SAMST}
    {2203538400 14400 0 SAMT}
    {2216239200 18000 1 SAMST}
    {2234988000 14400 0 SAMT}
    {2248293600 18000 1 SAMST}
    {2266437600 14400 0 SAMT}
    {2279743200 18000 1 SAMST}
    {2297887200 14400 0 SAMT}
    {2311192800 18000 1 SAMST}
    {2329336800 14400 0 SAMT}

    {2342642400 18000 1 SAMST}
    {2361391200 14400 0 SAMT}
    {2374092000 18000 1 SAMST}
    {2392840800 14400 0 SAMT}
    {2405541600 18000 1 SAMST}
    {2424290400 14400 0 SAMT}
    {2437596000 18000 1 SAMST}
    {2455740000 14400 0 SAMT}
    {2469045600 18000 1 SAMST}
    {2487189600 14400 0 SAMT}
    {2500495200 18000 1 SAMST}
    {2519244000 14400 0 SAMT}
    {2531944800 18000 1 SAMST}
    {2550693600 14400 0 SAMT}
    {2563394400 18000 1 SAMST}
    {2582143200 14400 0 SAMT}
    {2595448800 18000 1 SAMST}
    {2613592800 14400 0 SAMT}
    {2626898400 18000 1 SAMST}
    {2645042400 14400 0 SAMT}
    {2658348000 18000 1 SAMST}
    {2676492000 14400 0 SAMT}
    {2689797600 18000 1 SAMST}
    {2708546400 14400 0 SAMT}
    {2721247200 18000 1 SAMST}
    {2739996000 14400 0 SAMT}
    {2752696800 18000 1 SAMST}
    {2771445600 14400 0 SAMT}
    {2784751200 18000 1 SAMST}
    {2802895200 14400 0 SAMT}
    {2816200800 18000 1 SAMST}
    {2834344800 14400 0 SAMT}
    {2847650400 18000 1 SAMST}
    {2866399200 14400 0 SAMT}
    {2879100000 18000 1 SAMST}
    {2897848800 14400 0 SAMT}
    {2910549600 18000 1 SAMST}
    {2929298400 14400 0 SAMT}
    {2941999200 18000 1 SAMST}
    {2960748000 14400 0 SAMT}
    {2974053600 18000 1 SAMST}
    {2992197600 14400 0 SAMT}
    {3005503200 18000 1 SAMST}
    {3023647200 14400 0 SAMT}
    {3036952800 18000 1 SAMST}
    {3055701600 14400 0 SAMT}
    {3068402400 18000 1 SAMST}
    {3087151200 14400 0 SAMT}
    {3099852000 18000 1 SAMST}
    {3118600800 14400 0 SAMT}
    {3131906400 18000 1 SAMST}
    {3150050400 14400 0 SAMT}
    {3163356000 18000 1 SAMST}
    {3181500000 14400 0 SAMT}
    {3194805600 18000 1 SAMST}
    {3212949600 14400 0 SAMT}
    {3226255200 18000 1 SAMST}
    {3245004000 14400 0 SAMT}
    {3257704800 18000 1 SAMST}
    {3276453600 14400 0 SAMT}
    {3289154400 18000 1 SAMST}

    {3307903200 14400 0 SAMT}

    {3321208800 18000 1 SAMST}

    {3339352800 14400 0 SAMT}
    {3352658400 18000 1 SAMST}
    {3370802400 14400 0 SAMT}
    {3384108000 18000 1 SAMST}
    {3402856800 14400 0 SAMT}
    {3415557600 18000 1 SAMST}
    {3434306400 14400 0 SAMT}
    {3447007200 18000 1 SAMST}
    {3465756000 14400 0 SAMT}
    {3479061600 18000 1 SAMST}
    {3497205600 14400 0 SAMT}
    {3510511200 18000 1 SAMST}
    {3528655200 14400 0 SAMT}
    {3541960800 18000 1 SAMST}
    {3560104800 14400 0 SAMT}
    {3573410400 18000 1 SAMST}
    {3592159200 14400 0 SAMT}
    {3604860000 18000 1 SAMST}

    {3623608800 14400 0 SAMT}
    {3636309600 18000 1 SAMST}
    {3655058400 14400 0 SAMT}
    {3668364000 18000 1 SAMST}
    {3686508000 14400 0 SAMT}
    {3699813600 18000 1 SAMST}
    {3717957600 14400 0 SAMT}
    {3731263200 18000 1 SAMST}
    {3750012000 14400 0 SAMT}
    {3762712800 18000 1 SAMST}
    {3781461600 14400 0 SAMT}
    {3794162400 18000 1 SAMST}
    {3812911200 14400 0 SAMT}
    {3825612000 18000 1 SAMST}
    {3844360800 14400 0 SAMT}
    {3857666400 18000 1 SAMST}
    {3875810400 14400 0 SAMT}
    {3889116000 18000 1 SAMST}
    {3907260000 14400 0 SAMT}
    {3920565600 18000 1 SAMST}
    {3939314400 14400 0 SAMT}
    {3952015200 18000 1 SAMST}
    {3970764000 14400 0 SAMT}
    {3983464800 18000 1 SAMST}
    {4002213600 14400 0 SAMT}
    {4015519200 18000 1 SAMST}
    {4033663200 14400 0 SAMT}
    {4046968800 18000 1 SAMST}
    {4065112800 14400 0 SAMT}
    {4078418400 18000 1 SAMST}
    {4096562400 14400 0 SAMT}
}







|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
>
|
>
|
|
|
|
|
<
<
<
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
    {1162072800 14400 0 SAMT}
    {1174773600 18000 1 SAMST}
    {1193522400 14400 0 SAMT}
    {1206828000 18000 1 SAMST}
    {1224972000 14400 0 SAMT}
    {1238277600 18000 1 SAMST}
    {1256421600 14400 0 SAMT}
    {1269727200 10800 0 SAMMMTT}
    {1269730800 14400 1 SAMST}
    {1288479600 10800 0 SAMT}
    {1301180400 14400 1 SAMST}
    {1319929200 10800 0 SAMT}
    {1332630000 14400 1 SAMST}
    {1351378800 10800 0 SAMT}
    {1364684400 14400 1 SAMST}
    {1382828400 10800 0 SAMT}
    {1396134000 14400 1 SAMST}
    {1414278000 10800 0 SAMT}
    {1427583600 14400 1 SAMST}
    {1445727600 10800 0 SAMT}
    {1459033200 14400 1 SAMST}
    {1477782000 10800 0 SAMT}
    {1490482800 14400 1 SAMST}
    {1509231600 10800 0 SAMT}
    {1521932400 14400 1 SAMST}
    {1540681200 10800 0 SAMT}
    {1553986800 14400 1 SAMST}
    {1572130800 10800 0 SAMT}
    {1585436400 14400 1 SAMST}
    {1603580400 10800 0 SAMT}
    {1616886000 14400 1 SAMST}
    {1635634800 10800 0 SAMT}
    {1648335600 14400 1 SAMST}
    {1667084400 10800 0 SAMT}
    {1679785200 14400 1 SAMST}
    {1698534000 10800 0 SAMT}
    {1711839600 14400 1 SAMST}
    {1729983600 10800 0 SAMT}
    {1743289200 14400 1 SAMST}
    {1761433200 10800 0 SAMT}
    {1774738800 14400 1 SAMST}
    {1792882800 10800 0 SAMT}
    {1806188400 14400 1 SAMST}
    {1824937200 10800 0 SAMT}
    {1837638000 14400 1 SAMST}
    {1856386800 10800 0 SAMT}
    {1869087600 14400 1 SAMST}
    {1887836400 10800 0 SAMT}
    {1901142000 14400 1 SAMST}
    {1919286000 10800 0 SAMT}

    {1932591600 14400 1 SAMST}
    {1950735600 10800 0 SAMT}
    {1964041200 14400 1 SAMST}
    {1982790000 10800 0 SAMT}
    {1995490800 14400 1 SAMST}
    {2014239600 10800 0 SAMT}
    {2026940400 14400 1 SAMST}
    {2045689200 10800 0 SAMT}
    {2058390000 14400 1 SAMST}
    {2077138800 10800 0 SAMT}
    {2090444400 14400 1 SAMST}
    {2108588400 10800 0 SAMT}
    {2121894000 14400 1 SAMST}
    {2140038000 10800 0 SAMT}
    {2153343600 14400 1 SAMST}
    {2172092400 10800 0 SAMT}

    {2184793200 14400 1 SAMST}
    {2203542000 10800 0 SAMT}
    {2216242800 14400 1 SAMST}
    {2234991600 10800 0 SAMT}
    {2248297200 14400 1 SAMST}
    {2266441200 10800 0 SAMT}
    {2279746800 14400 1 SAMST}
    {2297890800 10800 0 SAMT}
    {2311196400 14400 1 SAMST}
    {2329340400 10800 0 SAMT}
    {2342646000 14400 1 SAMST}
    {2361394800 10800 0 SAMT}
    {2374095600 14400 1 SAMST}
    {2392844400 10800 0 SAMT}
    {2405545200 14400 1 SAMST}
    {2424294000 10800 0 SAMT}
    {2437599600 14400 1 SAMST}
    {2455743600 10800 0 SAMT}
    {2469049200 14400 1 SAMST}
    {2487193200 10800 0 SAMT}
    {2500498800 14400 1 SAMST}
    {2519247600 10800 0 SAMT}
    {2531948400 14400 1 SAMST}
    {2550697200 10800 0 SAMT}
    {2563398000 14400 1 SAMST}
    {2582146800 10800 0 SAMT}
    {2595452400 14400 1 SAMST}
    {2613596400 10800 0 SAMT}
    {2626902000 14400 1 SAMST}
    {2645046000 10800 0 SAMT}
    {2658351600 14400 1 SAMST}
    {2676495600 10800 0 SAMT}
    {2689801200 14400 1 SAMST}
    {2708550000 10800 0 SAMT}
    {2721250800 14400 1 SAMST}
    {2739999600 10800 0 SAMT}
    {2752700400 14400 1 SAMST}
    {2771449200 10800 0 SAMT}
    {2784754800 14400 1 SAMST}
    {2802898800 10800 0 SAMT}
    {2816204400 14400 1 SAMST}
    {2834348400 10800 0 SAMT}
    {2847654000 14400 1 SAMST}
    {2866402800 10800 0 SAMT}
    {2879103600 14400 1 SAMST}
    {2897852400 10800 0 SAMT}
    {2910553200 14400 1 SAMST}
    {2929302000 10800 0 SAMT}
    {2942002800 14400 1 SAMST}
    {2960751600 10800 0 SAMT}
    {2974057200 14400 1 SAMST}
    {2992201200 10800 0 SAMT}
    {3005506800 14400 1 SAMST}
    {3023650800 10800 0 SAMT}
    {3036956400 14400 1 SAMST}
    {3055705200 10800 0 SAMT}
    {3068406000 14400 1 SAMST}
    {3087154800 10800 0 SAMT}
    {3099855600 14400 1 SAMST}
    {3118604400 10800 0 SAMT}
    {3131910000 14400 1 SAMST}
    {3150054000 10800 0 SAMT}
    {3163359600 14400 1 SAMST}
    {3181503600 10800 0 SAMT}
    {3194809200 14400 1 SAMST}
    {3212953200 10800 0 SAMT}
    {3226258800 14400 1 SAMST}
    {3245007600 10800 0 SAMT}
    {3257708400 14400 1 SAMST}
    {3276457200 10800 0 SAMT}
    {3289158000 14400 1 SAMST}
    {3307906800 10800 0 SAMT}
    {3321212400 14400 1 SAMST}
    {3339356400 10800 0 SAMT}
    {3352662000 14400 1 SAMST}
    {3370806000 10800 0 SAMT}
    {3384111600 14400 1 SAMST}
    {3402860400 10800 0 SAMT}
    {3415561200 14400 1 SAMST}
    {3434310000 10800 0 SAMT}
    {3447010800 14400 1 SAMST}



    {3465759600 10800 0 SAMT}
    {3479065200 14400 1 SAMST}
    {3497209200 10800 0 SAMT}
    {3510514800 14400 1 SAMST}
    {3528658800 10800 0 SAMT}
    {3541964400 14400 1 SAMST}
    {3560108400 10800 0 SAMT}
    {3573414000 14400 1 SAMST}
    {3592162800 10800 0 SAMT}
    {3604863600 14400 1 SAMST}
    {3623612400 10800 0 SAMT}
    {3636313200 14400 1 SAMST}
    {3655062000 10800 0 SAMT}
    {3668367600 14400 1 SAMST}
    {3686511600 10800 0 SAMT}
    {3699817200 14400 1 SAMST}
    {3717961200 10800 0 SAMT}
    {3731266800 14400 1 SAMST}

    {3750015600 10800 0 SAMT}
    {3762716400 14400 1 SAMST}
    {3781465200 10800 0 SAMT}
    {3794166000 14400 1 SAMST}
    {3812914800 10800 0 SAMT}
    {3825615600 14400 1 SAMST}
    {3844364400 10800 0 SAMT}
    {3857670000 14400 1 SAMST}
    {3875814000 10800 0 SAMT}
    {3889119600 14400 1 SAMST}
    {3907263600 10800 0 SAMT}
    {3920569200 14400 1 SAMST}
    {3939318000 10800 0 SAMT}
    {3952018800 14400 1 SAMST}
    {3970767600 10800 0 SAMT}
    {3983468400 14400 1 SAMST}
    {4002217200 10800 0 SAMT}
    {4015522800 14400 1 SAMST}
    {4033666800 10800 0 SAMT}
    {4046972400 14400 1 SAMST}
    {4065116400 10800 0 SAMT}
    {4078422000 14400 1 SAMST}
    {4096566000 10800 0 SAMT}
}
Changes to library/tzdata/Pacific/Apia.
1
2
3
4
5
6
7
8
9
10
# created by tools/tclZIC.tcl - do not edit

set TZData(:Pacific/Apia) {
    {-9223372036854775808 45184 0 LMT}
    {-2855737984 -41216 0 LMT}
    {-1861878784 -41400 0 SAMT}
    {-631110600 -39600 0 WST}
    {1254654000 -36000 1 WSDT}
    {1269770400 -39600 0 WST}
}







|
|

1
2
3
4
5
6
7
8
9
10
# created by tools/tclZIC.tcl - do not edit

set TZData(:Pacific/Apia) {
    {-9223372036854775808 45184 0 LMT}
    {-2855737984 -41216 0 LMT}
    {-1861878784 -41400 0 SAMT}
    {-631110600 -39600 0 WST}
    {1285498800 -36000 1 WSDT}
    {1301824800 -39600 0 WST}
}
Changes to library/tzdata/Pacific/Easter.
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
    {1160884800 -18000 1 EASST}
    {1173582000 -21600 0 EAST}
    {1192334400 -18000 1 EASST}
    {1206846000 -21600 0 EAST}
    {1223784000 -18000 1 EASST}
    {1237086000 -21600 0 EAST}
    {1255233600 -18000 1 EASST}
    {1268535600 -21600 0 EAST}
    {1286683200 -18000 1 EASST}
    {1299985200 -21600 0 EAST}
    {1318132800 -18000 1 EASST}
    {1331434800 -21600 0 EAST}
    {1350187200 -18000 1 EASST}
    {1362884400 -21600 0 EAST}
    {1381636800 -18000 1 EASST}







|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
    {1160884800 -18000 1 EASST}
    {1173582000 -21600 0 EAST}
    {1192334400 -18000 1 EASST}
    {1206846000 -21600 0 EAST}
    {1223784000 -18000 1 EASST}
    {1237086000 -21600 0 EAST}
    {1255233600 -18000 1 EASST}
    {1270350000 -21600 0 EAST}
    {1286683200 -18000 1 EASST}
    {1299985200 -21600 0 EAST}
    {1318132800 -18000 1 EASST}
    {1331434800 -21600 0 EAST}
    {1350187200 -18000 1 EASST}
    {1362884400 -21600 0 EAST}
    {1381636800 -18000 1 EASST}
Changes to library/tzdata/Pacific/Fiji.
1
2
3
4
5
6
7
8
9
10
11


12
# created by tools/tclZIC.tcl - do not edit

set TZData(:Pacific/Fiji) {
    {-9223372036854775808 42820 0 LMT}
    {-1709985220 43200 0 FJT}
    {909842400 46800 1 FJST}
    {920124000 43200 0 FJT}
    {941896800 46800 1 FJST}
    {951573600 43200 0 FJT}
    {1259416800 46800 1 FJST}
    {1272117600 43200 0 FJT}


}










|
>
>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# created by tools/tclZIC.tcl - do not edit

set TZData(:Pacific/Fiji) {
    {-9223372036854775808 42820 0 LMT}
    {-1709985220 43200 0 FJT}
    {909842400 46800 1 FJST}
    {920124000 43200 0 FJT}
    {941896800 46800 1 FJST}
    {951573600 43200 0 FJT}
    {1259416800 46800 1 FJST}
    {1269698400 43200 0 FJT}
    {1287842400 46800 1 FJST}
    {1301148000 43200 0 FJT}
}
Changes to unix/Makefile.in.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# This file is a Makefile for Tcl. If it has the name "Makefile.in" then it is
# a template for a Makefile; to generate the actual Makefile, run
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.127.2.93 2010/04/19 15:58:52 dgp Exp $

VERSION 		= @TCL_VERSION@
MAJOR_VERSION		= @TCL_MAJOR_VERSION@
MINOR_VERSION		= @TCL_MINOR_VERSION@
PATCH_LEVEL		= @TCL_PATCH_LEVEL@

#--------------------------------------------------------------------------






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# This file is a Makefile for Tcl. If it has the name "Makefile.in" then it is
# a template for a Makefile; to generate the actual Makefile, run
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.127.2.94 2010/04/29 23:32:25 dgp Exp $

VERSION 		= @TCL_VERSION@
MAJOR_VERSION		= @TCL_MAJOR_VERSION@
MINOR_VERSION		= @TCL_MINOR_VERSION@
PATCH_LEVEL		= @TCL_PATCH_LEVEL@

#--------------------------------------------------------------------------
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
	    $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/opt0.4; \
	    done;
	@echo "Installing package msgcat 1.4.3 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.4.3.tm;
	@echo "Installing package tcltest 2.3.2 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.2.tm;

	@echo "Installing package platform 1.0.6 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.6.tm;
	@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform/shell-1.1.4.tm;

	@echo "Installing library encoding directory";
	@for i in $(TOP_DIR)/library/encoding/*.enc ; do \
		$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/encoding; \
	done;







|
|







852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
	    $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/opt0.4; \
	    done;
	@echo "Installing package msgcat 1.4.3 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.4.3.tm;
	@echo "Installing package tcltest 2.3.2 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.2.tm;

	@echo "Installing package platform 1.0.7 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.7.tm;
	@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
	@$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform/shell-1.1.4.tm;

	@echo "Installing library encoding directory";
	@for i in $(TOP_DIR)/library/encoding/*.enc ; do \
		$(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/encoding; \
	done;
Changes to unix/tclLoadDl.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * tclLoadDl.c --
 *
 *	This procedure provides a version of the TclLoadFile that works with
 *	the "dlopen" and "dlsym" library procedures for dynamic loading.
 *
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclLoadDl.c,v 1.13.4.6 2010/04/06 02:37:49 dgp Exp $
 */

#include "tclInt.h"
#ifdef NO_DLFCN_H
#   include "../compat/dlfcn.h"
#else
#   include <dlfcn.h>











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * tclLoadDl.c --
 *
 *	This procedure provides a version of the TclLoadFile that works with
 *	the "dlopen" and "dlsym" library procedures for dynamic loading.
 *
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclLoadDl.c,v 1.13.4.7 2010/04/29 23:32:25 dgp Exp $
 */

#include "tclInt.h"
#ifdef NO_DLFCN_H
#   include "../compat/dlfcn.h"
#else
#   include <dlfcn.h>
140
141
142
143
144
145
146
147

148


149

150

151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

static void *
FindSymbol(
    Tcl_Interp *interp,		/* Place to put error messages. */
    Tcl_LoadHandle loadHandle,	/* Value from TcpDlopen(). */
    const char *symbol)		/* Symbol to look up. */
{
    const char *native;

    Tcl_DString newName, ds;


    void *handle = (void *) loadHandle->clientData;

    Tcl_PackageInitProc *proc;


    /*
     * Some platforms still add an underscore to the beginning of symbol
     * names. If we can't find a name without an underscore, try again with
     * the underscore.
     */

    native = Tcl_UtfToExternalDString(NULL, symbol, -1, &ds);
    proc = (Tcl_PackageInitProc *) dlsym(handle, native);	/* INTL: Native. */
    if (proc == NULL) {
	Tcl_DStringInit(&newName);
	Tcl_DStringAppend(&newName, "_", 1);
	native = Tcl_DStringAppend(&newName, native, -1);
	proc = (Tcl_PackageInitProc *) dlsym(handle, native);	/* INTL: Native. */
	Tcl_DStringFree(&newName);
    }
    Tcl_DStringFree(&ds);
    if (proc == NULL && interp != NULL) {
	Tcl_ResetResult(interp);
	Tcl_AppendResult(interp, "cannot find symbol \"", symbol, "\": ",
		dlerror(), NULL);







|
>
|
>
>

>
|
>








|




|







140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

static void *
FindSymbol(
    Tcl_Interp *interp,		/* Place to put error messages. */
    Tcl_LoadHandle loadHandle,	/* Value from TcpDlopen(). */
    const char *symbol)		/* Symbol to look up. */
{
    const char *native;		/* Name of the library to be loaded, in
				 * system encoding */
    Tcl_DString newName, ds;	/* Buffers for converting the name to
				 * system encoding and prepending an 
				 * underscore*/
    void *handle = (void *) loadHandle->clientData;
				/* Native handle to the loaded library */
    void *proc;			/* Address corresponding to the resolved
				 * symbol */

    /*
     * Some platforms still add an underscore to the beginning of symbol
     * names. If we can't find a name without an underscore, try again with
     * the underscore.
     */

    native = Tcl_UtfToExternalDString(NULL, symbol, -1, &ds);
    proc = dlsym(handle, native);	/* INTL: Native. */
    if (proc == NULL) {
	Tcl_DStringInit(&newName);
	Tcl_DStringAppend(&newName, "_", 1);
	native = Tcl_DStringAppend(&newName, native, -1);
	proc = dlsym(handle, native);	/* INTL: Native. */
	Tcl_DStringFree(&newName);
    }
    Tcl_DStringFree(&ds);
    if (proc == NULL && interp != NULL) {
	Tcl_ResetResult(interp);
	Tcl_AppendResult(interp, "cannot find symbol \"", symbol, "\": ",
		dlerror(), NULL);
Changes to win/Makefile.in.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# This file is a Makefile for Tcl.  If it has the name "Makefile.in" then it
# is a template for a Makefile; to generate the actual Makefile, run
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.71.2.63 2010/04/19 15:58:52 dgp Exp $

VERSION = @TCL_VERSION@

#--------------------------------------------------------------------------
# Things you can change to personalize the Makefile for your own site (you can
# make these changes in either Makefile.in or Makefile, but changes to
# Makefile will get lost if you re-run the configuration script).






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# This file is a Makefile for Tcl.  If it has the name "Makefile.in" then it
# is a template for a Makefile; to generate the actual Makefile, run
# "./configure", which is a configuration script generated by the "autoconf"
# program (constructs like "@foo@" will get replaced in the actual Makefile.
#
# RCS: @(#) $Id: Makefile.in,v 1.71.2.64 2010/04/29 23:32:25 dgp Exp $

VERSION = @TCL_VERSION@

#--------------------------------------------------------------------------
# Things you can change to personalize the Makefile for your own site (you can
# make these changes in either Makefile.in or Makefile, but changes to
# Makefile will get lost if you re-run the configuration script).
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

# To enable compilation debugging reverse the comment characters on one of the
# following lines.
COMPILE_DEBUG_FLAGS =
#COMPILE_DEBUG_FLAGS = -DTCL_COMPILE_DEBUG
#COMPILE_DEBUG_FLAGS = -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS

# Special compiler flags to use when building man2tcl on Windows.
MAN2TCLFLAGS =		@MAN2TCLFLAGS@

SRC_DIR			= @srcdir@
ROOT_DIR		= @srcdir@/..
TOP_DIR			= $(shell cd @srcdir@/..; pwd)
GENERIC_DIR		= $(TOP_DIR)/generic
TOMMATH_DIR		= $(TOP_DIR)/libtommath
WIN_DIR			= $(TOP_DIR)/win
COMPAT_DIR		= $(TOP_DIR)/compat







<
<
<







86
87
88
89
90
91
92



93
94
95
96
97
98
99

# To enable compilation debugging reverse the comment characters on one of the
# following lines.
COMPILE_DEBUG_FLAGS =
#COMPILE_DEBUG_FLAGS = -DTCL_COMPILE_DEBUG
#COMPILE_DEBUG_FLAGS = -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS




SRC_DIR			= @srcdir@
ROOT_DIR		= @srcdir@/..
TOP_DIR			= $(shell cd @srcdir@/..; pwd)
GENERIC_DIR		= $(TOP_DIR)/generic
TOMMATH_DIR		= $(TOP_DIR)/libtommath
WIN_DIR			= $(TOP_DIR)/win
COMPAT_DIR		= $(TOP_DIR)/compat
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
	    do \
	    $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/opt0.4"; \
	    done;
	@echo "Installing package msgcat 1.4.3 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.4.3.tm;
	@echo "Installing package tcltest 2.3.2 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.2.tm;
	@echo "Installing package platform 1.0.6 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.6.tm;
	@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/platform/shell.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform/shell-1.1.4.tm;
	@echo "Installing encodings";
	@for i in $(ROOT_DIR)/library/encoding/*.enc ; do \
		$(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)/encoding"; \
	done;








|
|







671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
	    do \
	    $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/opt0.4"; \
	    done;
	@echo "Installing package msgcat 1.4.3 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.4.3.tm;
	@echo "Installing package tcltest 2.3.2 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.2.tm;
	@echo "Installing package platform 1.0.7 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.7.tm;
	@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
	@$(COPY) $(ROOT_DIR)/library/platform/shell.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform/shell-1.1.4.tm;
	@echo "Installing encodings";
	@for i in $(ROOT_DIR)/library/encoding/*.enc ; do \
		$(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)/encoding"; \
	done;

Changes to win/tclWinPort.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * tclWinPort.h --
 *
 *	This header file handles porting issues that occur because of
 *	differences between Windows and Unix. It should be the only
 *	file that contains #ifdefs to handle different flavors of OS.
 *
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinPort.h,v 1.36.4.16 2010/04/19 15:58:52 dgp Exp $
 */

#ifndef _TCLWINPORT
#define _TCLWINPORT

#define WIN32_LEAN_AND_MEAN
#include <windows.h>












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * tclWinPort.h --
 *
 *	This header file handles porting issues that occur because of
 *	differences between Windows and Unix. It should be the only
 *	file that contains #ifdefs to handle different flavors of OS.
 *
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclWinPort.h,v 1.36.4.17 2010/04/29 23:32:25 dgp Exp $
 */

#ifndef _TCLWINPORT
#define _TCLWINPORT

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 * The following sets of #includes and #ifdefs are required to get Tcl to
 * compile under the windows compilers.
 *---------------------------------------------------------------------------
 */

#include <wchar.h>
#include <io.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
#include <malloc.h>
#include <process.h>
#include <signal.h>
#include <string.h>

#ifdef __CYGWIN__
#   include <unistd.h>
#   ifndef _wcsicmp
#	define _wcsicmp wcscasecmp
#   endif
#else







<
<






|







52
53
54
55
56
57
58


59
60
61
62
63
64
65
66
67
68
69
70
71
72
 * The following sets of #includes and #ifdefs are required to get Tcl to
 * compile under the windows compilers.
 *---------------------------------------------------------------------------
 */

#include <wchar.h>
#include <io.h>


#include <errno.h>
#include <fcntl.h>
#include <float.h>
#include <malloc.h>
#include <process.h>
#include <signal.h>
#include <limits.h>

#ifdef __CYGWIN__
#   include <unistd.h>
#   ifndef _wcsicmp
#	define _wcsicmp wcscasecmp
#   endif
#else
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424

#ifdef  __BORLANDC__
#   define timezone _timezone
#   define environ  _environ
#endif /* __BORLANDC__ */

#ifdef __CYGWIN__
/* On Cygwin, the environment is imported from the Cygwin DLL. */
#   define putenv TclCygwinPutenv
#   define timezone _timezone
#endif /* __CYGWIN__ */


#ifdef __WATCOMC__
    /*
     * OpenWatcom uses a wine derived winsock2.h that is missing the







<
<







407
408
409
410
411
412
413


414
415
416
417
418
419
420

#ifdef  __BORLANDC__
#   define timezone _timezone
#   define environ  _environ
#endif /* __BORLANDC__ */

#ifdef __CYGWIN__


#   define timezone _timezone
#endif /* __CYGWIN__ */


#ifdef __WATCOMC__
    /*
     * OpenWatcom uses a wine derived winsock2.h that is missing the