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: |
93ad5b0c958326c070873eb22c0eeff8 |
| 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
Changes to ChangeLog.
1 2 3 4 5 6 7 8 | 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> | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | | | | | | | | | 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 | * 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 | | | 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 | * unix/tclLoadDyld.c: * unix/tclLoadNext.c: * unix/tclLoadOSF.c: * unix/tclLoadShl.c: * unix/tclUnixPipe.c: * win/Makefile.in: * win/tclWinLoad.c: | | | 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 | * 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. | | | 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 | * 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 | | | 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 | 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> | | | 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 | 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: | | | 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 | * 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> | | | 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 |
/*
* 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.
*
| | < | < | 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 | * 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. * | | < | < | 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 | * * 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. * | | < < < | 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 | /* * 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. * | | | | 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 | 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); | | | 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 | /* * 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. * | | < | 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 | /* * 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. * | | < | 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 | /* * 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. * | | | < | < | 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 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Headers if any. */ | | | 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 |
#define AllocVars(vPtr) \
register struct vars *vPtr = (struct vars *) MALLOC(sizeof(struct vars))
#define FreeVars(vPtr) \
FREE(vPtr)
#endif
/*
| > | > > > < < | 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 | */ #include "regcustom.h" /* * Things that regcustom.h might override. */ | < < < < < < < < < | 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 | #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 */ | < < < | 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 | * 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. * | | | 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 | /* * numMallocs[i] is the difference between the number of mallocs and frees for * a given block size. */ static unsigned int numMallocs[NBUCKETS+1]; | < | 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 | * 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. * | | | < < | 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 | /* * 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. * | | | 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 | * * 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. * | | | 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 |
/*
* If this is Path, eliminate any PATH variable, to prevent any
* confusion.
*/
if (strcmp(name, "Path") == 0) {
#ifdef __WIN32__
| | | | | | 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 | * 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. * | | < < | 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 |
do { \
objPtr->internalRep.twoPtrValue.ptr2 = auxObjList; \
auxObjList = objPtr; \
} while (0)
#define POP_TAUX_OBJ() \
do { \
| | | 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 | 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 | | | 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 |
/*
* 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.
*/
| | > | | 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 |
/*
* 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) {
| < | < | > | < < | < | | | < < < < | | < < | > | 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 |
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);
| < > | | | | | | < < > | | | < < > | | < | 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 |
* 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) {
| | < | > < | | 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 |
case INST_REVERSE: {
Tcl_Obj **a, **b;
opnd = TclGetUInt4AtPtr(pc+1);
a = tosPtr-(opnd-1);
b = tosPtr;
while (a<b) {
| | < | | 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 |
TclNewObj(objPtr);
objPtr->internalRep.twoPtrValue.ptr1 = (void *) CURR_DEPTH;
PUSH_TAUX_OBJ(objPtr);
NEXT_INST_F(1, 0, 0);
case INST_EXPAND_STKTOP: {
| | < | < | | 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 |
goto nonRecursiveCallStart;
}
/*
* INVOCATION BLOCK
*/
| < < < < | 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 |
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;
| | > > > > > > > | 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 |
#endif /* TCL_COMPILE_DEBUG */
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);
if (catchTop != initCatchTop) {
TclClearTailcall(interp, param);
iPtr->varFramePtr->tailcallPtr = 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 |
if (iPtr->varFramePtr->tailcallPtr) {
if (catchTop == initCatchTop) {
goto abnormalReturn;
}
TclClearTailcall(interp, iPtr->varFramePtr->tailcallPtr);
iPtr->varFramePtr->tailcallPtr = NULL;
| < | | 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 | TclNewObj(objPtr); Tcl_IncrRefCount(objPtr); iPtr->objResultPtr = objPtr; NEXT_INST_V(0, cleanup, -1); #if TCL_SUPPORT_84_BYTECODE | | < < < > | > > | | | | | | | | | | | | | | | | < | > | < | < < < < < < | > < < < < | 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 |
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) {
| | < < | | 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 |
TRACE(("\"%.30s\" => ", O2S(objPtr)));
doLoadStk:
part1Ptr = objPtr;
varPtr = TclObjLookupVarEx(interp, part1Ptr, part2Ptr,
TCL_LEAVE_ERR_MSG, "read", /*createPart1*/0, /*createPart2*/1,
&arrayPtr);
| | > > > > | | | | | | | | | | < < < < < < | < < < < | < > > | | 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 |
doStoreScalarDirect:
valuePtr = OBJ_AT_TOS;
varPtr = LOCAL(opnd);
TRACE(("%u <- \"%.30s\" => ", opnd, O2S(valuePtr)));
while (TclIsVarLink(varPtr)) {
varPtr = varPtr->value.linkPtr;
}
| | > > | > > | | | | | > | | | | | | | | | | | | | < < < < | 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 |
} 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);
| | > > > | | | | < < < < < | 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 |
}
cleanup = 2;
part1Ptr = NULL;
doStoreArrayDirectFailed:
varPtr = TclLookupArrayElement(interp, part1Ptr, part2Ptr,
TCL_LEAVE_ERR_MSG, "set", 1, 1, arrayPtr, opnd);
| | < < < | > | 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 |
part1Ptr = part2Ptr = NULL;
doCallPtrSetVar:
DECACHE_STACK_INFO();
objResultPtr = TclPtrSetVar(interp, varPtr, arrayPtr,
part1Ptr, part2Ptr, valuePtr, storeFlags, opnd);
CACHE_STACK_INFO();
| | > > > | | | | | < < < < < < | | 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 |
pcAdjustment = 1;
goto doIncrStk;
}
case INST_INCR_ARRAY_STK_IMM:
case INST_INCR_SCALAR_STK_IMM:
case INST_INCR_STK_IMM:
| | | | | | < < < < | > > | | | | < < < | > | | | | | | | | | | | | | 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 |
objPtr->refCount--; /* We know it's shared */
objResultPtr = Tcl_DuplicateObj(objPtr);
Tcl_IncrRefCount(objResultPtr);
varPtr->value.objPtr = objResultPtr;
} else {
objResultPtr = objPtr;
}
| | | | < < < | > > | | | | < < < | > < | | 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 |
/*
* End of INST_EXIST instructions.
* -----------------------------------------------------------------
* Start of INST_UNSET instructions.
*/
{
| | | > | < < | > | > | > > > > > > > | < | | < | < < < < < | > | < | > | | < < > > > | < < | | > | | | < | | < | < < < | < | | | | < < < < | < | 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 |
}
}
TclSetVarLink(varPtr);
varPtr->value.linkPtr = otherPtr;
if (TclIsVarInHash(otherPtr)) {
VarHashRefCount(otherPtr)++;
}
| < | | | < | 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 |
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 */
| | < | | 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 | * performed. */ int i1, i2, iResult; value2Ptr = OBJ_AT_TOS; valuePtr = OBJ_UNDER_TOS; | | < | | < | > > > > > < | < | | < < < < < < < < < < < | | | | | > > > > > | | | | | | < < < < < | < | < | < | < < | | | > | | | < < < < | < < | | | > > > | < < < < | | | | | < < < < | < | | | < < < < < < | | > > > | < < < < | | | | | < < < < | < < | < < | 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 | value2Ptr = OBJ_UNDER_TOS; /* * Compute the new variable value. */ objResultPtr = TclLsetList(interp, objPtr, value2Ptr, valuePtr); | < < < < < < | | | < < < | > > > > < | | | < < < < < | | | | | | | | | | | < | < < < < < < < | < | | > > > | < < < | > | | | | | | | | | < | < < < | < < < | | | | | | | | | | | | < < < < < < < < | | | | | | | | | | | | | | < | < < | > < < | < < < < < < | < | | > | | | | | | | | < < | | | | | | | | < < < | < | < < | | | | | 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 | 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); | | < | < < < > > > > > > | > | < < | | < < < > | > > | | | < > | > > | 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 |
* -----------------------------------------------------------------
* Start of numeric operator instructions.
*/
{
ClientData ptr1, ptr2;
int type1, type2;
| < < < < | 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 | /* * NaN 2nd arg: NaN != to everything, other compares are false. */ iResult = (*pc == INST_NEQ); goto foundResult; } | < | < < | < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 |
#endif
objResultPtr = TCONST(iResult);
NEXT_INST_F(0, 2, 1);
}
case INST_MOD:
case INST_LSHIFT:
| | | | | | < | < | | < | < | < > | > < | > | > > > < | > < < < < | > < < < < < | | | | | | < < < < | < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < | < | < | < < < < | > > | < < < < < < < < < < < < < < < < | < < < | < | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | < | < | < | < < > > | | < | < < < < < < < < < < < < < < < < < < | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | | < < | < < < < < < < < < < < | < < < < | < < < < < < < < < < < < < < < < | < | < < < < < < < < < < | < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < | < < < | < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < | < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < > | | < > | | < < < | < < | | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > | | < | | | < | < | < > | | > | | > > | < < | < < | < < | < < < < < < < < > < < < < < < < < < < < < < < < < < < < | < < < < | | < < < < < < < < < < | < < < < | < | < | | > > > > > > > > | < > | | < < < < | < < < < | < | > | | | | | | | | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < | < < < < < < < < | < < < < < | < > | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | < | < < < > > > > > > > | > | | < < < < < | < < > | > | | | < < < < < < < < < < < < | < < < < | < < | < < < < < < | < < < | < < | > | < < < < | < | < < < < | < > > | < < < | < | | | < | < | < < < | | | | < < < < < < < < < | < < < | | < | | | < < < < < < < < < < < | < | | | < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < | < | | 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 | Tcl_ResetResult(interp); CACHE_STACK_INFO(); */ TRESULT = TCL_CONTINUE; cleanup = 0; goto processExceptionReturn; | > > > > > > > > > | < < < < < | 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 | */ pc += 5; TCL_DTRACE_INST_NEXT(); #else NEXT_INST_F(5, 0, 0); #endif | | < | < < < < < < < < | | | > > > | | | | < < < < < | 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 |
TclDecrRefCount(value2Ptr);
}
varPtr->value.objPtr = valuePtr;
Tcl_IncrRefCount(valuePtr);
}
} else {
DECACHE_STACK_INFO();
| | | | < < | > | 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 |
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));
| < | | > | | | | < < < < < | > > | > | | 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 |
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))));
| < | < | 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 |
} else {
allocateDict = Tcl_IsShared(dictPtr);
if (allocateDict) {
dictPtr = Tcl_DuplicateObj(dictPtr);
}
}
| | | | | < | | > > | > | < | | | > | | | > > > | | < < | | | | > < < < | | | < | | 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 |
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) {
| | | | | < < < | 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 |
}
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) {
| < | | 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 |
objResultPtr = TclPtrSetVar(interp, varPtr, NULL, NULL, NULL,
dictPtr, TCL_LEAVE_ERR_MSG, opnd);
CACHE_STACK_INFO();
if (objResultPtr == NULL) {
if (allocdict) {
TclDecrRefCount(dictPtr);
}
| < | < < < < < < < < < < < < < < < < < < < < < < < < < | 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 |
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);
| < > | < | | | | | | | | | | | | > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | * 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. * | | | | 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 | * 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. * | | | | 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 | * 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. * | | | 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 |
if (handle == NULL) {
return TCL_ERROR;
}
*clientDataPtr = handle;
| | | | 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 | * 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. * | | | 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 | * 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. * | | | 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 | */ #include "tclPort.h" #include <stdio.h> #include <ctype.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 |
( !((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) \
| | | 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 | /* * 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. * | | | | 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 | * 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. * | | < | 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 | * '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. * | | < | < < < | | < | 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 | * * 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. * | | | 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 |
* 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)) {
| | < | | 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 | * 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 | > < < < < < < | 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 | */ #if defined(BUILD_tcl) || !defined(_WIN32) MODULE_SCOPE const char *mp_s_rmap; #endif #ifdef __cplusplus | | | | | 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 | /* *---------------------------------------------------------------------- * * 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. * | | < | 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 | /* * 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. * | | < | 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.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 |
}
linux {
# Look for the libc*.so and determine its version
# (libc5/6, libc6 further glibc 2.X)
set v unknown
| > > > > > > > > > | > | > | > | | > | | > > > > | 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 |
return $res
}
# ### ### ### ######### ######### #########
## Ready
| | | 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 |
{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}
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 |
{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}
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 |
{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}
| | | 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 |
{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}
| | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | > | | | | | | | | | | | | | | | | | | | > | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 |
{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}
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 |
# 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}
| < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 |
{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}
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 |
{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}
| | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | > | | | | | | | | | | | | | | | | | | | > | < | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 |
{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}
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 |
{-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}
| | | | 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 |
{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}
| | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | > | | | | | | | | | | | | < | | | | | | | | | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | > | > | | | | | < < < | | | | | | | | | | > | | | | | | | < | | | | | | | | | | | | | | | | | | | | | | | | 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 |
# 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}
| | | | 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 |
{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}
| | | 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 |
# 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}
| | > > | 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 | # # 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. # | | | 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 | $(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; | | | | 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 | /* * 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. * | | | 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 |
static void *
FindSymbol(
Tcl_Interp *interp, /* Place to put error messages. */
Tcl_LoadHandle loadHandle, /* Value from TcpDlopen(). */
const char *symbol) /* Symbol to look up. */
{
| | > | > > > | > | | | 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 | # # 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. # | | | 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 | # 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 | < < < | 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 | 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; | | | | 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 | /* * 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. * | | | 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 | * The following sets of #includes and #ifdefs are required to get Tcl to * compile under the windows compilers. *--------------------------------------------------------------------------- */ #include <wchar.h> #include <io.h> | < < | | 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 | #ifdef __BORLANDC__ # define timezone _timezone # define environ _environ #endif /* __BORLANDC__ */ #ifdef __CYGWIN__ | < < | 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
|
| ︙ | ︙ |