// Code generated for linux/s390x by 'generator -hide TclGetCStackPtr -hide TclWinCPUID -hide TclpCreateProcess -hide __darwin_check_fd_set --prefix-external=X --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/s390x -eval-all-macros -extended-errors -ignore-link-errors -ignore-unsupported-alignment -o libtcl.a.go --package-name libtcl9_0 libtcl9.0.a -lz', DO NOT EDIT. //go:build linux && s390x package libtcl9_0 import ( "reflect" "unsafe" "modernc.org/libc" "modernc.org/libz" ) var _ reflect.Type var _ unsafe.Pointer const ABSIZE = 10 const AF_ALG = 38 const AF_APPLETALK = 5 const AF_ASH = 18 const AF_ATMPVC = 8 const AF_ATMSVC = 20 const AF_AX25 = 3 const AF_BLUETOOTH = 31 const AF_BRIDGE = 7 const AF_CAIF = 37 const AF_CAN = 29 const AF_DECnet = 12 const AF_ECONET = 19 const AF_FILE = 1 const AF_IB = 27 const AF_IEEE802154 = 36 const AF_INET = 2 const AF_INET6 = 10 const AF_IPX = 4 const AF_IRDA = 23 const AF_ISDN = 34 const AF_IUCV = 32 const AF_KCM = 41 const AF_KEY = 15 const AF_LLC = 26 const AF_LOCAL = 1 const AF_MAX = 45 const AF_MPLS = 28 const AF_NETBEUI = 13 const AF_NETLINK = 16 const AF_NETROM = 6 const AF_NFC = 39 const AF_PACKET = 17 const AF_PHONET = 35 const AF_PPPOX = 24 const AF_QIPCRTR = 42 const AF_RDS = 21 const AF_ROSE = 11 const AF_ROUTE = 16 const AF_RXRPC = 33 const AF_SECURITY = 14 const AF_SMC = 43 const AF_SNA = 22 const AF_TIPC = 30 const AF_UNIX = 1 const AF_UNSPEC = 0 const AF_VSOCK = 40 const AF_WANPIPE = 25 const AF_X25 = 9 const AF_XDP = 44 const AHEAD = 97 const AI_ADDRCONFIG = 32 const AI_ALL = 16 const AI_CANONNAME = 2 const AI_NUMERICHOST = 4 const AI_NUMERICSERV = 1024 const AI_PASSIVE = 1 const AI_V4MAPPED = 8 const ALLOC_NOBJHIGH = 1200 const ARG_MAX = 131072 const AT_EACCESS = 512 const AT_EMPTY_PATH = 4096 const AT_FDCWD = -100 const AT_NO_AUTOMOUNT = 2048 const AT_RECURSIVE = 32768 const AT_REMOVEDIR = 512 const AT_STATX_DONT_SYNC = 16384 const AT_STATX_FORCE_SYNC = 8192 const AT_STATX_SYNC_AS_STAT = 0 const AT_STATX_SYNC_TYPE = 24576 const AT_SYMLINK_FOLLOW = 1024 const AT_SYMLINK_NOFOLLOW = 256 const BACKR = 16 const BACKREF = 98 const BC_BASE_MAX = 99 const BC_DIM_MAX = 2048 const BC_SCALE_MAX = 99 const BC_STRING_MAX = 1000 const BEHIND = 114 const BIG_ENDIAN = 4321 const BUFSIZ = 1024 const BUILD_tcl = 1 const BUS_ADRALN = 1 const BUS_ADRERR = 2 const BUS_MCEERR_AO = 5 const BUS_MCEERR_AR = 4 const BUS_OBJERR = 3 const BYTBITS = 8 const BYTE_ORDER = 4321 const BYTMASK = 255 const BYTTAB = 256 const CANBSIZ = 255 const CANCELED = 4096 const CAP = 8 const CCLASS = 67 const CHARCLASS_NAME_MAX = 14 const CHAR_BIT = 8 const CHAR_MAX = 255 const CHAR_MIN = 0 const CHRBITS = 32 const CHR_MAX = 1114111 const CHR_MIN = 0 const CLD_CONTINUED = 6 const CLD_DUMPED = 3 const CLD_EXITED = 1 const CLD_KILLED = 2 const CLD_STOPPED = 5 const CLD_TRAPPED = 4 const CLL_END = -1 const CLOCKS_PER_SEC = 1000000 const CLOCK_BOOTTIME = 7 const CLOCK_BOOTTIME_ALARM = 9 const CLOCK_MONOTONIC = 1 const CLOCK_MONOTONIC_COARSE = 6 const CLOCK_MONOTONIC_RAW = 4 const CLOCK_PROCESS_CPUTIME_ID = 2 const CLOCK_REALTIME = 0 const CLOCK_REALTIME_ALARM = 8 const CLOCK_REALTIME_COARSE = 5 const CLOCK_SGI_CYCLE = 10 const CLOCK_TAI = 11 const CLOCK_THREAD_CPUTIME_ID = 3 const CLONE_CHILD_CLEARTID = 2097152 const CLONE_CHILD_SETTID = 16777216 const CLONE_DETACHED = 4194304 const CLONE_FILES = 1024 const CLONE_FS = 512 const CLONE_IO = 2147483648 const CLONE_NEWCGROUP = 33554432 const CLONE_NEWIPC = 134217728 const CLONE_NEWNET = 1073741824 const CLONE_NEWNS = 131072 const CLONE_NEWPID = 536870912 const CLONE_NEWTIME = 128 const CLONE_NEWUSER = 268435456 const CLONE_NEWUTS = 67108864 const CLONE_PARENT = 32768 const CLONE_PARENT_SETTID = 1048576 const CLONE_PIDFD = 4096 const CLONE_PTRACE = 8192 const CLONE_SETTLS = 524288 const CLONE_SIGHAND = 2048 const CLONE_SYSVSEM = 262144 const CLONE_THREAD = 65536 const CLONE_UNTRACED = 8388608 const CLONE_VFORK = 16384 const CLONE_VM = 256 const CMD_COMPILES_EXPANDED = 8 const CMD_DEAD = 64 const CMD_DYING = 1 const CMD_HAS_EXEC_TRACES = 4 const CMD_REDEF_IN_PROGRESS = 16 const CMD_TRACE_ACTIVE = 2 const CMD_VIA_RESOLVER = 32 const CMMAGIC = 2166 const CNFA_NOPROGRESS = 1 const COLLEL = 73 const COLL_WEIGHTS_MAX = 2 const COLORLESS = -1 const COMPATIBLE = 3 const CONST86 = 0 const CPU_SETSIZE = 1024 const CSIGNAL = 255 const DBL_DECIMAL_DIG = 17 const DBL_DIG = 15 const DBL_EPSILON = 0 const DBL_HAS_SUBNORM = 1 const DBL_MANT_DIG = 53 const DBL_MAX = 0 const DBL_MAX_10_EXP = 308 const DBL_MAX_EXP = 1024 const DBL_MIN = 0 const DBL_MIN_10_EXP = -307 const DBL_MIN_EXP = -1021 const DBL_TRUE_MIN = 0 const DECIMAL_DIG = 17 const DELAYTIMER_MAX = 2147483647 const DELETED = 1 const DEV_BSIZE = 512 const DICT_PATH_CREATE = 5 const DICT_PATH_EXISTS = 2 const DICT_PATH_READ = 0 const DICT_PATH_UPDATE = 1 const DN_ACCESS = 1 const DN_ATTRIB = 32 const DN_CREATE = 4 const DN_DELETE = 8 const DN_MODIFY = 2 const DN_MULTISHOT = 2147483648 const DN_RENAME = 16 const DONT_COMPILE_CMDS_INLINE = 32 const DT_BLK = 6 const DT_CHR = 2 const DT_DIR = 4 const DT_FIFO = 1 const DT_LNK = 10 const DT_REG = 8 const DT_SOCK = 12 const DT_UNKNOWN = 0 const DT_WHT = 14 const DUPINF = 256 const DUPMAX = 255 const DUPTRAVERSE_MAX_DEPTH = 15000 const E2BIG = 7 const EACCES = 13 const EADDRINUSE = 98 const EADDRNOTAVAIL = 99 const EADV = 68 const EAFNOSUPPORT = 97 const EAGAIN = 11 const EAI_ADDRFAMILY = -9 const EAI_AGAIN = -3 const EAI_ALLDONE = -103 const EAI_BADFLAGS = -1 const EAI_CANCELED = -101 const EAI_FAIL = -4 const EAI_FAMILY = -6 const EAI_IDN_ENCODE = -105 const EAI_INPROGRESS = -100 const EAI_INTR = -104 const EAI_MEMORY = -10 const EAI_NODATA = -5 const EAI_NONAME = -2 const EAI_NOTCANCELED = -102 const EAI_OVERFLOW = -12 const EAI_SERVICE = -8 const EAI_SOCKTYPE = -7 const EAI_SYSTEM = -11 const EALREADY = 114 const EBADE = 52 const EBADF = 9 const EBADFD = 77 const EBADMSG = 74 const EBADR = 53 const EBADRQC = 56 const EBADSLT = 57 const EBFONT = 59 const EBUSY = 16 const ECANCELED = 125 const ECHILD = 10 const ECHRNG = 44 const ECLASS = 69 const ECOMM = 70 const ECONNABORTED = 103 const ECONNREFUSED = 111 const ECONNRESET = 104 const EDEADLK = 35 const EDEADLOCK = 35 const EDESTADDRREQ = 89 const EDOM = 33 const EDOTDOT = 73 const EDQUOT = 122 const EEXIST = 17 const EFAULT = 14 const EFBIG = 27 const EHOSTDOWN = 112 const EHOSTUNREACH = 113 const EHWPOISON = 133 const EIDRM = 43 const EILSEQ = 84 const EINPROGRESS = 115 const EINTR = 4 const EINVAL = 22 const EIO = 5 const EISCONN = 106 const EISDIR = 21 const EISNAM = 120 const EKEYEXPIRED = 127 const EKEYREJECTED = 129 const EKEYREVOKED = 128 const EL2HLT = 51 const EL2NSYNC = 45 const EL3HLT = 46 const EL3RST = 47 const ELIBACC = 79 const ELIBBAD = 80 const ELIBEXEC = 83 const ELIBMAX = 82 const ELIBSCN = 81 const ELNRNG = 48 const ELOOP = 40 const EMEDIUMTYPE = 124 const EMFILE = 24 const EMLINK = 31 const EMPTY = 110 const EMSGSIZE = 90 const EMULTIHOP = 72 const ENAMETOOLONG = 36 const ENAVAIL = 119 const ENCODING_PROFILE_MASK = 4278190080 const END = 88 const ENETDOWN = 100 const ENETRESET = 102 const ENETUNREACH = 101 const ENFILE = 23 const ENOANO = 55 const ENOBUFS = 105 const ENOCSI = 50 const ENODATA = 61 const ENODEV = 19 const ENOENT = 2 const ENOEXEC = 8 const ENOKEY = 126 const ENOLCK = 37 const ENOLINK = 67 const ENOMEDIUM = 123 const ENOMEM = 12 const ENOMSG = 42 const ENONET = 64 const ENOPKG = 65 const ENOPROTOOPT = 92 const ENOSPC = 28 const ENOSR = 63 const ENOSTR = 60 const ENOSYS = 38 const ENOTBLK = 15 const ENOTCONN = 107 const ENOTDIR = 20 const ENOTEMPTY = 39 const ENOTNAM = 118 const ENOTRECOVERABLE = 131 const ENOTSOCK = 88 const ENOTSUP = 95 const ENOTTY = 25 const ENOTUNIQ = 76 const ENSEMBLE_COMPILE = 4 const ENSEMBLE_DEAD = 1 const ENXIO = 6 const EOPNOTSUPP = 95 const EOS = 101 const EOVERFLOW = 75 const EOWNERDEAD = 130 const EPERM = 1 const EPFNOSUPPORT = 96 const EPIPE = 32 const EPROTO = 71 const EPROTONOSUPPORT = 93 const EPROTOTYPE = 91 const ERANGE = 34 const EREMCHG = 78 const EREMOTE = 66 const EREMOTEIO = 121 const ERESTART = 85 const ERFKILL = 132 const EROFS = 30 const ERR_ALREADY_LOGGED = 4 const ERR_LEGACY_COPY = 2048 const ESHUTDOWN = 108 const ESOCKTNOSUPPORT = 94 const ESPIPE = 29 const ESRCH = 3 const ESRMNT = 69 const ESTALE = 116 const ESTRPIPE = 86 const ETIME = 62 const ETIMEDOUT = 110 const ETOOMANYREFS = 109 const ETXTBSY = 26 const EUCLEAN = 117 const EUNATCH = 49 const EUSERS = 87 const EWOULDBLOCK = 11 const EXDEV = 18 const EXFULL = 54 const EXIT_FAILURE = 1 const EXIT_SUCCESS = 0 const EXPR_NEST_MAX = 32 const EXTERN = 0 const FALLOC_FL_KEEP_SIZE = 1 const FALLOC_FL_PUNCH_HOLE = 2 const FAPPEND = 1024 const FASYNC = 8192 const FD_CLOEXEC = 1 const FD_SETSIZE = 1024 const FFSYNC = 1052672 const FILENAME_MAX = 4096 const FILESIZEBITS = 64 const FLT_DECIMAL_DIG = 9 const FLT_DIG = 6 const FLT_EPSILON = 0 const FLT_EVAL_METHOD = 0 const FLT_HAS_SUBNORM = 1 const FLT_MANT_DIG = 24 const FLT_MAX = 0 const FLT_MAX_10_EXP = 38 const FLT_MAX_EXP = 128 const FLT_MIN = 0 const FLT_MIN_10_EXP = -37 const FLT_MIN_EXP = -125 const FLT_RADIX = 2 const FLT_ROUNDS = 0 const FLT_TRUE_MIN = 0 const FNDELAY = 2048 const FNONBLOCK = 2048 const FOPEN_MAX = 1000 const FPE_FLTDIV = 3 const FPE_FLTINV = 7 const FPE_FLTOVF = 4 const FPE_FLTRES = 6 const FPE_FLTSUB = 8 const FPE_FLTUND = 5 const FPE_INTDIV = 1 const FPE_INTOVF = 2 const FRAME_IS_LAMBDA = 2 const FRAME_IS_METHOD = 4 const FRAME_IS_OO_DEFINE = 8 const FRAME_IS_PRIVATE_DEFINE = 16 const FRAME_IS_PROC = 1 const FREECOL = 1 const FREESTATE = -1 const F_ADD_SEALS = 1033 const F_CANCELLK = 1029 const F_DUPFD = 0 const F_DUPFD_CLOEXEC = 1030 const F_GETFD = 1 const F_GETFL = 3 const F_GETLEASE = 1025 const F_GETLK = 5 const F_GETLK64 = 5 const F_GETOWN = 9 const F_GETOWNER_UIDS = 17 const F_GETOWN_EX = 16 const F_GETPIPE_SZ = 1032 const F_GETSIG = 11 const F_GET_FILE_RW_HINT = 1037 const F_GET_RW_HINT = 1035 const F_GET_SEALS = 1034 const F_LOCK = 1 const F_NOTIFY = 1026 const F_OFD_GETLK = 36 const F_OFD_SETLK = 37 const F_OFD_SETLKW = 38 const F_OK = 0 const F_OWNER_GID = 2 const F_OWNER_PGRP = 2 const F_OWNER_PID = 1 const F_OWNER_TID = 0 const F_RDLCK = 0 const F_SEAL_FUTURE_WRITE = 16 const F_SEAL_GROW = 4 const F_SEAL_SEAL = 1 const F_SEAL_SHRINK = 2 const F_SEAL_WRITE = 8 const F_SETFD = 2 const F_SETFL = 4 const F_SETLEASE = 1024 const F_SETLK = 6 const F_SETLK64 = 6 const F_SETLKW = 7 const F_SETLKW64 = 7 const F_SETOWN = 8 const F_SETOWN_EX = 15 const F_SETPIPE_SZ = 1031 const F_SETSIG = 10 const F_SET_FILE_RW_HINT = 1038 const F_SET_RW_HINT = 1036 const F_TEST = 3 const F_TLOCK = 2 const F_ULOCK = 0 const F_UNLCK = 2 const F_WRLCK = 1 const GUTSMAGIC = 65241 const HASLACONS = 1 const HAVE_BLKCNT_T = 1 const HAVE_CAST_TO_UNION = 1 const HAVE_CFMAKERAW = 1 const HAVE_DECL_GETHOSTBYADDR_R = 1 const HAVE_DECL_GETHOSTBYNAME_R = 1 const HAVE_DECL_PTHREAD_MUTEX_RECURSIVE = 1 const HAVE_FREEADDRINFO = 1 const HAVE_GAI_STRERROR = 1 const HAVE_GETADDRINFO = 1 const HAVE_GETCWD = 1 const HAVE_GETGRGID_R = 1 const HAVE_GETGRGID_R_5 = 1 const HAVE_GETGRNAM_R = 1 const HAVE_GETGRNAM_R_5 = 1 const HAVE_GETHOSTBYADDR_R = 1 const HAVE_GETHOSTBYADDR_R_8 = 1 const HAVE_GETHOSTBYNAME_R = 1 const HAVE_GETHOSTBYNAME_R_6 = 1 const HAVE_GETNAMEINFO = 1 const HAVE_GETPWNAM_R = 1 const HAVE_GETPWNAM_R_5 = 1 const HAVE_GETPWUID_R = 1 const HAVE_GETPWUID_R_5 = 1 const HAVE_GMTIME_R = 1 const HAVE_HIDDEN = 1 const HAVE_INTPTR_T = 1 const HAVE_INTTYPES_H = 1 const HAVE_LANGINFO = 1 const HAVE_LOCALTIME_R = 1 const HAVE_MKSTEMP = 1 const HAVE_MKSTEMPS = 1 const HAVE_POSIX_SPAWNATTR_SETFLAGS = 1 const HAVE_POSIX_SPAWNP = 1 const HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = 1 const HAVE_PSELECT = 1 const HAVE_PTHREAD_ATFORK = 1 const HAVE_PTHREAD_ATTR_SETSTACKSIZE = 1 const HAVE_SIGNED_CHAR = 1 const HAVE_STDBOOL_H = 1 const HAVE_STDINT_H = 1 const HAVE_STDIO_H = 1 const HAVE_STDLIB_H = 1 const HAVE_STRINGS_H = 1 const HAVE_STRING_H = 1 const HAVE_STRUCT_ADDRINFO = 1 const HAVE_STRUCT_IN6_ADDR = 1 const HAVE_STRUCT_SOCKADDR_IN6 = 1 const HAVE_STRUCT_SOCKADDR_STORAGE = 1 const HAVE_STRUCT_STAT_ST_BLKSIZE = 1 const HAVE_STRUCT_STAT_ST_BLOCKS = 1 const HAVE_STRUCT_STAT_ST_RDEV = 1 const HAVE_SYS_IOCTL_H = 1 const HAVE_SYS_PARAM_H = 1 const HAVE_SYS_STAT_H = 1 const HAVE_SYS_TIME_H = 1 const HAVE_SYS_TYPES_H = 1 const HAVE_TIMEZONE_VAR = 1 const HAVE_TM_GMTOFF = 1 const HAVE_UINTPTR_T = 1 const HAVE_UNISTD_H = 1 const HAVE_VFORK = 1 const HAVE_WAITPID = 1 const HOST_NAME_MAX = 255 const HOST_NOT_FOUND = 1 const ILL_BADSTK = 8 const ILL_COPROC = 7 const ILL_ILLADR = 3 const ILL_ILLOPC = 1 const ILL_ILLOPN = 2 const ILL_ILLTRP = 4 const ILL_PRVOPC = 5 const ILL_PRVREG = 6 const INCOMPATIBLE = 1 const INET6_ADDRSTRLEN = 46 const INET_ADDRSTRLEN = 16 const INF = 3 const INT16_MAX = 32767 const INT16_MIN = -32768 const INT32_MAX = 2147483647 const INT32_MIN = -2147483648 const INT64_MAX = 9223372036854775807 const INT64_MIN = -9223372036854775808 const INT8_MAX = 127 const INT8_MIN = -128 const INTERP_ALTERNATE_WRONG_ARGS = 1024 const INTERP_DEBUG_FRAME = 16 const INTERP_TRACE_IN_PROGRESS = 512 const INTMAX_MAX = 9223372036854775807 const INTMAX_MIN = -9223372036854775808 const INTPTR_MAX = 9223372036854775807 const INTPTR_MIN = -9223372036854775808 const INT_FAST16_MAX = 2147483647 const INT_FAST16_MIN = -2147483648 const INT_FAST32_MAX = 2147483647 const INT_FAST32_MIN = -2147483648 const INT_FAST64_MAX = 9223372036854775807 const INT_FAST64_MIN = -9223372036854775808 const INT_FAST8_MAX = 127 const INT_FAST8_MIN = -128 const INT_LEAST16_MAX = 32767 const INT_LEAST16_MIN = -32768 const INT_LEAST32_MAX = 2147483647 const INT_LEAST32_MIN = -2147483648 const INT_LEAST64_MAX = 9223372036854775807 const INT_LEAST64_MIN = -9223372036854775808 const INT_LEAST8_MAX = 127 const INT_LEAST8_MIN = -128 const INT_MAX = 2147483647 const INT_MIN = -2147483648 const INUSE = 64 const IN_CLASSA_HOST = 16777215 const IN_CLASSA_MAX = 128 const IN_CLASSA_NET = 4278190080 const IN_CLASSA_NSHIFT = 24 const IN_CLASSB_HOST = 65535 const IN_CLASSB_MAX = 65536 const IN_CLASSB_NET = 4294901760 const IN_CLASSB_NSHIFT = 16 const IN_CLASSC_HOST = 255 const IN_CLASSC_NET = 4294967040 const IN_CLASSC_NSHIFT = 8 const IN_LOOPBACKNET = 127 const IOV_MAX = 1024 const IPPORT_RESERVED = 1024 const IPPROTO_AH = 51 const IPPROTO_BEETPH = 94 const IPPROTO_COMP = 108 const IPPROTO_DCCP = 33 const IPPROTO_DSTOPTS = 60 const IPPROTO_EGP = 8 const IPPROTO_ENCAP = 98 const IPPROTO_ESP = 50 const IPPROTO_ETHERNET = 143 const IPPROTO_FRAGMENT = 44 const IPPROTO_GRE = 47 const IPPROTO_HOPOPTS = 0 const IPPROTO_ICMP = 1 const IPPROTO_ICMPV6 = 58 const IPPROTO_IDP = 22 const IPPROTO_IGMP = 2 const IPPROTO_IP = 0 const IPPROTO_IPIP = 4 const IPPROTO_IPV6 = 41 const IPPROTO_MAX = 263 const IPPROTO_MH = 135 const IPPROTO_MPLS = 137 const IPPROTO_MPTCP = 262 const IPPROTO_MTP = 92 const IPPROTO_NONE = 59 const IPPROTO_PIM = 103 const IPPROTO_PUP = 12 const IPPROTO_RAW = 255 const IPPROTO_ROUTING = 43 const IPPROTO_RSVP = 46 const IPPROTO_SCTP = 132 const IPPROTO_TCP = 6 const IPPROTO_TP = 29 const IPPROTO_UDP = 17 const IPPROTO_UDPLITE = 136 const IPV6_2292DSTOPTS = 4 const IPV6_2292HOPLIMIT = 8 const IPV6_2292HOPOPTS = 3 const IPV6_2292PKTINFO = 2 const IPV6_2292PKTOPTIONS = 6 const IPV6_2292RTHDR = 5 const IPV6_ADDRFORM = 1 const IPV6_ADDR_PREFERENCES = 72 const IPV6_ADD_MEMBERSHIP = 20 const IPV6_AUTHHDR = 10 const IPV6_AUTOFLOWLABEL = 70 const IPV6_CHECKSUM = 7 const IPV6_DONTFRAG = 62 const IPV6_DROP_MEMBERSHIP = 21 const IPV6_DSTOPTS = 59 const IPV6_FREEBIND = 78 const IPV6_HDRINCL = 36 const IPV6_HOPLIMIT = 52 const IPV6_HOPOPTS = 54 const IPV6_IPSEC_POLICY = 34 const IPV6_JOIN_ANYCAST = 27 const IPV6_JOIN_GROUP = 20 const IPV6_LEAVE_ANYCAST = 28 const IPV6_LEAVE_GROUP = 21 const IPV6_MINHOPCOUNT = 73 const IPV6_MTU = 24 const IPV6_MTU_DISCOVER = 23 const IPV6_MULTICAST_ALL = 29 const IPV6_MULTICAST_HOPS = 18 const IPV6_MULTICAST_IF = 17 const IPV6_MULTICAST_LOOP = 19 const IPV6_NEXTHOP = 9 const IPV6_ORIGDSTADDR = 74 const IPV6_PATHMTU = 61 const IPV6_PKTINFO = 50 const IPV6_PMTUDISC_DO = 2 const IPV6_PMTUDISC_DONT = 0 const IPV6_PMTUDISC_INTERFACE = 4 const IPV6_PMTUDISC_OMIT = 5 const IPV6_PMTUDISC_PROBE = 3 const IPV6_PMTUDISC_WANT = 1 const IPV6_PREFER_SRC_CGA = 8 const IPV6_PREFER_SRC_COA = 4 const IPV6_PREFER_SRC_HOME = 1024 const IPV6_PREFER_SRC_NONCGA = 2048 const IPV6_PREFER_SRC_PUBLIC = 2 const IPV6_PREFER_SRC_PUBTMP_DEFAULT = 256 const IPV6_PREFER_SRC_TMP = 1 const IPV6_RECVDSTOPTS = 58 const IPV6_RECVERR = 25 const IPV6_RECVFRAGSIZE = 77 const IPV6_RECVHOPLIMIT = 51 const IPV6_RECVHOPOPTS = 53 const IPV6_RECVORIGDSTADDR = 74 const IPV6_RECVPATHMTU = 60 const IPV6_RECVPKTINFO = 49 const IPV6_RECVRTHDR = 56 const IPV6_RECVTCLASS = 66 const IPV6_ROUTER_ALERT = 22 const IPV6_ROUTER_ALERT_ISOLATE = 30 const IPV6_RTHDR = 57 const IPV6_RTHDRDSTOPTS = 55 const IPV6_RTHDR_LOOSE = 0 const IPV6_RTHDR_STRICT = 1 const IPV6_RTHDR_TYPE_0 = 0 const IPV6_RXDSTOPTS = 59 const IPV6_RXHOPOPTS = 54 const IPV6_TCLASS = 67 const IPV6_TRANSPARENT = 75 const IPV6_UNICAST_HOPS = 16 const IPV6_UNICAST_IF = 76 const IPV6_V6ONLY = 26 const IPV6_XFRM_POLICY = 35 const IP_ADD_MEMBERSHIP = 35 const IP_ADD_SOURCE_MEMBERSHIP = 39 const IP_BIND_ADDRESS_NO_PORT = 24 const IP_BLOCK_SOURCE = 38 const IP_CHECKSUM = 23 const IP_DEFAULT_MULTICAST_LOOP = 1 const IP_DEFAULT_MULTICAST_TTL = 1 const IP_DROP_MEMBERSHIP = 36 const IP_DROP_SOURCE_MEMBERSHIP = 40 const IP_FREEBIND = 15 const IP_HDRINCL = 3 const IP_IPSEC_POLICY = 16 const IP_MAX_MEMBERSHIPS = 20 const IP_MINTTL = 21 const IP_MSFILTER = 41 const IP_MTU = 14 const IP_MTU_DISCOVER = 10 const IP_MULTICAST_ALL = 49 const IP_MULTICAST_IF = 32 const IP_MULTICAST_LOOP = 34 const IP_MULTICAST_TTL = 33 const IP_NODEFRAG = 22 const IP_OPTIONS = 4 const IP_ORIGDSTADDR = 20 const IP_PASSSEC = 18 const IP_PKTINFO = 8 const IP_PKTOPTIONS = 9 const IP_PMTUDISC = 10 const IP_PMTUDISC_DO = 2 const IP_PMTUDISC_DONT = 0 const IP_PMTUDISC_INTERFACE = 4 const IP_PMTUDISC_OMIT = 5 const IP_PMTUDISC_PROBE = 3 const IP_PMTUDISC_WANT = 1 const IP_RECVERR = 11 const IP_RECVERR_RFC4884 = 26 const IP_RECVFRAGSIZE = 25 const IP_RECVOPTS = 6 const IP_RECVORIGDSTADDR = 20 const IP_RECVRETOPTS = 7 const IP_RECVTOS = 13 const IP_RECVTTL = 12 const IP_RETOPTS = 7 const IP_ROUTER_ALERT = 5 const IP_TOS = 1 const IP_TRANSPARENT = 19 const IP_TTL = 2 const IP_UNBLOCK_SOURCE = 37 const IP_UNICAST_IF = 50 const IP_XFRM_POLICY = 17 const ITIMER_PROF = 2 const ITIMER_REAL = 0 const ITIMER_VIRTUAL = 1 const LACON = 76 const LC_ALL = 6 const LC_ALL_MASK = 2147483647 const LC_COLLATE = 3 const LC_COLLATE_MASK = 8 const LC_CTYPE = 0 const LC_CTYPE_MASK = 1 const LC_GLOBAL_LOCALE = -1 const LC_MESSAGES = 5 const LC_MESSAGES_MASK = 32 const LC_MONETARY = 4 const LC_MONETARY_MASK = 16 const LC_NUMERIC = 1 const LC_NUMERIC_MASK = 2 const LC_TIME = 2 const LC_TIME_MASK = 4 const LDBL_DECIMAL_DIG = 17 const LDBL_DIG = 15 const LDBL_EPSILON = 0 const LDBL_HAS_SUBNORM = 1 const LDBL_MANT_DIG = 53 const LDBL_MAX = 0 const LDBL_MAX_10_EXP = 308 const LDBL_MAX_EXP = 1024 const LDBL_MIN = 0 const LDBL_MIN_10_EXP = -307 const LDBL_MIN_EXP = -1021 const LDBL_TRUE_MIN = 0 const LINE_MAX = 4096 const LISTSTORE_CANONICAL = 1 const LIST_SPAN_THRESHOLD = 101 const LITTLE_ENDIAN = 1234 const LLONG_MAX = 9223372036854775807 const LLONG_MIN = -9223372036854775808 const LOCK_EX = 2 const LOCK_NB = 4 const LOCK_SH = 1 const LOCK_UN = 8 const LOGIN_NAME_MAX = 256 const LONGER = 1 const LONG_BIT = 64 const LONG_MAX = 9223372036854775807 const LONG_MIN = -9223372036854775808 const L_BBND = 5 const L_BRACK = 6 const L_BRE = 2 const L_CCL = 9 const L_CEL = 7 const L_EBND = 4 const L_ECL = 8 const L_ERE = 1 const L_INCR = 1 const L_Q = 3 const L_SET = 0 const L_XTND = 2 const L_ctermid = 20 const L_cuserid = 20 const L_tmpnam = 20 const MAXHOSTNAMELEN = 64 const MAXNAMLEN = 255 const MAXPATHLEN = 4096 const MAXSYMLINKS = 20 const MAX_COLOR = 32767 const MAX_HANDLE_SZ = 128 const MAX_NESTING_DEPTH = 1000 const MB_CUR_MAX = 0 const MB_LEN_MAX = 4 const MCAST_BLOCK_SOURCE = 43 const MCAST_EXCLUDE = 0 const MCAST_INCLUDE = 1 const MCAST_JOIN_GROUP = 42 const MCAST_JOIN_SOURCE_GROUP = 46 const MCAST_LEAVE_GROUP = 45 const MCAST_LEAVE_SOURCE_GROUP = 47 const MCAST_MSFILTER = 48 const MCAST_UNBLOCK_SOURCE = 44 const MINSIGSTKSZ = 4096 const MIXED = 4 const MP_FIXED_CUTOFFS = 1 const MP_PREC = 4 const MQ_PRIO_MAX = 32768 const MSG_BATCH = 262144 const MSG_CMSG_CLOEXEC = 1073741824 const MSG_CONFIRM = 2048 const MSG_CTRUNC = 8 const MSG_DONTROUTE = 4 const MSG_DONTWAIT = 64 const MSG_EOR = 128 const MSG_ERRQUEUE = 8192 const MSG_FASTOPEN = 536870912 const MSG_FIN = 512 const MSG_MORE = 32768 const MSG_NOSIGNAL = 16384 const MSG_OOB = 1 const MSG_PEEK = 2 const MSG_PROXY = 16 const MSG_RST = 4096 const MSG_SYN = 1024 const MSG_TRUNC = 32 const MSG_WAITALL = 256 const MSG_WAITFORONE = 65536 const MSG_ZEROCOPY = 67108864 const NAME_MAX = 255 const NBBY = 8 const NBYTS = 4 const NCARGS = 131072 const NDEBUG = 1 const NGROUPS = 32 const NGROUPS_MAX = 32 const NI_DGRAM = 16 const NI_MAXHOST = 255 const NI_MAXSERV = 32 const NI_NAMEREQD = 8 const NI_NOFQDN = 4 const NI_NUMERICHOST = 1 const NI_NUMERICSCOPE = 256 const NI_NUMERICSERV = 2 const NL_ARGMAX = 9 const NL_LANGMAX = 32 const NL_MSGMAX = 32767 const NL_NMAX = 16 const NL_SETMAX = 255 const NL_TEXTMAX = 2048 const NOCELT = -1 const NOFILE = 256 const NOGROUP = -1 const NOPROP = 3 const NOSUB = -1 const NOTREACHED = 0 const NO_ADDRESS = 4 const NO_DATA = 4 const NO_RECOVERY = 3 const NO_UNION_WAIT = 1 const NRE_ENABLE_ASSERTS = 0 const NRE_USE_SMALL_ALLOC = 1 const NSIG = 65 const NS_DEAD = 2 const NS_DYING = 1 const NS_KILLED = 4 const NS_SUPPRESS_COMPILATION = 8 const NS_TEARDOWN = 4 const NUM_STATIC_TOKENS = 20 const NWBDRY = 87 const NZERO = 20 const O_ACCMODE = 2097155 const O_APPEND = 1024 const O_ASYNC = 8192 const O_CLOEXEC = 524288 const O_CREAT = 64 const O_DIRECT = 16384 const O_DIRECTORY = 65536 const O_DSYNC = 4096 const O_EXCL = 128 const O_EXEC = 2097152 const O_LARGEFILE = 32768 const O_NDELAY = 2048 const O_NOATIME = 262144 const O_NOCTTY = 256 const O_NOFOLLOW = 131072 const O_NONBLOCK = 2048 const O_PATH = 2097152 const O_RDONLY = 0 const O_RDWR = 2 const O_RSYNC = 1052672 const O_SEARCH = 2097152 const O_SYNC = 1052672 const O_TMPFILE = 4259840 const O_TRUNC = 512 const O_TTY_INIT = 0 const O_WRONLY = 1 const PACKAGE_BUGREPORT = "" const PACKAGE_NAME = "tcl" const PACKAGE_STRING = "tcl 9.0" const PACKAGE_TARNAME = "tcl" const PACKAGE_URL = "" const PACKAGE_VERSION = "9.0" const PAGESIZE = 4096 const PAGE_SIZE = 4096 const PATH_MAX = 4096 const PDP_ENDIAN = 3412 const PF_ALG = 38 const PF_APPLETALK = 5 const PF_ASH = 18 const PF_ATMPVC = 8 const PF_ATMSVC = 20 const PF_AX25 = 3 const PF_BLUETOOTH = 31 const PF_BRIDGE = 7 const PF_CAIF = 37 const PF_CAN = 29 const PF_DECnet = 12 const PF_ECONET = 19 const PF_FILE = 1 const PF_IB = 27 const PF_IEEE802154 = 36 const PF_INET = 2 const PF_INET6 = 10 const PF_IPX = 4 const PF_IRDA = 23 const PF_ISDN = 34 const PF_IUCV = 32 const PF_KCM = 41 const PF_KEY = 15 const PF_LLC = 26 const PF_LOCAL = 1 const PF_MAX = 45 const PF_MPLS = 28 const PF_NETBEUI = 13 const PF_NETLINK = 16 const PF_NETROM = 6 const PF_NFC = 39 const PF_PACKET = 17 const PF_PHONET = 35 const PF_PPPOX = 24 const PF_QIPCRTR = 42 const PF_RDS = 21 const PF_ROSE = 11 const PF_ROUTE = 16 const PF_RXRPC = 33 const PF_SECURITY = 14 const PF_SMC = 43 const PF_SNA = 22 const PF_TIPC = 30 const PF_UNIX = 1 const PF_UNSPEC = 0 const PF_VSOCK = 40 const PF_WANPIPE = 25 const PF_X25 = 9 const PF_XDP = 44 const PIPE_BUF = 4096 const PLAIN = 112 const POLL_ERR = 4 const POLL_HUP = 6 const POLL_IN = 1 const POLL_MSG = 3 const POLL_OUT = 2 const POLL_PRI = 5 const POSIX_CLOSE_RESTART = 0 const POSIX_FADV_DONTNEED = 6 const POSIX_FADV_NOREUSE = 7 const POSIX_FADV_NORMAL = 0 const POSIX_FADV_RANDOM = 1 const POSIX_FADV_SEQUENTIAL = 2 const POSIX_FADV_WILLNEED = 3 const PREFER = 80 const PRIO_MAX = 20 const PRIO_MIN = -20 const PRIO_PGRP = 1 const PRIO_PROCESS = 0 const PRIO_USER = 2 const PRIX16 = "X" const PRIX32 = "X" const PRIX8 = "X" const PRIXFAST16 = "X" const PRIXFAST32 = "X" const PRIXFAST8 = "X" const PRIXLEAST16 = "X" const PRIXLEAST32 = "X" const PRIXLEAST8 = "X" const PRId16 = "d" const PRId32 = "d" const PRId8 = "d" const PRIdFAST16 = "d" const PRIdFAST32 = "d" const PRIdFAST8 = "d" const PRIdLEAST16 = "d" const PRIdLEAST32 = "d" const PRIdLEAST8 = "d" const PRIi16 = "i" const PRIi32 = "i" const PRIi8 = "i" const PRIiFAST16 = "i" const PRIiFAST32 = "i" const PRIiFAST8 = "i" const PRIiLEAST16 = "i" const PRIiLEAST32 = "i" const PRIiLEAST8 = "i" const PRIo16 = "o" const PRIo32 = "o" const PRIo8 = "o" const PRIoFAST16 = "o" const PRIoFAST32 = "o" const PRIoFAST8 = "o" const PRIoLEAST16 = "o" const PRIoLEAST32 = "o" const PRIoLEAST8 = "o" const PRIu16 = "u" const PRIu32 = "u" const PRIu8 = "u" const PRIuFAST16 = "u" const PRIuFAST32 = "u" const PRIuFAST8 = "u" const PRIuLEAST16 = "u" const PRIuLEAST32 = "u" const PRIuLEAST8 = "u" const PRIx16 = "x" const PRIx32 = "x" const PRIx8 = "x" const PRIxFAST16 = "x" const PRIxFAST32 = "x" const PRIxFAST8 = "x" const PRIxLEAST16 = "x" const PRIxLEAST32 = "x" const PRIxLEAST8 = "x" const PSEUDO = 2 const PTHREAD_BARRIER_SERIAL_THREAD = -1 const PTHREAD_CANCELED = -1 const PTHREAD_CANCEL_ASYNCHRONOUS = 1 const PTHREAD_CANCEL_DEFERRED = 0 const PTHREAD_CANCEL_DISABLE = 1 const PTHREAD_CANCEL_ENABLE = 0 const PTHREAD_CANCEL_MASKED = 2 const PTHREAD_CREATE_DETACHED = 1 const PTHREAD_CREATE_JOINABLE = 0 const PTHREAD_DESTRUCTOR_ITERATIONS = 4 const PTHREAD_EXPLICIT_SCHED = 1 const PTHREAD_INHERIT_SCHED = 0 const PTHREAD_KEYS_MAX = 128 const PTHREAD_MUTEX_DEFAULT = 0 const PTHREAD_MUTEX_ERRORCHECK = 2 const PTHREAD_MUTEX_NORMAL = 0 const PTHREAD_MUTEX_RECURSIVE = 1 const PTHREAD_MUTEX_ROBUST = 1 const PTHREAD_MUTEX_STALLED = 0 const PTHREAD_ONCE_INIT = 0 const PTHREAD_PRIO_INHERIT = 1 const PTHREAD_PRIO_NONE = 0 const PTHREAD_PRIO_PROTECT = 2 const PTHREAD_PROCESS_PRIVATE = 0 const PTHREAD_PROCESS_SHARED = 1 const PTHREAD_SCOPE_PROCESS = 1 const PTHREAD_SCOPE_SYSTEM = 0 const PTHREAD_STACK_MIN = 2048 const PTRDIFF_MAX = 9223372036854775807 const PTRDIFF_MIN = -9223372036854775808 const P_tmpdir = "/tmp" const RAND_MAX = 2147483647 const RAND_SEED_INITIALIZED = 64 const RANGE = 82 const REG_ADVANCED = 3 const REG_ADVF = 2 const REG_ASSERT = 15 const REG_ATOI = 101 const REG_BADBR = 10 const REG_BADOPT = 18 const REG_BADPAT = 2 const REG_BADRPT = 13 const REG_BASIC = 0 const REG_BOSONLY = 1024 const REG_CANCEL = 777 const REG_DUMP = 2048 const REG_EBRACE = 9 const REG_EBRACK = 7 const REG_ECOLLATE = 3 const REG_ECOLORS = 20 const REG_ECTYPE = 4 const REG_EESCAPE = 5 const REG_EPAREN = 8 const REG_ERANGE = 11 const REG_ESPACE = 12 const REG_ESUBREG = 6 const REG_ETOOBIG = 19 const REG_EXPANDED = 32 const REG_EXPECT = 512 const REG_EXTENDED = 1 const REG_FAKE = 4096 const REG_FTRACE = 8 const REG_ICASE = 8 const REG_INVARG = 16 const REG_ITOA = 102 const REG_MAX_COMPILE_SPACE = 0 const REG_MIXED = 17 const REG_MTRACE = 16 const REG_NEWLINE = 192 const REG_NLANCH = 128 const REG_NLSTOP = 64 const REG_NOMATCH = 1 const REG_NOSPEC = 4 const REG_NOSUB = 16 const REG_NOTBOL = 1 const REG_NOTEOL = 2 const REG_OKAY = 0 const REG_PEND = 256 const REG_PROGRESS = 8192 const REG_QUOTE = 4 const REG_SMALL = 32 const REG_STARTEND = 4 const REG_UBACKREF = 1 const REG_UBBS = 64 const REG_UBOUNDS = 4 const REG_UBRACES = 8 const REG_UBSALNUM = 16 const REG_UEMPTYMATCH = 2048 const REG_UIMPOSSIBLE = 4096 const REG_ULOCALE = 1024 const REG_ULOOKAHEAD = 2 const REG_UNONPOSIX = 128 const REG_UPBOTCH = 32 const REG_USHORTEST = 8192 const REG_UUNPORT = 512 const REG_UUNSPEC = 256 const REMAGIC = 65239 const RE_DUP_MAX = 255 const RLIM64_INFINITY = 18446744073709551615 const RLIM64_SAVED_CUR = 18446744073709551615 const RLIM64_SAVED_MAX = 18446744073709551615 const RLIMIT_AS = 9 const RLIMIT_CORE = 4 const RLIMIT_CPU = 0 const RLIMIT_DATA = 2 const RLIMIT_FSIZE = 1 const RLIMIT_LOCKS = 10 const RLIMIT_MEMLOCK = 8 const RLIMIT_MSGQUEUE = 12 const RLIMIT_NICE = 13 const RLIMIT_NLIMITS = 16 const RLIMIT_NOFILE = 7 const RLIMIT_NPROC = 6 const RLIMIT_RSS = 5 const RLIMIT_RTPRIO = 14 const RLIMIT_RTTIME = 15 const RLIMIT_SIGPENDING = 11 const RLIMIT_STACK = 3 const RLIM_INFINITY = 18446744073709551615 const RLIM_NLIMITS = 16 const RLIM_SAVED_CUR = 18446744073709551615 const RLIM_SAVED_MAX = 18446744073709551615 const RUSAGE_CHILDREN = -1 const RUSAGE_SELF = 0 const RUSAGE_THREAD = 1 const RWF_WRITE_LIFE_NOT_SET = 0 const RWH_WRITE_LIFE_EXTREME = 5 const RWH_WRITE_LIFE_LONG = 4 const RWH_WRITE_LIFE_MEDIUM = 3 const RWH_WRITE_LIFE_NONE = 1 const RWH_WRITE_LIFE_SHORT = 2 const R_OK = 4 const SAFE_INTERP = 128 const SATISFIED = 2 const SA_EXPOSE_TAGBITS = 2048 const SA_NOCLDSTOP = 1 const SA_NOCLDWAIT = 2 const SA_NODEFER = 1073741824 const SA_NOMASK = 1073741824 const SA_ONESHOT = 2147483648 const SA_ONSTACK = 134217728 const SA_RESETHAND = 2147483648 const SA_RESTART = 268435456 const SA_RESTORER = 67108864 const SA_SIGINFO = 4 const SA_UNSUPPORTED = 1024 const SBEGIN = 65 const SCHAR_MAX = 127 const SCHAR_MIN = -128 const SCHED_BATCH = 3 const SCHED_DEADLINE = 6 const SCHED_FIFO = 1 const SCHED_IDLE = 5 const SCHED_OTHER = 0 const SCHED_RESET_ON_FORK = 1073741824 const SCHED_RR = 2 const SCM_CREDENTIALS = 2 const SCM_RIGHTS = 1 const SCM_TIMESTAMP = 29 const SCM_TIMESTAMPING = 37 const SCM_TIMESTAMPING_OPT_STATS = 54 const SCM_TIMESTAMPING_PKTINFO = 58 const SCM_TIMESTAMPNS = 35 const SCM_TXTIME = 61 const SCM_WIFI_STATUS = 41 const SCNd16 = "hd" const SCNd32 = "d" const SCNd8 = "hhd" const SCNdFAST16 = "d" const SCNdFAST32 = "d" const SCNdFAST8 = "hhd" const SCNdLEAST16 = "hd" const SCNdLEAST32 = "d" const SCNdLEAST8 = "hhd" const SCNi16 = "hi" const SCNi32 = "i" const SCNi8 = "hhi" const SCNiFAST16 = "i" const SCNiFAST32 = "i" const SCNiFAST8 = "hhi" const SCNiLEAST16 = "hi" const SCNiLEAST32 = "i" const SCNiLEAST8 = "hhi" const SCNo16 = "ho" const SCNo32 = "o" const SCNo8 = "hho" const SCNoFAST16 = "o" const SCNoFAST32 = "o" const SCNoFAST8 = "hho" const SCNoLEAST16 = "ho" const SCNoLEAST32 = "o" const SCNoLEAST8 = "hho" const SCNu16 = "hu" const SCNu32 = "u" const SCNu8 = "hhu" const SCNuFAST16 = "u" const SCNuFAST32 = "u" const SCNuFAST8 = "hhu" const SCNuLEAST16 = "hu" const SCNuLEAST32 = "u" const SCNuLEAST8 = "hhu" const SCNx16 = "hx" const SCNx32 = "x" const SCNx8 = "hhx" const SCNxFAST16 = "x" const SCNxFAST32 = "x" const SCNxFAST8 = "hhx" const SCNxLEAST16 = "hx" const SCNxLEAST32 = "x" const SCNxLEAST8 = "hhx" const SEEK_DATA = 3 const SEEK_HOLE = 4 const SEGV_ACCERR = 2 const SEGV_BNDERR = 3 const SEGV_MAPERR = 1 const SEGV_MTEAERR = 8 const SEGV_MTESERR = 9 const SEGV_PKUERR = 4 const SELECT_MASK = 0 const SEM_NSEMS_MAX = 256 const SEM_VALUE_MAX = 2147483647 const SEND = 90 const SHORTER = 2 const SHRT_MAX = 32767 const SHRT_MIN = -32768 const SHUT_RD = 0 const SHUT_RDWR = 2 const SHUT_WR = 1 const SIGABRT = 6 const SIGALRM = 14 const SIGBUS = 7 const SIGCHLD = 17 const SIGCONT = 18 const SIGEV_NONE = 1 const SIGEV_SIGNAL = 0 const SIGEV_THREAD = 2 const SIGEV_THREAD_ID = 4 const SIGFPE = 8 const SIGHUP = 1 const SIGILL = 4 const SIGINT = 2 const SIGIO = 29 const SIGIOT = 6 const SIGKILL = 9 const SIGPIPE = 13 const SIGPOLL = 29 const SIGPROF = 27 const SIGPWR = 30 const SIGQUIT = 3 const SIGRTMAX = 0 const SIGRTMIN = 0 const SIGSEGV = 11 const SIGSTKFLT = 16 const SIGSTKSZ = 10240 const SIGSTOP = 19 const SIGSYS = 31 const SIGTERM = 15 const SIGTRAP = 5 const SIGTSTP = 20 const SIGTTIN = 21 const SIGTTOU = 22 const SIGUNUSED = 31 const SIGURG = 23 const SIGUSR1 = 10 const SIGUSR2 = 12 const SIGVTALRM = 26 const SIGWINCH = 28 const SIGXCPU = 24 const SIGXFSZ = 25 const SIG_ATOMIC_MAX = 2147483647 const SIG_ATOMIC_MIN = -2147483648 const SIG_BLOCK = 0 const SIG_SETMASK = 2 const SIG_UNBLOCK = 1 const SIZE_MAX = 18446744073709551615 const SI_ASYNCIO = -4 const SI_ASYNCNL = -60 const SI_KERNEL = 128 const SI_MESGQ = -3 const SI_QUEUE = -1 const SI_SIGIO = -5 const SI_TIMER = -2 const SI_TKILL = -6 const SI_USER = 0 const SOCK_CLOEXEC = 524288 const SOCK_DCCP = 6 const SOCK_DGRAM = 2 const SOCK_NONBLOCK = 2048 const SOCK_PACKET = 10 const SOCK_RAW = 3 const SOCK_RDM = 4 const SOCK_SEQPACKET = 5 const SOCK_STREAM = 1 const SOL_AAL = 265 const SOL_ALG = 279 const SOL_ATM = 264 const SOL_BLUETOOTH = 274 const SOL_CAIF = 278 const SOL_DCCP = 269 const SOL_DECNET = 261 const SOL_ICMPV6 = 58 const SOL_IP = 0 const SOL_IPV6 = 41 const SOL_IRDA = 266 const SOL_IUCV = 277 const SOL_KCM = 281 const SOL_LLC = 268 const SOL_NETBEUI = 267 const SOL_NETLINK = 270 const SOL_NFC = 280 const SOL_PACKET = 263 const SOL_PNPIPE = 275 const SOL_PPPOL2TP = 273 const SOL_RAW = 255 const SOL_RDS = 276 const SOL_RXRPC = 272 const SOL_SOCKET = 1 const SOL_TIPC = 271 const SOL_TLS = 282 const SOL_X25 = 262 const SOL_XDP = 283 const SOMAXCONN = 128 const SOME = 2 const SO_ACCEPTCONN = 30 const SO_ATTACH_BPF = 50 const SO_ATTACH_FILTER = 26 const SO_ATTACH_REUSEPORT_CBPF = 51 const SO_ATTACH_REUSEPORT_EBPF = 52 const SO_BINDTODEVICE = 25 const SO_BINDTOIFINDEX = 62 const SO_BPF_EXTENSIONS = 48 const SO_BROADCAST = 6 const SO_BSDCOMPAT = 14 const SO_BUSY_POLL = 46 const SO_BUSY_POLL_BUDGET = 70 const SO_CNX_ADVICE = 53 const SO_COOKIE = 57 const SO_DEBUG = 1 const SO_DETACH_BPF = 27 const SO_DETACH_FILTER = 27 const SO_DETACH_REUSEPORT_BPF = 68 const SO_DOMAIN = 39 const SO_DONTROUTE = 5 const SO_ERROR = 4 const SO_GET_FILTER = 26 const SO_INCOMING_CPU = 49 const SO_INCOMING_NAPI_ID = 56 const SO_KEEPALIVE = 9 const SO_LINGER = 13 const SO_LOCK_FILTER = 44 const SO_MARK = 36 const SO_MAX_PACING_RATE = 47 const SO_MEMINFO = 55 const SO_NOFCS = 43 const SO_NO_CHECK = 11 const SO_OOBINLINE = 10 const SO_PASSCRED = 16 const SO_PASSSEC = 34 const SO_PEEK_OFF = 42 const SO_PEERCRED = 17 const SO_PEERGROUPS = 59 const SO_PEERNAME = 28 const SO_PEERSEC = 31 const SO_PREFER_BUSY_POLL = 69 const SO_PRIORITY = 12 const SO_PROTOCOL = 38 const SO_RCVBUF = 8 const SO_RCVBUFFORCE = 33 const SO_RCVLOWAT = 18 const SO_RCVTIMEO = 20 const SO_REUSEADDR = 2 const SO_REUSEPORT = 15 const SO_RXQ_OVFL = 40 const SO_SECURITY_AUTHENTICATION = 22 const SO_SECURITY_ENCRYPTION_NETWORK = 24 const SO_SECURITY_ENCRYPTION_TRANSPORT = 23 const SO_SELECT_ERR_QUEUE = 45 const SO_SNDBUF = 7 const SO_SNDBUFFORCE = 32 const SO_SNDLOWAT = 19 const SO_SNDTIMEO = 21 const SO_TIMESTAMP = 29 const SO_TIMESTAMPING = 37 const SO_TIMESTAMPNS = 35 const SO_TXTIME = 61 const SO_TYPE = 3 const SO_WIFI_STATUS = 41 const SO_ZEROCOPY = 60 const SPLICE_F_GIFT = 8 const SPLICE_F_MORE = 4 const SPLICE_F_MOVE = 1 const SPLICE_F_NONBLOCK = 2 const SSIZE_MAX = 9223372036854775807 const SS_AUTODISARM = 2147483648 const SS_DISABLE = 2 const SS_FLAG_BITS = 2147483648 const SS_ONSTACK = 1 const STATIC_BUILD = 1 const STATX_ALL = 4095 const STATX_ATIME = 32 const STATX_BASIC_STATS = 2047 const STATX_BLOCKS = 1024 const STATX_BTIME = 2048 const STATX_CTIME = 128 const STATX_GID = 16 const STATX_INO = 256 const STATX_MODE = 2 const STATX_MTIME = 64 const STATX_NLINK = 4 const STATX_SIZE = 512 const STATX_TYPE = 1 const STATX_UID = 8 const STDC_HEADERS = 1 const STDERR_FILENO = 2 const STDIN_FILENO = 0 const STDOUT_FILENO = 1 const SYMLOOP_MAX = 40 const SYNC_FILE_RANGE_WAIT_AFTER = 4 const SYNC_FILE_RANGE_WAIT_BEFORE = 1 const SYNC_FILE_RANGE_WRITE = 2 const SYS_SECCOMP = 1 const SYS_USER_DISPATCH = 2 const S_IEXEC = 64 const S_IFBLK = 24576 const S_IFCHR = 8192 const S_IFDIR = 16384 const S_IFIFO = 4096 const S_IFLNK = 40960 const S_IFMT = 61440 const S_IFREG = 32768 const S_IFSOCK = 49152 const S_IREAD = 256 const S_IRGRP = 32 const S_IROTH = 4 const S_IRUSR = 256 const S_IRWXG = 56 const S_IRWXO = 7 const S_IRWXU = 448 const S_ISGID = 1024 const S_ISUID = 2048 const S_ISVTX = 512 const S_IWGRP = 16 const S_IWOTH = 2 const S_IWRITE = 128 const S_IWUSR = 128 const S_IXGRP = 8 const S_IXOTH = 1 const S_IXUSR = 64 const TCLFSENCODING = "NULL" const TCL_ALLOCALIGN = 0 const TCL_ALLOW_EXCEPTIONS = 4 const TCL_ALLOW_INLINE_COMPILATION = 131072 const TCL_ALL_EVENTS = -3 const TCL_ALPHA_RELEASE = 0 const TCL_APPEND_VALUE = 4 const TCL_ARGV_CONSTANT = 15 const TCL_ARGV_END = 23 const TCL_ARGV_FLOAT = 19 const TCL_ARGV_FUNC = 20 const TCL_ARGV_GENFUNC = 21 const TCL_ARGV_HELP = 22 const TCL_ARGV_INT = 16 const TCL_ARGV_REST = 18 const TCL_ARGV_STRING = 17 const TCL_AUTO_LENGTH = -1 const TCL_AVOID_RESOLVERS = 262144 const TCL_BETA_RELEASE = 1 const TCL_BREAK = 3 const TCL_CANCEL_UNWIND = 1048576 const TCL_CFGVAL_ENCODING = "utf-8" const TCL_CFG_DO64BIT = 1 const TCL_CFG_OPTIMIZED = 1 const TCL_CHANNEL_THREAD_INSERT = 0 const TCL_CHANNEL_THREAD_REMOVE = 1 const TCL_CLOSE2PROC = "NULL" const TCL_CLOSE_READ = 2 const TCL_CLOSE_WRITE = 4 const TCL_CODE_USER_MAX = 1073741823 const TCL_CODE_USER_MIN = 5 const TCL_COMBINE = 16777216 const TCL_CONTINUE = 4 const TCL_CONVERT_MULTIBYTE = -1 const TCL_CONVERT_NOSPACE = -4 const TCL_CONVERT_SYNTAX = -2 const TCL_CONVERT_UNKNOWN = -3 const TCL_CREATE_HARD_LINK = 2 const TCL_CREATE_NS_IF_UNKNOWN = 2048 const TCL_CREATE_SYMBOLIC_LINK = 1 const TCL_CUSTOM_PTR_KEYS = -1 const TCL_CUSTOM_TYPE_KEYS = -2 const TCL_DD_CONVERSION_TYPE_MASK = 3 const TCL_DD_E_FORMAT = 2 const TCL_DD_F_FORMAT = 3 const TCL_DD_NO_QUICK = 8 const TCL_DD_SHORTEST = 4 const TCL_DONT_QUOTE_HASH = 8 const TCL_DONT_USE_BRACES = 1 const TCL_DONT_WAIT = 2 const TCL_DOUBLE_SPACE = 27 const TCL_DSTRING_STATIC_SIZE = 200 const TCL_EACH_COLLECT = 1 const TCL_EACH_KEEP_NONE = 0 const TCL_ENCODING_CHAR_LIMIT = 16 const TCL_ENCODING_END = 2 const TCL_ENCODING_INTERNAL_USE_MASK = 65280 const TCL_ENCODING_NO_TERMINATE = 8 const TCL_ENCODING_PROFILE_REPLACE = 33554432 const TCL_ENCODING_PROFILE_STRICT = 0 const TCL_ENCODING_PROFILE_TCL8 = 16777216 const TCL_ENCODING_START = 1 const TCL_ENCODING_STOPONERROR = 0 const TCL_ENFORCE_MODE = 16 const TCL_ENSEMBLE_PREFIX = 2 const TCL_ERROR = 1 const TCL_EVAL_DIRECT = 262144 const TCL_EVAL_DISCARD_RESULT = 64 const TCL_EVAL_FILE = 2 const TCL_EVAL_GLOBAL = 131072 const TCL_EVAL_INVOKE = 524288 const TCL_EVAL_NOERR = 2097152 const TCL_EVAL_NORESOLVE = 32 const TCL_EVAL_SOURCE_IN_FRAME = 16 const TCL_EXACT = 1 const TCL_EXCEPTION = 8 const TCL_FILE_EVENTS = 8 const TCL_FINAL_RELEASE = 2 const TCL_FIND_IF_NOT_SIMPLE = 8192 const TCL_FIND_ONLY_NS = 4096 const TCL_GLOBAL_ONLY = 1 const TCL_GLOB_PERM_HIDDEN = 2 const TCL_GLOB_PERM_R = 4 const TCL_GLOB_PERM_RONLY = 1 const TCL_GLOB_PERM_W = 8 const TCL_GLOB_PERM_X = 16 const TCL_GLOB_TYPE_BLOCK = 1 const TCL_GLOB_TYPE_CHAR = 2 const TCL_GLOB_TYPE_DIR = 4 const TCL_GLOB_TYPE_FILE = 16 const TCL_GLOB_TYPE_LINK = 32 const TCL_GLOB_TYPE_MOUNT = 128 const TCL_GLOB_TYPE_PIPE = 8 const TCL_GLOB_TYPE_SOCK = 64 const TCL_HASH_KEY_DIRECT_COMPARE = 4 const TCL_HASH_KEY_RANDOMIZE_HASH = 1 const TCL_HASH_KEY_SYSTEM_HASH = 2 const TCL_HASH_KEY_TYPE_VERSION = 1 const TCL_HASH_TYPE = 0 const TCL_IDLE_EVENTS = 32 const TCL_INDEX_END = -2 const TCL_INDEX_NONE = -1 const TCL_INDEX_TEMP_TABLE = 64 const TCL_INVOKE_HIDDEN = 1 const TCL_INVOKE_NO_TRACEBACK = 4 const TCL_INVOKE_NO_UNKNOWN = 2 const TCL_IO_FAILURE = -1 const TCL_LEAVE_ERR_MSG = 512 const TCL_LIMIT_COMMANDS = 1 const TCL_LIMIT_TIME = 2 const TCL_LINK_BINARY = 16 const TCL_LINK_BOOLEAN = 3 const TCL_LINK_CHAR = 6 const TCL_LINK_CHARS = 15 const TCL_LINK_DOUBLE = 2 const TCL_LINK_FLOAT = 13 const TCL_LINK_INT = 1 const TCL_LINK_LONG = 1 const TCL_LINK_READ_ONLY = 128 const TCL_LINK_SHORT = 8 const TCL_LINK_STRING = 4 const TCL_LINK_UCHAR = 7 const TCL_LINK_UINT = 10 const TCL_LINK_ULONG = 10 const TCL_LINK_USHORT = 9 const TCL_LINK_WIDE_INT = 5 const TCL_LINK_WIDE_UINT = 14 const TCL_LIST_ELEMENT = 8 const TCL_LL_MODIFIER = "ll" const TCL_LOAD_GLOBAL = 1 const TCL_LOAD_LAZY = 2 const TCL_LOCATION_BC = 2 const TCL_LOCATION_EVAL = 0 const TCL_LOCATION_LAST = 6 const TCL_LOCATION_PREBC = 3 const TCL_LOCATION_PROC = 5 const TCL_LOCATION_SOURCE = 4 const TCL_MAJOR_VERSION = 9 const TCL_MATCH_NOCASE = 1 const TCL_MAX_PREC = 17 const TCL_MINOR_VERSION = 0 const TCL_MIN_GROWTH = 1024 const TCL_MIN_TOKEN_GROWTH = 1024 const TCL_MODE_BLOCKING = 0 const TCL_MODE_NONBLOCKING = 1 const TCL_NAMESPACE_ONLY = 2 const TCL_NO_EVAL = 65536 const TCL_NULL_OK = 32 const TCL_NUMBER_BIG = 3 const TCL_NUMBER_DOUBLE = 4 const TCL_NUMBER_INT = 2 const TCL_NUMBER_NAN = 5 const TCL_OBJTYPE_V0 = 0 const TCL_OK = 0 const TCL_ONE_WORD_KEYS = 1 const TCL_PARSE_BAD_NUMBER = 9 const TCL_PARSE_BINARY_ONLY = 64 const TCL_PARSE_BRACE_EXTRA = 2 const TCL_PARSE_DECIMAL_ONLY = 1 const TCL_PARSE_HEXADECIMAL_ONLY = 4 const TCL_PARSE_INTEGER_ONLY = 8 const TCL_PARSE_MISSING_BRACE = 3 const TCL_PARSE_MISSING_BRACKET = 4 const TCL_PARSE_MISSING_PAREN = 5 const TCL_PARSE_MISSING_QUOTE = 6 const TCL_PARSE_MISSING_VAR_BRACE = 7 const TCL_PARSE_NO_UNDERSCORE = 128 const TCL_PARSE_NO_WHITESPACE = 32 const TCL_PARSE_OCTAL_ONLY = 2 const TCL_PARSE_QUOTE_EXTRA = 1 const TCL_PARSE_SCAN_PREFIXES = 16 const TCL_PARSE_SUCCESS = 0 const TCL_PARSE_SYNTAX = 8 const TCL_PATCH_LEVEL = "9.0.1" const TCL_PLATFORM_TRANSLATION = 0 const TCL_READABLE = 2 const TCL_REG_ADVANCED = 3 const TCL_REG_ADVF = 2 const TCL_REG_BASIC = 0 const TCL_REG_BOSONLY = 1024 const TCL_REG_CANMATCH = 512 const TCL_REG_EXPANDED = 32 const TCL_REG_EXTENDED = 1 const TCL_REG_NEWLINE = 192 const TCL_REG_NLANCH = 128 const TCL_REG_NLSTOP = 64 const TCL_REG_NOCASE = 8 const TCL_REG_NOSUB = 16 const TCL_REG_NOTBOL = 1 const TCL_REG_NOTEOL = 2 const TCL_REG_QUOTE = 4 const TCL_RELEASE_LEVEL = 2 const TCL_RELEASE_SERIAL = 1 const TCL_RETURN = 2 const TCL_SERVICE_ALL = 1 const TCL_SERVICE_NONE = 0 const TCL_SHLIB_EXT = "" const TCL_SIZE_MODIFIER = "TCL_T_MODIFIER" const TCL_SMALL_HASH_TABLE = 4 const TCL_STDERR = 8 const TCL_STDIN = 2 const TCL_STDOUT = 4 const TCL_STRING_IN_PLACE = 2 const TCL_STRING_KEYS = 0 const TCL_STRING_MATCH_NOCASE = 1 const TCL_SUBST_ALL = 7 const TCL_SUBST_BACKSLASHES = 4 const TCL_SUBST_COMMANDS = 1 const TCL_SUBST_VARIABLES = 2 const TCL_TCPSERVER_REUSEADDR = 1 const TCL_TCPSERVER_REUSEPORT = 2 const TCL_THREADS = 1 const TCL_THREAD_JOINABLE = 1 const TCL_THREAD_NOFLAGS = 0 const TCL_THREAD_STACK_DEFAULT = 0 const TCL_TIMER_EVENTS = 16 const TCL_TOKEN_BS = 8 const TCL_TOKEN_COMMAND = 16 const TCL_TOKEN_EXPAND_WORD = 256 const TCL_TOKEN_OPERATOR = 128 const TCL_TOKEN_SIMPLE_WORD = 2 const TCL_TOKEN_SUB_EXPR = 64 const TCL_TOKEN_TEXT = 4 const TCL_TOKEN_VARIABLE = 32 const TCL_TOKEN_WORD = 1 const TCL_TRACE_ARRAY = 2048 const TCL_TRACE_DELETE = 16384 const TCL_TRACE_DESTROYED = 128 const TCL_TRACE_ENTER_EXEC = 1 const TCL_TRACE_LEAVE_EXEC = 2 const TCL_TRACE_READS = 16 const TCL_TRACE_RENAME = 8192 const TCL_TRACE_RESULT_DYNAMIC = 32768 const TCL_TRACE_RESULT_OBJECT = 65536 const TCL_TRACE_UNSETS = 64 const TCL_TRACE_WRITES = 32 const TCL_T_MODIFIER = "t" const TCL_UNLOAD_DETACH_FROM_INTERPRETER = 1 const TCL_UNLOAD_DETACH_FROM_PROCESS = 2 const TCL_UTF_MAX = 4 const TCL_VERSION = "9.0" const TCL_WIDE_INT_IS_LONG = 1 const TCL_WINDOW_EVENTS = 4 const TCL_WRITABLE = 4 const TCL_ZLIB_COMPRESS_BEST = 9 const TCL_ZLIB_COMPRESS_DEFAULT = -1 const TCL_ZLIB_COMPRESS_FAST = 1 const TCL_ZLIB_COMPRESS_NONE = 0 const TCL_ZLIB_FINALIZE = 4 const TCL_ZLIB_FLUSH = 2 const TCL_ZLIB_FORMAT_AUTO = 8 const TCL_ZLIB_FORMAT_GZIP = 4 const TCL_ZLIB_FORMAT_RAW = 1 const TCL_ZLIB_FORMAT_ZLIB = 2 const TCL_ZLIB_FULLFLUSH = 3 const TCL_ZLIB_NO_FLUSH = 0 const TCL_ZLIB_STREAM_DEFLATE = 16 const TCL_ZLIB_STREAM_INFLATE = 32 const TCL_Z_MODIFIER = "z" const TIMER_ABSTIME = 1 const TIME_UTC = 1 const TMP_MAX = 10000 const TRAP_BRANCH = 3 const TRAP_BRKPT = 1 const TRAP_HWBKPT = 4 const TRAP_TRACE = 2 const TRAP_UNK = 5 const TRY_AGAIN = 2 const TTY_NAME_MAX = 32 const TZNAME_MAX = 6 const TclOSclosedir = 0 const TclOSopen = 0 const TclOSopendir = 0 const TclOSreaddir = 0 const TclOSrewinddir = 0 const TclOSseek = 0 const TclObjInterpProc = 0 const TclObjInterpProc2 = 0 const Tcl_AttemptAlloc = 0 const Tcl_AttemptRealloc = 0 const Tcl_CreateSlave = 0 const Tcl_EncodingFreeProc = 0 const Tcl_ExitProc = 0 const Tcl_FSFreeInternalRepProc = 0 const Tcl_FileFreeProc = 0 const Tcl_Free = 0 const Tcl_GetMaster = 0 const Tcl_GetSlave = 0 const Tcl_LimitHandlerDeleteProc = 0 const Tcl_PackageInitProc = 0 const Tcl_PackageUnloadProc = 0 const Tcl_StaticPackage = 0 const Tcl_ThreadCreateType = 0 const UBITS = 0 const UCHAR_MAX = 255 const UINT16_MAX = 65535 const UINT32_MAX = 4294967295 const UINT64_MAX = 18446744073709551615 const UINT8_MAX = 255 const UINTMAX_MAX = 18446744073709551615 const UINTPTR_MAX = 18446744073709551615 const UINT_FAST16_MAX = 4294967295 const UINT_FAST32_MAX = 4294967295 const UINT_FAST64_MAX = 18446744073709551615 const UINT_FAST8_MAX = 255 const UINT_LEAST16_MAX = 65535 const UINT_LEAST32_MAX = 4294967295 const UINT_LEAST64_MAX = 18446744073709551615 const UINT_LEAST8_MAX = 255 const UINT_MAX = 4294967295 const ULLONG_MAX = 18446744073709551615 const ULONG_MAX = 18446744073709551615 const USE_THREAD_ALLOC = 1 const USHRT_MAX = 65535 const UTIME_NOW = 1073741823 const UTIME_OMIT = 1073741822 const UWIDE_MAX = -1 const VAR_ALL_HASH = 4236 const VAR_ALL_TRACES = 2160 const VAR_ARGUMENT = 256 const VAR_ARRAY = 1 const VAR_ARRAY_ELEMENT = 4096 const VAR_CONSTANT = 65536 const VAR_DEAD_HASH = 8 const VAR_IN_HASHTABLE = 4 const VAR_IS_ARGS = 1024 const VAR_LINK = 2 const VAR_NAMESPACE_VAR = 128 const VAR_RESOLVED = 32768 const VAR_SEARCH_ACTIVE = 16384 const VAR_TEMPORARY = 512 const VAR_TRACED_ARRAY = 2048 const VAR_TRACED_READ = 16 const VAR_TRACED_UNSET = 64 const VAR_TRACED_WRITE = 32 const VAR_TRACE_ACTIVE = 8192 const WAIT_STATUS_TYPE = 0 const WBDRY = 119 const WCHAR_MAX = 2147483647 const WCHAR_MIN = -2147483648 const WCONTINUED = 8 const WEXITED = 4 const WHITE = 0 const WINT_MAX = 4294967295 const WINT_MIN = 0 const WNOHANG = 1 const WNOWAIT = 16777216 const WORD_BIT = 32 const WSTOPPED = 2 const WUNTRACED = 2 const W_OK = 2 const X_OK = 1 const ZIPFS_BUILD = 2 const _CS_GNU_LIBC_VERSION = 2 const _CS_GNU_LIBPTHREAD_VERSION = 3 const _CS_PATH = 0 const _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS = 4 const _CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116 const _CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117 const _CS_POSIX_V6_ILP32_OFF32_LIBS = 1118 const _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119 const _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120 const _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121 const _CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122 const _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123 const _CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124 const _CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125 const _CS_POSIX_V6_LP64_OFF64_LIBS = 1126 const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127 const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128 const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129 const _CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130 const _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131 const _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1 const _CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132 const _CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133 const _CS_POSIX_V7_ILP32_OFF32_LIBS = 1134 const _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135 const _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136 const _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137 const _CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138 const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139 const _CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140 const _CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141 const _CS_POSIX_V7_LP64_OFF64_LIBS = 1142 const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143 const _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144 const _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145 const _CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146 const _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147 const _CS_POSIX_V7_THREADS_CFLAGS = 1150 const _CS_POSIX_V7_THREADS_LDFLAGS = 1151 const _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 5 const _CS_V6_ENV = 1148 const _CS_V7_ENV = 1149 const _GNU_SOURCE = 1 const _IOFBF = 0 const _IOLBF = 1 const _IONBF = 2 const _LARGEFILE64_SOURCE = 1 const _LP64 = 1 const _NSIG = 65 const _PC_2_SYMLINKS = 20 const _PC_ALLOC_SIZE_MIN = 18 const _PC_ASYNC_IO = 10 const _PC_CHOWN_RESTRICTED = 6 const _PC_FILESIZEBITS = 13 const _PC_LINK_MAX = 0 const _PC_MAX_CANON = 1 const _PC_MAX_INPUT = 2 const _PC_NAME_MAX = 3 const _PC_NO_TRUNC = 7 const _PC_PATH_MAX = 4 const _PC_PIPE_BUF = 5 const _PC_PRIO_IO = 11 const _PC_REC_INCR_XFER_SIZE = 14 const _PC_REC_MAX_XFER_SIZE = 15 const _PC_REC_MIN_XFER_SIZE = 16 const _PC_REC_XFER_ALIGN = 17 const _PC_SOCK_MAXBUF = 12 const _PC_SYMLINK_MAX = 19 const _PC_SYNC_IO = 9 const _PC_VDISABLE = 8 const _POSIX2_BC_BASE_MAX = 99 const _POSIX2_BC_DIM_MAX = 2048 const _POSIX2_BC_SCALE_MAX = 99 const _POSIX2_BC_STRING_MAX = 1000 const _POSIX2_CHARCLASS_NAME_MAX = 14 const _POSIX2_COLL_WEIGHTS_MAX = 2 const _POSIX2_C_BIND = 200809 const _POSIX2_EXPR_NEST_MAX = 32 const _POSIX2_LINE_MAX = 2048 const _POSIX2_RE_DUP_MAX = 255 const _POSIX2_VERSION = 200809 const _POSIX_ADVISORY_INFO = 200809 const _POSIX_AIO_LISTIO_MAX = 2 const _POSIX_AIO_MAX = 1 const _POSIX_ARG_MAX = 4096 const _POSIX_ASYNCHRONOUS_IO = 200809 const _POSIX_BARRIERS = 200809 const _POSIX_CHILD_MAX = 25 const _POSIX_CHOWN_RESTRICTED = 1 const _POSIX_CLOCKRES_MIN = 20000000 const _POSIX_CLOCK_SELECTION = 200809 const _POSIX_CPUTIME = 200809 const _POSIX_DELAYTIMER_MAX = 32 const _POSIX_FSYNC = 200809 const _POSIX_HOST_NAME_MAX = 255 const _POSIX_IPV6 = 200809 const _POSIX_JOB_CONTROL = 1 const _POSIX_LINK_MAX = 8 const _POSIX_LOGIN_NAME_MAX = 9 const _POSIX_MAPPED_FILES = 200809 const _POSIX_MAX_CANON = 255 const _POSIX_MAX_INPUT = 255 const _POSIX_MEMLOCK = 200809 const _POSIX_MEMLOCK_RANGE = 200809 const _POSIX_MEMORY_PROTECTION = 200809 const _POSIX_MESSAGE_PASSING = 200809 const _POSIX_MONOTONIC_CLOCK = 200809 const _POSIX_MQ_OPEN_MAX = 8 const _POSIX_MQ_PRIO_MAX = 32 const _POSIX_NAME_MAX = 14 const _POSIX_NGROUPS_MAX = 8 const _POSIX_NO_TRUNC = 1 const _POSIX_OPEN_MAX = 20 const _POSIX_PATH_MAX = 256 const _POSIX_PIPE_BUF = 512 const _POSIX_RAW_SOCKETS = 200809 const _POSIX_READER_WRITER_LOCKS = 200809 const _POSIX_REALTIME_SIGNALS = 200809 const _POSIX_REGEXP = 1 const _POSIX_RE_DUP_MAX = 255 const _POSIX_RTSIG_MAX = 8 const _POSIX_SAVED_IDS = 1 const _POSIX_SEMAPHORES = 200809 const _POSIX_SEM_NSEMS_MAX = 256 const _POSIX_SEM_VALUE_MAX = 32767 const _POSIX_SHARED_MEMORY_OBJECTS = 200809 const _POSIX_SHELL = 1 const _POSIX_SIGQUEUE_MAX = 32 const _POSIX_SPAWN = 200809 const _POSIX_SPIN_LOCKS = 200809 const _POSIX_SSIZE_MAX = 32767 const _POSIX_SS_REPL_MAX = 4 const _POSIX_STREAM_MAX = 8 const _POSIX_SYMLINK_MAX = 255 const _POSIX_SYMLOOP_MAX = 8 const _POSIX_THREADS = 200809 const _POSIX_THREAD_ATTR_STACKADDR = 200809 const _POSIX_THREAD_ATTR_STACKSIZE = 200809 const _POSIX_THREAD_CPUTIME = 200809 const _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 const _POSIX_THREAD_KEYS_MAX = 128 const _POSIX_THREAD_PRIORITY_SCHEDULING = 200809 const _POSIX_THREAD_PROCESS_SHARED = 200809 const _POSIX_THREAD_SAFE_FUNCTIONS = 200809 const _POSIX_THREAD_THREADS_MAX = 64 const _POSIX_TIMEOUTS = 200809 const _POSIX_TIMERS = 200809 const _POSIX_TIMER_MAX = 32 const _POSIX_TRACE_EVENT_NAME_MAX = 30 const _POSIX_TRACE_NAME_MAX = 8 const _POSIX_TRACE_SYS_MAX = 8 const _POSIX_TRACE_USER_EVENT_MAX = 32 const _POSIX_TTY_NAME_MAX = 9 const _POSIX_TZNAME_MAX = 6 const _POSIX_V6_LP64_OFF64 = 1 const _POSIX_V7_LP64_OFF64 = 1 const _POSIX_VDISABLE = 0 const _POSIX_VERSION = 200809 const _REENTRANT = 1 const _SC_2_CHAR_TERM = 95 const _SC_2_C_BIND = 47 const _SC_2_C_DEV = 48 const _SC_2_FORT_DEV = 49 const _SC_2_FORT_RUN = 50 const _SC_2_LOCALEDEF = 52 const _SC_2_PBS = 168 const _SC_2_PBS_ACCOUNTING = 169 const _SC_2_PBS_CHECKPOINT = 175 const _SC_2_PBS_LOCATE = 170 const _SC_2_PBS_MESSAGE = 171 const _SC_2_PBS_TRACK = 172 const _SC_2_SW_DEV = 51 const _SC_2_UPE = 97 const _SC_2_VERSION = 46 const _SC_ADVISORY_INFO = 132 const _SC_AIO_LISTIO_MAX = 23 const _SC_AIO_MAX = 24 const _SC_AIO_PRIO_DELTA_MAX = 25 const _SC_ARG_MAX = 0 const _SC_ASYNCHRONOUS_IO = 12 const _SC_ATEXIT_MAX = 87 const _SC_AVPHYS_PAGES = 86 const _SC_BARRIERS = 133 const _SC_BC_BASE_MAX = 36 const _SC_BC_DIM_MAX = 37 const _SC_BC_SCALE_MAX = 38 const _SC_BC_STRING_MAX = 39 const _SC_CHILD_MAX = 1 const _SC_CLK_TCK = 2 const _SC_CLOCK_SELECTION = 137 const _SC_COLL_WEIGHTS_MAX = 40 const _SC_CPUTIME = 138 const _SC_DELAYTIMER_MAX = 26 const _SC_EXPR_NEST_MAX = 42 const _SC_FSYNC = 15 const _SC_GETGR_R_SIZE_MAX = 69 const _SC_GETPW_R_SIZE_MAX = 70 const _SC_HOST_NAME_MAX = 180 const _SC_IOV_MAX = 60 const _SC_IPV6 = 235 const _SC_JOB_CONTROL = 7 const _SC_LINE_MAX = 43 const _SC_LOGIN_NAME_MAX = 71 const _SC_MAPPED_FILES = 16 const _SC_MEMLOCK = 17 const _SC_MEMLOCK_RANGE = 18 const _SC_MEMORY_PROTECTION = 19 const _SC_MESSAGE_PASSING = 20 const _SC_MINSIGSTKSZ = 249 const _SC_MONOTONIC_CLOCK = 149 const _SC_MQ_OPEN_MAX = 27 const _SC_MQ_PRIO_MAX = 28 const _SC_NGROUPS_MAX = 3 const _SC_NPROCESSORS_CONF = 83 const _SC_NPROCESSORS_ONLN = 84 const _SC_NZERO = 109 const _SC_OPEN_MAX = 4 const _SC_PAGESIZE = 30 const _SC_PAGE_SIZE = 30 const _SC_PASS_MAX = 88 const _SC_PHYS_PAGES = 85 const _SC_PRIORITIZED_IO = 13 const _SC_PRIORITY_SCHEDULING = 10 const _SC_RAW_SOCKETS = 236 const _SC_READER_WRITER_LOCKS = 153 const _SC_REALTIME_SIGNALS = 9 const _SC_REGEXP = 155 const _SC_RE_DUP_MAX = 44 const _SC_RTSIG_MAX = 31 const _SC_SAVED_IDS = 8 const _SC_SEMAPHORES = 21 const _SC_SEM_NSEMS_MAX = 32 const _SC_SEM_VALUE_MAX = 33 const _SC_SHARED_MEMORY_OBJECTS = 22 const _SC_SHELL = 157 const _SC_SIGQUEUE_MAX = 34 const _SC_SIGSTKSZ = 250 const _SC_SPAWN = 159 const _SC_SPIN_LOCKS = 154 const _SC_SPORADIC_SERVER = 160 const _SC_SS_REPL_MAX = 241 const _SC_STREAMS = 174 const _SC_STREAM_MAX = 5 const _SC_SYMLOOP_MAX = 173 const _SC_SYNCHRONIZED_IO = 14 const _SC_THREADS = 67 const _SC_THREAD_ATTR_STACKADDR = 77 const _SC_THREAD_ATTR_STACKSIZE = 78 const _SC_THREAD_CPUTIME = 139 const _SC_THREAD_DESTRUCTOR_ITERATIONS = 73 const _SC_THREAD_KEYS_MAX = 74 const _SC_THREAD_PRIORITY_SCHEDULING = 79 const _SC_THREAD_PRIO_INHERIT = 80 const _SC_THREAD_PRIO_PROTECT = 81 const _SC_THREAD_PROCESS_SHARED = 82 const _SC_THREAD_ROBUST_PRIO_INHERIT = 247 const _SC_THREAD_ROBUST_PRIO_PROTECT = 248 const _SC_THREAD_SAFE_FUNCTIONS = 68 const _SC_THREAD_SPORADIC_SERVER = 161 const _SC_THREAD_STACK_MIN = 75 const _SC_THREAD_THREADS_MAX = 76 const _SC_TIMEOUTS = 164 const _SC_TIMERS = 11 const _SC_TIMER_MAX = 35 const _SC_TRACE = 181 const _SC_TRACE_EVENT_FILTER = 182 const _SC_TRACE_EVENT_NAME_MAX = 242 const _SC_TRACE_INHERIT = 183 const _SC_TRACE_LOG = 184 const _SC_TRACE_NAME_MAX = 243 const _SC_TRACE_SYS_MAX = 244 const _SC_TRACE_USER_EVENT_MAX = 245 const _SC_TTY_NAME_MAX = 72 const _SC_TYPED_MEMORY_OBJECTS = 165 const _SC_TZNAME_MAX = 6 const _SC_UIO_MAXIOV = 60 const _SC_V6_ILP32_OFF32 = 176 const _SC_V6_ILP32_OFFBIG = 177 const _SC_V6_LP64_OFF64 = 178 const _SC_V6_LPBIG_OFFBIG = 179 const _SC_V7_ILP32_OFF32 = 237 const _SC_V7_ILP32_OFFBIG = 238 const _SC_V7_LP64_OFF64 = 239 const _SC_V7_LPBIG_OFFBIG = 240 const _SC_VERSION = 29 const _SC_XBS5_ILP32_OFF32 = 125 const _SC_XBS5_ILP32_OFFBIG = 126 const _SC_XBS5_LP64_OFF64 = 127 const _SC_XBS5_LPBIG_OFFBIG = 128 const _SC_XOPEN_CRYPT = 92 const _SC_XOPEN_ENH_I18N = 93 const _SC_XOPEN_LEGACY = 129 const _SC_XOPEN_REALTIME = 130 const _SC_XOPEN_REALTIME_THREADS = 131 const _SC_XOPEN_SHM = 94 const _SC_XOPEN_STREAMS = 246 const _SC_XOPEN_UNIX = 91 const _SC_XOPEN_VERSION = 89 const _SC_XOPEN_XCU_VERSION = 90 const _SC_XOPEN_XPG2 = 98 const _SC_XOPEN_XPG3 = 99 const _SC_XOPEN_XPG4 = 100 const _STDC_PREDEF_H = 1 const _THREAD_SAFE = 1 const _XOPEN_ENH_I18N = 1 const _XOPEN_IOV_MAX = 16 const _XOPEN_NAME_MAX = 255 const _XOPEN_PATH_MAX = 1024 const _XOPEN_UNIX = 1 const _XOPEN_VERSION = 700 const __ARCH__ = 9 const __ATOMIC_ACQUIRE = 2 const __ATOMIC_ACQ_REL = 4 const __ATOMIC_CONSUME = 1 const __ATOMIC_RELAXED = 0 const __ATOMIC_RELEASE = 3 const __ATOMIC_SEQ_CST = 5 const __BIGGEST_ALIGNMENT__ = 8 const __BIG_ENDIAN = 4321 const __BYTE_ORDER = 4321 const __BYTE_ORDER__ = 4321 const __CCGO__ = 1 const __CHAR_BIT__ = 8 const __CHAR_UNSIGNED__ = 1 const __DBL_DECIMAL_DIG__ = 17 const __DBL_DIG__ = 15 const __DBL_HAS_DENORM__ = 1 const __DBL_HAS_INFINITY__ = 1 const __DBL_HAS_QUIET_NAN__ = 1 const __DBL_MANT_DIG__ = 53 const __DBL_MAX_10_EXP__ = 308 const __DBL_MAX_EXP__ = 1024 const __DBL_MIN_10_EXP__ = -307 const __DBL_MIN_EXP__ = -1021 const __DEC128_EPSILON__ = 0 const __DEC128_MANT_DIG__ = 34 const __DEC128_MAX_EXP__ = 6145 const __DEC128_MAX__ = 0 const __DEC128_MIN_EXP__ = -6142 const __DEC128_MIN__ = 0 const __DEC128_SUBNORMAL_MIN__ = 0 const __DEC32_EPSILON__ = 0 const __DEC32_MANT_DIG__ = 7 const __DEC32_MAX_EXP__ = 97 const __DEC32_MAX__ = 0 const __DEC32_MIN_EXP__ = -94 const __DEC32_MIN__ = 0 const __DEC32_SUBNORMAL_MIN__ = 0 const __DEC64_EPSILON__ = 0 const __DEC64_MANT_DIG__ = 16 const __DEC64_MAX_EXP__ = 385 const __DEC64_MAX__ = 0 const __DEC64_MIN_EXP__ = -382 const __DEC64_MIN__ = 0 const __DEC64_SUBNORMAL_MIN__ = 0 const __DECIMAL_DIG__ = 17 const __DEC_EVAL_METHOD__ = 2 const __ELF__ = 1 const __FINITE_MATH_ONLY__ = 0 const __FLOAT_WORD_ORDER__ = 4321 const __FLT32X_DECIMAL_DIG__ = 17 const __FLT32X_DENORM_MIN__ = 0 const __FLT32X_DIG__ = 15 const __FLT32X_EPSILON__ = 0 const __FLT32X_HAS_DENORM__ = 1 const __FLT32X_HAS_INFINITY__ = 1 const __FLT32X_HAS_QUIET_NAN__ = 1 const __FLT32X_MANT_DIG__ = 53 const __FLT32X_MAX_10_EXP__ = 308 const __FLT32X_MAX_EXP__ = 1024 const __FLT32X_MAX__ = 0 const __FLT32X_MIN_10_EXP__ = -307 const __FLT32X_MIN_EXP__ = -1021 const __FLT32X_MIN__ = 0 const __FLT32X_NORM_MAX__ = 0 const __FLT32_DECIMAL_DIG__ = 9 const __FLT32_DENORM_MIN__ = 0 const __FLT32_DIG__ = 6 const __FLT32_EPSILON__ = 0 const __FLT32_HAS_DENORM__ = 1 const __FLT32_HAS_INFINITY__ = 1 const __FLT32_HAS_QUIET_NAN__ = 1 const __FLT32_MANT_DIG__ = 24 const __FLT32_MAX_10_EXP__ = 38 const __FLT32_MAX_EXP__ = 128 const __FLT32_MAX__ = 0 const __FLT32_MIN_10_EXP__ = -37 const __FLT32_MIN_EXP__ = -125 const __FLT32_MIN__ = 0 const __FLT32_NORM_MAX__ = 0 const __FLT64_DECIMAL_DIG__ = 17 const __FLT64_DENORM_MIN__ = 0 const __FLT64_DIG__ = 15 const __FLT64_EPSILON__ = 0 const __FLT64_HAS_DENORM__ = 1 const __FLT64_HAS_INFINITY__ = 1 const __FLT64_HAS_QUIET_NAN__ = 1 const __FLT64_MANT_DIG__ = 53 const __FLT64_MAX_10_EXP__ = 308 const __FLT64_MAX_EXP__ = 1024 const __FLT64_MAX__ = 0 const __FLT64_MIN_10_EXP__ = -307 const __FLT64_MIN_EXP__ = -1021 const __FLT64_MIN__ = 0 const __FLT64_NORM_MAX__ = 0 const __FLT_DECIMAL_DIG__ = 9 const __FLT_DENORM_MIN__ = 0 const __FLT_DIG__ = 6 const __FLT_EPSILON__ = 0 const __FLT_EVAL_METHOD_TS_18661_3__ = 0 const __FLT_EVAL_METHOD__ = 0 const __FLT_HAS_DENORM__ = 1 const __FLT_HAS_INFINITY__ = 1 const __FLT_HAS_QUIET_NAN__ = 1 const __FLT_MANT_DIG__ = 24 const __FLT_MAX_10_EXP__ = 38 const __FLT_MAX_EXP__ = 128 const __FLT_MAX__ = 0 const __FLT_MIN_10_EXP__ = -37 const __FLT_MIN_EXP__ = -125 const __FLT_MIN__ = 0 const __FLT_NORM_MAX__ = 0 const __FLT_RADIX__ = 2 const __FP_FAST_FMA = 1 const __FP_FAST_FMAF = 1 const __FP_FAST_FMAF32 = 1 const __FP_FAST_FMAF32x = 1 const __FP_FAST_FMAF64 = 1 const __FP_FAST_FMAL = 1 const __FUNCTION__ = 0 const __GCC_ATOMIC_BOOL_LOCK_FREE = 2 const __GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2 const __GCC_ATOMIC_CHAR32_T_LOCK_FREE = 2 const __GCC_ATOMIC_CHAR_LOCK_FREE = 2 const __GCC_ATOMIC_INT_LOCK_FREE = 2 const __GCC_ATOMIC_LLONG_LOCK_FREE = 2 const __GCC_ATOMIC_LONG_LOCK_FREE = 2 const __GCC_ATOMIC_POINTER_LOCK_FREE = 2 const __GCC_ATOMIC_SHORT_LOCK_FREE = 2 const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1 const __GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2 const __GCC_HAVE_DWARF2_CFI_ASM = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1 const __GCC_IEC_559 = 2 const __GCC_IEC_559_COMPLEX = 2 const __GNUC_MINOR__ = 2 const __GNUC_PATCHLEVEL__ = 1 const __GNUC_STDC_INLINE__ = 1 const __GNUC__ = 10 const __GXX_ABI_VERSION = 1014 const __HAVE_SPECULATION_SAFE_VALUE = 1 const __INT16_MAX__ = 32767 const __INT32_MAX__ = 2147483647 const __INT32_TYPE__ = 0 const __INT64_MAX__ = 9223372036854775807 const __INT8_MAX__ = 127 const __INTMAX_MAX__ = 9223372036854775807 const __INTMAX_WIDTH__ = 64 const __INTPTR_MAX__ = 9223372036854775807 const __INTPTR_WIDTH__ = 64 const __INT_FAST16_MAX__ = 9223372036854775807 const __INT_FAST16_WIDTH__ = 64 const __INT_FAST32_MAX__ = 9223372036854775807 const __INT_FAST32_WIDTH__ = 64 const __INT_FAST64_MAX__ = 9223372036854775807 const __INT_FAST64_WIDTH__ = 64 const __INT_FAST8_MAX__ = 127 const __INT_FAST8_WIDTH__ = 8 const __INT_LEAST16_MAX__ = 32767 const __INT_LEAST16_WIDTH__ = 16 const __INT_LEAST32_MAX__ = 2147483647 const __INT_LEAST32_TYPE__ = 0 const __INT_LEAST32_WIDTH__ = 32 const __INT_LEAST64_MAX__ = 9223372036854775807 const __INT_LEAST64_WIDTH__ = 64 const __INT_LEAST8_MAX__ = 127 const __INT_LEAST8_WIDTH__ = 8 const __INT_MAX__ = 2147483647 const __INT_WIDTH__ = 32 const __LDBL_DECIMAL_DIG__ = 17 const __LDBL_DENORM_MIN__ = 0 const __LDBL_DIG__ = 15 const __LDBL_EPSILON__ = 0 const __LDBL_HAS_DENORM__ = 1 const __LDBL_HAS_INFINITY__ = 1 const __LDBL_HAS_QUIET_NAN__ = 1 const __LDBL_MANT_DIG__ = 53 const __LDBL_MAX_10_EXP__ = 308 const __LDBL_MAX_EXP__ = 1024 const __LDBL_MAX__ = 0 const __LDBL_MIN_10_EXP__ = -307 const __LDBL_MIN_EXP__ = -1021 const __LDBL_MIN__ = 0 const __LDBL_NORM_MAX__ = 0 const __LITTLE_ENDIAN = 1234 const __LONG_LONG_MAX__ = 9223372036854775807 const __LONG_LONG_WIDTH__ = 64 const __LONG_MAX = 9223372036854775807 const __LONG_MAX__ = 9223372036854775807 const __LONG_WIDTH__ = 64 const __LP64__ = 1 const __OPTIMIZE__ = 1 const __ORDER_BIG_ENDIAN__ = 4321 const __ORDER_LITTLE_ENDIAN__ = 1234 const __ORDER_PDP_ENDIAN__ = 3412 const __PDP_ENDIAN = 3412 const __PIC__ = 2 const __PIE__ = 2 const __PRAGMA_REDEFINE_EXTNAME = 1 const __PRETTY_FUNCTION__ = 0 const __PRI64 = "l" const __PRIPTR = "l" const __PTRDIFF_MAX__ = 9223372036854775807 const __PTRDIFF_WIDTH__ = 64 const __SCHAR_MAX__ = 127 const __SCHAR_WIDTH__ = 8 const __SHRT_MAX__ = 32767 const __SHRT_WIDTH__ = 16 const __SIG_ATOMIC_MAX__ = 2147483647 const __SIG_ATOMIC_MIN__ = -2147483648 const __SIG_ATOMIC_TYPE__ = 0 const __SIG_ATOMIC_WIDTH__ = 32 const __SIZEOF_DOUBLE__ = 8 const __SIZEOF_FLOAT__ = 4 const __SIZEOF_INT__ = 4 const __SIZEOF_LONG_DOUBLE__ = 8 const __SIZEOF_LONG_LONG__ = 8 const __SIZEOF_LONG__ = 8 const __SIZEOF_POINTER__ = 8 const __SIZEOF_PTRDIFF_T__ = 8 const __SIZEOF_SHORT__ = 2 const __SIZEOF_SIZE_T__ = 8 const __SIZEOF_WCHAR_T__ = 4 const __SIZEOF_WINT_T__ = 4 const __SIZE_MAX__ = 18446744073709551615 const __SIZE_WIDTH__ = 64 const __STDC_HOSTED__ = 1 const __STDC_IEC_559_COMPLEX__ = 1 const __STDC_IEC_559__ = 1 const __STDC_ISO_10646__ = 201706 const __STDC_UTF_16__ = 1 const __STDC_UTF_32__ = 1 const __STDC_VERSION__ = 201710 const __STDC__ = 1 const __UAPI_DEF_IN6_ADDR = 0 const __UAPI_DEF_IN6_ADDR_ALT = 0 const __UAPI_DEF_IN6_PKTINFO = 0 const __UAPI_DEF_IN_ADDR = 0 const __UAPI_DEF_IN_CLASS = 0 const __UAPI_DEF_IN_IPPROTO = 0 const __UAPI_DEF_IN_PKTINFO = 0 const __UAPI_DEF_IP6_MTUINFO = 0 const __UAPI_DEF_IPPROTO_V6 = 0 const __UAPI_DEF_IPV6_MREQ = 0 const __UAPI_DEF_IPV6_OPTIONS = 0 const __UAPI_DEF_IP_MREQ = 0 const __UAPI_DEF_SOCKADDR_IN = 0 const __UAPI_DEF_SOCKADDR_IN6 = 0 const __UINT16_MAX__ = 65535 const __UINT32_MAX__ = 4294967295 const __UINT64_MAX__ = 18446744073709551615 const __UINT8_MAX__ = 255 const __UINTMAX_MAX__ = 18446744073709551615 const __UINTPTR_MAX__ = 18446744073709551615 const __UINT_FAST16_MAX__ = 18446744073709551615 const __UINT_FAST32_MAX__ = 18446744073709551615 const __UINT_FAST64_MAX__ = 18446744073709551615 const __UINT_FAST8_MAX__ = 255 const __UINT_LEAST16_MAX__ = 65535 const __UINT_LEAST32_MAX__ = 4294967295 const __UINT_LEAST64_MAX__ = 18446744073709551615 const __UINT_LEAST8_MAX__ = 255 const __USE_TIME_BITS64 = 1 const __VERSION__ = "10.2.1 20210110" const __WALL = 1073741824 const __WCHAR_MAX__ = 2147483647 const __WCHAR_MIN__ = -2147483648 const __WCHAR_TYPE__ = 0 const __WCHAR_WIDTH__ = 32 const __WCLONE = 2147483648 const __WINT_MAX__ = 4294967295 const __WINT_MIN__ = 0 const __WINT_WIDTH__ = 32 const __WNOTHREAD = 536870912 const __gnu_linux__ = 1 const __inline = 0 const __linux = 1 const __linux__ = 1 const __pic__ = 2 const __pie__ = 2 const __restrict = 0 const __restrict_arr = 0 const __s390__ = 1 const __s390x__ = 1 const __tm_gmtoff = 0 const __tm_zone = 0 const __ucontext = 0 const __unix = 1 const __unix__ = 1 const __zarch__ = 1 const alloca = 0 const alphasort64 = 0 const blkcnt64_t = 0 const compile = 0 const creat64 = 0 const d_fileno = 0 const dirent64 = 0 const errno = 0 const exec = 0 const fallocate64 = 0 const fgetpos64 = 0 const flock64 = 0 const fopen64 = 0 const fpos64_t = 0 const freechain = 0 const freopen64 = 0 const fsblkcnt64_t = 0 const fseeko64 = 0 const fsetpos64 = 0 const fsfilcnt64_t = 0 const fstat64 = 0 const fstatat64 = 0 const ftello64 = 0 const ftruncate64 = 0 const getdents64 = 0 const getrlimit64 = 0 const h_errno = 0 const ino64_t = 0 const linux = 1 const lockf64 = 0 const loff_t = 0 const lseek64 = 0 const lstat64 = 0 const mkostemp64 = 0 const mkostemps64 = 0 const mkstemp64 = 0 const mkstemps64 = 0 const off64_t = 0 const open64 = 0 const openat64 = 0 const posix_fadvise64 = 0 const posix_fallocate64 = 0 const pread64 = 0 const prlimit64 = 0 const pwrite64 = 0 const readdir64 = 0 const readdir64_r = 0 const regerror = 0 const regfree = 0 const rlim64_t = 0 const rlimit64 = 0 const scandir64 = 0 const setrlimit64 = 0 const stat64 = 0 const static_assert = 0 const tmpfile64 = 0 const truncate64 = 0 const unix = 1 const versionsort64 = 0 type T__builtin_va_list = uintptr type T__predefined_size_t = uint64 type T__predefined_wchar_t = int32 type T__predefined_ptrdiff_t = int64 type Tsize_t = uint64 type Tssize_t = int64 type Tmode_t = uint32 type Toff_t = int64 type Tpid_t = int32 type Tiovec = struct { Fiov_base uintptr Fiov_len Tsize_t } type Tflock = struct { Fl_type int16 Fl_whence int16 Fl_start Toff_t Fl_len Toff_t Fl_pid Tpid_t } type Tfile_handle = struct { Fhandle_bytes uint32 Fhandle_type int32 } type Tf_owner_ex = struct { Ftype1 int32 Fpid Tpid_t } type Tuid_t = uint32 type Tgid_t = uint32 type Tpasswd = struct { Fpw_name uintptr Fpw_passwd uintptr Fpw_uid Tuid_t Fpw_gid Tgid_t Fpw_gecos uintptr Fpw_dir uintptr Fpw_shell uintptr } type Ttime_t = int64 type Tclock_t = int64 type Ttimespec = struct { Ftv_sec Ttime_t Ftv_nsec int64 } type Tpthread_t = uintptr type Tsigset_t = struct { F__bits [16]uint64 } type T__sigset_t = Tsigset_t type Tpthread_attr_t = struct { F__u struct { F__vi [0][14]int32 F__s [0][7]uint64 F__i [14]int32 } } type Tstack_t = struct { Fss_sp uintptr Fss_flags int32 Fss_size Tsize_t } type Tsigaltstack = Tstack_t type Tgreg_t = uint64 type Tgregset_t = [27]uint64 type T__psw_t = struct { Fmask uint64 Faddr uint64 } type Tfpreg_t = struct { Ff [0]float32 Fd float64 } type Tfpregset_t = struct { Ffpc uint32 Ffprs [16]Tfpreg_t } type Tmcontext_t = struct { Fpsw T__psw_t Fgregs [16]uint64 Faregs [16]uint32 Ffpregs Tfpregset_t } type Tsigcontext = struct { Foldmask [1]uint64 Fsregs uintptr } type Tucontext_t = struct { Fuc_flags uint64 Fuc_link uintptr Fuc_stack Tstack_t Fuc_mcontext Tmcontext_t Fuc_sigmask Tsigset_t } type Tucontext = Tucontext_t type Tsigval = struct { Fsival_ptr [0]uintptr Fsival_int int32 F__ccgo_pad2 [4]byte } type Tsiginfo_t = struct { Fsi_signo int32 Fsi_errno int32 Fsi_code int32 F__si_fields struct { F__si_common [0]struct { F__first struct { F__timer [0]struct { Fsi_timerid int32 Fsi_overrun int32 } F__piduid struct { Fsi_pid Tpid_t Fsi_uid Tuid_t } } F__second struct { F__sigchld [0]struct { Fsi_status int32 Fsi_utime Tclock_t Fsi_stime Tclock_t } Fsi_value Tsigval F__ccgo_pad2 [16]byte } } F__sigfault [0]struct { Fsi_addr uintptr Fsi_addr_lsb int16 F__first struct { Fsi_pkey [0]uint32 F__addr_bnd struct { Fsi_lower uintptr Fsi_upper uintptr } } } F__sigpoll [0]struct { Fsi_band int64 Fsi_fd int32 } F__sigsys [0]struct { Fsi_call_addr uintptr Fsi_syscall int32 Fsi_arch uint32 } F__pad [112]uint8 } } type Tsigaction = struct { F__sa_handler struct { Fsa_sigaction [0]uintptr Fsa_handler uintptr } Fsa_mask Tsigset_t Fsa_flags int32 Fsa_restorer uintptr } type Tsigevent = struct { Fsigev_value Tsigval Fsigev_signo int32 Fsigev_notify int32 F__sev_fields struct { Fsigev_notify_thread_id [0]Tpid_t F__sev_thread [0]struct { Fsigev_notify_function uintptr Fsigev_notify_attributes uintptr } F__pad [48]uint8 } } type Tsig_t = uintptr type Tsighandler_t = uintptr type Tsig_atomic_t = int32 type Tsuseconds_t = int64 type Ttimeval = struct { Ftv_sec Ttime_t Ftv_usec Tsuseconds_t } type Tfd_mask = uint64 type Tfd_set = struct { Ffds_bits [16]uint64 } type Titimerval = struct { Fit_interval Ttimeval Fit_value Ttimeval } type Ttimezone = struct { Ftz_minuteswest int32 Ftz_dsttime int32 } type Tid_t = uint32 type Trlim_t = uint64 type Trlimit = struct { Frlim_cur Trlim_t Frlim_max Trlim_t } type Trusage = struct { Fru_utime Ttimeval Fru_stime Ttimeval Fru_maxrss int64 Fru_ixrss int64 Fru_idrss int64 Fru_isrss int64 Fru_minflt int64 Fru_majflt int64 Fru_nswap int64 Fru_inblock int64 Fru_oublock int64 Fru_msgsnd int64 Fru_msgrcv int64 Fru_nsignals int64 Fru_nvcsw int64 Fru_nivcsw int64 F__reserved [16]int64 } type Tuint16_t = uint16 type Tuint32_t = uint32 type Tuint64_t = uint64 type Tregister_t = int64 type Tint8_t = int8 type Tint16_t = int16 type Tint32_t = int32 type Tint64_t = int64 type Tu_int64_t = uint64 type Tnlink_t = uint64 type Tino_t = uint64 type Tdev_t = uint64 type Tblksize_t = int64 type Tblkcnt_t = int64 type Tfsblkcnt_t = uint64 type Tfsfilcnt_t = uint64 type Ttimer_t = uintptr type Tclockid_t = int32 type Tkey_t = int32 type Tuseconds_t = uint32 type Tpthread_once_t = int32 type Tpthread_key_t = uint32 type Tpthread_spinlock_t = int32 type Tpthread_mutexattr_t = struct { F__attr uint32 } type Tpthread_condattr_t = struct { F__attr uint32 } type Tpthread_barrierattr_t = struct { F__attr uint32 } type Tpthread_rwlockattr_t = struct { F__attr [2]uint32 } type Tpthread_mutex_t = struct { F__u struct { F__vi [0][10]int32 F__p [0][5]uintptr F__i [10]int32 } } type Tpthread_cond_t = struct { F__u struct { F__vi [0][12]int32 F__p [0][6]uintptr F__i [12]int32 } } type Tpthread_rwlock_t = struct { F__u struct { F__vi [0][14]int32 F__p [0][7]uintptr F__i [14]int32 } } type Tpthread_barrier_t = struct { F__u struct { F__vi [0][8]int32 F__p [0][4]uintptr F__i [8]int32 } } type Tu_int8_t = uint8 type Tu_int16_t = uint16 type Tu_int32_t = uint32 type Tcaddr_t = uintptr type Tu_char = uint8 type Tu_short = uint16 type Tushort = uint16 type Tu_int = uint32 type Tuint = uint32 type Tu_long = uint64 type Tulong = uint64 type Tquad_t = int64 type Tu_quad_t = uint64 type Tdirent = struct { Fd_ino Tino_t Fd_off Toff_t Fd_reclen uint16 Fd_type uint8 Fd_name [256]uint8 } type TTcl_DirEntry = struct { Fd_ino Tino_t Fd_off Toff_t Fd_reclen uint16 Fd_type uint8 Fd_name [256]uint8 } type TTcl_SeekOffset = int64 type Tstat = struct { Fst_dev Tdev_t Fst_ino Tino_t Fst_nlink Tnlink_t Fst_mode Tmode_t Fst_uid Tuid_t Fst_gid Tgid_t Fst_rdev Tdev_t Fst_size Toff_t Fst_atim Ttimespec Fst_mtim Ttimespec Fst_ctim Ttimespec Fst_blksize Tblksize_t Fst_blocks Tblkcnt_t F__unused [3]uint64 } type Tstatx_timestamp = struct { Ftv_sec Tint64_t Ftv_nsec Tuint32_t F__pad Tuint32_t } type Tstatx = struct { Fstx_mask Tuint32_t Fstx_blksize Tuint32_t Fstx_attributes Tuint64_t Fstx_nlink Tuint32_t Fstx_uid Tuint32_t Fstx_gid Tuint32_t Fstx_mode Tuint16_t F__pad0 [1]Tuint16_t Fstx_ino Tuint64_t Fstx_size Tuint64_t Fstx_blocks Tuint64_t Fstx_attributes_mask Tuint64_t Fstx_atime Tstatx_timestamp Fstx_btime Tstatx_timestamp Fstx_ctime Tstatx_timestamp Fstx_mtime Tstatx_timestamp Fstx_rdev_major Tuint32_t Fstx_rdev_minor Tuint32_t Fstx_dev_major Tuint32_t Fstx_dev_minor Tuint32_t F__pad1 [14]Tuint64_t } type Tlocale_t = uintptr type Ttm = struct { Ftm_sec int32 Ftm_min int32 Ftm_hour int32 Ftm_mday int32 Ftm_mon int32 Ftm_year int32 Ftm_wday int32 Ftm_yday int32 Ftm_isdst int32 Ftm_gmtoff int64 Ftm_zone uintptr } type Titimerspec = struct { Fit_interval Ttimespec Fit_value Ttimespec } type Tidtype_t = int32 const P_ALL = 0 const P_PID = 1 const P_PGID = 2 const P_PIDFD = 3 type Tuintptr_t = uint64 type Tintptr_t = int64 type Tintmax_t = int64 type Tuint8_t = uint8 type Tuintmax_t = uint64 type Tint_fast8_t = int8 type Tint_fast64_t = int64 type Tint_least8_t = int8 type Tint_least16_t = int16 type Tint_least32_t = int32 type Tint_least64_t = int64 type Tuint_fast8_t = uint8 type Tuint_fast64_t = uint64 type Tuint_least8_t = uint8 type Tuint_least16_t = uint16 type Tuint_least32_t = uint32 type Tuint_least64_t = uint64 type Tint_fast16_t = int32 type Tint_fast32_t = int32 type Tuint_fast16_t = uint32 type Tuint_fast32_t = uint32 type Twchar_t = int32 type Timaxdiv_t = struct { Fquot Tintmax_t Frem Tintmax_t } type Tutimbuf = struct { Factime Ttime_t Fmodtime Ttime_t } type Tsocklen_t = uint32 type Tsa_family_t = uint16 type Tmsghdr = struct { Fmsg_name uintptr Fmsg_namelen Tsocklen_t Fmsg_iov uintptr F__pad1 int32 Fmsg_iovlen int32 Fmsg_control uintptr F__pad2 int32 Fmsg_controllen Tsocklen_t Fmsg_flags int32 } type Tcmsghdr = struct { F__pad1 int32 Fcmsg_len Tsocklen_t Fcmsg_level int32 Fcmsg_type int32 } type Tucred = struct { Fpid Tpid_t Fuid Tuid_t Fgid Tgid_t } type Tmmsghdr = struct { Fmsg_hdr Tmsghdr Fmsg_len uint32 } type Tlinger = struct { Fl_onoff int32 Fl_linger int32 } type Tsockaddr = struct { Fsa_family Tsa_family_t Fsa_data [14]uint8 } type Tsockaddr_storage = struct { Fss_family Tsa_family_t F__ss_padding [118]uint8 F__ss_align uint64 } type Tutsname = struct { Fsysname [65]uint8 Fnodename [65]uint8 Frelease [65]uint8 Fversion [65]uint8 Fmachine [65]uint8 Fdomainname [65]uint8 } type Tin_port_t = uint16 type Tin_addr_t = uint32 type Tin_addr = struct { Fs_addr Tin_addr_t } type Tsockaddr_in = struct { Fsin_family Tsa_family_t Fsin_port Tin_port_t Fsin_addr Tin_addr Fsin_zero [8]Tuint8_t } type Tin6_addr = struct { F__in6_union struct { F__s6_addr16 [0][8]Tuint16_t F__s6_addr32 [0][4]Tuint32_t F__s6_addr [16]Tuint8_t } } type Tsockaddr_in6 = struct { Fsin6_family Tsa_family_t Fsin6_port Tin_port_t Fsin6_flowinfo Tuint32_t Fsin6_addr Tin6_addr Fsin6_scope_id Tuint32_t } type Tipv6_mreq = struct { Fipv6mr_multiaddr Tin6_addr Fipv6mr_interface uint32 } type Tip_opts = struct { Fip_dst Tin_addr Fip_opts [40]uint8 } type Tip_mreq = struct { Fimr_multiaddr Tin_addr Fimr_interface Tin_addr } type Tip_mreqn = struct { Fimr_multiaddr Tin_addr Fimr_address Tin_addr Fimr_ifindex int32 } type Tip_mreq_source = struct { Fimr_multiaddr Tin_addr Fimr_interface Tin_addr Fimr_sourceaddr Tin_addr } type Tip_msfilter = struct { Fimsf_multiaddr Tin_addr Fimsf_interface Tin_addr Fimsf_fmode Tuint32_t Fimsf_numsrc Tuint32_t Fimsf_slist [1]Tin_addr } type Tgroup_req = struct { Fgr_interface Tuint32_t Fgr_group Tsockaddr_storage } type Tgroup_source_req = struct { Fgsr_interface Tuint32_t Fgsr_group Tsockaddr_storage Fgsr_source Tsockaddr_storage } type Tgroup_filter = struct { Fgf_interface Tuint32_t Fgf_group Tsockaddr_storage Fgf_fmode Tuint32_t Fgf_numsrc Tuint32_t Fgf_slist [1]Tsockaddr_storage } type Tin_pktinfo = struct { Fipi_ifindex int32 Fipi_spec_dst Tin_addr Fipi_addr Tin_addr } type Tin6_pktinfo = struct { Fipi6_addr Tin6_addr Fipi6_ifindex uint32 } type Tip6_mtuinfo = struct { Fip6m_addr Tsockaddr_in6 Fip6m_mtu Tuint32_t } type Taddrinfo = struct { Fai_flags int32 Fai_family int32 Fai_socktype int32 Fai_protocol int32 Fai_addrlen Tsocklen_t Fai_addr uintptr Fai_canonname uintptr Fai_next uintptr } type Tnetent = struct { Fn_name uintptr Fn_aliases uintptr Fn_addrtype int32 Fn_net Tuint32_t } type Thostent = struct { Fh_name uintptr Fh_aliases uintptr Fh_addrtype int32 Fh_length int32 Fh_addr_list uintptr } type Tservent = struct { Fs_name uintptr Fs_aliases uintptr Fs_port int32 Fs_proto uintptr } type Tprotoent = struct { Fp_name uintptr Fp_aliases uintptr Fp_proto int32 } type Tsched_param = struct { Fsched_priority int32 F__reserved1 int32 F__reserved2 [2]struct { F__reserved1 Ttime_t F__reserved2 int64 } F__reserved3 int32 } type Tcpu_set_t = struct { F__bits [16]uint64 } type T__ptcb = struct { F__f uintptr F__x uintptr F__next uintptr } type Tcpu_set_t1 = struct { F__bits [16]uint64 } type Tgroup = struct { Fgr_name uintptr Fgr_passwd uintptr Fgr_gid Tgid_t Fgr_mem uintptr } type Tva_list = uintptr type T__isoc_va_list = uintptr type Tfpos_t = struct { F__lldata [0]int64 F__align [0]float64 F__opaque [16]uint8 } type T_G_fpos64_t = Tfpos_t type Tcookie_io_functions_t = struct { Fread uintptr Fwrite uintptr Fseek uintptr Fclose1 uintptr } type T_IO_cookie_io_functions_t = Tcookie_io_functions_t type Tmax_align_t = struct { F__ll int64 F__ld float64 } type Tptrdiff_t = int64 type TClientData = uintptr type TTcl_WideInt = int64 type TTcl_WideUInt = uint64 type TTcl_Size = int64 type TTcl_StatBuf = struct { Fst_dev Tdev_t Fst_ino Tino_t Fst_nlink Tnlink_t Fst_mode Tmode_t Fst_uid Tuid_t Fst_gid Tgid_t Fst_rdev Tdev_t Fst_size Toff_t Fst_atim Ttimespec Fst_mtim Ttimespec Fst_ctim Ttimespec Fst_blksize Tblksize_t Fst_blocks Tblkcnt_t F__unused [3]uint64 } type TTcl_AsyncHandler = uintptr type TTcl_Channel = uintptr type TTcl_ChannelTypeVersion = uintptr type TTcl_Command = uintptr type TTcl_Condition = uintptr type TTcl_Dict = uintptr type TTcl_EncodingState = uintptr type TTcl_Encoding = uintptr type TTcl_Event = struct { Fproc uintptr FnextPtr uintptr } type TTcl_InterpState = uintptr type TTcl_LoadHandle = uintptr type TTcl_LoadHandle_ = struct { FclientData uintptr FfindSymbolProcPtr uintptr FunloadFileProcPtr uintptr } type TTcl_Mutex = uintptr type TTcl_Pid = uintptr type TTcl_RegExp = uintptr type TTcl_ThreadDataKey = uintptr type TTcl_ThreadId = uintptr type TTcl_TimerToken = uintptr type TTcl_Trace = uintptr type TTcl_Var = uintptr type TTcl_ZlibStream = uintptr type TTcl_RegExpIndices = struct { Fstart TTcl_Size Fend TTcl_Size } type TTcl_RegExpInfo = struct { Fnsubs TTcl_Size Fmatches uintptr FextendStart TTcl_Size } type TTcl_Stat_ = uintptr type TTcl_OldStat_ = uintptr type TTcl_Obj1 = struct { FrefCount TTcl_Size Fbytes uintptr Flength TTcl_Size FtypePtr uintptr FinternalRep TTcl_ObjInternalRep } type TTcl_ObjType = struct { Fname uintptr FfreeIntRepProc uintptr FdupIntRepProc uintptr FupdateStringProc uintptr FsetFromAnyProc uintptr Fversion Tsize_t FlengthProc uintptr FindexProc uintptr FsliceProc uintptr FreverseProc uintptr FgetElementsProc uintptr FsetElementProc uintptr FreplaceProc uintptr FinOperProc uintptr } type TTcl_ObjInternalRep = struct { FdoubleValue [0]float64 FotherValuePtr [0]uintptr FwideValue [0]TTcl_WideInt FtwoPtrValue [0]struct { Fptr1 uintptr Fptr2 uintptr } FptrAndLongRep [0]struct { Fptr uintptr Fvalue uint64 } FptrAndSize [0]struct { Fptr uintptr Fsize TTcl_Size } FlongValue int64 F__ccgo_pad7 [8]byte } type TTcl_Obj = struct { FrefCount TTcl_Size Fbytes uintptr Flength TTcl_Size FtypePtr uintptr FinternalRep TTcl_ObjInternalRep } type TTcl_Namespace = struct { Fname uintptr FfullName uintptr FclientData uintptr FdeleteProc uintptr FparentPtr uintptr } type TTcl_CallFrame = struct { FnsPtr uintptr Fdummy1 int32 Fdummy2 TTcl_Size Fdummy3 uintptr Fdummy4 uintptr Fdummy5 uintptr Fdummy6 TTcl_Size Fdummy7 uintptr Fdummy8 uintptr Fdummy9 TTcl_Size Fdummy10 uintptr Fdummy11 uintptr Fdummy12 uintptr Fdummy13 uintptr } type TTcl_CmdInfo = struct { FisNativeObjectProc int32 FobjProc uintptr FobjClientData uintptr Fproc uintptr FclientData uintptr FdeleteProc uintptr FdeleteData uintptr FnamespacePtr uintptr FobjProc2 uintptr FobjClientData2 uintptr } type TTcl_DString = struct { Fstring1 uintptr Flength TTcl_Size FspaceAvl TTcl_Size FstaticSpace [200]uint8 } type TTcl_HashKeyType = struct { Fversion int32 Fflags int32 FhashKeyProc uintptr FcompareKeysProc uintptr FallocEntryProc uintptr FfreeEntryProc uintptr } type TTcl_HashTable = struct { Fbuckets uintptr FstaticBuckets [4]uintptr FnumBuckets TTcl_Size FnumEntries TTcl_Size FrebuildSize TTcl_Size Fmask Tsize_t FdownShift int32 FkeyType int32 FfindProc uintptr FcreateProc uintptr FtypePtr uintptr } type TTcl_HashEntry = struct { FnextPtr uintptr FtablePtr uintptr Fhash Tsize_t FclientData uintptr Fkey struct { FobjPtr [0]uintptr Fwords [0][1]int32 Fstring1 [0][1]uint8 FoneWordValue uintptr } } type TTcl_HashEntry1 = struct { FnextPtr uintptr FtablePtr uintptr Fhash Tsize_t FclientData uintptr Fkey struct { FobjPtr [0]uintptr Fwords [0][1]int32 Fstring1 [0][1]uint8 FoneWordValue uintptr } } type TTcl_HashKeyType1 = struct { Fversion int32 Fflags int32 FhashKeyProc uintptr FcompareKeysProc uintptr FallocEntryProc uintptr FfreeEntryProc uintptr } type TTcl_HashTable1 = struct { Fbuckets uintptr FstaticBuckets [4]uintptr FnumBuckets TTcl_Size FnumEntries TTcl_Size FrebuildSize TTcl_Size Fmask Tsize_t FdownShift int32 FkeyType int32 FfindProc uintptr FcreateProc uintptr FtypePtr uintptr } type TTcl_HashSearch = struct { FtablePtr uintptr FnextIndex TTcl_Size FnextEntryPtr uintptr } type TTcl_DictSearch = struct { Fnext uintptr Fepoch Tsize_t FdictionaryPtr TTcl_Dict } type TTcl_Event1 = struct { Fproc uintptr FnextPtr uintptr } type TTcl_QueuePosition = int32 const TCL_QUEUE_TAIL = 0 const TCL_QUEUE_HEAD = 1 const TCL_QUEUE_MARK = 2 const TCL_QUEUE_ALERT_IF_EMPTY = 4 type TTcl_Time = struct { Fsec int64 Fusec int64 } type TTcl_DriverCloseProc = struct{} type TTcl_DriverSeekProc = struct{} type TTcl_ChannelType = struct { FtypeName uintptr Fversion TTcl_ChannelTypeVersion FcloseProc uintptr FinputProc uintptr FoutputProc uintptr FseekProc uintptr FsetOptionProc uintptr FgetOptionProc uintptr FwatchProc uintptr FgetHandleProc uintptr Fclose2Proc uintptr FblockModeProc uintptr FflushProc uintptr FhandlerProc uintptr FwideSeekProc uintptr FthreadActionProc uintptr FtruncateProc uintptr } type TTcl_PathType = int32 type Tcl_PathType = int32 const TCL_PATH_ABSOLUTE = 0 const TCL_PATH_RELATIVE = 1 const TCL_PATH_VOLUME_RELATIVE = 2 type TTcl_GlobTypeData = struct { Ftype1 int32 Fperm int32 FmacType uintptr FmacCreator uintptr } type TTcl_FSVersion = uintptr type TTcl_Filesystem = struct { FtypeName uintptr FstructureLength TTcl_Size Fversion TTcl_FSVersion FpathInFilesystemProc uintptr FdupInternalRepProc uintptr FfreeInternalRepProc uintptr FinternalToNormalizedProc uintptr FcreateInternalRepProc uintptr FnormalizePathProc uintptr FfilesystemPathTypeProc uintptr FfilesystemSeparatorProc uintptr FstatProc uintptr FaccessProc uintptr FopenFileChannelProc uintptr FmatchInDirectoryProc uintptr FutimeProc uintptr FlinkProc uintptr FlistVolumesProc uintptr FfileAttrStringsProc uintptr FfileAttrsGetProc uintptr FfileAttrsSetProc uintptr FcreateDirectoryProc uintptr FremoveDirectoryProc uintptr FdeleteFileProc uintptr FcopyFileProc uintptr FrenameFileProc uintptr FcopyDirectoryProc uintptr FlstatProc uintptr FloadFileProc uintptr FgetCwdProc uintptr FchdirProc uintptr } type TTcl_NotifierProcs = struct { FsetTimerProc uintptr FwaitForEventProc uintptr FcreateFileHandlerProc uintptr FdeleteFileHandlerProc uintptr FinitNotifierProc uintptr FfinalizeNotifierProc uintptr FalertNotifierProc uintptr FserviceModeHookProc uintptr } type TTcl_Token = struct { Ftype1 int32 Fstart uintptr Fsize TTcl_Size FnumComponents TTcl_Size } type TTcl_Parse = struct { FcommentStart uintptr FcommentSize TTcl_Size FcommandStart uintptr FcommandSize TTcl_Size FnumWords TTcl_Size FtokenPtr uintptr FnumTokens TTcl_Size FtokensAvailable TTcl_Size FerrorType int32 Fincomplete int32 Fstring1 uintptr Fend uintptr Finterp uintptr Fterm uintptr FstaticTokens [20]TTcl_Token } type TTcl_EncodingType = struct { FencodingName uintptr FtoUtfProc uintptr FfromUtfProc uintptr FfreeProc uintptr FclientData uintptr FnullSize TTcl_Size } type TTcl_UniChar = int32 type TTcl_Config = struct { Fkey uintptr Fvalue uintptr } type TTcl_ArgvInfo = struct { Ftype1 int32 FkeyStr uintptr FsrcPtr uintptr FdstPtr uintptr FhelpStr uintptr FclientData uintptr } type TTclStubHooks = struct { FtclPlatStubs uintptr FtclIntStubs uintptr FtclIntPlatStubs uintptr } type TTclStubs = struct { Fmagic int32 Fhooks uintptr Ftcl_PkgProvideEx uintptr Ftcl_PkgRequireEx uintptr Ftcl_Panic uintptr Ftcl_Alloc uintptr Ftcl_Free uintptr Ftcl_Realloc uintptr Ftcl_DbCkalloc uintptr Ftcl_DbCkfree uintptr Ftcl_DbCkrealloc uintptr Ftcl_CreateFileHandler uintptr Ftcl_DeleteFileHandler uintptr Ftcl_SetTimer uintptr Ftcl_Sleep uintptr Ftcl_WaitForEvent uintptr Ftcl_AppendAllObjTypes uintptr Ftcl_AppendStringsToObj uintptr Ftcl_AppendToObj uintptr Ftcl_ConcatObj uintptr Ftcl_ConvertToType uintptr Ftcl_DbDecrRefCount uintptr Ftcl_DbIncrRefCount uintptr Ftcl_DbIsShared uintptr Freserved22 uintptr Ftcl_DbNewByteArrayObj uintptr Ftcl_DbNewDoubleObj uintptr Ftcl_DbNewListObj uintptr Freserved26 uintptr Ftcl_DbNewObj uintptr Ftcl_DbNewStringObj uintptr Ftcl_DuplicateObj uintptr FtclFreeObj uintptr Ftcl_GetBoolean uintptr Ftcl_GetBooleanFromObj uintptr Ftcl_GetByteArrayFromObj uintptr Ftcl_GetDouble uintptr Ftcl_GetDoubleFromObj uintptr Freserved36 uintptr Ftcl_GetInt uintptr Ftcl_GetIntFromObj uintptr Ftcl_GetLongFromObj uintptr Ftcl_GetObjType uintptr FtclGetStringFromObj uintptr Ftcl_InvalidateStringRep uintptr Ftcl_ListObjAppendList uintptr Ftcl_ListObjAppendElement uintptr FtclListObjGetElements uintptr Ftcl_ListObjIndex uintptr FtclListObjLength uintptr Ftcl_ListObjReplace uintptr Freserved49 uintptr Ftcl_NewByteArrayObj uintptr Ftcl_NewDoubleObj uintptr Freserved52 uintptr Ftcl_NewListObj uintptr Freserved54 uintptr Ftcl_NewObj uintptr Ftcl_NewStringObj uintptr Freserved57 uintptr Ftcl_SetByteArrayLength uintptr Ftcl_SetByteArrayObj uintptr Ftcl_SetDoubleObj uintptr Freserved61 uintptr Ftcl_SetListObj uintptr Freserved63 uintptr Ftcl_SetObjLength uintptr Ftcl_SetStringObj uintptr Freserved66 uintptr Freserved67 uintptr Ftcl_AllowExceptions uintptr Ftcl_AppendElement uintptr Ftcl_AppendResult uintptr Ftcl_AsyncCreate uintptr Ftcl_AsyncDelete uintptr Ftcl_AsyncInvoke uintptr Ftcl_AsyncMark uintptr Ftcl_AsyncReady uintptr Freserved76 uintptr Freserved77 uintptr Ftcl_BadChannelOption uintptr Ftcl_CallWhenDeleted uintptr Ftcl_CancelIdleCall uintptr Ftcl_Close uintptr Ftcl_CommandComplete uintptr Ftcl_Concat uintptr Ftcl_ConvertElement uintptr Ftcl_ConvertCountedElement uintptr Ftcl_CreateAlias uintptr Ftcl_CreateAliasObj uintptr Ftcl_CreateChannel uintptr Ftcl_CreateChannelHandler uintptr Ftcl_CreateCloseHandler uintptr Ftcl_CreateCommand uintptr Ftcl_CreateEventSource uintptr Ftcl_CreateExitHandler uintptr Ftcl_CreateInterp uintptr Freserved95 uintptr Ftcl_CreateObjCommand uintptr Ftcl_CreateChild uintptr Ftcl_CreateTimerHandler uintptr Ftcl_CreateTrace uintptr Ftcl_DeleteAssocData uintptr Ftcl_DeleteChannelHandler uintptr Ftcl_DeleteCloseHandler uintptr Ftcl_DeleteCommand uintptr Ftcl_DeleteCommandFromToken uintptr Ftcl_DeleteEvents uintptr Ftcl_DeleteEventSource uintptr Ftcl_DeleteExitHandler uintptr Ftcl_DeleteHashEntry uintptr Ftcl_DeleteHashTable uintptr Ftcl_DeleteInterp uintptr Ftcl_DetachPids uintptr Ftcl_DeleteTimerHandler uintptr Ftcl_DeleteTrace uintptr Ftcl_DontCallWhenDeleted uintptr Ftcl_DoOneEvent uintptr Ftcl_DoWhenIdle uintptr Ftcl_DStringAppend uintptr Ftcl_DStringAppendElement uintptr Ftcl_DStringEndSublist uintptr Ftcl_DStringFree uintptr Ftcl_DStringGetResult uintptr Ftcl_DStringInit uintptr Ftcl_DStringResult uintptr Ftcl_DStringSetLength uintptr Ftcl_DStringStartSublist uintptr Ftcl_Eof uintptr Ftcl_ErrnoId uintptr Ftcl_ErrnoMsg uintptr Freserved129 uintptr Ftcl_EvalFile uintptr Freserved131 uintptr Ftcl_EventuallyFree uintptr Ftcl_Exit uintptr Ftcl_ExposeCommand uintptr Ftcl_ExprBoolean uintptr Ftcl_ExprBooleanObj uintptr Ftcl_ExprDouble uintptr Ftcl_ExprDoubleObj uintptr Ftcl_ExprLong uintptr Ftcl_ExprLongObj uintptr Ftcl_ExprObj uintptr Ftcl_ExprString uintptr Ftcl_Finalize uintptr Freserved144 uintptr Ftcl_FirstHashEntry uintptr Ftcl_Flush uintptr Freserved147 uintptr Freserved148 uintptr FtclGetAliasObj uintptr Ftcl_GetAssocData uintptr Ftcl_GetChannel uintptr Ftcl_GetChannelBufferSize uintptr Ftcl_GetChannelHandle uintptr Ftcl_GetChannelInstanceData uintptr Ftcl_GetChannelMode uintptr Ftcl_GetChannelName uintptr Ftcl_GetChannelOption uintptr Ftcl_GetChannelType uintptr Ftcl_GetCommandInfo uintptr Ftcl_GetCommandName uintptr Ftcl_GetErrno uintptr Ftcl_GetHostName uintptr Ftcl_GetInterpPath uintptr Ftcl_GetParent uintptr Ftcl_GetNameOfExecutable uintptr Ftcl_GetObjResult uintptr Ftcl_GetOpenFile uintptr Ftcl_GetPathType uintptr Ftcl_Gets uintptr Ftcl_GetsObj uintptr Ftcl_GetServiceMode uintptr Ftcl_GetChild uintptr Ftcl_GetStdChannel uintptr Freserved174 uintptr Freserved175 uintptr Ftcl_GetVar2 uintptr Freserved177 uintptr Freserved178 uintptr Ftcl_HideCommand uintptr Ftcl_Init uintptr Ftcl_InitHashTable uintptr Ftcl_InputBlocked uintptr Ftcl_InputBuffered uintptr Ftcl_InterpDeleted uintptr Ftcl_IsSafe uintptr Ftcl_JoinPath uintptr Ftcl_LinkVar uintptr Freserved188 uintptr Ftcl_MakeFileChannel uintptr Freserved190 uintptr Ftcl_MakeTcpClientChannel uintptr Ftcl_Merge uintptr Ftcl_NextHashEntry uintptr Ftcl_NotifyChannel uintptr Ftcl_ObjGetVar2 uintptr Ftcl_ObjSetVar2 uintptr Ftcl_OpenCommandChannel uintptr Ftcl_OpenFileChannel uintptr Ftcl_OpenTcpClient uintptr Ftcl_OpenTcpServer uintptr Ftcl_Preserve uintptr Ftcl_PrintDouble uintptr Ftcl_PutEnv uintptr Ftcl_PosixError uintptr Ftcl_QueueEvent uintptr Ftcl_Read uintptr Ftcl_ReapDetachedProcs uintptr Ftcl_RecordAndEval uintptr Ftcl_RecordAndEvalObj uintptr Ftcl_RegisterChannel uintptr Ftcl_RegisterObjType uintptr Ftcl_RegExpCompile uintptr Ftcl_RegExpExec uintptr Ftcl_RegExpMatch uintptr Ftcl_RegExpRange uintptr Ftcl_Release uintptr Ftcl_ResetResult uintptr Ftcl_ScanElement uintptr Ftcl_ScanCountedElement uintptr Freserved220 uintptr Ftcl_ServiceAll uintptr Ftcl_ServiceEvent uintptr Ftcl_SetAssocData uintptr Ftcl_SetChannelBufferSize uintptr Ftcl_SetChannelOption uintptr Ftcl_SetCommandInfo uintptr Ftcl_SetErrno uintptr Ftcl_SetErrorCode uintptr Ftcl_SetMaxBlockTime uintptr Freserved230 uintptr Ftcl_SetRecursionLimit uintptr Freserved232 uintptr Ftcl_SetServiceMode uintptr Ftcl_SetObjErrorCode uintptr Ftcl_SetObjResult uintptr Ftcl_SetStdChannel uintptr Freserved237 uintptr Ftcl_SetVar2 uintptr Ftcl_SignalId uintptr Ftcl_SignalMsg uintptr Ftcl_SourceRCFile uintptr FtclSplitList uintptr FtclSplitPath uintptr Freserved244 uintptr Freserved245 uintptr Freserved246 uintptr Freserved247 uintptr Ftcl_TraceVar2 uintptr Ftcl_TranslateFileName uintptr Ftcl_Ungets uintptr Ftcl_UnlinkVar uintptr Ftcl_UnregisterChannel uintptr Freserved253 uintptr Ftcl_UnsetVar2 uintptr Freserved255 uintptr Ftcl_UntraceVar2 uintptr Ftcl_UpdateLinkedVar uintptr Freserved258 uintptr Ftcl_UpVar2 uintptr Ftcl_VarEval uintptr Freserved261 uintptr Ftcl_VarTraceInfo2 uintptr Ftcl_Write uintptr Ftcl_WrongNumArgs uintptr Ftcl_DumpActiveMemory uintptr Ftcl_ValidateAllMemory uintptr Freserved267 uintptr Freserved268 uintptr Ftcl_HashStats uintptr Ftcl_ParseVar uintptr Freserved271 uintptr Ftcl_PkgPresentEx uintptr Freserved273 uintptr Freserved274 uintptr Freserved275 uintptr Freserved276 uintptr Ftcl_WaitPid uintptr Freserved278 uintptr Ftcl_GetVersion uintptr Ftcl_InitMemory uintptr Ftcl_StackChannel uintptr Ftcl_UnstackChannel uintptr Ftcl_GetStackedChannel uintptr Ftcl_SetMainLoop uintptr Ftcl_GetAliasObj uintptr Ftcl_AppendObjToObj uintptr Ftcl_CreateEncoding uintptr Ftcl_CreateThreadExitHandler uintptr Ftcl_DeleteThreadExitHandler uintptr Freserved290 uintptr Ftcl_EvalEx uintptr Ftcl_EvalObjv uintptr Ftcl_EvalObjEx uintptr Ftcl_ExitThread uintptr Ftcl_ExternalToUtf uintptr Ftcl_ExternalToUtfDString uintptr Ftcl_FinalizeThread uintptr Ftcl_FinalizeNotifier uintptr Ftcl_FreeEncoding uintptr Ftcl_GetCurrentThread uintptr Ftcl_GetEncoding uintptr Ftcl_GetEncodingName uintptr Ftcl_GetEncodingNames uintptr Ftcl_GetIndexFromObjStruct uintptr Ftcl_GetThreadData uintptr Ftcl_GetVar2Ex uintptr Ftcl_InitNotifier uintptr Ftcl_MutexLock uintptr Ftcl_MutexUnlock uintptr Ftcl_ConditionNotify uintptr Ftcl_ConditionWait uintptr FtclNumUtfChars uintptr Ftcl_ReadChars uintptr Freserved314 uintptr Freserved315 uintptr Ftcl_SetSystemEncoding uintptr Ftcl_SetVar2Ex uintptr Ftcl_ThreadAlert uintptr Ftcl_ThreadQueueEvent uintptr Ftcl_UniCharAtIndex uintptr Ftcl_UniCharToLower uintptr Ftcl_UniCharToTitle uintptr Ftcl_UniCharToUpper uintptr Ftcl_UniCharToUtf uintptr FtclUtfAtIndex uintptr FtclUtfCharComplete uintptr Ftcl_UtfBackslash uintptr Ftcl_UtfFindFirst uintptr Ftcl_UtfFindLast uintptr FtclUtfNext uintptr FtclUtfPrev uintptr Ftcl_UtfToExternal uintptr Ftcl_UtfToExternalDString uintptr Ftcl_UtfToLower uintptr Ftcl_UtfToTitle uintptr Ftcl_UtfToChar16 uintptr Ftcl_UtfToUpper uintptr Ftcl_WriteChars uintptr Ftcl_WriteObj uintptr Ftcl_GetString uintptr Freserved341 uintptr Freserved342 uintptr Ftcl_AlertNotifier uintptr Ftcl_ServiceModeHook uintptr Ftcl_UniCharIsAlnum uintptr Ftcl_UniCharIsAlpha uintptr Ftcl_UniCharIsDigit uintptr Ftcl_UniCharIsLower uintptr Ftcl_UniCharIsSpace uintptr Ftcl_UniCharIsUpper uintptr Ftcl_UniCharIsWordChar uintptr Ftcl_Char16Len uintptr Freserved353 uintptr Ftcl_Char16ToUtfDString uintptr Ftcl_UtfToChar16DString uintptr Ftcl_GetRegExpFromObj uintptr Freserved357 uintptr Ftcl_FreeParse uintptr Ftcl_LogCommandInfo uintptr Ftcl_ParseBraces uintptr Ftcl_ParseCommand uintptr Ftcl_ParseExpr uintptr Ftcl_ParseQuotedString uintptr Ftcl_ParseVarName uintptr Ftcl_GetCwd uintptr Ftcl_Chdir uintptr Ftcl_Access uintptr Ftcl_Stat uintptr FtclUtfNcmp uintptr FtclUtfNcasecmp uintptr Ftcl_StringCaseMatch uintptr Ftcl_UniCharIsControl uintptr Ftcl_UniCharIsGraph uintptr Ftcl_UniCharIsPrint uintptr Ftcl_UniCharIsPunct uintptr Ftcl_RegExpExecObj uintptr Ftcl_RegExpGetInfo uintptr Ftcl_NewUnicodeObj uintptr Ftcl_SetUnicodeObj uintptr FtclGetCharLength uintptr FtclGetUniChar uintptr Freserved382 uintptr FtclGetRange uintptr Ftcl_AppendUnicodeToObj uintptr Ftcl_RegExpMatchObj uintptr Ftcl_SetNotifier uintptr Ftcl_GetAllocMutex uintptr Ftcl_GetChannelNames uintptr Ftcl_GetChannelNamesEx uintptr Ftcl_ProcObjCmd uintptr Ftcl_ConditionFinalize uintptr Ftcl_MutexFinalize uintptr Ftcl_CreateThread uintptr Ftcl_ReadRaw uintptr Ftcl_WriteRaw uintptr Ftcl_GetTopChannel uintptr Ftcl_ChannelBuffered uintptr Ftcl_ChannelName uintptr Ftcl_ChannelVersion uintptr Ftcl_ChannelBlockModeProc uintptr Freserved401 uintptr Ftcl_ChannelClose2Proc uintptr Ftcl_ChannelInputProc uintptr Ftcl_ChannelOutputProc uintptr Freserved405 uintptr Ftcl_ChannelSetOptionProc uintptr Ftcl_ChannelGetOptionProc uintptr Ftcl_ChannelWatchProc uintptr Ftcl_ChannelGetHandleProc uintptr Ftcl_ChannelFlushProc uintptr Ftcl_ChannelHandlerProc uintptr Ftcl_JoinThread uintptr Ftcl_IsChannelShared uintptr Ftcl_IsChannelRegistered uintptr Ftcl_CutChannel uintptr Ftcl_SpliceChannel uintptr Ftcl_ClearChannelHandlers uintptr Ftcl_IsChannelExisting uintptr Freserved419 uintptr Freserved420 uintptr Freserved421 uintptr Freserved422 uintptr Ftcl_InitCustomHashTable uintptr Ftcl_InitObjHashTable uintptr Ftcl_CommandTraceInfo uintptr Ftcl_TraceCommand uintptr Ftcl_UntraceCommand uintptr Ftcl_AttemptAlloc uintptr Ftcl_AttemptDbCkalloc uintptr Ftcl_AttemptRealloc uintptr Ftcl_AttemptDbCkrealloc uintptr Ftcl_AttemptSetObjLength uintptr Ftcl_GetChannelThread uintptr FtclGetUnicodeFromObj uintptr Freserved435 uintptr Freserved436 uintptr Ftcl_SubstObj uintptr Ftcl_DetachChannel uintptr Ftcl_IsStandardChannel uintptr Ftcl_FSCopyFile uintptr Ftcl_FSCopyDirectory uintptr Ftcl_FSCreateDirectory uintptr Ftcl_FSDeleteFile uintptr Ftcl_FSLoadFile uintptr Ftcl_FSMatchInDirectory uintptr Ftcl_FSLink uintptr Ftcl_FSRemoveDirectory uintptr Ftcl_FSRenameFile uintptr Ftcl_FSLstat uintptr Ftcl_FSUtime uintptr Ftcl_FSFileAttrsGet uintptr Ftcl_FSFileAttrsSet uintptr Ftcl_FSFileAttrStrings uintptr Ftcl_FSStat uintptr Ftcl_FSAccess uintptr Ftcl_FSOpenFileChannel uintptr Ftcl_FSGetCwd uintptr Ftcl_FSChdir uintptr Ftcl_FSConvertToPathType uintptr Ftcl_FSJoinPath uintptr FtclFSSplitPath uintptr Ftcl_FSEqualPaths uintptr Ftcl_FSGetNormalizedPath uintptr Ftcl_FSJoinToPath uintptr Ftcl_FSGetInternalRep uintptr Ftcl_FSGetTranslatedPath uintptr Ftcl_FSEvalFile uintptr Ftcl_FSNewNativePath uintptr Ftcl_FSGetNativePath uintptr Ftcl_FSFileSystemInfo uintptr Ftcl_FSPathSeparator uintptr Ftcl_FSListVolumes uintptr Ftcl_FSRegister uintptr Ftcl_FSUnregister uintptr Ftcl_FSData uintptr Ftcl_FSGetTranslatedStringPath uintptr Ftcl_FSGetFileSystemForPath uintptr Ftcl_FSGetPathType uintptr Ftcl_OutputBuffered uintptr Ftcl_FSMountsChanged uintptr Ftcl_EvalTokensStandard uintptr Ftcl_GetTime uintptr Ftcl_CreateObjTrace uintptr Ftcl_GetCommandInfoFromToken uintptr Ftcl_SetCommandInfoFromToken uintptr Ftcl_DbNewWideIntObj uintptr Ftcl_GetWideIntFromObj uintptr Ftcl_NewWideIntObj uintptr Ftcl_SetWideIntObj uintptr Ftcl_AllocStatBuf uintptr Ftcl_Seek uintptr Ftcl_Tell uintptr Ftcl_ChannelWideSeekProc uintptr Ftcl_DictObjPut uintptr Ftcl_DictObjGet uintptr Ftcl_DictObjRemove uintptr FtclDictObjSize uintptr Ftcl_DictObjFirst uintptr Ftcl_DictObjNext uintptr Ftcl_DictObjDone uintptr Ftcl_DictObjPutKeyList uintptr Ftcl_DictObjRemoveKeyList uintptr Ftcl_NewDictObj uintptr Ftcl_DbNewDictObj uintptr Ftcl_RegisterConfig uintptr Ftcl_CreateNamespace uintptr Ftcl_DeleteNamespace uintptr Ftcl_AppendExportList uintptr Ftcl_Export uintptr Ftcl_Import uintptr Ftcl_ForgetImport uintptr Ftcl_GetCurrentNamespace uintptr Ftcl_GetGlobalNamespace uintptr Ftcl_FindNamespace uintptr Ftcl_FindCommand uintptr Ftcl_GetCommandFromObj uintptr Ftcl_GetCommandFullName uintptr Ftcl_FSEvalFileEx uintptr Freserved519 uintptr Ftcl_LimitAddHandler uintptr Ftcl_LimitRemoveHandler uintptr Ftcl_LimitReady uintptr Ftcl_LimitCheck uintptr Ftcl_LimitExceeded uintptr Ftcl_LimitSetCommands uintptr Ftcl_LimitSetTime uintptr Ftcl_LimitSetGranularity uintptr Ftcl_LimitTypeEnabled uintptr Ftcl_LimitTypeExceeded uintptr Ftcl_LimitTypeSet uintptr Ftcl_LimitTypeReset uintptr Ftcl_LimitGetCommands uintptr Ftcl_LimitGetTime uintptr Ftcl_LimitGetGranularity uintptr Ftcl_SaveInterpState uintptr Ftcl_RestoreInterpState uintptr Ftcl_DiscardInterpState uintptr Ftcl_SetReturnOptions uintptr Ftcl_GetReturnOptions uintptr Ftcl_IsEnsemble uintptr Ftcl_CreateEnsemble uintptr Ftcl_FindEnsemble uintptr Ftcl_SetEnsembleSubcommandList uintptr Ftcl_SetEnsembleMappingDict uintptr Ftcl_SetEnsembleUnknownHandler uintptr Ftcl_SetEnsembleFlags uintptr Ftcl_GetEnsembleSubcommandList uintptr Ftcl_GetEnsembleMappingDict uintptr Ftcl_GetEnsembleUnknownHandler uintptr Ftcl_GetEnsembleFlags uintptr Ftcl_GetEnsembleNamespace uintptr Ftcl_SetTimeProc uintptr Ftcl_QueryTimeProc uintptr Ftcl_ChannelThreadActionProc uintptr Ftcl_NewBignumObj uintptr Ftcl_DbNewBignumObj uintptr Ftcl_SetBignumObj uintptr Ftcl_GetBignumFromObj uintptr Ftcl_TakeBignumFromObj uintptr Ftcl_TruncateChannel uintptr Ftcl_ChannelTruncateProc uintptr Ftcl_SetChannelErrorInterp uintptr Ftcl_GetChannelErrorInterp uintptr Ftcl_SetChannelError uintptr Ftcl_GetChannelError uintptr Ftcl_InitBignumFromDouble uintptr Ftcl_GetNamespaceUnknownHandler uintptr Ftcl_SetNamespaceUnknownHandler uintptr Ftcl_GetEncodingFromObj uintptr Ftcl_GetEncodingSearchPath uintptr Ftcl_SetEncodingSearchPath uintptr Ftcl_GetEncodingNameFromEnvironment uintptr Ftcl_PkgRequireProc uintptr Ftcl_AppendObjToErrorInfo uintptr Ftcl_AppendLimitedToObj uintptr Ftcl_Format uintptr Ftcl_AppendFormatToObj uintptr Ftcl_ObjPrintf uintptr Ftcl_AppendPrintfToObj uintptr Ftcl_CancelEval uintptr Ftcl_Canceled uintptr Ftcl_CreatePipe uintptr Ftcl_NRCreateCommand uintptr Ftcl_NREvalObj uintptr Ftcl_NREvalObjv uintptr Ftcl_NRCmdSwap uintptr Ftcl_NRAddCallback uintptr Ftcl_NRCallObjProc uintptr Ftcl_GetFSDeviceFromStat uintptr Ftcl_GetFSInodeFromStat uintptr Ftcl_GetModeFromStat uintptr Ftcl_GetLinkCountFromStat uintptr Ftcl_GetUserIdFromStat uintptr Ftcl_GetGroupIdFromStat uintptr Ftcl_GetDeviceTypeFromStat uintptr Ftcl_GetAccessTimeFromStat uintptr Ftcl_GetModificationTimeFromStat uintptr Ftcl_GetChangeTimeFromStat uintptr Ftcl_GetSizeFromStat uintptr Ftcl_GetBlocksFromStat uintptr Ftcl_GetBlockSizeFromStat uintptr Ftcl_SetEnsembleParameterList uintptr Ftcl_GetEnsembleParameterList uintptr FtclParseArgsObjv uintptr Ftcl_GetErrorLine uintptr Ftcl_SetErrorLine uintptr Ftcl_TransferResult uintptr Ftcl_InterpActive uintptr Ftcl_BackgroundException uintptr Ftcl_ZlibDeflate uintptr Ftcl_ZlibInflate uintptr Ftcl_ZlibCRC32 uintptr Ftcl_ZlibAdler32 uintptr Ftcl_ZlibStreamInit uintptr Ftcl_ZlibStreamGetCommandName uintptr Ftcl_ZlibStreamEof uintptr Ftcl_ZlibStreamChecksum uintptr Ftcl_ZlibStreamPut uintptr Ftcl_ZlibStreamGet uintptr Ftcl_ZlibStreamClose uintptr Ftcl_ZlibStreamReset uintptr Ftcl_SetStartupScript uintptr Ftcl_GetStartupScript uintptr Ftcl_CloseEx uintptr Ftcl_NRExprObj uintptr Ftcl_NRSubstObj uintptr Ftcl_LoadFile uintptr Ftcl_FindSymbol uintptr Ftcl_FSUnloadFile uintptr Ftcl_ZlibStreamSetCompressionDictionary uintptr Ftcl_OpenTcpServerEx uintptr FtclZipfs_Mount uintptr FtclZipfs_Unmount uintptr FtclZipfs_TclLibrary uintptr FtclZipfs_MountBuffer uintptr Ftcl_FreeInternalRep uintptr Ftcl_InitStringRep uintptr Ftcl_FetchInternalRep uintptr Ftcl_StoreInternalRep uintptr Ftcl_HasStringRep uintptr Ftcl_IncrRefCount uintptr Ftcl_DecrRefCount uintptr Ftcl_IsShared uintptr Ftcl_LinkArray uintptr Ftcl_GetIntForIndex uintptr Ftcl_UtfToUniChar uintptr Ftcl_UniCharToUtfDString uintptr Ftcl_UtfToUniCharDString uintptr FtclGetBytesFromObj uintptr Ftcl_GetBytesFromObj uintptr Ftcl_GetStringFromObj uintptr Ftcl_GetUnicodeFromObj uintptr Ftcl_GetSizeIntFromObj uintptr Ftcl_UtfCharComplete uintptr Ftcl_UtfNext uintptr Ftcl_UtfPrev uintptr Ftcl_FSTildeExpand uintptr Ftcl_ExternalToUtfDStringEx uintptr Ftcl_UtfToExternalDStringEx uintptr Ftcl_AsyncMarkFromSignal uintptr Ftcl_ListObjGetElements uintptr Ftcl_ListObjLength uintptr Ftcl_DictObjSize uintptr Ftcl_SplitList uintptr Ftcl_SplitPath uintptr Ftcl_FSSplitPath uintptr Ftcl_ParseArgsObjv uintptr Ftcl_UniCharLen uintptr Ftcl_NumUtfChars uintptr Ftcl_GetCharLength uintptr Ftcl_UtfAtIndex uintptr Ftcl_GetRange uintptr Ftcl_GetUniChar uintptr Ftcl_GetBool uintptr Ftcl_GetBoolFromObj uintptr Ftcl_CreateObjCommand2 uintptr Ftcl_CreateObjTrace2 uintptr Ftcl_NRCreateCommand2 uintptr Ftcl_NRCallObjProc2 uintptr Ftcl_GetNumberFromObj uintptr Ftcl_GetNumber uintptr Ftcl_RemoveChannelMode uintptr Ftcl_GetEncodingNulLength uintptr Ftcl_GetWideUIntFromObj uintptr Ftcl_DStringToObj uintptr Ftcl_UtfNcmp uintptr Ftcl_UtfNcasecmp uintptr Ftcl_NewWideUIntObj uintptr Ftcl_SetWideUIntObj uintptr FtclUnusedStubEntry uintptr } type TTclPlatStubs = struct { Fmagic int32 Fhooks uintptr Freserved0 uintptr Ftcl_MacOSXOpenVersionedBundleResources uintptr Ftcl_MacOSXNotifierAddRunLoopMode uintptr Ftcl_WinConvertError uintptr } type Tdiv_t = struct { Fquot int32 Frem int32 } type Tldiv_t = struct { Fquot int64 Frem int64 } type Tlldiv_t = struct { Fquot int64 Frem int64 } type Tlconv = struct { Fdecimal_point uintptr Fthousands_sep uintptr Fgrouping uintptr Fint_curr_symbol uintptr Fcurrency_symbol uintptr Fmon_decimal_point uintptr Fmon_thousands_sep uintptr Fmon_grouping uintptr Fpositive_sign uintptr Fnegative_sign uintptr Fint_frac_digits uint8 Ffrac_digits uint8 Fp_cs_precedes uint8 Fp_sep_by_space uint8 Fn_cs_precedes uint8 Fn_sep_by_space uint8 Fp_sign_posn uint8 Fn_sign_posn uint8 Fint_p_cs_precedes uint8 Fint_p_sep_by_space uint8 Fint_n_cs_precedes uint8 Fint_n_sep_by_space uint8 Fint_p_sign_posn uint8 Fint_n_sign_posn uint8 } type TTcl_ResolvedVarInfo1 = struct { FfetchProc uintptr FdeleteProc uintptr } type TTcl_ResolvedVarInfo = struct { FfetchProc uintptr FdeleteProc uintptr } type TTcl_ResolverInfo = struct { FcmdResProc uintptr FvarResProc uintptr FcompiledVarResProc uintptr } type TNamespacePathEntry = struct { FnsPtr uintptr FcreatorNsPtr uintptr FprevPtr uintptr FnextPtr uintptr } type TTclVarHashTable = struct { Ftable TTcl_HashTable FnsPtr uintptr FarrayPtr uintptr } type TNamespace = struct { Fname uintptr FfullName uintptr FclientData uintptr FdeleteProc uintptr FparentPtr uintptr FchildTable TTcl_HashTable FnsId Tsize_t Finterp uintptr Fflags int32 FactivationCount TTcl_Size FrefCount TTcl_Size FcmdTable TTcl_HashTable FvarTable TTclVarHashTable FexportArrayPtr uintptr FnumExportPatterns TTcl_Size FmaxExportPatterns TTcl_Size FcmdRefEpoch TTcl_Size FresolverEpoch TTcl_Size FcmdResProc uintptr FvarResProc uintptr FcompiledVarResProc uintptr FexportLookupEpoch TTcl_Size Fensembles uintptr FunknownHandlerPtr uintptr FcommandPathLength TTcl_Size FcommandPathArray uintptr FcommandPathSourceList uintptr FearlyDeleteProc uintptr } type TNamespacePathEntry1 = struct { FnsPtr uintptr FcreatorNsPtr uintptr FprevPtr uintptr FnextPtr uintptr } type TEnsembleConfig = struct { FnsPtr uintptr Ftoken TTcl_Command Fepoch TTcl_Size FsubcommandArrayPtr uintptr FsubcommandTable TTcl_HashTable Fnext uintptr Fflags int32 FsubcommandDict uintptr FsubcmdList uintptr FunknownHandler uintptr FparameterList uintptr FnumParameters TTcl_Size } type TVarTrace = struct { FtraceProc uintptr FclientData uintptr Fflags int32 FnextPtr uintptr } type TCommandTrace = struct { FtraceProc uintptr FclientData uintptr Fflags int32 FnextPtr uintptr FrefCount TTcl_Size } type TActiveCommandTrace = struct { FcmdPtr uintptr FnextPtr uintptr FnextTracePtr uintptr FreverseScan int32 } type TActiveVarTrace = struct { FvarPtr uintptr FnextPtr uintptr FnextTracePtr uintptr } type TVar = struct { Fflags int32 Fvalue struct { FtablePtr [0]uintptr FlinkPtr [0]uintptr FobjPtr uintptr } } type TVarInHash = struct { Fvar1 TVar FrefCount TTcl_Size Fentry TTcl_HashEntry } type TCommand1 = struct { FhPtr uintptr FnsPtr uintptr FrefCount TTcl_Size FcmdEpoch TTcl_Size FcompileProc uintptr FobjProc uintptr FobjClientData uintptr Fproc uintptr FclientData uintptr FdeleteProc uintptr FdeleteData uintptr Fflags int32 FimportRefPtr uintptr FtracePtr uintptr FnreProc uintptr } type TCompiledLocal = struct { FnextPtr uintptr FnameLength TTcl_Size FframeIndex TTcl_Size FdefValuePtr uintptr FresolveInfo uintptr Fflags int32 } type TProc = struct { FiPtr uintptr FrefCount TTcl_Size FcmdPtr uintptr FbodyPtr uintptr FnumArgs TTcl_Size FnumCompiledLocals TTcl_Size FfirstLocalPtr uintptr FlastLocalPtr uintptr } type TTrace = struct { Flevel TTcl_Size Fproc uintptr FclientData uintptr FnextPtr uintptr Fflags int32 FdelProc uintptr } type TActiveInterpTrace = struct { FnextPtr uintptr FnextTracePtr uintptr FreverseScan int32 } type TAssocData = struct { Fproc uintptr FclientData uintptr } type TLocalCache = struct { FrefCount TTcl_Size FnumVars TTcl_Size FvarName0 uintptr } type TCallFrame = struct { FnsPtr uintptr FisProcCallFrame int32 Fobjc TTcl_Size Fobjv uintptr FcallerPtr uintptr FcallerVarPtr uintptr Flevel TTcl_Size FprocPtr uintptr FvarTablePtr uintptr FnumCompiledLocals TTcl_Size FcompiledLocals uintptr FclientData uintptr FlocalCachePtr uintptr FtailcallPtr uintptr } type TCmdFrame = struct { Ftype1 int32 Flevel int32 Fline uintptr Fnline TTcl_Size FframePtr uintptr FnextPtr uintptr Fdata struct { Ftebc [0]struct { FcodePtr uintptr Fpc uintptr } Feval struct { Fpath uintptr } F__ccgo_pad2 [8]byte } FcmdObj uintptr Fcmd uintptr Flen1 TTcl_Size Flitarg uintptr } type TCFWord = struct { FframePtr uintptr Fword TTcl_Size FrefCount TTcl_Size } type TCFWordBC = struct { FframePtr uintptr Fpc TTcl_Size Fword TTcl_Size FprevPtr uintptr FnextPtr uintptr Fobj uintptr } type TContLineLoc = struct { Fnum TTcl_Size } type TExtraFrameInfoField = struct { Fname uintptr Fproc uintptr FclientData uintptr } type TExtraFrameInfo = struct { Flength TTcl_Size Ffields [2]TExtraFrameInfoField } type TTclHandle = uintptr type TExecStack = struct { FprevPtr uintptr FnextPtr uintptr FmarkerPtr uintptr FendPtr uintptr FtosPtr uintptr } type TCorContext = struct { FframePtr uintptr FvarFramePtr uintptr FcmdFramePtr uintptr FlineLABCPtr uintptr } type TCoroutineData = struct { FcmdPtr uintptr FeePtr uintptr FcallerEEPtr uintptr Fcaller TCorContext Frunning TCorContext FlineLABCPtr uintptr FstackLevel uintptr FauxNumLevels TTcl_Size Fnargs TTcl_Size FyieldPtr uintptr } type TExecEnv = struct { FexecStackPtr uintptr Fconstants [2]uintptr Finterp uintptr FcallbackPtr uintptr FcorPtr uintptr Frewind int32 } type TLiteralEntry = struct { FnextPtr uintptr FobjPtr uintptr FrefCount TTcl_Size FnsPtr uintptr } type TLiteralTable = struct { Fbuckets uintptr FstaticBuckets [4]uintptr FnumBuckets Tsize_t FnumEntries Tsize_t FrebuildSize Tsize_t Fmask Tsize_t } type TEnsembleImplMap = struct { Fname uintptr Fproc uintptr FcompileProc uintptr FnreProc uintptr FclientData uintptr Funsafe int32 } type TImportRef = struct { FimportedCmdPtr uintptr FnextPtr uintptr } type TImportedCmdData = struct { FrealCmdPtr uintptr FselfPtr uintptr } type TCommand = struct { FhPtr uintptr FnsPtr uintptr FrefCount TTcl_Size FcmdEpoch TTcl_Size FcompileProc uintptr FobjProc uintptr FobjClientData uintptr Fproc uintptr FclientData uintptr FdeleteProc uintptr FdeleteData uintptr Fflags int32 FimportRefPtr uintptr FtracePtr uintptr FnreProc uintptr } type TResolverScheme = struct { Fname uintptr FcmdResProc uintptr FvarResProc uintptr FcompiledVarResProc uintptr FnextPtr uintptr } type PkgPreferOptions = int32 const PKG_PREFER_LATEST = 0 const PKG_PREFER_STABLE = 1 type TAllocCache = struct { FnextPtr uintptr Fowner TTcl_ThreadId FfirstObjPtr uintptr FnumObjects Tsize_t } type TInterp = struct { FlegacyResult uintptr FlegacyFreeProc uintptr FerrorLine int32 FstubTable uintptr Fhandle TTclHandle FglobalNsPtr uintptr FhiddenCmdTablePtr uintptr FinterpInfo uintptr Foptimizer uintptr FnumLevels TTcl_Size FmaxNestingDepth TTcl_Size FframePtr uintptr FvarFramePtr uintptr FactiveVarTracePtr uintptr FreturnCode int32 FrootFramePtr uintptr FlookupNsPtr uintptr FpackageTable TTcl_HashTable FpackageUnknown uintptr FcmdCount TTcl_Size FevalFlags int32 FliteralTable TLiteralTable FcompileEpoch TTcl_Size FcompiledProcPtr uintptr FresolverPtr uintptr FscriptFile uintptr Fflags int32 FrandSeed int64 FtracePtr uintptr FassocData uintptr FexecEnvPtr uintptr FemptyObjPtr uintptr FobjResultPtr uintptr FthreadId TTcl_ThreadId FactiveCmdTracePtr uintptr FactiveInterpTracePtr uintptr FtracesForbiddingInline TTcl_Size FreturnOpts uintptr FerrorInfo uintptr FeiVar uintptr FerrorCode uintptr FecVar uintptr FreturnLevel int32 Flimit struct { Factive int32 FgranularityTicker int32 Fexceeded int32 FcmdCount TTcl_Size FcmdHandlers uintptr FcmdGranularity int32 Ftime TTcl_Time FtimeHandlers uintptr FtimeGranularity int32 FtimeEvent TTcl_TimerToken Fcallbacks TTcl_HashTable } FensembleRewrite struct { FsourceObjs uintptr FnumRemovedObjs TTcl_Size FnumInsertedObjs TTcl_Size } FchanMsg uintptr FcmdFramePtr uintptr FinvokeCmdFramePtr uintptr FinvokeWord int32 FlinePBodyPtr uintptr FlineBCPtr uintptr FlineLABCPtr uintptr FlineLAPtr uintptr FscriptCLLocPtr uintptr FpackagePrefer int32 FvarTraces TTcl_HashTable FvarSearches TTcl_HashTable FallocCache uintptr FpendingObjDataPtr uintptr FasyncReadyPtr uintptr FobjectFoundation uintptr FdeferredCallbacks uintptr FasyncCancel TTcl_AsyncHandler FasyncCancelMsg uintptr FerrorStack uintptr FupLiteral uintptr FcallLiteral uintptr FinnerLiteral uintptr FinnerContext uintptr FresetErrorStack int32 } type TTclMaxAlignment = struct { Funalign [8]uint8 Faligned struct { FmaxAlignDouble [0]float64 FmaxAlignPointer [0]uintptr FmaxAlignLongLong int64 } } type TTclPlatformType = int32 const TCL_PLATFORM_UNIX = 0 const TCL_PLATFORM_WINDOWS = 2 type TTclEolTranslation = int32 type TclEolTranslation = int32 const TCL_TRANSLATE_AUTO = 0 const TCL_TRANSLATE_CR = 1 const TCL_TRANSLATE_LF = 2 const TCL_TRANSLATE_CRLF = 3 type TListStore = struct { FfirstUsed TTcl_Size FnumUsed TTcl_Size FnumAllocated TTcl_Size FrefCount Tsize_t Fflags int32 } type TListSpan = struct { FspanStart TTcl_Size FspanLength TTcl_Size FrefCount Tsize_t } type TListRep = struct { FstorePtr uintptr FspanPtr uintptr } type TTclFileAttrProcs = struct { FgetProc uintptr FsetProc uintptr } type TTclFile = uintptr type TTcl_PathPart = int32 type Tcl_PathPart = int32 const TCL_PATH_DIRNAME = 0 const TCL_PATH_TAIL = 1 const TCL_PATH_EXTENSION = 2 const TCL_PATH_ROOT = 3 type TProcessGlobalValue = struct { Fepoch TTcl_Size FnumBytes Tsize_t Fvalue uintptr Fencoding TTcl_Encoding Fproc uintptr Fmutex TTcl_Mutex Fkey TTcl_ThreadDataKey } type CheckEmptyStringResult = int32 const TCL_EMPTYSTRING_UNKNOWN = -1 const TCL_EMPTYSTRING_NO = 0 const TCL_EMPTYSTRING_YES = 1 type TForIterData = struct { Fcond uintptr Fbody uintptr Fnext uintptr Fmsg uintptr Fword TTcl_Size } type TmemCmpFn_t = uintptr type TTclProcessWaitStatus = int32 type TclProcessWaitStatus = int32 const TCL_PROCESS_ERROR = -1 const TCL_PROCESS_UNCHANGED = 0 const TCL_PROCESS_EXITED = 1 const TCL_PROCESS_SIGNALED = 2 const TCL_PROCESS_STOPPED = 3 const TCL_PROCESS_UNKNOWN_STATUS = 4 type TNRE_callback = struct { FprocPtr uintptr Fdata [4]uintptr FnextPtr uintptr } type TTclIntStubs = struct { Fmagic int32 Fhooks uintptr Freserved0 uintptr Freserved1 uintptr Freserved2 uintptr FtclAllocateFreeObjects uintptr Freserved4 uintptr FtclCleanupChildren uintptr FtclCleanupCommand uintptr FtclCopyAndCollapse uintptr Freserved8 uintptr FtclCreatePipeline uintptr FtclCreateProc uintptr FtclDeleteCompiledLocalVars uintptr FtclDeleteVars uintptr Freserved13 uintptr FtclDumpMemoryInfo uintptr Freserved15 uintptr FtclExprFloatError uintptr Freserved17 uintptr Freserved18 uintptr Freserved19 uintptr Freserved20 uintptr Freserved21 uintptr FtclFindElement uintptr FtclFindProc uintptr FtclFormatInt uintptr FtclFreePackageInfo uintptr Freserved26 uintptr Freserved27 uintptr FtclpGetDefaultStdChannel uintptr Freserved29 uintptr Freserved30 uintptr FtclGetExtension uintptr FtclGetFrame uintptr Freserved33 uintptr Freserved34 uintptr Freserved35 uintptr Freserved36 uintptr Freserved37 uintptr FtclGetNamespaceForQualName uintptr FtclGetObjInterpProc uintptr FtclGetOpenMode uintptr FtclGetOriginalCommand uintptr FtclpGetUserHome uintptr FtclGetObjInterpProc2 uintptr Freserved44 uintptr FtclHideUnsafeCommands uintptr FtclInExit uintptr Freserved47 uintptr Freserved48 uintptr Freserved49 uintptr Freserved50 uintptr FtclInterpInit uintptr Freserved52 uintptr Freserved53 uintptr Freserved54 uintptr FtclIsProc uintptr Freserved56 uintptr Freserved57 uintptr FtclLookupVar uintptr Freserved59 uintptr FtclNeedSpace uintptr FtclNewProcBodyObj uintptr FtclObjCommandComplete uintptr Freserved63 uintptr FtclObjInvoke uintptr Freserved65 uintptr Freserved66 uintptr Freserved67 uintptr Freserved68 uintptr FtclpAlloc uintptr Freserved70 uintptr Freserved71 uintptr Freserved72 uintptr Freserved73 uintptr FtclpFree uintptr FtclpGetClicks uintptr FtclpGetSeconds uintptr Freserved77 uintptr Freserved78 uintptr Freserved79 uintptr Freserved80 uintptr FtclpRealloc uintptr Freserved82 uintptr Freserved83 uintptr Freserved84 uintptr Freserved85 uintptr Freserved86 uintptr Freserved87 uintptr Freserved88 uintptr FtclPreventAliasLoop uintptr Freserved90 uintptr FtclProcCleanupProc uintptr FtclProcCompileProc uintptr FtclProcDeleteProc uintptr Freserved94 uintptr Freserved95 uintptr FtclRenameCommand uintptr FtclResetShadowedCmdRefs uintptr FtclServiceIdle uintptr Freserved99 uintptr Freserved100 uintptr Freserved101 uintptr FtclSetupEnv uintptr FtclSockGetPort uintptr Freserved104 uintptr Freserved105 uintptr Freserved106 uintptr Freserved107 uintptr FtclTeardownNamespace uintptr FtclUpdateReturnInfo uintptr FtclSockMinimumBuffers uintptr Ftcl_AddInterpResolvers uintptr Freserved112 uintptr Freserved113 uintptr Freserved114 uintptr Freserved115 uintptr Freserved116 uintptr Freserved117 uintptr Ftcl_GetInterpResolvers uintptr Ftcl_GetNamespaceResolvers uintptr Ftcl_FindNamespaceVar uintptr Freserved121 uintptr Freserved122 uintptr Freserved123 uintptr Freserved124 uintptr Freserved125 uintptr Ftcl_GetVariableFullName uintptr Freserved127 uintptr Ftcl_PopCallFrame uintptr Ftcl_PushCallFrame uintptr Ftcl_RemoveInterpResolvers uintptr Ftcl_SetNamespaceResolvers uintptr Freserved132 uintptr Freserved133 uintptr Freserved134 uintptr Freserved135 uintptr Freserved136 uintptr Freserved137 uintptr FtclGetEnv uintptr Freserved139 uintptr Freserved140 uintptr FtclpGetCwd uintptr FtclSetByteCodeFromAny uintptr FtclAddLiteralObj uintptr FtclHideLiteral uintptr FtclGetAuxDataType uintptr FtclHandleCreate uintptr FtclHandleFree uintptr FtclHandlePreserve uintptr FtclHandleRelease uintptr FtclRegAbout uintptr FtclRegExpRangeUniChar uintptr Freserved152 uintptr Freserved153 uintptr Freserved154 uintptr Freserved155 uintptr FtclRegError uintptr FtclVarTraceExists uintptr Freserved158 uintptr Freserved159 uintptr Freserved160 uintptr FtclChannelTransform uintptr FtclChannelEventScriptInvoker uintptr FtclGetInstructionTable uintptr FtclExpandCodeArray uintptr FtclpSetInitialEncodings uintptr FtclListObjSetElement uintptr Freserved167 uintptr Freserved168 uintptr FtclpUtfNcmp2 uintptr FtclCheckInterpTraces uintptr FtclCheckExecutionTraces uintptr FtclInThreadExit uintptr FtclUniCharMatch uintptr Freserved174 uintptr FtclCallVarTraces uintptr FtclCleanupVar uintptr FtclVarErrMsg uintptr Freserved178 uintptr Freserved179 uintptr Freserved180 uintptr Freserved181 uintptr Freserved182 uintptr Freserved183 uintptr Freserved184 uintptr Freserved185 uintptr Freserved186 uintptr Freserved187 uintptr Freserved188 uintptr Freserved189 uintptr Freserved190 uintptr Freserved191 uintptr Freserved192 uintptr Freserved193 uintptr Freserved194 uintptr Freserved195 uintptr Freserved196 uintptr Freserved197 uintptr FtclObjGetFrame uintptr Freserved199 uintptr FtclpObjRemoveDirectory uintptr FtclpObjCopyDirectory uintptr FtclpObjCreateDirectory uintptr FtclpObjDeleteFile uintptr FtclpObjCopyFile uintptr FtclpObjRenameFile uintptr FtclpObjStat uintptr FtclpObjAccess uintptr FtclpOpenFileChannel uintptr Freserved209 uintptr Freserved210 uintptr Freserved211 uintptr FtclpFindExecutable uintptr FtclGetObjNameOfExecutable uintptr FtclSetObjNameOfExecutable uintptr FtclStackAlloc uintptr FtclStackFree uintptr FtclPushStackFrame uintptr FtclPopStackFrame uintptr FtclpCreateTemporaryDirectory uintptr Freserved220 uintptr FtclListTestObj uintptr FtclListObjValidate uintptr FtclGetCStackPtr uintptr FtclGetPlatform uintptr FtclTraceDictPath uintptr FtclObjBeingDeleted uintptr FtclSetNsPath uintptr Freserved228 uintptr FtclPtrMakeUpvar uintptr FtclObjLookupVar uintptr FtclGetNamespaceFromObj uintptr FtclEvalObjEx uintptr FtclGetSrcInfoForPc uintptr FtclVarHashCreateVar uintptr FtclInitVarHashTable uintptr Freserved236 uintptr FtclResetCancellation uintptr FtclNRInterpProc uintptr FtclNRInterpProcCore uintptr FtclNRRunCallbacks uintptr FtclNREvalObjEx uintptr FtclNREvalObjv uintptr FtclDbDumpActiveObjects uintptr FtclGetNamespaceChildTable uintptr FtclGetNamespaceCommandTable uintptr FtclInitRewriteEnsemble uintptr FtclResetRewriteEnsemble uintptr FtclCopyChannel uintptr FtclDoubleDigits uintptr FtclSetChildCancelFlags uintptr FtclRegisterLiteral uintptr FtclPtrGetVar uintptr FtclPtrSetVar uintptr FtclPtrIncrObjVar uintptr FtclPtrObjMakeUpvar uintptr FtclPtrUnsetVar uintptr FtclStaticLibrary uintptr Freserved258 uintptr Freserved259 uintptr Freserved260 uintptr FtclUnusedStubEntry uintptr } type TTclIntPlatStubs = struct { Fmagic int32 Fhooks uintptr Freserved0 uintptr FtclpCloseFile uintptr FtclpCreateCommandChannel uintptr FtclpCreatePipe uintptr FtclWinGetTclInstance uintptr FtclUnixWaitForFile uintptr FtclpMakeFile uintptr FtclpOpenFile uintptr FtclpGetPid uintptr FtclpCreateTempFile uintptr Freserved10 uintptr FtclGetAndDetachPids uintptr Freserved12 uintptr Freserved13 uintptr Freserved14 uintptr FtclpCreateProcess uintptr FtclpIsAtty uintptr FtclUnixCopyFile uintptr Freserved18 uintptr Freserved19 uintptr FtclWinAddProcess uintptr Freserved21 uintptr Freserved22 uintptr Freserved23 uintptr FtclWinNoBackslash uintptr Freserved25 uintptr Freserved26 uintptr FtclWinFlushDirtyChannels uintptr Freserved28 uintptr FtclWinCPUID uintptr FtclUnixOpenTemporaryFile uintptr } type Tregex_t = struct { Fre_magic int32 Fre_info int64 Fre_nsub Tsize_t Fre_endp uintptr Fre_guts uintptr Fre_fns uintptr } type Tregmatch_t = struct { Frm_so Tsize_t Frm_eo Tsize_t } type Trm_detail_t = struct { Frm_extend Tregmatch_t } type Tchr = int32 type Tpchr = int32 type Tuchr = uint32 type Tcelt = int32 type Tcolor = int16 type Tpcolor = int32 type Tcolors = struct { Fccolor [256]Tcolor } type Tptrs = struct { Fpptr [256]uintptr } type Ttree = struct { Fptrs [0]Tptrs Fcolors Tcolors F__ccgo_pad2 [1536]byte } type Tcolordesc = struct { Fnchrs Tuchr Fsub Tcolor Farcs uintptr Fflags int32 Fblock uintptr } type Tcolormap = struct { Fmagic int32 Fv uintptr Fncds Tsize_t Fmax Tsize_t Ffree Tcolor Fcd uintptr Fcdspace [10]Tcolordesc Ftree [4]Ttree } type Tcvec = struct { Fnchrs Tsize_t Fchrspace Tsize_t Fchrs uintptr Fnranges Tsize_t Frangespace Tsize_t Franges uintptr } type Tstate = struct { Fno Tsize_t Fflag uint8 Fnins Tsize_t Fins uintptr Fnouts Tsize_t Fouts uintptr Ffree uintptr Ftmp uintptr Fnext uintptr Fprev uintptr Foas Tarcbatch Fnoas Tsize_t } type Tarc = struct { Ftype1 int32 Fco Tcolor Ffrom uintptr Fto uintptr Foutchain uintptr FoutchainRev uintptr Finchain uintptr FinchainRev uintptr Fcolorchain uintptr FcolorchainRev uintptr } type Tarcbatch = struct { Fnext uintptr Fa [10]Tarc } type Tnfa = struct { Fpre uintptr Finit1 uintptr Ffinal uintptr Fpost uintptr Fnstates Tsize_t Fstates uintptr Fslast uintptr Ffree uintptr Fcm uintptr Fbos [2]Tcolor Feos [2]Tcolor Fv uintptr Fparent uintptr } type Tcarc = struct { Fco Tcolor Fto Tsize_t } type Tcnfa = struct { Fnstates Tsize_t Fncolors int32 Fflags int32 Fpre Tsize_t Fpost Tsize_t Fbos [2]Tcolor Feos [2]Tcolor Fstflags uintptr Fstates uintptr Farcs uintptr } type Tsubre = struct { Fop uint8 Fflags uint8 Fid int16 Fsubno int32 Fmin int16 Fmax int16 Fleft uintptr Fright uintptr Fbegin uintptr Fend uintptr Fcnfa Tcnfa Fchain uintptr } type Tfns = struct { Ffree uintptr } type Tguts = struct { Fmagic int32 Fcflags int32 Finfo int64 Fnsub Tsize_t Ftree uintptr Fsearch Tcnfa Fntree Tsize_t Fcmap Tcolormap Fcompare uintptr Flacons uintptr Fnlacons Tsize_t } /* automatically gathered by fwd; do not hand-edit */ /* =====^!^===== end forwards =====^!^===== */ /* internal variables, bundled for easy passing around */ type Tvars = struct { Fre uintptr Fnow uintptr Fstop uintptr Fsavenow uintptr Fsavestop uintptr Ferr int32 Fcflags int32 Flasttype int32 Fnexttype int32 Fnextvalue Tsize_t Flexcon int32 Fnsubexp Tsize_t Fsubs uintptr Fnsubs Tsize_t Fsub10 [10]uintptr Fnfa uintptr Fcm uintptr Fnlcolor Tcolor Fwordchrs uintptr Ftree uintptr Ftreechain uintptr Ftreefree uintptr Fntree int32 Fcv uintptr Fcv2 uintptr Flacons uintptr Fnlacons Tsize_t Fspaceused Tsize_t } /* parsing macros; most know that `v' is the struct vars pointer */ /* token type codes, some also used as NFA arc types */ /* is an arc colored, and hence on a color chain? */ // C documentation // // /* static function list */ var _functions = Tfns{} func init() { p := unsafe.Pointer(&_functions) *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_rfree) } // C documentation // // /* // - compile - compile regular expression // * Note: on failure, no resources remain allocated, so regfree() // * need not be applied to re. // ^ int compile(regex_t *, const chr *, size_t, int); // */ func XTclReComp(tls *libc.TLS, re uintptr, string1 uintptr, len1 Tsize_t, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var debug, g, v, v1, v2, v5 uintptr var i, j Tsize_t _, _, _, _, _, _, _, _ = debug, g, i, j, v, v1, v2, v5 v = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&_varsKey)), int64(280)) if flags&int32(REG_PROGRESS) != 0 { v1 = libc.Xstdout } else { v1 = libc.UintptrFromInt32(0) } debug = v1 /* * Sanity checks. */ if re == libc.UintptrFromInt32(0) || string1 == libc.UintptrFromInt32(0) { return int32(REG_INVARG) } if flags&int32(REG_QUOTE) != 0 && flags&(libc.Int32FromInt32(REG_ADVANCED)|libc.Int32FromInt32(REG_EXPANDED)|libc.Int32FromInt32(REG_NEWLINE)) != 0 { return int32(REG_INVARG) } if !(flags&libc.Int32FromInt32(REG_EXTENDED) != 0) && flags&int32(REG_ADVF) != 0 { return int32(REG_INVARG) } /* * Initial setup (after which freev() is callable). */ (*Tvars)(unsafe.Pointer(v)).Fre = re (*Tvars)(unsafe.Pointer(v)).Fnow = string1 (*Tvars)(unsafe.Pointer(v)).Fstop = (*Tvars)(unsafe.Pointer(v)).Fnow + uintptr(len1)*4 v2 = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Fsavestop = v2 (*Tvars)(unsafe.Pointer(v)).Fsavenow = v2 (*Tvars)(unsafe.Pointer(v)).Ferr = 0 (*Tvars)(unsafe.Pointer(v)).Fcflags = flags (*Tvars)(unsafe.Pointer(v)).Fnsubexp = uint64(0) (*Tvars)(unsafe.Pointer(v)).Fsubs = v + 96 (*Tvars)(unsafe.Pointer(v)).Fnsubs = uint64(10) j = uint64(0) for { if !(j < (*Tvars)(unsafe.Pointer(v)).Fnsubs) { break } *(*uintptr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fsubs + uintptr(j)*8)) = libc.UintptrFromInt32(0) goto _3 _3: ; j++ } (*Tvars)(unsafe.Pointer(v)).Fnfa = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Fcm = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Fnlcolor = int16(-libc.Int32FromInt32(1)) (*Tvars)(unsafe.Pointer(v)).Fwordchrs = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Ftree = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Ftreechain = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Ftreefree = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Fcv = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Fcv2 = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Flacons = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Fnlacons = uint64(0) (*Tvars)(unsafe.Pointer(v)).Fspaceused = uint64(0) (*Tregex_t)(unsafe.Pointer(re)).Fre_magic = int32(REMAGIC) (*Tregex_t)(unsafe.Pointer(re)).Fre_info = 0 /* bits get set during parse */ (*Tregex_t)(unsafe.Pointer(re)).Fre_guts = libc.UintptrFromInt32(0) (*Tregex_t)(unsafe.Pointer(re)).Fre_fns = uintptr(unsafe.Pointer(&_functions)) /* * More complex setup, malloced things. */ (*Tregex_t)(unsafe.Pointer(re)).Fre_guts = XTclpAlloc(tls, uint64(8688)) if (*Tregex_t)(unsafe.Pointer(re)).Fre_guts == libc.UintptrFromInt32(0) { return _freev(tls, v, int32(REG_ESPACE)) } g = (*Tregex_t)(unsafe.Pointer(re)).Fre_guts (*Tguts)(unsafe.Pointer(g)).Ftree = libc.UintptrFromInt32(0) _initcm(tls, v, g+104) (*Tvars)(unsafe.Pointer(v)).Fcm = g + 104 (*Tguts)(unsafe.Pointer(g)).Flacons = libc.UintptrFromInt32(0) (*Tguts)(unsafe.Pointer(g)).Fnlacons = uint64(0) (*Tguts)(unsafe.Pointer(g)).Fsearch.Fnstates = uint64(0) (*Tvars)(unsafe.Pointer(v)).Fnfa = _newnfa(tls, v, (*Tvars)(unsafe.Pointer(v)).Fcm, libc.UintptrFromInt32(0)) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return _freev(tls, v, (*Tvars)(unsafe.Pointer(v)).Ferr) } (*Tvars)(unsafe.Pointer(v)).Fcv = _newcvec(tls, uint64(100), uint64(20)) if (*Tvars)(unsafe.Pointer(v)).Fcv == libc.UintptrFromInt32(0) { return _freev(tls, v, int32(REG_ESPACE)) } /* * Parsing. */ _lexstart(tls, v) /* also handles prefixes */ if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_NLSTOP) != 0 || (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_NLANCH) != 0 { /* * Assign newline a unique color. */ (*Tvars)(unsafe.Pointer(v)).Fnlcolor = _subcolor(tls, (*Tvars)(unsafe.Pointer(v)).Fcm, _newline(tls)) _okcolors(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, (*Tvars)(unsafe.Pointer(v)).Fcm) } if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return _freev(tls, v, (*Tvars)(unsafe.Pointer(v)).Ferr) } (*Tvars)(unsafe.Pointer(v)).Ftree = _parse(tls, v, int32('e'), int32('p'), (*Tnfa)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnfa)).Finit1, (*Tnfa)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnfa)).Ffinal) /* even if error; ISERR() => SEE(EOS) */ if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return _freev(tls, v, (*Tvars)(unsafe.Pointer(v)).Ferr) } /* * Finish setup of nfa and its subre tree. */ _specialcolors(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return _freev(tls, v, (*Tvars)(unsafe.Pointer(v)).Ferr) } if debug != libc.UintptrFromInt32(0) { libc.Xfprintf(tls, debug, __ccgo_ts, 0) _dumpnfa(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, debug) _dumpst(tls, (*Tvars)(unsafe.Pointer(v)).Ftree, debug, int32(1)) } (*Tvars)(unsafe.Pointer(v)).Fntree = _numst(tls, (*Tvars)(unsafe.Pointer(v)).Ftree, int32(1)) _markst(tls, (*Tvars)(unsafe.Pointer(v)).Ftree) _cleanst(tls, v) if debug != libc.UintptrFromInt32(0) { libc.Xfprintf(tls, debug, __ccgo_ts+29, 0) _dumpst(tls, (*Tvars)(unsafe.Pointer(v)).Ftree, debug, int32(1)) } /* * Build compacted NFAs for tree and lacons. */ *(*int64)(unsafe.Pointer(re + 8)) |= _nfatree(tls, v, (*Tvars)(unsafe.Pointer(v)).Ftree, debug) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return _freev(tls, v, (*Tvars)(unsafe.Pointer(v)).Ferr) } i = uint64(1) for { if !(i < (*Tvars)(unsafe.Pointer(v)).Fnlacons) { break } if debug != libc.UintptrFromInt32(0) { libc.Xfprintf(tls, debug, __ccgo_ts+65, libc.VaList(bp+8, i)) } _nfanode(tls, v, (*Tvars)(unsafe.Pointer(v)).Flacons+uintptr(i)*120, debug) goto _4 _4: ; i++ } if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return _freev(tls, v, (*Tvars)(unsafe.Pointer(v)).Ferr) } if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Ftree)).Fflags)&int32(SHORTER) != 0 { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_USHORTEST)) } /* * Build compacted NFAs for tree, lacons, fast search. */ if debug != libc.UintptrFromInt32(0) { libc.Xfprintf(tls, debug, __ccgo_ts+96, 0) } /* * Can sacrifice main NFA now, so use it as work area. */ _optimize(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, debug) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return _freev(tls, v, (*Tvars)(unsafe.Pointer(v)).Ferr) } _makesearch(tls, v, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return _freev(tls, v, (*Tvars)(unsafe.Pointer(v)).Ferr) } _compact(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, g+32) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return _freev(tls, v, (*Tvars)(unsafe.Pointer(v)).Ferr) } /* * Looks okay, package it up. */ (*Tregex_t)(unsafe.Pointer(re)).Fre_nsub = (*Tvars)(unsafe.Pointer(v)).Fnsubexp (*Tvars)(unsafe.Pointer(v)).Fre = libc.UintptrFromInt32(0) /* freev no longer frees re */ (*Tguts)(unsafe.Pointer(g)).Fmagic = int32(GUTSMAGIC) (*Tguts)(unsafe.Pointer(g)).Fcflags = (*Tvars)(unsafe.Pointer(v)).Fcflags (*Tguts)(unsafe.Pointer(g)).Finfo = (*Tregex_t)(unsafe.Pointer(re)).Fre_info (*Tguts)(unsafe.Pointer(g)).Fnsub = (*Tregex_t)(unsafe.Pointer(re)).Fre_nsub (*Tguts)(unsafe.Pointer(g)).Ftree = (*Tvars)(unsafe.Pointer(v)).Ftree (*Tvars)(unsafe.Pointer(v)).Ftree = libc.UintptrFromInt32(0) (*Tguts)(unsafe.Pointer(g)).Fntree = libc.Uint64FromInt32((*Tvars)(unsafe.Pointer(v)).Fntree) if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ICASE) != 0 { v5 = __ccgo_fp(_casecmp) } else { v5 = __ccgo_fp(_cmp) } (*Tguts)(unsafe.Pointer(g)).Fcompare = v5 (*Tguts)(unsafe.Pointer(g)).Flacons = (*Tvars)(unsafe.Pointer(v)).Flacons (*Tvars)(unsafe.Pointer(v)).Flacons = libc.UintptrFromInt32(0) (*Tguts)(unsafe.Pointer(g)).Fnlacons = (*Tvars)(unsafe.Pointer(v)).Fnlacons if flags&int32(REG_DUMP) != 0 { _dump(tls, re, libc.Xstdout) } return _freev(tls, v, 0) } var _varsKey TTcl_ThreadDataKey // C documentation // // /* // - moresubs - enlarge subRE vector // ^ static void moresubs(struct vars *, size_t); // */ func _moresubs(tls *libc.TLS, v uintptr, wanted Tsize_t) { /* want enough room for this one */ var n Tsize_t var p uintptr var v1 int32 _, _, _ = n, p, v1 n = wanted*uint64(3)/uint64(2) + uint64(1) if (*Tvars)(unsafe.Pointer(v)).Fsubs == v+96 { p = XTclpAlloc(tls, n*uint64(8)) if p != libc.UintptrFromInt32(0) { libc.Xmemcpy(tls, p, (*Tvars)(unsafe.Pointer(v)).Fsubs, (*Tvars)(unsafe.Pointer(v)).Fnsubs*uint64(8)) } } else { p = XTclpRealloc(tls, (*Tvars)(unsafe.Pointer(v)).Fsubs, n*uint64(8)) } if p == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v1 return } (*Tvars)(unsafe.Pointer(v)).Fsubs = p p = (*Tvars)(unsafe.Pointer(v)).Fsubs + uintptr((*Tvars)(unsafe.Pointer(v)).Fnsubs)*8 for { if !((*Tvars)(unsafe.Pointer(v)).Fnsubs < n) { break } *(*uintptr)(unsafe.Pointer(p)) = libc.UintptrFromInt32(0) goto _2 _2: ; p += 8 (*Tvars)(unsafe.Pointer(v)).Fnsubs++ } } // C documentation // // /* // - freev - free vars struct's substructures where necessary // * Optionally does error-number setting, and always returns error code (if // * any), to make error-handling code terser. // ^ static int freev(struct vars *, int); // */ func _freev(tls *libc.TLS, v uintptr, err int32) (r int32) { var ret, v1 int32 _, _ = ret, v1 if (*Tvars)(unsafe.Pointer(v)).Fre != libc.UintptrFromInt32(0) { _rfree(tls, (*Tvars)(unsafe.Pointer(v)).Fre) } if (*Tvars)(unsafe.Pointer(v)).Fsubs != v+96 { XTclpFree(tls, (*Tvars)(unsafe.Pointer(v)).Fsubs) } if (*Tvars)(unsafe.Pointer(v)).Fnfa != libc.UintptrFromInt32(0) { _freenfa(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) } if (*Tvars)(unsafe.Pointer(v)).Ftree != libc.UintptrFromInt32(0) { _freesubre(tls, v, (*Tvars)(unsafe.Pointer(v)).Ftree) } if (*Tvars)(unsafe.Pointer(v)).Ftreechain != libc.UintptrFromInt32(0) { _cleanst(tls, v) } if (*Tvars)(unsafe.Pointer(v)).Fcv != libc.UintptrFromInt32(0) { _freecvec(tls, (*Tvars)(unsafe.Pointer(v)).Fcv) } if (*Tvars)(unsafe.Pointer(v)).Fcv2 != libc.UintptrFromInt32(0) { _freecvec(tls, (*Tvars)(unsafe.Pointer(v)).Fcv2) } if (*Tvars)(unsafe.Pointer(v)).Flacons != libc.UintptrFromInt32(0) { _freelacons(tls, (*Tvars)(unsafe.Pointer(v)).Flacons, libc.Int32FromUint64((*Tvars)(unsafe.Pointer(v)).Fnlacons)) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v1 = err } (*Tvars)(unsafe.Pointer(v)).Ferr = v1 /* nop if err==0 */ ret = (*Tvars)(unsafe.Pointer(v)).Ferr return ret } // C documentation // // /* // - makesearch - turn an NFA into a search NFA (implicit prepend of .*?) // * NFA must have been optimize()d already. // ^ static void makesearch(struct vars *, struct nfa *); // */ func _makesearch(tls *libc.TLS, v uintptr, nfa uintptr) { var a, b, pre, s, s2, slist, v4, v7 uintptr _, _, _, _, _, _, _, _ = a, b, pre, s, s2, slist, v4, v7 pre = (*Tnfa)(unsafe.Pointer(nfa)).Fpre /* * No loops are needed if it's anchored. */ a = (*Tstate)(unsafe.Pointer(pre)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } if int32((*Tarc)(unsafe.Pointer(a)).Fco) != int32(*(*Tcolor)(unsafe.Pointer(nfa + 72))) && int32((*Tarc)(unsafe.Pointer(a)).Fco) != int32(*(*Tcolor)(unsafe.Pointer(nfa + 72 + 1*2))) { break } goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } if a != libc.UintptrFromInt32(0) { /* * Add implicit .* in front. */ _rainbow(tls, nfa, (*Tvars)(unsafe.Pointer(v)).Fcm, int32('p'), -libc.Int32FromInt32(1), pre, pre) /* * And ^* and \A* too -- not always necessary, but harmless. */ _newarc(tls, nfa, int32('p'), int32(*(*Tcolor)(unsafe.Pointer(nfa + 72))), pre, pre) _newarc(tls, nfa, int32('p'), int32(*(*Tcolor)(unsafe.Pointer(nfa + 72 + 1*2))), pre, pre) } /* * Now here's the subtle part. Because many REs have no lookback * constraints, often knowing when you were in the pre state tells you * little; it's the next state(s) that are informative. But some of them * may have other inarcs, i.e. it may be possible to make actual progress * and then return to one of them. We must de-optimize such cases, * splitting each such state into progress and no-progress states. */ /* * First, make a list of the states. */ slist = libc.UintptrFromInt32(0) a = (*Tstate)(unsafe.Pointer(pre)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } s = (*Tarc)(unsafe.Pointer(a)).Fto b = (*Tstate)(unsafe.Pointer(s)).Fins for { if !(b != libc.UintptrFromInt32(0)) { break } if (*Tarc)(unsafe.Pointer(b)).Ffrom != pre { break } goto _3 _3: ; b = (*Tarc)(unsafe.Pointer(b)).Finchain } /* * We want to mark states as being in the list already by having non * NULL tmp fields, but we can't just store the old slist value in tmp * because that doesn't work for the first such state. Instead, the * first list entry gets its own address in tmp. */ if b != libc.UintptrFromInt32(0) && (*Tstate)(unsafe.Pointer(s)).Ftmp == libc.UintptrFromInt32(0) { if slist != libc.UintptrFromInt32(0) { v4 = slist } else { v4 = s } (*Tstate)(unsafe.Pointer(s)).Ftmp = v4 slist = s } goto _2 _2: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } /* * Do the splits. */ s = slist for { if !(s != libc.UintptrFromInt32(0)) { break } s2 = _newstate(tls, nfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _copyouts(tls, nfa, s, s2) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } a = (*Tstate)(unsafe.Pointer(s)).Fins for { if !(a != libc.UintptrFromInt32(0)) { break } b = (*Tarc)(unsafe.Pointer(a)).Finchain if (*Tarc)(unsafe.Pointer(a)).Ffrom != pre { _cparc(tls, nfa, a, (*Tarc)(unsafe.Pointer(a)).Ffrom, s2) _freearc(tls, nfa, a) } goto _6 _6: ; a = b } if (*Tstate)(unsafe.Pointer(s)).Ftmp != s { v7 = (*Tstate)(unsafe.Pointer(s)).Ftmp } else { v7 = libc.UintptrFromInt32(0) } s2 = v7 (*Tstate)(unsafe.Pointer(s)).Ftmp = libc.UintptrFromInt32(0) /* clean up while we're at it */ goto _5 _5: ; s = s2 } } // C documentation // // /* // - parse - parse an RE // * This is actually just the top level, which parses a bunch of branches tied // * together with '|'. They appear in the tree as the left children of a chain // * of '|' subres. // ^ static struct subre *parse(struct vars *, int, int, struct state *, // ^ struct state *); // */ func _parse(tls *libc.TLS, v uintptr, stopper int32, type1 int32, init1 uintptr, final uintptr) (r uintptr) { /* final state */ var branch, branches, left, right, t, p1, p3 uintptr var firstbranch, v4 int32 _, _, _, _, _, _, _, _, _ = branch, branches, firstbranch, left, right, t, v4, p1, p3 /* is this the first branch? */ branches = _sub_re(tls, v, int32('|'), int32(LONGER), init1, final) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return libc.UintptrFromInt32(0) } branch = branches firstbranch = int32(1) for cond := true; cond; cond = (*Tvars)(unsafe.Pointer(v)).Fnexttype == int32('|') && _next(tls, v) != 0 { /* a branch */ if !(firstbranch != 0) { /* * Need a place to hang the branch. */ (*Tsubre)(unsafe.Pointer(branch)).Fright = _sub_re(tls, v, int32('|'), int32(LONGER), init1, final) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return libc.UintptrFromInt32(0) } branch = (*Tsubre)(unsafe.Pointer(branch)).Fright } firstbranch = 0 left = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) right = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return libc.UintptrFromInt32(0) } _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, init1, left) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, right, final) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return libc.UintptrFromInt32(0) } (*Tsubre)(unsafe.Pointer(branch)).Fleft = _parsebranch(tls, v, stopper, type1, left, right, 0) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return libc.UintptrFromInt32(0) } p1 = branch + 1 *(*uint8)(unsafe.Pointer(p1)) = uint8(int32(*(*uint8)(unsafe.Pointer(p1))) | ((libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(branch)).Fflags)|libc.Int32FromUint8((*Tsubre)(unsafe.Pointer((*Tsubre)(unsafe.Pointer(branch)).Fleft)).Fflags)) & ^libc.Int32FromInt32(NOPROP) | (libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(branch)).Fflags)|libc.Int32FromUint8((*Tsubre)(unsafe.Pointer((*Tsubre)(unsafe.Pointer(branch)).Fleft)).Fflags))<'): goto _6 case int32('w'): goto _7 case int32('W'): goto _8 case int32('L'): goto _9 case int32('{'): goto _10 case int32('?'): goto _11 case int32('+'): goto _12 case int32('*'): goto _13 default: goto _14 case int32(')'): goto _15 case int32('p'): goto _16 case int32('['): goto _17 case int32('.'): goto _18 case int32('('): goto _19 case int32('b'): goto _20 } goto _21 /* first, constraints, which end by returning */ _1: ; _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('^'), int32(1), lp, rp) if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_NLANCH) != 0 { _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('r'), int32((*Tvars)(unsafe.Pointer(v)).Fnlcolor), lp, rp) } _next(tls, v) return _2: ; _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('$'), int32(1), lp, rp) if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_NLANCH) != 0 { _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('a'), int32((*Tvars)(unsafe.Pointer(v)).Fnlcolor), lp, rp) } _next(tls, v) return _3: ; _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('^'), int32(1), lp, rp) /* BOL */ _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('^'), 0, lp, rp) /* or BOS */ _next(tls, v) return _4: ; _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('$'), int32(1), lp, rp) /* EOL */ _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('$'), 0, lp, rp) /* or EOS */ _next(tls, v) return _5: ; _wordchrs(tls, v) /* does NEXT() */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _nonword(tls, v, int32('r'), lp, s) _word(tls, v, int32('a'), s, rp) return _6: ; _wordchrs(tls, v) /* does NEXT() */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _word(tls, v, int32('r'), lp, s) _nonword(tls, v, int32('a'), s, rp) return _7: ; _wordchrs(tls, v) /* does NEXT() */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _nonword(tls, v, int32('r'), lp, s) _word(tls, v, int32('a'), s, rp) s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _word(tls, v, int32('r'), lp, s) _nonword(tls, v, int32('a'), s, rp) return _8: ; _wordchrs(tls, v) /* does NEXT() */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _word(tls, v, int32('r'), lp, s) _word(tls, v, int32('a'), s, rp) s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _nonword(tls, v, int32('r'), lp, s) _nonword(tls, v, int32('a'), s, rp) return _9: ; /* lookahead constraint */ pos = libc.Int32FromUint64((*Tvars)(unsafe.Pointer(v)).Fnextvalue) _next(tls, v) s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) s2 = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } t = _parse(tls, v, int32(')'), int32('L'), s, s2) _freesubre(tls, v, t) /* internal structure irrelevant */ _next(tls, v) n = _newlacon(tls, v, s, s2, pos) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('L'), n, lp, rp) return /* * Then errors, to get them out of the way. */ _13: ; _12: ; _11: ; _10: ; (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v22 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v22 = int32(REG_BADRPT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v22 return _14: ; (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v23 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v23 = int32(REG_ASSERT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v23 return /* * Then plain characters, and minor variants on that theme. */ _15: ; /* unbalanced paren */ if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ADVANCED) != int32(REG_EXTENDED) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v24 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v24 = int32(REG_EPAREN) } (*Tvars)(unsafe.Pointer(v)).Ferr = v24 return } /* * Legal in EREs due to specification botch. */ *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UPBOTCH)) /* FALLTHRU */ _16: ; _onechr(tls, v, libc.Int32FromUint64((*Tvars)(unsafe.Pointer(v)).Fnextvalue), lp, rp) _okcolors(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, (*Tvars)(unsafe.Pointer(v)).Fcm) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _next(tls, v) goto _21 _17: ; if (*Tvars)(unsafe.Pointer(v)).Fnextvalue == uint64(1) { _bracket(tls, v, lp, rp) } else { _cbracket(tls, v, lp, rp) } _next(tls, v) goto _21 _18: ; if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_NLSTOP) != 0 { v25 = int32((*Tvars)(unsafe.Pointer(v)).Fnlcolor) } else { v25 = -int32(1) } _rainbow(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, (*Tvars)(unsafe.Pointer(v)).Fcm, int32('p'), v25, lp, rp) _next(tls, v) goto _21 /* * And finally the ugly stuff. */ _19: ; /* value flags as capturing or non */ if type1 == int32('L') { v26 = uint64(0) } else { v26 = (*Tvars)(unsafe.Pointer(v)).Fnextvalue } cap1 = libc.Int32FromUint64(v26) if cap1 != 0 { (*Tvars)(unsafe.Pointer(v)).Fnsubexp++ subno = (*Tvars)(unsafe.Pointer(v)).Fnsubexp if subno >= (*Tvars)(unsafe.Pointer(v)).Fnsubs { _moresubs(tls, v, subno) } } else { atomtype = int32('p') /* something that's not '(' */ } _next(tls, v) /* * Need new endpoints because tree will contain pointers. */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) s2 = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, lp, s) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, s2, rp) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } atom = _parse(tls, v, int32(')'), int32('p'), s, s2) _next(tls, v) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } if cap1 != 0 { *(*uintptr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fsubs + uintptr(subno)*8)) = atom t = _sub_re(tls, v, int32('('), libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(atom)).Fflags)|int32(CAP), lp, rp) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } (*Tsubre)(unsafe.Pointer(t)).Fsubno = libc.Int32FromUint64(subno) (*Tsubre)(unsafe.Pointer(t)).Fleft = atom atom = t } /* * Postpone everything else pending possible {0}. */ goto _21 _20: ; /* the Feature From The Black Lagoon */ _29: ; if !(type1 != libc.Int32FromUint8('L')) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v30 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v30 = int32(REG_ESUBREG) } (*Tvars)(unsafe.Pointer(v)).Ferr = v30 } goto _28 _28: ; if 0 != 0 { goto _29 } goto _27 _27: ; if !((*Tvars)(unsafe.Pointer(v)).Fnextvalue < (*Tvars)(unsafe.Pointer(v)).Fnsubs) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v31 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v31 = int32(REG_ESUBREG) } (*Tvars)(unsafe.Pointer(v)).Ferr = v31 } if !(*(*uintptr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fsubs + uintptr((*Tvars)(unsafe.Pointer(v)).Fnextvalue)*8)) != libc.UintptrFromInt32(0)) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v32 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v32 = int32(REG_ESUBREG) } (*Tvars)(unsafe.Pointer(v)).Ferr = v32 } if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } atom = _sub_re(tls, v, int32('b'), int32(BACKR), lp, rp) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } subno = (*Tvars)(unsafe.Pointer(v)).Fnextvalue (*Tsubre)(unsafe.Pointer(atom)).Fsubno = libc.Int32FromUint64(subno) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, lp, rp) /* temporarily, so there's something */ _next(tls, v) goto _21 _21: ; /* * ...and an atom may be followed by a quantifier. */ switch (*Tvars)(unsafe.Pointer(v)).Fnexttype { case int32('*'): m = 0 n = libc.Int32FromInt32(_POSIX2_RE_DUP_MAX) + libc.Int32FromInt32(1) if (*Tvars)(unsafe.Pointer(v)).Fnextvalue != 0 { v33 = int32(LONGER) } else { v33 = int32(SHORTER) } qprefer = v33 _next(tls, v) case int32('+'): m = int32(1) n = libc.Int32FromInt32(_POSIX2_RE_DUP_MAX) + libc.Int32FromInt32(1) if (*Tvars)(unsafe.Pointer(v)).Fnextvalue != 0 { v34 = int32(LONGER) } else { v34 = int32(SHORTER) } qprefer = v34 _next(tls, v) case int32('?'): m = 0 n = int32(1) if (*Tvars)(unsafe.Pointer(v)).Fnextvalue != 0 { v35 = int32(LONGER) } else { v35 = int32(SHORTER) } qprefer = v35 _next(tls, v) case int32('{'): _next(tls, v) m = _scannum(tls, v) if (*Tvars)(unsafe.Pointer(v)).Fnexttype == int32(',') && _next(tls, v) != 0 { if (*Tvars)(unsafe.Pointer(v)).Fnexttype == int32('d') { n = _scannum(tls, v) } else { n = libc.Int32FromInt32(_POSIX2_RE_DUP_MAX) + libc.Int32FromInt32(1) } if m > n { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v36 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v36 = int32(REG_BADBR) } (*Tvars)(unsafe.Pointer(v)).Ferr = v36 return } /* * {m,n} exercises preference, even if it's {m,m} */ if (*Tvars)(unsafe.Pointer(v)).Fnextvalue != 0 { v37 = int32(LONGER) } else { v37 = int32(SHORTER) } qprefer = v37 } else { n = m /* * {m} passes operand's preference through. */ qprefer = 0 } if !((*Tvars)(unsafe.Pointer(v)).Fnexttype == libc.Int32FromUint8('}')) { /* catches errors too */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v38 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v38 = int32(REG_BADBR) } (*Tvars)(unsafe.Pointer(v)).Ferr = v38 return } _next(tls, v) default: /* no quantifier */ v39 = libc.Int32FromInt32(1) n = v39 m = v39 qprefer = 0 break } /* * Annoying special case: {0} or {0,0} cancels everything. */ if m == 0 && n == 0 { if atom != libc.UintptrFromInt32(0) { _freesubre(tls, v, atom) } if atomtype == int32('(') { *(*uintptr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fsubs + uintptr(subno)*8)) = libc.UintptrFromInt32(0) } _delsub(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, lp, rp) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, lp, rp) return } /* * If not a messy case, avoid hard part. */ if atom != libc.UintptrFromInt32(0) { v40 = libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(atom)).Fflags) } else { v40 = 0 } f = libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(top)).Fflags) | qprefer | v40 if atomtype != int32('(') && atomtype != int32('b') && !((f & ^libc.Int32FromInt32(NOPROP) | f<end */ s2 = (*Tsubre)(unsafe.Pointer(atom)).Fend } else { if m == int32(1) && n == int32(1) { /* * No/vacuous quantifier: done. */ _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, s, (*Tsubre)(unsafe.Pointer(atom)).Fbegin) /* empty prefix */ /* rest of branch can be strung starting from atom->end */ s2 = (*Tsubre)(unsafe.Pointer(atom)).Fend } else { if m > 0 && !(libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(atom)).Fflags)&libc.Int32FromInt32(BACKR) != 0) { /* * If there's no backrefs involved, we can turn x{m,n} into * x{m-1,n-1}x, with capturing parens in only the second x. This * is valid because we only care about capturing matches from the * final iteration of the quantifier. It's a win because we can * implement the backref-free left side as a plain DFA node, since * we don't really care where its submatches are. */ _dupnfa(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, (*Tsubre)(unsafe.Pointer(atom)).Fbegin, (*Tsubre)(unsafe.Pointer(atom)).Fend, s, (*Tsubre)(unsafe.Pointer(atom)).Fbegin) if n == libc.Int32FromInt32(_POSIX2_RE_DUP_MAX)+libc.Int32FromInt32(1) { v44 = n } else { v44 = n - int32(1) } _repeat(tls, v, s, (*Tsubre)(unsafe.Pointer(atom)).Fbegin, m-int32(1), v44) if qprefer&int32(NOPROP) != 0 { v45 = qprefer & int32(NOPROP) } else { v45 = libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(atom)).Fflags) & int32(NOPROP) } f = (qprefer|libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(atom)).Fflags)) & ^libc.Int32FromInt32(NOPROP) | (qprefer|libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(atom)).Fflags))< int32(_POSIX2_RE_DUP_MAX) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_BADBR) } (*Tvars)(unsafe.Pointer(v)).Ferr = v1 return 0 } return n } // C documentation // // /* // - repeat - replicate subNFA for quantifiers // * The sub-NFA strung from lp to rp is modified to represent m to n // * repetitions of its initial contents. // * The duplication sequences used here are chosen carefully so that any // * pointers starting out pointing into the subexpression end up pointing into // * the last occurrence. (Note that it may not be strung between the same left // * and right end states, however!) This used to be important for the subRE // * tree, although the important bits are now handled by the in-line code in // * parse(), and when this is called, it doesn't matter any more. // ^ static void repeat(struct vars *, struct state *, struct state *, int, int); // */ func _repeat(tls *libc.TLS, v uintptr, lp uintptr, rp uintptr, m int32, n int32) { var rm, rn, v1, v2, v3, v4, v5 int32 var s, s2 uintptr _, _, _, _, _, _, _, _, _ = rm, rn, s, s2, v1, v2, v3, v4, v5 if m == libc.Int32FromInt32(_POSIX2_RE_DUP_MAX)+libc.Int32FromInt32(1) { v1 = int32(INF) } else { if m > int32(1) { v2 = int32(SOME) } else { v2 = m } v1 = v2 } rm = v1 if n == libc.Int32FromInt32(_POSIX2_RE_DUP_MAX)+libc.Int32FromInt32(1) { v3 = int32(INF) } else { if n > int32(1) { v4 = int32(SOME) } else { v4 = n } v3 = v4 } rn = v3 switch rm*libc.Int32FromInt32(4) + rn { case libc.Int32FromInt32(0)*libc.Int32FromInt32(4) + libc.Int32FromInt32(0): /* empty string */ _delsub(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, lp, rp) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, lp, rp) case libc.Int32FromInt32(0)*libc.Int32FromInt32(4) + libc.Int32FromInt32(1): /* do as x| */ _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, lp, rp) case libc.Int32FromInt32(0)*libc.Int32FromInt32(4) + libc.Int32FromInt32(SOME): /* do as x{1,n}| */ _repeat(tls, v, lp, rp, int32(1), n) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, lp, rp) case libc.Int32FromInt32(0)*libc.Int32FromInt32(4) + libc.Int32FromInt32(INF): /* loop x around */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _moveouts(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, lp, s) _moveins(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, rp, s) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, lp, s) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, s, rp) case libc.Int32FromInt32(1)*libc.Int32FromInt32(4) + libc.Int32FromInt32(1): /* no action required */ case libc.Int32FromInt32(1)*libc.Int32FromInt32(4) + libc.Int32FromInt32(SOME): /* do as x{0,n-1}x = (x{1,n-1}|)x */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _moveouts(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, lp, s) _dupnfa(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, s, rp, lp, s) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _repeat(tls, v, lp, s, int32(1), n-int32(1)) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, lp, s) case libc.Int32FromInt32(1)*libc.Int32FromInt32(4) + libc.Int32FromInt32(INF): /* add loopback arc */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) s2 = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _moveouts(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, lp, s) _moveins(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, rp, s2) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, lp, s) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, s2, rp) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('n'), 0, s2, s) case libc.Int32FromInt32(SOME)*libc.Int32FromInt32(4) + libc.Int32FromInt32(SOME): /* do as x{m-1,n-1}x */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _moveouts(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, lp, s) _dupnfa(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, s, rp, lp, s) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _repeat(tls, v, lp, s, m-int32(1), n-int32(1)) case libc.Int32FromInt32(SOME)*libc.Int32FromInt32(4) + libc.Int32FromInt32(INF): /* do as x{m-1,}x */ s = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _moveouts(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, lp, s) _dupnfa(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, s, rp, lp, s) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _repeat(tls, v, lp, s, m-int32(1), n) default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v5 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v5 = int32(REG_ASSERT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v5 break } } // C documentation // // /* // - bracket - handle non-complemented bracket expression // * Also called from cbracket for complemented bracket expressions. // ^ static void bracket(struct vars *, struct state *, struct state *); // */ func _bracket(tls *libc.TLS, v uintptr, lp uintptr, rp uintptr) { _next(tls, v) for !((*Tvars)(unsafe.Pointer(v)).Fnexttype == libc.Int32FromUint8(']')) && !((*Tvars)(unsafe.Pointer(v)).Fnexttype == libc.Int32FromUint8('e')) { _brackpart(tls, v, lp, rp) } _okcolors(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, (*Tvars)(unsafe.Pointer(v)).Fcm) } // C documentation // // /* // - cbracket - handle complemented bracket expression // * We do it by calling bracket() with dummy endpoints, and then complementing // * the result. The alternative would be to invoke rainbow(), and then delete // * arcs as the b.e. is seen... but that gets messy. // ^ static void cbracket(struct vars *, struct state *, struct state *); // */ func _cbracket(tls *libc.TLS, v uintptr, lp uintptr, rp uintptr) { var left, right uintptr _, _ = left, right left = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) right = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _bracket(tls, v, left, right) if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_NLSTOP) != 0 { _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('p'), int32((*Tvars)(unsafe.Pointer(v)).Fnlcolor), left, right) } if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } /* all outarcs will be ours */ /* * Easy part of complementing, and all there is to do since the MCCE code * was removed. */ _colorcomplement(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, (*Tvars)(unsafe.Pointer(v)).Fcm, int32('p'), left, lp, rp) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _dropstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, left) _freestate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, right) return } // C documentation // // /* // - brackpart - handle one item (or range) within a bracket expression // ^ static void brackpart(struct vars *, struct state *, struct state *); // */ func _brackpart(tls *libc.TLS, v uintptr, lp uintptr, rp uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var cv, endp, startp uintptr var endc, startc Tcelt var v1, v2, v3, v4, v5, v6, v7 int32 var _ /* c at bp+0 */ Tchr _, _, _, _, _, _, _, _, _, _, _, _ = cv, endc, endp, startc, startp, v1, v2, v3, v4, v5, v6, v7 /* * Parse something, get rid of special cases, take shortcuts. */ switch (*Tvars)(unsafe.Pointer(v)).Fnexttype { case int32('R'): /* a-b-c or other botch */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_ERANGE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v1 return case int32('p'): *(*Tchr)(unsafe.Pointer(bp)) = libc.Int32FromUint64((*Tvars)(unsafe.Pointer(v)).Fnextvalue) _next(tls, v) /* * Shortcut for ordinary chr (not range). */ if !((*Tvars)(unsafe.Pointer(v)).Fnexttype == libc.Int32FromUint8('R')) { _onechr(tls, v, *(*Tchr)(unsafe.Pointer(bp)), lp, rp) return } startc = _element(tls, v, bp, bp+uintptr(1)*4) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } case int32('I'): startp = (*Tvars)(unsafe.Pointer(v)).Fnow endp = _scanplain(tls, v) if !(startp < endp) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v2 = int32(REG_ECOLLATE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v2 } if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } startc = _element(tls, v, startp, endp) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } case int32('E'): startp = (*Tvars)(unsafe.Pointer(v)).Fnow endp = _scanplain(tls, v) if !(startp < endp) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v3 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v3 = int32(REG_ECOLLATE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v3 } if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } startc = _element(tls, v, startp, endp) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } cv = _eclass(tls, v, startc, (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ICASE)) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _dovec(tls, v, cv, lp, rp) return case int32('C'): startp = (*Tvars)(unsafe.Pointer(v)).Fnow endp = _scanplain(tls, v) if !(startp < endp) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v4 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v4 = int32(REG_ECTYPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v4 } if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } cv = _cclass(tls, v, startp, endp, (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ICASE)) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _dovec(tls, v, cv, lp, rp) return default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v5 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v5 = int32(REG_ASSERT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v5 return break } if (*Tvars)(unsafe.Pointer(v)).Fnexttype == int32('R') { _next(tls, v) switch (*Tvars)(unsafe.Pointer(v)).Fnexttype { case int32('p'): fallthrough case int32('R'): *(*Tchr)(unsafe.Pointer(bp)) = libc.Int32FromUint64((*Tvars)(unsafe.Pointer(v)).Fnextvalue) _next(tls, v) endc = _element(tls, v, bp, bp+uintptr(1)*4) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } case int32('I'): startp = (*Tvars)(unsafe.Pointer(v)).Fnow endp = _scanplain(tls, v) if !(startp < endp) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v6 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v6 = int32(REG_ECOLLATE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v6 } if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } endc = _element(tls, v, startp, endp) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v7 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v7 = int32(REG_ERANGE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v7 return break } } else { endc = startc } /* * Ranges are unportable. Actually, standard C does guarantee that digits * are contiguous, but making that an exception is just too complicated. */ if startc != endc { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNPORT)) } cv = _range(tls, v, startc, endc, (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ICASE)) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } _dovec(tls, v, cv, lp, rp) } // C documentation // // /* // - scanplain - scan PLAIN contents of [. etc. // * Certain bits of trickery in lex.c know that this code does not try to look // * past the final bracket of the [. etc. // ^ static const chr *scanplain(struct vars *); // */ func _scanplain(tls *libc.TLS, v uintptr) (r uintptr) { var endp uintptr _ = endp _next(tls, v) endp = (*Tvars)(unsafe.Pointer(v)).Fnow for (*Tvars)(unsafe.Pointer(v)).Fnexttype == int32('p') { endp = (*Tvars)(unsafe.Pointer(v)).Fnow _next(tls, v) } _next(tls, v) return endp } // C documentation // // /* // - onechr - fill in arcs for a plain character, and possible case complements // * This is mostly a shortcut for efficient handling of the common case. // ^ static void onechr(struct vars *, pchr, struct state *, struct state *); // */ func _onechr(tls *libc.TLS, v uintptr, c Tpchr, lp uintptr, rp uintptr) { if !((*Tvars)(unsafe.Pointer(v)).Fcflags&libc.Int32FromInt32(REG_ICASE) != 0) { _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('p'), int32(_subcolor(tls, (*Tvars)(unsafe.Pointer(v)).Fcm, c)), lp, rp) return } /* * Rats, need general case anyway... */ _dovec(tls, v, _allcases(tls, v, c), lp, rp) } // C documentation // // /* // - dovec - fill in arcs for each element of a cvec // ^ static void dovec(struct vars *, struct cvec *, struct state *, // ^ struct state *); // */ func _dovec(tls *libc.TLS, v uintptr, cv uintptr, lp uintptr, rp uintptr) { var ch, from, to Tchr var i int32 var p uintptr _, _, _, _, _ = ch, from, i, p, to p = (*Tcvec)(unsafe.Pointer(cv)).Fchrs i = libc.Int32FromUint64((*Tcvec)(unsafe.Pointer(cv)).Fnchrs) for { if !(i > 0) { break } ch = *(*Tchr)(unsafe.Pointer(p)) _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('p'), int32(_subcolor(tls, (*Tvars)(unsafe.Pointer(v)).Fcm, ch)), lp, rp) goto _1 _1: ; p += 4 i-- } p = (*Tcvec)(unsafe.Pointer(cv)).Franges i = libc.Int32FromUint64((*Tcvec)(unsafe.Pointer(cv)).Fnranges) for { if !(i > 0) { break } from = *(*Tchr)(unsafe.Pointer(p)) to = *(*Tchr)(unsafe.Pointer(p + libc.UintptrFromInt32(1)*4)) if from <= to { _subrange(tls, v, from, to, lp, rp) } goto _2 _2: ; p += uintptr(2) * 4 i-- } } // C documentation // // /* // - wordchrs - set up word-chr list for word-boundary stuff, if needed // * The list is kept as a bunch of arcs between two dummy states; it's disposed // * of by the unreachable-states sweep in NFA optimization. Does NEXT(). Must // * not be called from any unusual lexical context. This should be reconciled // * with the \w etc. handling in lex.c, and should be cleaned up to reduce // * dependencies on input scanning. // ^ static void wordchrs(struct vars *); // */ func _wordchrs(tls *libc.TLS, v uintptr) { var left, right uintptr _, _ = left, right if (*Tvars)(unsafe.Pointer(v)).Fwordchrs != libc.UintptrFromInt32(0) { _next(tls, v) /* for consistency */ return } left = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) right = _newstate(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } /* * Fine point: implemented with [::], and lexer will set REG_ULOCALE. */ _lexword(tls, v) _next(tls, v) _bracket(tls, v, left, right) _next(tls, v) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } (*Tvars)(unsafe.Pointer(v)).Fwordchrs = left } // C documentation // // /* // - sub_re - allocate a subre // ^ static struct subre *sub_re(struct vars *, int, int, struct state *, // ^ struct state *); // */ func _sub_re(tls *libc.TLS, v uintptr, op int32, flags int32, begin uintptr, end uintptr) (r uintptr) { var ret uintptr var v1 int32 var v2 int16 _, _, _ = ret, v1, v2 ret = (*Tvars)(unsafe.Pointer(v)).Ftreefree if ret != libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer(v)).Ftreefree = (*Tsubre)(unsafe.Pointer(ret)).Fleft } else { ret = XTclpAlloc(tls, uint64(120)) if ret == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v1 return libc.UintptrFromInt32(0) } (*Tsubre)(unsafe.Pointer(ret)).Fchain = (*Tvars)(unsafe.Pointer(v)).Ftreechain (*Tvars)(unsafe.Pointer(v)).Ftreechain = ret } (*Tsubre)(unsafe.Pointer(ret)).Fop = libc.Uint8FromInt32(op) (*Tsubre)(unsafe.Pointer(ret)).Fflags = libc.Uint8FromInt32(flags) (*Tsubre)(unsafe.Pointer(ret)).Fid = 0 /* will be assigned later */ (*Tsubre)(unsafe.Pointer(ret)).Fsubno = 0 v2 = libc.Int16FromInt32(1) (*Tsubre)(unsafe.Pointer(ret)).Fmax = v2 (*Tsubre)(unsafe.Pointer(ret)).Fmin = v2 (*Tsubre)(unsafe.Pointer(ret)).Fleft = libc.UintptrFromInt32(0) (*Tsubre)(unsafe.Pointer(ret)).Fright = libc.UintptrFromInt32(0) (*Tsubre)(unsafe.Pointer(ret)).Fbegin = begin (*Tsubre)(unsafe.Pointer(ret)).Fend = end (*Tsubre)(unsafe.Pointer(ret)).Fcnfa.Fnstates = uint64(0) return ret } // C documentation // // /* // - freesubre - free a subRE subtree // ^ static void freesubre(struct vars *, struct subre *); // */ func _freesubre(tls *libc.TLS, v uintptr, sr uintptr) { if sr == libc.UintptrFromInt32(0) { return } if (*Tsubre)(unsafe.Pointer(sr)).Fleft != libc.UintptrFromInt32(0) { _freesubre(tls, v, (*Tsubre)(unsafe.Pointer(sr)).Fleft) } if (*Tsubre)(unsafe.Pointer(sr)).Fright != libc.UintptrFromInt32(0) { _freesubre(tls, v, (*Tsubre)(unsafe.Pointer(sr)).Fright) } _freesrnode(tls, v, sr) } // C documentation // // /* // - freesrnode - free one node in a subRE subtree // ^ static void freesrnode(struct vars *, struct subre *); // */ func _freesrnode(tls *libc.TLS, v uintptr, sr uintptr) { if sr == libc.UintptrFromInt32(0) { return } if !((*Tsubre)(unsafe.Pointer(sr)).Fcnfa.Fnstates == libc.Uint64FromInt32(0)) { _freecnfa(tls, sr+48) } (*Tsubre)(unsafe.Pointer(sr)).Fflags = uint8(0) if v != libc.UintptrFromInt32(0) && (*Tvars)(unsafe.Pointer(v)).Ftreechain != libc.UintptrFromInt32(0) { /* we're still parsing, maybe we can reuse the subre */ (*Tsubre)(unsafe.Pointer(sr)).Fleft = (*Tvars)(unsafe.Pointer(v)).Ftreefree (*Tvars)(unsafe.Pointer(v)).Ftreefree = sr } else { XTclpFree(tls, sr) } } // C documentation // // /* // - numst - number tree nodes (assigning "id" indexes) // ^ static int numst(struct subre *, int); // */ func _numst(tls *libc.TLS, t uintptr, start int32) (r int32) { /* starting point for subtree numbers */ var i, v1 int32 _, _ = i, v1 i = start v1 = i i++ (*Tsubre)(unsafe.Pointer(t)).Fid = int16(v1) if (*Tsubre)(unsafe.Pointer(t)).Fleft != libc.UintptrFromInt32(0) { i = _numst(tls, (*Tsubre)(unsafe.Pointer(t)).Fleft, i) } if (*Tsubre)(unsafe.Pointer(t)).Fright != libc.UintptrFromInt32(0) { i = _numst(tls, (*Tsubre)(unsafe.Pointer(t)).Fright, i) } return i } // C documentation // // /* // - markst - mark tree nodes as INUSE // * Note: this is a great deal more subtle than it looks. During initial // * parsing of a regex, all subres are linked into the treechain list; // * discarded ones are also linked into the treefree list for possible reuse. // * After we are done creating all subres required for a regex, we run markst() // * then cleanst(), which results in discarding all subres not reachable from // * v->tree. We then clear v->treechain, indicating that subres must be found // * by descending from v->tree. This changes the behavior of freesubre(): it // * will henceforth FREE() unwanted subres rather than sticking them into the // * treefree list. (Doing that any earlier would result in dangling links in // * the treechain list.) This all means that freev() will clean up correctly // * if invoked before or after markst()+cleanst(); but it would not work if // * called partway through this state conversion, so we mustn't error out // * in or between these two functions. // ^ static void markst(struct subre *); // */ func _markst(tls *libc.TLS, t uintptr) { var p1 uintptr _ = p1 p1 = t + 1 *(*uint8)(unsafe.Pointer(p1)) = uint8(int32(*(*uint8)(unsafe.Pointer(p1))) | libc.Int32FromInt32(INUSE)) if (*Tsubre)(unsafe.Pointer(t)).Fleft != libc.UintptrFromInt32(0) { _markst(tls, (*Tsubre)(unsafe.Pointer(t)).Fleft) } if (*Tsubre)(unsafe.Pointer(t)).Fright != libc.UintptrFromInt32(0) { _markst(tls, (*Tsubre)(unsafe.Pointer(t)).Fright) } } // C documentation // // /* // - cleanst - free any tree nodes not marked INUSE // ^ static void cleanst(struct vars *); // */ func _cleanst(tls *libc.TLS, v uintptr) { var next, t uintptr _, _ = next, t t = (*Tvars)(unsafe.Pointer(v)).Ftreechain for { if !(t != libc.UintptrFromInt32(0)) { break } next = (*Tsubre)(unsafe.Pointer(t)).Fchain if !(libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fflags)&libc.Int32FromInt32(INUSE) != 0) { XTclpFree(tls, t) } goto _1 _1: ; t = next } (*Tvars)(unsafe.Pointer(v)).Ftreechain = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Ftreefree = libc.UintptrFromInt32(0) /* just on general principles */ } // C documentation // // /* // - nfatree - turn a subRE subtree into a tree of compacted NFAs // ^ static long nfatree(struct vars *, struct subre *, FILE *); // */ func _nfatree(tls *libc.TLS, v uintptr, t uintptr, f uintptr) (r int64) { /* for debug output */ if (*Tsubre)(unsafe.Pointer(t)).Fleft != libc.UintptrFromInt32(0) { _nfatree(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft, f) } if (*Tsubre)(unsafe.Pointer(t)).Fright != libc.UintptrFromInt32(0) { _nfatree(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fright, f) } return _nfanode(tls, v, t, f) } // C documentation // // /* // - nfanode - do one NFA for nfatree // ^ static long nfanode(struct vars *, struct subre *, FILE *); // */ func _nfanode(tls *libc.TLS, v uintptr, t uintptr, f uintptr) (r int64) { bp := tls.Alloc(80) defer tls.Free(80) /* for debug output */ var nfa uintptr var ret int64 var _ /* idbuf at bp+0 */ [50]uint8 _, _ = nfa, ret ret = 0 if f != libc.UintptrFromInt32(0) { libc.Xfprintf(tls, f, __ccgo_ts+128, libc.VaList(bp+64, _stid(tls, t, bp, uint64(50)))) } nfa = _newnfa(tls, v, (*Tvars)(unsafe.Pointer(v)).Fcm, (*Tvars)(unsafe.Pointer(v)).Fnfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return 0 } _dupnfa(tls, nfa, (*Tsubre)(unsafe.Pointer(t)).Fbegin, (*Tsubre)(unsafe.Pointer(t)).Fend, (*Tnfa)(unsafe.Pointer(nfa)).Finit1, (*Tnfa)(unsafe.Pointer(nfa)).Ffinal) if !((*Tvars)(unsafe.Pointer(v)).Ferr != libc.Int32FromInt32(0)) { _specialcolors(tls, nfa) ret = _optimize(tls, nfa, f) } if !((*Tvars)(unsafe.Pointer(v)).Ferr != libc.Int32FromInt32(0)) { _compact(tls, nfa, t+48) } _freenfa(tls, nfa) return ret } // C documentation // // /* // - newlacon - allocate a lookahead-constraint subRE // ^ static int newlacon(struct vars *, struct state *, struct state *, int); // */ func _newlacon(tls *libc.TLS, v uintptr, begin uintptr, end uintptr, pos int32) (r int32) { var n, v1 int32 var newlacons, sub uintptr _, _, _, _ = n, newlacons, sub, v1 if (*Tvars)(unsafe.Pointer(v)).Fnlacons == uint64(0) { n = int32(1) /* skip 0th */ newlacons = XTclpAlloc(tls, libc.Uint64FromInt32(2)*libc.Uint64FromInt64(120)) } else { n = libc.Int32FromUint64((*Tvars)(unsafe.Pointer(v)).Fnlacons) newlacons = XTclpRealloc(tls, (*Tvars)(unsafe.Pointer(v)).Flacons, libc.Uint64FromInt32(n+libc.Int32FromInt32(1))*uint64(120)) } if newlacons == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v1 return 0 } (*Tvars)(unsafe.Pointer(v)).Flacons = newlacons (*Tvars)(unsafe.Pointer(v)).Fnlacons = libc.Uint64FromInt32(n + int32(1)) sub = (*Tvars)(unsafe.Pointer(v)).Flacons + uintptr(n)*120 (*Tsubre)(unsafe.Pointer(sub)).Fbegin = begin (*Tsubre)(unsafe.Pointer(sub)).Fend = end (*Tsubre)(unsafe.Pointer(sub)).Fsubno = pos (*Tsubre)(unsafe.Pointer(sub)).Fcnfa.Fnstates = uint64(0) return n } // C documentation // // /* // - freelacons - free lookahead-constraint subRE vector // ^ static void freelacons(struct subre *, int); // */ func _freelacons(tls *libc.TLS, subs uintptr, n int32) { var i int32 var sub uintptr _, _ = i, sub sub = subs + uintptr(1)*120 i = n - libc.Int32FromInt32(1) for { if !(i > 0) { break } /* no 0th */ if !((*Tsubre)(unsafe.Pointer(sub)).Fcnfa.Fnstates == libc.Uint64FromInt32(0)) { _freecnfa(tls, sub+48) } goto _1 _1: ; sub += 120 i-- } XTclpFree(tls, subs) } // C documentation // // /* // - rfree - free a whole RE (insides of regfree) // ^ static void rfree(regex_t *); // */ func _rfree(tls *libc.TLS, re uintptr) { var g uintptr _ = g if re == libc.UintptrFromInt32(0) || (*Tregex_t)(unsafe.Pointer(re)).Fre_magic != int32(REMAGIC) { return } (*Tregex_t)(unsafe.Pointer(re)).Fre_magic = 0 /* invalidate RE */ g = (*Tregex_t)(unsafe.Pointer(re)).Fre_guts (*Tregex_t)(unsafe.Pointer(re)).Fre_guts = libc.UintptrFromInt32(0) (*Tregex_t)(unsafe.Pointer(re)).Fre_fns = libc.UintptrFromInt32(0) if g != libc.UintptrFromInt32(0) { (*Tguts)(unsafe.Pointer(g)).Fmagic = 0 _freecm(tls, g+104) if (*Tguts)(unsafe.Pointer(g)).Ftree != libc.UintptrFromInt32(0) { _freesubre(tls, libc.UintptrFromInt32(0), (*Tguts)(unsafe.Pointer(g)).Ftree) } if (*Tguts)(unsafe.Pointer(g)).Flacons != libc.UintptrFromInt32(0) { _freelacons(tls, (*Tguts)(unsafe.Pointer(g)).Flacons, libc.Int32FromUint64((*Tguts)(unsafe.Pointer(g)).Fnlacons)) } if !((*Tguts)(unsafe.Pointer(g)).Fsearch.Fnstates == libc.Uint64FromInt32(0)) { _freecnfa(tls, g+32) } XTclpFree(tls, g) } } // C documentation // // /* // - dump - dump an RE in human-readable form // ^ static void dump(regex_t *, FILE *); // */ func _dump(tls *libc.TLS, re uintptr, f uintptr) { _ = re _ = f } // C documentation // // /* // - dumpst - dump a subRE tree // ^ static void dumpst(struct subre *, FILE *, int); // */ func _dumpst(tls *libc.TLS, t uintptr, f uintptr, nfapresent int32) { /* is the original NFA still around? */ if t == libc.UintptrFromInt32(0) { libc.Xfprintf(tls, f, __ccgo_ts+166, 0) } else { _stdump(tls, t, f, nfapresent) } libc.Xfflush(tls, f) } // C documentation // // /* // - stdump - recursive guts of dumpst // ^ static void stdump(struct subre *, FILE *, int); // */ func _stdump(tls *libc.TLS, t uintptr, f uintptr, nfapresent int32) { bp := tls.Alloc(80) defer tls.Free(80) /* is the original NFA still around? */ var _ /* idbuf at bp+0 */ [50]uint8 libc.Xfprintf(tls, f, __ccgo_ts+177, libc.VaList(bp+64, _stid(tls, t, bp, uint64(50)), libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fop))) if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fflags)&int32(LONGER) != 0 { libc.Xfprintf(tls, f, __ccgo_ts+186, 0) } if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fflags)&int32(SHORTER) != 0 { libc.Xfprintf(tls, f, __ccgo_ts+195, 0) } if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fflags)&int32(MIXED) != 0 { libc.Xfprintf(tls, f, __ccgo_ts+205, 0) } if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fflags)&int32(CAP) != 0 { libc.Xfprintf(tls, f, __ccgo_ts+215, 0) } if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fflags)&int32(BACKR) != 0 { libc.Xfprintf(tls, f, __ccgo_ts+227, 0) } if !(libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fflags)&libc.Int32FromInt32(INUSE) != 0) { libc.Xfprintf(tls, f, __ccgo_ts+239, 0) } if (*Tsubre)(unsafe.Pointer(t)).Fsubno != 0 { libc.Xfprintf(tls, f, __ccgo_ts+247, libc.VaList(bp+64, (*Tsubre)(unsafe.Pointer(t)).Fsubno)) } if int32((*Tsubre)(unsafe.Pointer(t)).Fmin) != int32(1) || int32((*Tsubre)(unsafe.Pointer(t)).Fmax) != int32(1) { libc.Xfprintf(tls, f, __ccgo_ts+254, libc.VaList(bp+64, int32((*Tsubre)(unsafe.Pointer(t)).Fmin))) if int32((*Tsubre)(unsafe.Pointer(t)).Fmax) != libc.Int32FromInt32(_POSIX2_RE_DUP_MAX)+libc.Int32FromInt32(1) { libc.Xfprintf(tls, f, __ccgo_ts+260, libc.VaList(bp+64, int32((*Tsubre)(unsafe.Pointer(t)).Fmax))) } libc.Xfprintf(tls, f, __ccgo_ts+263, 0) } if nfapresent != 0 { libc.Xfprintf(tls, f, __ccgo_ts+265, libc.VaList(bp+64, (*Tstate)(unsafe.Pointer((*Tsubre)(unsafe.Pointer(t)).Fbegin)).Fno, (*Tstate)(unsafe.Pointer((*Tsubre)(unsafe.Pointer(t)).Fend)).Fno)) } if (*Tsubre)(unsafe.Pointer(t)).Fleft != libc.UintptrFromInt32(0) { libc.Xfprintf(tls, f, __ccgo_ts+274, libc.VaList(bp+64, _stid(tls, (*Tsubre)(unsafe.Pointer(t)).Fleft, bp, uint64(50)))) } if (*Tsubre)(unsafe.Pointer(t)).Fright != libc.UintptrFromInt32(0) { libc.Xfprintf(tls, f, __ccgo_ts+280, libc.VaList(bp+64, _stid(tls, (*Tsubre)(unsafe.Pointer(t)).Fright, bp, uint64(50)))) } if !((*Tsubre)(unsafe.Pointer(t)).Fcnfa.Fnstates == libc.Uint64FromInt32(0)) { libc.Xfprintf(tls, f, __ccgo_ts+286, 0) _dumpcnfa(tls, t+48, f) } libc.Xfprintf(tls, f, __ccgo_ts+286, 0) if (*Tsubre)(unsafe.Pointer(t)).Fleft != libc.UintptrFromInt32(0) { _stdump(tls, (*Tsubre)(unsafe.Pointer(t)).Fleft, f, nfapresent) } if (*Tsubre)(unsafe.Pointer(t)).Fright != libc.UintptrFromInt32(0) { _stdump(tls, (*Tsubre)(unsafe.Pointer(t)).Fright, f, nfapresent) } } // C documentation // // /* // - stid - identify a subtree node for dumping // ^ static const char *stid(struct subre *, char *, size_t); // */ func _stid(tls *libc.TLS, t uintptr, buf uintptr, bufsize Tsize_t) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* * Big enough for hex int or decimal t->id? */ if bufsize < libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt32(3) || bufsize < libc.Uint64FromInt64(2)*libc.Uint64FromInt32(3)+libc.Uint64FromInt32(1) { return __ccgo_ts + 288 } if int32((*Tsubre)(unsafe.Pointer(t)).Fid) != 0 { libc.X__builtin_snprintf(tls, buf, bufsize, __ccgo_ts+260, libc.VaList(bp+8, int32((*Tsubre)(unsafe.Pointer(t)).Fid))) } else { libc.X__builtin_snprintf(tls, buf, bufsize, __ccgo_ts+295, libc.VaList(bp+8, t)) } return buf } /* * lexical analyzer * This file is #included by regcomp.c. * * Copyright © 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 * Corporation, none of whom are responsible for the results. The author * thanks all of them. * * Redistribution and use in source and binary forms -- with or without * modification -- are permitted for any purpose, provided that * redistributions in source form retain this entire copyright notice and * indicate the origin and nature of any modifications. * * I'd appreciate being given credit for this package in the documentation of * software which uses it, but that is not a requirement. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* scanning macros (know about v) */ /* lexical contexts */ /* construct pointer past end of chr array */ // C documentation // // /* // - lexstart - set up lexical stuff, scan leading options // ^ static void lexstart(struct vars *); // */ func _lexstart(tls *libc.TLS, v uintptr) { _prefixes(tls, v) /* may turn on new type bits etc. */ if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return } if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_QUOTE) != 0 { (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_Q) } else { if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_EXTENDED) != 0 { (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_ERE) } else { (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_BRE) } } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('n') /* remember we were at the start */ _next(tls, v) /* set up the first token */ } // C documentation // // /* // - prefixes - implement various special prefixes // ^ static void prefixes(struct vars *); // */ func _prefixes(tls *libc.TLS, v uintptr) { var v1, v2, v4, v5 int32 _, _, _, _ = v1, v2, v4, v5 /* * Literal string doesn't get any of this stuff. */ if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_QUOTE) != 0 { return } /* * Initial "***" gets special things. */ if (int64((*Tvars)(unsafe.Pointer(v)).Fstop)-int64((*Tvars)(unsafe.Pointer(v)).Fnow))/4 >= int64(libc.Int32FromInt32(4)) && ((int64((*Tvars)(unsafe.Pointer(v)).Fstop)-int64((*Tvars)(unsafe.Pointer(v)).Fnow))/4 >= int64(libc.Int32FromInt32(3)) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('*'))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(1)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('*'))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(2)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('*')))) { switch *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(3)*4)) { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('?'))): /* "***?" error, msg shows version */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_BADPAT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v1 return /* proceed no further */ case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('='))): /* "***=" shifts to literal string */ *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) *(*int32)(unsafe.Pointer(v + 44)) |= int32(REG_QUOTE) *(*int32)(unsafe.Pointer(v + 44)) &= ^(libc.Int32FromInt32(REG_ADVANCED) | libc.Int32FromInt32(REG_EXPANDED) | libc.Int32FromInt32(REG_NEWLINE)) *(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(4) * 4 return /* and there can be no more prefixes */ case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))): /* "***:" shifts to AREs */ *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) *(*int32)(unsafe.Pointer(v + 44)) |= int32(REG_ADVANCED) *(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(4) * 4 default: /* otherwise *** is just an error */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v2 = int32(REG_BADRPT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v2 return break } } /* * BREs and EREs don't get embedded options. */ if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ADVANCED) != int32(REG_ADVANCED) { return } /* * Embedded options (AREs only). */ if (int64((*Tvars)(unsafe.Pointer(v)).Fstop)-int64((*Tvars)(unsafe.Pointer(v)).Fnow))/4 >= int64(libc.Int32FromInt32(3)) && ((int64((*Tvars)(unsafe.Pointer(v)).Fstop)-int64((*Tvars)(unsafe.Pointer(v)).Fnow))/4 >= int64(libc.Int32FromInt32(2)) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('('))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(1)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('?')))) && XTcl_UniCharIsAlpha(tls, *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(2)*4))) != 0 { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) *(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(2) * 4 for { if !(!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && XTcl_UniCharIsAlpha(tls, *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow))) != 0) { break } switch *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('b'))): /* BREs (but why???) */ *(*int32)(unsafe.Pointer(v + 44)) &= ^(libc.Int32FromInt32(REG_ADVANCED) | libc.Int32FromInt32(REG_QUOTE)) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('c'))): /* case sensitive */ *(*int32)(unsafe.Pointer(v + 44)) &= ^libc.Int32FromInt32(REG_ICASE) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('e'))): /* plain EREs */ *(*int32)(unsafe.Pointer(v + 44)) |= int32(REG_EXTENDED) *(*int32)(unsafe.Pointer(v + 44)) &= ^(libc.Int32FromInt32(REG_ADVF) | libc.Int32FromInt32(REG_QUOTE)) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('i'))): /* case insensitive */ *(*int32)(unsafe.Pointer(v + 44)) |= int32(REG_ICASE) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('m'))): /* Perloid synonym for n */ fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('n'))): /* \n affects ^ $ . [^ */ *(*int32)(unsafe.Pointer(v + 44)) |= int32(REG_NEWLINE) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('p'))): /* ~Perl, \n affects . [^ */ *(*int32)(unsafe.Pointer(v + 44)) |= int32(REG_NLSTOP) *(*int32)(unsafe.Pointer(v + 44)) &= ^libc.Int32FromInt32(REG_NLANCH) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('q'))): /* literal string */ *(*int32)(unsafe.Pointer(v + 44)) |= int32(REG_QUOTE) *(*int32)(unsafe.Pointer(v + 44)) &= ^libc.Int32FromInt32(REG_ADVANCED) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('s'))): /* single line, \n ordinary */ *(*int32)(unsafe.Pointer(v + 44)) &= ^libc.Int32FromInt32(REG_NEWLINE) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('t'))): /* tight syntax */ *(*int32)(unsafe.Pointer(v + 44)) &= ^libc.Int32FromInt32(REG_EXPANDED) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('w'))): /* weird, \n affects ^ $ only */ *(*int32)(unsafe.Pointer(v + 44)) &= ^libc.Int32FromInt32(REG_NLSTOP) *(*int32)(unsafe.Pointer(v + 44)) |= int32(REG_NLANCH) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('x'))): /* expanded syntax */ *(*int32)(unsafe.Pointer(v + 44)) |= int32(REG_EXPANDED) default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v4 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v4 = int32(REG_BADOPT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v4 return } goto _3 _3: ; (*Tvars)(unsafe.Pointer(v)).Fnow += 4 } if !(!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(')')))) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v5 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v5 = int32(REG_BADOPT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v5 return } (*Tvars)(unsafe.Pointer(v)).Fnow += 4 if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_QUOTE) != 0 { *(*int32)(unsafe.Pointer(v + 44)) &= ^(libc.Int32FromInt32(REG_EXPANDED) | libc.Int32FromInt32(REG_NEWLINE)) } } } // C documentation // // /* // - lexnest - "call a subroutine", interpolating string at the lexical level // * Note, this is not a very general facility. There are a number of // * implicit assumptions about what sorts of strings can be subroutines. // ^ static void lexnest(struct vars *, const chr *, const chr *); // */ func _lexnest(tls *libc.TLS, v uintptr, beginp uintptr, endp uintptr) { /* one past end of interpolation */ /* only one level of nesting */ (*Tvars)(unsafe.Pointer(v)).Fsavenow = (*Tvars)(unsafe.Pointer(v)).Fnow (*Tvars)(unsafe.Pointer(v)).Fsavestop = (*Tvars)(unsafe.Pointer(v)).Fstop (*Tvars)(unsafe.Pointer(v)).Fnow = beginp (*Tvars)(unsafe.Pointer(v)).Fstop = endp } /* * string constants to interpolate as expansions of things like \d */ var _backd = [11]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('d'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('i'))), 5: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('g'))), 6: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('i'))), 7: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('t'))), 8: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 9: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), 10: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), } var _backD = [12]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('^'))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('d'))), 5: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('i'))), 6: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('g'))), 7: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('i'))), 8: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('t'))), 9: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 10: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), 11: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), } var _brbackd = [9]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('d'))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('i'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('g'))), 5: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('i'))), 6: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('t'))), 7: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 8: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), } var _backs = [11]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('s'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('p'))), 5: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('a'))), 6: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('c'))), 7: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('e'))), 8: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 9: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), 10: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), } var _backS = [12]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('^'))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('s'))), 5: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('p'))), 6: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('a'))), 7: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('c'))), 8: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('e'))), 9: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 10: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), 11: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), } var _brbacks = [9]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('s'))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('p'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('a'))), 5: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('c'))), 6: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('e'))), 7: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 8: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), } var _backw = [21]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('a'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('l'))), 5: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('n'))), 6: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('u'))), 7: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('m'))), 8: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 9: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), 10: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('_'))), 11: int32(0x203F), 12: int32(0x2040), 13: int32(0x2054), 14: int32(0xFE33), 15: int32(0xFE34), 16: int32(0xFE4D), 17: int32(0xFE4E), 18: int32(0xFE4F), 19: int32(0xFF3F), 20: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), } var _backW = [22]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('^'))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('a'))), 5: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('l'))), 6: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('n'))), 7: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('u'))), 8: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('m'))), 9: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 10: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), 11: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('_'))), 12: int32(0x203F), 13: int32(0x2040), 14: int32(0x2054), 15: int32(0xFE33), 16: int32(0xFE34), 17: int32(0xFE4D), 18: int32(0xFE4E), 19: int32(0xFE4F), 20: int32(0xFF3F), 21: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), } var _brbackw = [19]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('a'))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('l'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('n'))), 5: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('u'))), 6: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('m'))), 7: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))), 8: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))), 9: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('_'))), 10: int32(0x203F), 11: int32(0x2040), 12: int32(0x2054), 13: int32(0xFE33), 14: int32(0xFE34), 15: int32(0xFE4D), 16: int32(0xFE4E), 17: int32(0xFE4F), 18: int32(0xFF3F), } // C documentation // // /* // - lexword - interpolate a bracket expression for word characters // * Possibly ought to inquire whether there is a "word" character class. // ^ static void lexword(struct vars *); // */ func _lexword(tls *libc.TLS, v uintptr) { _lexnest(tls, v, uintptr(unsafe.Pointer(&_backw)), uintptr(unsafe.Pointer(&_backw))+uintptr(libc.Uint64FromInt64(84)/libc.Uint64FromInt64(4))*4) } // C documentation // // /* // - next - get next token // ^ static int next(struct vars *); // */ func _next(tls *libc.TLS, v uintptr) (r int32) { var c Tchr var v1, v14, v15, v16, v17, v29, v30, v4, v5 uintptr var v10, v11, v12, v13, v2, v26, v27, v28, v3, v31, v32, v6, v7, v8, v9 int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, v1, v10, v11, v12, v13, v14, v15, v16, v17, v2, v26, v27, v28, v29, v3, v30, v31, v32, v4, v5, v6, v7, v8, v9 /* * Errors yield an infinite sequence of failures. */ if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return 0 /* the error has set nexttype to EOS */ } /* * Remember flavor of last token. */ (*Tvars)(unsafe.Pointer(v)).Flasttype = (*Tvars)(unsafe.Pointer(v)).Fnexttype /* * REG_BOSONLY */ if (*Tvars)(unsafe.Pointer(v)).Fnexttype == int32('n') && (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_BOSONLY) != 0 { /* at start of a REG_BOSONLY RE */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('A') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) /* same as \A */ } /* * If we're nested and we've hit end, return to outer level. */ if (*Tvars)(unsafe.Pointer(v)).Fsavenow != libc.UintptrFromInt32(0) && (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop { (*Tvars)(unsafe.Pointer(v)).Fnow = (*Tvars)(unsafe.Pointer(v)).Fsavenow (*Tvars)(unsafe.Pointer(v)).Fstop = (*Tvars)(unsafe.Pointer(v)).Fsavestop v1 = libc.UintptrFromInt32(0) (*Tvars)(unsafe.Pointer(v)).Fsavestop = v1 (*Tvars)(unsafe.Pointer(v)).Fsavenow = v1 } /* * Skip white space etc. if appropriate (not in literal or []) */ if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_EXPANDED) != 0 { switch (*Tvars)(unsafe.Pointer(v)).Flexcon { case int32(L_ERE): fallthrough case int32(L_BRE): fallthrough case int32(L_EBND): fallthrough case int32(L_BBND): _skip(tls, v) break } } /* * Handle EOS, depending on context. */ if (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop { switch (*Tvars)(unsafe.Pointer(v)).Flexcon { case int32(L_ERE): fallthrough case int32(L_BRE): fallthrough case int32(L_Q): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') return libc.Int32FromInt32(1) case int32(L_EBND): fallthrough case int32(L_BBND): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v2 = int32(REG_EBRACE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v2 return libc.Int32FromInt32(0) case int32(L_BRACK): fallthrough case int32(L_CEL): fallthrough case int32(L_ECL): fallthrough case int32(L_CCL): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v3 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v3 = int32(REG_EBRACK) } (*Tvars)(unsafe.Pointer(v)).Ferr = v3 return libc.Int32FromInt32(0) break } } /* * Okay, time to actually get a character. */ v5 = v + 8 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5)) += 4 c = *(*Tchr)(unsafe.Pointer(v4)) /* * Deal with the easy contexts, punt EREs to code below. */ switch (*Tvars)(unsafe.Pointer(v)).Flexcon { case int32(L_BRE): /* punt BREs to separate function */ return _brenext(tls, v, c) case int32(L_ERE): /* see below */ case int32(L_Q): /* literal strings are easy */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) case int32(L_BBND): /* bounds are fairly simple */ fallthrough case int32(L_EBND): switch c { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('0'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('1'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('2'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('3'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('4'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('5'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('6'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('7'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('8'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('9'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('d') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c - libc.Int32FromUint8('0')) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(','))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32(',') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('}'))): /* ERE bound ends with } */ if (*Tvars)(unsafe.Pointer(v)).Flexcon == int32(L_EBND) { (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_ERE) if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ADVF) != 0 && (!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('?')))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('}') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('}') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) } else { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v6 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v6 = int32(REG_BADBR) } (*Tvars)(unsafe.Pointer(v)).Ferr = v6 return libc.Int32FromInt32(0) } case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('\\'))): /* BRE bound ends with \} */ if (*Tvars)(unsafe.Pointer(v)).Flexcon == int32(L_BBND) && (!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('}')))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_BRE) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('}') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) } else { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v7 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v7 = int32(REG_BADBR) } (*Tvars)(unsafe.Pointer(v)).Ferr = v7 return libc.Int32FromInt32(0) } default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v8 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v8 = int32(REG_BADBR) } (*Tvars)(unsafe.Pointer(v)).Ferr = v8 return libc.Int32FromInt32(0) break } case int32(L_BRACK): /* brackets are not too hard */ switch c { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))): if (*Tvars)(unsafe.Pointer(v)).Flasttype == int32('[') { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } else { if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_EXTENDED) != 0 { v9 = int32(L_ERE) } else { v9 = int32(L_BRE) } (*Tvars)(unsafe.Pointer(v)).Flexcon = v9 (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32(']') return libc.Int32FromInt32(1) } case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('\\'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UBBS)) if !((*Tvars)(unsafe.Pointer(v)).Fcflags&libc.Int32FromInt32(REG_ADVF) != 0) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) if (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v10 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v10 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v10 return libc.Int32FromInt32(0) } _lexescape(tls, v) switch (*Tvars)(unsafe.Pointer(v)).Fnexttype { /* not all escapes okay here */ case int32('p'): return int32(1) case int32('C'): switch (*Tvars)(unsafe.Pointer(v)).Fnextvalue { case uint64('d'): _lexnest(tls, v, uintptr(unsafe.Pointer(&_brbackd)), uintptr(unsafe.Pointer(&_brbackd))+uintptr(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4))*4) case uint64('s'): _lexnest(tls, v, uintptr(unsafe.Pointer(&_brbacks)), uintptr(unsafe.Pointer(&_brbacks))+uintptr(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4))*4) case uint64('w'): _lexnest(tls, v, uintptr(unsafe.Pointer(&_brbackw)), uintptr(unsafe.Pointer(&_brbackw))+uintptr(libc.Uint64FromInt64(76)/libc.Uint64FromInt64(4))*4) default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v11 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v11 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v11 return libc.Int32FromInt32(0) break } /* * lexnest() done, back up and try again. */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = (*Tvars)(unsafe.Pointer(v)).Flasttype return _next(tls, v) break } /* * Not one of the acceptable escapes. */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v12 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v12 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v12 return libc.Int32FromInt32(0) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('-'))): if (*Tvars)(unsafe.Pointer(v)).Flasttype == int32('[') || !((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } else { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('R') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))): if (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v13 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v13 = int32(REG_EBRACK) } (*Tvars)(unsafe.Pointer(v)).Ferr = v13 return libc.Int32FromInt32(0) } v15 = v + 8 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15)) += 4 switch *(*Tchr)(unsafe.Pointer(v14)) { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('.'))): (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_CEL) /* * Might or might not be locale-specific. */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('I') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('='))): (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_ECL) *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('E') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))): (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_CCL) *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('C') return libc.Int32FromInt32(1) default: /* oops */ (*Tvars)(unsafe.Pointer(v)).Fnow -= 4 (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) break } default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) break } case int32(L_CEL): /* collating elements are easy */ if c == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('.'))) && (!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']')))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_BRACK) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('X') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromUint8('.')) return libc.Int32FromInt32(1) } else { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } case int32(L_ECL): /* ditto equivalence classes */ if c == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('='))) && (!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']')))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_BRACK) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('X') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromUint8('=')) return libc.Int32FromInt32(1) } else { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } case int32(L_CCL): /* ditto character classes */ if c == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))) && (!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']')))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_BRACK) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('X') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromUint8(':')) return libc.Int32FromInt32(1) } else { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } default: break } /* * That got rid of everything except EREs and AREs. */ /* * Deal with EREs and AREs, except for backslashes. */ switch c { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('|'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('|') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('*'))): if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ADVF) != 0 && (!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('?')))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('*') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('*') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('+'))): if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ADVF) != 0 && (!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('?')))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('+') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('+') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('?'))): if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ADVF) != 0 && (!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('?')))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('?') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('?') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('{'))): /* bounds start or plain character */ if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_EXPANDED) != 0 { _skip(tls, v) } if (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop || !(XTcl_UniCharIsDigit(tls, *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow))) != 0) { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UBRACES)) *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNSPEC)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } else { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UBOUNDS)) (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_EBND) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('{') return libc.Int32FromInt32(1) } case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('('))): /* parenthesis, or advanced extension */ if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_ADVF) != 0 && (!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('?')))) { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) (*Tvars)(unsafe.Pointer(v)).Fnow += 4 v17 = v + 8 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17)) += 4 switch *(*Tchr)(unsafe.Pointer(v16)) { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))): goto _18 case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('#'))): goto _19 case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('='))): goto _20 case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('!'))): goto _21 default: goto _22 } goto _23 _18: ; /* non-capturing paren */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('(') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) goto _23 _19: ; /* comment */ _25: ; if !(!((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) != libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(')')))) { goto _24 } (*Tvars)(unsafe.Pointer(v)).Fnow += 4 goto _25 _24: ; if !((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 } return _next(tls, v) goto _23 _20: ; /* positive lookahead */ *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOOKAHEAD)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('L') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) goto _23 _21: ; /* negative lookahead */ *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOOKAHEAD)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('L') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) goto _23 _22: ; (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v26 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v26 = int32(REG_BADRPT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v26 return libc.Int32FromInt32(0) goto _23 _23: } if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_NOSUB) != 0 { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('(') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) /* all parens non-capturing */ } else { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('(') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) } case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(')'))): if (*Tvars)(unsafe.Pointer(v)).Flasttype == int32('(') { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNSPEC)) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32(')') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))): /* easy except for [[:<:]] and [[:>:]] */ if (int64((*Tvars)(unsafe.Pointer(v)).Fstop)-int64((*Tvars)(unsafe.Pointer(v)).Fnow))/4 >= int64(libc.Int32FromInt32(6)) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(0)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(1)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))) && (*(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(2)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('<'))) || *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(2)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('>')))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(3)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(4)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(5)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))) { c = *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(2)*4)) *(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(6) * 4 *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) if c == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('<'))) { v27 = int32('<') } else { v27 = int32('>') } (*Tvars)(unsafe.Pointer(v)).Fnexttype = v27 return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_BRACK) if !((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('^'))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('[') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('[') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('.'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('.') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('^'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('^') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('$'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('$') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('\\'))): /* mostly punt backslashes to code below */ if (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v28 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v28 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v28 return libc.Int32FromInt32(0) } default: /* ordinary character */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) break } /* * ERE/ARE backslash handling; backslash already eaten. */ if !((*Tvars)(unsafe.Pointer(v)).Fcflags&libc.Int32FromInt32(REG_ADVF) != 0) { /* only AREs have non-trivial escapes */ if XTcl_UniCharIsAlnum(tls, *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow))) != 0 { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UBSALNUM)) *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNSPEC)) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') v30 = v + 8 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30)) += 4 (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(*(*Tchr)(unsafe.Pointer(v29))) return libc.Int32FromInt32(1) } _lexescape(tls, v) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v31 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v31 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v31 return libc.Int32FromInt32(0) } if (*Tvars)(unsafe.Pointer(v)).Fnexttype == int32('C') { /* fudge at lexical level */ switch (*Tvars)(unsafe.Pointer(v)).Fnextvalue { case uint64('d'): _lexnest(tls, v, uintptr(unsafe.Pointer(&_backd)), uintptr(unsafe.Pointer(&_backd))+uintptr(libc.Uint64FromInt64(44)/libc.Uint64FromInt64(4))*4) case uint64('D'): _lexnest(tls, v, uintptr(unsafe.Pointer(&_backD)), uintptr(unsafe.Pointer(&_backD))+uintptr(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(4))*4) case uint64('s'): _lexnest(tls, v, uintptr(unsafe.Pointer(&_backs)), uintptr(unsafe.Pointer(&_backs))+uintptr(libc.Uint64FromInt64(44)/libc.Uint64FromInt64(4))*4) case uint64('S'): _lexnest(tls, v, uintptr(unsafe.Pointer(&_backS)), uintptr(unsafe.Pointer(&_backS))+uintptr(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(4))*4) case uint64('w'): _lexnest(tls, v, uintptr(unsafe.Pointer(&_backw)), uintptr(unsafe.Pointer(&_backw))+uintptr(libc.Uint64FromInt64(84)/libc.Uint64FromInt64(4))*4) case uint64('W'): _lexnest(tls, v, uintptr(unsafe.Pointer(&_backW)), uintptr(unsafe.Pointer(&_backW))+uintptr(libc.Uint64FromInt64(88)/libc.Uint64FromInt64(4))*4) default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v32 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v32 = int32(REG_ASSERT) } (*Tvars)(unsafe.Pointer(v)).Ferr = v32 return libc.Int32FromInt32(0) break } /* lexnest done, back up and try again */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = (*Tvars)(unsafe.Pointer(v)).Flasttype return _next(tls, v) } /* * Otherwise, lexescape has already done the work. */ return libc.BoolInt32(!((*Tvars)(unsafe.Pointer(v)).Ferr != libc.Int32FromInt32(0))) } // C documentation // // /* // - lexescape - parse an ARE backslash escape (backslash already eaten) // * Note slightly nonstandard use of the CCLASS type code. // ^ static int lexescape(struct vars *); // */ func _lexescape(tls *libc.TLS, v uintptr) (r int32) { var c Tchr var i, v10, v11, v3, v6, v7, v8, v9 int32 var save, v1, v2, v4, v5 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, i, save, v1, v10, v11, v2, v3, v4, v5, v6, v7, v8, v9 v2 = v + 8 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2)) += 4 c = *(*Tchr)(unsafe.Pointer(v1)) if !(XTcl_UniCharIsAlnum(tls, c) != 0) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) switch c { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('a'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(_chrnamed(tls, v, uintptr(unsafe.Pointer(&_alert)), uintptr(unsafe.Pointer(&_alert))+uintptr(libc.Uint64FromInt64(20)/libc.Uint64FromInt64(4))*4, libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('\x07'))))) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('A'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('A') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('b'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = uint64(libc.Uint8FromInt32(libc.Int32FromUint8('\b'))) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('B'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = uint64(libc.Uint8FromInt32(libc.Int32FromUint8('\\'))) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('c'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNPORT)) if (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v3 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v3 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v3 return libc.Int32FromInt32(0) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') v5 = v + 8 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5)) += 4 (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(*(*Tchr)(unsafe.Pointer(v4)) & libc.Int32FromInt32(037)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('d'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('C') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromUint8('d')) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('D'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('C') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromUint8('D')) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('e'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNPORT)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(_chrnamed(tls, v, uintptr(unsafe.Pointer(&_esc)), uintptr(unsafe.Pointer(&_esc))+uintptr(libc.Uint64FromInt64(12)/libc.Uint64FromInt64(4))*4, libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('\x1B'))))) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('f'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = uint64(libc.Uint8FromInt32(libc.Int32FromUint8('\f'))) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('m'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('<') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('M'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('>') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('n'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = uint64(libc.Uint8FromInt32(libc.Int32FromUint8('\n'))) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('r'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = uint64(libc.Uint8FromInt32(libc.Int32FromUint8('\r'))) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('s'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('C') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromUint8('s')) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('S'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('C') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromUint8('S')) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('t'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = uint64(libc.Uint8FromInt32(libc.Int32FromUint8('\t'))) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('u'))): c = libc.Int32FromUint32(libc.Uint32FromInt32(_lexdigits(tls, v, int32(16), int32(1), int32(4)))) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v6 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v6 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v6 return libc.Int32FromInt32(0) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('U'))): i = _lexdigits(tls, v, int32(16), int32(1), int32(8)) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v7 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v7 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v7 return libc.Int32FromInt32(0) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = uint64(libc.Uint32FromInt32(i)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('v'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = uint64(libc.Uint8FromInt32(libc.Int32FromUint8('\v'))) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('w'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('C') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromUint8('w')) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('W'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('C') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromUint8('W')) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('x'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNPORT)) c = libc.Int32FromUint32(libc.Uint32FromInt32(_lexdigits(tls, v, int32(16), int32(1), int32(2)))) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v8 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v8 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v8 return libc.Int32FromInt32(0) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('y'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('w') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('Y'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('W') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('Z'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('Z') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('1'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('2'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('3'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('4'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('5'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('6'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('7'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('8'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('9'))): save = (*Tvars)(unsafe.Pointer(v)).Fnow (*Tvars)(unsafe.Pointer(v)).Fnow -= 4 /* put first digit back */ c = libc.Int32FromUint32(libc.Uint32FromInt32(_lexdigits(tls, v, int32(10), int32(1), int32(255)))) /* REs >255 long outside spec */ if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v9 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v9 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v9 return libc.Int32FromInt32(0) } /* * Ugly heuristic (first test is "exactly 1 digit?") */ if (int64((*Tvars)(unsafe.Pointer(v)).Fnow)-int64(save))/4 == 0 || c > 0 && libc.Uint64FromInt32(c) <= (*Tvars)(unsafe.Pointer(v)).Fnsubexp { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UBACKREF)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('b') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } /* * Oops, doesn't look like it's a backref after all... */ (*Tvars)(unsafe.Pointer(v)).Fnow = save /* FALLTHRU */ fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('0'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNPORT)) (*Tvars)(unsafe.Pointer(v)).Fnow -= 4 /* put first digit back */ c = libc.Int32FromUint32(libc.Uint32FromInt32(_lexdigits(tls, v, int32(8), int32(1), int32(3)))) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v10 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v10 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v10 return libc.Int32FromInt32(0) } if c > int32(0xFF) { /* out of range, so we handled one digit too much */ (*Tvars)(unsafe.Pointer(v)).Fnow -= 4 c >>= int32(3) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v11 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v11 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v11 return libc.Int32FromInt32(0) /* unknown alphabetic escape */ break } return r } var _alert = [5]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('a'))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('l'))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('e'))), 3: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('r'))), 4: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('t'))), } var _esc = [3]Tchr{ 0: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('E'))), 1: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('S'))), 2: libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('C'))), } // C documentation // // /* // - lexdigits - slurp up digits and return chr value // ^ static int lexdigits(struct vars *, int, int, int); // */ func _lexdigits(tls *libc.TLS, v uintptr, base int32, minlen int32, maxlen int32) (r int32) { var c Tchr var d, len1, n, v4 int32 var ub Tuchr var v2, v3 uintptr _, _, _, _, _, _, _, _ = c, d, len1, n, ub, v2, v3, v4 ub = libc.Uint32FromInt32(base) n = 0 len1 = 0 for { if !(len1 < maxlen && !((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop)) { break } if n > int32(0x10FFF) { /* Stop when continuing would otherwise overflow */ break } v3 = v + 8 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3)) += 4 c = *(*Tchr)(unsafe.Pointer(v2)) switch c { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('0'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('1'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('2'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('3'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('4'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('5'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('6'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('7'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('8'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('9'))): d = c - int32('0') case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('a'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('A'))): d = int32(10) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('b'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('B'))): d = int32(11) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('c'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('C'))): d = int32(12) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('d'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('D'))): d = int32(13) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('e'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('E'))): d = int32(14) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('f'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('F'))): d = int32(15) default: (*Tvars)(unsafe.Pointer(v)).Fnow -= 4 /* oops, not a digit at all */ d = -int32(1) break } if d >= base { /* not a plausible digit */ (*Tvars)(unsafe.Pointer(v)).Fnow -= 4 d = -int32(1) } if d < 0 { break /* NOTE BREAK OUT */ } n = libc.Int32FromUint32(libc.Uint32FromInt32(n)*ub + libc.Uint32FromInt32(d)) goto _1 _1: ; len1++ } if len1 < minlen { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v4 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v4 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v4 } return n } // C documentation // // /* // - brenext - get next BRE token // * This is much like EREs except for all the stupid backslashes and the // * context-dependency of some things. // ^ static int brenext(struct vars *, pchr); // */ func _brenext(tls *libc.TLS, v uintptr, pc Tpchr) (r int32) { var c Tchr var v1, v2 int32 var v3, v4 uintptr _, _, _, _, _ = c, v1, v2, v3, v4 c = pc switch c { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('*'))): if (*Tvars)(unsafe.Pointer(v)).Flasttype == int32('n') || (*Tvars)(unsafe.Pointer(v)).Flasttype == int32('(') || (*Tvars)(unsafe.Pointer(v)).Flasttype == int32('^') { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('*') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))): if (int64((*Tvars)(unsafe.Pointer(v)).Fstop)-int64((*Tvars)(unsafe.Pointer(v)).Fnow))/4 >= int64(libc.Int32FromInt32(6)) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(0)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('['))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(1)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))) && (*(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(2)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('<'))) || *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(2)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('>')))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(3)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(':'))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(4)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(5)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(']'))) { c = *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(2)*4)) *(*uintptr)(unsafe.Pointer(v + 8)) += uintptr(6) * 4 *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) if c == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('<'))) { v1 = int32('<') } else { v1 = int32('>') } (*Tvars)(unsafe.Pointer(v)).Fnexttype = v1 return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_BRACK) if !((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('^'))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('[') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(0)) return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('[') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('.'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('.') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('^'))): if (*Tvars)(unsafe.Pointer(v)).Flasttype == int32('n') { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('^') return libc.Int32FromInt32(1) } if (*Tvars)(unsafe.Pointer(v)).Flasttype == int32('(') { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNSPEC)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('^') return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('$'))): if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_EXPANDED) != 0 { _skip(tls, v) } if (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('$') return libc.Int32FromInt32(1) } if (int64((*Tvars)(unsafe.Pointer(v)).Fstop)-int64((*Tvars)(unsafe.Pointer(v)).Fnow))/4 >= int64(libc.Int32FromInt32(2)) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('\\'))) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow + libc.UintptrFromInt32(1)*4)) == libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(')'))) { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNSPEC)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('$') return libc.Int32FromInt32(1) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('\\'))): default: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) break } if (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v2 = int32(REG_EESCAPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v2 return libc.Int32FromInt32(0) } v4 = v + 8 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4)) += 4 c = *(*Tchr)(unsafe.Pointer(v3)) switch c { case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('{'))): (*Tvars)(unsafe.Pointer(v)).Flexcon = int32(L_BBND) *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UBOUNDS)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('{') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('('))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('(') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(libc.Int32FromInt32(1)) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8(')'))): (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32(')') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('<'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('<') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('>'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('>') return libc.Int32FromInt32(1) case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('1'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('2'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('3'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('4'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('5'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('6'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('7'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('8'))): fallthrough case libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('9'))): *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UBACKREF)) (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('b') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c - libc.Int32FromUint8('0')) return libc.Int32FromInt32(1) default: if XTcl_UniCharIsAlnum(tls, c) != 0 { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UBSALNUM)) *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UUNSPEC)) } (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('p') (*Tvars)(unsafe.Pointer(v)).Fnextvalue = libc.Uint64FromInt32(c) return libc.Int32FromInt32(1) break } return r } // C documentation // // /* // - skip - skip white space and comments in expanded form // ^ static void skip(struct vars *); // */ func _skip(tls *libc.TLS, v uintptr) { var start uintptr _ = start start = (*Tvars)(unsafe.Pointer(v)).Fnow for { for !((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && XTcl_UniCharIsSpace(tls, *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow))) != 0 { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 } if (*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop || *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) != libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('#'))) { break /* NOTE BREAK OUT */ } for !((*Tvars)(unsafe.Pointer(v)).Fnow >= (*Tvars)(unsafe.Pointer(v)).Fstop) && *(*Tchr)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fnow)) != libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('\n'))) { (*Tvars)(unsafe.Pointer(v)).Fnow += 4 } /* * Leave the newline to be picked up by the iscspace loop. */ goto _1 _1: } if (*Tvars)(unsafe.Pointer(v)).Fnow != start { *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_UNONPOSIX)) } } // C documentation // // /* // - newline - return the chr for a newline // * This helps confine use of CHR to this source file. // ^ static chr newline(void); // */ func _newline(tls *libc.TLS) (r Tchr) { return libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromUint8('\n'))) } // C documentation // // /* // - chrnamed - return the chr known by a given (chr string) name // * The code is a bit clumsy, but this routine gets only such specialized // * use that it hardly matters. // ^ static chr chrnamed(struct vars *, const chr *, const chr *, pchr); // */ func _chrnamed(tls *libc.TLS, v uintptr, startp uintptr, endp uintptr, lastresort Tpchr) (r Tchr) { /* what to return if name lookup fails */ var c Tcelt var cv uintptr var e, errsave int32 _, _, _, _ = c, cv, e, errsave errsave = (*Tvars)(unsafe.Pointer(v)).Ferr (*Tvars)(unsafe.Pointer(v)).Ferr = 0 c = _element(tls, v, startp, endp) e = (*Tvars)(unsafe.Pointer(v)).Ferr (*Tvars)(unsafe.Pointer(v)).Ferr = errsave if e != 0 { return lastresort } cv = _range(tls, v, c, c, 0) if (*Tcvec)(unsafe.Pointer(cv)).Fnchrs == uint64(0) { return lastresort } return *(*Tchr)(unsafe.Pointer((*Tcvec)(unsafe.Pointer(cv)).Fchrs)) } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* * colorings of characters * This file is #included by regcomp.c. * * Copyright © 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 * Corporation, none of whom are responsible for the results. The author * thanks all of them. * * Redistribution and use in source and binary forms -- with or without * modification -- are permitted for any purpose, provided that * redistributions in source form retain this entire copyright notice and * indicate the origin and nature of any modifications. * * I'd appreciate being given credit for this package in the documentation of * software which uses it, but that is not a requirement. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Note that there are some incestuous relationships between this code and NFA * arc maintenance, which perhaps ought to be cleaned up sometime. */ // C documentation // // /* // - initcm - set up new colormap // ^ static void initcm(struct vars *, struct colormap *); // */ func _initcm(tls *libc.TLS, v uintptr, cm uintptr) { var cd, nextt, t uintptr var i, j int32 _, _, _, _, _ = cd, i, j, nextt, t (*Tcolormap)(unsafe.Pointer(cm)).Fmagic = int32(CMMAGIC) (*Tcolormap)(unsafe.Pointer(cm)).Fv = v (*Tcolormap)(unsafe.Pointer(cm)).Fncds = libc.Uint64FromInt32(10) (*Tcolormap)(unsafe.Pointer(cm)).Fcd = cm + 48 (*Tcolormap)(unsafe.Pointer(cm)).Fmax = uint64(0) (*Tcolormap)(unsafe.Pointer(cm)).Ffree = 0 cd = (*Tcolormap)(unsafe.Pointer(cm)).Fcd /* cm->cd[WHITE] */ (*Tcolordesc)(unsafe.Pointer(cd)).Fsub = int16(-libc.Int32FromInt32(1)) (*Tcolordesc)(unsafe.Pointer(cd)).Farcs = libc.UintptrFromInt32(0) (*Tcolordesc)(unsafe.Pointer(cd)).Fflags = 0 (*Tcolordesc)(unsafe.Pointer(cd)).Fnchrs = libc.Uint32FromInt32(libc.Int32FromInt32(CHR_MAX) - libc.Int32FromInt32(CHR_MIN) + libc.Int32FromInt32(1)) /* * Upper levels of tree. */ t = cm + 368 j = (libc.Int32FromInt32(CHRBITS)+libc.Int32FromInt32(BYTBITS)-libc.Int32FromInt32(1))/libc.Int32FromInt32(BYTBITS) - libc.Int32FromInt32(1) for { if !(j > 0) { break } nextt = t + uintptr(1)*2048 i = libc.Int32FromInt32(1)<= 0) { break } *(*uintptr)(unsafe.Pointer(t + uintptr(i)*8)) = nextt goto _2 _2: ; i-- } goto _1 _1: ; t = nextt j-- } /* * Bottom level is solid white. */ t = cm + 368 + uintptr((libc.Int32FromInt32(CHRBITS)+libc.Int32FromInt32(BYTBITS)-libc.Int32FromInt32(1))/libc.Int32FromInt32(BYTBITS)-libc.Int32FromInt32(1))*2048 i = libc.Int32FromInt32(1)<= 0) { break } *(*Tcolor)(unsafe.Pointer(t + uintptr(i)*2)) = WHITE goto _3 _3: ; i-- } (*Tcolordesc)(unsafe.Pointer(cd)).Fblock = t } // C documentation // // /* // - freecm - free dynamically-allocated things in a colormap // ^ static void freecm(struct colormap *); // */ func _freecm(tls *libc.TLS, cm uintptr) { var cb uintptr var i Tsize_t _, _ = cb, i (*Tcolormap)(unsafe.Pointer(cm)).Fmagic = 0 if (libc.Int32FromInt32(CHRBITS)+libc.Int32FromInt32(BYTBITS)-libc.Int32FromInt32(1))/libc.Int32FromInt32(BYTBITS) > int32(1) { _cmtreefree(tls, cm, cm+368, 0) } i = uint64(1) for { if !(i <= (*Tcolormap)(unsafe.Pointer(cm)).Fmax) { break } /* skip WHITE */ if !((*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd+uintptr(i)*32)).Fflags&libc.Int32FromInt32(FREECOL) != 0) { cb = (*(*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr(i)*32))).Fblock if cb != libc.UintptrFromInt32(0) { XTclpFree(tls, cb) } } goto _1 _1: ; i++ } if (*Tcolormap)(unsafe.Pointer(cm)).Fcd != cm+48 { XTclpFree(tls, (*Tcolormap)(unsafe.Pointer(cm)).Fcd) } } // C documentation // // /* // - cmtreefree - free a non-terminal part of a colormap tree // ^ static void cmtreefree(struct colormap *, union tree *, int); // */ func _cmtreefree(tls *libc.TLS, cm uintptr, tree uintptr, level int32) { /* level number (top == 0) of this block */ var cb, fillt, t uintptr var i int32 _, _, _, _ = cb, fillt, i, t fillt = cm + 368 + uintptr(level+int32(1))*2048 /* this level has pointers */ i = libc.Int32FromInt32(1)<= 0) { break } t = *(*uintptr)(unsafe.Pointer(tree + uintptr(i)*8)) if t != fillt { if level < (libc.Int32FromInt32(CHRBITS)+libc.Int32FromInt32(BYTBITS)-libc.Int32FromInt32(1))/libc.Int32FromInt32(BYTBITS)-libc.Int32FromInt32(2) { /* more pointer blocks below */ _cmtreefree(tls, cm, t, level+int32(1)) XTclpFree(tls, t) } else { /* color block below */ cb = (*(*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr(*(*Tcolor)(unsafe.Pointer(t)))*32))).Fblock if t != cb { /* not a solid block */ XTclpFree(tls, t) } } } goto _1 _1: ; i-- } } // C documentation // // /* // - setcolor - set the color of a character in a colormap // ^ static color setcolor(struct colormap *, pchr, pcolor); // */ func _setcolor(tls *libc.TLS, cm uintptr, c Tpchr, co Tpcolor) (r Tcolor) { var b, bottom, level, shift, v2, v5 int32 var cb, fillt, lastt, newt, t, v3 uintptr var prev Tcolor var uc Tuchr var v4 uint64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = b, bottom, cb, fillt, lastt, level, newt, prev, shift, t, uc, v2, v3, v4, v5 uc = libc.Uint32FromInt32(c) if (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 || co == -int32(1) { return int16(-libc.Int32FromInt32(1)) } t = cm + 368 level = 0 shift = libc.Int32FromInt32(BYTBITS) * ((libc.Int32FromInt32(CHRBITS)+libc.Int32FromInt32(BYTBITS)-libc.Int32FromInt32(1))/libc.Int32FromInt32(BYTBITS) - libc.Int32FromInt32(1)) for { if !(shift > 0) { break } b = libc.Int32FromUint32(uc >> shift & libc.Uint32FromInt32(libc.Int32FromInt32(1)< libc.Uint64FromInt32(libc.Int32FromInt32(SHRT_MAX)+libc.Int32FromInt32(1)) { n = libc.Uint64FromInt32(libc.Int32FromInt32(SHRT_MAX) + libc.Int32FromInt32(1)) } if (*Tcolormap)(unsafe.Pointer(cm)).Fcd == cm+48 { newCd = XTclpAlloc(tls, n*uint64(32)) if newCd != libc.UintptrFromInt32(0) { libc.Xmemcpy(tls, newCd, cm+48, (*Tcolormap)(unsafe.Pointer(cm)).Fncds*uint64(32)) } } else { newCd = XTclpRealloc(tls, (*Tcolormap)(unsafe.Pointer(cm)).Fcd, n*uint64(32)) } if newCd == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Ferr } else { v2 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Ferr = v2 return int16(-libc.Int32FromInt32(1)) } (*Tcolormap)(unsafe.Pointer(cm)).Fcd = newCd (*Tcolormap)(unsafe.Pointer(cm)).Fncds = n (*Tcolormap)(unsafe.Pointer(cm)).Fmax++ cd = (*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Tcolormap)(unsafe.Pointer(cm)).Fmax)*32 } } (*Tcolordesc)(unsafe.Pointer(cd)).Fnchrs = uint32(0) (*Tcolordesc)(unsafe.Pointer(cd)).Fsub = int16(-libc.Int32FromInt32(1)) (*Tcolordesc)(unsafe.Pointer(cd)).Farcs = libc.UintptrFromInt32(0) (*Tcolordesc)(unsafe.Pointer(cd)).Fflags = 0 (*Tcolordesc)(unsafe.Pointer(cd)).Fblock = libc.UintptrFromInt32(0) return int16((int64(cd) - int64((*Tcolormap)(unsafe.Pointer(cm)).Fcd)) / 32) } // C documentation // // /* // - freecolor - free a color (must have no arcs or subcolor) // ^ static void freecolor(struct colormap *, pcolor); // */ func _freecolor(tls *libc.TLS, cm uintptr, co Tpcolor) { var cd uintptr var nco, pco Tcolor _, _, _ = cd, nco, pco cd = (*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32 /* for freelist scan */ if co == WHITE { return } (*Tcolordesc)(unsafe.Pointer(cd)).Fflags = int32(FREECOL) if (*Tcolordesc)(unsafe.Pointer(cd)).Fblock != libc.UintptrFromInt32(0) { XTclpFree(tls, (*Tcolordesc)(unsafe.Pointer(cd)).Fblock) (*Tcolordesc)(unsafe.Pointer(cd)).Fblock = libc.UintptrFromInt32(0) /* just paranoia */ } if libc.Uint64FromInt32(co) == (*Tcolormap)(unsafe.Pointer(cm)).Fmax { for (*Tcolormap)(unsafe.Pointer(cm)).Fmax > uint64(WHITE) && (*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd+uintptr((*Tcolormap)(unsafe.Pointer(cm)).Fmax)*32)).Fflags&int32(FREECOL) != 0 { (*Tcolormap)(unsafe.Pointer(cm)).Fmax-- } for libc.Uint64FromInt16((*Tcolormap)(unsafe.Pointer(cm)).Ffree) > (*Tcolormap)(unsafe.Pointer(cm)).Fmax { (*Tcolormap)(unsafe.Pointer(cm)).Ffree = (*(*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr((*Tcolormap)(unsafe.Pointer(cm)).Ffree)*32))).Fsub } if int32((*Tcolormap)(unsafe.Pointer(cm)).Ffree) > 0 { pco = (*Tcolormap)(unsafe.Pointer(cm)).Ffree nco = (*(*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr(pco)*32))).Fsub for int32(nco) > 0 { if libc.Uint64FromInt16(nco) > (*Tcolormap)(unsafe.Pointer(cm)).Fmax { /* * Take this one out of freelist. */ nco = (*(*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr(nco)*32))).Fsub (*(*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr(pco)*32))).Fsub = nco } else { pco = nco nco = (*(*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr(pco)*32))).Fsub } } } } else { (*Tcolordesc)(unsafe.Pointer(cd)).Fsub = (*Tcolormap)(unsafe.Pointer(cm)).Ffree (*Tcolormap)(unsafe.Pointer(cm)).Ffree = int16((int64(cd) - int64((*Tcolormap)(unsafe.Pointer(cm)).Fcd)) / 32) } } // C documentation // // /* // - pseudocolor - allocate a false color, to be managed by other means // ^ static color pseudocolor(struct colormap *); // */ func _pseudocolor(tls *libc.TLS, cm uintptr) (r Tcolor) { var co Tcolor _ = co co = _newcolor(tls, cm) if (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 { return int16(-libc.Int32FromInt32(1)) } (*(*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32))).Fnchrs = uint32(1) (*(*Tcolordesc)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fcd + uintptr(co)*32))).Fflags = int32(PSEUDO) return co } // C documentation // // /* // - subcolor - allocate a new subcolor (if necessary) to this chr // ^ static color subcolor(struct colormap *, pchr c); // */ func _subcolor(tls *libc.TLS, cm uintptr, c Tpchr) (r Tcolor) { var co, sco Tcolor _, _ = co, sco /* new subcolor */ co = *(*Tcolor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(c>>(libc.Int32FromInt32(3)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(2)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>libc.Int32FromInt32(BYTBITS)&(libc.Int32FromInt32(1)< 0) { break } _newarc(tls, (*Tvars)(unsafe.Pointer(v)).Fnfa, int32('p'), int32(_subcolor(tls, (*Tvars)(unsafe.Pointer(v)).Fcm, from)), lp, rp) goto _1 _1: ; i-- from++ } if from > to { /* didn't reach a boundary */ return } /* * Deal with whole blocks. */ for { if !(to-from >= libc.Int32FromInt32(1)< 0) { break } b = libc.Int32FromUint32(uc >> shift & libc.Uint32FromInt32(libc.Int32FromInt32(1)< int32(BYTBITS) { /* need new ptr block */ t = XTclpAlloc(tls, uint64(2048)) if t == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Ferr } else { v2 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer((*Tcolormap)(unsafe.Pointer(cm)).Fv)).Ferr = v2 return } libc.Xmemcpy(tls, t, fillt, libc.Uint64FromInt32(libc.Int32FromInt32(1)<')) /* number 1 */ (*Tnfa)(unsafe.Pointer(nfa)).Finit1 = _newstate(tls, nfa) /* May become invalid later. */ (*Tnfa)(unsafe.Pointer(nfa)).Ffinal = _newstate(tls, nfa) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { _freenfa(tls, nfa) return libc.UintptrFromInt32(0) } _rainbow(tls, nfa, (*Tnfa)(unsafe.Pointer(nfa)).Fcm, int32('p'), -libc.Int32FromInt32(1), (*Tnfa)(unsafe.Pointer(nfa)).Fpre, (*Tnfa)(unsafe.Pointer(nfa)).Finit1) _newarc(tls, nfa, int32('^'), int32(1), (*Tnfa)(unsafe.Pointer(nfa)).Fpre, (*Tnfa)(unsafe.Pointer(nfa)).Finit1) _newarc(tls, nfa, int32('^'), 0, (*Tnfa)(unsafe.Pointer(nfa)).Fpre, (*Tnfa)(unsafe.Pointer(nfa)).Finit1) _rainbow(tls, nfa, (*Tnfa)(unsafe.Pointer(nfa)).Fcm, int32('p'), -libc.Int32FromInt32(1), (*Tnfa)(unsafe.Pointer(nfa)).Ffinal, (*Tnfa)(unsafe.Pointer(nfa)).Fpost) _newarc(tls, nfa, int32('$'), int32(1), (*Tnfa)(unsafe.Pointer(nfa)).Ffinal, (*Tnfa)(unsafe.Pointer(nfa)).Fpost) _newarc(tls, nfa, int32('$'), 0, (*Tnfa)(unsafe.Pointer(nfa)).Ffinal, (*Tnfa)(unsafe.Pointer(nfa)).Fpost) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { _freenfa(tls, nfa) return libc.UintptrFromInt32(0) } return nfa } // C documentation // // /* // - freenfa - free an entire NFA // ^ static void freenfa(struct nfa *); // */ func _freenfa(tls *libc.TLS, nfa uintptr) { var s, v1, v3 uintptr var v2 Tsize_t _, _, _, _ = s, v1, v2, v3 for { v1 = (*Tnfa)(unsafe.Pointer(nfa)).Fstates s = v1 if !(v1 != libc.UintptrFromInt32(0)) { break } v2 = libc.Uint64FromInt32(0) (*Tstate)(unsafe.Pointer(s)).Fnouts = v2 (*Tstate)(unsafe.Pointer(s)).Fnins = v2 /* don't worry about arcs */ _freestate(tls, nfa, s) } for { v3 = (*Tnfa)(unsafe.Pointer(nfa)).Ffree s = v3 if !(v3 != libc.UintptrFromInt32(0)) { break } (*Tnfa)(unsafe.Pointer(nfa)).Ffree = (*Tstate)(unsafe.Pointer(s)).Fnext _destroystate(tls, nfa, s) } (*Tnfa)(unsafe.Pointer(nfa)).Fslast = libc.UintptrFromInt32(0) (*Tnfa)(unsafe.Pointer(nfa)).Fnstates = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) (*Tnfa)(unsafe.Pointer(nfa)).Fpre = libc.UintptrFromInt32(0) (*Tnfa)(unsafe.Pointer(nfa)).Fpost = libc.UintptrFromInt32(0) XTclpFree(tls, nfa) } // C documentation // // /* // - newstate - allocate an NFA state, with zero flag value // ^ static struct state *newstate(struct nfa *); // */ func _newstate(tls *libc.TLS, nfa uintptr) (r uintptr) { var s, v4 uintptr var v1, v2 int32 var v3 Tsize_t _, _, _, _, _ = s, v1, v2, v3, v4 if (*Tnfa)(unsafe.Pointer(nfa)).Ffree != libc.UintptrFromInt32(0) { s = (*Tnfa)(unsafe.Pointer(nfa)).Ffree (*Tnfa)(unsafe.Pointer(nfa)).Ffree = (*Tstate)(unsafe.Pointer(s)).Fnext } else { if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fspaceused >= libc.Uint64FromInt32(100000)*libc.Uint64FromInt64(816)+libc.Uint64FromInt32(100000)*libc.Uint64FromInt64(728) { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v1 = int32(REG_ETOOBIG) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v1 return libc.UintptrFromInt32(0) } s = XTclpAlloc(tls, uint64(816)) if s == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v2 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v2 return libc.UintptrFromInt32(0) } *(*Tsize_t)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv + 272)) += uint64(816) (*Tstate)(unsafe.Pointer(s)).Foas.Fnext = libc.UintptrFromInt32(0) (*Tstate)(unsafe.Pointer(s)).Ffree = libc.UintptrFromInt32(0) (*Tstate)(unsafe.Pointer(s)).Fnoas = uint64(0) } v4 = nfa + 32 v3 = *(*Tsize_t)(unsafe.Pointer(v4)) *(*Tsize_t)(unsafe.Pointer(v4))++ (*Tstate)(unsafe.Pointer(s)).Fno = v3 (*Tstate)(unsafe.Pointer(s)).Fflag = uint8(0) if (*Tnfa)(unsafe.Pointer(nfa)).Fstates == libc.UintptrFromInt32(0) { (*Tnfa)(unsafe.Pointer(nfa)).Fstates = s } (*Tstate)(unsafe.Pointer(s)).Fnins = uint64(0) (*Tstate)(unsafe.Pointer(s)).Fins = libc.UintptrFromInt32(0) (*Tstate)(unsafe.Pointer(s)).Fnouts = uint64(0) (*Tstate)(unsafe.Pointer(s)).Fouts = libc.UintptrFromInt32(0) (*Tstate)(unsafe.Pointer(s)).Ftmp = libc.UintptrFromInt32(0) (*Tstate)(unsafe.Pointer(s)).Fnext = libc.UintptrFromInt32(0) if (*Tnfa)(unsafe.Pointer(nfa)).Fslast != libc.UintptrFromInt32(0) { (*Tstate)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fslast)).Fnext = s } (*Tstate)(unsafe.Pointer(s)).Fprev = (*Tnfa)(unsafe.Pointer(nfa)).Fslast (*Tnfa)(unsafe.Pointer(nfa)).Fslast = s return s } // C documentation // // /* // - newfstate - allocate an NFA state with a specified flag value // ^ static struct state *newfstate(struct nfa *, int flag); // */ func _newfstate(tls *libc.TLS, nfa uintptr, flag int32) (r uintptr) { var s uintptr _ = s s = _newstate(tls, nfa) if s != libc.UintptrFromInt32(0) { (*Tstate)(unsafe.Pointer(s)).Fflag = libc.Uint8FromInt32(flag) } return s } // C documentation // // /* // - dropstate - delete a state's inarcs and outarcs and free it // ^ static void dropstate(struct nfa *, struct state *); // */ func _dropstate(tls *libc.TLS, nfa uintptr, s uintptr) { var a, v1, v2 uintptr _, _, _ = a, v1, v2 for { v1 = (*Tstate)(unsafe.Pointer(s)).Fins a = v1 if !(v1 != libc.UintptrFromInt32(0)) { break } _freearc(tls, nfa, a) } for { v2 = (*Tstate)(unsafe.Pointer(s)).Fouts a = v2 if !(v2 != libc.UintptrFromInt32(0)) { break } _freearc(tls, nfa, a) } _freestate(tls, nfa, s) } // C documentation // // /* // - freestate - free a state, which has no in-arcs or out-arcs // ^ static void freestate(struct nfa *, struct state *); // */ func _freestate(tls *libc.TLS, nfa uintptr, s uintptr) { (*Tstate)(unsafe.Pointer(s)).Fno = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) (*Tstate)(unsafe.Pointer(s)).Fflag = uint8(0) if (*Tstate)(unsafe.Pointer(s)).Fnext != libc.UintptrFromInt32(0) { (*Tstate)(unsafe.Pointer((*Tstate)(unsafe.Pointer(s)).Fnext)).Fprev = (*Tstate)(unsafe.Pointer(s)).Fprev } else { (*Tnfa)(unsafe.Pointer(nfa)).Fslast = (*Tstate)(unsafe.Pointer(s)).Fprev } if (*Tstate)(unsafe.Pointer(s)).Fprev != libc.UintptrFromInt32(0) { (*Tstate)(unsafe.Pointer((*Tstate)(unsafe.Pointer(s)).Fprev)).Fnext = (*Tstate)(unsafe.Pointer(s)).Fnext } else { (*Tnfa)(unsafe.Pointer(nfa)).Fstates = (*Tstate)(unsafe.Pointer(s)).Fnext } (*Tstate)(unsafe.Pointer(s)).Fprev = libc.UintptrFromInt32(0) (*Tstate)(unsafe.Pointer(s)).Fnext = (*Tnfa)(unsafe.Pointer(nfa)).Ffree /* don't delete it, put it on the free list */ (*Tnfa)(unsafe.Pointer(nfa)).Ffree = s } // C documentation // // /* // - destroystate - really get rid of an already-freed state // ^ static void destroystate(struct nfa *, struct state *); // */ func _destroystate(tls *libc.TLS, nfa uintptr, s uintptr) { var ab, abnext uintptr _, _ = ab, abnext ab = (*Tstate)(unsafe.Pointer(s)).Foas.Fnext for { if !(ab != libc.UintptrFromInt32(0)) { break } abnext = (*Tarcbatch)(unsafe.Pointer(ab)).Fnext XTclpFree(tls, ab) *(*Tsize_t)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv + 272)) -= uint64(728) goto _1 _1: ; ab = abnext } (*Tstate)(unsafe.Pointer(s)).Fins = libc.UintptrFromInt32(0) (*Tstate)(unsafe.Pointer(s)).Fouts = libc.UintptrFromInt32(0) (*Tstate)(unsafe.Pointer(s)).Fnext = libc.UintptrFromInt32(0) XTclpFree(tls, s) *(*Tsize_t)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv + 272)) -= uint64(816) } // C documentation // // /* // - newarc - set up a new arc within an NFA // ^ static void newarc(struct nfa *, int, pcolor, struct state *, // ^ struct state *); // */ // /* // * This function checks to make sure that no duplicate arcs are created. // * In general we never want duplicates. // */ func _newarc(tls *libc.TLS, nfa uintptr, t int32, co Tpcolor, from uintptr, to uintptr) { var a uintptr _ = a /* check for duplicate arc, using whichever chain is shorter */ if (*Tstate)(unsafe.Pointer(from)).Fnouts <= (*Tstate)(unsafe.Pointer(to)).Fnins { a = (*Tstate)(unsafe.Pointer(from)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } if (*Tarc)(unsafe.Pointer(a)).Fto == to && int32((*Tarc)(unsafe.Pointer(a)).Fco) == co && (*Tarc)(unsafe.Pointer(a)).Ftype1 == t { return } goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } } else { a = (*Tstate)(unsafe.Pointer(to)).Fins for { if !(a != libc.UintptrFromInt32(0)) { break } if (*Tarc)(unsafe.Pointer(a)).Ffrom == from && int32((*Tarc)(unsafe.Pointer(a)).Fco) == co && (*Tarc)(unsafe.Pointer(a)).Ftype1 == t { return } goto _2 _2: ; a = (*Tarc)(unsafe.Pointer(a)).Finchain } } /* no dup, so create the arc */ _createarc(tls, nfa, t, co, from, to) } // C documentation // // /* // * createarc - create a new arc within an NFA // * // * This function must *only* be used after verifying that there is no existing // * identical arc (same type/color/from/to). // */ func _createarc(tls *libc.TLS, nfa uintptr, t int32, co Tpcolor, from uintptr, to uintptr) { var a uintptr _ = a /* the arc is physically allocated within its from-state */ a = _allocarc(tls, nfa, from) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return } (*Tarc)(unsafe.Pointer(a)).Ftype1 = t (*Tarc)(unsafe.Pointer(a)).Fco = int16(co) (*Tarc)(unsafe.Pointer(a)).Fto = to (*Tarc)(unsafe.Pointer(a)).Ffrom = from /* * Put the new arc on the beginning, not the end, of the chains; it's * simpler here, and freearc() is the same cost either way. See also the * logic in moveins() and its cohorts, as well as fixempties(). */ (*Tarc)(unsafe.Pointer(a)).Finchain = (*Tstate)(unsafe.Pointer(to)).Fins (*Tarc)(unsafe.Pointer(a)).FinchainRev = libc.UintptrFromInt32(0) if (*Tstate)(unsafe.Pointer(to)).Fins != 0 { (*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(to)).Fins)).FinchainRev = a } (*Tstate)(unsafe.Pointer(to)).Fins = a (*Tarc)(unsafe.Pointer(a)).Foutchain = (*Tstate)(unsafe.Pointer(from)).Fouts (*Tarc)(unsafe.Pointer(a)).FoutchainRev = libc.UintptrFromInt32(0) if (*Tstate)(unsafe.Pointer(from)).Fouts != 0 { (*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(from)).Fouts)).FoutchainRev = a } (*Tstate)(unsafe.Pointer(from)).Fouts = a (*Tstate)(unsafe.Pointer(from)).Fnouts++ (*Tstate)(unsafe.Pointer(to)).Fnins++ if ((*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('p') || (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('a') || (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('r')) && (*Tnfa)(unsafe.Pointer(nfa)).Fparent == libc.UintptrFromInt32(0) { _colorchain(tls, (*Tnfa)(unsafe.Pointer(nfa)).Fcm, a) } } // C documentation // // /* // - allocarc - allocate a new out-arc within a state // ^ static struct arc *allocarc(struct nfa *, struct state *); // */ func _allocarc(tls *libc.TLS, nfa uintptr, s uintptr) (r uintptr) { var a, newAb uintptr var i, v1, v2 int32 _, _, _, _, _ = a, i, newAb, v1, v2 /* * Shortcut */ if (*Tstate)(unsafe.Pointer(s)).Ffree == libc.UintptrFromInt32(0) && (*Tstate)(unsafe.Pointer(s)).Fnoas < uint64(ABSIZE) { a = s + 80 + 8 + uintptr((*Tstate)(unsafe.Pointer(s)).Fnoas)*72 (*Tstate)(unsafe.Pointer(s)).Fnoas++ return a } /* * if none at hand, get more */ if (*Tstate)(unsafe.Pointer(s)).Ffree == libc.UintptrFromInt32(0) { if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fspaceused >= libc.Uint64FromInt32(100000)*libc.Uint64FromInt64(816)+libc.Uint64FromInt32(100000)*libc.Uint64FromInt64(728) { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v1 = int32(REG_ETOOBIG) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v1 return libc.UintptrFromInt32(0) } newAb = XTclpAlloc(tls, uint64(728)) if newAb == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v2 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v2 return libc.UintptrFromInt32(0) } *(*Tsize_t)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv + 272)) += uint64(728) (*Tarcbatch)(unsafe.Pointer(newAb)).Fnext = (*Tstate)(unsafe.Pointer(s)).Foas.Fnext (*Tstate)(unsafe.Pointer(s)).Foas.Fnext = newAb i = 0 for { if !(i < int32(ABSIZE)) { break } (*(*Tarc)(unsafe.Pointer(newAb + 8 + uintptr(i)*72))).Ftype1 = 0 (*(*Tarc)(unsafe.Pointer(newAb + 8 + uintptr(i)*72))).Foutchain = newAb + 8 + uintptr(i+int32(1))*72 goto _3 _3: ; i++ } (*(*Tarc)(unsafe.Pointer(newAb + 8 + uintptr(libc.Int32FromInt32(ABSIZE)-libc.Int32FromInt32(1))*72))).Foutchain = libc.UintptrFromInt32(0) (*Tstate)(unsafe.Pointer(s)).Ffree = newAb + 8 } a = (*Tstate)(unsafe.Pointer(s)).Ffree (*Tstate)(unsafe.Pointer(s)).Ffree = (*Tarc)(unsafe.Pointer(a)).Foutchain return a } // C documentation // // /* // - freearc - free an arc // ^ static void freearc(struct nfa *, struct arc *); // */ func _freearc(tls *libc.TLS, nfa uintptr, victim uintptr) { var from, predecessor, to uintptr _, _, _ = from, predecessor, to from = (*Tarc)(unsafe.Pointer(victim)).Ffrom to = (*Tarc)(unsafe.Pointer(victim)).Fto /* * Take it off color chain if necessary. */ if ((*Tarc)(unsafe.Pointer(victim)).Ftype1 == int32('p') || (*Tarc)(unsafe.Pointer(victim)).Ftype1 == int32('a') || (*Tarc)(unsafe.Pointer(victim)).Ftype1 == int32('r')) && (*Tnfa)(unsafe.Pointer(nfa)).Fparent == libc.UintptrFromInt32(0) { _uncolorchain(tls, (*Tnfa)(unsafe.Pointer(nfa)).Fcm, victim) } /* * Take it off source's out-chain. */ predecessor = (*Tarc)(unsafe.Pointer(victim)).FoutchainRev if predecessor == libc.UintptrFromInt32(0) { (*Tstate)(unsafe.Pointer(from)).Fouts = (*Tarc)(unsafe.Pointer(victim)).Foutchain } else { (*Tarc)(unsafe.Pointer(predecessor)).Foutchain = (*Tarc)(unsafe.Pointer(victim)).Foutchain } if (*Tarc)(unsafe.Pointer(victim)).Foutchain != libc.UintptrFromInt32(0) { (*Tarc)(unsafe.Pointer((*Tarc)(unsafe.Pointer(victim)).Foutchain)).FoutchainRev = predecessor } (*Tstate)(unsafe.Pointer(from)).Fnouts-- /* * Take it off target's in-chain. */ predecessor = (*Tarc)(unsafe.Pointer(victim)).FinchainRev if predecessor == libc.UintptrFromInt32(0) { (*Tstate)(unsafe.Pointer(to)).Fins = (*Tarc)(unsafe.Pointer(victim)).Finchain } else { (*Tarc)(unsafe.Pointer(predecessor)).Finchain = (*Tarc)(unsafe.Pointer(victim)).Finchain } if (*Tarc)(unsafe.Pointer(victim)).Finchain != libc.UintptrFromInt32(0) { (*Tarc)(unsafe.Pointer((*Tarc)(unsafe.Pointer(victim)).Finchain)).FinchainRev = predecessor } (*Tstate)(unsafe.Pointer(to)).Fnins-- /* * Clean up and place on from-state's free list. */ (*Tarc)(unsafe.Pointer(victim)).Ftype1 = 0 (*Tarc)(unsafe.Pointer(victim)).Ffrom = libc.UintptrFromInt32(0) /* precautions... */ (*Tarc)(unsafe.Pointer(victim)).Fto = libc.UintptrFromInt32(0) (*Tarc)(unsafe.Pointer(victim)).Finchain = libc.UintptrFromInt32(0) (*Tarc)(unsafe.Pointer(victim)).FinchainRev = libc.UintptrFromInt32(0) (*Tarc)(unsafe.Pointer(victim)).Foutchain = libc.UintptrFromInt32(0) (*Tarc)(unsafe.Pointer(victim)).FoutchainRev = libc.UintptrFromInt32(0) (*Tarc)(unsafe.Pointer(victim)).Foutchain = (*Tstate)(unsafe.Pointer(from)).Ffree (*Tstate)(unsafe.Pointer(from)).Ffree = victim } // C documentation // // /* // * changearctarget - flip an arc to have a different to state // * // * Caller must have verified that there is no preexisting duplicate arc. // * // * Note that because we store arcs in their from state, we can't easily have // * a similar changearcsource function. // */ func _changearctarget(tls *libc.TLS, a uintptr, newto uintptr) { var oldto, predecessor uintptr _, _ = oldto, predecessor oldto = (*Tarc)(unsafe.Pointer(a)).Fto /* take it off old target's in-chain */ predecessor = (*Tarc)(unsafe.Pointer(a)).FinchainRev if predecessor == libc.UintptrFromInt32(0) { (*Tstate)(unsafe.Pointer(oldto)).Fins = (*Tarc)(unsafe.Pointer(a)).Finchain } else { (*Tarc)(unsafe.Pointer(predecessor)).Finchain = (*Tarc)(unsafe.Pointer(a)).Finchain } if (*Tarc)(unsafe.Pointer(a)).Finchain != libc.UintptrFromInt32(0) { (*Tarc)(unsafe.Pointer((*Tarc)(unsafe.Pointer(a)).Finchain)).FinchainRev = predecessor } (*Tstate)(unsafe.Pointer(oldto)).Fnins-- (*Tarc)(unsafe.Pointer(a)).Fto = newto /* prepend it to new target's in-chain */ (*Tarc)(unsafe.Pointer(a)).Finchain = (*Tstate)(unsafe.Pointer(newto)).Fins (*Tarc)(unsafe.Pointer(a)).FinchainRev = libc.UintptrFromInt32(0) if (*Tstate)(unsafe.Pointer(newto)).Fins != 0 { (*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(newto)).Fins)).FinchainRev = a } (*Tstate)(unsafe.Pointer(newto)).Fins = a (*Tstate)(unsafe.Pointer(newto)).Fnins++ } // C documentation // // /* // - hasnonemptyout - Does state have a non-EMPTY out arc? // ^ static int hasnonemptyout(struct state *); // */ func _hasnonemptyout(tls *libc.TLS, s uintptr) (r int32) { var a uintptr _ = a a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } if (*Tarc)(unsafe.Pointer(a)).Ftype1 != int32('n') { return int32(1) } goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } return 0 } // C documentation // // /* // - findarc - find arc, if any, from given source with given type and color // * If there is more than one such arc, the result is random. // ^ static struct arc *findarc(struct state *, int, pcolor); // */ func _findarc(tls *libc.TLS, s uintptr, type1 int32, co Tpcolor) (r uintptr) { var a uintptr _ = a a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } if (*Tarc)(unsafe.Pointer(a)).Ftype1 == type1 && int32((*Tarc)(unsafe.Pointer(a)).Fco) == co { return a } goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } return libc.UintptrFromInt32(0) } // C documentation // // /* // - cparc - allocate a new arc within an NFA, copying details from old one // ^ static void cparc(struct nfa *, struct arc *, struct state *, // ^ struct state *); // */ func _cparc(tls *libc.TLS, nfa uintptr, oa uintptr, from uintptr, to uintptr) { _newarc(tls, nfa, (*Tarc)(unsafe.Pointer(oa)).Ftype1, int32((*Tarc)(unsafe.Pointer(oa)).Fco), from, to) } // C documentation // // /* // * sortins - sort the in arcs of a state by from/color/type // */ func _sortins(tls *libc.TLS, nfa uintptr, s uintptr) { var a, sortarray uintptr var i, n, v1, v3 int32 _, _, _, _, _, _ = a, i, n, sortarray, v1, v3 n = libc.Int32FromUint64((*Tstate)(unsafe.Pointer(s)).Fnins) if n <= int32(1) { return /* nothing to do */ } /* make an array of arc pointers ... */ sortarray = XTclpAlloc(tls, libc.Uint64FromInt32(n)*uint64(8)) if sortarray == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v1 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v1 return } i = 0 a = (*Tstate)(unsafe.Pointer(s)).Fins for { if !(a != libc.UintptrFromInt32(0)) { break } v3 = i i++ *(*uintptr)(unsafe.Pointer(sortarray + uintptr(v3)*8)) = a goto _2 _2: ; a = (*Tarc)(unsafe.Pointer(a)).Finchain } /* ... sort the array */ libc.Xqsort(tls, sortarray, libc.Uint64FromInt32(n), uint64(8), __ccgo_fp(_sortins_cmp)) /* ... and rebuild arc list in order */ /* it seems worth special-casing first and last items to simplify loop */ a = *(*uintptr)(unsafe.Pointer(sortarray)) (*Tstate)(unsafe.Pointer(s)).Fins = a (*Tarc)(unsafe.Pointer(a)).Finchain = *(*uintptr)(unsafe.Pointer(sortarray + 1*8)) (*Tarc)(unsafe.Pointer(a)).FinchainRev = libc.UintptrFromInt32(0) i = int32(1) for { if !(i < n-int32(1)) { break } a = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i)*8)) (*Tarc)(unsafe.Pointer(a)).Finchain = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i+int32(1))*8)) (*Tarc)(unsafe.Pointer(a)).FinchainRev = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i-int32(1))*8)) goto _4 _4: ; i++ } a = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i)*8)) (*Tarc)(unsafe.Pointer(a)).Finchain = libc.UintptrFromInt32(0) (*Tarc)(unsafe.Pointer(a)).FinchainRev = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i-int32(1))*8)) XTclpFree(tls, sortarray) } func _sortins_cmp(tls *libc.TLS, a uintptr, b uintptr) (r int32) { var aa, bb uintptr _, _ = aa, bb aa = *(*uintptr)(unsafe.Pointer(a)) bb = *(*uintptr)(unsafe.Pointer(b)) /* we check the fields in the order they are most likely to be different */ if (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(aa)).Ffrom)).Fno < (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(bb)).Ffrom)).Fno { return -int32(1) } if (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(aa)).Ffrom)).Fno > (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(bb)).Ffrom)).Fno { return int32(1) } if int32((*Tarc)(unsafe.Pointer(aa)).Fco) < int32((*Tarc)(unsafe.Pointer(bb)).Fco) { return -int32(1) } if int32((*Tarc)(unsafe.Pointer(aa)).Fco) > int32((*Tarc)(unsafe.Pointer(bb)).Fco) { return int32(1) } if (*Tarc)(unsafe.Pointer(aa)).Ftype1 < (*Tarc)(unsafe.Pointer(bb)).Ftype1 { return -int32(1) } if (*Tarc)(unsafe.Pointer(aa)).Ftype1 > (*Tarc)(unsafe.Pointer(bb)).Ftype1 { return int32(1) } return 0 } // C documentation // // /* // * sortouts - sort the out arcs of a state by to/color/type // */ func _sortouts(tls *libc.TLS, nfa uintptr, s uintptr) { var a, sortarray uintptr var i, n, v1, v3 int32 _, _, _, _, _, _ = a, i, n, sortarray, v1, v3 n = libc.Int32FromUint64((*Tstate)(unsafe.Pointer(s)).Fnouts) if n <= int32(1) { return /* nothing to do */ } /* make an array of arc pointers ... */ sortarray = XTclpAlloc(tls, libc.Uint64FromInt32(n)*uint64(8)) if sortarray == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v1 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v1 return } i = 0 a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } v3 = i i++ *(*uintptr)(unsafe.Pointer(sortarray + uintptr(v3)*8)) = a goto _2 _2: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } /* ... sort the array */ libc.Xqsort(tls, sortarray, libc.Uint64FromInt32(n), uint64(8), __ccgo_fp(_sortouts_cmp)) /* ... and rebuild arc list in order */ /* it seems worth special-casing first and last items to simplify loop */ a = *(*uintptr)(unsafe.Pointer(sortarray)) (*Tstate)(unsafe.Pointer(s)).Fouts = a (*Tarc)(unsafe.Pointer(a)).Foutchain = *(*uintptr)(unsafe.Pointer(sortarray + 1*8)) (*Tarc)(unsafe.Pointer(a)).FoutchainRev = libc.UintptrFromInt32(0) i = int32(1) for { if !(i < n-int32(1)) { break } a = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i)*8)) (*Tarc)(unsafe.Pointer(a)).Foutchain = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i+int32(1))*8)) (*Tarc)(unsafe.Pointer(a)).FoutchainRev = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i-int32(1))*8)) goto _4 _4: ; i++ } a = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i)*8)) (*Tarc)(unsafe.Pointer(a)).Foutchain = libc.UintptrFromInt32(0) (*Tarc)(unsafe.Pointer(a)).FoutchainRev = *(*uintptr)(unsafe.Pointer(sortarray + uintptr(i-int32(1))*8)) XTclpFree(tls, sortarray) } func _sortouts_cmp(tls *libc.TLS, a uintptr, b uintptr) (r int32) { var aa, bb uintptr _, _ = aa, bb aa = *(*uintptr)(unsafe.Pointer(a)) bb = *(*uintptr)(unsafe.Pointer(b)) /* we check the fields in the order they are most likely to be different */ if (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(aa)).Fto)).Fno < (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(bb)).Fto)).Fno { return -int32(1) } if (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(aa)).Fto)).Fno > (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(bb)).Fto)).Fno { return int32(1) } if int32((*Tarc)(unsafe.Pointer(aa)).Fco) < int32((*Tarc)(unsafe.Pointer(bb)).Fco) { return -int32(1) } if int32((*Tarc)(unsafe.Pointer(aa)).Fco) > int32((*Tarc)(unsafe.Pointer(bb)).Fco) { return int32(1) } if (*Tarc)(unsafe.Pointer(aa)).Ftype1 < (*Tarc)(unsafe.Pointer(bb)).Ftype1 { return -int32(1) } if (*Tarc)(unsafe.Pointer(aa)).Ftype1 > (*Tarc)(unsafe.Pointer(bb)).Ftype1 { return int32(1) } return 0 } /* * Common decision logic about whether to use arc-by-arc operations or * sort/merge. If there's just a few source arcs we cannot recoup the * cost of sorting the destination arc list, no matter how large it is. * Otherwise, limit the number of arc-by-arc comparisons to about 1000 * (a somewhat arbitrary choice, but the breakeven point would probably * be machine dependent anyway). */ // C documentation // // /* // - moveins - move all in arcs of a state to another state // * You might think this could be done better by just updating the // * existing arcs, and you would be right if it weren't for the need // * for duplicate suppression, which makes it easier to just make new // * ones to exploit the suppression built into newarc. // * // * However, if we have a whole lot of arcs to deal with, retail duplicate // * checks become too slow. In that case we proceed by sorting and merging // * the arc lists, and then we can indeed just update the arcs in-place. // * // ^ static void moveins(struct nfa *, struct state *, struct state *); // */ func _moveins(tls *libc.TLS, nfa uintptr, oldState uintptr, newState uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var a, a1, a2, v2 uintptr var v1, v3 int32 var _ /* na at bp+8 */ uintptr var _ /* oa at bp+0 */ uintptr _, _, _, _, _, _ = a, a1, a2, v1, v2, v3 if (*Tstate)(unsafe.Pointer(oldState)).Fnins < uint64(4) { v1 = 0 } else { v1 = libc.BoolInt32((*Tstate)(unsafe.Pointer(oldState)).Fnins > uint64(32) || (*Tstate)(unsafe.Pointer(newState)).Fnins > uint64(32)) } if !(v1 != 0) { for { v2 = (*Tstate)(unsafe.Pointer(oldState)).Fins a = v2 if !(v2 != libc.UintptrFromInt32(0)) { break } _cparc(tls, nfa, a, (*Tarc)(unsafe.Pointer(a)).Ffrom, newState) _freearc(tls, nfa, a) } } else { /* * Because we bypass newarc() in this code path, we'd better include a * cancel check. */ if 0 != 0 { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v3 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v3 = int32(REG_CANCEL) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v3 return } _sortins(tls, nfa, oldState) _sortins(tls, nfa, newState) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return /* might have failed to sort */ } *(*uintptr)(unsafe.Pointer(bp)) = (*Tstate)(unsafe.Pointer(oldState)).Fins *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tstate)(unsafe.Pointer(newState)).Fins for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) && *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { a1 = *(*uintptr)(unsafe.Pointer(bp)) switch _sortins_cmp(tls, bp, bp+8) { case -int32(1): /* newState does not have anything matching oa */ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Finchain /* * Rather than doing createarc+freearc, we can just unlink * and relink the existing arc struct. */ _changearctarget(tls, a1, newState) case 0: /* match, advance in both lists */ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Finchain *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Finchain /* ... and drop duplicate arc from oldState */ _freearc(tls, nfa, a1) case +libc.Int32FromInt32(1): /* advance only na; oa might have a match later */ *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Finchain default: } } for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { /* newState does not have anything matching oa */ a2 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Finchain _changearctarget(tls, a2, newState) } } } // C documentation // // /* // - copyins - copy in arcs of a state to another state // ^ static void copyins(struct nfa *, struct state *, struct state *, int); // */ func _copyins(tls *libc.TLS, nfa uintptr, oldState uintptr, newState uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var a, a1, a2 uintptr var v1, v3 int32 var _ /* na at bp+8 */ uintptr var _ /* oa at bp+0 */ uintptr _, _, _, _, _ = a, a1, a2, v1, v3 if (*Tstate)(unsafe.Pointer(oldState)).Fnins < uint64(4) { v1 = 0 } else { v1 = libc.BoolInt32((*Tstate)(unsafe.Pointer(oldState)).Fnins > uint64(32) || (*Tstate)(unsafe.Pointer(newState)).Fnins > uint64(32)) } if !(v1 != 0) { a = (*Tstate)(unsafe.Pointer(oldState)).Fins for { if !(a != libc.UintptrFromInt32(0)) { break } _cparc(tls, nfa, a, (*Tarc)(unsafe.Pointer(a)).Ffrom, newState) goto _2 _2: ; a = (*Tarc)(unsafe.Pointer(a)).Finchain } } else { /* * Because we bypass newarc() in this code path, we'd better include a * cancel check. */ if 0 != 0 { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v3 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v3 = int32(REG_CANCEL) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v3 return } _sortins(tls, nfa, oldState) _sortins(tls, nfa, newState) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return /* might have failed to sort */ } *(*uintptr)(unsafe.Pointer(bp)) = (*Tstate)(unsafe.Pointer(oldState)).Fins *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tstate)(unsafe.Pointer(newState)).Fins for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) && *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { a1 = *(*uintptr)(unsafe.Pointer(bp)) switch _sortins_cmp(tls, bp, bp+8) { case -int32(1): /* newState does not have anything matching oa */ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Finchain _createarc(tls, nfa, (*Tarc)(unsafe.Pointer(a1)).Ftype1, int32((*Tarc)(unsafe.Pointer(a1)).Fco), (*Tarc)(unsafe.Pointer(a1)).Ffrom, newState) case 0: /* match, advance in both lists */ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Finchain *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Finchain case +libc.Int32FromInt32(1): /* advance only na; oa might have a match later */ *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Finchain default: } } for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { /* newState does not have anything matching oa */ a2 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Finchain _createarc(tls, nfa, (*Tarc)(unsafe.Pointer(a2)).Ftype1, int32((*Tarc)(unsafe.Pointer(a2)).Fco), (*Tarc)(unsafe.Pointer(a2)).Ffrom, newState) } } } // C documentation // // /* // * mergeins - merge a list of inarcs into a state // * // * This is much like copyins, but the source arcs are listed in an array, // * and are not guaranteed unique. It's okay to clobber the array contents. // */ func _mergeins(tls *libc.TLS, nfa uintptr, s uintptr, arcarray uintptr, arccount int32) { bp := tls.Alloc(16) defer tls.Free(16) var a1 uintptr var i, j, v1, v3 int32 var _ /* a at bp+8 */ uintptr var _ /* na at bp+0 */ uintptr _, _, _, _, _ = a1, i, j, v1, v3 if arccount <= 0 { return } /* * Because we bypass newarc() in this code path, we'd better include a * cancel check. */ if 0 != 0 { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v1 = int32(REG_CANCEL) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v1 return } /* Sort existing inarcs as well as proposed new ones */ _sortins(tls, nfa, s) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return /* might have failed to sort */ } libc.Xqsort(tls, arcarray, libc.Uint64FromInt32(arccount), uint64(8), __ccgo_fp(_sortins_cmp)) /* * arcarray very likely includes dups, so we must eliminate them. (This * could be folded into the next loop, but it's not worth the trouble.) */ j = 0 i = int32(1) for { if !(i < arccount) { break } switch _sortins_cmp(tls, arcarray+uintptr(j)*8, arcarray+uintptr(i)*8) { case -int32(1): /* non-dup */ j++ v3 = j *(*uintptr)(unsafe.Pointer(arcarray + uintptr(v3)*8)) = *(*uintptr)(unsafe.Pointer(arcarray + uintptr(i)*8)) case 0: /* dup */ default: /* trouble */ } goto _2 _2: ; i++ } arccount = j + int32(1) /* * Now merge into s' inchain. Note that createarc() will put new arcs * onto the front of s's chain, so it does not break our walk through the * sorted part of the chain. */ i = 0 *(*uintptr)(unsafe.Pointer(bp)) = (*Tstate)(unsafe.Pointer(s)).Fins for i < arccount && *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(arcarray + uintptr(i)*8)) switch _sortins_cmp(tls, bp+8, bp) { case -int32(1): /* s does not have anything matching a */ _createarc(tls, nfa, (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Ftype1, int32((*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fco), (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Ffrom, s) i++ case 0: /* match, advance in both lists */ i++ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Finchain case +libc.Int32FromInt32(1): /* advance only na; array might have a match later */ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Finchain default: } } for i < arccount { /* s does not have anything matching a */ a1 = *(*uintptr)(unsafe.Pointer(arcarray + uintptr(i)*8)) _createarc(tls, nfa, (*Tarc)(unsafe.Pointer(a1)).Ftype1, int32((*Tarc)(unsafe.Pointer(a1)).Fco), (*Tarc)(unsafe.Pointer(a1)).Ffrom, s) i++ } } // C documentation // // /* // - moveouts - move all out arcs of a state to another state // ^ static void moveouts(struct nfa *, struct state *, struct state *); // */ func _moveouts(tls *libc.TLS, nfa uintptr, oldState uintptr, newState uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var a, a1, a2, v2 uintptr var v1, v3 int32 var _ /* na at bp+8 */ uintptr var _ /* oa at bp+0 */ uintptr _, _, _, _, _, _ = a, a1, a2, v1, v2, v3 if (*Tstate)(unsafe.Pointer(oldState)).Fnouts < uint64(4) { v1 = 0 } else { v1 = libc.BoolInt32((*Tstate)(unsafe.Pointer(oldState)).Fnouts > uint64(32) || (*Tstate)(unsafe.Pointer(newState)).Fnouts > uint64(32)) } if !(v1 != 0) { for { v2 = (*Tstate)(unsafe.Pointer(oldState)).Fouts a = v2 if !(v2 != libc.UintptrFromInt32(0)) { break } _cparc(tls, nfa, a, newState, (*Tarc)(unsafe.Pointer(a)).Fto) _freearc(tls, nfa, a) } } else { /* * Because we bypass newarc() in this code path, we'd better include a * cancel check. */ if 0 != 0 { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v3 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v3 = int32(REG_CANCEL) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v3 return } _sortouts(tls, nfa, oldState) _sortouts(tls, nfa, newState) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return /* might have failed to sort */ } *(*uintptr)(unsafe.Pointer(bp)) = (*Tstate)(unsafe.Pointer(oldState)).Fouts *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tstate)(unsafe.Pointer(newState)).Fouts for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) && *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { a1 = *(*uintptr)(unsafe.Pointer(bp)) switch _sortouts_cmp(tls, bp, bp+8) { case -int32(1): /* newState does not have anything matching oa */ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Foutchain _createarc(tls, nfa, (*Tarc)(unsafe.Pointer(a1)).Ftype1, int32((*Tarc)(unsafe.Pointer(a1)).Fco), newState, (*Tarc)(unsafe.Pointer(a1)).Fto) _freearc(tls, nfa, a1) case 0: /* match, advance in both lists */ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Foutchain *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Foutchain /* ... and drop duplicate arc from oldState */ _freearc(tls, nfa, a1) case +libc.Int32FromInt32(1): /* advance only na; oa might have a match later */ *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Foutchain default: } } for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { /* newState does not have anything matching oa */ a2 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Foutchain _createarc(tls, nfa, (*Tarc)(unsafe.Pointer(a2)).Ftype1, int32((*Tarc)(unsafe.Pointer(a2)).Fco), newState, (*Tarc)(unsafe.Pointer(a2)).Fto) _freearc(tls, nfa, a2) } } } // C documentation // // /* // - copyouts - copy out arcs of a state to another state // ^ static void copyouts(struct nfa *, struct state *, struct state *, int); // */ func _copyouts(tls *libc.TLS, nfa uintptr, oldState uintptr, newState uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var a, a1, a2 uintptr var v1, v3 int32 var _ /* na at bp+8 */ uintptr var _ /* oa at bp+0 */ uintptr _, _, _, _, _ = a, a1, a2, v1, v3 if (*Tstate)(unsafe.Pointer(oldState)).Fnouts < uint64(4) { v1 = 0 } else { v1 = libc.BoolInt32((*Tstate)(unsafe.Pointer(oldState)).Fnouts > uint64(32) || (*Tstate)(unsafe.Pointer(newState)).Fnouts > uint64(32)) } if !(v1 != 0) { a = (*Tstate)(unsafe.Pointer(oldState)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } _cparc(tls, nfa, a, newState, (*Tarc)(unsafe.Pointer(a)).Fto) goto _2 _2: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } } else { /* * Because we bypass newarc() in this code path, we'd better include a * cancel check. */ if 0 != 0 { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v3 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v3 = int32(REG_CANCEL) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v3 return } _sortouts(tls, nfa, oldState) _sortouts(tls, nfa, newState) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return /* might have failed to sort */ } *(*uintptr)(unsafe.Pointer(bp)) = (*Tstate)(unsafe.Pointer(oldState)).Fouts *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tstate)(unsafe.Pointer(newState)).Fouts for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) && *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { a1 = *(*uintptr)(unsafe.Pointer(bp)) switch _sortouts_cmp(tls, bp, bp+8) { case -int32(1): /* newState does not have anything matching oa */ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Foutchain _createarc(tls, nfa, (*Tarc)(unsafe.Pointer(a1)).Ftype1, int32((*Tarc)(unsafe.Pointer(a1)).Fco), newState, (*Tarc)(unsafe.Pointer(a1)).Fto) case 0: /* match, advance in both lists */ *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Foutchain *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Foutchain case +libc.Int32FromInt32(1): /* advance only na; oa might have a match later */ *(*uintptr)(unsafe.Pointer(bp + 8)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Foutchain default: } } for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { /* newState does not have anything matching oa */ a2 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = (*Tarc)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Foutchain _createarc(tls, nfa, (*Tarc)(unsafe.Pointer(a2)).Ftype1, int32((*Tarc)(unsafe.Pointer(a2)).Fco), newState, (*Tarc)(unsafe.Pointer(a2)).Fto) } } } // C documentation // // /* // - cloneouts - copy out arcs of a state to another state pair, modifying type // ^ static void cloneouts(struct nfa *, struct state *, struct state *, // ^ struct state *, int); // */ func _cloneouts(tls *libc.TLS, nfa uintptr, old uintptr, from uintptr, to uintptr, type1 int32) { var a uintptr _ = a a = (*Tstate)(unsafe.Pointer(old)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } _newarc(tls, nfa, type1, int32((*Tarc)(unsafe.Pointer(a)).Fco), from, to) goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } } // C documentation // // /* // - delsub - delete a sub-NFA, updating subre pointers if necessary // * This uses a recursive traversal of the sub-NFA, marking already-seen // * states using their tmp pointer. // ^ static void delsub(struct nfa *, struct state *, struct state *); // */ func _delsub(tls *libc.TLS, nfa uintptr, lp uintptr, rp uintptr) { /* ...to here, *not* inclusive */ (*Tstate)(unsafe.Pointer(rp)).Ftmp = rp /* mark end */ _deltraverse(tls, nfa, lp, lp) /* did the job */ /* no more */ (*Tstate)(unsafe.Pointer(rp)).Ftmp = libc.UintptrFromInt32(0) /* unmark end */ (*Tstate)(unsafe.Pointer(lp)).Ftmp = libc.UintptrFromInt32(0) /* and begin, marked by deltraverse */ } // C documentation // // /* // - deltraverse - the recursive heart of delsub // * This routine's basic job is to destroy all out-arcs of the state. // ^ static void deltraverse(struct nfa *, struct state *, struct state *); // */ func _deltraverse(tls *libc.TLS, nfa uintptr, leftend uintptr, s uintptr) { var a, to, v1 uintptr _, _, _ = a, to, v1 if (*Tstate)(unsafe.Pointer(s)).Fnouts == uint64(0) { return /* nothing to do */ } if (*Tstate)(unsafe.Pointer(s)).Ftmp != libc.UintptrFromInt32(0) { return /* already in progress */ } (*Tstate)(unsafe.Pointer(s)).Ftmp = s /* mark as in progress */ for { v1 = (*Tstate)(unsafe.Pointer(s)).Fouts a = v1 if !(v1 != libc.UintptrFromInt32(0)) { break } to = (*Tarc)(unsafe.Pointer(a)).Fto _deltraverse(tls, nfa, leftend, to) _freearc(tls, nfa, a) if (*Tstate)(unsafe.Pointer(to)).Fnins == uint64(0) && (*Tstate)(unsafe.Pointer(to)).Ftmp == libc.UintptrFromInt32(0) { _freestate(tls, nfa, to) } } /* we're still here */ /* and still reachable */ /* but have no outarcs */ (*Tstate)(unsafe.Pointer(s)).Ftmp = libc.UintptrFromInt32(0) /* we're done here */ } // C documentation // // /* // - dupnfa - duplicate sub-NFA // * Another recursive traversal, this time using tmp to point to duplicates as // * well as mark already-seen states. (You knew there was a reason why it's a // * state pointer, didn't you? :-)) // ^ static void dupnfa(struct nfa *, struct state *, struct state *, // ^ struct state *, struct state *); // */ func _dupnfa(tls *libc.TLS, nfa uintptr, start uintptr, stop uintptr, from uintptr, to uintptr) { /* to here */ if start == stop { _newarc(tls, nfa, int32('n'), 0, from, to) return } (*Tstate)(unsafe.Pointer(stop)).Ftmp = to _duptraverse(tls, nfa, start, from, 0) /* done, except for clearing out the tmp pointers */ (*Tstate)(unsafe.Pointer(stop)).Ftmp = libc.UintptrFromInt32(0) _cleartraverse(tls, nfa, start) } // C documentation // // /* // - duptraverse - recursive heart of dupnfa // ^ static void duptraverse(struct nfa *, struct state *, struct state *); // */ func _duptraverse(tls *libc.TLS, nfa uintptr, s uintptr, stmp uintptr, depth int32) { var a, v1 uintptr var v2, v3 int32 _, _, _, _ = a, v1, v2, v3 if (*Tstate)(unsafe.Pointer(s)).Ftmp != libc.UintptrFromInt32(0) { return /* already done */ } if stmp == libc.UintptrFromInt32(0) { v1 = _newstate(tls, nfa) } else { v1 = stmp } (*Tstate)(unsafe.Pointer(s)).Ftmp = v1 if (*Tstate)(unsafe.Pointer(s)).Ftmp == libc.UintptrFromInt32(0) { return } /* * Arbitrary depth limit. Needs tuning, but this value is sufficient to * make all normal tests (not reg-33.14) pass. */ v2 = depth depth++ if v2 > int32(DUPTRAVERSE_MAX_DEPTH) { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v3 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v3 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v3 } a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } _duptraverse(tls, nfa, (*Tarc)(unsafe.Pointer(a)).Fto, libc.UintptrFromInt32(0), depth) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { break } _cparc(tls, nfa, a, (*Tstate)(unsafe.Pointer(s)).Ftmp, (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(a)).Fto)).Ftmp) goto _4 _4: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } } // C documentation // // /* // - cleartraverse - recursive cleanup for algorithms that leave tmp ptrs set // ^ static void cleartraverse(struct nfa *, struct state *); // */ func _cleartraverse(tls *libc.TLS, nfa uintptr, s uintptr) { var a uintptr _ = a if (*Tstate)(unsafe.Pointer(s)).Ftmp == libc.UintptrFromInt32(0) { return } (*Tstate)(unsafe.Pointer(s)).Ftmp = libc.UintptrFromInt32(0) a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } _cleartraverse(tls, nfa, (*Tarc)(unsafe.Pointer(a)).Fto) goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } } // C documentation // // /* // - specialcolors - fill in special colors for an NFA // ^ static void specialcolors(struct nfa *); // */ func _specialcolors(tls *libc.TLS, nfa uintptr) { /* * False colors for BOS, BOL, EOS, EOL */ if (*Tnfa)(unsafe.Pointer(nfa)).Fparent == libc.UintptrFromInt32(0) { *(*Tcolor)(unsafe.Pointer(nfa + 72)) = _pseudocolor(tls, (*Tnfa)(unsafe.Pointer(nfa)).Fcm) *(*Tcolor)(unsafe.Pointer(nfa + 72 + 1*2)) = _pseudocolor(tls, (*Tnfa)(unsafe.Pointer(nfa)).Fcm) *(*Tcolor)(unsafe.Pointer(nfa + 76)) = _pseudocolor(tls, (*Tnfa)(unsafe.Pointer(nfa)).Fcm) *(*Tcolor)(unsafe.Pointer(nfa + 76 + 1*2)) = _pseudocolor(tls, (*Tnfa)(unsafe.Pointer(nfa)).Fcm) } else { *(*Tcolor)(unsafe.Pointer(nfa + 72)) = *(*Tcolor)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fparent + 72)) *(*Tcolor)(unsafe.Pointer(nfa + 72 + 1*2)) = *(*Tcolor)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fparent + 72 + 1*2)) *(*Tcolor)(unsafe.Pointer(nfa + 76)) = *(*Tcolor)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fparent + 76)) *(*Tcolor)(unsafe.Pointer(nfa + 76 + 1*2)) = *(*Tcolor)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fparent + 76 + 1*2)) } } /* - optimize - optimize an NFA ^ static long optimize(struct nfa *, FILE *); */ // C documentation // // /* // * The main goal of this function is not so much "optimization" (though it // * does try to get rid of useless NFA states) as reducing the NFA to a form // * the regex executor can handle. The executor, and indeed the cNFA format // * that is its input, can only handle PLAIN and LACON arcs. The output of // * the regex parser also includes EMPTY (do-nothing) arcs, as well as // * ^, $, AHEAD, and BEHIND constraint arcs, which we must get rid of here. // * We first get rid of EMPTY arcs and then deal with the constraint arcs. // * The hardest part of either job is to get rid of circular loops of the // * target arc type. We would have to do that in any case, though, as such a // * loop would otherwise allow the executor to cycle through the loop endlessly // * without making any progress in the input string. // */ func _optimize(tls *libc.TLS, nfa uintptr, f uintptr) (r int64) { /* for debug output; NULL none */ var verbose, v1 int32 _, _ = verbose, v1 if f != libc.UintptrFromInt32(0) { v1 = int32(1) } else { v1 = 0 } verbose = v1 if verbose != 0 { libc.Xfprintf(tls, f, __ccgo_ts+298, 0) } _cleanup(tls, nfa) /* may simplify situation */ if verbose != 0 { _dumpnfa(tls, nfa, f) } if verbose != 0 { libc.Xfprintf(tls, f, __ccgo_ts+317, 0) } _fixempties(tls, nfa, f) /* get rid of EMPTY arcs */ if verbose != 0 { libc.Xfprintf(tls, f, __ccgo_ts+328, 0) } _fixconstraintloops(tls, nfa, f) /* get rid of constraint loops */ _pullback(tls, nfa, f) /* pull back constraints backward */ _pushfwd(tls, nfa, f) /* push fwd constraints forward */ if verbose != 0 { libc.Xfprintf(tls, f, __ccgo_ts+343, 0) } _cleanup(tls, nfa) /* final tidying */ return _analyze(tls, nfa) /* and analysis */ } // C documentation // // /* // - pullback - pull back constraints backward to eliminate them // ^ static void pullback(struct nfa *, FILE *); // */ func _pullback(tls *libc.TLS, nfa uintptr, f uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* for debug output; NULL none */ var a, nexta, nexts, ns, s uintptr var progress int32 var _ /* intermediates at bp+0 */ uintptr _, _, _, _, _, _ = a, nexta, nexts, ns, progress, s /* * Find and pull until there are no more. */ for cond := true; cond; cond = progress != 0 && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0)) { progress = 0 s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } nexts = (*Tstate)(unsafe.Pointer(s)).Fnext *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } nexta = (*Tarc)(unsafe.Pointer(a)).Foutchain if (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('^') || (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('r') { if _pull(tls, nfa, a, bp) != 0 { progress = int32(1) } } goto _2 _2: ; a = nexta } /* clear tmp fields of intermediate states created here */ for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { ns = (*Tstate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ftmp (*Tstate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ftmp = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(bp)) = ns } /* if s is now useless, get rid of it */ if ((*Tstate)(unsafe.Pointer(s)).Fnins == uint64(0) || (*Tstate)(unsafe.Pointer(s)).Fnouts == uint64(0)) && !((*Tstate)(unsafe.Pointer(s)).Fflag != 0) { _dropstate(tls, nfa, s) } goto _1 _1: ; s = nexts } if progress != 0 && f != libc.UintptrFromInt32(0) { _dumpnfa(tls, nfa, f) } } if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return } /* * Any ^ constraints we were able to pull to the start state can now be * replaced by PLAIN arcs referencing the BOS or BOL colors. There should * be no other ^ or BEHIND arcs left in the NFA, though we do not check * that here (compact() will fail if so). */ a = (*Tstate)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fpre)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } nexta = (*Tarc)(unsafe.Pointer(a)).Foutchain if (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('^') { _newarc(tls, nfa, int32('p'), int32(*(*Tcolor)(unsafe.Pointer(nfa + 72 + uintptr((*Tarc)(unsafe.Pointer(a)).Fco)*2))), (*Tarc)(unsafe.Pointer(a)).Ffrom, (*Tarc)(unsafe.Pointer(a)).Fto) _freearc(tls, nfa, a) } goto _3 _3: ; a = nexta } } // C documentation // // /* // - pull - pull a back constraint backward past its source state // * // * Returns 1 if successful (which it always is unless the source is the // * start state or we have an internal error), 0 if nothing happened. // * // * A significant property of this function is that it deletes no preexisting // * states, and no outarcs of the constraint's from state other than the given // * constraint arc. This makes the loops in pullback() safe, at the cost that // * we may leave useless states behind. Therefore, we leave it to pullback() // * to delete such states. // * // * If the from state has multiple back-constraint outarcs, and/or multiple // * compatible constraint inarcs, we only need to create one new intermediate // * state per combination of predecessor and successor states. *intermediates // * points to a list of such intermediate states for this from state (chained // * through their tmp fields). // ^ static int pull(struct nfa *, struct arc *); // */ func _pull(tls *libc.TLS, nfa uintptr, con uintptr, intermediates uintptr) (r int32) { var a, from, nexta, s, to uintptr _, _, _, _, _ = a, from, nexta, s, to from = (*Tarc)(unsafe.Pointer(con)).Ffrom to = (*Tarc)(unsafe.Pointer(con)).Fto /* should have gotten rid of this earlier */ if (*Tstate)(unsafe.Pointer(from)).Fflag != 0 { /* can't pull back beyond start */ return 0 } if (*Tstate)(unsafe.Pointer(from)).Fnins == uint64(0) { /* unreachable */ _freearc(tls, nfa, con) return int32(1) } /* * First, clone from state if necessary to avoid other outarcs. This may * seem wasteful, but it simplifies the logic, and we'll get rid of the * clone state again at the bottom. */ if (*Tstate)(unsafe.Pointer(from)).Fnouts > uint64(1) { s = _newstate(tls, nfa) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return 0 } _copyins(tls, nfa, from, s) /* duplicate inarcs */ _cparc(tls, nfa, con, s, to) /* move constraint arc */ _freearc(tls, nfa, con) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return 0 } from = s con = (*Tstate)(unsafe.Pointer(from)).Fouts } /* * Propagate the constraint into the from state's inarcs. */ a = (*Tstate)(unsafe.Pointer(from)).Fins for { if !(a != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } nexta = (*Tarc)(unsafe.Pointer(a)).Finchain switch _combine(tls, con, a) { case int32(INCOMPATIBLE): goto _2 case int32(SATISFIED): goto _3 case int32(COMPATIBLE): goto _4 default: goto _5 } goto _6 _2: ; /* destroy the arc */ _freearc(tls, nfa, a) goto _6 _3: ; /* no action needed */ goto _6 _4: ; /* swap the two arcs, more or less */ /* need an intermediate state, but might have one already */ s = *(*uintptr)(unsafe.Pointer(intermediates)) _9: ; if !(s != libc.UintptrFromInt32(0)) { goto _7 } if (*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(s)).Fins)).Ffrom == (*Tarc)(unsafe.Pointer(a)).Ffrom && (*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(s)).Fouts)).Fto == to { goto _7 } goto _8 _8: ; s = (*Tstate)(unsafe.Pointer(s)).Ftmp goto _9 goto _7 _7: ; if s == libc.UintptrFromInt32(0) { s = _newstate(tls, nfa) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return 0 } (*Tstate)(unsafe.Pointer(s)).Ftmp = *(*uintptr)(unsafe.Pointer(intermediates)) *(*uintptr)(unsafe.Pointer(intermediates)) = s } _cparc(tls, nfa, con, (*Tarc)(unsafe.Pointer(a)).Ffrom, s) _cparc(tls, nfa, a, s, to) _freearc(tls, nfa, a) goto _6 _5: ; goto _6 _6: ; goto _1 _1: ; a = nexta } /* * Remaining inarcs, if any, incorporate the constraint. */ _moveins(tls, nfa, from, to) _freearc(tls, nfa, con) /* from state is now useless, but we leave it to pullback() to clean up */ return int32(1) } // C documentation // // /* // - pushfwd - push forward constraints forward to eliminate them // ^ static void pushfwd(struct nfa *, FILE *); // */ func _pushfwd(tls *libc.TLS, nfa uintptr, f uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* for debug output; NULL none */ var a, nexta, nexts, ns, s uintptr var progress int32 var _ /* intermediates at bp+0 */ uintptr _, _, _, _, _, _ = a, nexta, nexts, ns, progress, s /* * Find and push until there are no more. */ for cond := true; cond; cond = progress != 0 && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0)) { progress = 0 s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } nexts = (*Tstate)(unsafe.Pointer(s)).Fnext *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) a = (*Tstate)(unsafe.Pointer(s)).Fins for { if !(a != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } nexta = (*Tarc)(unsafe.Pointer(a)).Finchain if (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('$') || (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('a') { if _push(tls, nfa, a, bp) != 0 { progress = int32(1) } } goto _2 _2: ; a = nexta } /* clear tmp fields of intermediate states created here */ for *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { ns = (*Tstate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ftmp (*Tstate)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ftmp = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(bp)) = ns } /* if s is now useless, get rid of it */ if ((*Tstate)(unsafe.Pointer(s)).Fnins == uint64(0) || (*Tstate)(unsafe.Pointer(s)).Fnouts == uint64(0)) && !((*Tstate)(unsafe.Pointer(s)).Fflag != 0) { _dropstate(tls, nfa, s) } goto _1 _1: ; s = nexts } if progress != 0 && f != libc.UintptrFromInt32(0) { _dumpnfa(tls, nfa, f) } } if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return } /* * Any $ constraints we were able to push to the post state can now be * replaced by PLAIN arcs referencing the EOS or EOL colors. There should * be no other $ or AHEAD arcs left in the NFA, though we do not check * that here (compact() will fail if so). */ a = (*Tstate)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fpost)).Fins for { if !(a != libc.UintptrFromInt32(0)) { break } nexta = (*Tarc)(unsafe.Pointer(a)).Finchain if (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('$') { _newarc(tls, nfa, int32('p'), int32(*(*Tcolor)(unsafe.Pointer(nfa + 76 + uintptr((*Tarc)(unsafe.Pointer(a)).Fco)*2))), (*Tarc)(unsafe.Pointer(a)).Ffrom, (*Tarc)(unsafe.Pointer(a)).Fto) _freearc(tls, nfa, a) } goto _3 _3: ; a = nexta } } // C documentation // // /* // - push - push a forward constraint forward past its destination state // * // * Returns 1 if successful (which it always is unless the destination is the // * post state or we have an internal error), 0 if nothing happened. // * // * A significant property of this function is that it deletes no preexisting // * states, and no inarcs of the constraint's to state other than the given // * constraint arc. This makes the loops in pushfwd() safe, at the cost that // * we may leave useless states behind. Therefore, we leave it to pushfwd() // * to delete such states. // * // * If the to state has multiple forward-constraint inarcs, and/or multiple // * compatible constraint outarcs, we only need to create one new intermediate // * state per combination of predecessor and successor states. *intermediates // * points to a list of such intermediate states for this to state (chained // * through their tmp fields). // ^ static int push(struct nfa *, struct arc *); // */ func _push(tls *libc.TLS, nfa uintptr, con uintptr, intermediates uintptr) (r int32) { var a, from, nexta, s, to uintptr _, _, _, _, _ = a, from, nexta, s, to from = (*Tarc)(unsafe.Pointer(con)).Ffrom to = (*Tarc)(unsafe.Pointer(con)).Fto /* should have gotten rid of this earlier */ if (*Tstate)(unsafe.Pointer(to)).Fflag != 0 { /* can't push forward beyond end */ return 0 } if (*Tstate)(unsafe.Pointer(to)).Fnouts == uint64(0) { /* dead end */ _freearc(tls, nfa, con) return int32(1) } /* * First, clone to state if necessary to avoid other inarcs. This may * seem wasteful, but it simplifies the logic, and we'll get rid of the * clone state again at the bottom. */ if (*Tstate)(unsafe.Pointer(to)).Fnins > uint64(1) { s = _newstate(tls, nfa) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return 0 } _copyouts(tls, nfa, to, s) /* duplicate outarcs */ _cparc(tls, nfa, con, from, s) /* move constraint arc */ _freearc(tls, nfa, con) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return 0 } to = s con = (*Tstate)(unsafe.Pointer(to)).Fins } /* * Propagate the constraint into the to state's outarcs. */ a = (*Tstate)(unsafe.Pointer(to)).Fouts for { if !(a != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } nexta = (*Tarc)(unsafe.Pointer(a)).Foutchain switch _combine(tls, con, a) { case int32(INCOMPATIBLE): goto _2 case int32(SATISFIED): goto _3 case int32(COMPATIBLE): goto _4 default: goto _5 } goto _6 _2: ; /* destroy the arc */ _freearc(tls, nfa, a) goto _6 _3: ; /* no action needed */ goto _6 _4: ; /* swap the two arcs, more or less */ /* need an intermediate state, but might have one already */ s = *(*uintptr)(unsafe.Pointer(intermediates)) _9: ; if !(s != libc.UintptrFromInt32(0)) { goto _7 } if (*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(s)).Fins)).Ffrom == from && (*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(s)).Fouts)).Fto == (*Tarc)(unsafe.Pointer(a)).Fto { goto _7 } goto _8 _8: ; s = (*Tstate)(unsafe.Pointer(s)).Ftmp goto _9 goto _7 _7: ; if s == libc.UintptrFromInt32(0) { s = _newstate(tls, nfa) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return 0 } (*Tstate)(unsafe.Pointer(s)).Ftmp = *(*uintptr)(unsafe.Pointer(intermediates)) *(*uintptr)(unsafe.Pointer(intermediates)) = s } _cparc(tls, nfa, con, s, (*Tarc)(unsafe.Pointer(a)).Fto) _cparc(tls, nfa, a, from, s) _freearc(tls, nfa, a) goto _6 _5: ; goto _6 _6: ; goto _1 _1: ; a = nexta } /* * Remaining outarcs, if any, incorporate the constraint. */ _moveouts(tls, nfa, to, from) _freearc(tls, nfa, con) /* to state is now useless, but we leave it to pushfwd() to clean up */ return int32(1) } // C documentation // // /* // - combine - constraint lands on an arc, what happens? // ^ #def INCOMPATIBLE 1 // destroys arc // ^ #def SATISFIED 2 // constraint satisfied // ^ #def COMPATIBLE 3 // compatible but not satisfied yet // ^ static int combine(struct arc *, struct arc *); // */ func _combine(tls *libc.TLS, con uintptr, a uintptr) (r int32) { switch (*Tarc)(unsafe.Pointer(con)).Ftype1< 0) { break } a = (*Tarc)(unsafe.Pointer(a)).Finchain } *(*uintptr)(unsafe.Pointer(inarcsorig + uintptr((*Tstate)(unsafe.Pointer(s)).Fno)*8)) = a goto _6 _6: ; s = (*Tstate)(unsafe.Pointer(s)).Fnext } XTclpFree(tls, arcarray) XTclpFree(tls, inarcsorig) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return } /* * Remove all the EMPTY arcs, since we don't need them anymore. */ s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0)) { break } a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } nexta = (*Tarc)(unsafe.Pointer(a)).Foutchain if (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('n') { _freearc(tls, nfa, a) } goto _12 _12: ; a = nexta } goto _11 _11: ; s = (*Tstate)(unsafe.Pointer(s)).Fnext } /* * And remove any states that have become useless. (This cleanup is * not very thorough, and would be even less so if we tried to * combine it with the previous step; but cleanup() will take care * of anything we miss.) */ s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0)) { break } nexts = (*Tstate)(unsafe.Pointer(s)).Fnext if ((*Tstate)(unsafe.Pointer(s)).Fnins == uint64(0) || (*Tstate)(unsafe.Pointer(s)).Fnouts == uint64(0)) && !((*Tstate)(unsafe.Pointer(s)).Fflag != 0) { _dropstate(tls, nfa, s) } goto _13 _13: ; s = nexts } if f != libc.UintptrFromInt32(0) { _dumpnfa(tls, nfa, f) } } // C documentation // // /* // - emptyreachable - recursively find all states that can reach s by EMPTY arcs // * The return value is the last such state found. Its tmp field links back // * to the next-to-last such state, and so on back to s, so that all these // * states can be located without searching the whole NFA. // * // * Since this is only used in fixempties(), we pass in the inarcsorig[] array // * maintained by that function. This lets us skip over all new inarcs, which // * are certainly not EMPTY arcs. // * // * The maximum recursion depth here is equal to the length of the longest // * loop-free chain of EMPTY arcs, which is surely no more than the size of // * the NFA, and in practice will be less than that. // ^ static struct state *emptyreachable(struct state *, struct state *); // */ func _emptyreachable(tls *libc.TLS, nfa uintptr, s uintptr, lastfound uintptr, inarcsorig uintptr) (r uintptr) { var a uintptr _ = a (*Tstate)(unsafe.Pointer(s)).Ftmp = lastfound lastfound = s a = *(*uintptr)(unsafe.Pointer(inarcsorig + uintptr((*Tstate)(unsafe.Pointer(s)).Fno)*8)) for { if !(a != libc.UintptrFromInt32(0)) { break } if (*Tarc)(unsafe.Pointer(a)).Ftype1 == int32('n') && (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(a)).Ffrom)).Ftmp == libc.UintptrFromInt32(0) { lastfound = _emptyreachable(tls, nfa, (*Tarc)(unsafe.Pointer(a)).Ffrom, lastfound, inarcsorig) } goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Finchain } return lastfound } // C documentation // // /* // * isconstraintarc - detect whether an arc is of a constraint type // */ func _isconstraintarc(tls *libc.TLS, a uintptr) (r int32) { switch (*Tarc)(unsafe.Pointer(a)).Ftype1 { case int32('^'): fallthrough case int32('$'): fallthrough case int32('r'): fallthrough case int32('a'): fallthrough case int32('L'): return int32(1) } return 0 } // C documentation // // /* // * hasconstraintout - does state have a constraint out arc? // */ func _hasconstraintout(tls *libc.TLS, s uintptr) (r int32) { var a uintptr _ = a a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } if _isconstraintarc(tls, a) != 0 { return int32(1) } goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } return 0 } // C documentation // // /* // * fixconstraintloops - get rid of loops containing only constraint arcs // * // * A loop of states that contains only constraint arcs is useless, since // * passing around the loop represents no forward progress. Moreover, it // * would cause infinite looping in pullback/pushfwd, so we need to get rid // * of such loops before doing that. // */ func _fixconstraintloops(tls *libc.TLS, nfa uintptr, f uintptr) { /* for debug output; NULL none */ var a, nexta, nexts, s uintptr var hasconstraints int32 _, _, _, _, _ = a, hasconstraints, nexta, nexts, s /* * In the trivial case of a state that loops to itself, we can just drop * the constraint arc altogether. This is worth special-casing because * such loops are far more common than loops containing multiple states. * While we're at it, note whether any constraint arcs survive. */ hasconstraints = 0 s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } nexts = (*Tstate)(unsafe.Pointer(s)).Fnext /* while we're at it, ensure tmp fields are clear for next step */ a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } nexta = (*Tarc)(unsafe.Pointer(a)).Foutchain if _isconstraintarc(tls, a) != 0 { if (*Tarc)(unsafe.Pointer(a)).Fto == s { _freearc(tls, nfa, a) } else { hasconstraints = int32(1) } } goto _2 _2: ; a = nexta } /* If we removed all the outarcs, the state is useless. */ if (*Tstate)(unsafe.Pointer(s)).Fnouts == uint64(0) && !((*Tstate)(unsafe.Pointer(s)).Fflag != 0) { _dropstate(tls, nfa, s) } goto _1 _1: ; s = nexts } /* Nothing to do if no remaining constraint arcs */ if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 || !(hasconstraints != 0) { return } /* * Starting from each remaining NFA state, search outwards for a * constraint loop. If we find a loop, break the loop, then start the * search over. (We could possibly retain some state from the first scan, * but it would complicate things greatly, and multi-state constraint * loops are rare enough that it's not worth optimizing the case.) */ goto restart restart: ; s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } if _findconstraintloop(tls, nfa, s) != 0 { goto restart } goto _3 _3: ; s = (*Tstate)(unsafe.Pointer(s)).Fnext } if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return } /* * Now remove any states that have become useless. (This cleanup is not * very thorough, and would be even less so if we tried to combine it with * the previous step; but cleanup() will take care of anything we miss.) * * Because findconstraintloop intentionally doesn't reset all tmp fields, * we have to clear them after it's done. This is a convenient place to * do that, too. */ s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0)) { break } nexts = (*Tstate)(unsafe.Pointer(s)).Fnext (*Tstate)(unsafe.Pointer(s)).Ftmp = libc.UintptrFromInt32(0) if ((*Tstate)(unsafe.Pointer(s)).Fnins == uint64(0) || (*Tstate)(unsafe.Pointer(s)).Fnouts == uint64(0)) && !((*Tstate)(unsafe.Pointer(s)).Fflag != 0) { _dropstate(tls, nfa, s) } goto _4 _4: ; s = nexts } if f != libc.UintptrFromInt32(0) { _dumpnfa(tls, nfa, f) } } // C documentation // // /* // * findconstraintloop - recursively find a loop of constraint arcs // * // * If we find a loop, break it by calling breakconstraintloop(), then // * return 1; otherwise return 0. // * // * State tmp fields are guaranteed all NULL on a success return, because // * breakconstraintloop does that. After a failure return, any state that // * is known not to be part of a loop is marked with s->tmp == s; this allows // * us not to have to re-prove that fact on later calls. (This convention is // * workable because we already eliminated single-state loops.) // * // * Note that the found loop doesn't necessarily include the first state we // * are called on. Any loop reachable from that state will do. // * // * The maximum recursion depth here is one more than the length of the longest // * loop-free chain of constraint arcs, which is surely no more than the size // * of the NFA, and in practice will be a lot less than that. // */ func _findconstraintloop(tls *libc.TLS, nfa uintptr, s uintptr) (r int32) { var a, sto uintptr var v1 int32 _, _, _ = a, sto, v1 /* Since this is recursive, it could be driven to stack overflow */ if 0 != 0 { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v1 = int32(REG_ETOOBIG) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v1 return int32(1) /* to exit as quickly as possible */ } if (*Tstate)(unsafe.Pointer(s)).Ftmp != libc.UintptrFromInt32(0) { /* Already proven uninteresting? */ if (*Tstate)(unsafe.Pointer(s)).Ftmp == s { return 0 } /* Found a loop involving s */ _breakconstraintloop(tls, nfa, s) /* The tmp fields have been cleaned up by breakconstraintloop */ return int32(1) } a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } if _isconstraintarc(tls, a) != 0 { sto = (*Tarc)(unsafe.Pointer(a)).Fto (*Tstate)(unsafe.Pointer(s)).Ftmp = sto if _findconstraintloop(tls, nfa, sto) != 0 { return int32(1) } } goto _2 _2: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } /* * If we get here, no constraint loop exists leading out from s. Mark it * with s->tmp == s so we need not rediscover that fact again later. */ (*Tstate)(unsafe.Pointer(s)).Ftmp = s return 0 } // C documentation // // /* // * breakconstraintloop - break a loop of constraint arcs // * // * sinitial is any one member state of the loop. Each loop member's tmp // * field links to its successor within the loop. (Note that this function // * will reset all the tmp fields to NULL.) // * // * We can break the loop by, for any one state S1 in the loop, cloning its // * loop successor state S2 (and possibly following states), and then moving // * all S1->S2 constraint arcs to point to the cloned S2. The cloned S2 should // * copy any non-constraint outarcs of S2. Constraint outarcs should be // * dropped if they point back to S1, else they need to be copied as arcs to // * similarly cloned states S3, S4, etc. In general, each cloned state copies // * non-constraint outarcs, drops constraint outarcs that would lead to itself // * or any earlier cloned state, and sends other constraint outarcs to newly // * cloned states. No cloned state will have any inarcs that aren't constraint // * arcs or do not lead from S1 or earlier-cloned states. It's okay to drop // * constraint back-arcs since they would not take us to any state we've not // * already been in; therefore, no new constraint loop is created. In this way // * we generate a modified NFA that can still represent every useful state // * sequence, but not sequences that represent state loops with no consumption // * of input data. Note that the set of cloned states will certainly include // * all of the loop member states other than S1, and it may also include // * non-loop states that are reachable from S2 via constraint arcs. This is // * important because there is no guarantee that findconstraintloop found a // * maximal loop (and searching for one would be NP-hard, so don't try). // * Frequently the "non-loop states" are actually part of a larger loop that // * we didn't notice, and indeed there may be several overlapping loops. // * This technique ensures convergence in such cases, while considering only // * the originally-found loop does not. // * // * If there is only one S1->S2 constraint arc, then that constraint is // * certainly satisfied when we enter any of the clone states. This means that // * in the common case where many of the constraint arcs are identically // * labeled, we can merge together clone states linked by a similarly-labeled // * constraint: if we can get to the first one we can certainly get to the // * second, so there's no need to distinguish. This greatly reduces the number // * of new states needed, so we preferentially break the given loop at a state // * pair where this is true. // * // * Furthermore, it's fairly common to find that a cloned successor state has // * no outarcs, especially if we're a bit aggressive about removing unnecessary // * outarcs. If that happens, then there is simply not any interesting state // * that can be reached through the predecessor's loop arcs, which means we can // * break the loop just by removing those loop arcs, with no new states added. // */ func _breakconstraintloop(tls *libc.TLS, nfa uintptr, sinitial uintptr) { var a, nexta, nexts, refarc, s, sclone, shead, stail uintptr var narcs int32 _, _, _, _, _, _, _, _, _ = a, narcs, nexta, nexts, refarc, s, sclone, shead, stail /* * Start by identifying which loop step we want to break at. * Preferentially this is one with only one constraint arc. (XXX are * there any other secondary heuristics we want to use here?) Set refarc * to point to the selected lone constraint arc, if there is one. */ refarc = libc.UintptrFromInt32(0) s = sinitial for cond := true; cond; cond = s != sinitial { nexts = (*Tstate)(unsafe.Pointer(s)).Ftmp /* should not see any one-element loops */ if refarc == libc.UintptrFromInt32(0) { narcs = 0 a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } if (*Tarc)(unsafe.Pointer(a)).Fto == nexts && _isconstraintarc(tls, a) != 0 { refarc = a narcs++ } goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } if narcs > int32(1) { refarc = libc.UintptrFromInt32(0) /* multiple constraint arcs here, no good */ } } s = nexts } if refarc != 0 { /* break at the refarc */ shead = (*Tarc)(unsafe.Pointer(refarc)).Ffrom stail = (*Tarc)(unsafe.Pointer(refarc)).Fto } else { /* for lack of a better idea, break after sinitial */ shead = sinitial stail = (*Tstate)(unsafe.Pointer(sinitial)).Ftmp } /* * Reset the tmp fields so that we can use them for local storage in * clonesuccessorstates. (findconstraintloop won't mind, since it's just * going to abandon its search anyway.) */ s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0)) { break } (*Tstate)(unsafe.Pointer(s)).Ftmp = libc.UintptrFromInt32(0) goto _2 _2: ; s = (*Tstate)(unsafe.Pointer(s)).Fnext } /* * Recursively build clone state(s) as needed. */ sclone = _newstate(tls, nfa) if sclone == libc.UintptrFromInt32(0) { return } _clonesuccessorstates(tls, nfa, stail, sclone, shead, refarc, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), (*Tnfa)(unsafe.Pointer(nfa)).Fnstates) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { return } /* * It's possible that sclone has no outarcs at all, in which case it's * useless. (We don't try extremely hard to get rid of useless states * here, but this is an easy and fairly common case.) */ if (*Tstate)(unsafe.Pointer(sclone)).Fnouts == uint64(0) { _freestate(tls, nfa, sclone) sclone = libc.UintptrFromInt32(0) } /* * Move shead's constraint-loop arcs to point to sclone, or just drop them * if we discovered we don't need sclone. */ a = (*Tstate)(unsafe.Pointer(shead)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } nexta = (*Tarc)(unsafe.Pointer(a)).Foutchain if (*Tarc)(unsafe.Pointer(a)).Fto == stail && _isconstraintarc(tls, a) != 0 { if sclone != 0 { _cparc(tls, nfa, a, shead, sclone) } _freearc(tls, nfa, a) if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { break } } goto _3 _3: ; a = nexta } } // C documentation // // /* // * clonesuccessorstates - create a tree of constraint-arc successor states // * // * ssource is the state to be cloned, and sclone is the state to copy its // * outarcs into. sclone's inarcs, if any, should already be set up. // * // * spredecessor is the original predecessor state that we are trying to build // * successors for (it may not be the immediate predecessor of ssource). // * refarc, if not NULL, is the original constraint arc that is known to have // * been traversed out of spredecessor to reach the successor(s). // * // * For each cloned successor state, we transiently create a "donemap" that is // * a boolean array showing which source states we've already visited for this // * clone state. This prevents infinite recursion as well as useless repeat // * visits to the same state subtree (which can add up fast, since typical NFAs // * have multiple redundant arc pathways). Each donemap is a char array // * indexed by state number. The donemaps are all of the same size "nstates", // * which is nfa->nstates as of the start of the recursion. This is enough to // * have entries for all preexisting states, but *not* entries for clone // * states created during the recursion. That's okay since we have no need to // * mark those. // * // * curdonemap is NULL when recursing to a new sclone state, or sclone's // * donemap when we are recursing without having created a new state (which we // * do when we decide we can merge a successor state into the current clone // * state). outerdonemap is NULL at the top level and otherwise the parent // * clone state's donemap. // * // * The successor states we create and fill here form a strict tree structure, // * with each state having exactly one predecessor, except that the toplevel // * state has no inarcs as yet (breakconstraintloop will add its inarcs from // * spredecessor after we're done). Thus, we can examine sclone's inarcs back // * to the root, plus refarc if any, to identify the set of constraints already // * known valid at the current point. This allows us to avoid generating extra // * successor states. // */ func _clonesuccessorstates(tls *libc.TLS, nfa uintptr, ssource uintptr, sclone uintptr, spredecessor uintptr, refarc uintptr, curdonemap uintptr, outerdonemap uintptr, nstates Tsize_t) { var a, a2, donemap, prevclone, s, sto, sto1, stoclone, stoclone1 uintptr var canmerge, v1, v2 int32 _, _, _, _, _, _, _, _, _, _, _, _ = a, a2, canmerge, donemap, prevclone, s, sto, sto1, stoclone, stoclone1, v1, v2 /* Since this is recursive, it could be driven to stack overflow */ if 0 != 0 { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v1 = int32(REG_ETOOBIG) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v1 return } /* If this state hasn't already got a donemap, create one */ donemap = curdonemap if donemap == libc.UintptrFromInt32(0) { donemap = XTclpAlloc(tls, nstates*uint64(1)) if donemap == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v2 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v2 return } if outerdonemap != libc.UintptrFromInt32(0) { /* * Not at outermost recursion level, so copy the outer level's * donemap; this ensures that we see states in process of being * visited at outer levels, or already merged into predecessor * states, as ones we shouldn't traverse back to. */ libc.Xmemcpy(tls, donemap, outerdonemap, nstates*uint64(1)) } else { /* At outermost level, only spredecessor is off-limits */ libc.Xmemset(tls, donemap, 0, nstates*uint64(1)) *(*uint8)(unsafe.Pointer(donemap + uintptr((*Tstate)(unsafe.Pointer(spredecessor)).Fno))) = uint8(1) } } /* Mark ssource as visited in the donemap */ *(*uint8)(unsafe.Pointer(donemap + uintptr((*Tstate)(unsafe.Pointer(ssource)).Fno))) = uint8(1) /* * We proceed by first cloning all of ssource's outarcs, creating new * clone states as needed but not doing more with them than that. Then in * a second pass, recurse to process the child clone states. This allows * us to have only one child clone state per reachable source state, even * when there are multiple outarcs leading to the same state. Also, when * we do visit a child state, its set of inarcs is known exactly, which * makes it safe to apply the constraint-is-already-checked optimization. * Also, this ensures that we've merged all the states we can into the * current clone before we recurse to any children, thus possibly saving * them from making extra images of those states. * * While this function runs, child clone states of the current state are * marked by setting their tmp fields to point to the original state they * were cloned from. This makes it possible to detect multiple outarcs * leading to the same state, and also makes it easy to distinguish clone * states from original states (which will have tmp == NULL). */ a = (*Tstate)(unsafe.Pointer(ssource)).Fouts for { if !(a != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } sto = (*Tarc)(unsafe.Pointer(a)).Fto /* * We do not consider cloning successor states that have no constraint * outarcs; just link to them as-is. They cannot be part of a * constraint loop so there is no need to make copies. In particular, * this rule keeps us from trying to clone the post state, which would * be a bad idea. */ if _isconstraintarc(tls, a) != 0 && _hasconstraintout(tls, sto) != 0 { /* * Back-link constraint arcs must not be followed. Nor is there a * need to revisit states previously merged into this clone. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(donemap + uintptr((*Tstate)(unsafe.Pointer(sto)).Fno)))) != 0 { goto _3 } /* * Check whether we already have a child clone state for this * source state. */ prevclone = libc.UintptrFromInt32(0) a2 = (*Tstate)(unsafe.Pointer(sclone)).Fouts for { if !(a2 != libc.UintptrFromInt32(0)) { break } if (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(a2)).Fto)).Ftmp == sto { prevclone = (*Tarc)(unsafe.Pointer(a2)).Fto break } goto _4 _4: ; a2 = (*Tarc)(unsafe.Pointer(a2)).Foutchain } /* * If this arc is labeled the same as refarc, or the same as any * arc we must have traversed to get to sclone, then no additional * constraints need to be met to get to sto, so we should just * merge its outarcs into sclone. */ if refarc != 0 && (*Tarc)(unsafe.Pointer(a)).Ftype1 == (*Tarc)(unsafe.Pointer(refarc)).Ftype1 && int32((*Tarc)(unsafe.Pointer(a)).Fco) == int32((*Tarc)(unsafe.Pointer(refarc)).Fco) { canmerge = int32(1) } else { canmerge = 0 s = sclone for { if !((*Tstate)(unsafe.Pointer(s)).Fins != 0) { break } if (*Tstate)(unsafe.Pointer(s)).Fnins == uint64(1) && (*Tarc)(unsafe.Pointer(a)).Ftype1 == (*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(s)).Fins)).Ftype1 && int32((*Tarc)(unsafe.Pointer(a)).Fco) == int32((*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(s)).Fins)).Fco) { canmerge = int32(1) break } goto _5 _5: ; s = (*Tarc)(unsafe.Pointer((*Tstate)(unsafe.Pointer(s)).Fins)).Ffrom } } if canmerge != 0 { /* * We can merge into sclone. If we previously made a child * clone state, drop it; there's no need to visit it. (This * can happen if ssource has multiple pathways to sto, and we * only just now found one that is provably a no-op.) */ if prevclone != 0 { _dropstate(tls, nfa, prevclone) /* kills our outarc, too */ } /* Recurse to merge sto's outarcs into sclone */ _clonesuccessorstates(tls, nfa, sto, sclone, spredecessor, refarc, donemap, outerdonemap, nstates) /* sto should now be marked as previously visited */ } else { if prevclone != 0 { /* * We already have a clone state for this successor, so just * make another arc to it. */ _cparc(tls, nfa, a, sclone, prevclone) } else { stoclone = _newstate(tls, nfa) if stoclone == libc.UintptrFromInt32(0) { break } /* Mark it as to what it's a clone of */ (*Tstate)(unsafe.Pointer(stoclone)).Ftmp = sto /* ... and add the outarc leading to it */ _cparc(tls, nfa, a, sclone, stoclone) } } } else { /* * Non-constraint outarcs just get copied to sclone, as do outarcs * leading to states with no constraint outarc. */ _cparc(tls, nfa, a, sclone, sto) } goto _3 _3: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } /* * If we are at outer level for this clone state, recurse to all its child * clone states, clearing their tmp fields as we go. (If we're not * outermost for sclone, leave this to be done by the outer call level.) * Note that if we have multiple outarcs leading to the same clone state, * it will only be recursed-to once. */ if curdonemap == libc.UintptrFromInt32(0) { a = (*Tstate)(unsafe.Pointer(sclone)).Fouts for { if !(a != libc.UintptrFromInt32(0) && !((*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != libc.Int32FromInt32(0))) { break } stoclone1 = (*Tarc)(unsafe.Pointer(a)).Fto sto1 = (*Tstate)(unsafe.Pointer(stoclone1)).Ftmp if sto1 != libc.UintptrFromInt32(0) { (*Tstate)(unsafe.Pointer(stoclone1)).Ftmp = libc.UintptrFromInt32(0) _clonesuccessorstates(tls, nfa, sto1, stoclone1, spredecessor, refarc, libc.UintptrFromInt32(0), donemap, nstates) } goto _6 _6: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } /* Don't forget to free sclone's donemap when done with it */ XTclpFree(tls, donemap) } } // C documentation // // /* // - cleanup - clean up NFA after optimizations // ^ static void cleanup(struct nfa *); // */ func _cleanup(tls *libc.TLS, nfa uintptr) { var n, v3 Tsize_t var nexts, s uintptr _, _, _, _ = n, nexts, s, v3 /* * Clear out unreachable or dead-end states. Use pre to mark reachable, * then post to mark can-reach-post. */ _markreachable(tls, nfa, (*Tnfa)(unsafe.Pointer(nfa)).Fpre, libc.UintptrFromInt32(0), (*Tnfa)(unsafe.Pointer(nfa)).Fpre) _markcanreach(tls, nfa, (*Tnfa)(unsafe.Pointer(nfa)).Fpost, (*Tnfa)(unsafe.Pointer(nfa)).Fpre, (*Tnfa)(unsafe.Pointer(nfa)).Fpost) s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0)) { break } nexts = (*Tstate)(unsafe.Pointer(s)).Fnext if (*Tstate)(unsafe.Pointer(s)).Ftmp != (*Tnfa)(unsafe.Pointer(nfa)).Fpost && !((*Tstate)(unsafe.Pointer(s)).Fflag != 0) { _dropstate(tls, nfa, s) } goto _1 _1: ; s = nexts } _cleartraverse(tls, nfa, (*Tnfa)(unsafe.Pointer(nfa)).Fpre) /* the nins==0 (final unreachable) case will be caught later */ /* * Renumber surviving states. */ n = uint64(0) s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0)) { break } v3 = n n++ (*Tstate)(unsafe.Pointer(s)).Fno = v3 goto _2 _2: ; s = (*Tstate)(unsafe.Pointer(s)).Fnext } (*Tnfa)(unsafe.Pointer(nfa)).Fnstates = n } // C documentation // // /* // - markreachable - recursive marking of reachable states // ^ static void markreachable(struct nfa *, struct state *, struct state *, // ^ struct state *); // */ func _markreachable(tls *libc.TLS, nfa uintptr, s uintptr, okay uintptr, mark uintptr) { /* the value to mark with */ var a uintptr _ = a if (*Tstate)(unsafe.Pointer(s)).Ftmp != okay { return } (*Tstate)(unsafe.Pointer(s)).Ftmp = mark a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } _markreachable(tls, nfa, (*Tarc)(unsafe.Pointer(a)).Fto, okay, mark) goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } } // C documentation // // /* // - markcanreach - recursive marking of states which can reach here // ^ static void markcanreach(struct nfa *, struct state *, struct state *, // ^ struct state *); // */ func _markcanreach(tls *libc.TLS, nfa uintptr, s uintptr, okay uintptr, mark uintptr) { /* the value to mark with */ var a uintptr _ = a if (*Tstate)(unsafe.Pointer(s)).Ftmp != okay { return } (*Tstate)(unsafe.Pointer(s)).Ftmp = mark a = (*Tstate)(unsafe.Pointer(s)).Fins for { if !(a != libc.UintptrFromInt32(0)) { break } _markcanreach(tls, nfa, (*Tarc)(unsafe.Pointer(a)).Ffrom, okay, mark) goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Finchain } } // C documentation // // /* // - analyze - ascertain potentially-useful facts about an optimized NFA // ^ static long analyze(struct nfa *); // */ func _analyze(tls *libc.TLS, nfa uintptr) (r int64) { var a, aa uintptr _, _ = a, aa if (*Tstate)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fpre)).Fouts == libc.UintptrFromInt32(0) { return int64(REG_UIMPOSSIBLE) } a = (*Tstate)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fpre)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } aa = (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(a)).Fto)).Fouts for { if !(aa != libc.UintptrFromInt32(0)) { break } if (*Tarc)(unsafe.Pointer(aa)).Fto == (*Tnfa)(unsafe.Pointer(nfa)).Fpost { return int64(REG_UEMPTYMATCH) } goto _2 _2: ; aa = (*Tarc)(unsafe.Pointer(aa)).Foutchain } goto _1 _1: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } return 0 } // C documentation // // /* // - compact - construct the compact representation of an NFA // ^ static void compact(struct nfa *, struct cnfa *); // */ func _compact(tls *libc.TLS, nfa uintptr, cnfa uintptr) { var a, ca, first, s uintptr var narcs, nstates Tsize_t var v2, v5 int32 _, _, _, _, _, _, _, _ = a, ca, first, narcs, nstates, s, v2, v5 nstates = uint64(0) narcs = uint64(0) s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0)) { break } nstates++ narcs += (*Tstate)(unsafe.Pointer(s)).Fnouts + uint64(1) /* need one extra for endmarker */ goto _1 _1: ; s = (*Tstate)(unsafe.Pointer(s)).Fnext } (*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags = XTclpAlloc(tls, nstates*uint64(1)) (*Tcnfa)(unsafe.Pointer(cnfa)).Fstates = XTclpAlloc(tls, nstates*uint64(8)) (*Tcnfa)(unsafe.Pointer(cnfa)).Farcs = XTclpAlloc(tls, narcs*uint64(16)) if (*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags == libc.UintptrFromInt32(0) || (*Tcnfa)(unsafe.Pointer(cnfa)).Fstates == libc.UintptrFromInt32(0) || (*Tcnfa)(unsafe.Pointer(cnfa)).Farcs == libc.UintptrFromInt32(0) { if (*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags != libc.UintptrFromInt32(0) { XTclpFree(tls, (*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags) } if (*Tcnfa)(unsafe.Pointer(cnfa)).Fstates != libc.UintptrFromInt32(0) { XTclpFree(tls, (*Tcnfa)(unsafe.Pointer(cnfa)).Fstates) } if (*Tcnfa)(unsafe.Pointer(cnfa)).Farcs != libc.UintptrFromInt32(0) { XTclpFree(tls, (*Tcnfa)(unsafe.Pointer(cnfa)).Farcs) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v2 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v2 return } (*Tcnfa)(unsafe.Pointer(cnfa)).Fnstates = nstates (*Tcnfa)(unsafe.Pointer(cnfa)).Fpre = (*Tstate)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fpre)).Fno (*Tcnfa)(unsafe.Pointer(cnfa)).Fpost = (*Tstate)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fpost)).Fno *(*Tcolor)(unsafe.Pointer(cnfa + 32)) = *(*Tcolor)(unsafe.Pointer(nfa + 72)) *(*Tcolor)(unsafe.Pointer(cnfa + 32 + 1*2)) = *(*Tcolor)(unsafe.Pointer(nfa + 72 + 1*2)) *(*Tcolor)(unsafe.Pointer(cnfa + 36)) = *(*Tcolor)(unsafe.Pointer(nfa + 76)) *(*Tcolor)(unsafe.Pointer(cnfa + 36 + 1*2)) = *(*Tcolor)(unsafe.Pointer(nfa + 76 + 1*2)) (*Tcnfa)(unsafe.Pointer(cnfa)).Fncolors = int32(_maxcolor(tls, (*Tnfa)(unsafe.Pointer(nfa)).Fcm)) + int32(1) (*Tcnfa)(unsafe.Pointer(cnfa)).Fflags = 0 ca = (*Tcnfa)(unsafe.Pointer(cnfa)).Farcs s = (*Tnfa)(unsafe.Pointer(nfa)).Fstates for { if !(s != libc.UintptrFromInt32(0)) { break } *(*uint8)(unsafe.Pointer((*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*Tstate)(unsafe.Pointer(s)).Fno))) = uint8(0) *(*uintptr)(unsafe.Pointer((*Tcnfa)(unsafe.Pointer(cnfa)).Fstates + uintptr((*Tstate)(unsafe.Pointer(s)).Fno)*8)) = ca first = ca a = (*Tstate)(unsafe.Pointer(s)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } switch (*Tarc)(unsafe.Pointer(a)).Ftype1 { case int32('p'): (*Tcarc)(unsafe.Pointer(ca)).Fco = (*Tarc)(unsafe.Pointer(a)).Fco (*Tcarc)(unsafe.Pointer(ca)).Fto = (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(a)).Fto)).Fno ca += 16 case int32('L'): (*Tcarc)(unsafe.Pointer(ca)).Fco = int16((*Tcnfa)(unsafe.Pointer(cnfa)).Fncolors + int32((*Tarc)(unsafe.Pointer(a)).Fco)) (*Tcarc)(unsafe.Pointer(ca)).Fto = (*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(a)).Fto)).Fno ca += 16 *(*int32)(unsafe.Pointer(cnfa + 12)) |= int32(HASLACONS) default: (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr != 0 { v5 = (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr } else { v5 = int32(REG_ASSERT) } (*Tvars)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fv)).Ferr = v5 break } goto _4 _4: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } _carcsort(tls, first, libc.Uint64FromInt64((int64(ca)-int64(first))/16)) (*Tcarc)(unsafe.Pointer(ca)).Fco = int16(-libc.Int32FromInt32(1)) (*Tcarc)(unsafe.Pointer(ca)).Fto = uint64(0) ca += 16 goto _3 _3: ; s = (*Tstate)(unsafe.Pointer(s)).Fnext } /* * Mark no-progress states. */ a = (*Tstate)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fpre)).Fouts for { if !(a != libc.UintptrFromInt32(0)) { break } *(*uint8)(unsafe.Pointer((*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*Tstate)(unsafe.Pointer((*Tarc)(unsafe.Pointer(a)).Fto)).Fno))) = uint8(CNFA_NOPROGRESS) goto _6 _6: ; a = (*Tarc)(unsafe.Pointer(a)).Foutchain } *(*uint8)(unsafe.Pointer((*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*Tstate)(unsafe.Pointer((*Tnfa)(unsafe.Pointer(nfa)).Fpre)).Fno))) = uint8(CNFA_NOPROGRESS) } // C documentation // // /* // - carcsort - sort compacted-NFA arcs by color // ^ static void carcsort(struct carc *, struct carc *); // */ func _carcsort(tls *libc.TLS, first uintptr, n Tsize_t) { if n > uint64(1) { libc.Xqsort(tls, first, n, uint64(16), __ccgo_fp(_carc_cmp)) } } func _carc_cmp(tls *libc.TLS, a uintptr, b uintptr) (r int32) { var aa, bb uintptr _, _ = aa, bb aa = a bb = b if int32((*Tcarc)(unsafe.Pointer(aa)).Fco) < int32((*Tcarc)(unsafe.Pointer(bb)).Fco) { return -int32(1) } if int32((*Tcarc)(unsafe.Pointer(aa)).Fco) > int32((*Tcarc)(unsafe.Pointer(bb)).Fco) { return +libc.Int32FromInt32(1) } if (*Tcarc)(unsafe.Pointer(aa)).Fto < (*Tcarc)(unsafe.Pointer(bb)).Fto { return -int32(1) } if (*Tcarc)(unsafe.Pointer(aa)).Fto > (*Tcarc)(unsafe.Pointer(bb)).Fto { return +libc.Int32FromInt32(1) } return 0 } // C documentation // // /* // - freecnfa - free a compacted NFA // ^ static void freecnfa(struct cnfa *); // */ func _freecnfa(tls *libc.TLS, cnfa uintptr) { /* not empty already */ (*Tcnfa)(unsafe.Pointer(cnfa)).Fnstates = uint64(0) XTclpFree(tls, (*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags) XTclpFree(tls, (*Tcnfa)(unsafe.Pointer(cnfa)).Fstates) XTclpFree(tls, (*Tcnfa)(unsafe.Pointer(cnfa)).Farcs) } // C documentation // // /* // - dumpnfa - dump an NFA in human-readable form // ^ static void dumpnfa(struct nfa *, FILE *); // */ func _dumpnfa(tls *libc.TLS, nfa uintptr, f uintptr) { _ = nfa _ = f } // C documentation // // /* // - dumpcnfa - dump a compacted NFA in human-readable form // ^ static void dumpcnfa(struct cnfa *, FILE *); // */ func _dumpcnfa(tls *libc.TLS, cnfa uintptr, f uintptr) { _ = cnfa _ = f } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* * Utility functions for handling cvecs * This file is #included by regcomp.c. * * Copyright © 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 * Corporation, none of whom are responsible for the results. The author * thanks all of them. * * Redistribution and use in source and binary forms -- with or without * modification -- are permitted for any purpose, provided that * redistributions in source form retain this entire copyright notice and * indicate the origin and nature of any modifications. * * I'd appreciate being given credit for this package in the documentation of * software which uses it, but that is not a requirement. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Notes: * Only (selected) functions in _this_ file should treat chr* as non-constant. */ // C documentation // // /* // - newcvec - allocate a new cvec // ^ static struct cvec *newcvec(size_t, size_t); // */ func _newcvec(tls *libc.TLS, nchrs Tsize_t, nranges Tsize_t) (r uintptr) { /* ... and this many ranges... */ var cv uintptr var n, nc Tsize_t _, _, _ = cv, n, nc nc = nchrs + nranges*uint64(2) n = uint64(48) + nc*uint64(4) cv = XTclpAlloc(tls, n) if cv == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } (*Tcvec)(unsafe.Pointer(cv)).Fchrspace = nchrs (*Tcvec)(unsafe.Pointer(cv)).Fchrs = cv + libc.UintptrFromInt64(48) (*Tcvec)(unsafe.Pointer(cv)).Franges = (*Tcvec)(unsafe.Pointer(cv)).Fchrs + uintptr(nchrs)*4 (*Tcvec)(unsafe.Pointer(cv)).Frangespace = nranges return _clearcvec(tls, cv) } // C documentation // // /* // - clearcvec - clear a possibly-new cvec // * Returns pointer as convenience. // ^ static struct cvec *clearcvec(struct cvec *); // */ func _clearcvec(tls *libc.TLS, cv uintptr) (r uintptr) { /* character vector */ (*Tcvec)(unsafe.Pointer(cv)).Fnchrs = uint64(0) (*Tcvec)(unsafe.Pointer(cv)).Fnranges = uint64(0) return cv } // C documentation // // /* // - addchr - add a chr to a cvec // ^ static void addchr(struct cvec *, pchr); // */ func _addchr(tls *libc.TLS, cv uintptr, c Tpchr) { /* character to add */ var v1 Tsize_t var v2 uintptr _, _ = v1, v2 v2 = cv v1 = *(*Tsize_t)(unsafe.Pointer(v2)) *(*Tsize_t)(unsafe.Pointer(v2))++ *(*Tchr)(unsafe.Pointer((*Tcvec)(unsafe.Pointer(cv)).Fchrs + uintptr(v1)*4)) = c } // C documentation // // /* // - addrange - add a range to a cvec // ^ static void addrange(struct cvec *, pchr, pchr); // */ func _addrange(tls *libc.TLS, cv uintptr, from Tpchr, to Tpchr) { /* last character of range */ *(*Tchr)(unsafe.Pointer((*Tcvec)(unsafe.Pointer(cv)).Franges + uintptr((*Tcvec)(unsafe.Pointer(cv)).Fnranges*uint64(2))*4)) = from *(*Tchr)(unsafe.Pointer((*Tcvec)(unsafe.Pointer(cv)).Franges + uintptr((*Tcvec)(unsafe.Pointer(cv)).Fnranges*uint64(2)+uint64(1))*4)) = to (*Tcvec)(unsafe.Pointer(cv)).Fnranges++ } // C documentation // // /* // - getcvec - get a cvec, remembering it as v->cv // ^ static struct cvec *getcvec(struct vars *, int, int); // */ func _getcvec(tls *libc.TLS, v uintptr, nchrs Tsize_t, nranges Tsize_t) (r uintptr) { /* ... and this many ranges... */ var v1 int32 _ = v1 if (*Tvars)(unsafe.Pointer(v)).Fcv != libc.UintptrFromInt32(0) && nchrs <= (*Tcvec)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fcv)).Fchrspace && nranges <= (*Tcvec)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fcv)).Frangespace { return _clearcvec(tls, (*Tvars)(unsafe.Pointer(v)).Fcv) } if (*Tvars)(unsafe.Pointer(v)).Fcv != libc.UintptrFromInt32(0) { _freecvec(tls, (*Tvars)(unsafe.Pointer(v)).Fcv) } (*Tvars)(unsafe.Pointer(v)).Fcv = _newcvec(tls, nchrs, nranges) if (*Tvars)(unsafe.Pointer(v)).Fcv == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v1 } return (*Tvars)(unsafe.Pointer(v)).Fcv } // C documentation // // /* // - freecvec - free a cvec // ^ static void freecvec(struct cvec *); // */ func _freecvec(tls *libc.TLS, cv uintptr) { /* character vector */ XTclpFree(tls, cv) } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* * regc_locale.c -- * * This file contains the Unicode locale specific regexp routines. * This file is #included by regcomp.c. * * Copyright © 1998 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ /* ASCII character-name table */ type Tcname = struct { Fname uintptr Fcode uint8 } /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* * regc_locale.c -- * * This file contains the Unicode locale specific regexp routines. * This file is #included by regcomp.c. * * Copyright © 1998 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ /* ASCII character-name table */ var _cnames = [96]Tcname{ 0: { Fname: __ccgo_ts + 360, }, 1: { Fname: __ccgo_ts + 364, Fcode: uint8('\x01'), }, 2: { Fname: __ccgo_ts + 368, Fcode: uint8('\x02'), }, 3: { Fname: __ccgo_ts + 372, Fcode: uint8('\x03'), }, 4: { Fname: __ccgo_ts + 376, Fcode: uint8('\x04'), }, 5: { Fname: __ccgo_ts + 380, Fcode: uint8('\x05'), }, 6: { Fname: __ccgo_ts + 384, Fcode: uint8('\x06'), }, 7: { Fname: __ccgo_ts + 388, Fcode: uint8('\x07'), }, 8: { Fname: __ccgo_ts + 392, Fcode: uint8('\x07'), }, 9: { Fname: __ccgo_ts + 398, Fcode: uint8('\x08'), }, 10: { Fname: __ccgo_ts + 401, Fcode: uint8('\x08'), }, 11: { Fname: __ccgo_ts + 411, Fcode: uint8('\x09'), }, 12: { Fname: __ccgo_ts + 414, Fcode: uint8('\x09'), }, 13: { Fname: __ccgo_ts + 418, Fcode: uint8('\x0A'), }, 14: { Fname: __ccgo_ts + 421, Fcode: uint8('\x0A'), }, 15: { Fname: __ccgo_ts + 429, Fcode: uint8('\x0B'), }, 16: { Fname: __ccgo_ts + 432, Fcode: uint8('\x0B'), }, 17: { Fname: __ccgo_ts + 445, Fcode: uint8('\x0C'), }, 18: { Fname: __ccgo_ts + 448, Fcode: uint8('\x0C'), }, 19: { Fname: __ccgo_ts + 458, Fcode: uint8('\x0D'), }, 20: { Fname: __ccgo_ts + 461, Fcode: uint8('\x0D'), }, 21: { Fname: __ccgo_ts + 477, Fcode: uint8('\x0E'), }, 22: { Fname: __ccgo_ts + 480, Fcode: uint8('\x0F'), }, 23: { Fname: __ccgo_ts + 483, Fcode: uint8('\x10'), }, 24: { Fname: __ccgo_ts + 487, Fcode: uint8('\x11'), }, 25: { Fname: __ccgo_ts + 491, Fcode: uint8('\x12'), }, 26: { Fname: __ccgo_ts + 495, Fcode: uint8('\x13'), }, 27: { Fname: __ccgo_ts + 499, Fcode: uint8('\x14'), }, 28: { Fname: __ccgo_ts + 503, Fcode: uint8('\x15'), }, 29: { Fname: __ccgo_ts + 507, Fcode: uint8('\x16'), }, 30: { Fname: __ccgo_ts + 511, Fcode: uint8('\x17'), }, 31: { Fname: __ccgo_ts + 515, Fcode: uint8('\x18'), }, 32: { Fname: __ccgo_ts + 519, Fcode: uint8('\x19'), }, 33: { Fname: __ccgo_ts + 522, Fcode: uint8('\x1A'), }, 34: { Fname: __ccgo_ts + 526, Fcode: uint8('\x1B'), }, 35: { Fname: __ccgo_ts + 530, Fcode: uint8('\x1C'), }, 36: { Fname: __ccgo_ts + 534, Fcode: uint8('\x1C'), }, 37: { Fname: __ccgo_ts + 537, Fcode: uint8('\x1D'), }, 38: { Fname: __ccgo_ts + 541, Fcode: uint8('\x1D'), }, 39: { Fname: __ccgo_ts + 544, Fcode: uint8('\x1E'), }, 40: { Fname: __ccgo_ts + 548, Fcode: uint8('\x1E'), }, 41: { Fname: __ccgo_ts + 551, Fcode: uint8('\x1F'), }, 42: { Fname: __ccgo_ts + 555, Fcode: uint8('\x1F'), }, 43: { Fname: __ccgo_ts + 558, Fcode: uint8(' '), }, 44: { Fname: __ccgo_ts + 564, Fcode: uint8('!'), }, 45: { Fname: __ccgo_ts + 581, Fcode: uint8('"'), }, 46: { Fname: __ccgo_ts + 596, Fcode: uint8('#'), }, 47: { Fname: __ccgo_ts + 608, Fcode: uint8('$'), }, 48: { Fname: __ccgo_ts + 620, Fcode: uint8('%'), }, 49: { Fname: __ccgo_ts + 633, Fcode: uint8('&'), }, 50: { Fname: __ccgo_ts + 643, Fcode: uint8('\''), }, 51: { Fname: __ccgo_ts + 654, Fcode: uint8('('), }, 52: { Fname: __ccgo_ts + 671, Fcode: uint8(')'), }, 53: { Fname: __ccgo_ts + 689, Fcode: uint8('*'), }, 54: { Fname: __ccgo_ts + 698, Fcode: uint8('+'), }, 55: { Fname: __ccgo_ts + 708, Fcode: uint8(','), }, 56: { Fname: __ccgo_ts + 714, Fcode: uint8('-'), }, 57: { Fname: __ccgo_ts + 721, Fcode: uint8('-'), }, 58: { Fname: __ccgo_ts + 734, Fcode: uint8('.'), }, 59: { Fname: __ccgo_ts + 741, Fcode: uint8('.'), }, 60: { Fname: __ccgo_ts + 751, Fcode: uint8('/'), }, 61: { Fname: __ccgo_ts + 757, Fcode: uint8('/'), }, 62: { Fname: __ccgo_ts + 765, Fcode: uint8('0'), }, 63: { Fname: __ccgo_ts + 770, Fcode: uint8('1'), }, 64: { Fname: __ccgo_ts + 774, Fcode: uint8('2'), }, 65: { Fname: __ccgo_ts + 778, Fcode: uint8('3'), }, 66: { Fname: __ccgo_ts + 784, Fcode: uint8('4'), }, 67: { Fname: __ccgo_ts + 789, Fcode: uint8('5'), }, 68: { Fname: __ccgo_ts + 794, Fcode: uint8('6'), }, 69: { Fname: __ccgo_ts + 798, Fcode: uint8('7'), }, 70: { Fname: __ccgo_ts + 804, Fcode: uint8('8'), }, 71: { Fname: __ccgo_ts + 810, Fcode: uint8('9'), }, 72: { Fname: __ccgo_ts + 815, Fcode: uint8(':'), }, 73: { Fname: __ccgo_ts + 821, Fcode: uint8(';'), }, 74: { Fname: __ccgo_ts + 831, Fcode: uint8('<'), }, 75: { Fname: __ccgo_ts + 846, Fcode: uint8('='), }, 76: { Fname: __ccgo_ts + 858, Fcode: uint8('>'), }, 77: { Fname: __ccgo_ts + 876, Fcode: uint8('?'), }, 78: { Fname: __ccgo_ts + 890, Fcode: uint8('@'), }, 79: { Fname: __ccgo_ts + 904, Fcode: uint8('['), }, 80: { Fname: __ccgo_ts + 924, Fcode: uint8('\\'), }, 81: { Fname: __ccgo_ts + 934, Fcode: uint8('\\'), }, 82: { Fname: __ccgo_ts + 950, Fcode: uint8(']'), }, 83: { Fname: __ccgo_ts + 971, Fcode: uint8('^'), }, 84: { Fname: __ccgo_ts + 982, Fcode: uint8('^'), }, 85: { Fname: __ccgo_ts + 1000, Fcode: uint8('_'), }, 86: { Fname: __ccgo_ts + 1011, Fcode: uint8('_'), }, 87: { Fname: __ccgo_ts + 1020, Fcode: uint8('`'), }, 88: { Fname: __ccgo_ts + 1033, Fcode: uint8('{'), }, 89: { Fname: __ccgo_ts + 1044, Fcode: uint8('{'), }, 90: { Fname: __ccgo_ts + 1063, Fcode: uint8('|'), }, 91: { Fname: __ccgo_ts + 1077, Fcode: uint8('}'), }, 92: { Fname: __ccgo_ts + 1089, Fcode: uint8('}'), }, 93: { Fname: __ccgo_ts + 1109, Fcode: uint8('~'), }, 94: { Fname: __ccgo_ts + 1115, Fcode: uint8('\x7F'), }, 95: {}, } /* * Unicode character-class tables. */ type Tcrange = struct { Fstart Tchr Fend Tchr } /* * Declarations of Unicode character ranges. This code * is automatically generated by the tools/uniClass.tcl script * and used in generic/regc_locale.c. Do not modify by hand. */ /* * Unicode: alphabetic characters. */ var _alphaRangeTable = [471]Tcrange{ 0: { Fstart: int32(0x41), Fend: int32(0x5A), }, 1: { Fstart: int32(0x61), Fend: int32(0x7A), }, 2: { Fstart: int32(0xC0), Fend: int32(0xD6), }, 3: { Fstart: int32(0xD8), Fend: int32(0xF6), }, 4: { Fstart: int32(0xF8), Fend: int32(0x2C1), }, 5: { Fstart: int32(0x2C6), Fend: int32(0x2D1), }, 6: { Fstart: int32(0x2E0), Fend: int32(0x2E4), }, 7: { Fstart: int32(0x370), Fend: int32(0x374), }, 8: { Fstart: int32(0x37A), Fend: int32(0x37D), }, 9: { Fstart: int32(0x388), Fend: int32(0x38A), }, 10: { Fstart: int32(0x38E), Fend: int32(0x3A1), }, 11: { Fstart: int32(0x3A3), Fend: int32(0x3F5), }, 12: { Fstart: int32(0x3F7), Fend: int32(0x481), }, 13: { Fstart: int32(0x48A), Fend: int32(0x52F), }, 14: { Fstart: int32(0x531), Fend: int32(0x556), }, 15: { Fstart: int32(0x560), Fend: int32(0x588), }, 16: { Fstart: int32(0x5D0), Fend: int32(0x5EA), }, 17: { Fstart: int32(0x5EF), Fend: int32(0x5F2), }, 18: { Fstart: int32(0x620), Fend: int32(0x64A), }, 19: { Fstart: int32(0x671), Fend: int32(0x6D3), }, 20: { Fstart: int32(0x6FA), Fend: int32(0x6FC), }, 21: { Fstart: int32(0x712), Fend: int32(0x72F), }, 22: { Fstart: int32(0x74D), Fend: int32(0x7A5), }, 23: { Fstart: int32(0x7CA), Fend: int32(0x7EA), }, 24: { Fstart: int32(0x800), Fend: int32(0x815), }, 25: { Fstart: int32(0x840), Fend: int32(0x858), }, 26: { Fstart: int32(0x860), Fend: int32(0x86A), }, 27: { Fstart: int32(0x870), Fend: int32(0x887), }, 28: { Fstart: int32(0x889), Fend: int32(0x88E), }, 29: { Fstart: int32(0x8A0), Fend: int32(0x8C9), }, 30: { Fstart: int32(0x904), Fend: int32(0x939), }, 31: { Fstart: int32(0x958), Fend: int32(0x961), }, 32: { Fstart: int32(0x971), Fend: int32(0x980), }, 33: { Fstart: int32(0x985), Fend: int32(0x98C), }, 34: { Fstart: int32(0x993), Fend: int32(0x9A8), }, 35: { Fstart: int32(0x9AA), Fend: int32(0x9B0), }, 36: { Fstart: int32(0x9B6), Fend: int32(0x9B9), }, 37: { Fstart: int32(0x9DF), Fend: int32(0x9E1), }, 38: { Fstart: int32(0xA05), Fend: int32(0xA0A), }, 39: { Fstart: int32(0xA13), Fend: int32(0xA28), }, 40: { Fstart: int32(0xA2A), Fend: int32(0xA30), }, 41: { Fstart: int32(0xA59), Fend: int32(0xA5C), }, 42: { Fstart: int32(0xA72), Fend: int32(0xA74), }, 43: { Fstart: int32(0xA85), Fend: int32(0xA8D), }, 44: { Fstart: int32(0xA8F), Fend: int32(0xA91), }, 45: { Fstart: int32(0xA93), Fend: int32(0xAA8), }, 46: { Fstart: int32(0xAAA), Fend: int32(0xAB0), }, 47: { Fstart: int32(0xAB5), Fend: int32(0xAB9), }, 48: { Fstart: int32(0xB05), Fend: int32(0xB0C), }, 49: { Fstart: int32(0xB13), Fend: int32(0xB28), }, 50: { Fstart: int32(0xB2A), Fend: int32(0xB30), }, 51: { Fstart: int32(0xB35), Fend: int32(0xB39), }, 52: { Fstart: int32(0xB5F), Fend: int32(0xB61), }, 53: { Fstart: int32(0xB85), Fend: int32(0xB8A), }, 54: { Fstart: int32(0xB8E), Fend: int32(0xB90), }, 55: { Fstart: int32(0xB92), Fend: int32(0xB95), }, 56: { Fstart: int32(0xBA8), Fend: int32(0xBAA), }, 57: { Fstart: int32(0xBAE), Fend: int32(0xBB9), }, 58: { Fstart: int32(0xC05), Fend: int32(0xC0C), }, 59: { Fstart: int32(0xC0E), Fend: int32(0xC10), }, 60: { Fstart: int32(0xC12), Fend: int32(0xC28), }, 61: { Fstart: int32(0xC2A), Fend: int32(0xC39), }, 62: { Fstart: int32(0xC58), Fend: int32(0xC5A), }, 63: { Fstart: int32(0xC85), Fend: int32(0xC8C), }, 64: { Fstart: int32(0xC8E), Fend: int32(0xC90), }, 65: { Fstart: int32(0xC92), Fend: int32(0xCA8), }, 66: { Fstart: int32(0xCAA), Fend: int32(0xCB3), }, 67: { Fstart: int32(0xCB5), Fend: int32(0xCB9), }, 68: { Fstart: int32(0xD04), Fend: int32(0xD0C), }, 69: { Fstart: int32(0xD0E), Fend: int32(0xD10), }, 70: { Fstart: int32(0xD12), Fend: int32(0xD3A), }, 71: { Fstart: int32(0xD54), Fend: int32(0xD56), }, 72: { Fstart: int32(0xD5F), Fend: int32(0xD61), }, 73: { Fstart: int32(0xD7A), Fend: int32(0xD7F), }, 74: { Fstart: int32(0xD85), Fend: int32(0xD96), }, 75: { Fstart: int32(0xD9A), Fend: int32(0xDB1), }, 76: { Fstart: int32(0xDB3), Fend: int32(0xDBB), }, 77: { Fstart: int32(0xDC0), Fend: int32(0xDC6), }, 78: { Fstart: int32(0xE01), Fend: int32(0xE30), }, 79: { Fstart: int32(0xE40), Fend: int32(0xE46), }, 80: { Fstart: int32(0xE86), Fend: int32(0xE8A), }, 81: { Fstart: int32(0xE8C), Fend: int32(0xEA3), }, 82: { Fstart: int32(0xEA7), Fend: int32(0xEB0), }, 83: { Fstart: int32(0xEC0), Fend: int32(0xEC4), }, 84: { Fstart: int32(0xEDC), Fend: int32(0xEDF), }, 85: { Fstart: int32(0xF40), Fend: int32(0xF47), }, 86: { Fstart: int32(0xF49), Fend: int32(0xF6C), }, 87: { Fstart: int32(0xF88), Fend: int32(0xF8C), }, 88: { Fstart: int32(0x1000), Fend: int32(0x102A), }, 89: { Fstart: int32(0x1050), Fend: int32(0x1055), }, 90: { Fstart: int32(0x105A), Fend: int32(0x105D), }, 91: { Fstart: int32(0x106E), Fend: int32(0x1070), }, 92: { Fstart: int32(0x1075), Fend: int32(0x1081), }, 93: { Fstart: int32(0x10A0), Fend: int32(0x10C5), }, 94: { Fstart: int32(0x10D0), Fend: int32(0x10FA), }, 95: { Fstart: int32(0x10FC), Fend: int32(0x1248), }, 96: { Fstart: int32(0x124A), Fend: int32(0x124D), }, 97: { Fstart: int32(0x1250), Fend: int32(0x1256), }, 98: { Fstart: int32(0x125A), Fend: int32(0x125D), }, 99: { Fstart: int32(0x1260), Fend: int32(0x1288), }, 100: { Fstart: int32(0x128A), Fend: int32(0x128D), }, 101: { Fstart: int32(0x1290), Fend: int32(0x12B0), }, 102: { Fstart: int32(0x12B2), Fend: int32(0x12B5), }, 103: { Fstart: int32(0x12B8), Fend: int32(0x12BE), }, 104: { Fstart: int32(0x12C2), Fend: int32(0x12C5), }, 105: { Fstart: int32(0x12C8), Fend: int32(0x12D6), }, 106: { Fstart: int32(0x12D8), Fend: int32(0x1310), }, 107: { Fstart: int32(0x1312), Fend: int32(0x1315), }, 108: { Fstart: int32(0x1318), Fend: int32(0x135A), }, 109: { Fstart: int32(0x1380), Fend: int32(0x138F), }, 110: { Fstart: int32(0x13A0), Fend: int32(0x13F5), }, 111: { Fstart: int32(0x13F8), Fend: int32(0x13FD), }, 112: { Fstart: int32(0x1401), Fend: int32(0x166C), }, 113: { Fstart: int32(0x166F), Fend: int32(0x167F), }, 114: { Fstart: int32(0x1681), Fend: int32(0x169A), }, 115: { Fstart: int32(0x16A0), Fend: int32(0x16EA), }, 116: { Fstart: int32(0x16F1), Fend: int32(0x16F8), }, 117: { Fstart: int32(0x1700), Fend: int32(0x1711), }, 118: { Fstart: int32(0x171F), Fend: int32(0x1731), }, 119: { Fstart: int32(0x1740), Fend: int32(0x1751), }, 120: { Fstart: int32(0x1760), Fend: int32(0x176C), }, 121: { Fstart: int32(0x176E), Fend: int32(0x1770), }, 122: { Fstart: int32(0x1780), Fend: int32(0x17B3), }, 123: { Fstart: int32(0x1820), Fend: int32(0x1878), }, 124: { Fstart: int32(0x1880), Fend: int32(0x1884), }, 125: { Fstart: int32(0x1887), Fend: int32(0x18A8), }, 126: { Fstart: int32(0x18B0), Fend: int32(0x18F5), }, 127: { Fstart: int32(0x1900), Fend: int32(0x191E), }, 128: { Fstart: int32(0x1950), Fend: int32(0x196D), }, 129: { Fstart: int32(0x1970), Fend: int32(0x1974), }, 130: { Fstart: int32(0x1980), Fend: int32(0x19AB), }, 131: { Fstart: int32(0x19B0), Fend: int32(0x19C9), }, 132: { Fstart: int32(0x1A00), Fend: int32(0x1A16), }, 133: { Fstart: int32(0x1A20), Fend: int32(0x1A54), }, 134: { Fstart: int32(0x1B05), Fend: int32(0x1B33), }, 135: { Fstart: int32(0x1B45), Fend: int32(0x1B4C), }, 136: { Fstart: int32(0x1B83), Fend: int32(0x1BA0), }, 137: { Fstart: int32(0x1BBA), Fend: int32(0x1BE5), }, 138: { Fstart: int32(0x1C00), Fend: int32(0x1C23), }, 139: { Fstart: int32(0x1C4D), Fend: int32(0x1C4F), }, 140: { Fstart: int32(0x1C5A), Fend: int32(0x1C7D), }, 141: { Fstart: int32(0x1C80), Fend: int32(0x1C8A), }, 142: { Fstart: int32(0x1C90), Fend: int32(0x1CBA), }, 143: { Fstart: int32(0x1CBD), Fend: int32(0x1CBF), }, 144: { Fstart: int32(0x1CE9), Fend: int32(0x1CEC), }, 145: { Fstart: int32(0x1CEE), Fend: int32(0x1CF3), }, 146: { Fstart: int32(0x1D00), Fend: int32(0x1DBF), }, 147: { Fstart: int32(0x1E00), Fend: int32(0x1F15), }, 148: { Fstart: int32(0x1F18), Fend: int32(0x1F1D), }, 149: { Fstart: int32(0x1F20), Fend: int32(0x1F45), }, 150: { Fstart: int32(0x1F48), Fend: int32(0x1F4D), }, 151: { Fstart: int32(0x1F50), Fend: int32(0x1F57), }, 152: { Fstart: int32(0x1F5F), Fend: int32(0x1F7D), }, 153: { Fstart: int32(0x1F80), Fend: int32(0x1FB4), }, 154: { Fstart: int32(0x1FB6), Fend: int32(0x1FBC), }, 155: { Fstart: int32(0x1FC2), Fend: int32(0x1FC4), }, 156: { Fstart: int32(0x1FC6), Fend: int32(0x1FCC), }, 157: { Fstart: int32(0x1FD0), Fend: int32(0x1FD3), }, 158: { Fstart: int32(0x1FD6), Fend: int32(0x1FDB), }, 159: { Fstart: int32(0x1FE0), Fend: int32(0x1FEC), }, 160: { Fstart: int32(0x1FF2), Fend: int32(0x1FF4), }, 161: { Fstart: int32(0x1FF6), Fend: int32(0x1FFC), }, 162: { Fstart: int32(0x2090), Fend: int32(0x209C), }, 163: { Fstart: int32(0x210A), Fend: int32(0x2113), }, 164: { Fstart: int32(0x2119), Fend: int32(0x211D), }, 165: { Fstart: int32(0x212A), Fend: int32(0x212D), }, 166: { Fstart: int32(0x212F), Fend: int32(0x2139), }, 167: { Fstart: int32(0x213C), Fend: int32(0x213F), }, 168: { Fstart: int32(0x2145), Fend: int32(0x2149), }, 169: { Fstart: int32(0x2C00), Fend: int32(0x2CE4), }, 170: { Fstart: int32(0x2CEB), Fend: int32(0x2CEE), }, 171: { Fstart: int32(0x2D00), Fend: int32(0x2D25), }, 172: { Fstart: int32(0x2D30), Fend: int32(0x2D67), }, 173: { Fstart: int32(0x2D80), Fend: int32(0x2D96), }, 174: { Fstart: int32(0x2DA0), Fend: int32(0x2DA6), }, 175: { Fstart: int32(0x2DA8), Fend: int32(0x2DAE), }, 176: { Fstart: int32(0x2DB0), Fend: int32(0x2DB6), }, 177: { Fstart: int32(0x2DB8), Fend: int32(0x2DBE), }, 178: { Fstart: int32(0x2DC0), Fend: int32(0x2DC6), }, 179: { Fstart: int32(0x2DC8), Fend: int32(0x2DCE), }, 180: { Fstart: int32(0x2DD0), Fend: int32(0x2DD6), }, 181: { Fstart: int32(0x2DD8), Fend: int32(0x2DDE), }, 182: { Fstart: int32(0x3031), Fend: int32(0x3035), }, 183: { Fstart: int32(0x3041), Fend: int32(0x3096), }, 184: { Fstart: int32(0x309D), Fend: int32(0x309F), }, 185: { Fstart: int32(0x30A1), Fend: int32(0x30FA), }, 186: { Fstart: int32(0x30FC), Fend: int32(0x30FF), }, 187: { Fstart: int32(0x3105), Fend: int32(0x312F), }, 188: { Fstart: int32(0x3131), Fend: int32(0x318E), }, 189: { Fstart: int32(0x31A0), Fend: int32(0x31BF), }, 190: { Fstart: int32(0x31F0), Fend: int32(0x31FF), }, 191: { Fstart: int32(0x3400), Fend: int32(0x4DBF), }, 192: { Fstart: int32(0x4E00), Fend: int32(0xA48C), }, 193: { Fstart: int32(0xA4D0), Fend: int32(0xA4FD), }, 194: { Fstart: int32(0xA500), Fend: int32(0xA60C), }, 195: { Fstart: int32(0xA610), Fend: int32(0xA61F), }, 196: { Fstart: int32(0xA640), Fend: int32(0xA66E), }, 197: { Fstart: int32(0xA67F), Fend: int32(0xA69D), }, 198: { Fstart: int32(0xA6A0), Fend: int32(0xA6E5), }, 199: { Fstart: int32(0xA717), Fend: int32(0xA71F), }, 200: { Fstart: int32(0xA722), Fend: int32(0xA788), }, 201: { Fstart: int32(0xA78B), Fend: int32(0xA7CD), }, 202: { Fstart: int32(0xA7D5), Fend: int32(0xA7DC), }, 203: { Fstart: int32(0xA7F2), Fend: int32(0xA801), }, 204: { Fstart: int32(0xA803), Fend: int32(0xA805), }, 205: { Fstart: int32(0xA807), Fend: int32(0xA80A), }, 206: { Fstart: int32(0xA80C), Fend: int32(0xA822), }, 207: { Fstart: int32(0xA840), Fend: int32(0xA873), }, 208: { Fstart: int32(0xA882), Fend: int32(0xA8B3), }, 209: { Fstart: int32(0xA8F2), Fend: int32(0xA8F7), }, 210: { Fstart: int32(0xA90A), Fend: int32(0xA925), }, 211: { Fstart: int32(0xA930), Fend: int32(0xA946), }, 212: { Fstart: int32(0xA960), Fend: int32(0xA97C), }, 213: { Fstart: int32(0xA984), Fend: int32(0xA9B2), }, 214: { Fstart: int32(0xA9E0), Fend: int32(0xA9E4), }, 215: { Fstart: int32(0xA9E6), Fend: int32(0xA9EF), }, 216: { Fstart: int32(0xA9FA), Fend: int32(0xA9FE), }, 217: { Fstart: int32(0xAA00), Fend: int32(0xAA28), }, 218: { Fstart: int32(0xAA40), Fend: int32(0xAA42), }, 219: { Fstart: int32(0xAA44), Fend: int32(0xAA4B), }, 220: { Fstart: int32(0xAA60), Fend: int32(0xAA76), }, 221: { Fstart: int32(0xAA7E), Fend: int32(0xAAAF), }, 222: { Fstart: int32(0xAAB9), Fend: int32(0xAABD), }, 223: { Fstart: int32(0xAADB), Fend: int32(0xAADD), }, 224: { Fstart: int32(0xAAE0), Fend: int32(0xAAEA), }, 225: { Fstart: int32(0xAAF2), Fend: int32(0xAAF4), }, 226: { Fstart: int32(0xAB01), Fend: int32(0xAB06), }, 227: { Fstart: int32(0xAB09), Fend: int32(0xAB0E), }, 228: { Fstart: int32(0xAB11), Fend: int32(0xAB16), }, 229: { Fstart: int32(0xAB20), Fend: int32(0xAB26), }, 230: { Fstart: int32(0xAB28), Fend: int32(0xAB2E), }, 231: { Fstart: int32(0xAB30), Fend: int32(0xAB5A), }, 232: { Fstart: int32(0xAB5C), Fend: int32(0xAB69), }, 233: { Fstart: int32(0xAB70), Fend: int32(0xABE2), }, 234: { Fstart: int32(0xAC00), Fend: int32(0xD7A3), }, 235: { Fstart: int32(0xD7B0), Fend: int32(0xD7C6), }, 236: { Fstart: int32(0xD7CB), Fend: int32(0xD7FB), }, 237: { Fstart: int32(0xF900), Fend: int32(0xFA6D), }, 238: { Fstart: int32(0xFA70), Fend: int32(0xFAD9), }, 239: { Fstart: int32(0xFB00), Fend: int32(0xFB06), }, 240: { Fstart: int32(0xFB13), Fend: int32(0xFB17), }, 241: { Fstart: int32(0xFB1F), Fend: int32(0xFB28), }, 242: { Fstart: int32(0xFB2A), Fend: int32(0xFB36), }, 243: { Fstart: int32(0xFB38), Fend: int32(0xFB3C), }, 244: { Fstart: int32(0xFB46), Fend: int32(0xFBB1), }, 245: { Fstart: int32(0xFBD3), Fend: int32(0xFD3D), }, 246: { Fstart: int32(0xFD50), Fend: int32(0xFD8F), }, 247: { Fstart: int32(0xFD92), Fend: int32(0xFDC7), }, 248: { Fstart: int32(0xFDF0), Fend: int32(0xFDFB), }, 249: { Fstart: int32(0xFE70), Fend: int32(0xFE74), }, 250: { Fstart: int32(0xFE76), Fend: int32(0xFEFC), }, 251: { Fstart: int32(0xFF21), Fend: int32(0xFF3A), }, 252: { Fstart: int32(0xFF41), Fend: int32(0xFF5A), }, 253: { Fstart: int32(0xFF66), Fend: int32(0xFFBE), }, 254: { Fstart: int32(0xFFC2), Fend: int32(0xFFC7), }, 255: { Fstart: int32(0xFFCA), Fend: int32(0xFFCF), }, 256: { Fstart: int32(0xFFD2), Fend: int32(0xFFD7), }, 257: { Fstart: int32(0xFFDA), Fend: int32(0xFFDC), }, 258: { Fstart: int32(0x10000), Fend: int32(0x1000B), }, 259: { Fstart: int32(0x1000D), Fend: int32(0x10026), }, 260: { Fstart: int32(0x10028), Fend: int32(0x1003A), }, 261: { Fstart: int32(0x1003F), Fend: int32(0x1004D), }, 262: { Fstart: int32(0x10050), Fend: int32(0x1005D), }, 263: { Fstart: int32(0x10080), Fend: int32(0x100FA), }, 264: { Fstart: int32(0x10280), Fend: int32(0x1029C), }, 265: { Fstart: int32(0x102A0), Fend: int32(0x102D0), }, 266: { Fstart: int32(0x10300), Fend: int32(0x1031F), }, 267: { Fstart: int32(0x1032D), Fend: int32(0x10340), }, 268: { Fstart: int32(0x10342), Fend: int32(0x10349), }, 269: { Fstart: int32(0x10350), Fend: int32(0x10375), }, 270: { Fstart: int32(0x10380), Fend: int32(0x1039D), }, 271: { Fstart: int32(0x103A0), Fend: int32(0x103C3), }, 272: { Fstart: int32(0x103C8), Fend: int32(0x103CF), }, 273: { Fstart: int32(0x10400), Fend: int32(0x1049D), }, 274: { Fstart: int32(0x104B0), Fend: int32(0x104D3), }, 275: { Fstart: int32(0x104D8), Fend: int32(0x104FB), }, 276: { Fstart: int32(0x10500), Fend: int32(0x10527), }, 277: { Fstart: int32(0x10530), Fend: int32(0x10563), }, 278: { Fstart: int32(0x10570), Fend: int32(0x1057A), }, 279: { Fstart: int32(0x1057C), Fend: int32(0x1058A), }, 280: { Fstart: int32(0x1058C), Fend: int32(0x10592), }, 281: { Fstart: int32(0x10597), Fend: int32(0x105A1), }, 282: { Fstart: int32(0x105A3), Fend: int32(0x105B1), }, 283: { Fstart: int32(0x105B3), Fend: int32(0x105B9), }, 284: { Fstart: int32(0x105C0), Fend: int32(0x105F3), }, 285: { Fstart: int32(0x10600), Fend: int32(0x10736), }, 286: { Fstart: int32(0x10740), Fend: int32(0x10755), }, 287: { Fstart: int32(0x10760), Fend: int32(0x10767), }, 288: { Fstart: int32(0x10780), Fend: int32(0x10785), }, 289: { Fstart: int32(0x10787), Fend: int32(0x107B0), }, 290: { Fstart: int32(0x107B2), Fend: int32(0x107BA), }, 291: { Fstart: int32(0x10800), Fend: int32(0x10805), }, 292: { Fstart: int32(0x1080A), Fend: int32(0x10835), }, 293: { Fstart: int32(0x1083F), Fend: int32(0x10855), }, 294: { Fstart: int32(0x10860), Fend: int32(0x10876), }, 295: { Fstart: int32(0x10880), Fend: int32(0x1089E), }, 296: { Fstart: int32(0x108E0), Fend: int32(0x108F2), }, 297: { Fstart: int32(0x10900), Fend: int32(0x10915), }, 298: { Fstart: int32(0x10920), Fend: int32(0x10939), }, 299: { Fstart: int32(0x10980), Fend: int32(0x109B7), }, 300: { Fstart: int32(0x10A10), Fend: int32(0x10A13), }, 301: { Fstart: int32(0x10A15), Fend: int32(0x10A17), }, 302: { Fstart: int32(0x10A19), Fend: int32(0x10A35), }, 303: { Fstart: int32(0x10A60), Fend: int32(0x10A7C), }, 304: { Fstart: int32(0x10A80), Fend: int32(0x10A9C), }, 305: { Fstart: int32(0x10AC0), Fend: int32(0x10AC7), }, 306: { Fstart: int32(0x10AC9), Fend: int32(0x10AE4), }, 307: { Fstart: int32(0x10B00), Fend: int32(0x10B35), }, 308: { Fstart: int32(0x10B40), Fend: int32(0x10B55), }, 309: { Fstart: int32(0x10B60), Fend: int32(0x10B72), }, 310: { Fstart: int32(0x10B80), Fend: int32(0x10B91), }, 311: { Fstart: int32(0x10C00), Fend: int32(0x10C48), }, 312: { Fstart: int32(0x10C80), Fend: int32(0x10CB2), }, 313: { Fstart: int32(0x10CC0), Fend: int32(0x10CF2), }, 314: { Fstart: int32(0x10D00), Fend: int32(0x10D23), }, 315: { Fstart: int32(0x10D4A), Fend: int32(0x10D65), }, 316: { Fstart: int32(0x10D6F), Fend: int32(0x10D85), }, 317: { Fstart: int32(0x10E80), Fend: int32(0x10EA9), }, 318: { Fstart: int32(0x10EC2), Fend: int32(0x10EC4), }, 319: { Fstart: int32(0x10F00), Fend: int32(0x10F1C), }, 320: { Fstart: int32(0x10F30), Fend: int32(0x10F45), }, 321: { Fstart: int32(0x10F70), Fend: int32(0x10F81), }, 322: { Fstart: int32(0x10FB0), Fend: int32(0x10FC4), }, 323: { Fstart: int32(0x10FE0), Fend: int32(0x10FF6), }, 324: { Fstart: int32(0x11003), Fend: int32(0x11037), }, 325: { Fstart: int32(0x11083), Fend: int32(0x110AF), }, 326: { Fstart: int32(0x110D0), Fend: int32(0x110E8), }, 327: { Fstart: int32(0x11103), Fend: int32(0x11126), }, 328: { Fstart: int32(0x11150), Fend: int32(0x11172), }, 329: { Fstart: int32(0x11183), Fend: int32(0x111B2), }, 330: { Fstart: int32(0x111C1), Fend: int32(0x111C4), }, 331: { Fstart: int32(0x11200), Fend: int32(0x11211), }, 332: { Fstart: int32(0x11213), Fend: int32(0x1122B), }, 333: { Fstart: int32(0x11280), Fend: int32(0x11286), }, 334: { Fstart: int32(0x1128A), Fend: int32(0x1128D), }, 335: { Fstart: int32(0x1128F), Fend: int32(0x1129D), }, 336: { Fstart: int32(0x1129F), Fend: int32(0x112A8), }, 337: { Fstart: int32(0x112B0), Fend: int32(0x112DE), }, 338: { Fstart: int32(0x11305), Fend: int32(0x1130C), }, 339: { Fstart: int32(0x11313), Fend: int32(0x11328), }, 340: { Fstart: int32(0x1132A), Fend: int32(0x11330), }, 341: { Fstart: int32(0x11335), Fend: int32(0x11339), }, 342: { Fstart: int32(0x1135D), Fend: int32(0x11361), }, 343: { Fstart: int32(0x11380), Fend: int32(0x11389), }, 344: { Fstart: int32(0x11390), Fend: int32(0x113B5), }, 345: { Fstart: int32(0x11400), Fend: int32(0x11434), }, 346: { Fstart: int32(0x11447), Fend: int32(0x1144A), }, 347: { Fstart: int32(0x1145F), Fend: int32(0x11461), }, 348: { Fstart: int32(0x11480), Fend: int32(0x114AF), }, 349: { Fstart: int32(0x11580), Fend: int32(0x115AE), }, 350: { Fstart: int32(0x115D8), Fend: int32(0x115DB), }, 351: { Fstart: int32(0x11600), Fend: int32(0x1162F), }, 352: { Fstart: int32(0x11680), Fend: int32(0x116AA), }, 353: { Fstart: int32(0x11700), Fend: int32(0x1171A), }, 354: { Fstart: int32(0x11740), Fend: int32(0x11746), }, 355: { Fstart: int32(0x11800), Fend: int32(0x1182B), }, 356: { Fstart: int32(0x118A0), Fend: int32(0x118DF), }, 357: { Fstart: int32(0x118FF), Fend: int32(0x11906), }, 358: { Fstart: int32(0x1190C), Fend: int32(0x11913), }, 359: { Fstart: int32(0x11918), Fend: int32(0x1192F), }, 360: { Fstart: int32(0x119A0), Fend: int32(0x119A7), }, 361: { Fstart: int32(0x119AA), Fend: int32(0x119D0), }, 362: { Fstart: int32(0x11A0B), Fend: int32(0x11A32), }, 363: { Fstart: int32(0x11A5C), Fend: int32(0x11A89), }, 364: { Fstart: int32(0x11AB0), Fend: int32(0x11AF8), }, 365: { Fstart: int32(0x11BC0), Fend: int32(0x11BE0), }, 366: { Fstart: int32(0x11C00), Fend: int32(0x11C08), }, 367: { Fstart: int32(0x11C0A), Fend: int32(0x11C2E), }, 368: { Fstart: int32(0x11C72), Fend: int32(0x11C8F), }, 369: { Fstart: int32(0x11D00), Fend: int32(0x11D06), }, 370: { Fstart: int32(0x11D0B), Fend: int32(0x11D30), }, 371: { Fstart: int32(0x11D60), Fend: int32(0x11D65), }, 372: { Fstart: int32(0x11D6A), Fend: int32(0x11D89), }, 373: { Fstart: int32(0x11EE0), Fend: int32(0x11EF2), }, 374: { Fstart: int32(0x11F04), Fend: int32(0x11F10), }, 375: { Fstart: int32(0x11F12), Fend: int32(0x11F33), }, 376: { Fstart: int32(0x12000), Fend: int32(0x12399), }, 377: { Fstart: int32(0x12480), Fend: int32(0x12543), }, 378: { Fstart: int32(0x12F90), Fend: int32(0x12FF0), }, 379: { Fstart: int32(0x13000), Fend: int32(0x1342F), }, 380: { Fstart: int32(0x13441), Fend: int32(0x13446), }, 381: { Fstart: int32(0x13460), Fend: int32(0x143FA), }, 382: { Fstart: int32(0x14400), Fend: int32(0x14646), }, 383: { Fstart: int32(0x16100), Fend: int32(0x1611D), }, 384: { Fstart: int32(0x16800), Fend: int32(0x16A38), }, 385: { Fstart: int32(0x16A40), Fend: int32(0x16A5E), }, 386: { Fstart: int32(0x16A70), Fend: int32(0x16ABE), }, 387: { Fstart: int32(0x16AD0), Fend: int32(0x16AED), }, 388: { Fstart: int32(0x16B00), Fend: int32(0x16B2F), }, 389: { Fstart: int32(0x16B40), Fend: int32(0x16B43), }, 390: { Fstart: int32(0x16B63), Fend: int32(0x16B77), }, 391: { Fstart: int32(0x16B7D), Fend: int32(0x16B8F), }, 392: { Fstart: int32(0x16D40), Fend: int32(0x16D6C), }, 393: { Fstart: int32(0x16E40), Fend: int32(0x16E7F), }, 394: { Fstart: int32(0x16F00), Fend: int32(0x16F4A), }, 395: { Fstart: int32(0x16F93), Fend: int32(0x16F9F), }, 396: { Fstart: int32(0x17000), Fend: int32(0x187F7), }, 397: { Fstart: int32(0x18800), Fend: int32(0x18CD5), }, 398: { Fstart: int32(0x18CFF), Fend: int32(0x18D08), }, 399: { Fstart: int32(0x1AFF0), Fend: int32(0x1AFF3), }, 400: { Fstart: int32(0x1AFF5), Fend: int32(0x1AFFB), }, 401: { Fstart: int32(0x1B000), Fend: int32(0x1B122), }, 402: { Fstart: int32(0x1B150), Fend: int32(0x1B152), }, 403: { Fstart: int32(0x1B164), Fend: int32(0x1B167), }, 404: { Fstart: int32(0x1B170), Fend: int32(0x1B2FB), }, 405: { Fstart: int32(0x1BC00), Fend: int32(0x1BC6A), }, 406: { Fstart: int32(0x1BC70), Fend: int32(0x1BC7C), }, 407: { Fstart: int32(0x1BC80), Fend: int32(0x1BC88), }, 408: { Fstart: int32(0x1BC90), Fend: int32(0x1BC99), }, 409: { Fstart: int32(0x1D400), Fend: int32(0x1D454), }, 410: { Fstart: int32(0x1D456), Fend: int32(0x1D49C), }, 411: { Fstart: int32(0x1D4A9), Fend: int32(0x1D4AC), }, 412: { Fstart: int32(0x1D4AE), Fend: int32(0x1D4B9), }, 413: { Fstart: int32(0x1D4BD), Fend: int32(0x1D4C3), }, 414: { Fstart: int32(0x1D4C5), Fend: int32(0x1D505), }, 415: { Fstart: int32(0x1D507), Fend: int32(0x1D50A), }, 416: { Fstart: int32(0x1D50D), Fend: int32(0x1D514), }, 417: { Fstart: int32(0x1D516), Fend: int32(0x1D51C), }, 418: { Fstart: int32(0x1D51E), Fend: int32(0x1D539), }, 419: { Fstart: int32(0x1D53B), Fend: int32(0x1D53E), }, 420: { Fstart: int32(0x1D540), Fend: int32(0x1D544), }, 421: { Fstart: int32(0x1D54A), Fend: int32(0x1D550), }, 422: { Fstart: int32(0x1D552), Fend: int32(0x1D6A5), }, 423: { Fstart: int32(0x1D6A8), Fend: int32(0x1D6C0), }, 424: { Fstart: int32(0x1D6C2), Fend: int32(0x1D6DA), }, 425: { Fstart: int32(0x1D6DC), Fend: int32(0x1D6FA), }, 426: { Fstart: int32(0x1D6FC), Fend: int32(0x1D714), }, 427: { Fstart: int32(0x1D716), Fend: int32(0x1D734), }, 428: { Fstart: int32(0x1D736), Fend: int32(0x1D74E), }, 429: { Fstart: int32(0x1D750), Fend: int32(0x1D76E), }, 430: { Fstart: int32(0x1D770), Fend: int32(0x1D788), }, 431: { Fstart: int32(0x1D78A), Fend: int32(0x1D7A8), }, 432: { Fstart: int32(0x1D7AA), Fend: int32(0x1D7C2), }, 433: { Fstart: int32(0x1D7C4), Fend: int32(0x1D7CB), }, 434: { Fstart: int32(0x1DF00), Fend: int32(0x1DF1E), }, 435: { Fstart: int32(0x1DF25), Fend: int32(0x1DF2A), }, 436: { Fstart: int32(0x1E030), Fend: int32(0x1E06D), }, 437: { Fstart: int32(0x1E100), Fend: int32(0x1E12C), }, 438: { Fstart: int32(0x1E137), Fend: int32(0x1E13D), }, 439: { Fstart: int32(0x1E290), Fend: int32(0x1E2AD), }, 440: { Fstart: int32(0x1E2C0), Fend: int32(0x1E2EB), }, 441: { Fstart: int32(0x1E4D0), Fend: int32(0x1E4EB), }, 442: { Fstart: int32(0x1E5D0), Fend: int32(0x1E5ED), }, 443: { Fstart: int32(0x1E7E0), Fend: int32(0x1E7E6), }, 444: { Fstart: int32(0x1E7E8), Fend: int32(0x1E7EB), }, 445: { Fstart: int32(0x1E7F0), Fend: int32(0x1E7FE), }, 446: { Fstart: int32(0x1E800), Fend: int32(0x1E8C4), }, 447: { Fstart: int32(0x1E900), Fend: int32(0x1E943), }, 448: { Fstart: int32(0x1EE00), Fend: int32(0x1EE03), }, 449: { Fstart: int32(0x1EE05), Fend: int32(0x1EE1F), }, 450: { Fstart: int32(0x1EE29), Fend: int32(0x1EE32), }, 451: { Fstart: int32(0x1EE34), Fend: int32(0x1EE37), }, 452: { Fstart: int32(0x1EE4D), Fend: int32(0x1EE4F), }, 453: { Fstart: int32(0x1EE67), Fend: int32(0x1EE6A), }, 454: { Fstart: int32(0x1EE6C), Fend: int32(0x1EE72), }, 455: { Fstart: int32(0x1EE74), Fend: int32(0x1EE77), }, 456: { Fstart: int32(0x1EE79), Fend: int32(0x1EE7C), }, 457: { Fstart: int32(0x1EE80), Fend: int32(0x1EE89), }, 458: { Fstart: int32(0x1EE8B), Fend: int32(0x1EE9B), }, 459: { Fstart: int32(0x1EEA1), Fend: int32(0x1EEA3), }, 460: { Fstart: int32(0x1EEA5), Fend: int32(0x1EEA9), }, 461: { Fstart: int32(0x1EEAB), Fend: int32(0x1EEBB), }, 462: { Fstart: int32(0x20000), Fend: int32(0x2A6DF), }, 463: { Fstart: int32(0x2A700), Fend: int32(0x2B739), }, 464: { Fstart: int32(0x2B740), Fend: int32(0x2B81D), }, 465: { Fstart: int32(0x2B820), Fend: int32(0x2CEA1), }, 466: { Fstart: int32(0x2CEB0), Fend: int32(0x2EBE0), }, 467: { Fstart: int32(0x2EBF0), Fend: int32(0x2EE5D), }, 468: { Fstart: int32(0x2F800), Fend: int32(0x2FA1D), }, 469: { Fstart: int32(0x30000), Fend: int32(0x3134A), }, 470: { Fstart: int32(0x31350), Fend: int32(0x323AF), }, } var _alphaCharTable = [269]Tchr{ 0: int32(0xAA), 1: int32(0xB5), 2: int32(0xBA), 3: int32(0x2EC), 4: int32(0x2EE), 5: int32(0x376), 6: int32(0x377), 7: int32(0x37F), 8: int32(0x386), 9: int32(0x38C), 10: int32(0x559), 11: int32(0x66E), 12: int32(0x66F), 13: int32(0x6D5), 14: int32(0x6E5), 15: int32(0x6E6), 16: int32(0x6EE), 17: int32(0x6EF), 18: int32(0x6FF), 19: int32(0x710), 20: int32(0x7B1), 21: int32(0x7F4), 22: int32(0x7F5), 23: int32(0x7FA), 24: int32(0x81A), 25: int32(0x824), 26: int32(0x828), 27: int32(0x93D), 28: int32(0x950), 29: int32(0x98F), 30: int32(0x990), 31: int32(0x9B2), 32: int32(0x9BD), 33: int32(0x9CE), 34: int32(0x9DC), 35: int32(0x9DD), 36: int32(0x9F0), 37: int32(0x9F1), 38: int32(0x9FC), 39: int32(0xA0F), 40: int32(0xA10), 41: int32(0xA32), 42: int32(0xA33), 43: int32(0xA35), 44: int32(0xA36), 45: int32(0xA38), 46: int32(0xA39), 47: int32(0xA5E), 48: int32(0xAB2), 49: int32(0xAB3), 50: int32(0xABD), 51: int32(0xAD0), 52: int32(0xAE0), 53: int32(0xAE1), 54: int32(0xAF9), 55: int32(0xB0F), 56: int32(0xB10), 57: int32(0xB32), 58: int32(0xB33), 59: int32(0xB3D), 60: int32(0xB5C), 61: int32(0xB5D), 62: int32(0xB71), 63: int32(0xB83), 64: int32(0xB99), 65: int32(0xB9A), 66: int32(0xB9C), 67: int32(0xB9E), 68: int32(0xB9F), 69: int32(0xBA3), 70: int32(0xBA4), 71: int32(0xBD0), 72: int32(0xC3D), 73: int32(0xC5D), 74: int32(0xC60), 75: int32(0xC61), 76: int32(0xC80), 77: int32(0xCBD), 78: int32(0xCDD), 79: int32(0xCDE), 80: int32(0xCE0), 81: int32(0xCE1), 82: int32(0xCF1), 83: int32(0xCF2), 84: int32(0xD3D), 85: int32(0xD4E), 86: int32(0xDBD), 87: int32(0xE32), 88: int32(0xE33), 89: int32(0xE81), 90: int32(0xE82), 91: int32(0xE84), 92: int32(0xEA5), 93: int32(0xEB2), 94: int32(0xEB3), 95: int32(0xEBD), 96: int32(0xEC6), 97: int32(0xF00), 98: int32(0x103F), 99: int32(0x1061), 100: int32(0x1065), 101: int32(0x1066), 102: int32(0x108E), 103: int32(0x10C7), 104: int32(0x10CD), 105: int32(0x1258), 106: int32(0x12C0), 107: int32(0x17D7), 108: int32(0x17DC), 109: int32(0x18AA), 110: int32(0x1AA7), 111: int32(0x1BAE), 112: int32(0x1BAF), 113: int32(0x1CF5), 114: int32(0x1CF6), 115: int32(0x1CFA), 116: int32(0x1F59), 117: int32(0x1F5B), 118: int32(0x1F5D), 119: int32(0x1FBE), 120: int32(0x2071), 121: int32(0x207F), 122: int32(0x2102), 123: int32(0x2107), 124: int32(0x2115), 125: int32(0x2124), 126: int32(0x2126), 127: int32(0x2128), 128: int32(0x214E), 129: int32(0x2183), 130: int32(0x2184), 131: int32(0x2CF2), 132: int32(0x2CF3), 133: int32(0x2D27), 134: int32(0x2D2D), 135: int32(0x2D6F), 136: int32(0x2E2F), 137: int32(0x3005), 138: int32(0x3006), 139: int32(0x303B), 140: int32(0x303C), 141: int32(0xA62A), 142: int32(0xA62B), 143: int32(0xA7D0), 144: int32(0xA7D1), 145: int32(0xA7D3), 146: int32(0xA8FB), 147: int32(0xA8FD), 148: int32(0xA8FE), 149: int32(0xA9CF), 150: int32(0xAA7A), 151: int32(0xAAB1), 152: int32(0xAAB5), 153: int32(0xAAB6), 154: int32(0xAAC0), 155: int32(0xAAC2), 156: int32(0xFB1D), 157: int32(0xFB3E), 158: int32(0xFB40), 159: int32(0xFB41), 160: int32(0xFB43), 161: int32(0xFB44), 162: int32(0x1003C), 163: int32(0x1003D), 164: int32(0x10594), 165: int32(0x10595), 166: int32(0x105BB), 167: int32(0x105BC), 168: int32(0x10808), 169: int32(0x10837), 170: int32(0x10838), 171: int32(0x1083C), 172: int32(0x108F4), 173: int32(0x108F5), 174: int32(0x109BE), 175: int32(0x109BF), 176: int32(0x10A00), 177: int32(0x10EB0), 178: int32(0x10EB1), 179: int32(0x10F27), 180: int32(0x11071), 181: int32(0x11072), 182: int32(0x11075), 183: int32(0x11144), 184: int32(0x11147), 185: int32(0x11176), 186: int32(0x111DA), 187: int32(0x111DC), 188: int32(0x1123F), 189: int32(0x11240), 190: int32(0x11288), 191: int32(0x1130F), 192: int32(0x11310), 193: int32(0x11332), 194: int32(0x11333), 195: int32(0x1133D), 196: int32(0x11350), 197: int32(0x1138B), 198: int32(0x1138E), 199: int32(0x113B7), 200: int32(0x113D1), 201: int32(0x113D3), 202: int32(0x114C4), 203: int32(0x114C5), 204: int32(0x114C7), 205: int32(0x11644), 206: int32(0x116B8), 207: int32(0x11909), 208: int32(0x11915), 209: int32(0x11916), 210: int32(0x1193F), 211: int32(0x11941), 212: int32(0x119E1), 213: int32(0x119E3), 214: int32(0x11A00), 215: int32(0x11A3A), 216: int32(0x11A50), 217: int32(0x11A9D), 218: int32(0x11C40), 219: int32(0x11D08), 220: int32(0x11D09), 221: int32(0x11D46), 222: int32(0x11D67), 223: int32(0x11D68), 224: int32(0x11D98), 225: int32(0x11F02), 226: int32(0x11FB0), 227: int32(0x16F50), 228: int32(0x16FE0), 229: int32(0x16FE1), 230: int32(0x16FE3), 231: int32(0x1AFFD), 232: int32(0x1AFFE), 233: int32(0x1B132), 234: int32(0x1B155), 235: int32(0x1D49E), 236: int32(0x1D49F), 237: int32(0x1D4A2), 238: int32(0x1D4A5), 239: int32(0x1D4A6), 240: int32(0x1D4BB), 241: int32(0x1D546), 242: int32(0x1E14E), 243: int32(0x1E5F0), 244: int32(0x1E7ED), 245: int32(0x1E7EE), 246: int32(0x1E94B), 247: int32(0x1EE21), 248: int32(0x1EE22), 249: int32(0x1EE24), 250: int32(0x1EE27), 251: int32(0x1EE39), 252: int32(0x1EE3B), 253: int32(0x1EE42), 254: int32(0x1EE47), 255: int32(0x1EE49), 256: int32(0x1EE4B), 257: int32(0x1EE51), 258: int32(0x1EE52), 259: int32(0x1EE54), 260: int32(0x1EE57), 261: int32(0x1EE59), 262: int32(0x1EE5B), 263: int32(0x1EE5D), 264: int32(0x1EE5F), 265: int32(0x1EE61), 266: int32(0x1EE62), 267: int32(0x1EE64), 268: int32(0x1EE7E), } /* * Unicode: control characters. */ var _controlRangeTable = [12]Tcrange{ 0: { Fend: int32(0x1F), }, 1: { Fstart: int32(0x7F), Fend: int32(0x9F), }, 2: { Fstart: int32(0x600), Fend: int32(0x605), }, 3: { Fstart: int32(0x200B), Fend: int32(0x200F), }, 4: { Fstart: int32(0x202A), Fend: int32(0x202E), }, 5: { Fstart: int32(0x2060), Fend: int32(0x2064), }, 6: { Fstart: int32(0x2066), Fend: int32(0x206F), }, 7: { Fstart: int32(0xFFF9), Fend: int32(0xFFFB), }, 8: { Fstart: int32(0x13430), Fend: int32(0x1343F), }, 9: { Fstart: int32(0x1BCA0), Fend: int32(0x1BCA3), }, 10: { Fstart: int32(0x1D173), Fend: int32(0x1D17A), }, 11: { Fstart: int32(0xE0020), Fend: int32(0xE007F), }, } var _controlCharTable = [12]Tchr{ 0: int32(0xAD), 1: int32(0x61C), 2: int32(0x6DD), 3: int32(0x70F), 4: int32(0x890), 5: int32(0x891), 6: int32(0x8E2), 7: int32(0x180E), 8: int32(0xFEFF), 9: int32(0x110BD), 10: int32(0x110CD), 11: int32(0xE0001), } /* * Unicode: decimal digit characters. */ var _digitRangeTable = [71]Tcrange{ 0: { Fstart: int32(0x30), Fend: int32(0x39), }, 1: { Fstart: int32(0x660), Fend: int32(0x669), }, 2: { Fstart: int32(0x6F0), Fend: int32(0x6F9), }, 3: { Fstart: int32(0x7C0), Fend: int32(0x7C9), }, 4: { Fstart: int32(0x966), Fend: int32(0x96F), }, 5: { Fstart: int32(0x9E6), Fend: int32(0x9EF), }, 6: { Fstart: int32(0xA66), Fend: int32(0xA6F), }, 7: { Fstart: int32(0xAE6), Fend: int32(0xAEF), }, 8: { Fstart: int32(0xB66), Fend: int32(0xB6F), }, 9: { Fstart: int32(0xBE6), Fend: int32(0xBEF), }, 10: { Fstart: int32(0xC66), Fend: int32(0xC6F), }, 11: { Fstart: int32(0xCE6), Fend: int32(0xCEF), }, 12: { Fstart: int32(0xD66), Fend: int32(0xD6F), }, 13: { Fstart: int32(0xDE6), Fend: int32(0xDEF), }, 14: { Fstart: int32(0xE50), Fend: int32(0xE59), }, 15: { Fstart: int32(0xED0), Fend: int32(0xED9), }, 16: { Fstart: int32(0xF20), Fend: int32(0xF29), }, 17: { Fstart: int32(0x1040), Fend: int32(0x1049), }, 18: { Fstart: int32(0x1090), Fend: int32(0x1099), }, 19: { Fstart: int32(0x17E0), Fend: int32(0x17E9), }, 20: { Fstart: int32(0x1810), Fend: int32(0x1819), }, 21: { Fstart: int32(0x1946), Fend: int32(0x194F), }, 22: { Fstart: int32(0x19D0), Fend: int32(0x19D9), }, 23: { Fstart: int32(0x1A80), Fend: int32(0x1A89), }, 24: { Fstart: int32(0x1A90), Fend: int32(0x1A99), }, 25: { Fstart: int32(0x1B50), Fend: int32(0x1B59), }, 26: { Fstart: int32(0x1BB0), Fend: int32(0x1BB9), }, 27: { Fstart: int32(0x1C40), Fend: int32(0x1C49), }, 28: { Fstart: int32(0x1C50), Fend: int32(0x1C59), }, 29: { Fstart: int32(0xA620), Fend: int32(0xA629), }, 30: { Fstart: int32(0xA8D0), Fend: int32(0xA8D9), }, 31: { Fstart: int32(0xA900), Fend: int32(0xA909), }, 32: { Fstart: int32(0xA9D0), Fend: int32(0xA9D9), }, 33: { Fstart: int32(0xA9F0), Fend: int32(0xA9F9), }, 34: { Fstart: int32(0xAA50), Fend: int32(0xAA59), }, 35: { Fstart: int32(0xABF0), Fend: int32(0xABF9), }, 36: { Fstart: int32(0xFF10), Fend: int32(0xFF19), }, 37: { Fstart: int32(0x104A0), Fend: int32(0x104A9), }, 38: { Fstart: int32(0x10D30), Fend: int32(0x10D39), }, 39: { Fstart: int32(0x10D40), Fend: int32(0x10D49), }, 40: { Fstart: int32(0x11066), Fend: int32(0x1106F), }, 41: { Fstart: int32(0x110F0), Fend: int32(0x110F9), }, 42: { Fstart: int32(0x11136), Fend: int32(0x1113F), }, 43: { Fstart: int32(0x111D0), Fend: int32(0x111D9), }, 44: { Fstart: int32(0x112F0), Fend: int32(0x112F9), }, 45: { Fstart: int32(0x11450), Fend: int32(0x11459), }, 46: { Fstart: int32(0x114D0), Fend: int32(0x114D9), }, 47: { Fstart: int32(0x11650), Fend: int32(0x11659), }, 48: { Fstart: int32(0x116C0), Fend: int32(0x116C9), }, 49: { Fstart: int32(0x116D0), Fend: int32(0x116E3), }, 50: { Fstart: int32(0x11730), Fend: int32(0x11739), }, 51: { Fstart: int32(0x118E0), Fend: int32(0x118E9), }, 52: { Fstart: int32(0x11950), Fend: int32(0x11959), }, 53: { Fstart: int32(0x11BF0), Fend: int32(0x11BF9), }, 54: { Fstart: int32(0x11C50), Fend: int32(0x11C59), }, 55: { Fstart: int32(0x11D50), Fend: int32(0x11D59), }, 56: { Fstart: int32(0x11DA0), Fend: int32(0x11DA9), }, 57: { Fstart: int32(0x11F50), Fend: int32(0x11F59), }, 58: { Fstart: int32(0x16130), Fend: int32(0x16139), }, 59: { Fstart: int32(0x16A60), Fend: int32(0x16A69), }, 60: { Fstart: int32(0x16AC0), Fend: int32(0x16AC9), }, 61: { Fstart: int32(0x16B50), Fend: int32(0x16B59), }, 62: { Fstart: int32(0x16D70), Fend: int32(0x16D79), }, 63: { Fstart: int32(0x1CCF0), Fend: int32(0x1CCF9), }, 64: { Fstart: int32(0x1D7CE), Fend: int32(0x1D7FF), }, 65: { Fstart: int32(0x1E140), Fend: int32(0x1E149), }, 66: { Fstart: int32(0x1E2F0), Fend: int32(0x1E2F9), }, 67: { Fstart: int32(0x1E4F0), Fend: int32(0x1E4F9), }, 68: { Fstart: int32(0x1E5F1), Fend: int32(0x1E5FA), }, 69: { Fstart: int32(0x1E950), Fend: int32(0x1E959), }, 70: { Fstart: int32(0x1FBF0), Fend: int32(0x1FBF9), }, } /* * no singletons of digit characters. */ /* * Unicode: punctuation characters. */ var _punctRangeTable = [86]Tcrange{ 0: { Fstart: int32(0x21), Fend: int32(0x23), }, 1: { Fstart: int32(0x25), Fend: int32(0x2A), }, 2: { Fstart: int32(0x2C), Fend: int32(0x2F), }, 3: { Fstart: int32(0x5B), Fend: int32(0x5D), }, 4: { Fstart: int32(0x55A), Fend: int32(0x55F), }, 5: { Fstart: int32(0x61D), Fend: int32(0x61F), }, 6: { Fstart: int32(0x66A), Fend: int32(0x66D), }, 7: { Fstart: int32(0x700), Fend: int32(0x70D), }, 8: { Fstart: int32(0x7F7), Fend: int32(0x7F9), }, 9: { Fstart: int32(0x830), Fend: int32(0x83E), }, 10: { Fstart: int32(0xF04), Fend: int32(0xF12), }, 11: { Fstart: int32(0xF3A), Fend: int32(0xF3D), }, 12: { Fstart: int32(0xFD0), Fend: int32(0xFD4), }, 13: { Fstart: int32(0x104A), Fend: int32(0x104F), }, 14: { Fstart: int32(0x1360), Fend: int32(0x1368), }, 15: { Fstart: int32(0x16EB), Fend: int32(0x16ED), }, 16: { Fstart: int32(0x17D4), Fend: int32(0x17D6), }, 17: { Fstart: int32(0x17D8), Fend: int32(0x17DA), }, 18: { Fstart: int32(0x1800), Fend: int32(0x180A), }, 19: { Fstart: int32(0x1AA0), Fend: int32(0x1AA6), }, 20: { Fstart: int32(0x1AA8), Fend: int32(0x1AAD), }, 21: { Fstart: int32(0x1B5A), Fend: int32(0x1B60), }, 22: { Fstart: int32(0x1B7D), Fend: int32(0x1B7F), }, 23: { Fstart: int32(0x1BFC), Fend: int32(0x1BFF), }, 24: { Fstart: int32(0x1C3B), Fend: int32(0x1C3F), }, 25: { Fstart: int32(0x1CC0), Fend: int32(0x1CC7), }, 26: { Fstart: int32(0x2010), Fend: int32(0x2027), }, 27: { Fstart: int32(0x2030), Fend: int32(0x2043), }, 28: { Fstart: int32(0x2045), Fend: int32(0x2051), }, 29: { Fstart: int32(0x2053), Fend: int32(0x205E), }, 30: { Fstart: int32(0x2308), Fend: int32(0x230B), }, 31: { Fstart: int32(0x2768), Fend: int32(0x2775), }, 32: { Fstart: int32(0x27E6), Fend: int32(0x27EF), }, 33: { Fstart: int32(0x2983), Fend: int32(0x2998), }, 34: { Fstart: int32(0x29D8), Fend: int32(0x29DB), }, 35: { Fstart: int32(0x2CF9), Fend: int32(0x2CFC), }, 36: { Fstart: int32(0x2E00), Fend: int32(0x2E2E), }, 37: { Fstart: int32(0x2E30), Fend: int32(0x2E4F), }, 38: { Fstart: int32(0x2E52), Fend: int32(0x2E5D), }, 39: { Fstart: int32(0x3001), Fend: int32(0x3003), }, 40: { Fstart: int32(0x3008), Fend: int32(0x3011), }, 41: { Fstart: int32(0x3014), Fend: int32(0x301F), }, 42: { Fstart: int32(0xA60D), Fend: int32(0xA60F), }, 43: { Fstart: int32(0xA6F2), Fend: int32(0xA6F7), }, 44: { Fstart: int32(0xA874), Fend: int32(0xA877), }, 45: { Fstart: int32(0xA8F8), Fend: int32(0xA8FA), }, 46: { Fstart: int32(0xA9C1), Fend: int32(0xA9CD), }, 47: { Fstart: int32(0xAA5C), Fend: int32(0xAA5F), }, 48: { Fstart: int32(0xFE10), Fend: int32(0xFE19), }, 49: { Fstart: int32(0xFE30), Fend: int32(0xFE52), }, 50: { Fstart: int32(0xFE54), Fend: int32(0xFE61), }, 51: { Fstart: int32(0xFF01), Fend: int32(0xFF03), }, 52: { Fstart: int32(0xFF05), Fend: int32(0xFF0A), }, 53: { Fstart: int32(0xFF0C), Fend: int32(0xFF0F), }, 54: { Fstart: int32(0xFF3B), Fend: int32(0xFF3D), }, 55: { Fstart: int32(0xFF5F), Fend: int32(0xFF65), }, 56: { Fstart: int32(0x10100), Fend: int32(0x10102), }, 57: { Fstart: int32(0x10A50), Fend: int32(0x10A58), }, 58: { Fstart: int32(0x10AF0), Fend: int32(0x10AF6), }, 59: { Fstart: int32(0x10B39), Fend: int32(0x10B3F), }, 60: { Fstart: int32(0x10B99), Fend: int32(0x10B9C), }, 61: { Fstart: int32(0x10F55), Fend: int32(0x10F59), }, 62: { Fstart: int32(0x10F86), Fend: int32(0x10F89), }, 63: { Fstart: int32(0x11047), Fend: int32(0x1104D), }, 64: { Fstart: int32(0x110BE), Fend: int32(0x110C1), }, 65: { Fstart: int32(0x11140), Fend: int32(0x11143), }, 66: { Fstart: int32(0x111C5), Fend: int32(0x111C8), }, 67: { Fstart: int32(0x111DD), Fend: int32(0x111DF), }, 68: { Fstart: int32(0x11238), Fend: int32(0x1123D), }, 69: { Fstart: int32(0x1144B), Fend: int32(0x1144F), }, 70: { Fstart: int32(0x115C1), Fend: int32(0x115D7), }, 71: { Fstart: int32(0x11641), Fend: int32(0x11643), }, 72: { Fstart: int32(0x11660), Fend: int32(0x1166C), }, 73: { Fstart: int32(0x1173C), Fend: int32(0x1173E), }, 74: { Fstart: int32(0x11944), Fend: int32(0x11946), }, 75: { Fstart: int32(0x11A3F), Fend: int32(0x11A46), }, 76: { Fstart: int32(0x11A9A), Fend: int32(0x11A9C), }, 77: { Fstart: int32(0x11A9E), Fend: int32(0x11AA2), }, 78: { Fstart: int32(0x11B00), Fend: int32(0x11B09), }, 79: { Fstart: int32(0x11C41), Fend: int32(0x11C45), }, 80: { Fstart: int32(0x11F43), Fend: int32(0x11F4F), }, 81: { Fstart: int32(0x12470), Fend: int32(0x12474), }, 82: { Fstart: int32(0x16B37), Fend: int32(0x16B3B), }, 83: { Fstart: int32(0x16D6D), Fend: int32(0x16D6F), }, 84: { Fstart: int32(0x16E97), Fend: int32(0x16E9A), }, 85: { Fstart: int32(0x1DA87), Fend: int32(0x1DA8B), }, } var _punctCharTable = [154]Tchr{ 0: int32(0x3A), 1: int32(0x3B), 2: int32(0x3F), 3: int32(0x40), 4: int32(0x5F), 5: int32(0x7B), 6: int32(0x7D), 7: int32(0xA1), 8: int32(0xA7), 9: int32(0xAB), 10: int32(0xB6), 11: int32(0xB7), 12: int32(0xBB), 13: int32(0xBF), 14: int32(0x37E), 15: int32(0x387), 16: int32(0x589), 17: int32(0x58A), 18: int32(0x5BE), 19: int32(0x5C0), 20: int32(0x5C3), 21: int32(0x5C6), 22: int32(0x5F3), 23: int32(0x5F4), 24: int32(0x609), 25: int32(0x60A), 26: int32(0x60C), 27: int32(0x60D), 28: int32(0x61B), 29: int32(0x6D4), 30: int32(0x85E), 31: int32(0x964), 32: int32(0x965), 33: int32(0x970), 34: int32(0x9FD), 35: int32(0xA76), 36: int32(0xAF0), 37: int32(0xC77), 38: int32(0xC84), 39: int32(0xDF4), 40: int32(0xE4F), 41: int32(0xE5A), 42: int32(0xE5B), 43: int32(0xF14), 44: int32(0xF85), 45: int32(0xFD9), 46: int32(0xFDA), 47: int32(0x10FB), 48: int32(0x1400), 49: int32(0x166E), 50: int32(0x169B), 51: int32(0x169C), 52: int32(0x1735), 53: int32(0x1736), 54: int32(0x1944), 55: int32(0x1945), 56: int32(0x1A1E), 57: int32(0x1A1F), 58: int32(0x1B4E), 59: int32(0x1B4F), 60: int32(0x1C7E), 61: int32(0x1C7F), 62: int32(0x1CD3), 63: int32(0x207D), 64: int32(0x207E), 65: int32(0x208D), 66: int32(0x208E), 67: int32(0x2329), 68: int32(0x232A), 69: int32(0x27C5), 70: int32(0x27C6), 71: int32(0x29FC), 72: int32(0x29FD), 73: int32(0x2CFE), 74: int32(0x2CFF), 75: int32(0x2D70), 76: int32(0x3030), 77: int32(0x303D), 78: int32(0x30A0), 79: int32(0x30FB), 80: int32(0xA4FE), 81: int32(0xA4FF), 82: int32(0xA673), 83: int32(0xA67E), 84: int32(0xA8CE), 85: int32(0xA8CF), 86: int32(0xA8FC), 87: int32(0xA92E), 88: int32(0xA92F), 89: int32(0xA95F), 90: int32(0xA9DE), 91: int32(0xA9DF), 92: int32(0xAADE), 93: int32(0xAADF), 94: int32(0xAAF0), 95: int32(0xAAF1), 96: int32(0xABEB), 97: int32(0xFD3E), 98: int32(0xFD3F), 99: int32(0xFE63), 100: int32(0xFE68), 101: int32(0xFE6A), 102: int32(0xFE6B), 103: int32(0xFF1A), 104: int32(0xFF1B), 105: int32(0xFF1F), 106: int32(0xFF20), 107: int32(0xFF3F), 108: int32(0xFF5B), 109: int32(0xFF5D), 110: int32(0x1039F), 111: int32(0x103D0), 112: int32(0x1056F), 113: int32(0x10857), 114: int32(0x1091F), 115: int32(0x1093F), 116: int32(0x10A7F), 117: int32(0x10D6E), 118: int32(0x10EAD), 119: int32(0x110BB), 120: int32(0x110BC), 121: int32(0x11174), 122: int32(0x11175), 123: int32(0x111CD), 124: int32(0x111DB), 125: int32(0x112A9), 126: int32(0x113D4), 127: int32(0x113D5), 128: int32(0x113D7), 129: int32(0x113D8), 130: int32(0x1145A), 131: int32(0x1145B), 132: int32(0x1145D), 133: int32(0x114C6), 134: int32(0x116B9), 135: int32(0x1183B), 136: int32(0x119E2), 137: int32(0x11BE1), 138: int32(0x11C70), 139: int32(0x11C71), 140: int32(0x11EF7), 141: int32(0x11EF8), 142: int32(0x11FFF), 143: int32(0x12FF1), 144: int32(0x12FF2), 145: int32(0x16A6E), 146: int32(0x16A6F), 147: int32(0x16AF5), 148: int32(0x16B44), 149: int32(0x16FE2), 150: int32(0x1BC9F), 151: int32(0x1E5FF), 152: int32(0x1E95E), 153: int32(0x1E95F), } /* * Unicode: white space characters. */ var _spaceRangeTable = [2]Tcrange{ 0: { Fstart: int32(0x9), Fend: int32(0xD), }, 1: { Fstart: int32(0x2000), Fend: int32(0x200B), }, } var _spaceCharTable = [12]Tchr{ 0: int32(0x20), 1: int32(0x85), 2: int32(0xA0), 3: int32(0x1680), 4: int32(0x180E), 5: int32(0x2028), 6: int32(0x2029), 7: int32(0x202F), 8: int32(0x205F), 9: int32(0x2060), 10: int32(0x3000), 11: int32(0xFEFF), } /* * Unicode: lowercase characters. */ var _lowerRangeTable = [91]Tcrange{ 0: { Fstart: int32(0x61), Fend: int32(0x7A), }, 1: { Fstart: int32(0xDF), Fend: int32(0xF6), }, 2: { Fstart: int32(0xF8), Fend: int32(0xFF), }, 3: { Fstart: int32(0x17E), Fend: int32(0x180), }, 4: { Fstart: int32(0x199), Fend: int32(0x19B), }, 5: { Fstart: int32(0x1BD), Fend: int32(0x1BF), }, 6: { Fstart: int32(0x233), Fend: int32(0x239), }, 7: { Fstart: int32(0x24F), Fend: int32(0x293), }, 8: { Fstart: int32(0x295), Fend: int32(0x2AF), }, 9: { Fstart: int32(0x37B), Fend: int32(0x37D), }, 10: { Fstart: int32(0x3AC), Fend: int32(0x3CE), }, 11: { Fstart: int32(0x3D5), Fend: int32(0x3D7), }, 12: { Fstart: int32(0x3EF), Fend: int32(0x3F3), }, 13: { Fstart: int32(0x430), Fend: int32(0x45F), }, 14: { Fstart: int32(0x560), Fend: int32(0x588), }, 15: { Fstart: int32(0x10D0), Fend: int32(0x10FA), }, 16: { Fstart: int32(0x10FD), Fend: int32(0x10FF), }, 17: { Fstart: int32(0x13F8), Fend: int32(0x13FD), }, 18: { Fstart: int32(0x1C80), Fend: int32(0x1C88), }, 19: { Fstart: int32(0x1D00), Fend: int32(0x1D2B), }, 20: { Fstart: int32(0x1D6B), Fend: int32(0x1D77), }, 21: { Fstart: int32(0x1D79), Fend: int32(0x1D9A), }, 22: { Fstart: int32(0x1E95), Fend: int32(0x1E9D), }, 23: { Fstart: int32(0x1EFF), Fend: int32(0x1F07), }, 24: { Fstart: int32(0x1F10), Fend: int32(0x1F15), }, 25: { Fstart: int32(0x1F20), Fend: int32(0x1F27), }, 26: { Fstart: int32(0x1F30), Fend: int32(0x1F37), }, 27: { Fstart: int32(0x1F40), Fend: int32(0x1F45), }, 28: { Fstart: int32(0x1F50), Fend: int32(0x1F57), }, 29: { Fstart: int32(0x1F60), Fend: int32(0x1F67), }, 30: { Fstart: int32(0x1F70), Fend: int32(0x1F7D), }, 31: { Fstart: int32(0x1F80), Fend: int32(0x1F87), }, 32: { Fstart: int32(0x1F90), Fend: int32(0x1F97), }, 33: { Fstart: int32(0x1FA0), Fend: int32(0x1FA7), }, 34: { Fstart: int32(0x1FB0), Fend: int32(0x1FB4), }, 35: { Fstart: int32(0x1FC2), Fend: int32(0x1FC4), }, 36: { Fstart: int32(0x1FD0), Fend: int32(0x1FD3), }, 37: { Fstart: int32(0x1FE0), Fend: int32(0x1FE7), }, 38: { Fstart: int32(0x1FF2), Fend: int32(0x1FF4), }, 39: { Fstart: int32(0x2146), Fend: int32(0x2149), }, 40: { Fstart: int32(0x2C30), Fend: int32(0x2C5F), }, 41: { Fstart: int32(0x2C76), Fend: int32(0x2C7B), }, 42: { Fstart: int32(0x2D00), Fend: int32(0x2D25), }, 43: { Fstart: int32(0xA72F), Fend: int32(0xA731), }, 44: { Fstart: int32(0xA771), Fend: int32(0xA778), }, 45: { Fstart: int32(0xA793), Fend: int32(0xA795), }, 46: { Fstart: int32(0xAB30), Fend: int32(0xAB5A), }, 47: { Fstart: int32(0xAB60), Fend: int32(0xAB68), }, 48: { Fstart: int32(0xAB70), Fend: int32(0xABBF), }, 49: { Fstart: int32(0xFB00), Fend: int32(0xFB06), }, 50: { Fstart: int32(0xFB13), Fend: int32(0xFB17), }, 51: { Fstart: int32(0xFF41), Fend: int32(0xFF5A), }, 52: { Fstart: int32(0x10428), Fend: int32(0x1044F), }, 53: { Fstart: int32(0x104D8), Fend: int32(0x104FB), }, 54: { Fstart: int32(0x10597), Fend: int32(0x105A1), }, 55: { Fstart: int32(0x105A3), Fend: int32(0x105B1), }, 56: { Fstart: int32(0x105B3), Fend: int32(0x105B9), }, 57: { Fstart: int32(0x10CC0), Fend: int32(0x10CF2), }, 58: { Fstart: int32(0x10D70), Fend: int32(0x10D85), }, 59: { Fstart: int32(0x118C0), Fend: int32(0x118DF), }, 60: { Fstart: int32(0x16E60), Fend: int32(0x16E7F), }, 61: { Fstart: int32(0x1D41A), Fend: int32(0x1D433), }, 62: { Fstart: int32(0x1D44E), Fend: int32(0x1D454), }, 63: { Fstart: int32(0x1D456), Fend: int32(0x1D467), }, 64: { Fstart: int32(0x1D482), Fend: int32(0x1D49B), }, 65: { Fstart: int32(0x1D4B6), Fend: int32(0x1D4B9), }, 66: { Fstart: int32(0x1D4BD), Fend: int32(0x1D4C3), }, 67: { Fstart: int32(0x1D4C5), Fend: int32(0x1D4CF), }, 68: { Fstart: int32(0x1D4EA), Fend: int32(0x1D503), }, 69: { Fstart: int32(0x1D51E), Fend: int32(0x1D537), }, 70: { Fstart: int32(0x1D552), Fend: int32(0x1D56B), }, 71: { Fstart: int32(0x1D586), Fend: int32(0x1D59F), }, 72: { Fstart: int32(0x1D5BA), Fend: int32(0x1D5D3), }, 73: { Fstart: int32(0x1D5EE), Fend: int32(0x1D607), }, 74: { Fstart: int32(0x1D622), Fend: int32(0x1D63B), }, 75: { Fstart: int32(0x1D656), Fend: int32(0x1D66F), }, 76: { Fstart: int32(0x1D68A), Fend: int32(0x1D6A5), }, 77: { Fstart: int32(0x1D6C2), Fend: int32(0x1D6DA), }, 78: { Fstart: int32(0x1D6DC), Fend: int32(0x1D6E1), }, 79: { Fstart: int32(0x1D6FC), Fend: int32(0x1D714), }, 80: { Fstart: int32(0x1D716), Fend: int32(0x1D71B), }, 81: { Fstart: int32(0x1D736), Fend: int32(0x1D74E), }, 82: { Fstart: int32(0x1D750), Fend: int32(0x1D755), }, 83: { Fstart: int32(0x1D770), Fend: int32(0x1D788), }, 84: { Fstart: int32(0x1D78A), Fend: int32(0x1D78F), }, 85: { Fstart: int32(0x1D7AA), Fend: int32(0x1D7C2), }, 86: { Fstart: int32(0x1D7C4), Fend: int32(0x1D7C9), }, 87: { Fstart: int32(0x1DF00), Fend: int32(0x1DF09), }, 88: { Fstart: int32(0x1DF0B), Fend: int32(0x1DF1E), }, 89: { Fstart: int32(0x1DF25), Fend: int32(0x1DF2A), }, 90: { Fstart: int32(0x1E922), Fend: int32(0x1E943), }, } var _lowerCharTable = [592]Tchr{ 0: int32(0xB5), 1: int32(0x101), 2: int32(0x103), 3: int32(0x105), 4: int32(0x107), 5: int32(0x109), 6: int32(0x10B), 7: int32(0x10D), 8: int32(0x10F), 9: int32(0x111), 10: int32(0x113), 11: int32(0x115), 12: int32(0x117), 13: int32(0x119), 14: int32(0x11B), 15: int32(0x11D), 16: int32(0x11F), 17: int32(0x121), 18: int32(0x123), 19: int32(0x125), 20: int32(0x127), 21: int32(0x129), 22: int32(0x12B), 23: int32(0x12D), 24: int32(0x12F), 25: int32(0x131), 26: int32(0x133), 27: int32(0x135), 28: int32(0x137), 29: int32(0x138), 30: int32(0x13A), 31: int32(0x13C), 32: int32(0x13E), 33: int32(0x140), 34: int32(0x142), 35: int32(0x144), 36: int32(0x146), 37: int32(0x148), 38: int32(0x149), 39: int32(0x14B), 40: int32(0x14D), 41: int32(0x14F), 42: int32(0x151), 43: int32(0x153), 44: int32(0x155), 45: int32(0x157), 46: int32(0x159), 47: int32(0x15B), 48: int32(0x15D), 49: int32(0x15F), 50: int32(0x161), 51: int32(0x163), 52: int32(0x165), 53: int32(0x167), 54: int32(0x169), 55: int32(0x16B), 56: int32(0x16D), 57: int32(0x16F), 58: int32(0x171), 59: int32(0x173), 60: int32(0x175), 61: int32(0x177), 62: int32(0x17A), 63: int32(0x17C), 64: int32(0x183), 65: int32(0x185), 66: int32(0x188), 67: int32(0x18C), 68: int32(0x18D), 69: int32(0x192), 70: int32(0x195), 71: int32(0x19E), 72: int32(0x1A1), 73: int32(0x1A3), 74: int32(0x1A5), 75: int32(0x1A8), 76: int32(0x1AA), 77: int32(0x1AB), 78: int32(0x1AD), 79: int32(0x1B0), 80: int32(0x1B4), 81: int32(0x1B6), 82: int32(0x1B9), 83: int32(0x1BA), 84: int32(0x1C6), 85: int32(0x1C9), 86: int32(0x1CC), 87: int32(0x1CE), 88: int32(0x1D0), 89: int32(0x1D2), 90: int32(0x1D4), 91: int32(0x1D6), 92: int32(0x1D8), 93: int32(0x1DA), 94: int32(0x1DC), 95: int32(0x1DD), 96: int32(0x1DF), 97: int32(0x1E1), 98: int32(0x1E3), 99: int32(0x1E5), 100: int32(0x1E7), 101: int32(0x1E9), 102: int32(0x1EB), 103: int32(0x1ED), 104: int32(0x1EF), 105: int32(0x1F0), 106: int32(0x1F3), 107: int32(0x1F5), 108: int32(0x1F9), 109: int32(0x1FB), 110: int32(0x1FD), 111: int32(0x1FF), 112: int32(0x201), 113: int32(0x203), 114: int32(0x205), 115: int32(0x207), 116: int32(0x209), 117: int32(0x20B), 118: int32(0x20D), 119: int32(0x20F), 120: int32(0x211), 121: int32(0x213), 122: int32(0x215), 123: int32(0x217), 124: int32(0x219), 125: int32(0x21B), 126: int32(0x21D), 127: int32(0x21F), 128: int32(0x221), 129: int32(0x223), 130: int32(0x225), 131: int32(0x227), 132: int32(0x229), 133: int32(0x22B), 134: int32(0x22D), 135: int32(0x22F), 136: int32(0x231), 137: int32(0x23C), 138: int32(0x23F), 139: int32(0x240), 140: int32(0x242), 141: int32(0x247), 142: int32(0x249), 143: int32(0x24B), 144: int32(0x24D), 145: int32(0x371), 146: int32(0x373), 147: int32(0x377), 148: int32(0x390), 149: int32(0x3D0), 150: int32(0x3D1), 151: int32(0x3D9), 152: int32(0x3DB), 153: int32(0x3DD), 154: int32(0x3DF), 155: int32(0x3E1), 156: int32(0x3E3), 157: int32(0x3E5), 158: int32(0x3E7), 159: int32(0x3E9), 160: int32(0x3EB), 161: int32(0x3ED), 162: int32(0x3F5), 163: int32(0x3F8), 164: int32(0x3FB), 165: int32(0x3FC), 166: int32(0x461), 167: int32(0x463), 168: int32(0x465), 169: int32(0x467), 170: int32(0x469), 171: int32(0x46B), 172: int32(0x46D), 173: int32(0x46F), 174: int32(0x471), 175: int32(0x473), 176: int32(0x475), 177: int32(0x477), 178: int32(0x479), 179: int32(0x47B), 180: int32(0x47D), 181: int32(0x47F), 182: int32(0x481), 183: int32(0x48B), 184: int32(0x48D), 185: int32(0x48F), 186: int32(0x491), 187: int32(0x493), 188: int32(0x495), 189: int32(0x497), 190: int32(0x499), 191: int32(0x49B), 192: int32(0x49D), 193: int32(0x49F), 194: int32(0x4A1), 195: int32(0x4A3), 196: int32(0x4A5), 197: int32(0x4A7), 198: int32(0x4A9), 199: int32(0x4AB), 200: int32(0x4AD), 201: int32(0x4AF), 202: int32(0x4B1), 203: int32(0x4B3), 204: int32(0x4B5), 205: int32(0x4B7), 206: int32(0x4B9), 207: int32(0x4BB), 208: int32(0x4BD), 209: int32(0x4BF), 210: int32(0x4C2), 211: int32(0x4C4), 212: int32(0x4C6), 213: int32(0x4C8), 214: int32(0x4CA), 215: int32(0x4CC), 216: int32(0x4CE), 217: int32(0x4CF), 218: int32(0x4D1), 219: int32(0x4D3), 220: int32(0x4D5), 221: int32(0x4D7), 222: int32(0x4D9), 223: int32(0x4DB), 224: int32(0x4DD), 225: int32(0x4DF), 226: int32(0x4E1), 227: int32(0x4E3), 228: int32(0x4E5), 229: int32(0x4E7), 230: int32(0x4E9), 231: int32(0x4EB), 232: int32(0x4ED), 233: int32(0x4EF), 234: int32(0x4F1), 235: int32(0x4F3), 236: int32(0x4F5), 237: int32(0x4F7), 238: int32(0x4F9), 239: int32(0x4FB), 240: int32(0x4FD), 241: int32(0x4FF), 242: int32(0x501), 243: int32(0x503), 244: int32(0x505), 245: int32(0x507), 246: int32(0x509), 247: int32(0x50B), 248: int32(0x50D), 249: int32(0x50F), 250: int32(0x511), 251: int32(0x513), 252: int32(0x515), 253: int32(0x517), 254: int32(0x519), 255: int32(0x51B), 256: int32(0x51D), 257: int32(0x51F), 258: int32(0x521), 259: int32(0x523), 260: int32(0x525), 261: int32(0x527), 262: int32(0x529), 263: int32(0x52B), 264: int32(0x52D), 265: int32(0x52F), 266: int32(0x1C8A), 267: int32(0x1E01), 268: int32(0x1E03), 269: int32(0x1E05), 270: int32(0x1E07), 271: int32(0x1E09), 272: int32(0x1E0B), 273: int32(0x1E0D), 274: int32(0x1E0F), 275: int32(0x1E11), 276: int32(0x1E13), 277: int32(0x1E15), 278: int32(0x1E17), 279: int32(0x1E19), 280: int32(0x1E1B), 281: int32(0x1E1D), 282: int32(0x1E1F), 283: int32(0x1E21), 284: int32(0x1E23), 285: int32(0x1E25), 286: int32(0x1E27), 287: int32(0x1E29), 288: int32(0x1E2B), 289: int32(0x1E2D), 290: int32(0x1E2F), 291: int32(0x1E31), 292: int32(0x1E33), 293: int32(0x1E35), 294: int32(0x1E37), 295: int32(0x1E39), 296: int32(0x1E3B), 297: int32(0x1E3D), 298: int32(0x1E3F), 299: int32(0x1E41), 300: int32(0x1E43), 301: int32(0x1E45), 302: int32(0x1E47), 303: int32(0x1E49), 304: int32(0x1E4B), 305: int32(0x1E4D), 306: int32(0x1E4F), 307: int32(0x1E51), 308: int32(0x1E53), 309: int32(0x1E55), 310: int32(0x1E57), 311: int32(0x1E59), 312: int32(0x1E5B), 313: int32(0x1E5D), 314: int32(0x1E5F), 315: int32(0x1E61), 316: int32(0x1E63), 317: int32(0x1E65), 318: int32(0x1E67), 319: int32(0x1E69), 320: int32(0x1E6B), 321: int32(0x1E6D), 322: int32(0x1E6F), 323: int32(0x1E71), 324: int32(0x1E73), 325: int32(0x1E75), 326: int32(0x1E77), 327: int32(0x1E79), 328: int32(0x1E7B), 329: int32(0x1E7D), 330: int32(0x1E7F), 331: int32(0x1E81), 332: int32(0x1E83), 333: int32(0x1E85), 334: int32(0x1E87), 335: int32(0x1E89), 336: int32(0x1E8B), 337: int32(0x1E8D), 338: int32(0x1E8F), 339: int32(0x1E91), 340: int32(0x1E93), 341: int32(0x1E9F), 342: int32(0x1EA1), 343: int32(0x1EA3), 344: int32(0x1EA5), 345: int32(0x1EA7), 346: int32(0x1EA9), 347: int32(0x1EAB), 348: int32(0x1EAD), 349: int32(0x1EAF), 350: int32(0x1EB1), 351: int32(0x1EB3), 352: int32(0x1EB5), 353: int32(0x1EB7), 354: int32(0x1EB9), 355: int32(0x1EBB), 356: int32(0x1EBD), 357: int32(0x1EBF), 358: int32(0x1EC1), 359: int32(0x1EC3), 360: int32(0x1EC5), 361: int32(0x1EC7), 362: int32(0x1EC9), 363: int32(0x1ECB), 364: int32(0x1ECD), 365: int32(0x1ECF), 366: int32(0x1ED1), 367: int32(0x1ED3), 368: int32(0x1ED5), 369: int32(0x1ED7), 370: int32(0x1ED9), 371: int32(0x1EDB), 372: int32(0x1EDD), 373: int32(0x1EDF), 374: int32(0x1EE1), 375: int32(0x1EE3), 376: int32(0x1EE5), 377: int32(0x1EE7), 378: int32(0x1EE9), 379: int32(0x1EEB), 380: int32(0x1EED), 381: int32(0x1EEF), 382: int32(0x1EF1), 383: int32(0x1EF3), 384: int32(0x1EF5), 385: int32(0x1EF7), 386: int32(0x1EF9), 387: int32(0x1EFB), 388: int32(0x1EFD), 389: int32(0x1FB6), 390: int32(0x1FB7), 391: int32(0x1FBE), 392: int32(0x1FC6), 393: int32(0x1FC7), 394: int32(0x1FD6), 395: int32(0x1FD7), 396: int32(0x1FF6), 397: int32(0x1FF7), 398: int32(0x210A), 399: int32(0x210E), 400: int32(0x210F), 401: int32(0x2113), 402: int32(0x212F), 403: int32(0x2134), 404: int32(0x2139), 405: int32(0x213C), 406: int32(0x213D), 407: int32(0x214E), 408: int32(0x2184), 409: int32(0x2C61), 410: int32(0x2C65), 411: int32(0x2C66), 412: int32(0x2C68), 413: int32(0x2C6A), 414: int32(0x2C6C), 415: int32(0x2C71), 416: int32(0x2C73), 417: int32(0x2C74), 418: int32(0x2C81), 419: int32(0x2C83), 420: int32(0x2C85), 421: int32(0x2C87), 422: int32(0x2C89), 423: int32(0x2C8B), 424: int32(0x2C8D), 425: int32(0x2C8F), 426: int32(0x2C91), 427: int32(0x2C93), 428: int32(0x2C95), 429: int32(0x2C97), 430: int32(0x2C99), 431: int32(0x2C9B), 432: int32(0x2C9D), 433: int32(0x2C9F), 434: int32(0x2CA1), 435: int32(0x2CA3), 436: int32(0x2CA5), 437: int32(0x2CA7), 438: int32(0x2CA9), 439: int32(0x2CAB), 440: int32(0x2CAD), 441: int32(0x2CAF), 442: int32(0x2CB1), 443: int32(0x2CB3), 444: int32(0x2CB5), 445: int32(0x2CB7), 446: int32(0x2CB9), 447: int32(0x2CBB), 448: int32(0x2CBD), 449: int32(0x2CBF), 450: int32(0x2CC1), 451: int32(0x2CC3), 452: int32(0x2CC5), 453: int32(0x2CC7), 454: int32(0x2CC9), 455: int32(0x2CCB), 456: int32(0x2CCD), 457: int32(0x2CCF), 458: int32(0x2CD1), 459: int32(0x2CD3), 460: int32(0x2CD5), 461: int32(0x2CD7), 462: int32(0x2CD9), 463: int32(0x2CDB), 464: int32(0x2CDD), 465: int32(0x2CDF), 466: int32(0x2CE1), 467: int32(0x2CE3), 468: int32(0x2CE4), 469: int32(0x2CEC), 470: int32(0x2CEE), 471: int32(0x2CF3), 472: int32(0x2D27), 473: int32(0x2D2D), 474: int32(0xA641), 475: int32(0xA643), 476: int32(0xA645), 477: int32(0xA647), 478: int32(0xA649), 479: int32(0xA64B), 480: int32(0xA64D), 481: int32(0xA64F), 482: int32(0xA651), 483: int32(0xA653), 484: int32(0xA655), 485: int32(0xA657), 486: int32(0xA659), 487: int32(0xA65B), 488: int32(0xA65D), 489: int32(0xA65F), 490: int32(0xA661), 491: int32(0xA663), 492: int32(0xA665), 493: int32(0xA667), 494: int32(0xA669), 495: int32(0xA66B), 496: int32(0xA66D), 497: int32(0xA681), 498: int32(0xA683), 499: int32(0xA685), 500: int32(0xA687), 501: int32(0xA689), 502: int32(0xA68B), 503: int32(0xA68D), 504: int32(0xA68F), 505: int32(0xA691), 506: int32(0xA693), 507: int32(0xA695), 508: int32(0xA697), 509: int32(0xA699), 510: int32(0xA69B), 511: int32(0xA723), 512: int32(0xA725), 513: int32(0xA727), 514: int32(0xA729), 515: int32(0xA72B), 516: int32(0xA72D), 517: int32(0xA733), 518: int32(0xA735), 519: int32(0xA737), 520: int32(0xA739), 521: int32(0xA73B), 522: int32(0xA73D), 523: int32(0xA73F), 524: int32(0xA741), 525: int32(0xA743), 526: int32(0xA745), 527: int32(0xA747), 528: int32(0xA749), 529: int32(0xA74B), 530: int32(0xA74D), 531: int32(0xA74F), 532: int32(0xA751), 533: int32(0xA753), 534: int32(0xA755), 535: int32(0xA757), 536: int32(0xA759), 537: int32(0xA75B), 538: int32(0xA75D), 539: int32(0xA75F), 540: int32(0xA761), 541: int32(0xA763), 542: int32(0xA765), 543: int32(0xA767), 544: int32(0xA769), 545: int32(0xA76B), 546: int32(0xA76D), 547: int32(0xA76F), 548: int32(0xA77A), 549: int32(0xA77C), 550: int32(0xA77F), 551: int32(0xA781), 552: int32(0xA783), 553: int32(0xA785), 554: int32(0xA787), 555: int32(0xA78C), 556: int32(0xA78E), 557: int32(0xA791), 558: int32(0xA797), 559: int32(0xA799), 560: int32(0xA79B), 561: int32(0xA79D), 562: int32(0xA79F), 563: int32(0xA7A1), 564: int32(0xA7A3), 565: int32(0xA7A5), 566: int32(0xA7A7), 567: int32(0xA7A9), 568: int32(0xA7AF), 569: int32(0xA7B5), 570: int32(0xA7B7), 571: int32(0xA7B9), 572: int32(0xA7BB), 573: int32(0xA7BD), 574: int32(0xA7BF), 575: int32(0xA7C1), 576: int32(0xA7C3), 577: int32(0xA7C8), 578: int32(0xA7CA), 579: int32(0xA7CD), 580: int32(0xA7D1), 581: int32(0xA7D3), 582: int32(0xA7D5), 583: int32(0xA7D7), 584: int32(0xA7D9), 585: int32(0xA7DB), 586: int32(0xA7F6), 587: int32(0xA7FA), 588: int32(0x105BB), 589: int32(0x105BC), 590: int32(0x1D4BB), 591: int32(0x1D7CB), } /* * Unicode: uppercase characters. */ var _upperRangeTable = [76]Tcrange{ 0: { Fstart: int32(0x41), Fend: int32(0x5A), }, 1: { Fstart: int32(0xC0), Fend: int32(0xD6), }, 2: { Fstart: int32(0xD8), Fend: int32(0xDE), }, 3: { Fstart: int32(0x189), Fend: int32(0x18B), }, 4: { Fstart: int32(0x18E), Fend: int32(0x191), }, 5: { Fstart: int32(0x196), Fend: int32(0x198), }, 6: { Fstart: int32(0x1B1), Fend: int32(0x1B3), }, 7: { Fstart: int32(0x1F6), Fend: int32(0x1F8), }, 8: { Fstart: int32(0x243), Fend: int32(0x246), }, 9: { Fstart: int32(0x388), Fend: int32(0x38A), }, 10: { Fstart: int32(0x391), Fend: int32(0x3A1), }, 11: { Fstart: int32(0x3A3), Fend: int32(0x3AB), }, 12: { Fstart: int32(0x3D2), Fend: int32(0x3D4), }, 13: { Fstart: int32(0x3FD), Fend: int32(0x42F), }, 14: { Fstart: int32(0x531), Fend: int32(0x556), }, 15: { Fstart: int32(0x10A0), Fend: int32(0x10C5), }, 16: { Fstart: int32(0x13A0), Fend: int32(0x13F5), }, 17: { Fstart: int32(0x1C90), Fend: int32(0x1CBA), }, 18: { Fstart: int32(0x1CBD), Fend: int32(0x1CBF), }, 19: { Fstart: int32(0x1F08), Fend: int32(0x1F0F), }, 20: { Fstart: int32(0x1F18), Fend: int32(0x1F1D), }, 21: { Fstart: int32(0x1F28), Fend: int32(0x1F2F), }, 22: { Fstart: int32(0x1F38), Fend: int32(0x1F3F), }, 23: { Fstart: int32(0x1F48), Fend: int32(0x1F4D), }, 24: { Fstart: int32(0x1F68), Fend: int32(0x1F6F), }, 25: { Fstart: int32(0x1FB8), Fend: int32(0x1FBB), }, 26: { Fstart: int32(0x1FC8), Fend: int32(0x1FCB), }, 27: { Fstart: int32(0x1FD8), Fend: int32(0x1FDB), }, 28: { Fstart: int32(0x1FE8), Fend: int32(0x1FEC), }, 29: { Fstart: int32(0x1FF8), Fend: int32(0x1FFB), }, 30: { Fstart: int32(0x210B), Fend: int32(0x210D), }, 31: { Fstart: int32(0x2110), Fend: int32(0x2112), }, 32: { Fstart: int32(0x2119), Fend: int32(0x211D), }, 33: { Fstart: int32(0x212A), Fend: int32(0x212D), }, 34: { Fstart: int32(0x2130), Fend: int32(0x2133), }, 35: { Fstart: int32(0x2C00), Fend: int32(0x2C2F), }, 36: { Fstart: int32(0x2C62), Fend: int32(0x2C64), }, 37: { Fstart: int32(0x2C6D), Fend: int32(0x2C70), }, 38: { Fstart: int32(0x2C7E), Fend: int32(0x2C80), }, 39: { Fstart: int32(0xA7AA), Fend: int32(0xA7AE), }, 40: { Fstart: int32(0xA7B0), Fend: int32(0xA7B4), }, 41: { Fstart: int32(0xA7C4), Fend: int32(0xA7C7), }, 42: { Fstart: int32(0xFF21), Fend: int32(0xFF3A), }, 43: { Fstart: int32(0x10400), Fend: int32(0x10427), }, 44: { Fstart: int32(0x104B0), Fend: int32(0x104D3), }, 45: { Fstart: int32(0x10570), Fend: int32(0x1057A), }, 46: { Fstart: int32(0x1057C), Fend: int32(0x1058A), }, 47: { Fstart: int32(0x1058C), Fend: int32(0x10592), }, 48: { Fstart: int32(0x10C80), Fend: int32(0x10CB2), }, 49: { Fstart: int32(0x10D50), Fend: int32(0x10D65), }, 50: { Fstart: int32(0x118A0), Fend: int32(0x118BF), }, 51: { Fstart: int32(0x16E40), Fend: int32(0x16E5F), }, 52: { Fstart: int32(0x1D400), Fend: int32(0x1D419), }, 53: { Fstart: int32(0x1D434), Fend: int32(0x1D44D), }, 54: { Fstart: int32(0x1D468), Fend: int32(0x1D481), }, 55: { Fstart: int32(0x1D4A9), Fend: int32(0x1D4AC), }, 56: { Fstart: int32(0x1D4AE), Fend: int32(0x1D4B5), }, 57: { Fstart: int32(0x1D4D0), Fend: int32(0x1D4E9), }, 58: { Fstart: int32(0x1D507), Fend: int32(0x1D50A), }, 59: { Fstart: int32(0x1D50D), Fend: int32(0x1D514), }, 60: { Fstart: int32(0x1D516), Fend: int32(0x1D51C), }, 61: { Fstart: int32(0x1D53B), Fend: int32(0x1D53E), }, 62: { Fstart: int32(0x1D540), Fend: int32(0x1D544), }, 63: { Fstart: int32(0x1D54A), Fend: int32(0x1D550), }, 64: { Fstart: int32(0x1D56C), Fend: int32(0x1D585), }, 65: { Fstart: int32(0x1D5A0), Fend: int32(0x1D5B9), }, 66: { Fstart: int32(0x1D5D4), Fend: int32(0x1D5ED), }, 67: { Fstart: int32(0x1D608), Fend: int32(0x1D621), }, 68: { Fstart: int32(0x1D63C), Fend: int32(0x1D655), }, 69: { Fstart: int32(0x1D670), Fend: int32(0x1D689), }, 70: { Fstart: int32(0x1D6A8), Fend: int32(0x1D6C0), }, 71: { Fstart: int32(0x1D6E2), Fend: int32(0x1D6FA), }, 72: { Fstart: int32(0x1D71C), Fend: int32(0x1D734), }, 73: { Fstart: int32(0x1D756), Fend: int32(0x1D76E), }, 74: { Fstart: int32(0x1D790), Fend: int32(0x1D7A8), }, 75: { Fstart: int32(0x1E900), Fend: int32(0x1E921), }, } var _upperCharTable = [597]Tchr{ 0: int32(0x100), 1: int32(0x102), 2: int32(0x104), 3: int32(0x106), 4: int32(0x108), 5: int32(0x10A), 6: int32(0x10C), 7: int32(0x10E), 8: int32(0x110), 9: int32(0x112), 10: int32(0x114), 11: int32(0x116), 12: int32(0x118), 13: int32(0x11A), 14: int32(0x11C), 15: int32(0x11E), 16: int32(0x120), 17: int32(0x122), 18: int32(0x124), 19: int32(0x126), 20: int32(0x128), 21: int32(0x12A), 22: int32(0x12C), 23: int32(0x12E), 24: int32(0x130), 25: int32(0x132), 26: int32(0x134), 27: int32(0x136), 28: int32(0x139), 29: int32(0x13B), 30: int32(0x13D), 31: int32(0x13F), 32: int32(0x141), 33: int32(0x143), 34: int32(0x145), 35: int32(0x147), 36: int32(0x14A), 37: int32(0x14C), 38: int32(0x14E), 39: int32(0x150), 40: int32(0x152), 41: int32(0x154), 42: int32(0x156), 43: int32(0x158), 44: int32(0x15A), 45: int32(0x15C), 46: int32(0x15E), 47: int32(0x160), 48: int32(0x162), 49: int32(0x164), 50: int32(0x166), 51: int32(0x168), 52: int32(0x16A), 53: int32(0x16C), 54: int32(0x16E), 55: int32(0x170), 56: int32(0x172), 57: int32(0x174), 58: int32(0x176), 59: int32(0x178), 60: int32(0x179), 61: int32(0x17B), 62: int32(0x17D), 63: int32(0x181), 64: int32(0x182), 65: int32(0x184), 66: int32(0x186), 67: int32(0x187), 68: int32(0x193), 69: int32(0x194), 70: int32(0x19C), 71: int32(0x19D), 72: int32(0x19F), 73: int32(0x1A0), 74: int32(0x1A2), 75: int32(0x1A4), 76: int32(0x1A6), 77: int32(0x1A7), 78: int32(0x1A9), 79: int32(0x1AC), 80: int32(0x1AE), 81: int32(0x1AF), 82: int32(0x1B5), 83: int32(0x1B7), 84: int32(0x1B8), 85: int32(0x1BC), 86: int32(0x1C4), 87: int32(0x1C7), 88: int32(0x1CA), 89: int32(0x1CD), 90: int32(0x1CF), 91: int32(0x1D1), 92: int32(0x1D3), 93: int32(0x1D5), 94: int32(0x1D7), 95: int32(0x1D9), 96: int32(0x1DB), 97: int32(0x1DE), 98: int32(0x1E0), 99: int32(0x1E2), 100: int32(0x1E4), 101: int32(0x1E6), 102: int32(0x1E8), 103: int32(0x1EA), 104: int32(0x1EC), 105: int32(0x1EE), 106: int32(0x1F1), 107: int32(0x1F4), 108: int32(0x1FA), 109: int32(0x1FC), 110: int32(0x1FE), 111: int32(0x200), 112: int32(0x202), 113: int32(0x204), 114: int32(0x206), 115: int32(0x208), 116: int32(0x20A), 117: int32(0x20C), 118: int32(0x20E), 119: int32(0x210), 120: int32(0x212), 121: int32(0x214), 122: int32(0x216), 123: int32(0x218), 124: int32(0x21A), 125: int32(0x21C), 126: int32(0x21E), 127: int32(0x220), 128: int32(0x222), 129: int32(0x224), 130: int32(0x226), 131: int32(0x228), 132: int32(0x22A), 133: int32(0x22C), 134: int32(0x22E), 135: int32(0x230), 136: int32(0x232), 137: int32(0x23A), 138: int32(0x23B), 139: int32(0x23D), 140: int32(0x23E), 141: int32(0x241), 142: int32(0x248), 143: int32(0x24A), 144: int32(0x24C), 145: int32(0x24E), 146: int32(0x370), 147: int32(0x372), 148: int32(0x376), 149: int32(0x37F), 150: int32(0x386), 151: int32(0x38C), 152: int32(0x38E), 153: int32(0x38F), 154: int32(0x3CF), 155: int32(0x3D8), 156: int32(0x3DA), 157: int32(0x3DC), 158: int32(0x3DE), 159: int32(0x3E0), 160: int32(0x3E2), 161: int32(0x3E4), 162: int32(0x3E6), 163: int32(0x3E8), 164: int32(0x3EA), 165: int32(0x3EC), 166: int32(0x3EE), 167: int32(0x3F4), 168: int32(0x3F7), 169: int32(0x3F9), 170: int32(0x3FA), 171: int32(0x460), 172: int32(0x462), 173: int32(0x464), 174: int32(0x466), 175: int32(0x468), 176: int32(0x46A), 177: int32(0x46C), 178: int32(0x46E), 179: int32(0x470), 180: int32(0x472), 181: int32(0x474), 182: int32(0x476), 183: int32(0x478), 184: int32(0x47A), 185: int32(0x47C), 186: int32(0x47E), 187: int32(0x480), 188: int32(0x48A), 189: int32(0x48C), 190: int32(0x48E), 191: int32(0x490), 192: int32(0x492), 193: int32(0x494), 194: int32(0x496), 195: int32(0x498), 196: int32(0x49A), 197: int32(0x49C), 198: int32(0x49E), 199: int32(0x4A0), 200: int32(0x4A2), 201: int32(0x4A4), 202: int32(0x4A6), 203: int32(0x4A8), 204: int32(0x4AA), 205: int32(0x4AC), 206: int32(0x4AE), 207: int32(0x4B0), 208: int32(0x4B2), 209: int32(0x4B4), 210: int32(0x4B6), 211: int32(0x4B8), 212: int32(0x4BA), 213: int32(0x4BC), 214: int32(0x4BE), 215: int32(0x4C0), 216: int32(0x4C1), 217: int32(0x4C3), 218: int32(0x4C5), 219: int32(0x4C7), 220: int32(0x4C9), 221: int32(0x4CB), 222: int32(0x4CD), 223: int32(0x4D0), 224: int32(0x4D2), 225: int32(0x4D4), 226: int32(0x4D6), 227: int32(0x4D8), 228: int32(0x4DA), 229: int32(0x4DC), 230: int32(0x4DE), 231: int32(0x4E0), 232: int32(0x4E2), 233: int32(0x4E4), 234: int32(0x4E6), 235: int32(0x4E8), 236: int32(0x4EA), 237: int32(0x4EC), 238: int32(0x4EE), 239: int32(0x4F0), 240: int32(0x4F2), 241: int32(0x4F4), 242: int32(0x4F6), 243: int32(0x4F8), 244: int32(0x4FA), 245: int32(0x4FC), 246: int32(0x4FE), 247: int32(0x500), 248: int32(0x502), 249: int32(0x504), 250: int32(0x506), 251: int32(0x508), 252: int32(0x50A), 253: int32(0x50C), 254: int32(0x50E), 255: int32(0x510), 256: int32(0x512), 257: int32(0x514), 258: int32(0x516), 259: int32(0x518), 260: int32(0x51A), 261: int32(0x51C), 262: int32(0x51E), 263: int32(0x520), 264: int32(0x522), 265: int32(0x524), 266: int32(0x526), 267: int32(0x528), 268: int32(0x52A), 269: int32(0x52C), 270: int32(0x52E), 271: int32(0x10C7), 272: int32(0x10CD), 273: int32(0x1C89), 274: int32(0x1E00), 275: int32(0x1E02), 276: int32(0x1E04), 277: int32(0x1E06), 278: int32(0x1E08), 279: int32(0x1E0A), 280: int32(0x1E0C), 281: int32(0x1E0E), 282: int32(0x1E10), 283: int32(0x1E12), 284: int32(0x1E14), 285: int32(0x1E16), 286: int32(0x1E18), 287: int32(0x1E1A), 288: int32(0x1E1C), 289: int32(0x1E1E), 290: int32(0x1E20), 291: int32(0x1E22), 292: int32(0x1E24), 293: int32(0x1E26), 294: int32(0x1E28), 295: int32(0x1E2A), 296: int32(0x1E2C), 297: int32(0x1E2E), 298: int32(0x1E30), 299: int32(0x1E32), 300: int32(0x1E34), 301: int32(0x1E36), 302: int32(0x1E38), 303: int32(0x1E3A), 304: int32(0x1E3C), 305: int32(0x1E3E), 306: int32(0x1E40), 307: int32(0x1E42), 308: int32(0x1E44), 309: int32(0x1E46), 310: int32(0x1E48), 311: int32(0x1E4A), 312: int32(0x1E4C), 313: int32(0x1E4E), 314: int32(0x1E50), 315: int32(0x1E52), 316: int32(0x1E54), 317: int32(0x1E56), 318: int32(0x1E58), 319: int32(0x1E5A), 320: int32(0x1E5C), 321: int32(0x1E5E), 322: int32(0x1E60), 323: int32(0x1E62), 324: int32(0x1E64), 325: int32(0x1E66), 326: int32(0x1E68), 327: int32(0x1E6A), 328: int32(0x1E6C), 329: int32(0x1E6E), 330: int32(0x1E70), 331: int32(0x1E72), 332: int32(0x1E74), 333: int32(0x1E76), 334: int32(0x1E78), 335: int32(0x1E7A), 336: int32(0x1E7C), 337: int32(0x1E7E), 338: int32(0x1E80), 339: int32(0x1E82), 340: int32(0x1E84), 341: int32(0x1E86), 342: int32(0x1E88), 343: int32(0x1E8A), 344: int32(0x1E8C), 345: int32(0x1E8E), 346: int32(0x1E90), 347: int32(0x1E92), 348: int32(0x1E94), 349: int32(0x1E9E), 350: int32(0x1EA0), 351: int32(0x1EA2), 352: int32(0x1EA4), 353: int32(0x1EA6), 354: int32(0x1EA8), 355: int32(0x1EAA), 356: int32(0x1EAC), 357: int32(0x1EAE), 358: int32(0x1EB0), 359: int32(0x1EB2), 360: int32(0x1EB4), 361: int32(0x1EB6), 362: int32(0x1EB8), 363: int32(0x1EBA), 364: int32(0x1EBC), 365: int32(0x1EBE), 366: int32(0x1EC0), 367: int32(0x1EC2), 368: int32(0x1EC4), 369: int32(0x1EC6), 370: int32(0x1EC8), 371: int32(0x1ECA), 372: int32(0x1ECC), 373: int32(0x1ECE), 374: int32(0x1ED0), 375: int32(0x1ED2), 376: int32(0x1ED4), 377: int32(0x1ED6), 378: int32(0x1ED8), 379: int32(0x1EDA), 380: int32(0x1EDC), 381: int32(0x1EDE), 382: int32(0x1EE0), 383: int32(0x1EE2), 384: int32(0x1EE4), 385: int32(0x1EE6), 386: int32(0x1EE8), 387: int32(0x1EEA), 388: int32(0x1EEC), 389: int32(0x1EEE), 390: int32(0x1EF0), 391: int32(0x1EF2), 392: int32(0x1EF4), 393: int32(0x1EF6), 394: int32(0x1EF8), 395: int32(0x1EFA), 396: int32(0x1EFC), 397: int32(0x1EFE), 398: int32(0x1F59), 399: int32(0x1F5B), 400: int32(0x1F5D), 401: int32(0x1F5F), 402: int32(0x2102), 403: int32(0x2107), 404: int32(0x2115), 405: int32(0x2124), 406: int32(0x2126), 407: int32(0x2128), 408: int32(0x213E), 409: int32(0x213F), 410: int32(0x2145), 411: int32(0x2183), 412: int32(0x2C60), 413: int32(0x2C67), 414: int32(0x2C69), 415: int32(0x2C6B), 416: int32(0x2C72), 417: int32(0x2C75), 418: int32(0x2C82), 419: int32(0x2C84), 420: int32(0x2C86), 421: int32(0x2C88), 422: int32(0x2C8A), 423: int32(0x2C8C), 424: int32(0x2C8E), 425: int32(0x2C90), 426: int32(0x2C92), 427: int32(0x2C94), 428: int32(0x2C96), 429: int32(0x2C98), 430: int32(0x2C9A), 431: int32(0x2C9C), 432: int32(0x2C9E), 433: int32(0x2CA0), 434: int32(0x2CA2), 435: int32(0x2CA4), 436: int32(0x2CA6), 437: int32(0x2CA8), 438: int32(0x2CAA), 439: int32(0x2CAC), 440: int32(0x2CAE), 441: int32(0x2CB0), 442: int32(0x2CB2), 443: int32(0x2CB4), 444: int32(0x2CB6), 445: int32(0x2CB8), 446: int32(0x2CBA), 447: int32(0x2CBC), 448: int32(0x2CBE), 449: int32(0x2CC0), 450: int32(0x2CC2), 451: int32(0x2CC4), 452: int32(0x2CC6), 453: int32(0x2CC8), 454: int32(0x2CCA), 455: int32(0x2CCC), 456: int32(0x2CCE), 457: int32(0x2CD0), 458: int32(0x2CD2), 459: int32(0x2CD4), 460: int32(0x2CD6), 461: int32(0x2CD8), 462: int32(0x2CDA), 463: int32(0x2CDC), 464: int32(0x2CDE), 465: int32(0x2CE0), 466: int32(0x2CE2), 467: int32(0x2CEB), 468: int32(0x2CED), 469: int32(0x2CF2), 470: int32(0xA640), 471: int32(0xA642), 472: int32(0xA644), 473: int32(0xA646), 474: int32(0xA648), 475: int32(0xA64A), 476: int32(0xA64C), 477: int32(0xA64E), 478: int32(0xA650), 479: int32(0xA652), 480: int32(0xA654), 481: int32(0xA656), 482: int32(0xA658), 483: int32(0xA65A), 484: int32(0xA65C), 485: int32(0xA65E), 486: int32(0xA660), 487: int32(0xA662), 488: int32(0xA664), 489: int32(0xA666), 490: int32(0xA668), 491: int32(0xA66A), 492: int32(0xA66C), 493: int32(0xA680), 494: int32(0xA682), 495: int32(0xA684), 496: int32(0xA686), 497: int32(0xA688), 498: int32(0xA68A), 499: int32(0xA68C), 500: int32(0xA68E), 501: int32(0xA690), 502: int32(0xA692), 503: int32(0xA694), 504: int32(0xA696), 505: int32(0xA698), 506: int32(0xA69A), 507: int32(0xA722), 508: int32(0xA724), 509: int32(0xA726), 510: int32(0xA728), 511: int32(0xA72A), 512: int32(0xA72C), 513: int32(0xA72E), 514: int32(0xA732), 515: int32(0xA734), 516: int32(0xA736), 517: int32(0xA738), 518: int32(0xA73A), 519: int32(0xA73C), 520: int32(0xA73E), 521: int32(0xA740), 522: int32(0xA742), 523: int32(0xA744), 524: int32(0xA746), 525: int32(0xA748), 526: int32(0xA74A), 527: int32(0xA74C), 528: int32(0xA74E), 529: int32(0xA750), 530: int32(0xA752), 531: int32(0xA754), 532: int32(0xA756), 533: int32(0xA758), 534: int32(0xA75A), 535: int32(0xA75C), 536: int32(0xA75E), 537: int32(0xA760), 538: int32(0xA762), 539: int32(0xA764), 540: int32(0xA766), 541: int32(0xA768), 542: int32(0xA76A), 543: int32(0xA76C), 544: int32(0xA76E), 545: int32(0xA779), 546: int32(0xA77B), 547: int32(0xA77D), 548: int32(0xA77E), 549: int32(0xA780), 550: int32(0xA782), 551: int32(0xA784), 552: int32(0xA786), 553: int32(0xA78B), 554: int32(0xA78D), 555: int32(0xA790), 556: int32(0xA792), 557: int32(0xA796), 558: int32(0xA798), 559: int32(0xA79A), 560: int32(0xA79C), 561: int32(0xA79E), 562: int32(0xA7A0), 563: int32(0xA7A2), 564: int32(0xA7A4), 565: int32(0xA7A6), 566: int32(0xA7A8), 567: int32(0xA7B6), 568: int32(0xA7B8), 569: int32(0xA7BA), 570: int32(0xA7BC), 571: int32(0xA7BE), 572: int32(0xA7C0), 573: int32(0xA7C2), 574: int32(0xA7C9), 575: int32(0xA7CB), 576: int32(0xA7CC), 577: int32(0xA7D0), 578: int32(0xA7D6), 579: int32(0xA7D8), 580: int32(0xA7DA), 581: int32(0xA7DC), 582: int32(0xA7F5), 583: int32(0x10594), 584: int32(0x10595), 585: int32(0x1D49C), 586: int32(0x1D49E), 587: int32(0x1D49F), 588: int32(0x1D4A2), 589: int32(0x1D4A5), 590: int32(0x1D4A6), 591: int32(0x1D504), 592: int32(0x1D505), 593: int32(0x1D538), 594: int32(0x1D539), 595: int32(0x1D546), 596: int32(0x1D7CA), } /* * Unicode: unicode print characters excluding space. */ var _graphRangeTable = [605]Tcrange{ 0: { Fstart: int32(0x21), Fend: int32(0x7E), }, 1: { Fstart: int32(0xA1), Fend: int32(0xAC), }, 2: { Fstart: int32(0xAE), Fend: int32(0x377), }, 3: { Fstart: int32(0x37A), Fend: int32(0x37F), }, 4: { Fstart: int32(0x384), Fend: int32(0x38A), }, 5: { Fstart: int32(0x38E), Fend: int32(0x3A1), }, 6: { Fstart: int32(0x3A3), Fend: int32(0x52F), }, 7: { Fstart: int32(0x531), Fend: int32(0x556), }, 8: { Fstart: int32(0x559), Fend: int32(0x58A), }, 9: { Fstart: int32(0x58D), Fend: int32(0x58F), }, 10: { Fstart: int32(0x591), Fend: int32(0x5C7), }, 11: { Fstart: int32(0x5D0), Fend: int32(0x5EA), }, 12: { Fstart: int32(0x5EF), Fend: int32(0x5F4), }, 13: { Fstart: int32(0x606), Fend: int32(0x61B), }, 14: { Fstart: int32(0x61D), Fend: int32(0x6DC), }, 15: { Fstart: int32(0x6DE), Fend: int32(0x70D), }, 16: { Fstart: int32(0x710), Fend: int32(0x74A), }, 17: { Fstart: int32(0x74D), Fend: int32(0x7B1), }, 18: { Fstart: int32(0x7C0), Fend: int32(0x7FA), }, 19: { Fstart: int32(0x7FD), Fend: int32(0x82D), }, 20: { Fstart: int32(0x830), Fend: int32(0x83E), }, 21: { Fstart: int32(0x840), Fend: int32(0x85B), }, 22: { Fstart: int32(0x860), Fend: int32(0x86A), }, 23: { Fstart: int32(0x870), Fend: int32(0x88E), }, 24: { Fstart: int32(0x897), Fend: int32(0x8E1), }, 25: { Fstart: int32(0x8E3), Fend: int32(0x983), }, 26: { Fstart: int32(0x985), Fend: int32(0x98C), }, 27: { Fstart: int32(0x993), Fend: int32(0x9A8), }, 28: { Fstart: int32(0x9AA), Fend: int32(0x9B0), }, 29: { Fstart: int32(0x9B6), Fend: int32(0x9B9), }, 30: { Fstart: int32(0x9BC), Fend: int32(0x9C4), }, 31: { Fstart: int32(0x9CB), Fend: int32(0x9CE), }, 32: { Fstart: int32(0x9DF), Fend: int32(0x9E3), }, 33: { Fstart: int32(0x9E6), Fend: int32(0x9FE), }, 34: { Fstart: int32(0xA01), Fend: int32(0xA03), }, 35: { Fstart: int32(0xA05), Fend: int32(0xA0A), }, 36: { Fstart: int32(0xA13), Fend: int32(0xA28), }, 37: { Fstart: int32(0xA2A), Fend: int32(0xA30), }, 38: { Fstart: int32(0xA3E), Fend: int32(0xA42), }, 39: { Fstart: int32(0xA4B), Fend: int32(0xA4D), }, 40: { Fstart: int32(0xA59), Fend: int32(0xA5C), }, 41: { Fstart: int32(0xA66), Fend: int32(0xA76), }, 42: { Fstart: int32(0xA81), Fend: int32(0xA83), }, 43: { Fstart: int32(0xA85), Fend: int32(0xA8D), }, 44: { Fstart: int32(0xA8F), Fend: int32(0xA91), }, 45: { Fstart: int32(0xA93), Fend: int32(0xAA8), }, 46: { Fstart: int32(0xAAA), Fend: int32(0xAB0), }, 47: { Fstart: int32(0xAB5), Fend: int32(0xAB9), }, 48: { Fstart: int32(0xABC), Fend: int32(0xAC5), }, 49: { Fstart: int32(0xAC7), Fend: int32(0xAC9), }, 50: { Fstart: int32(0xACB), Fend: int32(0xACD), }, 51: { Fstart: int32(0xAE0), Fend: int32(0xAE3), }, 52: { Fstart: int32(0xAE6), Fend: int32(0xAF1), }, 53: { Fstart: int32(0xAF9), Fend: int32(0xAFF), }, 54: { Fstart: int32(0xB01), Fend: int32(0xB03), }, 55: { Fstart: int32(0xB05), Fend: int32(0xB0C), }, 56: { Fstart: int32(0xB13), Fend: int32(0xB28), }, 57: { Fstart: int32(0xB2A), Fend: int32(0xB30), }, 58: { Fstart: int32(0xB35), Fend: int32(0xB39), }, 59: { Fstart: int32(0xB3C), Fend: int32(0xB44), }, 60: { Fstart: int32(0xB4B), Fend: int32(0xB4D), }, 61: { Fstart: int32(0xB55), Fend: int32(0xB57), }, 62: { Fstart: int32(0xB5F), Fend: int32(0xB63), }, 63: { Fstart: int32(0xB66), Fend: int32(0xB77), }, 64: { Fstart: int32(0xB85), Fend: int32(0xB8A), }, 65: { Fstart: int32(0xB8E), Fend: int32(0xB90), }, 66: { Fstart: int32(0xB92), Fend: int32(0xB95), }, 67: { Fstart: int32(0xBA8), Fend: int32(0xBAA), }, 68: { Fstart: int32(0xBAE), Fend: int32(0xBB9), }, 69: { Fstart: int32(0xBBE), Fend: int32(0xBC2), }, 70: { Fstart: int32(0xBC6), Fend: int32(0xBC8), }, 71: { Fstart: int32(0xBCA), Fend: int32(0xBCD), }, 72: { Fstart: int32(0xBE6), Fend: int32(0xBFA), }, 73: { Fstart: int32(0xC00), Fend: int32(0xC0C), }, 74: { Fstart: int32(0xC0E), Fend: int32(0xC10), }, 75: { Fstart: int32(0xC12), Fend: int32(0xC28), }, 76: { Fstart: int32(0xC2A), Fend: int32(0xC39), }, 77: { Fstart: int32(0xC3C), Fend: int32(0xC44), }, 78: { Fstart: int32(0xC46), Fend: int32(0xC48), }, 79: { Fstart: int32(0xC4A), Fend: int32(0xC4D), }, 80: { Fstart: int32(0xC58), Fend: int32(0xC5A), }, 81: { Fstart: int32(0xC60), Fend: int32(0xC63), }, 82: { Fstart: int32(0xC66), Fend: int32(0xC6F), }, 83: { Fstart: int32(0xC77), Fend: int32(0xC8C), }, 84: { Fstart: int32(0xC8E), Fend: int32(0xC90), }, 85: { Fstart: int32(0xC92), Fend: int32(0xCA8), }, 86: { Fstart: int32(0xCAA), Fend: int32(0xCB3), }, 87: { Fstart: int32(0xCB5), Fend: int32(0xCB9), }, 88: { Fstart: int32(0xCBC), Fend: int32(0xCC4), }, 89: { Fstart: int32(0xCC6), Fend: int32(0xCC8), }, 90: { Fstart: int32(0xCCA), Fend: int32(0xCCD), }, 91: { Fstart: int32(0xCE0), Fend: int32(0xCE3), }, 92: { Fstart: int32(0xCE6), Fend: int32(0xCEF), }, 93: { Fstart: int32(0xCF1), Fend: int32(0xCF3), }, 94: { Fstart: int32(0xD00), Fend: int32(0xD0C), }, 95: { Fstart: int32(0xD0E), Fend: int32(0xD10), }, 96: { Fstart: int32(0xD12), Fend: int32(0xD44), }, 97: { Fstart: int32(0xD46), Fend: int32(0xD48), }, 98: { Fstart: int32(0xD4A), Fend: int32(0xD4F), }, 99: { Fstart: int32(0xD54), Fend: int32(0xD63), }, 100: { Fstart: int32(0xD66), Fend: int32(0xD7F), }, 101: { Fstart: int32(0xD81), Fend: int32(0xD83), }, 102: { Fstart: int32(0xD85), Fend: int32(0xD96), }, 103: { Fstart: int32(0xD9A), Fend: int32(0xDB1), }, 104: { Fstart: int32(0xDB3), Fend: int32(0xDBB), }, 105: { Fstart: int32(0xDC0), Fend: int32(0xDC6), }, 106: { Fstart: int32(0xDCF), Fend: int32(0xDD4), }, 107: { Fstart: int32(0xDD8), Fend: int32(0xDDF), }, 108: { Fstart: int32(0xDE6), Fend: int32(0xDEF), }, 109: { Fstart: int32(0xDF2), Fend: int32(0xDF4), }, 110: { Fstart: int32(0xE01), Fend: int32(0xE3A), }, 111: { Fstart: int32(0xE3F), Fend: int32(0xE5B), }, 112: { Fstart: int32(0xE86), Fend: int32(0xE8A), }, 113: { Fstart: int32(0xE8C), Fend: int32(0xEA3), }, 114: { Fstart: int32(0xEA7), Fend: int32(0xEBD), }, 115: { Fstart: int32(0xEC0), Fend: int32(0xEC4), }, 116: { Fstart: int32(0xEC8), Fend: int32(0xECE), }, 117: { Fstart: int32(0xED0), Fend: int32(0xED9), }, 118: { Fstart: int32(0xEDC), Fend: int32(0xEDF), }, 119: { Fstart: int32(0xF00), Fend: int32(0xF47), }, 120: { Fstart: int32(0xF49), Fend: int32(0xF6C), }, 121: { Fstart: int32(0xF71), Fend: int32(0xF97), }, 122: { Fstart: int32(0xF99), Fend: int32(0xFBC), }, 123: { Fstart: int32(0xFBE), Fend: int32(0xFCC), }, 124: { Fstart: int32(0xFCE), Fend: int32(0xFDA), }, 125: { Fstart: int32(0x1000), Fend: int32(0x10C5), }, 126: { Fstart: int32(0x10D0), Fend: int32(0x1248), }, 127: { Fstart: int32(0x124A), Fend: int32(0x124D), }, 128: { Fstart: int32(0x1250), Fend: int32(0x1256), }, 129: { Fstart: int32(0x125A), Fend: int32(0x125D), }, 130: { Fstart: int32(0x1260), Fend: int32(0x1288), }, 131: { Fstart: int32(0x128A), Fend: int32(0x128D), }, 132: { Fstart: int32(0x1290), Fend: int32(0x12B0), }, 133: { Fstart: int32(0x12B2), Fend: int32(0x12B5), }, 134: { Fstart: int32(0x12B8), Fend: int32(0x12BE), }, 135: { Fstart: int32(0x12C2), Fend: int32(0x12C5), }, 136: { Fstart: int32(0x12C8), Fend: int32(0x12D6), }, 137: { Fstart: int32(0x12D8), Fend: int32(0x1310), }, 138: { Fstart: int32(0x1312), Fend: int32(0x1315), }, 139: { Fstart: int32(0x1318), Fend: int32(0x135A), }, 140: { Fstart: int32(0x135D), Fend: int32(0x137C), }, 141: { Fstart: int32(0x1380), Fend: int32(0x1399), }, 142: { Fstart: int32(0x13A0), Fend: int32(0x13F5), }, 143: { Fstart: int32(0x13F8), Fend: int32(0x13FD), }, 144: { Fstart: int32(0x1400), Fend: int32(0x167F), }, 145: { Fstart: int32(0x1681), Fend: int32(0x169C), }, 146: { Fstart: int32(0x16A0), Fend: int32(0x16F8), }, 147: { Fstart: int32(0x1700), Fend: int32(0x1715), }, 148: { Fstart: int32(0x171F), Fend: int32(0x1736), }, 149: { Fstart: int32(0x1740), Fend: int32(0x1753), }, 150: { Fstart: int32(0x1760), Fend: int32(0x176C), }, 151: { Fstart: int32(0x176E), Fend: int32(0x1770), }, 152: { Fstart: int32(0x1780), Fend: int32(0x17DD), }, 153: { Fstart: int32(0x17E0), Fend: int32(0x17E9), }, 154: { Fstart: int32(0x17F0), Fend: int32(0x17F9), }, 155: { Fstart: int32(0x1800), Fend: int32(0x180D), }, 156: { Fstart: int32(0x180F), Fend: int32(0x1819), }, 157: { Fstart: int32(0x1820), Fend: int32(0x1878), }, 158: { Fstart: int32(0x1880), Fend: int32(0x18AA), }, 159: { Fstart: int32(0x18B0), Fend: int32(0x18F5), }, 160: { Fstart: int32(0x1900), Fend: int32(0x191E), }, 161: { Fstart: int32(0x1920), Fend: int32(0x192B), }, 162: { Fstart: int32(0x1930), Fend: int32(0x193B), }, 163: { Fstart: int32(0x1944), Fend: int32(0x196D), }, 164: { Fstart: int32(0x1970), Fend: int32(0x1974), }, 165: { Fstart: int32(0x1980), Fend: int32(0x19AB), }, 166: { Fstart: int32(0x19B0), Fend: int32(0x19C9), }, 167: { Fstart: int32(0x19D0), Fend: int32(0x19DA), }, 168: { Fstart: int32(0x19DE), Fend: int32(0x1A1B), }, 169: { Fstart: int32(0x1A1E), Fend: int32(0x1A5E), }, 170: { Fstart: int32(0x1A60), Fend: int32(0x1A7C), }, 171: { Fstart: int32(0x1A7F), Fend: int32(0x1A89), }, 172: { Fstart: int32(0x1A90), Fend: int32(0x1A99), }, 173: { Fstart: int32(0x1AA0), Fend: int32(0x1AAD), }, 174: { Fstart: int32(0x1AB0), Fend: int32(0x1ACE), }, 175: { Fstart: int32(0x1B00), Fend: int32(0x1B4C), }, 176: { Fstart: int32(0x1B4E), Fend: int32(0x1BF3), }, 177: { Fstart: int32(0x1BFC), Fend: int32(0x1C37), }, 178: { Fstart: int32(0x1C3B), Fend: int32(0x1C49), }, 179: { Fstart: int32(0x1C4D), Fend: int32(0x1C8A), }, 180: { Fstart: int32(0x1C90), Fend: int32(0x1CBA), }, 181: { Fstart: int32(0x1CBD), Fend: int32(0x1CC7), }, 182: { Fstart: int32(0x1CD0), Fend: int32(0x1CFA), }, 183: { Fstart: int32(0x1D00), Fend: int32(0x1F15), }, 184: { Fstart: int32(0x1F18), Fend: int32(0x1F1D), }, 185: { Fstart: int32(0x1F20), Fend: int32(0x1F45), }, 186: { Fstart: int32(0x1F48), Fend: int32(0x1F4D), }, 187: { Fstart: int32(0x1F50), Fend: int32(0x1F57), }, 188: { Fstart: int32(0x1F5F), Fend: int32(0x1F7D), }, 189: { Fstart: int32(0x1F80), Fend: int32(0x1FB4), }, 190: { Fstart: int32(0x1FB6), Fend: int32(0x1FC4), }, 191: { Fstart: int32(0x1FC6), Fend: int32(0x1FD3), }, 192: { Fstart: int32(0x1FD6), Fend: int32(0x1FDB), }, 193: { Fstart: int32(0x1FDD), Fend: int32(0x1FEF), }, 194: { Fstart: int32(0x1FF2), Fend: int32(0x1FF4), }, 195: { Fstart: int32(0x1FF6), Fend: int32(0x1FFE), }, 196: { Fstart: int32(0x2010), Fend: int32(0x2027), }, 197: { Fstart: int32(0x2030), Fend: int32(0x205E), }, 198: { Fstart: int32(0x2074), Fend: int32(0x208E), }, 199: { Fstart: int32(0x2090), Fend: int32(0x209C), }, 200: { Fstart: int32(0x20A0), Fend: int32(0x20C0), }, 201: { Fstart: int32(0x20D0), Fend: int32(0x20F0), }, 202: { Fstart: int32(0x2100), Fend: int32(0x218B), }, 203: { Fstart: int32(0x2190), Fend: int32(0x2429), }, 204: { Fstart: int32(0x2440), Fend: int32(0x244A), }, 205: { Fstart: int32(0x2460), Fend: int32(0x2B73), }, 206: { Fstart: int32(0x2B76), Fend: int32(0x2B95), }, 207: { Fstart: int32(0x2B97), Fend: int32(0x2CF3), }, 208: { Fstart: int32(0x2CF9), Fend: int32(0x2D25), }, 209: { Fstart: int32(0x2D30), Fend: int32(0x2D67), }, 210: { Fstart: int32(0x2D7F), Fend: int32(0x2D96), }, 211: { Fstart: int32(0x2DA0), Fend: int32(0x2DA6), }, 212: { Fstart: int32(0x2DA8), Fend: int32(0x2DAE), }, 213: { Fstart: int32(0x2DB0), Fend: int32(0x2DB6), }, 214: { Fstart: int32(0x2DB8), Fend: int32(0x2DBE), }, 215: { Fstart: int32(0x2DC0), Fend: int32(0x2DC6), }, 216: { Fstart: int32(0x2DC8), Fend: int32(0x2DCE), }, 217: { Fstart: int32(0x2DD0), Fend: int32(0x2DD6), }, 218: { Fstart: int32(0x2DD8), Fend: int32(0x2DDE), }, 219: { Fstart: int32(0x2DE0), Fend: int32(0x2E5D), }, 220: { Fstart: int32(0x2E80), Fend: int32(0x2E99), }, 221: { Fstart: int32(0x2E9B), Fend: int32(0x2EF3), }, 222: { Fstart: int32(0x2F00), Fend: int32(0x2FD5), }, 223: { Fstart: int32(0x2FF0), Fend: int32(0x2FFF), }, 224: { Fstart: int32(0x3001), Fend: int32(0x303F), }, 225: { Fstart: int32(0x3041), Fend: int32(0x3096), }, 226: { Fstart: int32(0x3099), Fend: int32(0x30FF), }, 227: { Fstart: int32(0x3105), Fend: int32(0x312F), }, 228: { Fstart: int32(0x3131), Fend: int32(0x318E), }, 229: { Fstart: int32(0x3190), Fend: int32(0x31E5), }, 230: { Fstart: int32(0x31EF), Fend: int32(0x321E), }, 231: { Fstart: int32(0x3220), Fend: int32(0xA48C), }, 232: { Fstart: int32(0xA490), Fend: int32(0xA4C6), }, 233: { Fstart: int32(0xA4D0), Fend: int32(0xA62B), }, 234: { Fstart: int32(0xA640), Fend: int32(0xA6F7), }, 235: { Fstart: int32(0xA700), Fend: int32(0xA7CD), }, 236: { Fstart: int32(0xA7D5), Fend: int32(0xA7DC), }, 237: { Fstart: int32(0xA7F2), Fend: int32(0xA82C), }, 238: { Fstart: int32(0xA830), Fend: int32(0xA839), }, 239: { Fstart: int32(0xA840), Fend: int32(0xA877), }, 240: { Fstart: int32(0xA880), Fend: int32(0xA8C5), }, 241: { Fstart: int32(0xA8CE), Fend: int32(0xA8D9), }, 242: { Fstart: int32(0xA8E0), Fend: int32(0xA953), }, 243: { Fstart: int32(0xA95F), Fend: int32(0xA97C), }, 244: { Fstart: int32(0xA980), Fend: int32(0xA9CD), }, 245: { Fstart: int32(0xA9CF), Fend: int32(0xA9D9), }, 246: { Fstart: int32(0xA9DE), Fend: int32(0xA9FE), }, 247: { Fstart: int32(0xAA00), Fend: int32(0xAA36), }, 248: { Fstart: int32(0xAA40), Fend: int32(0xAA4D), }, 249: { Fstart: int32(0xAA50), Fend: int32(0xAA59), }, 250: { Fstart: int32(0xAA5C), Fend: int32(0xAAC2), }, 251: { Fstart: int32(0xAADB), Fend: int32(0xAAF6), }, 252: { Fstart: int32(0xAB01), Fend: int32(0xAB06), }, 253: { Fstart: int32(0xAB09), Fend: int32(0xAB0E), }, 254: { Fstart: int32(0xAB11), Fend: int32(0xAB16), }, 255: { Fstart: int32(0xAB20), Fend: int32(0xAB26), }, 256: { Fstart: int32(0xAB28), Fend: int32(0xAB2E), }, 257: { Fstart: int32(0xAB30), Fend: int32(0xAB6B), }, 258: { Fstart: int32(0xAB70), Fend: int32(0xABED), }, 259: { Fstart: int32(0xABF0), Fend: int32(0xABF9), }, 260: { Fstart: int32(0xAC00), Fend: int32(0xD7A3), }, 261: { Fstart: int32(0xD7B0), Fend: int32(0xD7C6), }, 262: { Fstart: int32(0xD7CB), Fend: int32(0xD7FB), }, 263: { Fstart: int32(0xF900), Fend: int32(0xFA6D), }, 264: { Fstart: int32(0xFA70), Fend: int32(0xFAD9), }, 265: { Fstart: int32(0xFB00), Fend: int32(0xFB06), }, 266: { Fstart: int32(0xFB13), Fend: int32(0xFB17), }, 267: { Fstart: int32(0xFB1D), Fend: int32(0xFB36), }, 268: { Fstart: int32(0xFB38), Fend: int32(0xFB3C), }, 269: { Fstart: int32(0xFB46), Fend: int32(0xFBC2), }, 270: { Fstart: int32(0xFBD3), Fend: int32(0xFD8F), }, 271: { Fstart: int32(0xFD92), Fend: int32(0xFDC7), }, 272: { Fstart: int32(0xFDF0), Fend: int32(0xFE19), }, 273: { Fstart: int32(0xFE20), Fend: int32(0xFE52), }, 274: { Fstart: int32(0xFE54), Fend: int32(0xFE66), }, 275: { Fstart: int32(0xFE68), Fend: int32(0xFE6B), }, 276: { Fstart: int32(0xFE70), Fend: int32(0xFE74), }, 277: { Fstart: int32(0xFE76), Fend: int32(0xFEFC), }, 278: { Fstart: int32(0xFF01), Fend: int32(0xFFBE), }, 279: { Fstart: int32(0xFFC2), Fend: int32(0xFFC7), }, 280: { Fstart: int32(0xFFCA), Fend: int32(0xFFCF), }, 281: { Fstart: int32(0xFFD2), Fend: int32(0xFFD7), }, 282: { Fstart: int32(0xFFDA), Fend: int32(0xFFDC), }, 283: { Fstart: int32(0xFFE0), Fend: int32(0xFFE6), }, 284: { Fstart: int32(0xFFE8), Fend: int32(0xFFEE), }, 285: { Fstart: int32(0x10000), Fend: int32(0x1000B), }, 286: { Fstart: int32(0x1000D), Fend: int32(0x10026), }, 287: { Fstart: int32(0x10028), Fend: int32(0x1003A), }, 288: { Fstart: int32(0x1003F), Fend: int32(0x1004D), }, 289: { Fstart: int32(0x10050), Fend: int32(0x1005D), }, 290: { Fstart: int32(0x10080), Fend: int32(0x100FA), }, 291: { Fstart: int32(0x10100), Fend: int32(0x10102), }, 292: { Fstart: int32(0x10107), Fend: int32(0x10133), }, 293: { Fstart: int32(0x10137), Fend: int32(0x1018E), }, 294: { Fstart: int32(0x10190), Fend: int32(0x1019C), }, 295: { Fstart: int32(0x101D0), Fend: int32(0x101FD), }, 296: { Fstart: int32(0x10280), Fend: int32(0x1029C), }, 297: { Fstart: int32(0x102A0), Fend: int32(0x102D0), }, 298: { Fstart: int32(0x102E0), Fend: int32(0x102FB), }, 299: { Fstart: int32(0x10300), Fend: int32(0x10323), }, 300: { Fstart: int32(0x1032D), Fend: int32(0x1034A), }, 301: { Fstart: int32(0x10350), Fend: int32(0x1037A), }, 302: { Fstart: int32(0x10380), Fend: int32(0x1039D), }, 303: { Fstart: int32(0x1039F), Fend: int32(0x103C3), }, 304: { Fstart: int32(0x103C8), Fend: int32(0x103D5), }, 305: { Fstart: int32(0x10400), Fend: int32(0x1049D), }, 306: { Fstart: int32(0x104A0), Fend: int32(0x104A9), }, 307: { Fstart: int32(0x104B0), Fend: int32(0x104D3), }, 308: { Fstart: int32(0x104D8), Fend: int32(0x104FB), }, 309: { Fstart: int32(0x10500), Fend: int32(0x10527), }, 310: { Fstart: int32(0x10530), Fend: int32(0x10563), }, 311: { Fstart: int32(0x1056F), Fend: int32(0x1057A), }, 312: { Fstart: int32(0x1057C), Fend: int32(0x1058A), }, 313: { Fstart: int32(0x1058C), Fend: int32(0x10592), }, 314: { Fstart: int32(0x10597), Fend: int32(0x105A1), }, 315: { Fstart: int32(0x105A3), Fend: int32(0x105B1), }, 316: { Fstart: int32(0x105B3), Fend: int32(0x105B9), }, 317: { Fstart: int32(0x105C0), Fend: int32(0x105F3), }, 318: { Fstart: int32(0x10600), Fend: int32(0x10736), }, 319: { Fstart: int32(0x10740), Fend: int32(0x10755), }, 320: { Fstart: int32(0x10760), Fend: int32(0x10767), }, 321: { Fstart: int32(0x10780), Fend: int32(0x10785), }, 322: { Fstart: int32(0x10787), Fend: int32(0x107B0), }, 323: { Fstart: int32(0x107B2), Fend: int32(0x107BA), }, 324: { Fstart: int32(0x10800), Fend: int32(0x10805), }, 325: { Fstart: int32(0x1080A), Fend: int32(0x10835), }, 326: { Fstart: int32(0x1083F), Fend: int32(0x10855), }, 327: { Fstart: int32(0x10857), Fend: int32(0x1089E), }, 328: { Fstart: int32(0x108A7), Fend: int32(0x108AF), }, 329: { Fstart: int32(0x108E0), Fend: int32(0x108F2), }, 330: { Fstart: int32(0x108FB), Fend: int32(0x1091B), }, 331: { Fstart: int32(0x1091F), Fend: int32(0x10939), }, 332: { Fstart: int32(0x10980), Fend: int32(0x109B7), }, 333: { Fstart: int32(0x109BC), Fend: int32(0x109CF), }, 334: { Fstart: int32(0x109D2), Fend: int32(0x10A03), }, 335: { Fstart: int32(0x10A0C), Fend: int32(0x10A13), }, 336: { Fstart: int32(0x10A15), Fend: int32(0x10A17), }, 337: { Fstart: int32(0x10A19), Fend: int32(0x10A35), }, 338: { Fstart: int32(0x10A38), Fend: int32(0x10A3A), }, 339: { Fstart: int32(0x10A3F), Fend: int32(0x10A48), }, 340: { Fstart: int32(0x10A50), Fend: int32(0x10A58), }, 341: { Fstart: int32(0x10A60), Fend: int32(0x10A9F), }, 342: { Fstart: int32(0x10AC0), Fend: int32(0x10AE6), }, 343: { Fstart: int32(0x10AEB), Fend: int32(0x10AF6), }, 344: { Fstart: int32(0x10B00), Fend: int32(0x10B35), }, 345: { Fstart: int32(0x10B39), Fend: int32(0x10B55), }, 346: { Fstart: int32(0x10B58), Fend: int32(0x10B72), }, 347: { Fstart: int32(0x10B78), Fend: int32(0x10B91), }, 348: { Fstart: int32(0x10B99), Fend: int32(0x10B9C), }, 349: { Fstart: int32(0x10BA9), Fend: int32(0x10BAF), }, 350: { Fstart: int32(0x10C00), Fend: int32(0x10C48), }, 351: { Fstart: int32(0x10C80), Fend: int32(0x10CB2), }, 352: { Fstart: int32(0x10CC0), Fend: int32(0x10CF2), }, 353: { Fstart: int32(0x10CFA), Fend: int32(0x10D27), }, 354: { Fstart: int32(0x10D30), Fend: int32(0x10D39), }, 355: { Fstart: int32(0x10D40), Fend: int32(0x10D65), }, 356: { Fstart: int32(0x10D69), Fend: int32(0x10D85), }, 357: { Fstart: int32(0x10E60), Fend: int32(0x10E7E), }, 358: { Fstart: int32(0x10E80), Fend: int32(0x10EA9), }, 359: { Fstart: int32(0x10EAB), Fend: int32(0x10EAD), }, 360: { Fstart: int32(0x10EC2), Fend: int32(0x10EC4), }, 361: { Fstart: int32(0x10EFC), Fend: int32(0x10F27), }, 362: { Fstart: int32(0x10F30), Fend: int32(0x10F59), }, 363: { Fstart: int32(0x10F70), Fend: int32(0x10F89), }, 364: { Fstart: int32(0x10FB0), Fend: int32(0x10FCB), }, 365: { Fstart: int32(0x10FE0), Fend: int32(0x10FF6), }, 366: { Fstart: int32(0x11000), Fend: int32(0x1104D), }, 367: { Fstart: int32(0x11052), Fend: int32(0x11075), }, 368: { Fstart: int32(0x1107F), Fend: int32(0x110BC), }, 369: { Fstart: int32(0x110BE), Fend: int32(0x110C2), }, 370: { Fstart: int32(0x110D0), Fend: int32(0x110E8), }, 371: { Fstart: int32(0x110F0), Fend: int32(0x110F9), }, 372: { Fstart: int32(0x11100), Fend: int32(0x11134), }, 373: { Fstart: int32(0x11136), Fend: int32(0x11147), }, 374: { Fstart: int32(0x11150), Fend: int32(0x11176), }, 375: { Fstart: int32(0x11180), Fend: int32(0x111DF), }, 376: { Fstart: int32(0x111E1), Fend: int32(0x111F4), }, 377: { Fstart: int32(0x11200), Fend: int32(0x11211), }, 378: { Fstart: int32(0x11213), Fend: int32(0x11241), }, 379: { Fstart: int32(0x11280), Fend: int32(0x11286), }, 380: { Fstart: int32(0x1128A), Fend: int32(0x1128D), }, 381: { Fstart: int32(0x1128F), Fend: int32(0x1129D), }, 382: { Fstart: int32(0x1129F), Fend: int32(0x112A9), }, 383: { Fstart: int32(0x112B0), Fend: int32(0x112EA), }, 384: { Fstart: int32(0x112F0), Fend: int32(0x112F9), }, 385: { Fstart: int32(0x11300), Fend: int32(0x11303), }, 386: { Fstart: int32(0x11305), Fend: int32(0x1130C), }, 387: { Fstart: int32(0x11313), Fend: int32(0x11328), }, 388: { Fstart: int32(0x1132A), Fend: int32(0x11330), }, 389: { Fstart: int32(0x11335), Fend: int32(0x11339), }, 390: { Fstart: int32(0x1133B), Fend: int32(0x11344), }, 391: { Fstart: int32(0x1134B), Fend: int32(0x1134D), }, 392: { Fstart: int32(0x1135D), Fend: int32(0x11363), }, 393: { Fstart: int32(0x11366), Fend: int32(0x1136C), }, 394: { Fstart: int32(0x11370), Fend: int32(0x11374), }, 395: { Fstart: int32(0x11380), Fend: int32(0x11389), }, 396: { Fstart: int32(0x11390), Fend: int32(0x113B5), }, 397: { Fstart: int32(0x113B7), Fend: int32(0x113C0), }, 398: { Fstart: int32(0x113C7), Fend: int32(0x113CA), }, 399: { Fstart: int32(0x113CC), Fend: int32(0x113D5), }, 400: { Fstart: int32(0x11400), Fend: int32(0x1145B), }, 401: { Fstart: int32(0x1145D), Fend: int32(0x11461), }, 402: { Fstart: int32(0x11480), Fend: int32(0x114C7), }, 403: { Fstart: int32(0x114D0), Fend: int32(0x114D9), }, 404: { Fstart: int32(0x11580), Fend: int32(0x115B5), }, 405: { Fstart: int32(0x115B8), Fend: int32(0x115DD), }, 406: { Fstart: int32(0x11600), Fend: int32(0x11644), }, 407: { Fstart: int32(0x11650), Fend: int32(0x11659), }, 408: { Fstart: int32(0x11660), Fend: int32(0x1166C), }, 409: { Fstart: int32(0x11680), Fend: int32(0x116B9), }, 410: { Fstart: int32(0x116C0), Fend: int32(0x116C9), }, 411: { Fstart: int32(0x116D0), Fend: int32(0x116E3), }, 412: { Fstart: int32(0x11700), Fend: int32(0x1171A), }, 413: { Fstart: int32(0x1171D), Fend: int32(0x1172B), }, 414: { Fstart: int32(0x11730), Fend: int32(0x11746), }, 415: { Fstart: int32(0x11800), Fend: int32(0x1183B), }, 416: { Fstart: int32(0x118A0), Fend: int32(0x118F2), }, 417: { Fstart: int32(0x118FF), Fend: int32(0x11906), }, 418: { Fstart: int32(0x1190C), Fend: int32(0x11913), }, 419: { Fstart: int32(0x11918), Fend: int32(0x11935), }, 420: { Fstart: int32(0x1193B), Fend: int32(0x11946), }, 421: { Fstart: int32(0x11950), Fend: int32(0x11959), }, 422: { Fstart: int32(0x119A0), Fend: int32(0x119A7), }, 423: { Fstart: int32(0x119AA), Fend: int32(0x119D7), }, 424: { Fstart: int32(0x119DA), Fend: int32(0x119E4), }, 425: { Fstart: int32(0x11A00), Fend: int32(0x11A47), }, 426: { Fstart: int32(0x11A50), Fend: int32(0x11AA2), }, 427: { Fstart: int32(0x11AB0), Fend: int32(0x11AF8), }, 428: { Fstart: int32(0x11B00), Fend: int32(0x11B09), }, 429: { Fstart: int32(0x11BC0), Fend: int32(0x11BE1), }, 430: { Fstart: int32(0x11BF0), Fend: int32(0x11BF9), }, 431: { Fstart: int32(0x11C00), Fend: int32(0x11C08), }, 432: { Fstart: int32(0x11C0A), Fend: int32(0x11C36), }, 433: { Fstart: int32(0x11C38), Fend: int32(0x11C45), }, 434: { Fstart: int32(0x11C50), Fend: int32(0x11C6C), }, 435: { Fstart: int32(0x11C70), Fend: int32(0x11C8F), }, 436: { Fstart: int32(0x11C92), Fend: int32(0x11CA7), }, 437: { Fstart: int32(0x11CA9), Fend: int32(0x11CB6), }, 438: { Fstart: int32(0x11D00), Fend: int32(0x11D06), }, 439: { Fstart: int32(0x11D0B), Fend: int32(0x11D36), }, 440: { Fstart: int32(0x11D3F), Fend: int32(0x11D47), }, 441: { Fstart: int32(0x11D50), Fend: int32(0x11D59), }, 442: { Fstart: int32(0x11D60), Fend: int32(0x11D65), }, 443: { Fstart: int32(0x11D6A), Fend: int32(0x11D8E), }, 444: { Fstart: int32(0x11D93), Fend: int32(0x11D98), }, 445: { Fstart: int32(0x11DA0), Fend: int32(0x11DA9), }, 446: { Fstart: int32(0x11EE0), Fend: int32(0x11EF8), }, 447: { Fstart: int32(0x11F00), Fend: int32(0x11F10), }, 448: { Fstart: int32(0x11F12), Fend: int32(0x11F3A), }, 449: { Fstart: int32(0x11F3E), Fend: int32(0x11F5A), }, 450: { Fstart: int32(0x11FC0), Fend: int32(0x11FF1), }, 451: { Fstart: int32(0x11FFF), Fend: int32(0x12399), }, 452: { Fstart: int32(0x12400), Fend: int32(0x1246E), }, 453: { Fstart: int32(0x12470), Fend: int32(0x12474), }, 454: { Fstart: int32(0x12480), Fend: int32(0x12543), }, 455: { Fstart: int32(0x12F90), Fend: int32(0x12FF2), }, 456: { Fstart: int32(0x13000), Fend: int32(0x1342F), }, 457: { Fstart: int32(0x13440), Fend: int32(0x13455), }, 458: { Fstart: int32(0x13460), Fend: int32(0x143FA), }, 459: { Fstart: int32(0x14400), Fend: int32(0x14646), }, 460: { Fstart: int32(0x16100), Fend: int32(0x16139), }, 461: { Fstart: int32(0x16800), Fend: int32(0x16A38), }, 462: { Fstart: int32(0x16A40), Fend: int32(0x16A5E), }, 463: { Fstart: int32(0x16A60), Fend: int32(0x16A69), }, 464: { Fstart: int32(0x16A6E), Fend: int32(0x16ABE), }, 465: { Fstart: int32(0x16AC0), Fend: int32(0x16AC9), }, 466: { Fstart: int32(0x16AD0), Fend: int32(0x16AED), }, 467: { Fstart: int32(0x16AF0), Fend: int32(0x16AF5), }, 468: { Fstart: int32(0x16B00), Fend: int32(0x16B45), }, 469: { Fstart: int32(0x16B50), Fend: int32(0x16B59), }, 470: { Fstart: int32(0x16B5B), Fend: int32(0x16B61), }, 471: { Fstart: int32(0x16B63), Fend: int32(0x16B77), }, 472: { Fstart: int32(0x16B7D), Fend: int32(0x16B8F), }, 473: { Fstart: int32(0x16D40), Fend: int32(0x16D79), }, 474: { Fstart: int32(0x16E40), Fend: int32(0x16E9A), }, 475: { Fstart: int32(0x16F00), Fend: int32(0x16F4A), }, 476: { Fstart: int32(0x16F4F), Fend: int32(0x16F87), }, 477: { Fstart: int32(0x16F8F), Fend: int32(0x16F9F), }, 478: { Fstart: int32(0x16FE0), Fend: int32(0x16FE4), }, 479: { Fstart: int32(0x17000), Fend: int32(0x187F7), }, 480: { Fstart: int32(0x18800), Fend: int32(0x18CD5), }, 481: { Fstart: int32(0x18CFF), Fend: int32(0x18D08), }, 482: { Fstart: int32(0x1AFF0), Fend: int32(0x1AFF3), }, 483: { Fstart: int32(0x1AFF5), Fend: int32(0x1AFFB), }, 484: { Fstart: int32(0x1B000), Fend: int32(0x1B122), }, 485: { Fstart: int32(0x1B150), Fend: int32(0x1B152), }, 486: { Fstart: int32(0x1B164), Fend: int32(0x1B167), }, 487: { Fstart: int32(0x1B170), Fend: int32(0x1B2FB), }, 488: { Fstart: int32(0x1BC00), Fend: int32(0x1BC6A), }, 489: { Fstart: int32(0x1BC70), Fend: int32(0x1BC7C), }, 490: { Fstart: int32(0x1BC80), Fend: int32(0x1BC88), }, 491: { Fstart: int32(0x1BC90), Fend: int32(0x1BC99), }, 492: { Fstart: int32(0x1BC9C), Fend: int32(0x1BC9F), }, 493: { Fstart: int32(0x1CC00), Fend: int32(0x1CCF9), }, 494: { Fstart: int32(0x1CD00), Fend: int32(0x1CEB3), }, 495: { Fstart: int32(0x1CF00), Fend: int32(0x1CF2D), }, 496: { Fstart: int32(0x1CF30), Fend: int32(0x1CF46), }, 497: { Fstart: int32(0x1CF50), Fend: int32(0x1CFC3), }, 498: { Fstart: int32(0x1D000), Fend: int32(0x1D0F5), }, 499: { Fstart: int32(0x1D100), Fend: int32(0x1D126), }, 500: { Fstart: int32(0x1D129), Fend: int32(0x1D172), }, 501: { Fstart: int32(0x1D17B), Fend: int32(0x1D1EA), }, 502: { Fstart: int32(0x1D200), Fend: int32(0x1D245), }, 503: { Fstart: int32(0x1D2C0), Fend: int32(0x1D2D3), }, 504: { Fstart: int32(0x1D2E0), Fend: int32(0x1D2F3), }, 505: { Fstart: int32(0x1D300), Fend: int32(0x1D356), }, 506: { Fstart: int32(0x1D360), Fend: int32(0x1D378), }, 507: { Fstart: int32(0x1D400), Fend: int32(0x1D454), }, 508: { Fstart: int32(0x1D456), Fend: int32(0x1D49C), }, 509: { Fstart: int32(0x1D4A9), Fend: int32(0x1D4AC), }, 510: { Fstart: int32(0x1D4AE), Fend: int32(0x1D4B9), }, 511: { Fstart: int32(0x1D4BD), Fend: int32(0x1D4C3), }, 512: { Fstart: int32(0x1D4C5), Fend: int32(0x1D505), }, 513: { Fstart: int32(0x1D507), Fend: int32(0x1D50A), }, 514: { Fstart: int32(0x1D50D), Fend: int32(0x1D514), }, 515: { Fstart: int32(0x1D516), Fend: int32(0x1D51C), }, 516: { Fstart: int32(0x1D51E), Fend: int32(0x1D539), }, 517: { Fstart: int32(0x1D53B), Fend: int32(0x1D53E), }, 518: { Fstart: int32(0x1D540), Fend: int32(0x1D544), }, 519: { Fstart: int32(0x1D54A), Fend: int32(0x1D550), }, 520: { Fstart: int32(0x1D552), Fend: int32(0x1D6A5), }, 521: { Fstart: int32(0x1D6A8), Fend: int32(0x1D7CB), }, 522: { Fstart: int32(0x1D7CE), Fend: int32(0x1DA8B), }, 523: { Fstart: int32(0x1DA9B), Fend: int32(0x1DA9F), }, 524: { Fstart: int32(0x1DAA1), Fend: int32(0x1DAAF), }, 525: { Fstart: int32(0x1DF00), Fend: int32(0x1DF1E), }, 526: { Fstart: int32(0x1DF25), Fend: int32(0x1DF2A), }, 527: { Fstart: int32(0x1E000), Fend: int32(0x1E006), }, 528: { Fstart: int32(0x1E008), Fend: int32(0x1E018), }, 529: { Fstart: int32(0x1E01B), Fend: int32(0x1E021), }, 530: { Fstart: int32(0x1E026), Fend: int32(0x1E02A), }, 531: { Fstart: int32(0x1E030), Fend: int32(0x1E06D), }, 532: { Fstart: int32(0x1E100), Fend: int32(0x1E12C), }, 533: { Fstart: int32(0x1E130), Fend: int32(0x1E13D), }, 534: { Fstart: int32(0x1E140), Fend: int32(0x1E149), }, 535: { Fstart: int32(0x1E290), Fend: int32(0x1E2AE), }, 536: { Fstart: int32(0x1E2C0), Fend: int32(0x1E2F9), }, 537: { Fstart: int32(0x1E4D0), Fend: int32(0x1E4F9), }, 538: { Fstart: int32(0x1E5D0), Fend: int32(0x1E5FA), }, 539: { Fstart: int32(0x1E7E0), Fend: int32(0x1E7E6), }, 540: { Fstart: int32(0x1E7E8), Fend: int32(0x1E7EB), }, 541: { Fstart: int32(0x1E7F0), Fend: int32(0x1E7FE), }, 542: { Fstart: int32(0x1E800), Fend: int32(0x1E8C4), }, 543: { Fstart: int32(0x1E8C7), Fend: int32(0x1E8D6), }, 544: { Fstart: int32(0x1E900), Fend: int32(0x1E94B), }, 545: { Fstart: int32(0x1E950), Fend: int32(0x1E959), }, 546: { Fstart: int32(0x1EC71), Fend: int32(0x1ECB4), }, 547: { Fstart: int32(0x1ED01), Fend: int32(0x1ED3D), }, 548: { Fstart: int32(0x1EE00), Fend: int32(0x1EE03), }, 549: { Fstart: int32(0x1EE05), Fend: int32(0x1EE1F), }, 550: { Fstart: int32(0x1EE29), Fend: int32(0x1EE32), }, 551: { Fstart: int32(0x1EE34), Fend: int32(0x1EE37), }, 552: { Fstart: int32(0x1EE4D), Fend: int32(0x1EE4F), }, 553: { Fstart: int32(0x1EE67), Fend: int32(0x1EE6A), }, 554: { Fstart: int32(0x1EE6C), Fend: int32(0x1EE72), }, 555: { Fstart: int32(0x1EE74), Fend: int32(0x1EE77), }, 556: { Fstart: int32(0x1EE79), Fend: int32(0x1EE7C), }, 557: { Fstart: int32(0x1EE80), Fend: int32(0x1EE89), }, 558: { Fstart: int32(0x1EE8B), Fend: int32(0x1EE9B), }, 559: { Fstart: int32(0x1EEA1), Fend: int32(0x1EEA3), }, 560: { Fstart: int32(0x1EEA5), Fend: int32(0x1EEA9), }, 561: { Fstart: int32(0x1EEAB), Fend: int32(0x1EEBB), }, 562: { Fstart: int32(0x1F000), Fend: int32(0x1F02B), }, 563: { Fstart: int32(0x1F030), Fend: int32(0x1F093), }, 564: { Fstart: int32(0x1F0A0), Fend: int32(0x1F0AE), }, 565: { Fstart: int32(0x1F0B1), Fend: int32(0x1F0BF), }, 566: { Fstart: int32(0x1F0C1), Fend: int32(0x1F0CF), }, 567: { Fstart: int32(0x1F0D1), Fend: int32(0x1F0F5), }, 568: { Fstart: int32(0x1F100), Fend: int32(0x1F1AD), }, 569: { Fstart: int32(0x1F1E6), Fend: int32(0x1F202), }, 570: { Fstart: int32(0x1F210), Fend: int32(0x1F23B), }, 571: { Fstart: int32(0x1F240), Fend: int32(0x1F248), }, 572: { Fstart: int32(0x1F260), Fend: int32(0x1F265), }, 573: { Fstart: int32(0x1F300), Fend: int32(0x1F6D7), }, 574: { Fstart: int32(0x1F6DC), Fend: int32(0x1F6EC), }, 575: { Fstart: int32(0x1F6F0), Fend: int32(0x1F6FC), }, 576: { Fstart: int32(0x1F700), Fend: int32(0x1F776), }, 577: { Fstart: int32(0x1F77B), Fend: int32(0x1F7D9), }, 578: { Fstart: int32(0x1F7E0), Fend: int32(0x1F7EB), }, 579: { Fstart: int32(0x1F800), Fend: int32(0x1F80B), }, 580: { Fstart: int32(0x1F810), Fend: int32(0x1F847), }, 581: { Fstart: int32(0x1F850), Fend: int32(0x1F859), }, 582: { Fstart: int32(0x1F860), Fend: int32(0x1F887), }, 583: { Fstart: int32(0x1F890), Fend: int32(0x1F8AD), }, 584: { Fstart: int32(0x1F8B0), Fend: int32(0x1F8BB), }, 585: { Fstart: int32(0x1F900), Fend: int32(0x1FA53), }, 586: { Fstart: int32(0x1FA60), Fend: int32(0x1FA6D), }, 587: { Fstart: int32(0x1FA70), Fend: int32(0x1FA7C), }, 588: { Fstart: int32(0x1FA80), Fend: int32(0x1FA89), }, 589: { Fstart: int32(0x1FA8F), Fend: int32(0x1FAC6), }, 590: { Fstart: int32(0x1FACE), Fend: int32(0x1FADC), }, 591: { Fstart: int32(0x1FADF), Fend: int32(0x1FAE9), }, 592: { Fstart: int32(0x1FAF0), Fend: int32(0x1FAF8), }, 593: { Fstart: int32(0x1FB00), Fend: int32(0x1FB92), }, 594: { Fstart: int32(0x1FB94), Fend: int32(0x1FBF9), }, 595: { Fstart: int32(0x20000), Fend: int32(0x2A6DF), }, 596: { Fstart: int32(0x2A700), Fend: int32(0x2B739), }, 597: { Fstart: int32(0x2B740), Fend: int32(0x2B81D), }, 598: { Fstart: int32(0x2B820), Fend: int32(0x2CEA1), }, 599: { Fstart: int32(0x2CEB0), Fend: int32(0x2EBE0), }, 600: { Fstart: int32(0x2EBF0), Fend: int32(0x2EE5D), }, 601: { Fstart: int32(0x2F800), Fend: int32(0x2FA1D), }, 602: { Fstart: int32(0x30000), Fend: int32(0x3134A), }, 603: { Fstart: int32(0x31350), Fend: int32(0x323AF), }, 604: { Fstart: int32(0xE0100), Fend: int32(0xE01EF), }, } var _graphCharTable = [192]Tchr{ 0: int32(0x38C), 1: int32(0x85E), 2: int32(0x98F), 3: int32(0x990), 4: int32(0x9B2), 5: int32(0x9C7), 6: int32(0x9C8), 7: int32(0x9D7), 8: int32(0x9DC), 9: int32(0x9DD), 10: int32(0xA0F), 11: int32(0xA10), 12: int32(0xA32), 13: int32(0xA33), 14: int32(0xA35), 15: int32(0xA36), 16: int32(0xA38), 17: int32(0xA39), 18: int32(0xA3C), 19: int32(0xA47), 20: int32(0xA48), 21: int32(0xA51), 22: int32(0xA5E), 23: int32(0xAB2), 24: int32(0xAB3), 25: int32(0xAD0), 26: int32(0xB0F), 27: int32(0xB10), 28: int32(0xB32), 29: int32(0xB33), 30: int32(0xB47), 31: int32(0xB48), 32: int32(0xB5C), 33: int32(0xB5D), 34: int32(0xB82), 35: int32(0xB83), 36: int32(0xB99), 37: int32(0xB9A), 38: int32(0xB9C), 39: int32(0xB9E), 40: int32(0xB9F), 41: int32(0xBA3), 42: int32(0xBA4), 43: int32(0xBD0), 44: int32(0xBD7), 45: int32(0xC55), 46: int32(0xC56), 47: int32(0xC5D), 48: int32(0xCD5), 49: int32(0xCD6), 50: int32(0xCDD), 51: int32(0xCDE), 52: int32(0xDBD), 53: int32(0xDCA), 54: int32(0xDD6), 55: int32(0xE81), 56: int32(0xE82), 57: int32(0xE84), 58: int32(0xEA5), 59: int32(0xEC6), 60: int32(0x10C7), 61: int32(0x10CD), 62: int32(0x1258), 63: int32(0x12C0), 64: int32(0x1772), 65: int32(0x1773), 66: int32(0x1940), 67: int32(0x1F59), 68: int32(0x1F5B), 69: int32(0x1F5D), 70: int32(0x2070), 71: int32(0x2071), 72: int32(0x2D27), 73: int32(0x2D2D), 74: int32(0x2D6F), 75: int32(0x2D70), 76: int32(0xA7D0), 77: int32(0xA7D1), 78: int32(0xA7D3), 79: int32(0xFB3E), 80: int32(0xFB40), 81: int32(0xFB41), 82: int32(0xFB43), 83: int32(0xFB44), 84: int32(0xFDCF), 85: int32(0xFFFC), 86: int32(0xFFFD), 87: int32(0x1003C), 88: int32(0x1003D), 89: int32(0x101A0), 90: int32(0x10594), 91: int32(0x10595), 92: int32(0x105BB), 93: int32(0x105BC), 94: int32(0x10808), 95: int32(0x10837), 96: int32(0x10838), 97: int32(0x1083C), 98: int32(0x108F4), 99: int32(0x108F5), 100: int32(0x1093F), 101: int32(0x10A05), 102: int32(0x10A06), 103: int32(0x10D8E), 104: int32(0x10D8F), 105: int32(0x10EB0), 106: int32(0x10EB1), 107: int32(0x11288), 108: int32(0x1130F), 109: int32(0x11310), 110: int32(0x11332), 111: int32(0x11333), 112: int32(0x11347), 113: int32(0x11348), 114: int32(0x11350), 115: int32(0x11357), 116: int32(0x1138B), 117: int32(0x1138E), 118: int32(0x113C2), 119: int32(0x113C5), 120: int32(0x113D7), 121: int32(0x113D8), 122: int32(0x113E1), 123: int32(0x113E2), 124: int32(0x11909), 125: int32(0x11915), 126: int32(0x11916), 127: int32(0x11937), 128: int32(0x11938), 129: int32(0x11D08), 130: int32(0x11D09), 131: int32(0x11D3A), 132: int32(0x11D3C), 133: int32(0x11D3D), 134: int32(0x11D67), 135: int32(0x11D68), 136: int32(0x11D90), 137: int32(0x11D91), 138: int32(0x11FB0), 139: int32(0x16FF0), 140: int32(0x16FF1), 141: int32(0x1AFFD), 142: int32(0x1AFFE), 143: int32(0x1B132), 144: int32(0x1B155), 145: int32(0x1D49E), 146: int32(0x1D49F), 147: int32(0x1D4A2), 148: int32(0x1D4A5), 149: int32(0x1D4A6), 150: int32(0x1D4BB), 151: int32(0x1D546), 152: int32(0x1E023), 153: int32(0x1E024), 154: int32(0x1E08F), 155: int32(0x1E14E), 156: int32(0x1E14F), 157: int32(0x1E2FF), 158: int32(0x1E5FF), 159: int32(0x1E7ED), 160: int32(0x1E7EE), 161: int32(0x1E95E), 162: int32(0x1E95F), 163: int32(0x1EE21), 164: int32(0x1EE22), 165: int32(0x1EE24), 166: int32(0x1EE27), 167: int32(0x1EE39), 168: int32(0x1EE3B), 169: int32(0x1EE42), 170: int32(0x1EE47), 171: int32(0x1EE49), 172: int32(0x1EE4B), 173: int32(0x1EE51), 174: int32(0x1EE52), 175: int32(0x1EE54), 176: int32(0x1EE57), 177: int32(0x1EE59), 178: int32(0x1EE5B), 179: int32(0x1EE5D), 180: int32(0x1EE5F), 181: int32(0x1EE61), 182: int32(0x1EE62), 183: int32(0x1EE64), 184: int32(0x1EE7E), 185: int32(0x1EEF0), 186: int32(0x1EEF1), 187: int32(0x1F250), 188: int32(0x1F251), 189: int32(0x1F7F0), 190: int32(0x1F8C0), 191: int32(0x1F8C1), } /* * End of auto-generated Unicode character ranges declarations. */ // C documentation // // /* // - element - map collating-element name to celt // ^ static celt element(struct vars *, const chr *, const chr *); // */ func _element(tls *libc.TLS, v uintptr, startp uintptr, endp uintptr) (r Tcelt) { bp := tls.Alloc(224) defer tls.Free(224) /* points just past end of name */ var cn, np uintptr var len1 Tsize_t var v2 int32 var _ /* ds at bp+0 */ TTcl_DString _, _, _, _ = cn, len1, np, v2 /* * Generic: one-chr names stand for themselves. */ len1 = libc.Uint64FromInt64((int64(endp) - int64(startp)) / 4) if len1 == uint64(1) { return *(*Tchr)(unsafe.Pointer(startp)) } *(*int64)(unsafe.Pointer((*Tvars)(unsafe.Pointer(v)).Fre + 8)) |= int64(libc.Int32FromInt32(REG_ULOCALE)) /* * Search table. */ XTcl_DStringInit(tls, bp) np = XTcl_UniCharToUtfDString(tls, startp, libc.Int64FromUint64(len1), bp) cn = uintptr(unsafe.Pointer(&_cnames)) for { if !((*Tcname)(unsafe.Pointer(cn)).Fname != libc.UintptrFromInt32(0)) { break } if libc.Xstrlen(tls, (*Tcname)(unsafe.Pointer(cn)).Fname) == len1 && libc.Xstrncmp(tls, (*Tcname)(unsafe.Pointer(cn)).Fname, np, len1) == 0 { break /* NOTE BREAK OUT */ } goto _1 _1: ; cn += 16 } XTcl_DStringFree(tls, bp) if (*Tcname)(unsafe.Pointer(cn)).Fname != libc.UintptrFromInt32(0) { return libc.Int32FromUint8((*Tcname)(unsafe.Pointer(cn)).Fcode) } /* * Couldn't find it. */ (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v2 = int32(REG_ECOLLATE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v2 return 0 } // C documentation // // /* // - range - supply cvec for a range, including legality check // ^ static struct cvec *range(struct vars *, celt, celt, int); // */ func _range(tls *libc.TLS, v uintptr, a Tcelt, b Tcelt, cases int32) (r uintptr) { /* case-independent? */ var c, lc, tc, uc Tcelt var cv uintptr var nchrs, v1 int32 _, _, _, _, _, _, _ = c, cv, lc, nchrs, tc, uc, v1 if a != b && !(_before(tls, a, b) != 0) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_ERANGE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v1 return libc.UintptrFromInt32(0) } if !(cases != 0) { /* easy version */ cv = _getcvec(tls, v, uint64(0), uint64(1)) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return libc.UintptrFromInt32(0) } _addrange(tls, cv, a, b) return cv } /* * When case-independent, it's hard to decide when cvec ranges are usable, * so for now at least, we won't try. We allocate enough space for two * case variants plus a little extra for the two title case variants. */ nchrs = (b-a+int32(1))*int32(2) + int32(4) cv = _getcvec(tls, v, libc.Uint64FromInt32(nchrs), uint64(0)) if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { return libc.UintptrFromInt32(0) } c = a for { if !(c <= b) { break } _addchr(tls, cv, c) lc = XTcl_UniCharToLower(tls, c) uc = XTcl_UniCharToUpper(tls, c) tc = XTcl_UniCharToTitle(tls, c) if c != lc { _addchr(tls, cv, lc) } if c != uc { _addchr(tls, cv, uc) } if c != tc && tc != uc { _addchr(tls, cv, tc) } goto _2 _2: ; c++ } return cv } // C documentation // // /* // - before - is celt x before celt y, for purposes of range legality? // ^ static int before(celt, celt); // */ func _before(tls *libc.TLS, x Tcelt, y Tcelt) (r int32) { /* collating elements */ if x < y { return int32(1) } return 0 } // C documentation // // /* // - eclass - supply cvec for an equivalence class // * Must include case counterparts on request. // ^ static struct cvec *eclass(struct vars *, celt, int); // */ func _eclass(tls *libc.TLS, v uintptr, c Tcelt, cases int32) (r uintptr) { /* all cases? */ var cv uintptr _ = cv /* * Crude fake equivalence class for testing. */ if (*Tvars)(unsafe.Pointer(v)).Fcflags&int32(REG_FAKE) != 0 && c == int32('x') { cv = _getcvec(tls, v, uint64(4), uint64(0)) _addchr(tls, cv, int32('x')) _addchr(tls, cv, int32('y')) if cases != 0 { _addchr(tls, cv, int32('X')) _addchr(tls, cv, int32('Y')) } return cv } /* * Otherwise, none. */ if cases != 0 { return _allcases(tls, v, c) } cv = _getcvec(tls, v, uint64(1), uint64(0)) _addchr(tls, cv, c) return cv } // C documentation // // /* // - cclass - supply cvec for a character class // * Must include case counterparts on request. // ^ static struct cvec *cclass(struct vars *, const chr *, const chr *, int); // */ func _cclass(tls *libc.TLS, v uintptr, startp uintptr, endp uintptr, cases int32) (r uintptr) { bp := tls.Alloc(224) defer tls.Free(224) /* case-independent? */ var cv, namePtr, np uintptr var i, index, v2, v25 int32 var len1 Tsize_t var _ /* ds at bp+0 */ TTcl_DString _, _, _, _, _, _, _, _ = cv, i, index, len1, namePtr, np, v2, v25 cv = libc.UintptrFromInt32(0) /* * Extract the class name */ len1 = libc.Uint64FromInt64((int64(endp) - int64(startp)) / 4) XTcl_DStringInit(tls, bp) np = XTcl_UniCharToUtfDString(tls, startp, libc.Int64FromUint64(len1), bp) /* * Map the name to the corresponding enumerated value. */ index = -1 namePtr = uintptr(unsafe.Pointer(&_classNames)) i = libc.Int32FromInt32(0) for { if !(*(*uintptr)(unsafe.Pointer(namePtr)) != libc.UintptrFromInt32(0)) { break } if libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(namePtr))) == len1 && libc.Xstrncmp(tls, *(*uintptr)(unsafe.Pointer(namePtr)), np, len1) == 0 { index = i break } goto _1 _1: ; namePtr += 8 i++ } XTcl_DStringFree(tls, bp) /* * Remap lower and upper to alpha if the match is case insensitive. */ if cases != 0 && (index == 7 || index == 11) { index = 0 } /* * Now compute the character class contents. */ switch index { case -1: (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v2 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v2 = int32(REG_ECTYPE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v2 return libc.UintptrFromInt32(0) case 0: cv = _getcvec(tls, v, libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(1076)/libc.Uint64FromInt64(4))), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(568)/libc.Uint64FromInt64(8))+libc.Int32FromUint64(libc.Uint64FromInt64(3768)/libc.Uint64FromInt64(8)))) if cv != 0 { i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(1076)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _alphaCharTable[i]) goto _3 _3: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(3768)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _alphaRangeTable[i].Fstart, _alphaRangeTable[i].Fend) goto _4 _4: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(568)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _digitRangeTable[i].Fstart, _digitRangeTable[i].Fend) goto _5 _5: ; i++ } } case 1: cv = _getcvec(tls, v, libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(1076)/libc.Uint64FromInt64(4))), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(3768)/libc.Uint64FromInt64(8)))) if cv != 0 { i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(3768)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _alphaRangeTable[i].Fstart, _alphaRangeTable[i].Fend) goto _6 _6: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(1076)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _alphaCharTable[i]) goto _7 _7: ; i++ } } case 2: cv = _getcvec(tls, v, uint64(0), uint64(1)) if cv != 0 { _addrange(tls, cv, 0, int32(0x7F)) } case 3: cv = _getcvec(tls, v, uint64(2), uint64(0)) _addchr(tls, cv, int32('\t')) _addchr(tls, cv, int32(' ')) case 4: cv = _getcvec(tls, v, libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(4))), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(96)/libc.Uint64FromInt64(8)))) if cv != 0 { i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(96)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _controlRangeTable[i].Fstart, _controlRangeTable[i].Fend) goto _8 _8: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _controlCharTable[i]) goto _9 _9: ; i++ } } case 5: cv = _getcvec(tls, v, uint64(0), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(568)/libc.Uint64FromInt64(8)))) if cv != 0 { i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(568)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _digitRangeTable[i].Fstart, _digitRangeTable[i].Fend) goto _10 _10: ; i++ } } case 9: cv = _getcvec(tls, v, libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(616)/libc.Uint64FromInt64(4))), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(688)/libc.Uint64FromInt64(8)))) if cv != 0 { i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(688)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _punctRangeTable[i].Fstart, _punctRangeTable[i].Fend) goto _11 _11: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(616)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _punctCharTable[i]) goto _12 _12: ; i++ } } case 12: /* * This is a 3 instead of (NUM_DIGIT_RANGE+2) because I've no idea how * to define the digits 'a' through 'f' in non-western locales. The * concept is quite possibly non portable, or only used in contextx * where the characters used would be the western ones anyway! * Whatever is actually the case, the number of ranges is fixed (until * someone comes up with a better arrangement!) */ cv = _getcvec(tls, v, uint64(0), uint64(3)) if cv != 0 { _addrange(tls, cv, int32('0'), int32('9')) _addrange(tls, cv, int32('a'), int32('f')) _addrange(tls, cv, int32('A'), int32('F')) } case 10: cv = _getcvec(tls, v, libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(4))), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(16)/libc.Uint64FromInt64(8)))) if cv != 0 { i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(16)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _spaceRangeTable[i].Fstart, _spaceRangeTable[i].Fend) goto _13 _13: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _spaceCharTable[i]) goto _14 _14: ; i++ } } case 7: cv = _getcvec(tls, v, libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(2368)/libc.Uint64FromInt64(4))), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(728)/libc.Uint64FromInt64(8)))) if cv != 0 { i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(728)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _lowerRangeTable[i].Fstart, _lowerRangeTable[i].Fend) goto _15 _15: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(2368)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _lowerCharTable[i]) goto _16 _16: ; i++ } } case 11: cv = _getcvec(tls, v, libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(2388)/libc.Uint64FromInt64(4))), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(608)/libc.Uint64FromInt64(8)))) if cv != 0 { i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(608)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _upperRangeTable[i].Fstart, _upperRangeTable[i].Fend) goto _17 _17: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(2388)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _upperCharTable[i]) goto _18 _18: ; i++ } } case 8: cv = _getcvec(tls, v, libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(4))+libc.Int32FromUint64(libc.Uint64FromInt64(768)/libc.Uint64FromInt64(4))), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(16)/libc.Uint64FromInt64(8))+libc.Int32FromUint64(libc.Uint64FromInt64(4840)/libc.Uint64FromInt64(8))-libc.Int32FromInt32(1))) if cv != 0 { i = int32(1) for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(16)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _spaceRangeTable[i].Fstart, _spaceRangeTable[i].Fend) goto _19 _19: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _spaceCharTable[i]) goto _20 _20: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(4840)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _graphRangeTable[i].Fstart, _graphRangeTable[i].Fend) goto _21 _21: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(768)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _graphCharTable[i]) goto _22 _22: ; i++ } } case 6: cv = _getcvec(tls, v, libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(768)/libc.Uint64FromInt64(4))), libc.Uint64FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(4840)/libc.Uint64FromInt64(8)))) if cv != 0 { i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(4840)/libc.Uint64FromInt64(8))) { break } _addrange(tls, cv, _graphRangeTable[i].Fstart, _graphRangeTable[i].Fend) goto _23 _23: ; i++ } i = 0 for { if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(768)/libc.Uint64FromInt64(4))) { break } _addchr(tls, cv, _graphCharTable[i]) goto _24 _24: ; i++ } } break } if cv == libc.UintptrFromInt32(0) { (*Tvars)(unsafe.Pointer(v)).Fnexttype = int32('e') if (*Tvars)(unsafe.Pointer(v)).Ferr != 0 { v25 = (*Tvars)(unsafe.Pointer(v)).Ferr } else { v25 = int32(REG_ESPACE) } (*Tvars)(unsafe.Pointer(v)).Ferr = v25 } return cv } /* * The following arrays define the valid character class names. */ var _classNames = [14]uintptr{ 0: __ccgo_ts + 1119, 1: __ccgo_ts + 1125, 2: __ccgo_ts + 1131, 3: __ccgo_ts + 1137, 4: __ccgo_ts + 1143, 5: __ccgo_ts + 1149, 6: __ccgo_ts + 1155, 7: __ccgo_ts + 1161, 8: __ccgo_ts + 1167, 9: __ccgo_ts + 1173, 10: __ccgo_ts + 558, 11: __ccgo_ts + 1179, 12: __ccgo_ts + 1185, 13: libc.UintptrFromInt32(0), } // C documentation // // /* // - allcases - supply cvec for all case counterparts of a chr (including itself) // * This is a shortcut, preferably an efficient one, for simple characters; // * messy cases are done via range(). // ^ static struct cvec *allcases(struct vars *, pchr); // */ func _allcases(tls *libc.TLS, v uintptr, pc Tpchr) (r uintptr) { /* character to get case equivs of */ var c, lc, tc, uc Tchr var cv uintptr _, _, _, _, _ = c, cv, lc, tc, uc c = pc lc = XTcl_UniCharToLower(tls, c) uc = XTcl_UniCharToUpper(tls, c) tc = XTcl_UniCharToTitle(tls, c) if tc != uc { cv = _getcvec(tls, v, uint64(3), uint64(0)) _addchr(tls, cv, tc) } else { cv = _getcvec(tls, v, uint64(2), uint64(0)) } _addchr(tls, cv, lc) if lc != uc { _addchr(tls, cv, uc) } return cv } // C documentation // // /* // - cmp - chr-substring compare // * Backrefs need this. It should preferably be efficient. // * Note that it does not need to report anything except equal/unequal. // * Note also that the length is exact, and the comparison should not // * stop at embedded NULs! // ^ static int cmp(const chr *, const chr *, size_t); // */ func _cmp(tls *libc.TLS, x uintptr, y uintptr, len1 Tsize_t) (r int32) { /* exact length of comparison */ return libc.Xmemcmp(tls, x, y, len1*uint64(4)) } // C documentation // // /* // - casecmp - case-independent chr-substring compare // * REG_ICASE backrefs need this. It should preferably be efficient. // * Note that it does not need to report anything except equal/unequal. // * Note also that the length is exact, and the comparison should not // * stop at embedded NULs! // ^ static int casecmp(const chr *, const chr *, size_t); // */ func _casecmp(tls *libc.TLS, x uintptr, y uintptr, len1 Tsize_t) (r int32) { /* exact length of comparison */ for { if !(len1 > uint64(0)) { break } if *(*Tchr)(unsafe.Pointer(x)) != *(*Tchr)(unsafe.Pointer(y)) && XTcl_UniCharToLower(tls, *(*Tchr)(unsafe.Pointer(x))) != XTcl_UniCharToLower(tls, *(*Tchr)(unsafe.Pointer(y))) { return int32(1) } goto _1 _1: ; len1-- x += 4 y += 4 } return 0 } const FEWCOLORS = 15 const FEWSTATES = 20 const LOCALDFAS = 40 const LOCALMAT = 20 const LOCKED = 4 const NOPROGRESS = 8 const POSTSTATE = 2 const STARTER = 1 const WORK = 1 /* * Magic for allocating a variable workspace. This default version is * stack-hungry. */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* * Lazy-DFA representation. */ type Tarcp = struct { Fss uintptr Fco Tcolor } type Tsset = struct { Fstates uintptr Fhash uint32 Fflags int32 Fins Tarcp Flastseen uintptr Fouts uintptr Finchain uintptr } type Tdfa = struct { Fnssets Tsize_t Fnssused Tsize_t Fnstates Tsize_t Fwordsper Tsize_t Fncolors int32 Fcptsmalloced int32 Fssets uintptr Fstatesarea uintptr Fwork uintptr Foutsarea uintptr Fincarea uintptr Fcnfa uintptr Fcm uintptr Flastpost uintptr Flastnopr uintptr Fsearch uintptr Fmallocarea uintptr } /* * Setup for non-malloc allocation for small cases. */ type Tsmalldfa = struct { Fdfa Tdfa Fssets [40]Tsset Fstatesarea [41]uint32 Foutsarea [600]uintptr Fincarea [600]Tarcp } /* * Internal variables, bundled for easy passing around. */ type Tvars1 = struct { Fre uintptr Fg uintptr Feflags int32 Fnmatch Tsize_t Fpmatch uintptr Fdetails uintptr Fstart uintptr Fstop uintptr Ferr int32 Fsubdfas uintptr Fdfa1 Tsmalldfa Fdfa2 Tsmalldfa } /* automatically gathered by fwd; do not hand-edit */ /* =====^!^===== end forwards =====^!^===== */ // C documentation // // /* // - exec - match regular expression // ^ int exec(regex_t *, const chr *, size_t, rm_detail_t *, // ^ size_t, regmatch_t [], int); // */ func XTclReExec(tls *libc.TLS, re uintptr, string1 uintptr, len1 Tsize_t, details uintptr, nmatch Tsize_t, pmatch uintptr, flags int32) (r int32) { bp := tls.Alloc(640) defer tls.Free(640) var backref, i, n, st, v1 int32 var v uintptr var v3 uint64 var _ /* mat at bp+0 */ [20]Tregmatch_t var _ /* subdfas at bp+320 */ [40]uintptr _, _, _, _, _, _, _ = backref, i, n, st, v, v1, v3 v = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&_varsKey1)), int64(33952)) /* * Sanity checks. */ if re == libc.UintptrFromInt32(0) || string1 == libc.UintptrFromInt32(0) || (*Tregex_t)(unsafe.Pointer(re)).Fre_magic != int32(REMAGIC) { return int32(REG_INVARG) } /* * Setup. */ (*Tvars1)(unsafe.Pointer(v)).Fre = re (*Tvars1)(unsafe.Pointer(v)).Fg = (*Tregex_t)(unsafe.Pointer(re)).Fre_guts if (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fcflags&int32(REG_EXPECT) != 0 && details == libc.UintptrFromInt32(0) { return int32(REG_INVARG) } if (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Finfo&int64(REG_UIMPOSSIBLE) != 0 { return int32(REG_NOMATCH) } if (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Finfo&int64(REG_UBACKREF) != 0 { v1 = int32(1) } else { v1 = 0 } backref = v1 (*Tvars1)(unsafe.Pointer(v)).Feflags = flags if (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fcflags&int32(REG_NOSUB) != 0 { nmatch = uint64(0) /* override client */ } (*Tvars1)(unsafe.Pointer(v)).Fnmatch = nmatch if backref != 0 { /* * Need work area. */ if (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fnsub+uint64(1) <= uint64(LOCALMAT) { (*Tvars1)(unsafe.Pointer(v)).Fpmatch = bp } else { (*Tvars1)(unsafe.Pointer(v)).Fpmatch = XTclpAlloc(tls, ((*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fnsub+uint64(1))*uint64(16)) } if (*Tvars1)(unsafe.Pointer(v)).Fpmatch == libc.UintptrFromInt32(0) { return int32(REG_ESPACE) } (*Tvars1)(unsafe.Pointer(v)).Fnmatch = (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fnsub + uint64(1) } else { (*Tvars1)(unsafe.Pointer(v)).Fpmatch = pmatch } (*Tvars1)(unsafe.Pointer(v)).Fdetails = details (*Tvars1)(unsafe.Pointer(v)).Fstart = string1 (*Tvars1)(unsafe.Pointer(v)).Fstop = string1 + uintptr(len1)*4 (*Tvars1)(unsafe.Pointer(v)).Ferr = 0 n = libc.Int32FromUint64((*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fntree) if n <= int32(LOCALDFAS) { (*Tvars1)(unsafe.Pointer(v)).Fsubdfas = bp + 320 } else { (*Tvars1)(unsafe.Pointer(v)).Fsubdfas = XTclpAlloc(tls, libc.Uint64FromInt32(n)*uint64(8)) } if (*Tvars1)(unsafe.Pointer(v)).Fsubdfas == libc.UintptrFromInt32(0) { if (*Tvars1)(unsafe.Pointer(v)).Fpmatch != pmatch && (*Tvars1)(unsafe.Pointer(v)).Fpmatch != bp { XTclpFree(tls, (*Tvars1)(unsafe.Pointer(v)).Fpmatch) } return int32(REG_ESPACE) } i = 0 for { if !(i < n) { break } *(*uintptr)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fsubdfas + uintptr(i)*8)) = libc.UintptrFromInt32(0) goto _2 _2: ; i++ } /* * Do it. */ if backref != 0 { st = _complicatedFind(tls, v, (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Ftree+48, (*Tvars1)(unsafe.Pointer(v)).Fg+104) } else { st = _simpleFind(tls, v, (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Ftree+48, (*Tvars1)(unsafe.Pointer(v)).Fg+104) } /* * Copy (portion of) match vector over if necessary. */ if st == REG_OKAY && (*Tvars1)(unsafe.Pointer(v)).Fpmatch != pmatch && nmatch > uint64(0) { _zapallsubs(tls, pmatch, nmatch) if nmatch < (*Tvars1)(unsafe.Pointer(v)).Fnmatch { v3 = nmatch } else { v3 = (*Tvars1)(unsafe.Pointer(v)).Fnmatch } n = libc.Int32FromUint64(v3) libc.Xmemcpy(tls, pmatch, (*Tvars1)(unsafe.Pointer(v)).Fpmatch, libc.Uint64FromInt32(n)*uint64(16)) } /* * Clean up. */ if (*Tvars1)(unsafe.Pointer(v)).Fpmatch != pmatch && (*Tvars1)(unsafe.Pointer(v)).Fpmatch != bp { XTclpFree(tls, (*Tvars1)(unsafe.Pointer(v)).Fpmatch) } n = libc.Int32FromUint64((*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fntree) i = 0 for { if !(i < n) { break } if *(*uintptr)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fsubdfas + uintptr(i)*8)) != libc.UintptrFromInt32(0) { _freeDFA(tls, *(*uintptr)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fsubdfas + uintptr(i)*8))) } goto _4 _4: ; i++ } if (*Tvars1)(unsafe.Pointer(v)).Fsubdfas != bp+320 { XTclpFree(tls, (*Tvars1)(unsafe.Pointer(v)).Fsubdfas) } return st } var _varsKey1 TTcl_ThreadDataKey // C documentation // // /* // - getsubdfa - create or re-fetch the DFA for a subre node // * We only need to create the DFA once per overall regex execution. // * The DFA will be freed by the cleanup step in exec(). // */ func _getsubdfa(tls *libc.TLS, v uintptr, t uintptr) (r uintptr) { if *(*uintptr)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fsubdfas + uintptr((*Tsubre)(unsafe.Pointer(t)).Fid)*8)) == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fsubdfas + uintptr((*Tsubre)(unsafe.Pointer(t)).Fid)*8)) = _newDFA(tls, v, t+48, (*Tvars1)(unsafe.Pointer(v)).Fg+104, libc.UintptrFromInt32(0)) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return libc.UintptrFromInt32(0) } } return *(*uintptr)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fsubdfas + uintptr((*Tsubre)(unsafe.Pointer(t)).Fid)*8)) } // C documentation // // /* // - simpleFind - find a match for the main NFA (no-complications case) // ^ static int simpleFind(struct vars *, struct cnfa *, struct colormap *); // */ func _simpleFind(tls *libc.TLS, v uintptr, cnfa uintptr, cm uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var begin, close1, d, end, open, s uintptr var shorter, v1 int32 var _ /* cold at bp+0 */ uintptr var _ /* hitend at bp+8 */ int32 _, _, _, _, _, _, _, _ = begin, close1, d, end, open, s, shorter, v1 end = libc.UintptrFromInt32(0) if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer((*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Ftree)).Fflags)&int32(SHORTER) != 0 { v1 = int32(1) } else { v1 = 0 } shorter = v1 /* * First, a shot with the search RE. */ s = _newDFA(tls, v, (*Tvars1)(unsafe.Pointer(v)).Fg+32, cm, v+80) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) close1 = _shortest(tls, v, s, (*Tvars1)(unsafe.Pointer(v)).Fstart, (*Tvars1)(unsafe.Pointer(v)).Fstart, (*Tvars1)(unsafe.Pointer(v)).Fstop, bp, libc.UintptrFromInt32(0)) _freeDFA(tls, s) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } if (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fcflags&int32(REG_EXPECT) != 0 { if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { (*Trm_detail_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = libc.Uint64FromInt64((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) } else { (*Trm_detail_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = libc.Uint64FromInt64((int64((*Tvars1)(unsafe.Pointer(v)).Fstop) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) } (*Trm_detail_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_eo = libc.Uint64FromInt64((int64((*Tvars1)(unsafe.Pointer(v)).Fstop) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) /* unknown */ } if close1 == libc.UintptrFromInt32(0) { /* not found */ return int32(REG_NOMATCH) } if (*Tvars1)(unsafe.Pointer(v)).Fnmatch == uint64(0) { /* found, don't need exact location */ return REG_OKAY } /* * Find starting point and match. */ open = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) d = _newDFA(tls, v, cnfa, cm, v+80) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } begin = open for { if !(begin <= close1) { break } if shorter != 0 { end = _shortest(tls, v, d, begin, begin, (*Tvars1)(unsafe.Pointer(v)).Fstop, libc.UintptrFromInt32(0), bp+8) } else { end = _longest(tls, v, d, begin, (*Tvars1)(unsafe.Pointer(v)).Fstop, bp+8) } if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { _freeDFA(tls, d) return (*Tvars1)(unsafe.Pointer(v)).Ferr } if *(*int32)(unsafe.Pointer(bp + 8)) != 0 && *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = begin } if end != libc.UintptrFromInt32(0) { break /* NOTE BREAK OUT */ } goto _2 _2: ; begin += 4 } /* search RE succeeded so loop should */ _freeDFA(tls, d) /* * And pin down details. */ (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch))).Frm_so = libc.Uint64FromInt64((int64(begin) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch))).Frm_eo = libc.Uint64FromInt64((int64(end) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) if (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fcflags&int32(REG_EXPECT) != 0 { if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { (*Trm_detail_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = libc.Uint64FromInt64((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) } else { (*Trm_detail_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = libc.Uint64FromInt64((int64((*Tvars1)(unsafe.Pointer(v)).Fstop) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) } (*Trm_detail_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_eo = libc.Uint64FromInt64((int64((*Tvars1)(unsafe.Pointer(v)).Fstop) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) /* unknown */ } if (*Tvars1)(unsafe.Pointer(v)).Fnmatch == uint64(1) { /* no need for submatches */ return REG_OKAY } /* * Find submatches. */ _zapallsubs(tls, (*Tvars1)(unsafe.Pointer(v)).Fpmatch, (*Tvars1)(unsafe.Pointer(v)).Fnmatch) return _cdissect(tls, v, (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Ftree, begin, end) } // C documentation // // /* // - complicatedFind - find a match for the main NFA (with complications) // ^ static int complicatedFind(struct vars *, struct cnfa *, struct colormap *); // */ func _complicatedFind(tls *libc.TLS, v uintptr, cnfa uintptr, cm uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var d, s uintptr var ret int32 var _ /* cold at bp+0 */ uintptr _, _, _ = d, ret, s *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) s = _newDFA(tls, v, (*Tvars1)(unsafe.Pointer(v)).Fg+32, cm, v+80) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } d = _newDFA(tls, v, cnfa, cm, v+17016) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { _freeDFA(tls, s) return (*Tvars1)(unsafe.Pointer(v)).Ferr } ret = _complicatedFindLoop(tls, v, d, s, bp) _freeDFA(tls, d) _freeDFA(tls, s) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } if (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fcflags&int32(REG_EXPECT) != 0 { if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { (*Trm_detail_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = libc.Uint64FromInt64((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) } else { (*Trm_detail_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_so = libc.Uint64FromInt64((int64((*Tvars1)(unsafe.Pointer(v)).Fstop) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) } (*Trm_detail_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fdetails)).Frm_extend.Frm_eo = libc.Uint64FromInt64((int64((*Tvars1)(unsafe.Pointer(v)).Fstop) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) /* unknown */ } return ret } // C documentation // // /* // - complicatedFindLoop - the heart of complicatedFind // ^ static int complicatedFindLoop(struct vars *, // ^ struct dfa *, struct dfa *, chr **); // */ func _complicatedFindLoop(tls *libc.TLS, v uintptr, d uintptr, s uintptr, coldp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* where to put coldstart pointer */ var begin, close1, end, estart, estop, open uintptr var er, shorter, v3, v4 int32 var _ /* cold at bp+0 */ uintptr var _ /* hitend at bp+8 */ int32 _, _, _, _, _, _, _, _, _, _ = begin, close1, end, er, estart, estop, open, shorter, v3, v4 shorter = libc.Int32FromUint8((*Tsubre)(unsafe.Pointer((*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Ftree)).Fflags) & int32(SHORTER) *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) close1 = (*Tvars1)(unsafe.Pointer(v)).Fstart for cond := true; cond; cond = close1 < (*Tvars1)(unsafe.Pointer(v)).Fstop { close1 = _shortest(tls, v, s, close1, close1, (*Tvars1)(unsafe.Pointer(v)).Fstop, bp, libc.UintptrFromInt32(0)) if close1 == libc.UintptrFromInt32(0) { break /* NOTE BREAK */ } open = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) begin = open for { if !(begin <= close1) { break } estart = begin estop = (*Tvars1)(unsafe.Pointer(v)).Fstop for { if shorter != 0 { end = _shortest(tls, v, d, begin, estart, estop, libc.UintptrFromInt32(0), bp+8) } else { end = _longest(tls, v, d, begin, estop, bp+8) } if *(*int32)(unsafe.Pointer(bp + 8)) != 0 && *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = begin } if end == libc.UintptrFromInt32(0) { break /* NOTE BREAK OUT */ } _zapallsubs(tls, (*Tvars1)(unsafe.Pointer(v)).Fpmatch, (*Tvars1)(unsafe.Pointer(v)).Fnmatch) er = _cdissect(tls, v, (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Ftree, begin, end) if er == REG_OKAY { if (*Tvars1)(unsafe.Pointer(v)).Fnmatch > uint64(0) { (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch))).Frm_so = libc.Uint64FromInt64((int64(begin) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch))).Frm_eo = libc.Uint64FromInt64((int64(end) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) } *(*uintptr)(unsafe.Pointer(coldp)) = *(*uintptr)(unsafe.Pointer(bp)) return REG_OKAY } if er != int32(REG_NOMATCH) { if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { v3 = (*Tvars1)(unsafe.Pointer(v)).Ferr } else { v3 = er } (*Tvars1)(unsafe.Pointer(v)).Ferr = v3 *(*uintptr)(unsafe.Pointer(coldp)) = *(*uintptr)(unsafe.Pointer(bp)) return er } if shorter != 0 { v4 = libc.BoolInt32(end == estop) } else { v4 = libc.BoolInt32(end == begin) } if v4 != 0 { break } /* * Go around and try again */ if shorter != 0 { estart = end + uintptr(1)*4 } else { estop = end - uintptr(1)*4 } goto _2 _2: } goto _1 _1: ; begin += 4 } } *(*uintptr)(unsafe.Pointer(coldp)) = *(*uintptr)(unsafe.Pointer(bp)) return int32(REG_NOMATCH) } // C documentation // // /* // - zapallsubs - initialize all subexpression matches to "no match" // ^ static void zapallsubs(regmatch_t *, size_t); // */ func _zapallsubs(tls *libc.TLS, p uintptr, n Tsize_t) { var i Tsize_t _ = i i = n - uint64(1) for { if !(i > uint64(0)) { break } (*(*Tregmatch_t)(unsafe.Pointer(p + uintptr(i)*16))).Frm_so = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) (*(*Tregmatch_t)(unsafe.Pointer(p + uintptr(i)*16))).Frm_eo = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) goto _1 _1: ; i-- } } // C documentation // // /* // - zaptreesubs - initialize subexpressions within subtree to "no match" // ^ static void zaptreesubs(struct vars *, struct subre *); // */ func _zaptreesubs(tls *libc.TLS, v uintptr, t uintptr) { var n Tsize_t _ = n if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fop) == int32('(') { n = libc.Uint64FromInt32((*Tsubre)(unsafe.Pointer(t)).Fsubno) if n < (*Tvars1)(unsafe.Pointer(v)).Fnmatch { (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16))).Frm_so = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16))).Frm_eo = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } } if (*Tsubre)(unsafe.Pointer(t)).Fleft != libc.UintptrFromInt32(0) { _zaptreesubs(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) } if (*Tsubre)(unsafe.Pointer(t)).Fright != libc.UintptrFromInt32(0) { _zaptreesubs(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fright) } } // C documentation // // /* // - subset - set subexpression match data for a successful subre // ^ static void subset(struct vars *, struct subre *, chr *, chr *); // */ func _subset(tls *libc.TLS, v uintptr, sub uintptr, begin uintptr, end uintptr) { var n int32 _ = n n = (*Tsubre)(unsafe.Pointer(sub)).Fsubno if libc.Uint64FromInt32(n) >= (*Tvars1)(unsafe.Pointer(v)).Fnmatch { return } (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16))).Frm_so = libc.Uint64FromInt64((int64(begin) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16))).Frm_eo = libc.Uint64FromInt64((int64(end) - int64((*Tvars1)(unsafe.Pointer(v)).Fstart)) / 4) } // C documentation // // /* // - cdissect - check backrefs and determine subexpression matches // * cdissect recursively processes a subre tree to check matching of backrefs // * and/or identify submatch boundaries for capture nodes. The proposed match // * runs from "begin" to "end" (not including "end"), and we are basically // * "dissecting" it to see where the submatches are. // * Before calling any level of cdissect, the caller must have run the node's // * DFA and found that the proposed substring satisfies the DFA. (We make // * the caller do that because in concatenation and iteration nodes, it's // * much faster to check all the substrings against the child DFAs before we // * recurse.) Also, caller must have cleared subexpression match data via // * zaptreesubs (or zapallsubs at the top level). // ^ static int cdissect(struct vars *, struct subre *, chr *, chr *); // */ func _cdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) (r int32) { /* end of same */ var er int32 _ = er switch libc.Int32FromUint8((*Tsubre)(unsafe.Pointer(t)).Fop) { case int32('='): /* terminal node */ er = REG_OKAY /* no action, parent did the work */ case int32('b'): /* back reference */ er = _cbrdissect(tls, v, t, begin, end) case int32('.'): /* concatenation */ if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer((*Tsubre)(unsafe.Pointer(t)).Fleft)).Fflags)&int32(SHORTER) != 0 { /* reverse scan */ er = _crevcondissect(tls, v, t, begin, end) } else { er = _ccondissect(tls, v, t, begin, end) } case int32('|'): /* alternation */ er = _caltdissect(tls, v, t, begin, end) case int32('*'): /* iteration */ if libc.Int32FromUint8((*Tsubre)(unsafe.Pointer((*Tsubre)(unsafe.Pointer(t)).Fleft)).Fflags)&int32(SHORTER) != 0 { /* reverse scan */ er = _creviterdissect(tls, v, t, begin, end) } else { er = _citerdissect(tls, v, t, begin, end) } case int32('('): /* capturing */ er = _cdissect(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft, begin, end) if er == REG_OKAY { _subset(tls, v, t, begin, end) } default: er = int32(REG_ASSERT) break } /* * We should never have a match failure unless backrefs lurk below; * otherwise, either caller failed to check the DFA, or there's some * inconsistency between the DFA and the node's innards. */ return er } // C documentation // // /* // - ccondissect - dissect match for concatenation node // ^ static int ccondissect(struct vars *, struct subre *, chr *, chr *); // */ func _ccondissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) (r int32) { /* end of same */ var d, d2, mid uintptr var er int32 _, _, _, _ = d, d2, er, mid d = _getsubdfa(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } d2 = _getsubdfa(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fright) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } /* * Pick a tentative midpoint. */ mid = _longest(tls, v, d, begin, end, libc.UintptrFromInt32(0)) if mid == libc.UintptrFromInt32(0) { return int32(REG_NOMATCH) } /* * Iterate until satisfaction or failure. */ for { /* * Try this midpoint on for size. */ if _longest(tls, v, d2, mid, end, libc.UintptrFromInt32(0)) == end { er = _cdissect(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft, begin, mid) if er == REG_OKAY { er = _cdissect(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fright, mid, end) if er == REG_OKAY { /* * Satisfaction. */ return REG_OKAY } } if er != int32(REG_NOMATCH) { return er } } /* * That midpoint didn't work, find a new one. */ if mid == begin { /* * All possibilities exhausted. */ return int32(REG_NOMATCH) } mid = _longest(tls, v, d, begin, mid-uintptr(1)*4, libc.UintptrFromInt32(0)) if mid == libc.UintptrFromInt32(0) { /* * Failed to find a new one. */ return int32(REG_NOMATCH) } _zaptreesubs(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) _zaptreesubs(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fright) goto _1 _1: } return r } // C documentation // // /* // - crevcondissect - dissect match for concatenation node, shortest-first // ^ static int crevcondissect(struct vars *, struct subre *, chr *, chr *); // */ func _crevcondissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) (r int32) { /* end of same */ var d, d2, mid uintptr var er int32 _, _, _, _ = d, d2, er, mid d = _getsubdfa(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } d2 = _getsubdfa(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fright) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } /* * Pick a tentative midpoint. */ mid = _shortest(tls, v, d, begin, begin, end, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0)) if mid == libc.UintptrFromInt32(0) { return int32(REG_NOMATCH) } /* * Iterate until satisfaction or failure. */ for { /* * Try this midpoint on for size. */ if _longest(tls, v, d2, mid, end, libc.UintptrFromInt32(0)) == end { er = _cdissect(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft, begin, mid) if er == REG_OKAY { er = _cdissect(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fright, mid, end) if er == REG_OKAY { /* * Satisfaction. */ return REG_OKAY } } if er != int32(REG_NOMATCH) { return er } } /* * That midpoint didn't work, find a new one. */ if mid == end { /* * All possibilities exhausted. */ return int32(REG_NOMATCH) } mid = _shortest(tls, v, d, begin, mid+uintptr(1)*4, end, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0)) if mid == libc.UintptrFromInt32(0) { /* * Failed to find a new one. */ return int32(REG_NOMATCH) } _zaptreesubs(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) _zaptreesubs(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fright) goto _1 _1: } return r } // C documentation // // /* // - cbrdissect - dissect match for backref node // ^ static int cbrdissect(struct vars *, struct subre *, chr *, chr *); // */ func _cbrdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) (r int32) { /* end of same */ var brlen, numreps, tlen, v1 Tsize_t var brstring, p uintptr var max, min, n int32 _, _, _, _, _, _, _, _, _ = brlen, brstring, max, min, n, numreps, p, tlen, v1 n = (*Tsubre)(unsafe.Pointer(t)).Fsubno min = int32((*Tsubre)(unsafe.Pointer(t)).Fmin) max = int32((*Tsubre)(unsafe.Pointer(t)).Fmax) /* get the backreferenced string */ if (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16))).Frm_so == libc.Uint64FromInt32(-libc.Int32FromInt32(1)) { return int32(REG_NOMATCH) } brstring = (*Tvars1)(unsafe.Pointer(v)).Fstart + uintptr((*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16))).Frm_so)*4 brlen = (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16))).Frm_eo - (*(*Tregmatch_t)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fpmatch + uintptr(n)*16))).Frm_so /* special cases for zero-length strings */ if brlen == uint64(0) { /* * matches only if target is zero length, but any number of * repetitions can be considered to be present */ if begin == end && min <= max { return REG_OKAY } return int32(REG_NOMATCH) } if begin == end { /* matches only if zero repetitions are okay */ if min == 0 { return REG_OKAY } return int32(REG_NOMATCH) } /* * check target length to see if it could possibly be an allowed number of * repetitions of brstring */ tlen = libc.Uint64FromInt64((int64(end) - int64(begin)) / 4) if tlen%brlen != uint64(0) { return int32(REG_NOMATCH) } numreps = tlen / brlen if numreps < libc.Uint64FromInt32(min) || numreps > libc.Uint64FromInt32(max) && max != libc.Int32FromInt32(_POSIX2_RE_DUP_MAX)+libc.Int32FromInt32(1) { return int32(REG_NOMATCH) } /* okay, compare the actual string contents */ p = begin for { v1 = numreps numreps-- if !(v1 > uint64(0)) { break } if (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Fcompare})))(tls, brstring, p, brlen) != 0 { return int32(REG_NOMATCH) } p += uintptr(brlen) * 4 } return REG_OKAY } // C documentation // // /* // - caltdissect - dissect match for alternation node // ^ static int caltdissect(struct vars *, struct subre *, chr *, chr *); // */ func _caltdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) (r int32) { /* end of same */ var d uintptr var er int32 _, _ = d, er /* We loop, rather than tail-recurse, to handle a chain of alternatives */ for t != libc.UintptrFromInt32(0) { d = _getsubdfa(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { return (*Tvars1)(unsafe.Pointer(v)).Ferr } if _longest(tls, v, d, begin, end, libc.UintptrFromInt32(0)) == end { er = _cdissect(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft, begin, end) if er != int32(REG_NOMATCH) { return er } } t = (*Tsubre)(unsafe.Pointer(t)).Fright } return int32(REG_NOMATCH) } // C documentation // // /* // - citerdissect - dissect match for iteration node // ^ static int citerdissect(struct vars *, struct subre *, chr *, chr *); // */ func _citerdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) (r int32) { /* end of same */ var d, endpts, limit, prev_end uintptr var er, i, k, min_matches, nverified int32 var max_matches Tsize_t _, _, _, _, _, _, _, _, _, _ = d, endpts, er, i, k, limit, max_matches, min_matches, nverified, prev_end /* * If zero matches are allowed, and target string is empty, just declare * victory. OTOH, if target string isn't empty, zero matches can't work * so we pretend the min is 1. */ min_matches = int32((*Tsubre)(unsafe.Pointer(t)).Fmin) if min_matches <= 0 { if begin == end { return REG_OKAY } min_matches = int32(1) } /* * We need workspace to track the endpoints of each sub-match. Normally * we consider only nonzero-length sub-matches, so there can be at most * end-begin of them. However, if min is larger than that, we will also * consider zero-length sub-matches in order to find enough matches. * * For convenience, endpts[0] contains the "begin" pointer and we store * sub-match endpoints in endpts[1..max_matches]. */ max_matches = libc.Uint64FromInt64((int64(end) - int64(begin)) / 4) if max_matches > libc.Uint64FromInt16((*Tsubre)(unsafe.Pointer(t)).Fmax) && int32((*Tsubre)(unsafe.Pointer(t)).Fmax) != libc.Int32FromInt32(_POSIX2_RE_DUP_MAX)+libc.Int32FromInt32(1) { max_matches = libc.Uint64FromInt16((*Tsubre)(unsafe.Pointer(t)).Fmax) } if max_matches < libc.Uint64FromInt32(min_matches) { max_matches = libc.Uint64FromInt32(min_matches) } endpts = XTclpAlloc(tls, (max_matches+uint64(1))*uint64(8)) if endpts == libc.UintptrFromInt32(0) { return int32(REG_ESPACE) } *(*uintptr)(unsafe.Pointer(endpts)) = begin d = _getsubdfa(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { XTclpFree(tls, endpts) return (*Tvars1)(unsafe.Pointer(v)).Ferr } /* * Our strategy is to first find a set of sub-match endpoints that are * valid according to the child node's DFA, and then recursively dissect * each sub-match to confirm validity. If any validity check fails, * backtrack the last sub-match and try again. And, when we next try for * a validity check, we need not recheck any successfully verified * sub-matches that we didn't move the endpoints of. nverified remembers * how many sub-matches are currently known okay. */ /* initialize to consider first sub-match */ nverified = 0 k = int32(1) limit = end /* iterate until satisfaction or failure */ for k > 0 { /* try to find an endpoint for the k'th sub-match */ *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) = _longest(tls, v, d, *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-int32(1))*8)), limit, libc.UintptrFromInt32(0)) if *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) == libc.UintptrFromInt32(0) { /* no match possible, so see if we can shorten previous one */ k-- goto backtrack } /* k'th sub-match can no longer be considered verified */ if nverified >= k { nverified = k - int32(1) } if *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) != end { /* haven't reached end yet, try another iteration if allowed */ if libc.Uint64FromInt32(k) >= max_matches { /* must try to shorten some previous match */ k-- goto backtrack } /* reject zero-length match unless necessary to achieve min */ if *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) == *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-int32(1))*8)) && (k >= min_matches || int64(min_matches-k) < (int64(end)-int64(*(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8))))/4) { goto backtrack } k++ limit = end continue } /* * We've identified a way to divide the string into k sub-matches * that works so far as the child DFA can tell. If k is an allowed * number of matches, start the slow part: recurse to verify each * sub-match. We always have k <= max_matches, needn't check that. */ if k < min_matches { goto backtrack } i = nverified + int32(1) for { if !(i <= k) { break } _zaptreesubs(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) er = _cdissect(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft, *(*uintptr)(unsafe.Pointer(endpts + uintptr(i-int32(1))*8)), *(*uintptr)(unsafe.Pointer(endpts + uintptr(i)*8))) if er == REG_OKAY { nverified = i goto _1 } if er == int32(REG_NOMATCH) { break } /* oops, something failed */ XTclpFree(tls, endpts) return er goto _1 _1: ; i++ } if i > k { /* satisfaction */ XTclpFree(tls, endpts) return REG_OKAY } /* match failed to verify, so backtrack */ goto backtrack backtrack: ; /* * Must consider shorter versions of the current sub-match. However, * we'll only ask for a zero-length match if necessary. */ for k > 0 { prev_end = *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-int32(1))*8)) if *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) > prev_end { limit = *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) - uintptr(1)*4 if limit > prev_end || k < min_matches && int64(min_matches-k) >= (int64(end)-int64(prev_end))/4 { /* break out of backtrack loop, continue the outer one */ break } } /* can't shorten k'th sub-match any more, consider previous one */ k-- } } /* all possibilities exhausted */ XTclpFree(tls, endpts) return int32(REG_NOMATCH) } // C documentation // // /* // - creviterdissect - dissect match for iteration node, shortest-first // ^ static int creviterdissect(struct vars *, struct subre *, chr *, chr *); // */ func _creviterdissect(tls *libc.TLS, v uintptr, t uintptr, begin uintptr, end uintptr) (r int32) { /* end of same */ var d, endpts, limit uintptr var er, i, k, min_matches, nverified int32 var max_matches Tsize_t _, _, _, _, _, _, _, _, _ = d, endpts, er, i, k, limit, max_matches, min_matches, nverified /* * If zero matches are allowed, and target string is empty, just declare * victory. OTOH, if target string isn't empty, zero matches can't work * so we pretend the min is 1. */ min_matches = int32((*Tsubre)(unsafe.Pointer(t)).Fmin) if min_matches <= 0 { if begin == end { return REG_OKAY } min_matches = int32(1) } /* * We need workspace to track the endpoints of each sub-match. Normally * we consider only nonzero-length sub-matches, so there can be at most * end-begin of them. However, if min is larger than that, we will also * consider zero-length sub-matches in order to find enough matches. * * For convenience, endpts[0] contains the "begin" pointer and we store * sub-match endpoints in endpts[1..max_matches]. */ max_matches = libc.Uint64FromInt64((int64(end) - int64(begin)) / 4) if max_matches > libc.Uint64FromInt16((*Tsubre)(unsafe.Pointer(t)).Fmax) && int32((*Tsubre)(unsafe.Pointer(t)).Fmax) != libc.Int32FromInt32(_POSIX2_RE_DUP_MAX)+libc.Int32FromInt32(1) { max_matches = libc.Uint64FromInt16((*Tsubre)(unsafe.Pointer(t)).Fmax) } if max_matches < libc.Uint64FromInt32(min_matches) { max_matches = libc.Uint64FromInt32(min_matches) } endpts = XTclpAlloc(tls, (max_matches+uint64(1))*uint64(8)) if endpts == libc.UintptrFromInt32(0) { return int32(REG_ESPACE) } *(*uintptr)(unsafe.Pointer(endpts)) = begin d = _getsubdfa(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { XTclpFree(tls, endpts) return (*Tvars1)(unsafe.Pointer(v)).Ferr } /* * Our strategy is to first find a set of sub-match endpoints that are * valid according to the child node's DFA, and then recursively dissect * each sub-match to confirm validity. If any validity check fails, * backtrack the last sub-match and try again. And, when we next try for * a validity check, we need not recheck any successfully verified * sub-matches that we didn't move the endpoints of. nverified remembers * how many sub-matches are currently known okay. */ /* initialize to consider first sub-match */ nverified = 0 k = int32(1) limit = begin /* iterate until satisfaction or failure */ for k > 0 { /* disallow zero-length match unless necessary to achieve min */ if limit == *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-int32(1))*8)) && limit != end && (k >= min_matches || int64(min_matches-k) < (int64(end)-int64(limit))/4) { limit += 4 } /* if this is the last allowed sub-match, it must reach to the end */ if libc.Uint64FromInt32(k) >= max_matches { limit = end } /* try to find an endpoint for the k'th sub-match */ *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) = _shortest(tls, v, d, *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-int32(1))*8)), limit, end, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0)) if *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) == libc.UintptrFromInt32(0) { /* no match possible, so see if we can lengthen previous one */ k-- goto backtrack } /* k'th sub-match can no longer be considered verified */ if nverified >= k { nverified = k - int32(1) } if *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) != end { /* haven't reached end yet, try another iteration if allowed */ if libc.Uint64FromInt32(k) >= max_matches { /* must try to lengthen some previous match */ k-- goto backtrack } k++ limit = *(*uintptr)(unsafe.Pointer(endpts + uintptr(k-int32(1))*8)) continue } /* * We've identified a way to divide the string into k sub-matches * that works so far as the child DFA can tell. If k is an allowed * number of matches, start the slow part: recurse to verify each * sub-match. We always have k <= max_matches, needn't check that. */ if k < min_matches { goto backtrack } i = nverified + int32(1) for { if !(i <= k) { break } _zaptreesubs(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft) er = _cdissect(tls, v, (*Tsubre)(unsafe.Pointer(t)).Fleft, *(*uintptr)(unsafe.Pointer(endpts + uintptr(i-int32(1))*8)), *(*uintptr)(unsafe.Pointer(endpts + uintptr(i)*8))) if er == REG_OKAY { nverified = i goto _1 } if er == int32(REG_NOMATCH) { break } /* oops, something failed */ XTclpFree(tls, endpts) return er goto _1 _1: ; i++ } if i > k { /* satisfaction */ XTclpFree(tls, endpts) return REG_OKAY } /* match failed to verify, so backtrack */ goto backtrack backtrack: ; /* * Must consider longer versions of the current sub-match. */ for k > 0 { if *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) < end { limit = *(*uintptr)(unsafe.Pointer(endpts + uintptr(k)*8)) + uintptr(1)*4 /* break out of backtrack loop, continue the outer one */ break } /* can't lengthen k'th sub-match any more, consider previous one */ k-- } } /* all possibilities exhausted */ XTclpFree(tls, endpts) return int32(REG_NOMATCH) } /* * DFA routines * This file is #included by regexec.c. * * Copyright © 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 * Corporation, none of whom are responsible for the results. The author * thanks all of them. * * Redistribution and use in source and binary forms -- with or without * modification -- are permitted for any purpose, provided that * redistributions in source form retain this entire copyright notice and * indicate the origin and nature of any modifications. * * I'd appreciate being given credit for this package in the documentation * of software which uses it, but that is not a requirement. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ // C documentation // // /* // - longest - longest-preferred matching engine // ^ static chr *longest(struct vars *, struct dfa *, chr *, chr *, int *); // */ func _longest(tls *libc.TLS, v uintptr, d uintptr, start uintptr, stop uintptr, hitstopp uintptr) (r uintptr) { /* record whether hit v->stop, if non-NULL */ var cm, cp, css, post, realstop, ss, v1 uintptr var co Tcolor var i Tsize_t var v2, v3 int32 _, _, _, _, _, _, _, _, _, _, _ = cm, co, cp, css, i, post, realstop, ss, v1, v2, v3 if stop == (*Tvars1)(unsafe.Pointer(v)).Fstop { v1 = stop } else { v1 = stop + uintptr(1)*4 } realstop = v1 cm = (*Tdfa)(unsafe.Pointer(d)).Fcm /* * Initialize. */ css = _initialize(tls, v, d, start) cp = start if hitstopp != libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(hitstopp)) = 0 } /* * Startup. */ if cp == (*Tvars1)(unsafe.Pointer(v)).Fstart { if (*Tvars1)(unsafe.Pointer(v)).Feflags&int32(REG_NOTBOL) != 0 { v2 = 0 } else { v2 = int32(1) } co = *(*Tcolor)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fcnfa + 32 + uintptr(v2)*2)) } else { co = *(*Tcolor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(*(*Tchr)(unsafe.Pointer(cp - libc.UintptrFromInt32(1)*4))>>(libc.Int32FromInt32(3)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(2)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>libc.Int32FromInt32(BYTBITS)&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(3)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(2)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>libc.Int32FromInt32(BYTBITS)&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(3)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(2)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>libc.Int32FromInt32(BYTBITS)&(libc.Int32FromInt32(1)< uint64(0)) { break } if (*Tsset)(unsafe.Pointer(ss)).Fflags&int32(POSTSTATE) != 0 && post != (*Tsset)(unsafe.Pointer(ss)).Flastseen && (post == libc.UintptrFromInt32(0) || post < (*Tsset)(unsafe.Pointer(ss)).Flastseen) { post = (*Tsset)(unsafe.Pointer(ss)).Flastseen } goto _4 _4: ; ss += 56 i-- } if post != libc.UintptrFromInt32(0) { /* found one */ return post - uintptr(1)*4 } return libc.UintptrFromInt32(0) } // C documentation // // /* // - shortest - shortest-preferred matching engine // ^ static chr *shortest(struct vars *, struct dfa *, chr *, chr *, chr *, // ^ chr **, int *); // */ func _shortest(tls *libc.TLS, v uintptr, d uintptr, start uintptr, min uintptr, max uintptr, coldp uintptr, hitstopp uintptr) (r uintptr) { /* record whether hit v->stop, if non-NULL */ var cm, cp, css, realmax, realmin, ss, v1, v2 uintptr var co Tcolor var v3, v4 int32 _, _, _, _, _, _, _, _, _, _, _ = cm, co, cp, css, realmax, realmin, ss, v1, v2, v3, v4 if min == (*Tvars1)(unsafe.Pointer(v)).Fstop { v1 = min } else { v1 = min + uintptr(1)*4 } realmin = v1 if max == (*Tvars1)(unsafe.Pointer(v)).Fstop { v2 = max } else { v2 = max + uintptr(1)*4 } realmax = v2 cm = (*Tdfa)(unsafe.Pointer(d)).Fcm /* * Initialize. */ css = _initialize(tls, v, d, start) cp = start if hitstopp != libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(hitstopp)) = 0 } /* * Startup. */ if cp == (*Tvars1)(unsafe.Pointer(v)).Fstart { if (*Tvars1)(unsafe.Pointer(v)).Feflags&int32(REG_NOTBOL) != 0 { v3 = 0 } else { v3 = int32(1) } co = *(*Tcolor)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fcnfa + 32 + uintptr(v3)*2)) } else { co = *(*Tcolor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(*(*Tchr)(unsafe.Pointer(cp - libc.UintptrFromInt32(1)*4))>>(libc.Int32FromInt32(3)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(2)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>libc.Int32FromInt32(BYTBITS)&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(3)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(2)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>libc.Int32FromInt32(BYTBITS)&(libc.Int32FromInt32(1)<= realmin { break /* NOTE BREAK OUT */ } } } else { for cp < realmax { co = *(*Tcolor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cm + 368 + uintptr(*(*Tchr)(unsafe.Pointer(cp))>>(libc.Int32FromInt32(3)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>(libc.Int32FromInt32(2)*libc.Int32FromInt32(BYTBITS))&(libc.Int32FromInt32(1)<>libc.Int32FromInt32(BYTBITS)&(libc.Int32FromInt32(1)<= realmin { break /* NOTE BREAK OUT */ } } } if ss == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } if coldp != libc.UintptrFromInt32(0) { /* report last no-progress state set, if any */ *(*uintptr)(unsafe.Pointer(coldp)) = _lastCold(tls, v, d) } if (*Tsset)(unsafe.Pointer(ss)).Fflags&int32(POSTSTATE) != 0 && cp > min { cp -= 4 } else { if cp == (*Tvars1)(unsafe.Pointer(v)).Fstop && max == (*Tvars1)(unsafe.Pointer(v)).Fstop { if (*Tvars1)(unsafe.Pointer(v)).Feflags&int32(REG_NOTEOL) != 0 { v4 = 0 } else { v4 = int32(1) } co = *(*Tcolor)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fcnfa + 36 + uintptr(v4)*2)) ss = _miss(tls, v, d, css, int32(co), cp, start) /* * Match might have ended at eol. */ if (ss == libc.UintptrFromInt32(0) || !((*Tsset)(unsafe.Pointer(ss)).Fflags&libc.Int32FromInt32(POSTSTATE) != 0)) && hitstopp != libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(hitstopp)) = int32(1) } } } if ss == libc.UintptrFromInt32(0) || !((*Tsset)(unsafe.Pointer(ss)).Fflags&libc.Int32FromInt32(POSTSTATE) != 0) { return libc.UintptrFromInt32(0) } return cp } // C documentation // // /* // - lastCold - determine last point at which no progress had been made // ^ static chr *lastCold(struct vars *, struct dfa *); // */ func _lastCold(tls *libc.TLS, v uintptr, d uintptr) (r uintptr) { var i Tsize_t var nopr, ss uintptr _, _, _ = i, nopr, ss nopr = (*Tdfa)(unsafe.Pointer(d)).Flastnopr if nopr == libc.UintptrFromInt32(0) { nopr = (*Tvars1)(unsafe.Pointer(v)).Fstart } ss = (*Tdfa)(unsafe.Pointer(d)).Fssets i = (*Tdfa)(unsafe.Pointer(d)).Fnssused for { if !(i > uint64(0)) { break } if (*Tsset)(unsafe.Pointer(ss)).Fflags&int32(NOPROGRESS) != 0 && nopr < (*Tsset)(unsafe.Pointer(ss)).Flastseen { nopr = (*Tsset)(unsafe.Pointer(ss)).Flastseen } goto _1 _1: ; ss += 56 i-- } return nopr } // C documentation // // /* // - newDFA - set up a fresh DFA // ^ static struct dfa *newDFA(struct vars *, struct cnfa *, // ^ struct colormap *, struct smalldfa *); // */ func _newDFA(tls *libc.TLS, v uintptr, cnfa uintptr, cm uintptr, sml uintptr) (r uintptr) { /* preallocated space, may be NULL */ var d, smallwas, v2 uintptr var nss, wordsper Tsize_t var v1, v3, v4 int32 var v5 uint64 _, _, _, _, _, _, _, _, _ = d, nss, smallwas, wordsper, v1, v2, v3, v4, v5 nss = (*Tcnfa)(unsafe.Pointer(cnfa)).Fnstates * uint64(2) wordsper = ((*Tcnfa)(unsafe.Pointer(cnfa)).Fnstates + libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4) - uint64(1)) / (libc.Uint64FromInt32(CHAR_BIT) * libc.Uint64FromInt64(4)) smallwas = sml if nss <= uint64(FEWSTATES) && (*Tcnfa)(unsafe.Pointer(cnfa)).Fncolors <= int32(FEWCOLORS) { if sml == libc.UintptrFromInt32(0) { sml = XTclpAlloc(tls, uint64(16936)) if sml == libc.UintptrFromInt32(0) { if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars1)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_ESPACE) } (*Tvars1)(unsafe.Pointer(v)).Ferr = v1 return libc.UintptrFromInt32(0) } } d = sml (*Tdfa)(unsafe.Pointer(d)).Fssets = sml + 128 (*Tdfa)(unsafe.Pointer(d)).Fstatesarea = sml + 2368 (*Tdfa)(unsafe.Pointer(d)).Fwork = (*Tdfa)(unsafe.Pointer(d)).Fstatesarea + uintptr(nss)*4 (*Tdfa)(unsafe.Pointer(d)).Foutsarea = sml + 2536 (*Tdfa)(unsafe.Pointer(d)).Fincarea = sml + 7336 (*Tdfa)(unsafe.Pointer(d)).Fcptsmalloced = 0 if smallwas == libc.UintptrFromInt32(0) { v2 = sml } else { v2 = libc.UintptrFromInt32(0) } (*Tdfa)(unsafe.Pointer(d)).Fmallocarea = v2 } else { d = XTclpAlloc(tls, uint64(128)) if d == libc.UintptrFromInt32(0) { if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { v3 = (*Tvars1)(unsafe.Pointer(v)).Ferr } else { v3 = int32(REG_ESPACE) } (*Tvars1)(unsafe.Pointer(v)).Ferr = v3 return libc.UintptrFromInt32(0) } (*Tdfa)(unsafe.Pointer(d)).Fssets = XTclpAlloc(tls, nss*uint64(56)) (*Tdfa)(unsafe.Pointer(d)).Fstatesarea = XTclpAlloc(tls, (nss+uint64(WORK))*wordsper*uint64(4)) (*Tdfa)(unsafe.Pointer(d)).Fwork = (*Tdfa)(unsafe.Pointer(d)).Fstatesarea + uintptr(nss*wordsper)*4 (*Tdfa)(unsafe.Pointer(d)).Foutsarea = XTclpAlloc(tls, nss*libc.Uint64FromInt32((*Tcnfa)(unsafe.Pointer(cnfa)).Fncolors)*uint64(8)) (*Tdfa)(unsafe.Pointer(d)).Fincarea = XTclpAlloc(tls, nss*libc.Uint64FromInt32((*Tcnfa)(unsafe.Pointer(cnfa)).Fncolors)*uint64(16)) (*Tdfa)(unsafe.Pointer(d)).Fcptsmalloced = int32(1) (*Tdfa)(unsafe.Pointer(d)).Fmallocarea = d if (*Tdfa)(unsafe.Pointer(d)).Fssets == libc.UintptrFromInt32(0) || (*Tdfa)(unsafe.Pointer(d)).Fstatesarea == libc.UintptrFromInt32(0) || (*Tdfa)(unsafe.Pointer(d)).Foutsarea == libc.UintptrFromInt32(0) || (*Tdfa)(unsafe.Pointer(d)).Fincarea == libc.UintptrFromInt32(0) { _freeDFA(tls, d) if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { v4 = (*Tvars1)(unsafe.Pointer(v)).Ferr } else { v4 = int32(REG_ESPACE) } (*Tvars1)(unsafe.Pointer(v)).Ferr = v4 return libc.UintptrFromInt32(0) } } if (*Tvars1)(unsafe.Pointer(v)).Feflags&int32(REG_SMALL) != 0 { v5 = uint64(7) } else { v5 = nss } (*Tdfa)(unsafe.Pointer(d)).Fnssets = v5 (*Tdfa)(unsafe.Pointer(d)).Fnssused = uint64(0) (*Tdfa)(unsafe.Pointer(d)).Fnstates = (*Tcnfa)(unsafe.Pointer(cnfa)).Fnstates (*Tdfa)(unsafe.Pointer(d)).Fncolors = (*Tcnfa)(unsafe.Pointer(cnfa)).Fncolors (*Tdfa)(unsafe.Pointer(d)).Fwordsper = wordsper (*Tdfa)(unsafe.Pointer(d)).Fcnfa = cnfa (*Tdfa)(unsafe.Pointer(d)).Fcm = cm (*Tdfa)(unsafe.Pointer(d)).Flastpost = libc.UintptrFromInt32(0) (*Tdfa)(unsafe.Pointer(d)).Flastnopr = libc.UintptrFromInt32(0) (*Tdfa)(unsafe.Pointer(d)).Fsearch = (*Tdfa)(unsafe.Pointer(d)).Fssets /* * Initialization of sset fields is done as needed. */ return d } // C documentation // // /* // - freeDFA - free a DFA // ^ static void freeDFA(struct dfa *); // */ func _freeDFA(tls *libc.TLS, d uintptr) { if (*Tdfa)(unsafe.Pointer(d)).Fcptsmalloced != 0 { if (*Tdfa)(unsafe.Pointer(d)).Fssets != libc.UintptrFromInt32(0) { XTclpFree(tls, (*Tdfa)(unsafe.Pointer(d)).Fssets) } if (*Tdfa)(unsafe.Pointer(d)).Fstatesarea != libc.UintptrFromInt32(0) { XTclpFree(tls, (*Tdfa)(unsafe.Pointer(d)).Fstatesarea) } if (*Tdfa)(unsafe.Pointer(d)).Foutsarea != libc.UintptrFromInt32(0) { XTclpFree(tls, (*Tdfa)(unsafe.Pointer(d)).Foutsarea) } if (*Tdfa)(unsafe.Pointer(d)).Fincarea != libc.UintptrFromInt32(0) { XTclpFree(tls, (*Tdfa)(unsafe.Pointer(d)).Fincarea) } } if (*Tdfa)(unsafe.Pointer(d)).Fmallocarea != libc.UintptrFromInt32(0) { XTclpFree(tls, (*Tdfa)(unsafe.Pointer(d)).Fmallocarea) } } // C documentation // // /* // - hash - construct a hash code for a bitvector // * There are probably better ways, but they're more expensive. // ^ static unsigned hash(unsigned *, int); // */ func _hash(tls *libc.TLS, uv uintptr, n int32) (r uint32) { var h uint32 var i int32 _, _ = h, i h = uint32(0) i = 0 for { if !(i < n) { break } h ^= *(*uint32)(unsafe.Pointer(uv + uintptr(i)*4)) goto _1 _1: ; i++ } return h } // C documentation // // /* // - initialize - hand-craft a cache entry for startup, otherwise get ready // ^ static struct sset *initialize(struct vars *, struct dfa *, chr *); // */ func _initialize(tls *libc.TLS, v uintptr, d uintptr, start uintptr) (r uintptr) { var i Tsize_t var ss uintptr var v2 uint32 _, _, _ = i, ss, v2 /* * Is previous one still there? */ if (*Tdfa)(unsafe.Pointer(d)).Fnssused > uint64(0) && (*(*Tsset)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fssets))).Fflags&int32(STARTER) != 0 { ss = (*Tdfa)(unsafe.Pointer(d)).Fssets } else { /* no, must (re)build it */ ss = _getVacantSS(tls, v, d, start, start) i = uint64(0) for { if !(i < (*Tdfa)(unsafe.Pointer(d)).Fwordsper) { break } *(*uint32)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Fstates + uintptr(i)*4)) = uint32(0) goto _1 _1: ; i++ } *(*uint32)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Fstates + uintptr((*Tcnfa)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fcnfa)).Fpre/(libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4)))*4)) |= libc.Uint32FromInt32(1) << ((*Tcnfa)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fcnfa)).Fpre % (libc.Uint64FromInt32(CHAR_BIT) * libc.Uint64FromInt64(4))) if (*Tdfa)(unsafe.Pointer(d)).Fwordsper == uint64(1) { v2 = *(*uint32)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Fstates)) } else { v2 = _hash(tls, (*Tsset)(unsafe.Pointer(ss)).Fstates, libc.Int32FromUint64((*Tdfa)(unsafe.Pointer(d)).Fwordsper)) } (*Tsset)(unsafe.Pointer(ss)).Fhash = v2 (*Tsset)(unsafe.Pointer(ss)).Fflags = libc.Int32FromInt32(STARTER) | libc.Int32FromInt32(LOCKED) | libc.Int32FromInt32(NOPROGRESS) /* * lastseen dealt with below */ } i = uint64(0) for { if !(i < (*Tdfa)(unsafe.Pointer(d)).Fnssused) { break } (*(*Tsset)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fssets + uintptr(i)*56))).Flastseen = libc.UintptrFromInt32(0) goto _3 _3: ; i++ } (*Tsset)(unsafe.Pointer(ss)).Flastseen = start /* maybe untrue, but harmless */ (*Tdfa)(unsafe.Pointer(d)).Flastpost = libc.UintptrFromInt32(0) (*Tdfa)(unsafe.Pointer(d)).Flastnopr = libc.UintptrFromInt32(0) return ss } // C documentation // // /* // - miss - handle a cache miss // ^ static struct sset *miss(struct vars *, struct dfa *, struct sset *, // ^ pcolor, chr *, chr *); // */ func _miss(tls *libc.TLS, v uintptr, d uintptr, css uintptr, co Tpcolor, cp uintptr, start uintptr) (r uintptr) { /* where the attempt got started */ var ca, cnfa, p uintptr var doLAConstraints, gotState, isPost, noProgress, sawLAConstraints, v10, v4 int32 var h, v7 uint32 var i Tsize_t _, _, _, _, _, _, _, _, _, _, _, _, _ = ca, cnfa, doLAConstraints, gotState, h, i, isPost, noProgress, p, sawLAConstraints, v10, v4, v7 cnfa = (*Tdfa)(unsafe.Pointer(d)).Fcnfa /* * For convenience, we can be called even if it might not be a miss. */ if *(*uintptr)(unsafe.Pointer((*Tsset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8)) != libc.UintptrFromInt32(0) { return *(*uintptr)(unsafe.Pointer((*Tsset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8)) } /* * First, what set of states would we end up in? */ i = uint64(0) for { if !(i < (*Tdfa)(unsafe.Pointer(d)).Fwordsper) { break } *(*uint32)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fwork + uintptr(i)*4)) = uint32(0) goto _1 _1: ; i++ } isPost = 0 noProgress = int32(1) gotState = 0 i = uint64(0) for { if !(i < (*Tdfa)(unsafe.Pointer(d)).Fnstates) { break } if *(*uint32)(unsafe.Pointer((*Tsset)(unsafe.Pointer(css)).Fstates + uintptr(i/(libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4)))*4))&(libc.Uint32FromInt32(1)<<(i%(libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4)))) != 0 { ca = *(*uintptr)(unsafe.Pointer((*Tcnfa)(unsafe.Pointer(cnfa)).Fstates + uintptr(i)*8)) for { if !(int32((*Tcarc)(unsafe.Pointer(ca)).Fco) != -int32(1)) { break } if int32((*Tcarc)(unsafe.Pointer(ca)).Fco) == co { *(*uint32)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fwork + uintptr((*Tcarc)(unsafe.Pointer(ca)).Fto/(libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4)))*4)) |= libc.Uint32FromInt32(1) << ((*Tcarc)(unsafe.Pointer(ca)).Fto % (libc.Uint64FromInt32(CHAR_BIT) * libc.Uint64FromInt64(4))) gotState = int32(1) if (*Tcarc)(unsafe.Pointer(ca)).Fto == (*Tcnfa)(unsafe.Pointer(cnfa)).Fpost { isPost = int32(1) } if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*Tcarc)(unsafe.Pointer(ca)).Fto))))&libc.Int32FromInt32(CNFA_NOPROGRESS) != 0) { noProgress = 0 } } goto _3 _3: ; ca += 16 } } goto _2 _2: ; i++ } if gotState != 0 { v4 = (*Tcnfa)(unsafe.Pointer(cnfa)).Fflags & int32(HASLACONS) } else { v4 = 0 } doLAConstraints = v4 sawLAConstraints = 0 for doLAConstraints != 0 { /* transitive closure */ doLAConstraints = 0 i = uint64(0) for { if !(i < (*Tdfa)(unsafe.Pointer(d)).Fnstates) { break } if *(*uint32)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fwork + uintptr(i/(libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4)))*4))&(libc.Uint32FromInt32(1)<<(i%(libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4)))) != 0 { ca = *(*uintptr)(unsafe.Pointer((*Tcnfa)(unsafe.Pointer(cnfa)).Fstates + uintptr(i)*8)) for { if !(int32((*Tcarc)(unsafe.Pointer(ca)).Fco) != -int32(1)) { break } if int32((*Tcarc)(unsafe.Pointer(ca)).Fco) < (*Tcnfa)(unsafe.Pointer(cnfa)).Fncolors { goto _6 /* NOTE CONTINUE */ } sawLAConstraints = int32(1) if *(*uint32)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fwork + uintptr((*Tcarc)(unsafe.Pointer(ca)).Fto/(libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4)))*4))&(libc.Uint32FromInt32(1)<<((*Tcarc)(unsafe.Pointer(ca)).Fto%(libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4)))) != 0 { goto _6 /* NOTE CONTINUE */ } if !(_checkLAConstraint(tls, v, cnfa, cp, int32((*Tcarc)(unsafe.Pointer(ca)).Fco)) != 0) { goto _6 /* NOTE CONTINUE */ } *(*uint32)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fwork + uintptr((*Tcarc)(unsafe.Pointer(ca)).Fto/(libc.Uint64FromInt32(CHAR_BIT)*libc.Uint64FromInt64(4)))*4)) |= libc.Uint32FromInt32(1) << ((*Tcarc)(unsafe.Pointer(ca)).Fto % (libc.Uint64FromInt32(CHAR_BIT) * libc.Uint64FromInt64(4))) doLAConstraints = int32(1) if (*Tcarc)(unsafe.Pointer(ca)).Fto == (*Tcnfa)(unsafe.Pointer(cnfa)).Fpost { isPost = int32(1) } if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tcnfa)(unsafe.Pointer(cnfa)).Fstflags + uintptr((*Tcarc)(unsafe.Pointer(ca)).Fto))))&libc.Int32FromInt32(CNFA_NOPROGRESS) != 0) { noProgress = 0 } goto _6 _6: ; ca += 16 } } goto _5 _5: ; i++ } } if !(gotState != 0) { return libc.UintptrFromInt32(0) } if (*Tdfa)(unsafe.Pointer(d)).Fwordsper == uint64(1) { v7 = *(*uint32)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fwork)) } else { v7 = _hash(tls, (*Tdfa)(unsafe.Pointer(d)).Fwork, libc.Int32FromUint64((*Tdfa)(unsafe.Pointer(d)).Fwordsper)) } h = v7 /* * Next, is that in the cache? */ p = (*Tdfa)(unsafe.Pointer(d)).Fssets i = (*Tdfa)(unsafe.Pointer(d)).Fnssused for { if !(i > uint64(0)) { break } if (*Tsset)(unsafe.Pointer(p)).Fhash == h && ((*Tdfa)(unsafe.Pointer(d)).Fwordsper == uint64(1) || libc.Xmemcmp(tls, (*Tdfa)(unsafe.Pointer(d)).Fwork, (*Tsset)(unsafe.Pointer(p)).Fstates, (*Tdfa)(unsafe.Pointer(d)).Fwordsper*uint64(4)) == 0) { break /* NOTE BREAK OUT */ } goto _8 _8: ; p += 56 i-- } if i == uint64(0) { /* nope, need a new cache entry */ p = _getVacantSS(tls, v, d, cp, start) i = uint64(0) for { if !(i < (*Tdfa)(unsafe.Pointer(d)).Fwordsper) { break } *(*uint32)(unsafe.Pointer((*Tsset)(unsafe.Pointer(p)).Fstates + uintptr(i)*4)) = *(*uint32)(unsafe.Pointer((*Tdfa)(unsafe.Pointer(d)).Fwork + uintptr(i)*4)) goto _9 _9: ; i++ } (*Tsset)(unsafe.Pointer(p)).Fhash = h if isPost != 0 { v10 = int32(POSTSTATE) } else { v10 = 0 } (*Tsset)(unsafe.Pointer(p)).Fflags = v10 if noProgress != 0 { *(*int32)(unsafe.Pointer(p + 12)) |= int32(NOPROGRESS) } /* * lastseen to be dealt with by caller */ } if !(sawLAConstraints != 0) { /* lookahead conds. always cache miss */ *(*uintptr)(unsafe.Pointer((*Tsset)(unsafe.Pointer(css)).Fouts + uintptr(co)*8)) = p *(*Tarcp)(unsafe.Pointer((*Tsset)(unsafe.Pointer(css)).Finchain + uintptr(co)*16)) = (*Tsset)(unsafe.Pointer(p)).Fins (*Tsset)(unsafe.Pointer(p)).Fins.Fss = css (*Tsset)(unsafe.Pointer(p)).Fins.Fco = int16(co) } return p } // C documentation // // /* // - checkLAConstraint - lookahead-constraint checker for miss() // ^ static int checkLAConstraint(struct vars *, struct cnfa *, chr *, pcolor); // */ func _checkLAConstraint(tls *libc.TLS, v uintptr, pcnfa uintptr, cp uintptr, co Tpcolor) (r int32) { bp := tls.Alloc(16944) defer tls.Free(16944) /* "color" of the lookahead constraint */ var d, end, sub uintptr var n Tsize_t var v1, v2 int32 var _ /* sd at bp+0 */ Tsmalldfa _, _, _, _, _, _ = d, end, n, sub, v1, v2 n = libc.Uint64FromInt32(co - (*Tcnfa)(unsafe.Pointer(pcnfa)).Fncolors) sub = (*Tguts)(unsafe.Pointer((*Tvars1)(unsafe.Pointer(v)).Fg)).Flacons + uintptr(n)*120 d = _newDFA(tls, v, sub+48, (*Tvars1)(unsafe.Pointer(v)).Fg+104, bp) if d == libc.UintptrFromInt32(0) { if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { v1 = (*Tvars1)(unsafe.Pointer(v)).Ferr } else { v1 = int32(REG_ESPACE) } (*Tvars1)(unsafe.Pointer(v)).Ferr = v1 return 0 } end = _longest(tls, v, d, cp, (*Tvars1)(unsafe.Pointer(v)).Fstop, libc.UintptrFromInt32(0)) _freeDFA(tls, d) if (*Tsubre)(unsafe.Pointer(sub)).Fsubno != 0 { v2 = libc.BoolInt32(end != libc.UintptrFromInt32(0)) } else { v2 = libc.BoolInt32(end == libc.UintptrFromInt32(0)) } return v2 } // C documentation // // /* // - getVacantSS - get a vacant state set // * This routine clears out the inarcs and outarcs, but does not otherwise // * clear the innards of the state set -- that's up to the caller. // ^ static struct sset *getVacantSS(struct vars *, struct dfa *, chr *, chr *); // */ func _getVacantSS(tls *libc.TLS, v uintptr, d uintptr, cp uintptr, start uintptr) (r uintptr) { var ap, lastap Tarcp var co Tcolor var i int32 var p, ss, v1 uintptr _, _, _, _, _, _, _ = ap, co, i, lastap, p, ss, v1 lastap = Tarcp{} ss = _pickNextSS(tls, v, d, cp, start) /* * Clear out its inarcs, including self-referential ones. */ ap = (*Tsset)(unsafe.Pointer(ss)).Fins for { v1 = ap.Fss p = v1 if !(v1 != libc.UintptrFromInt32(0)) { break } co = ap.Fco *(*uintptr)(unsafe.Pointer((*Tsset)(unsafe.Pointer(p)).Fouts + uintptr(co)*8)) = libc.UintptrFromInt32(0) ap = *(*Tarcp)(unsafe.Pointer((*Tsset)(unsafe.Pointer(p)).Finchain + uintptr(co)*16)) (*(*Tarcp)(unsafe.Pointer((*Tsset)(unsafe.Pointer(p)).Finchain + uintptr(co)*16))).Fss = libc.UintptrFromInt32(0) /* paranoia */ } (*Tsset)(unsafe.Pointer(ss)).Fins.Fss = libc.UintptrFromInt32(0) /* * Take it off the inarc chains of the ssets reached by its outarcs. */ i = 0 for { if !(i < (*Tdfa)(unsafe.Pointer(d)).Fncolors) { break } p = *(*uintptr)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Fouts + uintptr(i)*8)) /* not self-referential */ if p == libc.UintptrFromInt32(0) { goto _2 /* NOTE CONTINUE */ } if (*Tsset)(unsafe.Pointer(p)).Fins.Fss == ss && int32((*Tsset)(unsafe.Pointer(p)).Fins.Fco) == i { (*Tsset)(unsafe.Pointer(p)).Fins = *(*Tarcp)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Finchain + uintptr(i)*16)) } else { ap = (*Tsset)(unsafe.Pointer(p)).Fins for { if !(ap.Fss != libc.UintptrFromInt32(0) && !(ap.Fss == ss && int32(ap.Fco) == i)) { break } lastap = ap goto _3 _3: ; ap = *(*Tarcp)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ap.Fss)).Finchain + uintptr(ap.Fco)*16)) } *(*Tarcp)(unsafe.Pointer((*Tsset)(unsafe.Pointer(lastap.Fss)).Finchain + uintptr(lastap.Fco)*16)) = *(*Tarcp)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Finchain + uintptr(i)*16)) } *(*uintptr)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Fouts + uintptr(i)*8)) = libc.UintptrFromInt32(0) (*(*Tarcp)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Finchain + uintptr(i)*16))).Fss = libc.UintptrFromInt32(0) goto _2 _2: ; i++ } /* * If ss was a success state, may need to remember location. */ if (*Tsset)(unsafe.Pointer(ss)).Fflags&int32(POSTSTATE) != 0 && (*Tsset)(unsafe.Pointer(ss)).Flastseen != (*Tdfa)(unsafe.Pointer(d)).Flastpost && ((*Tdfa)(unsafe.Pointer(d)).Flastpost == libc.UintptrFromInt32(0) || (*Tdfa)(unsafe.Pointer(d)).Flastpost < (*Tsset)(unsafe.Pointer(ss)).Flastseen) { (*Tdfa)(unsafe.Pointer(d)).Flastpost = (*Tsset)(unsafe.Pointer(ss)).Flastseen } /* * Likewise for a no-progress state. */ if (*Tsset)(unsafe.Pointer(ss)).Fflags&int32(NOPROGRESS) != 0 && (*Tsset)(unsafe.Pointer(ss)).Flastseen != (*Tdfa)(unsafe.Pointer(d)).Flastnopr && ((*Tdfa)(unsafe.Pointer(d)).Flastnopr == libc.UintptrFromInt32(0) || (*Tdfa)(unsafe.Pointer(d)).Flastnopr < (*Tsset)(unsafe.Pointer(ss)).Flastseen) { (*Tdfa)(unsafe.Pointer(d)).Flastnopr = (*Tsset)(unsafe.Pointer(ss)).Flastseen } return ss } // C documentation // // /* // - pickNextSS - pick the next stateset to be used // ^ static struct sset *pickNextSS(struct vars *, struct dfa *, chr *, chr *); // */ func _pickNextSS(tls *libc.TLS, v uintptr, d uintptr, cp uintptr, start uintptr) (r uintptr) { var ancient, end, ss uintptr var i, v4 int32 var j Tsize_t _, _, _, _, _, _ = ancient, end, i, j, ss, v4 /* * Shortcut for cases where cache isn't full. */ if (*Tdfa)(unsafe.Pointer(d)).Fnssused < (*Tdfa)(unsafe.Pointer(d)).Fnssets { j = (*Tdfa)(unsafe.Pointer(d)).Fnssused (*Tdfa)(unsafe.Pointer(d)).Fnssused++ ss = (*Tdfa)(unsafe.Pointer(d)).Fssets + uintptr(j)*56 /* * Set up innards. */ (*Tsset)(unsafe.Pointer(ss)).Fstates = (*Tdfa)(unsafe.Pointer(d)).Fstatesarea + uintptr(j*(*Tdfa)(unsafe.Pointer(d)).Fwordsper)*4 (*Tsset)(unsafe.Pointer(ss)).Fflags = 0 (*Tsset)(unsafe.Pointer(ss)).Fins.Fss = libc.UintptrFromInt32(0) (*Tsset)(unsafe.Pointer(ss)).Fins.Fco = WHITE /* give it some value */ (*Tsset)(unsafe.Pointer(ss)).Fouts = (*Tdfa)(unsafe.Pointer(d)).Foutsarea + uintptr(j*libc.Uint64FromInt32((*Tdfa)(unsafe.Pointer(d)).Fncolors))*8 (*Tsset)(unsafe.Pointer(ss)).Finchain = (*Tdfa)(unsafe.Pointer(d)).Fincarea + uintptr(j*libc.Uint64FromInt32((*Tdfa)(unsafe.Pointer(d)).Fncolors))*16 i = 0 for { if !(i < (*Tdfa)(unsafe.Pointer(d)).Fncolors) { break } *(*uintptr)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Fouts + uintptr(i)*8)) = libc.UintptrFromInt32(0) (*(*Tarcp)(unsafe.Pointer((*Tsset)(unsafe.Pointer(ss)).Finchain + uintptr(i)*16))).Fss = libc.UintptrFromInt32(0) goto _1 _1: ; i++ } return ss } /* * Look for oldest, or old enough anyway. */ if libc.Uint64FromInt64((int64(cp)-int64(start))/4) > (*Tdfa)(unsafe.Pointer(d)).Fnssets*uint64(2)/uint64(3) { /* oldest 33% are expendable */ ancient = cp - uintptr((*Tdfa)(unsafe.Pointer(d)).Fnssets*uint64(2)/uint64(3))*4 } else { ancient = start } ss = (*Tdfa)(unsafe.Pointer(d)).Fsearch end = (*Tdfa)(unsafe.Pointer(d)).Fssets + uintptr((*Tdfa)(unsafe.Pointer(d)).Fnssets)*56 for { if !(ss < end) { break } if ((*Tsset)(unsafe.Pointer(ss)).Flastseen == libc.UintptrFromInt32(0) || (*Tsset)(unsafe.Pointer(ss)).Flastseen < ancient) && !((*Tsset)(unsafe.Pointer(ss)).Fflags&libc.Int32FromInt32(LOCKED) != 0) { (*Tdfa)(unsafe.Pointer(d)).Fsearch = ss + uintptr(1)*56 return ss } goto _2 _2: ; ss += 56 } ss = (*Tdfa)(unsafe.Pointer(d)).Fssets end = (*Tdfa)(unsafe.Pointer(d)).Fsearch for { if !(ss < end) { break } if ((*Tsset)(unsafe.Pointer(ss)).Flastseen == libc.UintptrFromInt32(0) || (*Tsset)(unsafe.Pointer(ss)).Flastseen < ancient) && !((*Tsset)(unsafe.Pointer(ss)).Fflags&libc.Int32FromInt32(LOCKED) != 0) { (*Tdfa)(unsafe.Pointer(d)).Fsearch = ss + uintptr(1)*56 return ss } goto _3 _3: ; ss += 56 } /* * Nobody's old enough?!? -- something's really wrong. */ if (*Tvars1)(unsafe.Pointer(v)).Ferr != 0 { v4 = (*Tvars1)(unsafe.Pointer(v)).Ferr } else { v4 = int32(REG_ASSERT) } (*Tvars1)(unsafe.Pointer(v)).Ferr = v4 return (*Tdfa)(unsafe.Pointer(d)).Fssets } /* * Magic for allocating a variable workspace. This default version is * stack-hungry. */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ // C documentation // // /* // - regfree - free an RE (generic function, punts to RE-specific function) // * // * Ignoring invocation with NULL is a convenience. // */ func XTclReFree(tls *libc.TLS, re uintptr) { if re == libc.UintptrFromInt32(0) { return } (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tfns)(unsafe.Pointer((*Tregex_t)(unsafe.Pointer(re)).Fre_fns)).Ffree})))(tls, re) } /* * Magic for allocating a variable workspace. This default version is * stack-hungry. */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* * Unknown-error explanation. */ var _unk = [38]uint8{'*', '*', '*', ' ', 'u', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'r', 'e', 'g', 'e', 'x', ' ', 'e', 'r', 'r', 'o', 'r', ' ', 'c', 'o', 'd', 'e', ' ', '0', 'x', '%', 'x', ' ', '*', '*', '*'} /* * Struct to map among codes, code names, and explanations. */ type Trerr = struct { Fcode int32 Fname uintptr Fexplain uintptr } /* * Struct to map among codes, code names, and explanations. */ var _rerrs = [21]Trerr{ 0: { Fname: __ccgo_ts + 1192, Fexplain: __ccgo_ts + 1201, }, 1: { Fcode: int32(REG_NOMATCH), Fname: __ccgo_ts + 1220, Fexplain: __ccgo_ts + 1232, }, 2: { Fcode: int32(REG_BADPAT), Fname: __ccgo_ts + 1248, Fexplain: __ccgo_ts + 1259, }, 3: { Fcode: int32(REG_ECOLLATE), Fname: __ccgo_ts + 1292, Fexplain: __ccgo_ts + 1305, }, 4: { Fcode: int32(REG_ECTYPE), Fname: __ccgo_ts + 1331, Fexplain: __ccgo_ts + 1342, }, 5: { Fcode: int32(REG_EESCAPE), Fname: __ccgo_ts + 1366, Fexplain: __ccgo_ts + 1378, }, 6: { Fcode: int32(REG_ESUBREG), Fname: __ccgo_ts + 1404, Fexplain: __ccgo_ts + 1416, }, 7: { Fcode: int32(REG_EBRACK), Fname: __ccgo_ts + 1445, Fexplain: __ccgo_ts + 1456, }, 8: { Fcode: int32(REG_EPAREN), Fname: __ccgo_ts + 1481, Fexplain: __ccgo_ts + 1492, }, 9: { Fcode: int32(REG_EBRACE), Fname: __ccgo_ts + 1520, Fexplain: __ccgo_ts + 1531, }, 10: { Fcode: int32(REG_BADBR), Fname: __ccgo_ts + 1554, Fexplain: __ccgo_ts + 1564, }, 11: { Fcode: int32(REG_ERANGE), Fname: __ccgo_ts + 1592, Fexplain: __ccgo_ts + 1603, }, 12: { Fcode: int32(REG_ESPACE), Fname: __ccgo_ts + 1627, Fexplain: __ccgo_ts + 1638, }, 13: { Fcode: int32(REG_BADRPT), Fname: __ccgo_ts + 1652, Fexplain: __ccgo_ts + 1663, }, 14: { Fcode: int32(REG_ASSERT), Fname: __ccgo_ts + 1690, Fexplain: __ccgo_ts + 1701, }, 15: { Fcode: int32(REG_INVARG), Fname: __ccgo_ts + 1736, Fexplain: __ccgo_ts + 1747, }, 16: { Fcode: int32(REG_MIXED), Fname: __ccgo_ts + 1782, Fexplain: __ccgo_ts + 1792, }, 17: { Fcode: int32(REG_BADOPT), Fname: __ccgo_ts + 1836, Fexplain: __ccgo_ts + 1847, }, 18: { Fcode: int32(REG_ETOOBIG), Fname: __ccgo_ts + 1871, Fexplain: __ccgo_ts + 1883, }, 19: { Fcode: int32(REG_ECOLORS), Fname: __ccgo_ts + 1917, Fexplain: __ccgo_ts + 1929, }, 20: { Fcode: -int32(1), Fname: __ccgo_ts + 1945, Fexplain: __ccgo_ts + 1946, }, } // C documentation // // /* // - regerror - the interface to error numbers // */ func XTclReError(tls *libc.TLS, code int32, errbuf uintptr, errbuf_size Tsize_t) (r1 Tsize_t) { bp := tls.Alloc(112) defer tls.Free(112) /* Available space in errbuf, can be 0 */ var icode int32 var len1 Tsize_t var msg, r uintptr var _ /* convbuf at bp+0 */ [88]uint8 _, _, _, _ = icode, len1, msg, r switch code { case int32(REG_ATOI): goto _1 case int32(REG_ITOA): goto _2 default: goto _3 } goto _4 _1: ; /* Convert name to number */ r = uintptr(unsafe.Pointer(&_rerrs)) _7: ; if !((*Trerr)(unsafe.Pointer(r)).Fcode >= 0) { goto _5 } if libc.Xstrcmp(tls, (*Trerr)(unsafe.Pointer(r)).Fname, errbuf) == 0 { goto _5 } goto _6 _6: ; r += 24 goto _7 goto _5 _5: ; libc.X__builtin_snprintf(tls, bp, uint64(88), __ccgo_ts+260, libc.VaList(bp+96, (*Trerr)(unsafe.Pointer(r)).Fcode)) /* -1 for unknown */ msg = bp goto _4 _2: ; /* Convert number to name */ icode = libc.Xatoi(tls, errbuf) /* Not our problem if this fails */ r = uintptr(unsafe.Pointer(&_rerrs)) for { if !((*Trerr)(unsafe.Pointer(r)).Fcode >= 0) { break } if (*Trerr)(unsafe.Pointer(r)).Fcode == icode { break } goto _8 _8: ; r += 24 } if (*Trerr)(unsafe.Pointer(r)).Fcode >= 0 { msg = (*Trerr)(unsafe.Pointer(r)).Fname } else { /* Unknown; tell him the number */ libc.X__builtin_snprintf(tls, bp, uint64(88), __ccgo_ts+1951, libc.VaList(bp+96, icode)) msg = bp } goto _4 _3: ; /* A real, normal error code */ r = uintptr(unsafe.Pointer(&_rerrs)) for { if !((*Trerr)(unsafe.Pointer(r)).Fcode >= 0) { break } if (*Trerr)(unsafe.Pointer(r)).Fcode == code { break } goto _9 _9: ; r += 24 } if (*Trerr)(unsafe.Pointer(r)).Fcode >= 0 { msg = (*Trerr)(unsafe.Pointer(r)).Fexplain } else { /* Unknown; say so */ libc.X__builtin_snprintf(tls, bp, uint64(88), uintptr(unsafe.Pointer(&_unk)), libc.VaList(bp+96, code)) msg = bp } goto _4 _4: ; len1 = libc.Xstrlen(tls, msg) + uint64(1) /* Space needed, including NUL */ if errbuf_size > uint64(0) { if errbuf_size > len1 { libc.Xstrcpy(tls, errbuf, msg) } else { /* Truncate to fit */ libc.Xstrncpy(tls, errbuf, msg, errbuf_size-uint64(1)) *(*uint8)(unsafe.Pointer(errbuf + uintptr(errbuf_size-uint64(1)))) = uint8('\000') } } return len1 } const FP_FAST_FMA = 1 const FP_FAST_FMAF = 1 const FP_FAST_FMAL = 1 const FP_ILOGB0 = -2147483648 const FP_ILOGBNAN = -2147483648 const FP_INFINITE = 1 const FP_NAN = 0 const FP_NORMAL = 4 const FP_SUBNORMAL = 3 const FP_ZERO = 2 const HUGE = 0 const HUGE_VALF = 0 const INFINITY = 0 const MATH_ERREXCEPT = 2 const MATH_ERRNO = 1 const M_1_PI = 0 const M_2_PI = 0 const M_2_SQRTPI = 0 const M_E = 0 const M_LN10 = 0 const M_LN2 = 0 const M_LOG10E = 0 const M_LOG2E = 0 const M_PI = 0 const M_PI_2 = 0 const M_PI_4 = 0 const M_SQRT1_2 = 0 const M_SQRT2 = 0 const NAN = 0 const math_errhandling = 2 type Tfloat_t = float32 type Tdouble_t = float64 /* * The structure below defines the arithmetic series Tcl object type by * means of procedures that can be invoked by generic object code. * * The arithmetic series object is a special case of Tcl list representing * an interval of an arithmetic series in constant space. * * The arithmetic series is internally represented with three integers, * *start*, *end*, and *step*, Where the length is calculated with * the following algorithm: * * if RANGE == 0 THEN * ERROR * if RANGE > 0 * LEN is (((END-START)-1)/STEP) + 1 * else if RANGE < 0 * LEN is (((END-START)-1)/STEP) - 1 * * And where the equivalent's list I-th element is calculated * as: * * LIST[i] = START + (STEP * i) * * Zero elements ranges, like in the case of START=10 END=10 STEP=1 * are valid and will be equivalent to the empty list. */ /* * The structure used for the ArithSeries internal representation. * Note that the len can in theory be always computed by start,end,step * but it's faster to cache it inside the internal representation. */ type TArithSeries = struct { Flen1 TTcl_Size Felements uintptr FisDouble int32 } type TArithSeriesInt = struct { Fbase TArithSeries Fstart TTcl_WideInt Fend TTcl_WideInt Fstep TTcl_WideInt } type TArithSeriesDbl = struct { Fbase TArithSeries Fstart float64 Fend float64 Fstep float64 Fprecision uint32 } /* ------------------------ ArithSeries object type -------------------------- */ var _arithSeriesType = TTcl_ObjType{ Fname: __ccgo_ts + 1958, Fversion: uint64(112), } func init() { p := unsafe.Pointer(&_arithSeriesType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_FreeArithSeriesInternalRep) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_DupArithSeriesInternalRep) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_UpdateStringOfArithSeries) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_SetArithSeriesFromAny) *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_ArithSeriesObjLength) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_TclArithSeriesObjIndex) *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_TclArithSeriesObjRange) *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_TclArithSeriesObjReverse) *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_TclArithSeriesGetElements) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_ArithSeriesInOperation) } /* * Helper functions * * - power10 -- Fast version of pow(10, (int) n) for common cases. * - ArithRound -- Round doubles to the number of significant fractional * digits * - ArithSeriesIndexDbl -- base list indexing operation for doubles * - ArithSeriesIndexInt -- " " " " " integers * - ArithSeriesGetInternalRep -- Return the internal rep from a Tcl_Obj * - Precision -- determine the number of factional digits for the given * double value * - maxPrecision -- Using the values provide, determine the longest percision * in the arithSeries */ func _power10(tls *libc.TLS, n uint32) (r float64) { if uint64(n) < libc.Uint64FromInt64(168)/libc.Uint64FromInt64(8) { return _powers[n] } else { // Not an expected case. Doesn't need to be so fast return libc.Xpow(tls, libc.Float64FromInt32(10), float64(n)) } return r } var _powers = [21]float64{ 0: libc.Float64FromInt32(1), 1: libc.Float64FromInt32(10), 2: libc.Float64FromInt32(100), 3: libc.Float64FromInt32(1000), 4: float64(10000), 5: float64(100000), 6: float64(1e+06), 7: float64(1e+07), 8: float64(1e+08), 9: float64(1e+09), 10: float64(1e+10), 11: float64(1e+11), 12: float64(1e+12), 13: float64(1e+13), 14: float64(1e+14), 15: float64(1e+15), 16: float64(1e+16), 17: float64(1e+17), 18: float64(1e+18), 19: float64(1e+19), 20: float64(1e+20), } func _ArithRound(tls *libc.TLS, d float64, n uint32) (r float64) { var scalefactor float64 _ = scalefactor scalefactor = _power10(tls, n) return libc.X__builtin_round(tls, float64(d*scalefactor)) / scalefactor } func _ArithSeriesIndexDbl(tls *libc.TLS, arithSeriesRepPtr uintptr, index TTcl_WideInt) (r float64) { var d float64 var dblRepPtr, intRepPtr uintptr _, _, _ = d, dblRepPtr, intRepPtr if (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).FisDouble != 0 { dblRepPtr = arithSeriesRepPtr d = (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstart + float64(float64(index)*(*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstep) return _ArithRound(tls, d, (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fprecision) } else { intRepPtr = arithSeriesRepPtr return float64((*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstart + index*(*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstep) } return r } func _ArithSeriesIndexInt(tls *libc.TLS, arithSeriesRepPtr uintptr, index TTcl_WideInt) (r TTcl_WideInt) { var dblRepPtr, intRepPtr uintptr _, _ = dblRepPtr, intRepPtr if (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).FisDouble != 0 { dblRepPtr = arithSeriesRepPtr return int64((*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstart + float64(float64(index)*(*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstep)) } else { intRepPtr = arithSeriesRepPtr return (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstart + index*(*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstep } return r } func _ArithSeriesGetInternalRep(tls *libc.TLS, objPtr uintptr) (r uintptr) { var irPtr, v1, v2 uintptr _, _, _ = irPtr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_arithSeriesType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } return v2 } // C documentation // // /* // * Compute number of significant fractional digits // */ func _Precision(tls *libc.TLS, d float64) (r uint32) { bp := tls.Alloc(32) defer tls.Free(32) var off uintptr var v1 uint64 var _ /* tmp at bp+0 */ [29]uint8 _, _ = off, v1 (*(*[29]uint8)(unsafe.Pointer(bp)))[0] = uint8(0) XTcl_PrintDouble(tls, libc.UintptrFromInt32(0), d, bp) off = libc.Xstrchr(tls, bp, int32('.')) if off != 0 { v1 = libc.Xstrlen(tls, off+uintptr(1)) } else { v1 = uint64(0) } return uint32(v1) } // C documentation // // /* // * Find longest number of digits after the decimal point. // */ func _maxPrecision(tls *libc.TLS, start float64, end float64, step float64) (r uint32) { var dp, i, v1, v2 uint32 _, _, _, _ = dp, i, v1, v2 dp = _Precision(tls, step) i = _Precision(tls, start) if i > dp { v1 = i } else { v1 = dp } dp = v1 i = _Precision(tls, end) if i > dp { v2 = i } else { v2 = dp } dp = v2 return dp } // C documentation // // /* // *---------------------------------------------------------------------- // * // * ArithSeriesLen -- // * // * Compute the length of the equivalent list where // * every element is generated starting from *start*, // * and adding *step* to generate every successive element // * that's < *end* for positive steps, or > *end* for negative // * steps. // * // * Results: // * The length of the list generated by the given range, // * that may be zero. // * The function returns -1 if the list is of length infinite. // * // * Side effects: // * None. // * // *---------------------------------------------------------------------- // */ func _ArithSeriesLenInt(tls *libc.TLS, start TTcl_WideInt, end TTcl_WideInt, step TTcl_WideInt) (r TTcl_WideInt) { var len1 TTcl_WideInt var v1 int64 _, _ = len1, v1 if step == 0 { return 0 } len1 = int64(1) + (end-start)/step if len1 < 0 { v1 = int64(-int32(1)) } else { v1 = len1 } return v1 } func _ArithSeriesLenDbl(tls *libc.TLS, start float64, end float64, step float64, precision uint32) (r TTcl_WideInt) { var iend, ilen, istart, istep float64 _, _, _, _ = iend, ilen, istart, istep if step == libc.Float64FromInt32(0) { return 0 } istart = float64(start * _power10(tls, precision)) iend = float64(end * _power10(tls, precision)) istep = float64(step * _power10(tls, precision)) ilen = (iend - istart + istep) / istep return int64(libc.Xfloor(tls, ilen)) } /* *---------------------------------------------------------------------- * * DupArithSeriesInternalRep -- * * Initialize the internal representation of a arithseries Tcl_Obj to a * copy of the internal representation of an existing arithseries object. * The copy does not share the cache of the elements. * * Results: * None. * * Side effects: * We set "copyPtr"s internal rep to a pointer to a * newly allocated ArithSeries structure. * *---------------------------------------------------------------------- */ func _DupArithSeriesInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { /* Object with internal rep to set. */ var copyDblPtr, copyIntPtr, srcDblPtr, srcIntPtr, srcRepPtr uintptr _, _, _, _, _ = copyDblPtr, copyIntPtr, srcDblPtr, srcIntPtr, srcRepPtr srcRepPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(srcPtr + 32))).Fptr1 if (*TArithSeries)(unsafe.Pointer(srcRepPtr)).FisDouble != 0 { srcDblPtr = srcRepPtr copyDblPtr = XTcl_Alloc(tls, uint64(56)) *(*TArithSeriesDbl)(unsafe.Pointer(copyDblPtr)) = *(*TArithSeriesDbl)(unsafe.Pointer(srcDblPtr)) (*TArithSeriesDbl)(unsafe.Pointer(copyDblPtr)).Fbase.Felements = libc.UintptrFromInt32(0) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr1 = copyDblPtr } else { srcIntPtr = srcRepPtr copyIntPtr = XTcl_Alloc(tls, uint64(48)) *(*TArithSeriesInt)(unsafe.Pointer(copyIntPtr)) = *(*TArithSeriesInt)(unsafe.Pointer(srcIntPtr)) (*TArithSeriesInt)(unsafe.Pointer(copyIntPtr)).Fbase.Felements = libc.UintptrFromInt32(0) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr1 = copyIntPtr } (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr2 = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&_arithSeriesType)) } /* *---------------------------------------------------------------------- * * FreeArithSeriesInternalRep -- * * Free any allocated memory in the ArithSeries Rep * * Results: * None. * * Side effects: * *---------------------------------------------------------------------- */ func _FreeElements(tls *libc.TLS, arithSeriesRepPtr uintptr) { var _objPtr, v3 uintptr var i, len1 TTcl_WideInt var v2 TTcl_Size _, _, _, _, _ = _objPtr, i, len1, v2, v3 if (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Felements != 0 { len1 = (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 i = 0 for { if !(i < len1) { break } _objPtr = *(*uintptr)(unsafe.Pointer((*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Felements + uintptr(i)*8)) v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } goto _1 _1: ; i++ } XTclpFree(tls, (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Felements) (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Felements = libc.UintptrFromInt32(0) } } func _FreeArithSeriesInternalRep(tls *libc.TLS, arithSeriesObjPtr uintptr) { var arithSeriesRepPtr uintptr _ = arithSeriesRepPtr arithSeriesRepPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObjPtr + 32))).Fptr1 if arithSeriesRepPtr != 0 { _FreeElements(tls, arithSeriesRepPtr) XTclpFree(tls, arithSeriesRepPtr) } } // C documentation // // /* // *---------------------------------------------------------------------- // * // * NewArithSeriesInt -- // * // * Creates a new ArithSeries object. The returned object has // * refcount = 0. // * // * Results: // * A Tcl_Obj pointer to the created ArithSeries object. // * A NULL pointer of the range is invalid. // * // * Side Effects: // * None. // * // *---------------------------------------------------------------------- // */ func _NewArithSeriesInt(tls *libc.TLS, start TTcl_WideInt, end TTcl_WideInt, step TTcl_WideInt, len1 TTcl_WideInt) (r uintptr) { var arithSeriesObj, arithSeriesRepPtr, cachePtr uintptr var length TTcl_WideInt var v1 int64 var v2 bool _, _, _, _, _, _ = arithSeriesObj, arithSeriesRepPtr, cachePtr, length, v1, v2 if len1 >= 0 { v1 = len1 } else { v1 = int64(-int32(1)) } length = v1 if length < 0 { length = int64(-int32(1)) } if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { arithSeriesObj = XTclThreadAllocObj(tls) } else { arithSeriesObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).FtypePtr = libc.UintptrFromInt32(0) if length <= 0 { return arithSeriesObj } arithSeriesRepPtr = XTcl_Alloc(tls, uint64(48)) (*TArithSeriesInt)(unsafe.Pointer(arithSeriesRepPtr)).Fbase.Flen1 = length (*TArithSeriesInt)(unsafe.Pointer(arithSeriesRepPtr)).Fbase.Felements = libc.UintptrFromInt32(0) (*TArithSeriesInt)(unsafe.Pointer(arithSeriesRepPtr)).Fbase.FisDouble = 0 (*TArithSeriesInt)(unsafe.Pointer(arithSeriesRepPtr)).Fstart = start (*TArithSeriesInt)(unsafe.Pointer(arithSeriesRepPtr)).Fend = end (*TArithSeriesInt)(unsafe.Pointer(arithSeriesRepPtr)).Fstep = step (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObj + 32))).Fptr1 = arithSeriesRepPtr (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObj + 32))).Fptr2 = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).FtypePtr = uintptr(unsafe.Pointer(&_arithSeriesType)) if length > 0 { XTcl_InvalidateStringRep(tls, arithSeriesObj) } return arithSeriesObj } // C documentation // // /* // *---------------------------------------------------------------------- // * // * NewArithSeriesDbl -- // * // * Creates a new ArithSeries object with doubles. The returned object has // * refcount = 0. // * // * Results: // * A Tcl_Obj pointer to the created ArithSeries object. // * A NULL pointer of the range is invalid. // * // * Side Effects: // * None. // *---------------------------------------------------------------------- // */ func _NewArithSeriesDbl(tls *libc.TLS, start float64, end float64, step float64, len1 TTcl_WideInt) (r uintptr) { var arithSeriesObj, arithSeriesRepPtr, cachePtr uintptr var length TTcl_WideInt var v1 int64 var v2 bool _, _, _, _, _, _ = arithSeriesObj, arithSeriesRepPtr, cachePtr, length, v1, v2 if len1 >= 0 { v1 = len1 } else { v1 = int64(-int32(1)) } length = v1 if length < 0 { length = int64(-int32(1)) } if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { arithSeriesObj = XTclThreadAllocObj(tls) } else { arithSeriesObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).FtypePtr = libc.UintptrFromInt32(0) if length <= 0 { return arithSeriesObj } arithSeriesRepPtr = XTcl_Alloc(tls, uint64(56)) (*TArithSeriesDbl)(unsafe.Pointer(arithSeriesRepPtr)).Fbase.Flen1 = length (*TArithSeriesDbl)(unsafe.Pointer(arithSeriesRepPtr)).Fbase.Felements = libc.UintptrFromInt32(0) (*TArithSeriesDbl)(unsafe.Pointer(arithSeriesRepPtr)).Fbase.FisDouble = int32(1) (*TArithSeriesDbl)(unsafe.Pointer(arithSeriesRepPtr)).Fstart = start (*TArithSeriesDbl)(unsafe.Pointer(arithSeriesRepPtr)).Fend = end (*TArithSeriesDbl)(unsafe.Pointer(arithSeriesRepPtr)).Fstep = step (*TArithSeriesDbl)(unsafe.Pointer(arithSeriesRepPtr)).Fprecision = _maxPrecision(tls, start, end, step) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObj + 32))).Fptr1 = arithSeriesRepPtr (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObj + 32))).Fptr2 = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).FtypePtr = uintptr(unsafe.Pointer(&_arithSeriesType)) if length > 0 { XTcl_InvalidateStringRep(tls, arithSeriesObj) } return arithSeriesObj } // C documentation // // /* // *---------------------------------------------------------------------- // * // * assignNumber -- // * // * Create the appropriate Tcl_Obj value for the given numeric values. // * Used locally only for decoding [lseq] numeric arguments. // * refcount = 0. // * // * Results: // * A Tcl_Obj pointer. No assignment on error. // * // * Side Effects: // * None. // *---------------------------------------------------------------------- // */ func _assignNumber(tls *libc.TLS, interp uintptr, useDoubles int32, intNumberPtr uintptr, dblNumberPtr uintptr, numberObj uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _ /* clientData at bp+0 */ uintptr var _ /* tcl_number_type at bp+8 */ int32 var _ /* w at bp+16 */ TTcl_WideInt if XTcl_GetNumberFromObj(tls, interp, numberObj, bp, bp+8) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 8)) == int32(TCL_NUMBER_BIG) { XTcl_GetWideIntFromObj(tls, interp, numberObj, bp+16) return int32(TCL_ERROR) } if useDoubles != 0 { if *(*int32)(unsafe.Pointer(bp + 8)) != int32(TCL_NUMBER_INT) { *(*float64)(unsafe.Pointer(dblNumberPtr)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) } else { *(*float64)(unsafe.Pointer(dblNumberPtr)) = float64(*(*TTcl_WideInt)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) } } else { if *(*int32)(unsafe.Pointer(bp + 8)) == int32(TCL_NUMBER_INT) { *(*TTcl_WideInt)(unsafe.Pointer(intNumberPtr)) = *(*TTcl_WideInt)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) } else { *(*TTcl_WideInt)(unsafe.Pointer(intNumberPtr)) = int64(*(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) } } return TCL_OK } // C documentation // // /* // *---------------------------------------------------------------------- // * // * TclNewArithSeriesObj -- // * // * Creates a new ArithSeries object. Some arguments may be NULL and will // * be computed based on the other given arguments. // * refcount = 0. // * // * Results: // * A Tcl_Obj pointer to the created ArithSeries object. // * NULL if the range is invalid. // * // * Side Effects: // * None. // *---------------------------------------------------------------------- // */ func XTclNewArithSeriesObj(tls *libc.TLS, interp uintptr, useDoubles int32, startObj uintptr, endObj uintptr, stepObj uintptr, lenObj uintptr) (r uintptr) { bp := tls.Alloc(96) defer tls.Free(96) /* Number of elements */ var cachePtr, objPtr, v4 uintptr var precision, precision1 uint32 var v1 bool var v2 float64 var v3 int32 var _ /* dend at bp+8 */ float64 var _ /* dstart at bp+0 */ float64 var _ /* dstep at bp+16 */ float64 var _ /* end at bp+32 */ TTcl_WideInt var _ /* len at bp+48 */ TTcl_WideInt var _ /* start at bp+24 */ TTcl_WideInt var _ /* step at bp+40 */ TTcl_WideInt _, _, _, _, _, _, _, _ = cachePtr, objPtr, precision, precision1, v1, v2, v3, v4 *(*TTcl_WideInt)(unsafe.Pointer(bp + 48)) = int64(-int32(1)) if startObj != 0 { if _assignNumber(tls, interp, useDoubles, bp+24, bp, startObj) != TCL_OK { return libc.UintptrFromInt32(0) } } else { *(*TTcl_WideInt)(unsafe.Pointer(bp + 24)) = 0 *(*float64)(unsafe.Pointer(bp)) = float64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 24))) } if stepObj != 0 { if _assignNumber(tls, interp, useDoubles, bp+40, bp+16, stepObj) != TCL_OK { return libc.UintptrFromInt32(0) } if useDoubles != 0 { *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) = int64(*(*float64)(unsafe.Pointer(bp + 16))) } else { *(*float64)(unsafe.Pointer(bp + 16)) = float64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 40))) } if *(*float64)(unsafe.Pointer(bp + 16)) == libc.Float64FromInt32(0) { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) return objPtr } } if endObj != 0 { if _assignNumber(tls, interp, useDoubles, bp+32, bp+8, endObj) != TCL_OK { return libc.UintptrFromInt32(0) } } if lenObj != 0 { if TCL_OK != XTcl_GetWideIntFromObj(tls, interp, lenObj, bp+48) { return libc.UintptrFromInt32(0) } } if startObj != 0 && endObj != 0 { if !(stepObj != 0) { if useDoubles != 0 { if *(*float64)(unsafe.Pointer(bp)) < *(*float64)(unsafe.Pointer(bp + 8)) { v2 = float64(1) } else { v2 = -libc.Float64FromFloat64(1) } *(*float64)(unsafe.Pointer(bp + 16)) = v2 *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) = int64(*(*float64)(unsafe.Pointer(bp + 16))) } else { if *(*TTcl_WideInt)(unsafe.Pointer(bp + 24)) < *(*TTcl_WideInt)(unsafe.Pointer(bp + 32)) { v3 = int32(1) } else { v3 = -int32(1) } *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) = int64(v3) *(*float64)(unsafe.Pointer(bp + 16)) = float64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 40))) } } if !(lenObj != 0) { if useDoubles != 0 { precision = _maxPrecision(tls, *(*float64)(unsafe.Pointer(bp)), *(*float64)(unsafe.Pointer(bp + 8)), *(*float64)(unsafe.Pointer(bp + 16))) *(*TTcl_WideInt)(unsafe.Pointer(bp + 48)) = _ArithSeriesLenDbl(tls, *(*float64)(unsafe.Pointer(bp)), *(*float64)(unsafe.Pointer(bp + 8)), *(*float64)(unsafe.Pointer(bp + 16)), precision) } else { *(*TTcl_WideInt)(unsafe.Pointer(bp + 48)) = _ArithSeriesLenInt(tls, *(*TTcl_WideInt)(unsafe.Pointer(bp + 24)), *(*TTcl_WideInt)(unsafe.Pointer(bp + 32)), *(*TTcl_WideInt)(unsafe.Pointer(bp + 40))) } } } if !(endObj != 0) { if useDoubles != 0 { // Compute precision based on given command argument values precision1 = _maxPrecision(tls, *(*float64)(unsafe.Pointer(bp)), float64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 48))), *(*float64)(unsafe.Pointer(bp + 16))) *(*float64)(unsafe.Pointer(bp + 8)) = *(*float64)(unsafe.Pointer(bp)) + float64(*(*float64)(unsafe.Pointer(bp + 16))*float64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 48))-libc.Int64FromInt32(1))) // Make computed end value match argument(s) precision *(*float64)(unsafe.Pointer(bp + 8)) = _ArithRound(tls, *(*float64)(unsafe.Pointer(bp + 8)), precision1) *(*TTcl_WideInt)(unsafe.Pointer(bp + 32)) = int64(*(*float64)(unsafe.Pointer(bp + 8))) } else { *(*TTcl_WideInt)(unsafe.Pointer(bp + 32)) = *(*TTcl_WideInt)(unsafe.Pointer(bp + 24)) + *(*TTcl_WideInt)(unsafe.Pointer(bp + 40))*(*(*TTcl_WideInt)(unsafe.Pointer(bp + 48))-int64(1)) *(*float64)(unsafe.Pointer(bp + 8)) = float64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 32))) } } if *(*TTcl_WideInt)(unsafe.Pointer(bp + 48)) > int64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+1970, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, __ccgo_ts+2004, __ccgo_ts+2008, libc.UintptrFromInt32(0))) return libc.UintptrFromInt32(0) } if useDoubles != 0 { v4 = _NewArithSeriesDbl(tls, *(*float64)(unsafe.Pointer(bp)), *(*float64)(unsafe.Pointer(bp + 8)), *(*float64)(unsafe.Pointer(bp + 16)), *(*TTcl_WideInt)(unsafe.Pointer(bp + 48))) } else { v4 = _NewArithSeriesInt(tls, *(*TTcl_WideInt)(unsafe.Pointer(bp + 24)), *(*TTcl_WideInt)(unsafe.Pointer(bp + 32)), *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)), *(*TTcl_WideInt)(unsafe.Pointer(bp + 48))) } objPtr = v4 return objPtr } // C documentation // // /* // *---------------------------------------------------------------------- // * // * TclArithSeriesObjIndex -- // * // * Returns the element with the specified index in the list // * represented by the specified Arithmetic Sequence object. // * If the index is out of range, TCL_ERROR is returned, // * otherwise TCL_OK is returned and the integer value of the // * element is stored in *element. // * // * Results: // * TCL_OK on success. // * // * Side Effects: // * On success, the integer pointed by *element is modified. // * An empty string ("") is assigned if index is out-of-bounds. // * // *---------------------------------------------------------------------- // */ func _TclArithSeriesObjIndex(tls *libc.TLS, dummy677 uintptr, arithSeriesObj uintptr, index TTcl_Size, elemObj uintptr) (r int32) { /* Return value */ var arithSeriesRepPtr uintptr _ = arithSeriesRepPtr arithSeriesRepPtr = _ArithSeriesGetInternalRep(tls, arithSeriesObj) if index < 0 || (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 <= index { *(*uintptr)(unsafe.Pointer(elemObj)) = libc.UintptrFromInt32(0) } else { /* List[i] = Start + (Step * index) */ if (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).FisDouble != 0 { *(*uintptr)(unsafe.Pointer(elemObj)) = XTcl_NewDoubleObj(tls, _ArithSeriesIndexDbl(tls, arithSeriesRepPtr, index)) } else { *(*uintptr)(unsafe.Pointer(elemObj)) = XTcl_NewWideIntObj(tls, _ArithSeriesIndexInt(tls, arithSeriesRepPtr, index)) } } return TCL_OK } // C documentation // // /* // *---------------------------------------------------------------------- // * // * ArithSeriesObjLength // * // * Returns the length of the arithmetic series. // * // * Results: // * The length of the series as Tcl_WideInt. // * // * Side Effects: // * None. // * // *---------------------------------------------------------------------- // */ func _ArithSeriesObjLength(tls *libc.TLS, arithSeriesObj uintptr) (r TTcl_Size) { var arithSeriesRepPtr uintptr _ = arithSeriesRepPtr arithSeriesRepPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObj + 32))).Fptr1 return (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 } /* *---------------------------------------------------------------------- * * TclArithSeriesObjStep -- * * Return a Tcl_Obj with the step value from the give ArithSeries Obj. * refcount = 0. * * Results: * A Tcl_Obj pointer to the created ArithSeries object. * A NULL pointer of the range is invalid. * * Side Effects: * None. *---------------------------------------------------------------------- */ func _TclArithSeriesObjStep(tls *libc.TLS, arithSeriesObj uintptr, stepObj uintptr) (r int32) { var arithSeriesRepPtr uintptr _ = arithSeriesRepPtr arithSeriesRepPtr = _ArithSeriesGetInternalRep(tls, arithSeriesObj) if (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).FisDouble != 0 { *(*uintptr)(unsafe.Pointer(stepObj)) = XTcl_NewDoubleObj(tls, (*TArithSeriesDbl)(unsafe.Pointer(arithSeriesRepPtr)).Fstep) } else { *(*uintptr)(unsafe.Pointer(stepObj)) = XTcl_NewWideIntObj(tls, (*TArithSeriesInt)(unsafe.Pointer(arithSeriesRepPtr)).Fstep) } return TCL_OK } /* *---------------------------------------------------------------------- * * SetArithSeriesFromAny -- * * The Arithmetic Series object is just an way to optimize * Lists space complexity, so no one should try to convert * a string to an Arithmetic Series object. * * This function is here just to populate the Type structure. * * Results: * The result is always TCL_ERROR. But see Side Effects. * * Side effects: * Tcl Panic if called. * *---------------------------------------------------------------------- */ func _SetArithSeriesFromAny(tls *libc.TLS, dummy776 uintptr, dummy777 uintptr) (r int32) { /* The object to convert. */ XTcl_Panic(tls, __ccgo_ts+2015, 0) return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * TclArithSeriesObjRange -- * * Makes a slice of an ArithSeries value. * *arithSeriesObj must be known to be a valid list. * * Results: * Returns a pointer to the sliced series. * This may be a new object or the same object if not shared. * * Side effects: * ?The possible conversion of the object referenced by listPtr? * ?to a list object.? * *---------------------------------------------------------------------- */ func _TclArithSeriesObjRange(tls *libc.TLS, interp uintptr, arithSeriesObj uintptr, fromIdx TTcl_Size, toIdx TTcl_Size, newObjPtr uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) /* return value */ var _isobjPtr, _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, arithSeriesRepPtr, cachePtr, dblRepPtr, intRepPtr, newSlicePtr, v10, v12, v14, v3, v5, v7 uintptr var v1 bool var v11, v13, v2, v4, v6, v9 TTcl_Size var v8 int32 var _ /* end at bp+32 */ float64 var _ /* end at bp+56 */ TTcl_WideInt var _ /* endObj at bp+8 */ uintptr var _ /* start at bp+24 */ float64 var _ /* start at bp+48 */ TTcl_WideInt var _ /* startObj at bp+0 */ uintptr var _ /* step at bp+40 */ float64 var _ /* step at bp+64 */ TTcl_WideInt var _ /* stepObj at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _isobjPtr, _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, arithSeriesRepPtr, cachePtr, dblRepPtr, intRepPtr, newSlicePtr, v1, v10, v11, v12, v13, v14, v2, v3, v4, v5, v6, v7, v8, v9 _ = interp /* silence compiler */ arithSeriesRepPtr = _ArithSeriesGetInternalRep(tls, arithSeriesObj) if fromIdx == int64(-libc.Int32FromInt32(1)) { fromIdx = 0 } if toIdx >= (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 { toIdx = (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 - int64(1) } if fromIdx > toIdx || fromIdx >= (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(newObjPtr)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(newObjPtr)) = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(newObjPtr)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(newObjPtr)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(newObjPtr)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(newObjPtr)))).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(newObjPtr)))).FtypePtr = libc.UintptrFromInt32(0) return TCL_OK } if fromIdx < 0 { fromIdx = 0 } if toIdx < 0 { toIdx = 0 } if toIdx > (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1-int64(1) { toIdx = (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 - int64(1) } _TclArithSeriesObjIndex(tls, interp, arithSeriesObj, fromIdx, bp) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount++ _TclArithSeriesObjIndex(tls, interp, arithSeriesObj, toIdx, bp+8) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++ _TclArithSeriesObjStep(tls, arithSeriesObj, bp+16) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).FrefCount > int64(1) { newSlicePtr = XTclNewArithSeriesObj(tls, interp, (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).FisDouble, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)), libc.UintptrFromInt32(0)) *(*uintptr)(unsafe.Pointer(newObjPtr)) = newSlicePtr _objPtr = *(*uintptr)(unsafe.Pointer(bp)) v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 8)) v5 = _objPtr1 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr1) } _objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 16)) v7 = _objPtr2 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr2) } if newSlicePtr != 0 { v8 = TCL_OK } else { v8 = int32(TCL_ERROR) } return v8 } /* * In-place is possible. */ /* * Even if nothing below causes any changes, we still want the * string-canonizing effect of [lrange 0 end]. */ _isobjPtr = arithSeriesObj if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } if (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).FisDouble != 0 { dblRepPtr = arithSeriesRepPtr XTcl_GetDoubleFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), bp+24) XTcl_GetDoubleFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), bp+32) XTcl_GetDoubleFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 16)), bp+40) (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstart = *(*float64)(unsafe.Pointer(bp + 24)) (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fend = *(*float64)(unsafe.Pointer(bp + 32)) (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstep = *(*float64)(unsafe.Pointer(bp + 40)) (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fprecision = _maxPrecision(tls, *(*float64)(unsafe.Pointer(bp + 24)), *(*float64)(unsafe.Pointer(bp + 32)), *(*float64)(unsafe.Pointer(bp + 40))) _FreeElements(tls, arithSeriesRepPtr) (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fbase.Flen1 = _ArithSeriesLenDbl(tls, *(*float64)(unsafe.Pointer(bp + 24)), *(*float64)(unsafe.Pointer(bp + 32)), *(*float64)(unsafe.Pointer(bp + 40)), (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fprecision) } else { intRepPtr = arithSeriesRepPtr XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), bp+48) XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), bp+56) XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 16)), bp+64) (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstart = *(*TTcl_WideInt)(unsafe.Pointer(bp + 48)) (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fend = *(*TTcl_WideInt)(unsafe.Pointer(bp + 56)) (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstep = *(*TTcl_WideInt)(unsafe.Pointer(bp + 64)) _FreeElements(tls, arithSeriesRepPtr) (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fbase.Flen1 = _ArithSeriesLenInt(tls, *(*TTcl_WideInt)(unsafe.Pointer(bp + 48)), *(*TTcl_WideInt)(unsafe.Pointer(bp + 56)), *(*TTcl_WideInt)(unsafe.Pointer(bp + 64))) } _objPtr3 = *(*uintptr)(unsafe.Pointer(bp)) v10 = _objPtr3 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr3) } _objPtr4 = *(*uintptr)(unsafe.Pointer(bp + 8)) v12 = _objPtr4 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr4) } _objPtr5 = *(*uintptr)(unsafe.Pointer(bp + 16)) v14 = _objPtr5 v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if v13 <= int64(1) { XTclFreeObj(tls, _objPtr5) } *(*uintptr)(unsafe.Pointer(newObjPtr)) = arithSeriesObj return TCL_OK } /* *---------------------------------------------------------------------- * * TclArithSeriesGetElements -- * * This function returns an (objc,objv) array of the elements in a list * object. * * Results: * The return value is normally TCL_OK; in this case *objcPtr is set to * the count of list elements and *objvPtr is set to a pointer to an * array of (*objcPtr) pointers to each list element. If listPtr does not * refer to an Abstract List object and the object can not be converted * to one, TCL_ERROR is returned and an error message will be left in the * interpreter's result if interp is not NULL. * * The objects referenced by the returned array should be treated as * readonly and their ref counts are _not_ incremented; the caller must * do that if it holds on to a reference. Furthermore, the pointer and * length returned by this function may change as soon as any function is * called on the list object; be careful about retaining the pointer in a * local data structure. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _TclArithSeriesGetElements(tls *libc.TLS, interp uintptr, objPtr uintptr, objcPtr uintptr, objvPtr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Where to store the pointer to an array of * pointers to the list's objects. */ var arithSeriesRepPtr, objv uintptr var i, objc TTcl_Size var status int32 _, _, _, _, _ = arithSeriesRepPtr, i, objc, objv, status if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_arithSeriesType)) { arithSeriesRepPtr = _ArithSeriesGetInternalRep(tls, objPtr) objc = (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 if objc > 0 { if (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Felements != 0 { /* If this exists, it has already been populated */ objv = (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Felements } else { /* Construct the elements array */ objv = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt64(objc)) if objv == libc.UintptrFromInt32(0) { if interp != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+1970, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+2008, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Felements = objv i = 0 for { if !(i < objc) { break } status = _TclArithSeriesObjIndex(tls, interp, objPtr, i, objv+uintptr(i)*8) if status != 0 { return int32(TCL_ERROR) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FrefCount++ goto _1 _1: ; i++ } } } else { objv = libc.UintptrFromInt32(0) } *(*uintptr)(unsafe.Pointer(objvPtr)) = objv *(*TTcl_Size)(unsafe.Pointer(objcPtr)) = objc } else { if interp != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+2061, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+2095, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } return TCL_OK } // C documentation // // /* // *---------------------------------------------------------------------- // * // * TclArithSeriesObjReverse -- // * // * Reverse the order of the ArithSeries value. The arithSeriesObj is // * assumed to be a valid ArithSeries. The new Obj has the Start and End // * values appropriately swapped and the Step value sign is changed. // * // * Results: // * The result will be an ArithSeries in the reverse order. // * // * Side effects: // * The ogiginal obj will be modified and returned if it is not Shared. // * // *---------------------------------------------------------------------- // */ func _TclArithSeriesObjReverse(tls *libc.TLS, interp uintptr, arithSeriesObj uintptr, newObjPtr uintptr) (r int32) { bp := tls.Alloc(112) defer tls.Free(112) var _isobjPtr, _isobjPtr1, _isobjPtr2, _objPtr, _objPtr1, _objPtr2, _objPtr3, arithSeriesRepPtr, cachePtr, dblRepPtr, intRepPtr, lenObj, resultObj, v3, v5, v7, v9 uintptr var isDouble, v10 int32 var len1 TTcl_WideInt var v1 bool var v2, v4, v6, v8 TTcl_Size var _ /* dend at bp+56 */ float64 var _ /* dstart at bp+48 */ float64 var _ /* dstep at bp+64 */ float64 var _ /* end at bp+32 */ TTcl_WideInt var _ /* endObj at bp+8 */ uintptr var _ /* ir at bp+72 */ TTcl_ObjInternalRep var _ /* ir at bp+88 */ TTcl_ObjInternalRep var _ /* start at bp+24 */ TTcl_WideInt var _ /* startObj at bp+0 */ uintptr var _ /* step at bp+40 */ TTcl_WideInt var _ /* stepObj at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _isobjPtr, _isobjPtr1, _isobjPtr2, _objPtr, _objPtr1, _objPtr2, _objPtr3, arithSeriesRepPtr, cachePtr, dblRepPtr, intRepPtr, isDouble, len1, lenObj, resultObj, v1, v10, v2, v3, v4, v5, v6, v7, v8, v9 _ = interp if newObjPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } arithSeriesRepPtr = _ArithSeriesGetInternalRep(tls, arithSeriesObj) isDouble = (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).FisDouble len1 = (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 _TclArithSeriesObjIndex(tls, libc.UintptrFromInt32(0), arithSeriesObj, len1-int64(1), bp) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount++ _TclArithSeriesObjIndex(tls, libc.UintptrFromInt32(0), arithSeriesObj, 0, bp+8) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++ _TclArithSeriesObjStep(tls, arithSeriesObj, bp+16) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++ if isDouble != 0 { XTcl_GetDoubleFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), bp+48) XTcl_GetDoubleFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), bp+56) XTcl_GetDoubleFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 16)), bp+64) *(*float64)(unsafe.Pointer(bp + 64)) = -*(*float64)(unsafe.Pointer(bp + 64)) *(*float64)(unsafe.Pointer(&*(*TTcl_ObjInternalRep)(unsafe.Pointer(bp + 72)))) = *(*float64)(unsafe.Pointer(bp + 64)) _isobjPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } XTcl_StoreInternalRep(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), uintptr(unsafe.Pointer(&XtclDoubleType)), bp+72) } else { XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), bp+24) XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), bp+32) XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 16)), bp+40) *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) = -*(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) *(*TTcl_WideInt)(unsafe.Pointer(&*(*TTcl_ObjInternalRep)(unsafe.Pointer(bp + 88)))) = *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) _isobjPtr1 = *(*uintptr)(unsafe.Pointer(bp + 16)) if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes = libc.UintptrFromInt32(0) } XTcl_StoreInternalRep(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), uintptr(unsafe.Pointer(&XtclIntType)), bp+88) } if (*TTcl_Obj)(unsafe.Pointer(arithSeriesObj)).FrefCount > int64(1) { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { lenObj = XTclThreadAllocObj(tls) } else { lenObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(lenObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(lenObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(lenObj)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(lenObj)).FinternalRep)) = len1 (*TTcl_Obj)(unsafe.Pointer(lenObj)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) resultObj = XTclNewArithSeriesObj(tls, interp, isDouble, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)), lenObj) _objPtr = lenObj v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } } else { /* * In-place is possible. */ _isobjPtr2 = arithSeriesObj if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr2)).Fbytes = libc.UintptrFromInt32(0) } if isDouble != 0 { dblRepPtr = arithSeriesRepPtr (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstart = *(*float64)(unsafe.Pointer(bp + 48)) (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fend = *(*float64)(unsafe.Pointer(bp + 56)) (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstep = *(*float64)(unsafe.Pointer(bp + 64)) } else { intRepPtr = arithSeriesRepPtr (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstart = *(*TTcl_WideInt)(unsafe.Pointer(bp + 24)) (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fend = *(*TTcl_WideInt)(unsafe.Pointer(bp + 32)) (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstep = *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) } _FreeElements(tls, arithSeriesRepPtr) resultObj = arithSeriesObj } _objPtr1 = *(*uintptr)(unsafe.Pointer(bp)) v5 = _objPtr1 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr1) } _objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 8)) v7 = _objPtr2 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr2) } _objPtr3 = *(*uintptr)(unsafe.Pointer(bp + 16)) v9 = _objPtr3 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr3) } *(*uintptr)(unsafe.Pointer(newObjPtr)) = resultObj if resultObj != 0 { v10 = TCL_OK } else { v10 = int32(TCL_ERROR) } return v10 } // C documentation // // /* // *---------------------------------------------------------------------- // * // * UpdateStringOfArithSeries -- // * // * Update the string representation for an arithseries object. // * Note: This procedure does not invalidate an existing old string rep // * so storage will be lost if this has not already been done. // * // * Results: // * None. // * // * Side effects: // * The object's string is set to a valid string that results from // * the list-to-string conversion. This string will be empty if the // * list has no elements. The list internal representation // * should not be NULL and we assume it is not NULL. // * // * Notes: // * At the cost of overallocation it's possible to estimate // * the length of the string representation and make this procedure // * much faster. Because the programmer shouldn't expect the // * string conversion of a big arithmetic sequence to be fast // * this version takes more care of space than time. // * // *---------------------------------------------------------------------- // */ func _UpdateStringOfArithSeries(tls *libc.TLS, arithSeriesObjPtr uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, arithSeriesRepPtr, p, str, v6, v8 uintptr var bytlen, i, v7 TTcl_Size var d, d1, v2, v3 float64 var slen Tsize_t var _ /* eleObj at bp+0 */ uintptr var _ /* slen at bp+40 */ TTcl_Size var _ /* tmp at bp+8 */ [29]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, arithSeriesRepPtr, bytlen, d, d1, i, p, slen, str, v2, v3, v6, v7, v8 arithSeriesRepPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObjPtr + 32))).Fptr1 bytlen = 0 /* * Pass 1: estimate space. */ if !((*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).FisDouble != 0) { i = 0 for { if !(i < (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1) { break } d = float64(_ArithSeriesIndexInt(tls, arithSeriesRepPtr, i)) if d > libc.Float64FromInt32(0) { v2 = libc.Xlog10(tls, d) + libc.Float64FromInt32(1) } else { if d < libc.Float64FromInt32(0) { v3 = libc.Xlog10(tls, -d) + libc.Float64FromInt32(2) } else { v3 = libc.Float64FromInt32(1) } v2 = v3 } slen = uint64(v2) bytlen = TTcl_Size(uint64(bytlen) + slen) goto _1 _1: ; i++ } } else { i = 0 for { if !(i < (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1) { break } d1 = _ArithSeriesIndexDbl(tls, arithSeriesRepPtr, i) (*(*[29]uint8)(unsafe.Pointer(bp + 8)))[0] = uint8(0) XTcl_PrintDouble(tls, libc.UintptrFromInt32(0), d1, bp+8) if libc.Uint64FromInt64(bytlen)+libc.Xstrlen(tls, bp+8) > libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) { break // overflow } bytlen = TTcl_Size(uint64(bytlen) + libc.Xstrlen(tls, bp+8)) goto _4 _4: ; i++ } } bytlen += (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1 // Space for each separator /* * Pass 2: generate the string repr. */ p = XTcl_InitStringRep(tls, arithSeriesObjPtr, libc.UintptrFromInt32(0), libc.Uint64FromInt64(bytlen)) i = 0 for { if !(i < (*TArithSeries)(unsafe.Pointer(arithSeriesRepPtr)).Flen1) { break } if _TclArithSeriesObjIndex(tls, libc.UintptrFromInt32(0), arithSeriesObjPtr, i, bp) == TCL_OK { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength v6 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+40) } str = v6 libc.Xstrcpy(tls, p, str) *(*uint8)(unsafe.Pointer(p + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 40))))) = uint8(' ') p += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 40)) + int64(1)) _objPtr = *(*uintptr)(unsafe.Pointer(bp)) v8 = _objPtr v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr) } } // else TODO: report error here? goto _5 _5: ; i++ } if bytlen > 0 { *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(arithSeriesObjPtr)).Fbytes + uintptr(bytlen-int64(1)))) = uint8('\000') } (*TTcl_Obj)(unsafe.Pointer(arithSeriesObjPtr)).Flength = bytlen - int64(1) } /* *---------------------------------------------------------------------- * * ArithSeriesInOperator -- * * Evaluate the "in" operation for expr * * This can be done more efficiently in the Arith Series relative to * doing a linear search as implemented in expr. * * Results: * Boolean true or false (1/0) * * Side effects: * None * *---------------------------------------------------------------------- */ func _ArithSeriesInOperation(tls *libc.TLS, interp uintptr, valueObj uintptr, arithSeriesObjPtr uintptr, boolResult uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, dblRepPtr, estr, estr1, intRepPtr, repPtr, vstr, vstr1, v1, v10, v12, v14, v2, v3, v5, v7, v8, v9 uintptr var incr, index, v13, v6 TTcl_Size var status, test, v11, v4 int32 var _ /* elemObj at bp+24 */ uintptr var _ /* elemObj at bp+40 */ uintptr var _ /* elen at bp+0 */ TTcl_Size var _ /* vlen at bp+8 */ TTcl_Size var _ /* y at bp+16 */ float64 var _ /* y at bp+32 */ TTcl_WideInt _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, dblRepPtr, estr, estr1, incr, index, intRepPtr, repPtr, status, test, vstr, vstr1, v1, v10, v11, v12, v13, v14, v2, v3, v4, v5, v6, v7, v8, v9 repPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(arithSeriesObjPtr + 32))).Fptr1 if (*TArithSeries)(unsafe.Pointer(repPtr)).FisDouble != 0 { dblRepPtr = repPtr test = 0 incr = 0 // Check index+incr where incr is 0 and 1 status = XTcl_GetDoubleFromObj(tls, interp, valueObj, bp+16) if status != TCL_OK { test = 0 } else { if (*TTcl_Obj)(unsafe.Pointer(valueObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(valueObj)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(valueObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, valueObj, bp+8) } vstr = v1 index = int64((*(*float64)(unsafe.Pointer(bp + 16)) - (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstart) / (*TArithSeriesDbl)(unsafe.Pointer(dblRepPtr)).Fstep) for incr < int64(2) { *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 _TclArithSeriesObjIndex(tls, interp, arithSeriesObjPtr, index+incr, bp+24) if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Flength v3 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), bp) } v2 = v3 } else { v2 = __ccgo_ts + 1945 } estr = v2 /* "in" operation defined as a string compare */ if *(*TTcl_Size)(unsafe.Pointer(bp)) == *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { v4 = libc.BoolInt32(libc.Xmemcmp(tls, estr, vstr, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))) == 0) } else { v4 = 0 } test = v4 v5 = *(*uintptr)(unsafe.Pointer(bp + 24)) if v5 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v5)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v5 v7 = _objPtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } /* Stop if we have a match */ if test != 0 { break } incr++ } } if boolResult != 0 { *(*int32)(unsafe.Pointer(boolResult)) = test } } else { intRepPtr = repPtr status = XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), valueObj, bp+32) if status != TCL_OK { if boolResult != 0 { *(*int32)(unsafe.Pointer(boolResult)) = 0 } } else { *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 index = (*(*TTcl_WideInt)(unsafe.Pointer(bp + 32)) - (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstart) / (*TArithSeriesInt)(unsafe.Pointer(intRepPtr)).Fstep _TclArithSeriesObjIndex(tls, interp, arithSeriesObjPtr, index, bp+40) if (*TTcl_Obj)(unsafe.Pointer(valueObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(valueObj)).Flength v8 = (*TTcl_Obj)(unsafe.Pointer(valueObj)).Fbytes } else { v8 = XTcl_GetStringFromObj(tls, valueObj, bp+8) } vstr1 = v8 if *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Flength v10 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).Fbytes } else { v10 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), bp) } v9 = v10 } else { v9 = __ccgo_ts + 1945 } estr1 = v9 if boolResult != 0 { if *(*TTcl_Size)(unsafe.Pointer(bp)) == *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { v11 = libc.BoolInt32(libc.Xmemcmp(tls, estr1, vstr1, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))) == 0) } else { v11 = 0 } *(*int32)(unsafe.Pointer(boolResult)) = v11 } v12 = *(*uintptr)(unsafe.Pointer(bp + 40)) if v12 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v12)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v12 v14 = _objPtr v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if v13 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } } } return TCL_OK } const CALL_CHAIN_STATIC_SIZE = 4 const COMPILEENV_INIT_AUX_DATA_SIZE = 5 const COMPILEENV_INIT_CMD_MAP_SIZE = 40 const COMPILEENV_INIT_CODE_BYTES = 250 const COMPILEENV_INIT_EXCEPT_RANGES = 5 const COMPILEENV_INIT_NUM_OBJECTS = 60 const JUMPFIXUP_INIT_ENTRIES = 10 const LITERAL_CMD_NAME = 2 const LITERAL_ON_HEAP = 1 const LITERAL_UNSHARED = 4 const MAX_INSTRUCTION_OPERANDS = 2 const SCOPE_FLAGS = 0 const TCLOO_PROCEDURE_METHOD_VERSION = 0 const TCLOO_VERSION = "1.3" const TCL_BYTECODE_PRECOMPILED = 1 const TCL_BYTECODE_RECOMPILE = 4 const TCL_BYTECODE_RESOLVE_VARS = 2 const TCL_LREPLACE4_END_IS_LAST = 1 const TCL_LREPLACE4_SINGLE_INDEX = 2 const TCL_NO_ELEMENT = 2 const TCL_NO_LARGE_INDEX = 1 const TCL_OO_INTERNAL_H = 1 const TCL_OO_METADATA_VERSION_CURRENT = 0 const TCL_OO_METHOD_VERSION_CURRENT = 0 const _TCLCOMPILATION = 1 type TCompileEnv1 = struct { FiPtr uintptr Fsource uintptr FnumSrcBytes TTcl_Size FprocPtr uintptr FnumCommands TTcl_Size FexceptDepth TTcl_Size FmaxExceptDepth TTcl_Size FmaxStackDepth TTcl_Size FcurrStackDepth TTcl_Size FlocalLitTable TLiteralTable FcodeStart uintptr FcodeNext uintptr FcodeEnd uintptr FmallocedCodeArray int32 FmallocedExceptArray int32 FliteralArrayPtr uintptr FliteralArrayNext TTcl_Size FliteralArrayEnd TTcl_Size FmallocedLiteralArray int32 FexceptArrayPtr uintptr FexceptArrayNext TTcl_Size FexceptArrayEnd TTcl_Size FexceptAuxArrayPtr uintptr FcmdMapPtr uintptr FcmdMapEnd TTcl_Size FmallocedCmdMap int32 FmallocedAuxDataArray int32 FauxDataArrayPtr uintptr FauxDataArrayNext TTcl_Size FauxDataArrayEnd TTcl_Size FstaticCodeSpace [250]uint8 FstaticLiteralSpace [60]TLiteralEntry FstaticExceptArraySpace [5]TExceptionRange FstaticExAuxArraySpace [5]TExceptionAux FstaticCmdMapSpace [40]TCmdLocation FstaticAuxDataArraySpace [5]TAuxData FextCmdMapPtr uintptr Fline TTcl_Size FatCmdStart int32 FexpandCount TTcl_Size FclNext uintptr } type TByteCode1 = struct { FinterpHandle TTclHandle FcompileEpoch TTcl_Size FnsPtr uintptr FnsEpoch TTcl_Size FrefCount TTcl_Size Fflags uint32 Fsource uintptr FprocPtr uintptr FstructureSize Tsize_t FnumCommands TTcl_Size FnumSrcBytes TTcl_Size FnumCodeBytes TTcl_Size FnumLitObjects TTcl_Size FnumExceptRanges TTcl_Size FnumAuxDataItems TTcl_Size FnumCmdLocBytes TTcl_Size FmaxExceptDepth TTcl_Size FmaxStackDepth TTcl_Size FcodeStart uintptr FobjArrayPtr uintptr FexceptArrayPtr uintptr FauxDataArrayPtr uintptr FcodeDeltaStart uintptr FcodeLengthStart uintptr FsrcDeltaStart uintptr FsrcLengthStart uintptr FlocalCachePtr uintptr } type TExceptionRangeType = int32 const LOOP_EXCEPTION_RANGE = 0 const CATCH_EXCEPTION_RANGE = 1 type TExceptionRange = struct { Ftype1 TExceptionRangeType FnestingLevel TTcl_Size FcodeOffset TTcl_Size FnumCodeBytes TTcl_Size FbreakOffset TTcl_Size FcontinueOffset TTcl_Size FcatchOffset TTcl_Size } type TExceptionAux = struct { FsupportsContinue int32 FstackDepth TTcl_Size FexpandTarget TTcl_Size FexpandTargetDepth TTcl_Size FnumBreakTargets TTcl_Size FbreakTargets uintptr FallocBreakTargets TTcl_Size FnumContinueTargets TTcl_Size FcontinueTargets uintptr FallocContinueTargets TTcl_Size } type TCmdLocation = struct { FcodeOffset TTcl_Size FnumCodeBytes TTcl_Size FsrcOffset TTcl_Size FnumSrcBytes TTcl_Size } type TECL = struct { FsrcOffset TTcl_Size Fnline TTcl_Size Fline uintptr Fnext uintptr } type TExtCmdLoc = struct { Ftype1 int32 Fstart TTcl_Size Fpath uintptr Floc uintptr Fnloc TTcl_Size Fnuloc TTcl_Size } type TAuxDataType = struct { Fname uintptr FdupProc uintptr FfreeProc uintptr FprintProc uintptr FdisassembleProc uintptr } type TAuxData = struct { Ftype1 uintptr FclientData uintptr } type TCompileEnv = struct { FiPtr uintptr Fsource uintptr FnumSrcBytes TTcl_Size FprocPtr uintptr FnumCommands TTcl_Size FexceptDepth TTcl_Size FmaxExceptDepth TTcl_Size FmaxStackDepth TTcl_Size FcurrStackDepth TTcl_Size FlocalLitTable TLiteralTable FcodeStart uintptr FcodeNext uintptr FcodeEnd uintptr FmallocedCodeArray int32 FmallocedExceptArray int32 FliteralArrayPtr uintptr FliteralArrayNext TTcl_Size FliteralArrayEnd TTcl_Size FmallocedLiteralArray int32 FexceptArrayPtr uintptr FexceptArrayNext TTcl_Size FexceptArrayEnd TTcl_Size FexceptAuxArrayPtr uintptr FcmdMapPtr uintptr FcmdMapEnd TTcl_Size FmallocedCmdMap int32 FmallocedAuxDataArray int32 FauxDataArrayPtr uintptr FauxDataArrayNext TTcl_Size FauxDataArrayEnd TTcl_Size FstaticCodeSpace [250]uint8 FstaticLiteralSpace [60]TLiteralEntry FstaticExceptArraySpace [5]TExceptionRange FstaticExAuxArraySpace [5]TExceptionAux FstaticCmdMapSpace [40]TCmdLocation FstaticAuxDataArraySpace [5]TAuxData FextCmdMapPtr uintptr Fline TTcl_Size FatCmdStart int32 FexpandCount TTcl_Size FclNext uintptr } type TByteCode = struct { FinterpHandle TTclHandle FcompileEpoch TTcl_Size FnsPtr uintptr FnsEpoch TTcl_Size FrefCount TTcl_Size Fflags uint32 Fsource uintptr FprocPtr uintptr FstructureSize Tsize_t FnumCommands TTcl_Size FnumSrcBytes TTcl_Size FnumCodeBytes TTcl_Size FnumLitObjects TTcl_Size FnumExceptRanges TTcl_Size FnumAuxDataItems TTcl_Size FnumCmdLocBytes TTcl_Size FmaxExceptDepth TTcl_Size FmaxStackDepth TTcl_Size FcodeStart uintptr FobjArrayPtr uintptr FexceptArrayPtr uintptr FauxDataArrayPtr uintptr FcodeDeltaStart uintptr FcodeLengthStart uintptr FsrcDeltaStart uintptr FsrcLengthStart uintptr FlocalCachePtr uintptr } type TclInstruction = int32 const INST_DONE = 0 const INST_PUSH1 = 1 const INST_PUSH4 = 2 const INST_POP = 3 const INST_DUP = 4 const INST_STR_CONCAT1 = 5 const INST_INVOKE_STK1 = 6 const INST_INVOKE_STK4 = 7 const INST_EVAL_STK = 8 const INST_EXPR_STK = 9 const INST_LOAD_SCALAR1 = 10 const INST_LOAD_SCALAR4 = 11 const INST_LOAD_SCALAR_STK = 12 const INST_LOAD_ARRAY1 = 13 const INST_LOAD_ARRAY4 = 14 const INST_LOAD_ARRAY_STK = 15 const INST_LOAD_STK = 16 const INST_STORE_SCALAR1 = 17 const INST_STORE_SCALAR4 = 18 const INST_STORE_SCALAR_STK = 19 const INST_STORE_ARRAY1 = 20 const INST_STORE_ARRAY4 = 21 const INST_STORE_ARRAY_STK = 22 const INST_STORE_STK = 23 const INST_INCR_SCALAR1 = 24 const INST_INCR_SCALAR_STK = 25 const INST_INCR_ARRAY1 = 26 const INST_INCR_ARRAY_STK = 27 const INST_INCR_STK = 28 const INST_INCR_SCALAR1_IMM = 29 const INST_INCR_SCALAR_STK_IMM = 30 const INST_INCR_ARRAY1_IMM = 31 const INST_INCR_ARRAY_STK_IMM = 32 const INST_INCR_STK_IMM = 33 const INST_JUMP1 = 34 const INST_JUMP4 = 35 const INST_JUMP_TRUE1 = 36 const INST_JUMP_TRUE4 = 37 const INST_JUMP_FALSE1 = 38 const INST_JUMP_FALSE4 = 39 const INST_BITOR = 40 const INST_BITXOR = 41 const INST_BITAND = 42 const INST_EQ = 43 const INST_NEQ = 44 const INST_LT = 45 const INST_GT = 46 const INST_LE = 47 const INST_GE = 48 const INST_LSHIFT = 49 const INST_RSHIFT = 50 const INST_ADD = 51 const INST_SUB = 52 const INST_MULT = 53 const INST_DIV = 54 const INST_MOD = 55 const INST_UPLUS = 56 const INST_UMINUS = 57 const INST_BITNOT = 58 const INST_LNOT = 59 const INST_TRY_CVT_TO_NUMERIC = 60 const INST_BREAK = 61 const INST_CONTINUE = 62 const INST_BEGIN_CATCH4 = 63 const INST_END_CATCH = 64 const INST_PUSH_RESULT = 65 const INST_PUSH_RETURN_CODE = 66 const INST_STR_EQ = 67 const INST_STR_NEQ = 68 const INST_STR_CMP = 69 const INST_STR_LEN = 70 const INST_STR_INDEX = 71 const INST_STR_MATCH = 72 const INST_LIST = 73 const INST_LIST_INDEX = 74 const INST_LIST_LENGTH = 75 const INST_APPEND_SCALAR1 = 76 const INST_APPEND_SCALAR4 = 77 const INST_APPEND_ARRAY1 = 78 const INST_APPEND_ARRAY4 = 79 const INST_APPEND_ARRAY_STK = 80 const INST_APPEND_STK = 81 const INST_LAPPEND_SCALAR1 = 82 const INST_LAPPEND_SCALAR4 = 83 const INST_LAPPEND_ARRAY1 = 84 const INST_LAPPEND_ARRAY4 = 85 const INST_LAPPEND_ARRAY_STK = 86 const INST_LAPPEND_STK = 87 const INST_LIST_INDEX_MULTI = 88 const INST_OVER = 89 const INST_LSET_LIST = 90 const INST_LSET_FLAT = 91 const INST_RETURN_IMM = 92 const INST_EXPON = 93 const INST_EXPAND_START = 94 const INST_EXPAND_STKTOP = 95 const INST_INVOKE_EXPANDED = 96 const INST_LIST_INDEX_IMM = 97 const INST_LIST_RANGE_IMM = 98 const INST_START_CMD = 99 const INST_LIST_IN = 100 const INST_LIST_NOT_IN = 101 const INST_PUSH_RETURN_OPTIONS = 102 const INST_RETURN_STK = 103 const INST_DICT_GET = 104 const INST_DICT_SET = 105 const INST_DICT_UNSET = 106 const INST_DICT_INCR_IMM = 107 const INST_DICT_APPEND = 108 const INST_DICT_LAPPEND = 109 const INST_DICT_FIRST = 110 const INST_DICT_NEXT = 111 const INST_DICT_UPDATE_START = 112 const INST_DICT_UPDATE_END = 113 const INST_JUMP_TABLE = 114 const INST_UPVAR = 115 const INST_NSUPVAR = 116 const INST_VARIABLE = 117 const INST_SYNTAX = 118 const INST_REVERSE = 119 const INST_REGEXP = 120 const INST_EXIST_SCALAR = 121 const INST_EXIST_ARRAY = 122 const INST_EXIST_ARRAY_STK = 123 const INST_EXIST_STK = 124 const INST_NOP = 125 const INST_RETURN_CODE_BRANCH = 126 const INST_UNSET_SCALAR = 127 const INST_UNSET_ARRAY = 128 const INST_UNSET_ARRAY_STK = 129 const INST_UNSET_STK = 130 const INST_DICT_EXPAND = 131 const INST_DICT_RECOMBINE_STK = 132 const INST_DICT_RECOMBINE_IMM = 133 const INST_DICT_EXISTS = 134 const INST_DICT_VERIFY = 135 const INST_STR_MAP = 136 const INST_STR_FIND = 137 const INST_STR_FIND_LAST = 138 const INST_STR_RANGE_IMM = 139 const INST_STR_RANGE = 140 const INST_YIELD = 141 const INST_COROUTINE_NAME = 142 const INST_TAILCALL = 143 const INST_NS_CURRENT = 144 const INST_INFO_LEVEL_NUM = 145 const INST_INFO_LEVEL_ARGS = 146 const INST_RESOLVE_COMMAND = 147 const INST_TCLOO_SELF = 148 const INST_TCLOO_CLASS = 149 const INST_TCLOO_NS = 150 const INST_TCLOO_IS_OBJECT = 151 const INST_ARRAY_EXISTS_STK = 152 const INST_ARRAY_EXISTS_IMM = 153 const INST_ARRAY_MAKE_STK = 154 const INST_ARRAY_MAKE_IMM = 155 const INST_INVOKE_REPLACE = 156 const INST_LIST_CONCAT = 157 const INST_EXPAND_DROP = 158 const INST_FOREACH_START = 159 const INST_FOREACH_STEP = 160 const INST_FOREACH_END = 161 const INST_LMAP_COLLECT = 162 const INST_STR_TRIM = 163 const INST_STR_TRIM_LEFT = 164 const INST_STR_TRIM_RIGHT = 165 const INST_CONCAT_STK = 166 const INST_STR_UPPER = 167 const INST_STR_LOWER = 168 const INST_STR_TITLE = 169 const INST_STR_REPLACE = 170 const INST_ORIGIN_COMMAND = 171 const INST_TCLOO_NEXT = 172 const INST_TCLOO_NEXT_CLASS = 173 const INST_YIELD_TO_INVOKE = 174 const INST_NUM_TYPE = 175 const INST_TRY_CVT_TO_BOOLEAN = 176 const INST_STR_CLASS = 177 const INST_LAPPEND_LIST = 178 const INST_LAPPEND_LIST_ARRAY = 179 const INST_LAPPEND_LIST_ARRAY_STK = 180 const INST_LAPPEND_LIST_STK = 181 const INST_CLOCK_READ = 182 const INST_DICT_GET_DEF = 183 const INST_STR_LT = 184 const INST_STR_GT = 185 const INST_STR_LE = 186 const INST_STR_GE = 187 const INST_LREPLACE4 = 188 const INST_CONST_IMM = 189 const INST_CONST_STK = 190 const LAST_INST_OPCODE = 191 type TInstOperandType = int32 type InstOperandType = int32 const OPERAND_NONE = 0 const OPERAND_INT1 = 1 const OPERAND_INT4 = 2 const OPERAND_UINT1 = 3 const OPERAND_UINT4 = 4 const OPERAND_IDX4 = 5 const OPERAND_LVT1 = 6 const OPERAND_LVT4 = 7 const OPERAND_AUX4 = 8 const OPERAND_OFFSET1 = 9 const OPERAND_OFFSET4 = 10 const OPERAND_LIT1 = 11 const OPERAND_LIT4 = 12 const OPERAND_SCLS1 = 13 type TInstructionDesc = struct { Fname uintptr FnumBytes TTcl_Size FstackEffect int32 FnumOperands int32 FopTypes [2]TInstOperandType } type TInstStringClassType = int32 type InstStringClassType = int32 const STR_CLASS_ALNUM = 0 const STR_CLASS_ALPHA = 1 const STR_CLASS_ASCII = 2 const STR_CLASS_CONTROL = 3 const STR_CLASS_DIGIT = 4 const STR_CLASS_GRAPH = 5 const STR_CLASS_LOWER = 6 const STR_CLASS_PRINT = 7 const STR_CLASS_PUNCT = 8 const STR_CLASS_SPACE = 9 const STR_CLASS_UPPER = 10 const STR_CLASS_WORD = 11 const STR_CLASS_XDIGIT = 12 type TStringClassDesc = struct { Fname [8]uint8 Fcomparator uintptr } type TTclJumpType = int32 const TCL_UNCONDITIONAL_JUMP = 0 const TCL_TRUE_JUMP = 1 const TCL_FALSE_JUMP = 2 type TJumpFixup = struct { FjumpType TTclJumpType FcodeOffset uint32 FcmdIndex int32 FexceptIndex int32 } type TJumpFixupArray = struct { Ffixup uintptr Fnext TTcl_Size Fend TTcl_Size FmallocedArray int32 FstaticFixupSpace [10]TJumpFixup } type TForeachVarList = struct { FnumVars TTcl_Size } type TForeachInfo = struct { FnumLists TTcl_Size FfirstValueTemp TTcl_Size FloopCtTemp TTcl_Size } type TJumptableInfo = struct { FhashTable TTcl_HashTable } type TDictUpdateInfo = struct { Flength TTcl_Size } type TTclOpCmdClientData = struct { Fop uintptr Fexpected uintptr Fi struct { Fidentity [0]int32 FnumArgs int32 } } type TTcl_Class = uintptr type TTcl_Method = uintptr type TTcl_Object = uintptr type TTcl_ObjectContext = uintptr type TTcl_MethodType = struct { Fversion int32 Fname uintptr FcallProc uintptr FdeleteProc uintptr FcloneProc uintptr } type TTcl_MethodType2 = struct { Fversion int32 Fname uintptr FcallProc uintptr FdeleteProc uintptr FcloneProc uintptr } type TclOOMethodVersion = int32 const TCL_OO_METHOD_VERSION_1 = 1 const TCL_OO_METHOD_VERSION_2 = 2 type TclOOMethodVisibilityFlags = int32 const TCL_OO_METHOD_PUBLIC = 1 const TCL_OO_METHOD_UNEXPORTED = 0 const TCL_OO_METHOD_PRIVATE = 32 type TTcl_ObjectMetadataType = struct { Fversion int32 Fname uintptr FdeleteProc uintptr FcloneProc uintptr } type TclOOMetadataVersion = int32 const TCL_OO_METADATA_VERSION_1 = 1 type TTclOOStubHooks = struct { FtclOOIntStubs uintptr } type TTclOOStubs = struct { Fmagic int32 Fhooks uintptr Ftcl_CopyObjectInstance uintptr Ftcl_GetClassAsObject uintptr Ftcl_GetObjectAsClass uintptr Ftcl_GetObjectCommand uintptr Ftcl_GetObjectFromObj uintptr Ftcl_GetObjectNamespace uintptr Ftcl_MethodDeclarerClass uintptr Ftcl_MethodDeclarerObject uintptr Ftcl_MethodIsPublic uintptr Ftcl_MethodIsType uintptr Ftcl_MethodName uintptr Ftcl_NewInstanceMethod uintptr Ftcl_NewMethod uintptr Ftcl_NewObjectInstance uintptr Ftcl_ObjectDeleted uintptr Ftcl_ObjectContextIsFiltering uintptr Ftcl_ObjectContextMethod uintptr Ftcl_ObjectContextObject uintptr Ftcl_ObjectContextSkippedArgs uintptr Ftcl_ClassGetMetadata uintptr Ftcl_ClassSetMetadata uintptr Ftcl_ObjectGetMetadata uintptr Ftcl_ObjectSetMetadata uintptr Ftcl_ObjectContextInvokeNext uintptr Ftcl_ObjectGetMethodNameMapper uintptr Ftcl_ObjectSetMethodNameMapper uintptr Ftcl_ClassSetConstructor uintptr Ftcl_ClassSetDestructor uintptr Ftcl_GetObjectName uintptr Ftcl_MethodIsPrivate uintptr Ftcl_GetClassOfObject uintptr Ftcl_GetObjectClassName uintptr Ftcl_MethodIsType2 uintptr Ftcl_NewInstanceMethod2 uintptr Ftcl_NewMethod2 uintptr } type TCallChain = struct { FobjectCreationEpoch TTcl_Size FobjectEpoch TTcl_Size Fepoch TTcl_Size Fflags int32 FrefCount TTcl_Size FnumChain TTcl_Size Fchain uintptr FstaticChain [4]TMInvoke } type TCallContext = struct { FoPtr uintptr Findex TTcl_Size Fskip TTcl_Size FcallPtr uintptr } type TClass = struct { FthisPtr uintptr Fflags int32 Fsuperclasses TClassList Fsubclasses TVarClassList Finstances TObjectList Ffilters TFilterList Fmixins TClassList FmixinSubs TVarClassList FclassMethods TTcl_HashTable FconstructorPtr uintptr FdestructorPtr uintptr FmetadataPtr uintptr FconstructorChainPtr uintptr FdestructorChainPtr uintptr FclassChainCache uintptr Fvariables TVariableNameList FprivateVariables TPrivateVariableList FclsDefinitionNs uintptr FobjDefinitionNs uintptr Fproperties TPropertyStorage } type TDeclaredClassMethod = struct { Fname uintptr FisPublic int32 Fdefinition TTcl_MethodType } type TForwardMethod = struct { FprefixObj uintptr } type TFoundation = struct { Finterp uintptr FobjectCls uintptr FclassCls uintptr FooNs uintptr FhelpersNs uintptr Fepoch TTcl_Size FtsdPtr uintptr FunknownMethodNameObj uintptr FconstructorName uintptr FdestructorName uintptr FclonedName uintptr FdefineName uintptr FmyName uintptr FmcdName uintptr } type TMethod = struct { F__ccgo0_0 struct { Ftype2Ptr [0]uintptr FtypePtr uintptr } FrefCount TTcl_Size FclientData uintptr FnamePtr uintptr FdeclaringObjectPtr uintptr FdeclaringClassPtr uintptr Fflags int32 } type TMInvoke = struct { FmPtr uintptr FisFilter int32 FfilterDeclarer uintptr } type TObject = struct { FfPtr uintptr FnamespacePtr uintptr Fcommand TTcl_Command FmyCommand TTcl_Command FselfCls uintptr FmethodsPtr uintptr Fmixins TClassList Ffilters TFilterList FclassPtr uintptr FrefCount TTcl_Size Fflags int32 FcreationEpoch TTcl_Size Fepoch TTcl_Size FmetadataPtr uintptr FcachedNameObj uintptr FchainCache uintptr FmapMethodNameProc uintptr Fvariables TVariableNameList FprivateVariables TPrivateVariableList FmyclassCommand TTcl_Command Fproperties TPropertyStorage } type TPrivateVariableMapping = struct { FvariableObj uintptr FfullNameObj uintptr } type TProcedureMethod = struct { Fversion int32 FprocPtr uintptr Fflags int32 FrefCount TTcl_Size FclientData uintptr FdeleteClientdataProc uintptr FcloneClientdataProc uintptr FerrProc uintptr FpreCallProc uintptr FpostCallProc uintptr FgfivProc uintptr Fcmd TCommand Fefi TExtraFrameInfo Finterp uintptr Fmethod TTcl_Method FcallSiteFlags int32 } type TPropertyStorage = struct { Freadable TPropertyList Fwritable TPropertyList FallReadableCache uintptr FallWritableCache uintptr Fepoch int32 } type TMethod1 = struct { F__ccgo0_0 struct { Ftype2Ptr [0]uintptr FtypePtr uintptr } FrefCount TTcl_Size FclientData uintptr FnamePtr uintptr FdeclaringObjectPtr uintptr FdeclaringClassPtr uintptr Fflags int32 } type TProcedureMethod1 = struct { Fversion int32 FprocPtr uintptr Fflags int32 FrefCount TTcl_Size FclientData uintptr FdeleteClientdataProc uintptr FcloneClientdataProc uintptr FerrProc uintptr FpreCallProc uintptr FpostCallProc uintptr FgfivProc uintptr Fcmd TCommand Fefi TExtraFrameInfo Finterp uintptr Fmethod TTcl_Method FcallSiteFlags int32 } type ProcedureMethodVersion = int32 const TCLOO_PROCEDURE_METHOD_VERSION_1 = 0 type ProceudreMethodFlags = int32 const USE_DECLARER_NS = 128 type TForwardMethod1 = struct { FprefixObj uintptr } type TPrivateVariableMapping1 = struct { FvariableObj uintptr FfullNameObj uintptr } type TClassList = struct { Fnum TTcl_Size Flist uintptr } type TVarClassList = struct { Fnum TTcl_Size Fsize TTcl_Size Flist uintptr } type TFilterList = struct { Fnum TTcl_Size Flist uintptr } type TObjectList = struct { Fnum TTcl_Size Fsize TTcl_Size Flist uintptr } type TVariableNameList = struct { Fnum TTcl_Size Flist uintptr } type TPrivateVariableList = struct { Fnum TTcl_Size Flist uintptr } type TPropertyList = struct { Fnum TTcl_Size Flist uintptr } type TPropertyStorage1 = struct { Freadable TPropertyList Fwritable TPropertyList FallReadableCache uintptr FallWritableCache uintptr Fepoch int32 } type TObject1 = struct { FfPtr uintptr FnamespacePtr uintptr Fcommand TTcl_Command FmyCommand TTcl_Command FselfCls uintptr FmethodsPtr uintptr Fmixins TClassList Ffilters TFilterList FclassPtr uintptr FrefCount TTcl_Size Fflags int32 FcreationEpoch TTcl_Size Fepoch TTcl_Size FmetadataPtr uintptr FcachedNameObj uintptr FchainCache uintptr FmapMethodNameProc uintptr Fvariables TVariableNameList FprivateVariables TPrivateVariableList FmyclassCommand TTcl_Command Fproperties TPropertyStorage } type ObjectFlags = int32 const OBJECT_DESTRUCTING = 1 const DESTRUCTOR_CALLED = 2 const ROOT_OBJECT = 4096 const FILTER_HANDLING = 8192 const USE_CLASS_CACHE = 16384 const ROOT_CLASS = 32768 const FORCE_UNKNOWN = 65536 const DONT_DELETE = 131072 const HAS_PRIVATE_METHODS = 262144 type TClass1 = struct { FthisPtr uintptr Fflags int32 Fsuperclasses TClassList Fsubclasses TVarClassList Finstances TObjectList Ffilters TFilterList Fmixins TClassList FmixinSubs TVarClassList FclassMethods TTcl_HashTable FconstructorPtr uintptr FdestructorPtr uintptr FmetadataPtr uintptr FconstructorChainPtr uintptr FdestructorChainPtr uintptr FclassChainCache uintptr Fvariables TVariableNameList FprivateVariables TPrivateVariableList FclsDefinitionNs uintptr FobjDefinitionNs uintptr Fproperties TPropertyStorage } type TThreadLocalData = struct { FnsCount TTcl_Size } type TFoundation1 = struct { Finterp uintptr FobjectCls uintptr FclassCls uintptr FooNs uintptr FhelpersNs uintptr Fepoch TTcl_Size FtsdPtr uintptr FunknownMethodNameObj uintptr FconstructorName uintptr FdestructorName uintptr FclonedName uintptr FdefineName uintptr FmyName uintptr FmcdName uintptr } type TMInvoke1 = struct { FmPtr uintptr FisFilter int32 FfilterDeclarer uintptr } type TCallChain1 = struct { FobjectCreationEpoch TTcl_Size FobjectEpoch TTcl_Size Fepoch TTcl_Size Fflags int32 FrefCount TTcl_Size FnumChain TTcl_Size Fchain uintptr FstaticChain [4]TMInvoke } type TCallContext1 = struct { FoPtr uintptr Findex TTcl_Size Fskip TTcl_Size FcallPtr uintptr } type TclOOCallChainFlags = int32 const PUBLIC_METHOD = 1 const PRIVATE_METHOD = 2 const OO_UNKNOWN_METHOD = 4 const CONSTRUCTOR = 8 const DESTRUCTOR = 16 const TRUE_PRIVATE_METHOD = 32 type TDeclaredClassMethod1 = struct { Fname uintptr FisPublic int32 Fdefinition TTcl_MethodType } type TTclOOIntStubs = struct { Fmagic int32 Fhooks uintptr FtclOOGetDefineCmdContext uintptr FtclOOMakeProcInstanceMethod uintptr FtclOOMakeProcMethod uintptr FtclOONewProcInstanceMethod uintptr FtclOONewProcMethod uintptr FtclOOObjectCmdCore uintptr FtclOOIsReachable uintptr FtclOONewForwardMethod uintptr FtclOONewForwardInstanceMethod uintptr FtclOONewProcInstanceMethodEx uintptr FtclOONewProcMethodEx uintptr FtclOOInvokeObject uintptr FtclOOObjectSetFilters uintptr FtclOOClassSetFilters uintptr FtclOOObjectSetMixins uintptr FtclOOClassSetMixins uintptr } /* * Structure that represents a range of instructions in the bytecode. */ type TCodeRange = struct { FstartOffset int32 FendOffset int32 } /* * State identified for a basic block's catch context. */ type TBasicBlockCatchState = int32 /* * State identified for a basic block's catch context. */ type BasicBlockCatchState = int32 const BBCS_UNKNOWN = 0 const /* Catch context has not yet been identified */ BBCS_NONE = 1 const /* Block is outside of any catch */ BBCS_INCATCH = 2 const /* Block is within a catch context */ BBCS_CAUGHT = 3 /* * Structure that defines a basic block - a linear sequence of bytecode * instructions with no jumps in or out (including not changing the * state of any exception range). */ type TBasicBlock = struct { ForiginalStartOffset int32 FstartOffset int32 FstartLine int32 FjumpOffset int32 FjumpLine int32 FprevPtr uintptr Fpredecessor uintptr Fsuccessor1 uintptr FjumpTarget uintptr FinitialStackDepth int32 FminStackDepth int32 FmaxStackDepth int32 FfinalStackDepth int32 FcatchState BasicBlockCatchState FcatchDepth int32 FenclosingCatch uintptr FforeignExceptionBase int32 FforeignExceptionCount int32 FforeignExceptions uintptr FjtPtr uintptr Fflags int32 } /* * Flags that pertain to a basic block. */ type BasicBlockFlags = int32 const BB_VISITED = 1 const /* Block has been visited in the current * traversal */ BB_FALLTHRU = 2 const /* Control may pass from this block to a * successor */ BB_JUMP1 = 4 const /* Basic block ends with a 1-byte-offset jump * and may need expansion */ BB_JUMPTABLE = 8 const /* Basic block ends with a jump table */ BB_BEGINCATCH = 16 const /* Block ends with a 'beginCatch' instruction, * marking it as the start of a 'catch' * sequence. The 'jumpTarget' is the exception * exit from the catch block. */ BB_ENDCATCH = 32 /* * Source instruction type recognized by the assembler. */ type TTalInstType = int32 const ASSEM_1BYTE = 0 const /* Fixed arity, 1-byte instruction */ ASSEM_BEGIN_CATCH = 1 const /* Begin catch: one 4-byte jump offset to be * converted to appropriate exception * ranges */ ASSEM_BOOL = 2 const /* One Boolean operand */ ASSEM_BOOL_LVT4 = 3 const /* One Boolean, one 4-byte LVT ref. */ ASSEM_CLOCK_READ = 4 const /* 1-byte unsigned-integer case number, in the * range 0-3 */ ASSEM_CONCAT1 = 5 const /* 1-byte unsigned-integer operand count, must * be strictly positive, consumes N, produces * 1 */ ASSEM_DICT_GET = 6 const /* 'dict get' and related - consumes N+1 * operands, produces 1, N > 0 */ ASSEM_DICT_SET = 7 const /* specifies key count and LVT index, consumes * N+1 operands, produces 1, N > 0 */ ASSEM_DICT_UNSET = 8 const /* specifies key count and LVT index, consumes * N operands, produces 1, N > 0 */ ASSEM_END_CATCH = 9 const /* End catch. No args. Exception range popped * from stack and stack pointer restored. */ ASSEM_EVAL = 10 const /* 'eval' - evaluate a constant script (by * compiling it in line with the assembly * code! I love Tcl!) */ ASSEM_INDEX = 11 const /* 4 byte operand, integer or end-integer */ ASSEM_INVOKE = 12 const /* 1- or 4-byte operand count, must be * strictly positive, consumes N, produces * 1. */ ASSEM_JUMP = 13 const /* Jump instructions */ ASSEM_JUMP4 = 14 const /* Jump instructions forcing a 4-byte offset */ ASSEM_JUMPTABLE = 15 const /* Jumptable (switch -exact) */ ASSEM_LABEL = 16 const /* The assembly directive that defines a * label */ ASSEM_LINDEX_MULTI = 17 const /* 4-byte operand count, must be strictly * positive, consumes N, produces 1 */ ASSEM_LIST = 18 const /* 4-byte operand count, must be nonnegative, * consumses N, produces 1 */ ASSEM_LSET_FLAT = 19 const /* 4-byte operand count, must be >= 3, * consumes N, produces 1 */ ASSEM_LVT = 20 const /* One operand that references a local * variable */ ASSEM_LVT1 = 21 const /* One 1-byte operand that references a local * variable */ ASSEM_LVT1_SINT1 = 22 const /* One 1-byte operand that references a local * variable, one signed-integer 1-byte * operand */ ASSEM_LVT4 = 23 const /* One 4-byte operand that references a local * variable */ ASSEM_OVER = 24 const /* OVER: 4-byte operand count, consumes N+1, * produces N+2 */ ASSEM_PUSH = 25 const /* one literal operand */ ASSEM_REGEXP = 26 const /* One Boolean operand, but weird mapping to * call flags */ ASSEM_REVERSE = 27 const /* REVERSE: 4-byte operand count, consumes N, * produces N */ ASSEM_SINT1 = 28 const /* One 1-byte signed-integer operand * (INCR_STK_IMM) */ ASSEM_SINT4_LVT4 = 29 const /* Signed 4-byte integer operand followed by * LVT entry. Fixed arity */ ASSEM_DICT_GET_DEF = 30 /* * Description of an instruction recognized by the assembler. */ type TTalInstDesc = struct { Fname uintptr FinstType TTalInstType FtclInstCode int32 FoperandsConsumed int32 FoperandsProduced int32 } /* * Structure that holds the state of the assembler while generating code. */ type TAssemblyEnv = struct { FenvPtr uintptr FparsePtr uintptr FlabelHash TTcl_HashTable FcmdLine TTcl_Size FclNext uintptr Fhead_bb uintptr Fcurr_bb uintptr FmaxDepth int32 FcurCatchDepth int32 FmaxCatchDepth int32 Fflags int32 } var _assembleCodeType = TTcl_ObjType{ Fname: __ccgo_ts + 2103, } func init() { p := unsafe.Pointer(&_assembleCodeType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_FreeAssembleCodeInternalRep) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_DupAssembleCodeInternalRep) } /* * Source instructions recognized in the Tcl Assembly Language (TAL) */ var _TalInstructionTable = [151]TTalInstDesc{ 0: { Fname: __ccgo_ts + 2116, FinstType: int32(ASSEM_PUSH), FtclInstCode: int32(INST_PUSH1)< (*TBasicBlock)(unsafe.Pointer(bbPtr)).FmaxStackDepth { (*TBasicBlock)(unsafe.Pointer(bbPtr)).FmaxStackDepth = depth } (*TBasicBlock)(unsafe.Pointer(bbPtr)).FfinalStackDepth = depth } /* *----------------------------------------------------------------------------- * * BBUpdateStackReqs -- * * Updates the stack requirements of a basic block, given the opcode * being emitted and an operand count. * * Results: * None. * * Side effects: * Updates min, max and final stack requirements in the basic block. * * Notes: * This function must not be called for instructions such as REVERSE and * OVER that are variadic but do not consume all their operands. Instead, * BBAdjustStackDepth should be called directly. * * count should be provided only for variadic operations. For operations * with known arity, count should be 0. * *----------------------------------------------------------------------------- */ func _BBUpdateStackReqs(tls *libc.TLS, bbPtr uintptr, tblIdx int32, count int32) { /* Count of operands for variadic insts */ var consumed, produced int32 _, _ = consumed, produced consumed = _TalInstructionTable[tblIdx].FoperandsConsumed produced = _TalInstructionTable[tblIdx].FoperandsProduced if consumed == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { /* * The instruction is variadic; it consumes 'count' operands, or * 'count+1' for ASSEM_DICT_GET_DEF. */ consumed = count if _TalInstructionTable[tblIdx].FinstType == int32(ASSEM_DICT_GET_DEF) { consumed++ } } if produced < 0 { /* * The instruction leaves some of its variadic operands on the stack, * with net stack effect of '-1-produced' */ produced = consumed - produced - int32(1) } _BBAdjustStackDepth(tls, bbPtr, consumed, produced) } /* *----------------------------------------------------------------------------- * * BBEmitOpcode, BBEmitInstInt1, BBEmitInstInt4 -- * * Emit the opcode part of an instruction, or the entirety of an * instruction with a 1- or 4-byte operand, and adjust stack * requirements. * * Results: * None. * * Side effects: * Stores instruction and operand in the operand stream, and adjusts the * stack. * *----------------------------------------------------------------------------- */ func _BBEmitOpcode(tls *libc.TLS, assemEnvPtr uintptr, tblIdx int32, count int32) { /* Operand count for variadic ops */ var bbPtr, envPtr, v1, v2 uintptr var op, v3 int32 _, _, _, _, _, _ = bbPtr, envPtr, op, v1, v2, v3 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ bbPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb /* Current basic block */ op = _TalInstructionTable[tblIdx].FtclInstCode & int32(0xFF) /* * If this is the first instruction in a basic block, record its line * number. */ if int64((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) == int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart) { (*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartLine = int32((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine) } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } v2 = envPtr + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = uint8(libc.Uint32FromInt32(op)) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < int32(2) { if op == int32(INST_START_CMD) { v3 = int32(1) } else { v3 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = v3 } _BBUpdateStackReqs(tls, bbPtr, tblIdx, count) } func _BBEmitInstInt1(tls *libc.TLS, assemEnvPtr uintptr, tblIdx int32, opnd int32, count int32) { /* Operand count for variadic ops */ var v1, v2 uintptr _, _ = v1, v2 _BBEmitOpcode(tls, assemEnvPtr, tblIdx, count) if (*TCompileEnv)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeNext == (*TCompileEnv)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeEnd { XTclExpandCodeArray(tls, (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr) } v2 = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = uint8(libc.Uint32FromInt32(opnd)) } func _BBEmitInstInt4(tls *libc.TLS, assemEnvPtr uintptr, tblIdx int32, opnd int32, count int32) { /* Operand count for variadic ops */ var v1, v2, v3, v4, v5, v6, v7, v8 uintptr _, _, _, _, _, _, _, _ = v1, v2, v3, v4, v5, v6, v7, v8 _BBEmitOpcode(tls, assemEnvPtr, tblIdx, count) if (*TCompileEnv)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FcodeEnd { XTclExpandCodeArray(tls, (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr) } v2 = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = uint8(libc.Uint32FromInt32(opnd) >> libc.Int32FromInt32(24)) v4 = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(opnd) >> libc.Int32FromInt32(16)) v6 = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(opnd) >> libc.Int32FromInt32(8)) v8 = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(opnd)) } /* *----------------------------------------------------------------------------- * * BBEmitInst1or4 -- * * Emits a 1- or 4-byte operation according to the magnitude of the * operand. * *----------------------------------------------------------------------------- */ func _BBEmitInst1or4(tls *libc.TLS, assemEnvPtr uintptr, tblIdx int32, param int32, count int32) { /* Arity if variadic */ var bbPtr, envPtr, v1, v10, v11, v12, v2, v3, v4, v5, v6, v7, v8, v9 uintptr var op, v13 int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bbPtr, envPtr, op, v1, v10, v11, v12, v13, v2, v3, v4, v5, v6, v7, v8, v9 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ bbPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb /* Current basic block */ op = _TalInstructionTable[tblIdx].FtclInstCode if param <= int32(0xFF) { op >>= int32(8) } else { op &= int32(0xFF) } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } v2 = envPtr + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = uint8(libc.Uint32FromInt32(op)) if param <= int32(0xFF) { if (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } v4 = envPtr + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(param)) } else { if (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } v6 = envPtr + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(param) >> libc.Int32FromInt32(24)) v8 = envPtr + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(param) >> libc.Int32FromInt32(16)) v10 = envPtr + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(param) >> libc.Int32FromInt32(8)) v12 = envPtr + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(param)) } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart < int32(2) { if op == int32(INST_START_CMD) { v13 = int32(1) } else { v13 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = v13 } _BBUpdateStackReqs(tls, bbPtr, tblIdx, count) } /* *----------------------------------------------------------------------------- * * Tcl_AssembleObjCmd, TclNRAssembleObjCmd -- * * Direct evaluation path for tcl::unsupported::assemble * * Results: * Returns a standard Tcl result. * * Side effects: * Assembles the code in objv[1], and executes it, so side effects * include whatever the code does. * *----------------------------------------------------------------------------- */ func XTcl_AssembleObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ /* * Boilerplate - make sure that there is an NRE trampoline on the C stack * because there needs to be one in place to execute bytecode. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRAssembleObjCmd), clientData, int64(objc), objv) } func XTclNRAssembleObjCmd(tls *libc.TLS, dummy789 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var backtrace, cachePtr, codePtr uintptr var v1 bool _, _, _, _ = backtrace, cachePtr, codePtr, v1 /* Object where extra error information is * constructed. */ if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3528) return int32(TCL_ERROR) } /* * Assemble the source to bytecode. */ codePtr = _CompileAssembleObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) /* * On failure, report error line. */ if codePtr == libc.UintptrFromInt32(0) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+3541, int64(-int32(1)))) XTcl_AppendObjToErrorInfo(tls, interp, *(*uintptr)(unsafe.Pointer(objv))) XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+3549, int64(-int32(1)))) if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { backtrace = XTclThreadAllocObj(tls) } else { backtrace = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(backtrace + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(backtrace)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(backtrace)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(backtrace)).FinternalRep)) = int64(XTcl_GetErrorLine(tls, interp)) (*TTcl_Obj)(unsafe.Pointer(backtrace)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) XTcl_AppendObjToErrorInfo(tls, interp, backtrace) XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+3563, int64(-int32(1)))) return int32(TCL_ERROR) } /* * Use NRE to evaluate the bytecode from the trampoline. */ return XTclNRExecuteByteCode(tls, interp, codePtr) } /* *----------------------------------------------------------------------------- * * CompileAssembleObj -- * * Sets up and assembles Tcl bytecode for the direct-execution path in * the Tcl bytecode assembler. * * Results: * Returns a pointer to the assembled code. Returns NULL if the assembly * fails for any reason, with an appropriate error message in the * interpreter. * *----------------------------------------------------------------------------- */ func _CompileAssembleObj(tls *libc.TLS, interp uintptr, objPtr uintptr) (r uintptr) { bp := tls.Alloc(4560) defer tls.Free(4560) /* Source code to assemble */ var codePtr, iPtr, irPtr, namespacePtr, source, v1, v2, v3, v4, v5, v7 uintptr var delta1, status, v6 int32 var _ /* compEnv at bp+0 */ TCompileEnv var _ /* sourceLen at bp+4544 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _ = codePtr, delta1, iPtr, irPtr, namespacePtr, source, status, v1, v2, v3, v4, v5, v6, v7 iPtr = interp /* Compilation environment structure */ codePtr = libc.UintptrFromInt32(0) /* Length of the source code in bytes */ /* * Get the expression ByteCode from the object. If it exists, make sure it * is valid in the current context. */ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_assembleCodeType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } codePtr = v2 if codePtr != 0 { namespacePtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr if *(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) == iPtr && (*TByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch == (*TInterp)(unsafe.Pointer(iPtr)).FcompileEpoch && (*TByteCode)(unsafe.Pointer(codePtr)).FnsPtr == namespacePtr && (*TByteCode)(unsafe.Pointer(codePtr)).FnsEpoch == (*TNamespace)(unsafe.Pointer(namespacePtr)).FresolverEpoch && (*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr == (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr { return codePtr } /* * Not valid, so free it and regenerate. */ XTcl_StoreInternalRep(tls, objPtr, uintptr(unsafe.Pointer(&_assembleCodeType)), libc.UintptrFromInt32(0)) } /* * Set up the compilation environment, and assemble the code. */ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 4544)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v3 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, objPtr, bp+4544) } source = v3 XTclInitCompileEnv(tls, interp, bp, source, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 4544))), libc.UintptrFromInt32(0), 0) status = _TclAssembleCode(tls, bp, source, int32(*(*TTcl_Size)(unsafe.Pointer(bp + 4544))), int32(TCL_EVAL_DIRECT)) if status != TCL_OK { /* * Assembly failed. Clean up and report the error. */ XTclFreeCompileEnv(tls, bp) return libc.UintptrFromInt32(0) } /* * Add a "done" instruction as the last instruction and change the object * into a ByteCode object. Ownership of the literal objects and aux data * items is given to the ByteCode object. */ if (*TCompileEnv)(unsafe.Pointer(bp)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(bp)).FcodeEnd { XTclExpandCodeArray(tls, bp) } v5 = bp + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = libc.Uint8FromInt32(int32(INST_DONE)) if (*TCompileEnv)(unsafe.Pointer(bp)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(bp)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DONE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v6 = delta1 v7 = bp if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } codePtr = XTclInitByteCodeObj(tls, objPtr, uintptr(unsafe.Pointer(&_assembleCodeType)), bp) XTclFreeCompileEnv(tls, bp) /* * Record the local variable context to which the bytecode pertains */ if (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr != 0 { (*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr (*TLocalCache)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr)).FrefCount++ } /* * Report on what the assembler did. */ _ = objPtr return codePtr } /* *----------------------------------------------------------------------------- * * TclCompileAssembleCmd -- * * Compilation procedure for the '::tcl::unsupported::assemble' command. * * Results: * Returns a standard Tcl result. * * Side effects: * Puts the result of assembling the code into the bytecode stream in * 'compileEnv'. * * This procedure makes sure that the command has a single arg, which is * constant. If that condition is met, the procedure calls TclAssembleCode to * produce bytecode for the given assembly code, and returns any error * resulting from the assembly. * *----------------------------------------------------------------------------- */ func XTclCompileAssembleCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy957 uintptr, envPtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Holds resulting instructions. */ var depth, numCommands Tsize_t var offset int32 var tokenPtr uintptr _, _, _, _ = depth, numCommands, offset, tokenPtr /* Token in the input script */ numCommands = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands) offset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) depth = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) /* * Make sure that the command has a single arg that is a simple word. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return int32(TCL_ERROR) } /* * Compile the code and convert any error from the compilation into * bytecode reporting the error; */ if int32(TCL_ERROR) == _TclAssembleCode(tls, envPtr, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, int32((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize), int32(TCL_EVAL_DIRECT)) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+3565, libc.VaList(bp+8, int32((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).Fsize), (*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).Fstart, XTcl_GetErrorLine(tls, interp)))) (*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands = libc.Int64FromUint64(numCommands) (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(offset) (*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = libc.Int64FromUint64(depth) XTclCompileSyntaxError(tls, interp, envPtr) } return TCL_OK } /* *----------------------------------------------------------------------------- * * TclAssembleCode -- * * Take a list of instructions in a Tcl_Obj, and assemble them to Tcl * bytecodes * * Results: * Returns TCL_OK on success, TCL_ERROR on failure. If 'flags' includes * TCL_EVAL_DIRECT, places an error message in the interpreter result. * * Side effects: * Adds byte codes to the compile environment, and updates the * environment's stack depth. * *----------------------------------------------------------------------------- */ func _TclAssembleCode(tls *libc.TLS, envPtr uintptr, codePtr uintptr, codeLen int32, flags int32) (r int32) { /* OR'ed combination of flags */ var assemEnvPtr, instPtr, interp, nextPtr, parsePtr uintptr var bytesLeft, status int32 var instLen Tsize_t _, _, _, _, _, _, _, _ = assemEnvPtr, bytesLeft, instLen, instPtr, interp, nextPtr, parsePtr, status interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ /* * Walk through the assembly script using the Tcl parser. Each 'command' * will be an instruction or assembly directive. */ instPtr = codePtr /* Pointer to the end of the line of code */ bytesLeft = codeLen /* Tcl status return */ assemEnvPtr = _NewAssemblyEnv(tls, envPtr, flags) parsePtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FparsePtr for cond := true; cond; cond = bytesLeft > 0 { /* * Parse out one command line from the assembly script. */ status = XTcl_ParseCommand(tls, interp, instPtr, int64(bytesLeft), 0, parsePtr) /* * Report errors in the parse. */ if status != TCL_OK { if flags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_LogCommandInfo(tls, interp, codePtr, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm+uintptr(1))-int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)) } _FreeAssemblyEnv(tls, assemEnvPtr) return int32(TCL_ERROR) } /* * Advance the pointers around any leading commentary. */ XTclAdvanceLines(tls, assemEnvPtr+120, instPtr, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart) XTclAdvanceContinuations(tls, assemEnvPtr+120, assemEnvPtr+128, int32(int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64((*TCompileEnv)(unsafe.Pointer(envPtr)).Fsource))) /* * Process the line of code. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 0 { instLen = libc.Uint64FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize) /* Length in bytes of the current command */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm == (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart+uintptr(instLen)-uintptr(1) { instLen-- } /* * If tracing, show each line assembled as it happens. */ if _AssembleOneLine(tls, assemEnvPtr) != TCL_OK { if flags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_LogCommandInfo(tls, interp, codePtr, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, libc.Int64FromUint64(instLen)) } XTcl_FreeParse(tls, parsePtr) _FreeAssemblyEnv(tls, assemEnvPtr) return int32(TCL_ERROR) } } /* * Advance to the next line of code. */ nextPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize) bytesLeft = int32(int64(bytesLeft) - (int64(nextPtr) - int64(instPtr))) instPtr = nextPtr XTclAdvanceLines(tls, assemEnvPtr+120, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, instPtr) XTclAdvanceContinuations(tls, assemEnvPtr+120, assemEnvPtr+128, int32(int64(instPtr)-int64((*TCompileEnv)(unsafe.Pointer(envPtr)).Fsource))) XTcl_FreeParse(tls, parsePtr) } /* * Done with parsing the code. */ status = _FinishAssembly(tls, assemEnvPtr) _FreeAssemblyEnv(tls, assemEnvPtr) return status } /* *----------------------------------------------------------------------------- * * NewAssemblyEnv -- * * Creates an environment for the assembler to run in. * * Results: * Allocates, initialises and returns an assembler environment * *----------------------------------------------------------------------------- */ func _NewAssemblyEnv(tls *libc.TLS, envPtr uintptr, flags int32) (r uintptr) { /* Compilation flags (TCL_EVAL_DIRECT) */ var assemEnvPtr, interp, parsePtr uintptr _, _, _ = assemEnvPtr, interp, parsePtr interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ assemEnvPtr = XTclStackAlloc(tls, interp, uint64(168)) /* Assembler environment under construction */ parsePtr = XTclStackAlloc(tls, interp, uint64(744)) /* Parse of one line of assembly code */ (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr = envPtr (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FparsePtr = parsePtr (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine = int64(1) (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FclNext = (*TCompileEnv)(unsafe.Pointer(envPtr)).FclNext /* * Make the hashtables that store symbol resolution. */ XTcl_InitHashTable(tls, assemEnvPtr+16, TCL_STRING_KEYS) /* * Start the first basic block. */ (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb = libc.UintptrFromInt32(0) (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb = _AllocBB(tls, assemEnvPtr) (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb (*TBasicBlock)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb)).FstartLine = int32(1) /* * Stash compilation flags. */ (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags = flags return assemEnvPtr } /* *----------------------------------------------------------------------------- * * FreeAssemblyEnv -- * * Cleans up the assembler environment when assembly is complete. * *----------------------------------------------------------------------------- */ func _FreeAssemblyEnv(tls *libc.TLS, assemEnvPtr uintptr) { /* Environment to free */ var _objPtr, envPtr, interp, nextBB, thisBB, v3 uintptr var v2 TTcl_Size _, _, _, _, _, _, _ = _objPtr, envPtr, interp, nextBB, thisBB, v2, v3 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment being used for code * generation */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Pointer to a deleted basic block's * successor */ /* * Free all the basic block structures. */ thisBB = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb for { if !(thisBB != libc.UintptrFromInt32(0)) { break } if (*TBasicBlock)(unsafe.Pointer(thisBB)).FjumpTarget != libc.UintptrFromInt32(0) { _objPtr = (*TBasicBlock)(unsafe.Pointer(thisBB)).FjumpTarget v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } } if (*TBasicBlock)(unsafe.Pointer(thisBB)).FforeignExceptions != libc.UintptrFromInt32(0) { XTclpFree(tls, (*TBasicBlock)(unsafe.Pointer(thisBB)).FforeignExceptions) } nextBB = (*TBasicBlock)(unsafe.Pointer(thisBB)).Fsuccessor1 if (*TBasicBlock)(unsafe.Pointer(thisBB)).FjtPtr != libc.UintptrFromInt32(0) { _DeleteMirrorJumpTable(tls, (*TBasicBlock)(unsafe.Pointer(thisBB)).FjtPtr) (*TBasicBlock)(unsafe.Pointer(thisBB)).FjtPtr = libc.UintptrFromInt32(0) } XTclpFree(tls, thisBB) goto _1 _1: ; thisBB = nextBB } /* * Dispose what's left. */ XTcl_DeleteHashTable(tls, assemEnvPtr+16) XTclStackFree(tls, interp, (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FparsePtr) XTclStackFree(tls, interp, assemEnvPtr) } /* *----------------------------------------------------------------------------- * * AssembleOneLine -- * * Assembles a single command from an assembly language source. * * Results: * Returns TCL_ERROR with an appropriate error message if the assembly * fails. Returns TCL_OK if the assembly succeeds. Updates the assembly * environment with the state of the assembly. * *----------------------------------------------------------------------------- */ func _AssembleOneLine(tls *libc.TLS, assemEnvPtr uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) /* State of the assembly */ var _objPtr, _objPtr1, envPtr, interp, jtPtr, operand1, parsePtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v42, v44, v5, v6, v7, v8, v9 uintptr var flags, infoIndex, litIndex, status, v31 int32 var instType TTalInstType var localVar, v41, v43 TTcl_Size var _ /* instNameObj at bp+8 */ uintptr var _ /* operand1Len at bp+32 */ TTcl_Size var _ /* operand1Obj at bp+24 */ uintptr var _ /* opnd at bp+40 */ int32 var _ /* tblIdx at bp+16 */ int32 var _ /* tokenPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, envPtr, flags, infoIndex, instType, interp, jtPtr, litIndex, localVar, operand1, parsePtr, status, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v5, v6, v7, v8, v9 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment being used for code * gen */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ parsePtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FparsePtr /* Type of the instruction */ *(*uintptr)(unsafe.Pointer(bp + 24)) = libc.UintptrFromInt32(0) /* Index of the jumptable in auxdata */ status = int32(TCL_ERROR) /* Return value from this function */ /* * Make sure that the instruction name is known at compile time. */ *(*uintptr)(unsafe.Pointer(bp)) = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr if _GetNextOperand(tls, assemEnvPtr, bp, bp+8) != TCL_OK { return int32(TCL_ERROR) } /* * Look up the instruction name. */ if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 8)), uintptr(unsafe.Pointer(&_TalInstructionTable)), libc.Int64FromUint64(libc.Uint64FromInt64(24)), __ccgo_ts+3593, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } v3 = envPtr + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(24)) v5 = envPtr + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(16)) v7 = envPtr + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(8)) v9 = envPtr + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt64(localVar)) case int32(ASSEM_CLOCK_READ): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3635) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK { goto cleanup } if *(*int32)(unsafe.Pointer(bp + 40)) < 0 || *(*int32)(unsafe.Pointer(bp + 40)) > int32(3) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+3640, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+3669, libc.UintptrFromInt32(0))) goto cleanup } _BBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))) case int32(ASSEM_CONCAT1): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3635) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckOneByte(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK || _CheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } _BBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))) case int32(ASSEM_DICT_GET): fallthrough case int32(ASSEM_DICT_GET_DEF): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3682) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))+int32(1)) case int32(ASSEM_DICT_SET): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3688) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } localVar = libc.Int64FromUint64(_FindLocalVar(tls, assemEnvPtr, bp)) if localVar < 0 { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))+int32(1)) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } v11 = envPtr + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(24)) v13 = envPtr + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(16)) v15 = envPtr + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(8)) v17 = envPtr + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt64(localVar)) case int32(ASSEM_DICT_UNSET): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3688) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } localVar = libc.Int64FromUint64(_FindLocalVar(tls, assemEnvPtr, bp)) if localVar < 0 { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } v19 = envPtr + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(24)) v21 = envPtr + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(16)) v23 = envPtr + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(8)) v25 = envPtr + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt64(localVar)) case int32(ASSEM_END_CATCH): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(1) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+1945) goto cleanup } *(*int32)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb + 112)) |= int32(BB_ENDCATCH) _BBEmitOpcode(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), 0) _StartBasicBlock(tls, assemEnvPtr, int32(BB_FALLTHRU), libc.UintptrFromInt32(0)) case int32(ASSEM_EVAL): /* TODO - Refactor this stuff into a subroutine that takes the inst * code, the message ("script" or "expression") and an evaluator * callback that calls TclCompileScript or TclCompileExpr. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { if _TalInstructionTable[*(*int32)(unsafe.Pointer(bp + 16))].FtclInstCode == int32(INST_EVAL_STK) { v26 = __ccgo_ts + 3702 } else { v26 = __ccgo_ts + 3709 } XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, v26) goto cleanup } if (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _CompileEmbeddedScript(tls, assemEnvPtr, *(*uintptr)(unsafe.Pointer(bp))+uintptr(1)*32, uintptr(unsafe.Pointer(&_TalInstructionTable))+uintptr(*(*int32)(unsafe.Pointer(bp + 16)))*24) } else { if _GetNextOperand(tls, assemEnvPtr, bp, bp+24) != TCL_OK { goto cleanup } else { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Flength v27 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes } else { v27 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), bp+32) } operand1 = v27 litIndex = XTclRegisterLiteral(tls, envPtr, operand1, *(*TTcl_Size)(unsafe.Pointer(bp + 32)), 0) /* * Assumes that PUSH is the first slot! */ _BBEmitInst1or4(tls, assemEnvPtr, 0, litIndex, 0) _BBEmitOpcode(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), 0) } } case int32(ASSEM_INVOKE): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3682) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } _BBEmitInst1or4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))) case int32(ASSEM_JUMP): fallthrough case int32(ASSEM_JUMP4): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+2727) goto cleanup } if _GetNextOperand(tls, assemEnvPtr, bp, bp+24) != TCL_OK { goto cleanup } (*TBasicBlock)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpOffset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) if instType == int32(ASSEM_JUMP) { flags = int32(BB_JUMP1) _BBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), 0, 0) } else { flags = 0 _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), 0, 0) } /* * Start a new basic block at the instruction following the jump. */ (*TBasicBlock)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpLine = int32((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine) if _TalInstructionTable[*(*int32)(unsafe.Pointer(bp + 16))].FoperandsConsumed != 0 { flags |= int32(BB_FALLTHRU) } _StartBasicBlock(tls, assemEnvPtr, flags, *(*uintptr)(unsafe.Pointer(bp + 24))) case int32(ASSEM_JUMPTABLE): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3720) goto cleanup } if _GetNextOperand(tls, assemEnvPtr, bp, bp+24) != TCL_OK { goto cleanup } jtPtr = XTcl_Alloc(tls, uint64(104)) XTcl_InitHashTable(tls, jtPtr, TCL_STRING_KEYS) (*TBasicBlock)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpLine = int32((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine) (*TBasicBlock)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FjumpOffset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) infoIndex = int32(XTclCreateAuxData(tls, jtPtr, uintptr(unsafe.Pointer(&XtclJumptableInfoType)), envPtr)) _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), infoIndex, 0) if _CreateMirrorJumpTable(tls, assemEnvPtr, *(*uintptr)(unsafe.Pointer(bp + 24))) != TCL_OK { goto cleanup } _StartBasicBlock(tls, assemEnvPtr, int32(BB_JUMPTABLE)|int32(BB_FALLTHRU), libc.UintptrFromInt32(0)) case int32(ASSEM_LABEL): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3726) goto cleanup } if _GetNextOperand(tls, assemEnvPtr, bp, bp+24) != TCL_OK { goto cleanup } /* * Add the (label_name, address) pair to the hash table. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != 0 { v28 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes } else { v28 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), libc.UintptrFromInt32(0)) } if _DefineLabel(tls, assemEnvPtr, v28) != TCL_OK { goto cleanup } case int32(ASSEM_LINDEX_MULTI): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3682) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckStrictlyPositive(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))) case int32(ASSEM_LIST): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3682) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckNonNegative(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))) case int32(ASSEM_INDEX): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3682) goto cleanup } if _GetListIndexOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))) case int32(ASSEM_LSET_FLAT): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3682) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK { goto cleanup } if *(*int32)(unsafe.Pointer(bp + 40)) < int32(2) { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+3731, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+3751, libc.UintptrFromInt32(0))) } goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))) case int32(ASSEM_LVT): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3762) goto cleanup } localVar = libc.Int64FromUint64(_FindLocalVar(tls, assemEnvPtr, bp)) if localVar < 0 { goto cleanup } _BBEmitInst1or4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), int32(localVar), 0) case int32(ASSEM_LVT1): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3762) goto cleanup } localVar = libc.Int64FromUint64(_FindLocalVar(tls, assemEnvPtr, bp)) if localVar < 0 || _CheckOneByte(tls, interp, int32(localVar)) != 0 { goto cleanup } _BBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), int32(localVar), 0) case int32(ASSEM_LVT1_SINT1): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3770) goto cleanup } localVar = libc.Int64FromUint64(_FindLocalVar(tls, assemEnvPtr, bp)) if localVar < 0 || _CheckOneByte(tls, interp, int32(localVar)) != 0 || _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckSignedOneByte(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != 0 { goto cleanup } _BBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), int32(localVar), 0) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } v30 = envPtr + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 40)))) case int32(ASSEM_LVT4): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3762) goto cleanup } localVar = libc.Int64FromUint64(_FindLocalVar(tls, assemEnvPtr, bp)) if localVar < 0 { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), int32(localVar), 0) case int32(ASSEM_OVER): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3682) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckNonNegative(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))+int32(1)) case int32(ASSEM_REGEXP): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3611) goto cleanup } if _GetBooleanOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK { goto cleanup } if *(*int32)(unsafe.Pointer(bp + 40)) != 0 { v31 = int32(TCL_REG_NOCASE) } else { v31 = 0 } _BBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), int32(TCL_REG_ADVANCED)|v31, 0) case int32(ASSEM_REVERSE): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3682) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckNonNegative(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 40))) case int32(ASSEM_SINT1): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3635) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK || _CheckSignedOneByte(tls, interp, *(*int32)(unsafe.Pointer(bp + 40))) != TCL_OK { goto cleanup } _BBEmitInstInt1(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), 0) case int32(ASSEM_SINT4_LVT4): if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { XTcl_WrongNumArgs(tls, interp, int64(1), bp+8, __ccgo_ts+3688) goto cleanup } if _GetIntegerOperand(tls, assemEnvPtr, bp, bp+40) != TCL_OK { goto cleanup } localVar = libc.Int64FromUint64(_FindLocalVar(tls, assemEnvPtr, bp)) if localVar < 0 { goto cleanup } _BBEmitInstInt4(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 40)), 0) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } v33 = envPtr + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(24)) v35 = envPtr + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(16)) v37 = envPtr + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(8)) v39 = envPtr + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt64(localVar)) default: if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 { v40 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes } else { v40 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), libc.UintptrFromInt32(0)) } XTcl_Panic(tls, __ccgo_ts+3783, libc.VaList(bp+56, v40)) } status = TCL_OK goto cleanup cleanup: ; _objPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) v42 = _objPtr v41 = *(*TTcl_Size)(unsafe.Pointer(v42)) *(*TTcl_Size)(unsafe.Pointer(v42))-- if v41 <= int64(1) { XTclFreeObj(tls, _objPtr) } if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 { _objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 24)) v44 = _objPtr1 v43 = *(*TTcl_Size)(unsafe.Pointer(v44)) *(*TTcl_Size)(unsafe.Pointer(v44))-- if v43 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } return status } /* *----------------------------------------------------------------------------- * * CompileEmbeddedScript -- * * Compile an embedded 'eval' or 'expr' that appears in assembly code. * * This procedure is called when the 'eval' or 'expr' assembly directive is * encountered, and the argument to the directive is a simple word that * requires no substitution. The appropriate compiler (TclCompileScript or * TclCompileExpr) is invoked recursively, and emits bytecode. * * Before the compiler is invoked, the compilation environment's stack * consumption is reset to zero. Upon return from the compilation, the net * stack effect of the compilation is in the compiler env, and this stack * effect is posted to the assembler environment. The compile environment's * stack consumption is then restored to what it was before (which is actually * the state of the stack on entry to the block of assembly code). * * Any exception ranges pushed by the compilation are copied to the basic * block and removed from the compiler environment. They will be rebuilt at * the end of assembly, when the exception stack depth is actually known. * *----------------------------------------------------------------------------- */ func _CompileEmbeddedScript(tls *libc.TLS, assemEnvPtr uintptr, tokenPtr uintptr, instPtr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* Instruction that determines whether * the script is 'expr' or 'eval' */ var envPtr, interp uintptr var savedExceptArrayNext int32 var savedMaxStackDepth, savedStackDepth Tsize_t _, _, _, _, _ = envPtr, interp, savedExceptArrayNext, savedMaxStackDepth, savedStackDepth envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ /* * The expression or script is not only known at compile time, but * actually a "simple word". It can be compiled inline by invoking the * compiler recursively. * * Save away the stack depth and reset it before compiling the script. * We'll record the stack usage of the script in the BasicBlock, and * accumulate it together with the stack usage of the enclosing assembly * code. */ savedStackDepth = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) savedMaxStackDepth = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth) savedExceptArrayNext = int32((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) (*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = 0 _StartBasicBlock(tls, assemEnvPtr, int32(BB_FALLTHRU), libc.UintptrFromInt32(0)) switch (*TTalInstDesc)(unsafe.Pointer(instPtr)).FtclInstCode { case int32(INST_EVAL_STK): XTclCompileScript(tls, interp, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, envPtr) case int32(INST_EXPR_STK): XTclCompileExpr(tls, interp, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, envPtr, int32(1)) default: XTcl_Panic(tls, __ccgo_ts+3834, libc.VaList(bp+8, (*TTalInstDesc)(unsafe.Pointer(instPtr)).Fname, (*TTalInstDesc)(unsafe.Pointer(instPtr)).FtclInstCode)) } /* * Roll up the stack usage of the embedded block into the assembler * environment. */ _SyncStackDepth(tls, assemEnvPtr) (*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = libc.Int64FromUint64(savedStackDepth) (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = libc.Int64FromUint64(savedMaxStackDepth) /* * Save any exception ranges that were pushed by the compiler; they will * need to be fixed up once the stack depth is known. */ _MoveExceptionRangesToBasicBlock(tls, assemEnvPtr, savedExceptArrayNext) /* * Flush the current basic block. */ _StartBasicBlock(tls, assemEnvPtr, int32(BB_FALLTHRU), libc.UintptrFromInt32(0)) } /* *----------------------------------------------------------------------------- * * SyncStackDepth -- * * Copies the stack depth from the compile environment to a basic block. * * Side effects: * Current and max stack depth in the current basic block are adjusted. * * This procedure is called on return from invoking the compiler for the * 'eval' and 'expr' operations. It adjusts the stack depth of the current * basic block to reflect the stack required by the just-compiled code. * *----------------------------------------------------------------------------- */ func _SyncStackDepth(tls *libc.TLS, assemEnvPtr uintptr) { /* Assembly environment */ var curr_bb, envPtr, p1 uintptr var maxStackDepth int32 _, _, _, _ = curr_bb, envPtr, maxStackDepth, p1 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ curr_bb = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb /* Current basic block */ maxStackDepth = int32(int64((*TBasicBlock)(unsafe.Pointer(curr_bb)).FfinalStackDepth) + (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth) /* Max stack depth in the basic block */ if maxStackDepth > (*TBasicBlock)(unsafe.Pointer(curr_bb)).FmaxStackDepth { (*TBasicBlock)(unsafe.Pointer(curr_bb)).FmaxStackDepth = maxStackDepth } p1 = curr_bb + 68 *(*int32)(unsafe.Pointer(p1)) = int32(int64(*(*int32)(unsafe.Pointer(p1))) + (*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth) } /* *----------------------------------------------------------------------------- * * MoveExceptionRangesToBasicBlock -- * * Removes exception ranges that were created by compiling an embedded * script from the CompileEnv, and stores them in the BasicBlock. They * will be reinstalled, at the correct stack depth, after control flow * analysis is complete on the assembly code. * *----------------------------------------------------------------------------- */ func _MoveExceptionRangesToBasicBlock(tls *libc.TLS, assemEnvPtr uintptr, savedExceptArrayNext int32) { /* Saved index of the end of the exception * range array */ var curr_bb, envPtr uintptr var exceptionCount, i int32 _, _, _, _ = curr_bb, envPtr, exceptionCount, i envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ curr_bb = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb /* Current basic block */ exceptionCount = int32((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext - int64(savedExceptArrayNext)) if exceptionCount == 0 { /* Nothing to do */ return } /* * Save the exception ranges in the basic block. They will be re-added at * the conclusion of assembly; at this time, the INST_BEGIN_CATCH * instructions in the block will be adjusted from whatever range indices * they have [savedExceptArrayNext .. envPtr->exceptArrayNext) to the * indices that the exceptions acquire. The saved exception ranges are * converted to a relative nesting depth. The depth will be recomputed * once flow analysis has determined the actual stack depth of the block. */ (*TBasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptionBase = savedExceptArrayNext (*TBasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptionCount = exceptionCount (*TBasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptions = XTcl_Alloc(tls, libc.Uint64FromInt32(exceptionCount)*uint64(56)) libc.Xmemcpy(tls, (*TBasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptions, (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(savedExceptArrayNext)*56, libc.Uint64FromInt32(exceptionCount)*uint64(56)) i = 0 for { if !(i < exceptionCount) { break } (*(*TExceptionRange)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(curr_bb)).FforeignExceptions + uintptr(i)*56))).FnestingLevel -= (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth goto _1 _1: ; i++ } (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext = int64(savedExceptArrayNext) } /* *----------------------------------------------------------------------------- * * CreateMirrorJumpTable -- * * Makes a jump table with comparison values and assembly code labels. * * Results: * Returns a standard Tcl status, with an error message in the * interpreter on error. * * Side effects: * Initializes the jump table pointer in the current basic block to a * JumptableInfo. The keys in the JumptableInfo are the comparison * strings. The values, instead of being jump displacements, are * Tcl_Obj's with the code labels. */ func _CreateMirrorJumpTable(tls *libc.TLS, assemEnvPtr uintptr, jumps uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* List of alternating keywords and labels */ var bbPtr, envPtr, hashEntry, interp, jtHashPtr, jtPtr, v7, v8 uintptr var i TTcl_Size var v1, v3 int32 var v2, v4, v5 int64 var _ /* isNew at bp+16 */ int32 var _ /* objc at bp+0 */ TTcl_Size var _ /* objv at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bbPtr, envPtr, hashEntry, i, interp, jtHashPtr, jtPtr, v1, v2, v3, v4, v5, v7, v8 /* Pointers to the elements in the list */ envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ bbPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb if (*TTcl_Obj)(unsafe.Pointer(jumps)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, jumps, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp))%int64(2) != 0 { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+3879, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+3932, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(jumps)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr2)).FspanStart } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr1 + 40 + uintptr(v4)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr2)).FspanLength } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(jumps + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v5 v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_ListObjGetElements(tls, interp, jumps, bp, bp+8) } if v3 != TCL_OK { return int32(TCL_ERROR) } /* * Allocate the jumptable. */ jtPtr = XTcl_Alloc(tls, uint64(104)) jtHashPtr = jtPtr XTcl_InitHashTable(tls, jtHashPtr, TCL_STRING_KEYS) /* * Fill the keys and labels into the table. */ i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp))) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes != 0 { v7 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)), libc.UintptrFromInt32(0)) } hashEntry = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(jtHashPtr)).FcreateProc})))(tls, jtHashPtr, v7, bp+16) if !(*(*int32)(unsafe.Pointer(bp + 16)) != 0) { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes != 0 { v8 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes } else { v8 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+3945, libc.VaList(bp+32, v8))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+3984, libc.UintptrFromInt32(0))) _DeleteMirrorJumpTable(tls, jtPtr) return int32(TCL_ERROR) } } (*TTcl_HashEntry)(unsafe.Pointer(hashEntry)).FclientData = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+int64(1))*8)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i+int64(1))*8)))).FrefCount++ goto _6 _6: ; i += int64(2) } /* * Put the mirror jumptable in the basic block struct. */ (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjtPtr = jtPtr return TCL_OK } /* *----------------------------------------------------------------------------- * * DeleteMirrorJumpTable -- * * Cleans up a jump table when the basic block is deleted. * *----------------------------------------------------------------------------- */ func _DeleteMirrorJumpTable(tls *libc.TLS, jtPtr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, entry, jtHashPtr, label, v3 uintptr var v2 TTcl_Size var _ /* search at bp+0 */ TTcl_HashSearch _, _, _, _, _, _ = _objPtr, entry, jtHashPtr, label, v2, v3 jtHashPtr = jtPtr /* Jump label from the hash table */ entry = XTcl_FirstHashEntry(tls, jtHashPtr, bp) for { if !(entry != libc.UintptrFromInt32(0)) { break } label = (*TTcl_HashEntry)(unsafe.Pointer(entry)).FclientData _objPtr = label v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } (*TTcl_HashEntry)(unsafe.Pointer(entry)).FclientData = libc.UintptrFromInt32(0) goto _1 _1: ; entry = XTcl_NextHashEntry(tls, bp) } XTcl_DeleteHashTable(tls, jtHashPtr) XTclpFree(tls, jtPtr) } /* *----------------------------------------------------------------------------- * * GetNextOperand -- * * Retrieves the next operand in sequence from an assembly instruction, * and makes sure that its value is known at compile time. * * Results: * If successful, returns TCL_OK and leaves a Tcl_Obj with the operand * text in *operandObjPtr. In case of failure, returns TCL_ERROR and * leaves *operandObjPtr untouched. * * Side effects: * Advances *tokenPtrPtr around the token just processed. * *----------------------------------------------------------------------------- */ func _GetNextOperand(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr, operandObjPtr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* OUTPUT: Tcl object holding the operand text * with \-substitutions done. */ var _objPtr, cachePtr, interp, operandObj, v3 uintptr var v1 bool var v2 TTcl_Size _, _, _, _, _, _, _ = _objPtr, cachePtr, interp, operandObj, v1, v2, v3 interp = (*TCompileEnv)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr)).FiPtr if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { operandObj = XTclThreadAllocObj(tls) } else { operandObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(operandObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(operandObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(operandObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(operandObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(operandObj)).FtypePtr = libc.UintptrFromInt32(0) if !(XTclWordKnownAtCompileTime(tls, *(*uintptr)(unsafe.Pointer(tokenPtrPtr)), operandObj) != 0) { _objPtr = operandObj v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+4002, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4046, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) + uintptr((*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tokenPtrPtr)))).FnumComponents+libc.Int64FromInt32(1))*32 (*TTcl_Obj)(unsafe.Pointer(operandObj)).FrefCount++ *(*uintptr)(unsafe.Pointer(operandObjPtr)) = operandObj return TCL_OK } /* *----------------------------------------------------------------------------- * * GetBooleanOperand -- * * Retrieves a Boolean operand from the input stream and advances * the token pointer. * * Results: * Returns a standard Tcl result (with an error message in the * interpreter on failure). * * Side effects: * Stores the Boolean value in (*result) and advances (*tokenPtrPtr) * to the next token. * *----------------------------------------------------------------------------- */ func _GetBooleanOperand(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr, result uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* OUTPUT: Integer extracted from the token */ var _objPtr, envPtr, interp, tokenPtr, v2 uintptr var status int32 var v1 TTcl_Size var _ /* intObj at bp+0 */ uintptr _, _, _, _, _, _, _ = _objPtr, envPtr, interp, status, tokenPtr, v1, v2 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ tokenPtr = *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) /* Tcl status return */ /* * Extract the next token as a string. */ if _GetNextOperand(tls, assemEnvPtr, tokenPtrPtr, bp) != TCL_OK { return int32(TCL_ERROR) } /* * Convert to an integer, advance to the next token and return. */ status = XTcl_GetBoolFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), result) _objPtr = *(*uintptr)(unsafe.Pointer(bp)) v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 return status } /* *----------------------------------------------------------------------------- * * GetIntegerOperand -- * * Retrieves an integer operand from the input stream and advances the * token pointer. * * Results: * Returns a standard Tcl result (with an error message in the * interpreter on failure). * * Side effects: * Stores the integer value in (*result) and advances (*tokenPtrPtr) to * the next token. * *----------------------------------------------------------------------------- */ func _GetIntegerOperand(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr, result uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* OUTPUT: Integer extracted from the token */ var _objPtr, envPtr, interp, tokenPtr, v2 uintptr var status int32 var v1 TTcl_Size var _ /* intObj at bp+0 */ uintptr _, _, _, _, _, _, _ = _objPtr, envPtr, interp, status, tokenPtr, v1, v2 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ tokenPtr = *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) /* Tcl status return */ /* * Extract the next token as a string. */ if _GetNextOperand(tls, assemEnvPtr, tokenPtrPtr, bp) != TCL_OK { return int32(TCL_ERROR) } /* * Convert to an integer, advance to the next token and return. */ status = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), result) _objPtr = *(*uintptr)(unsafe.Pointer(bp)) v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 return status } /* *----------------------------------------------------------------------------- * * GetListIndexOperand -- * * Gets the value of an operand intended to serve as a list index. * * Results: * Returns a standard Tcl result: TCL_OK if the parse is successful and * TCL_ERROR (with an appropriate error message) if the parse fails. * * Side effects: * Stores the list index at '*index'. Values between -1 and 0x7FFFFFFF * have their natural meaning; values between -2 and -0x80000000 * represent 'end-2-N'. * *----------------------------------------------------------------------------- */ func _GetListIndexOperand(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr, result uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* OUTPUT: encoded index derived from the token */ var _objPtr, envPtr, interp, tokenPtr, v2 uintptr var status int32 var v1 TTcl_Size var _ /* value at bp+0 */ uintptr _, _, _, _, _, _, _ = _objPtr, envPtr, interp, status, tokenPtr, v1, v2 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ tokenPtr = *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) /* General operand validity check */ if _GetNextOperand(tls, assemEnvPtr, tokenPtrPtr, bp) != TCL_OK { return int32(TCL_ERROR) } /* Convert to an integer, advance to the next token and return. */ /* * NOTE: Indexing a list with an index before it yields the * same result as indexing after it, and might be more easily portable * when list size limits grow. */ status = XTclIndexEncode(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), int32(int64(-libc.Int32FromInt32(1))), int32(int64(-libc.Int32FromInt32(1))), result) _objPtr = *(*uintptr)(unsafe.Pointer(bp)) v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 return status } /* *----------------------------------------------------------------------------- * * FindLocalVar -- * * Gets the name of a local variable from the input stream and advances * the token pointer. * * Results: * Returns the LVT index of the local variable. Returns -1 if the * variable is non-local, not known at compile time, or cannot be * installed in the LVT (leaving an error message in the interpreter * result if necessary). * * Side effects: * Advances the token pointer. May define a new LVT slot if the variable * has not yet been seen and the execution context allows for it. * *----------------------------------------------------------------------------- */ func _FindLocalVar(tls *libc.TLS, assemEnvPtr uintptr, tokenPtrPtr uintptr) (r Tsize_t) { bp := tls.Alloc(64) defer tls.Free(64) var _objPtr, _objPtr1, envPtr, interp, tokenPtr, varNameStr, v1, v3, v5 uintptr var localVar, v2, v4 TTcl_Size var _ /* varNameLen at bp+8 */ TTcl_Size var _ /* varNameObj at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, envPtr, interp, localVar, tokenPtr, varNameStr, v1, v2, v3, v4, v5 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ tokenPtr = *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) /* Index of the variable in the LVT */ if _GetNextOperand(tls, assemEnvPtr, tokenPtrPtr, bp) != TCL_OK { return libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp)), bp+8) } varNameStr = v1 if _CheckNamespaceQualifiers(tls, interp, varNameStr, int32(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) != 0 { _objPtr = *(*uintptr)(unsafe.Pointer(bp)) v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } return libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))) } localVar = XTclFindCompiledLocal(tls, varNameStr, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), int32(1), envPtr) _objPtr1 = *(*uintptr)(unsafe.Pointer(bp)) v5 = _objPtr1 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr1) } if localVar < 0 { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+4054, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4125, libc.UintptrFromInt32(0))) } return libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))) } *(*uintptr)(unsafe.Pointer(tokenPtrPtr)) = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 return libc.Uint64FromInt64(localVar) } /* *----------------------------------------------------------------------------- * * CheckNamespaceQualifiers -- * * Verify that a variable name has no namespace qualifiers before * attempting to install it in the LVT. * * Results: * On success, returns TCL_OK. On failure, returns TCL_ERROR and stores * an error message in the interpreter result. * *----------------------------------------------------------------------------- */ func _CheckNamespaceQualifiers(tls *libc.TLS, interp uintptr, name uintptr, nameLen int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Length of the variable */ var p uintptr _ = p p = name for { if !(p+uintptr(2) < name+uintptr(nameLen)) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(':') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) == int32(':') { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+4129, libc.VaList(bp+8, name))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4156, name, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } goto _1 _1: ; p++ } return TCL_OK } /* *----------------------------------------------------------------------------- * * CheckOneByte -- * * Verify that a constant fits in a single byte in the instruction * stream. * * Results: * On success, returns TCL_OK. On failure, returns TCL_ERROR and stores * an error message in the interpreter result. * * This code is here primarily to verify that instructions like INCR_SCALAR1 * are possible on a given local variable. The fact that there is no * INCR_SCALAR4 is puzzling. * *----------------------------------------------------------------------------- */ func _CheckOneByte(tls *libc.TLS, interp uintptr, value int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Value to check */ var result uintptr _ = result /* Error message */ if value < 0 || value > int32(0xFF) { result = XTcl_NewStringObj(tls, __ccgo_ts+4165, int64(-int32(1))) XTcl_SetObjResult(tls, interp, result) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4198, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } return TCL_OK } /* *----------------------------------------------------------------------------- * * CheckSignedOneByte -- * * Verify that a constant fits in a single signed byte in the instruction * stream. * * Results: * On success, returns TCL_OK. On failure, returns TCL_ERROR and stores * an error message in the interpreter result. * * This code is here primarily to verify that instructions like INCR_SCALAR1 * are possible on a given local variable. The fact that there is no * INCR_SCALAR4 is puzzling. * *----------------------------------------------------------------------------- */ func _CheckSignedOneByte(tls *libc.TLS, interp uintptr, value int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Value to check */ var result uintptr _ = result /* Error message */ if value > int32(0x7F) || value < -int32(0x80) { result = XTcl_NewStringObj(tls, __ccgo_ts+4165, int64(-int32(1))) XTcl_SetObjResult(tls, interp, result) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4198, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } return TCL_OK } /* *----------------------------------------------------------------------------- * * CheckNonNegative -- * * Verify that a constant is nonnegative * * Results: * On success, returns TCL_OK. On failure, returns TCL_ERROR and stores * an error message in the interpreter result. * * This code is here primarily to verify that instructions like INCR_INVOKE * are consuming a positive number of operands * *----------------------------------------------------------------------------- */ func _CheckNonNegative(tls *libc.TLS, interp uintptr, value int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Value to check */ var result uintptr _ = result /* Error message */ if value < 0 { result = XTcl_NewStringObj(tls, __ccgo_ts+4204, int64(-int32(1))) XTcl_SetObjResult(tls, interp, result) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4232, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } return TCL_OK } /* *----------------------------------------------------------------------------- * * CheckStrictlyPositive -- * * Verify that a constant is positive * * Results: * On success, returns TCL_OK. On failure, returns TCL_ERROR and * stores an error message in the interpreter result. * * This code is here primarily to verify that instructions like INCR_INVOKE * are consuming a positive number of operands * *----------------------------------------------------------------------------- */ func _CheckStrictlyPositive(tls *libc.TLS, interp uintptr, value int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Value to check */ var result uintptr _ = result /* Error message */ if value <= 0 { result = XTcl_NewStringObj(tls, __ccgo_ts+4244, int64(-int32(1))) XTcl_SetObjResult(tls, interp, result) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4269, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } return TCL_OK } /* *----------------------------------------------------------------------------- * * DefineLabel -- * * Defines a label appearing in the assembly sequence. * * Results: * Returns a standard Tcl result. Returns TCL_OK and an empty result if * the definition succeeds; returns TCL_ERROR and an appropriate message * if a duplicate definition is found. * *----------------------------------------------------------------------------- */ func _DefineLabel(tls *libc.TLS, assemEnvPtr uintptr, labelName uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Label being defined */ var entry, envPtr, interp uintptr var _ /* isNew at bp+0 */ int32 _, _, _ = entry, envPtr, interp envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Flag == 1 iff the label was previously * undefined */ /* TODO - This can now be simplified! */ _StartBasicBlock(tls, assemEnvPtr, int32(BB_FALLTHRU), libc.UintptrFromInt32(0)) /* * Look up the newly-defined label in the symbol table. */ entry = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16)).FcreateProc})))(tls, assemEnvPtr+16, labelName, bp) if !(*(*int32)(unsafe.Pointer(bp)) != 0) { /* * This is a duplicate label. */ if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+4278, libc.VaList(bp+16, labelName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4313, labelName, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } /* * This is the first appearance of the label in the code. */ (*TTcl_HashEntry)(unsafe.Pointer(entry)).FclientData = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb return TCL_OK } /* *----------------------------------------------------------------------------- * * StartBasicBlock -- * * Starts a new basic block when a label or jump is encountered. * * Results: * Returns a pointer to the BasicBlock structure of the new * basic block. * *----------------------------------------------------------------------------- */ func _StartBasicBlock(tls *libc.TLS, assemEnvPtr uintptr, flags int32, jumpLabel uintptr) (r uintptr) { /* Label of the location that the block jumps * to, or NULL if the block does not jump */ var currBB, envPtr, newBB uintptr _, _, _ = currBB, envPtr, newBB envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* BasicBlock structure for the new block */ currBB = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb /* * Coalesce zero-length blocks. */ if int64((*TBasicBlock)(unsafe.Pointer(currBB)).FstartOffset) == int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart) { (*TBasicBlock)(unsafe.Pointer(currBB)).FstartLine = int32((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine) return currBB } /* * Make the new basic block. */ newBB = _AllocBB(tls, assemEnvPtr) /* * Record the jump target if there is one. */ (*TBasicBlock)(unsafe.Pointer(currBB)).FjumpTarget = jumpLabel if jumpLabel != libc.UintptrFromInt32(0) { (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(currBB)).FjumpTarget)).FrefCount++ } /* * Record the fallthrough if there is one. */ *(*int32)(unsafe.Pointer(currBB + 112)) |= flags /* * Record the successor block. */ (*TBasicBlock)(unsafe.Pointer(currBB)).Fsuccessor1 = newBB (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb = newBB return newBB } /* *----------------------------------------------------------------------------- * * AllocBB -- * * Allocates a new basic block * * Results: * Returns a pointer to the newly allocated block, which is initialized * to contain no code and begin at the current instruction pointer. * *----------------------------------------------------------------------------- */ func _AllocBB(tls *libc.TLS, assemEnvPtr uintptr) (r uintptr) { /* Assembly environment */ var bb, envPtr uintptr var v1 int32 _, _, _ = bb, envPtr, v1 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr bb = XTcl_Alloc(tls, uint64(120)) v1 = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) (*TBasicBlock)(unsafe.Pointer(bb)).FstartOffset = v1 (*TBasicBlock)(unsafe.Pointer(bb)).ForiginalStartOffset = v1 (*TBasicBlock)(unsafe.Pointer(bb)).FstartLine = int32((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FcmdLine + int64(1)) (*TBasicBlock)(unsafe.Pointer(bb)).FjumpOffset = -int32(1) (*TBasicBlock)(unsafe.Pointer(bb)).FjumpLine = -int32(1) (*TBasicBlock)(unsafe.Pointer(bb)).FprevPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb (*TBasicBlock)(unsafe.Pointer(bb)).Fpredecessor = libc.UintptrFromInt32(0) (*TBasicBlock)(unsafe.Pointer(bb)).Fsuccessor1 = libc.UintptrFromInt32(0) (*TBasicBlock)(unsafe.Pointer(bb)).FjumpTarget = libc.UintptrFromInt32(0) (*TBasicBlock)(unsafe.Pointer(bb)).FinitialStackDepth = 0 (*TBasicBlock)(unsafe.Pointer(bb)).FminStackDepth = 0 (*TBasicBlock)(unsafe.Pointer(bb)).FmaxStackDepth = 0 (*TBasicBlock)(unsafe.Pointer(bb)).FfinalStackDepth = 0 (*TBasicBlock)(unsafe.Pointer(bb)).FcatchDepth = 0 (*TBasicBlock)(unsafe.Pointer(bb)).FenclosingCatch = libc.UintptrFromInt32(0) (*TBasicBlock)(unsafe.Pointer(bb)).FforeignExceptionBase = -int32(1) (*TBasicBlock)(unsafe.Pointer(bb)).FforeignExceptionCount = 0 (*TBasicBlock)(unsafe.Pointer(bb)).FforeignExceptions = libc.UintptrFromInt32(0) (*TBasicBlock)(unsafe.Pointer(bb)).FjtPtr = libc.UintptrFromInt32(0) (*TBasicBlock)(unsafe.Pointer(bb)).Fflags = 0 return bb } /* *----------------------------------------------------------------------------- * * FinishAssembly -- * * Postprocessing after all bytecode has been generated for a block of * assembly code. * * Results: * Returns a standard Tcl result, with an error message left in the * interpreter if appropriate. * * Side effects: * The program is checked to see if any undefined labels remain. The * initial stack depth of all the basic blocks in the flow graph is * calculated and saved. The stack balance on exit is computed, checked * and saved. * *----------------------------------------------------------------------------- */ func _FinishAssembly(tls *libc.TLS, assemEnvPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Assembly environment */ var _ /* mustMove at bp+0 */ int32 /* Amount by which the code needs to be grown * because of expanding jumps */ /* * Resolve the targets of all jumps and determine whether code needs to be * moved around. */ if _CalculateJumpRelocations(tls, assemEnvPtr, bp) != 0 { return int32(TCL_ERROR) } /* * Move the code if necessary. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { _MoveCodeForJumps(tls, assemEnvPtr, *(*int32)(unsafe.Pointer(bp))) } /* * Resolve jump target labels to bytecode offsets. */ _FillInJumpOffsets(tls, assemEnvPtr) /* * Label each basic block with its catch context. Quit on inconsistency. */ if _ProcessCatches(tls, assemEnvPtr) != TCL_OK { return int32(TCL_ERROR) } /* * Make sure that no block accessible from a catch's error exit that hasn't * popped the exception stack can throw an exception. */ if _CheckForThrowInWrongContext(tls, assemEnvPtr) != TCL_OK { return int32(TCL_ERROR) } /* * Compute stack balance throughout the program. */ if _CheckStack(tls, assemEnvPtr) != TCL_OK { return int32(TCL_ERROR) } /* * TODO - Check for unreachable code. Or maybe not; unreachable code is * Mostly Harmless. */ return TCL_OK } /* *----------------------------------------------------------------------------- * * CalculateJumpRelocations -- * * Calculate any movement that has to be done in the assembly code to * expand JUMP1 instructions to JUMP4 (because they jump more than a * 1-byte range). * * Results: * Returns a standard Tcl result, with an appropriate error message if * anything fails. * * Side effects: * Sets the 'startOffset' pointer in every basic block to the new origin * of the block, and turns off JUMP1 flags on instructions that must be * expanded (and adjusts them to the corresponding JUMP4's). Does *not* * store the jump offsets at this point. * * Sets *mustMove to 1 if and only if at least one instruction changed * size so the code must be moved. * * As a side effect, also checks for undefined labels and reports them. * *----------------------------------------------------------------------------- */ func _CalculateJumpRelocations(tls *libc.TLS, assemEnvPtr uintptr, mustMove uintptr) (r int32) { /* OUTPUT: Number of bytes that have been * added to the code */ var bbPtr, entry, envPtr, jumpTarget, v2 uintptr var motion, offset int32 var opcode uint32 _, _, _, _, _, _, _, _ = bbPtr, entry, envPtr, jumpTarget, motion, offset, opcode, v2 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Opcode in the bytecode being adjusted */ /* * Iterate through basic blocks as long as a change results in code * expansion. */ *(*int32)(unsafe.Pointer(mustMove)) = 0 for cond := true; cond; cond = motion != 0 { motion = 0 bbPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb for { if !(bbPtr != libc.UintptrFromInt32(0)) { break } /* * Advance the basic block start offset by however many bytes we * have inserted in the code up to this point */ *(*int32)(unsafe.Pointer(bbPtr + 4)) += motion /* * If the basic block references a label (and hence performs a * jump), find the location of the label. Report an error if the * label is missing. */ if (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget, libc.UintptrFromInt32(0)) } entry = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16)).FfindProc})))(tls, assemEnvPtr+16, v2) if entry == libc.UintptrFromInt32(0) { _ReportUndefinedLabel(tls, assemEnvPtr, bbPtr, (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget) return int32(TCL_ERROR) } /* * If the instruction is a JUMP1, turn it into a JUMP4 if its * target is out of range. */ jumpTarget = (*TTcl_HashEntry)(unsafe.Pointer(entry)).FclientData if (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fflags&int32(BB_JUMP1) != 0 { offset = (*TBasicBlock)(unsafe.Pointer(jumpTarget)).FstartOffset - ((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset + motion) if offset < -int32(0x80) || offset > int32(0x7F) { opcode = uint32(*(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset)))) opcode++ *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset))) = uint8(opcode) motion += int32(3) *(*int32)(unsafe.Pointer(bbPtr + 112)) &= ^int32(BB_JUMP1) } } } /* * If the basic block references a jump table, that doesn't affect * the code locations, but resolve the labels now, and store basic * block pointers in the jumptable hash. */ if (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fflags&int32(BB_JUMPTABLE) != 0 { if _CheckJumpTableLabels(tls, assemEnvPtr, bbPtr) != TCL_OK { return int32(TCL_ERROR) } } goto _1 _1: ; bbPtr = (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 } *(*int32)(unsafe.Pointer(mustMove)) += motion } return TCL_OK } /* *----------------------------------------------------------------------------- * * CheckJumpTableLabels -- * * Make sure that all the labels in a jump table are defined. * * Results: * Returns TCL_OK if they are, TCL_ERROR if they aren't. * *----------------------------------------------------------------------------- */ func _CheckJumpTableLabels(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Basic block that ends in a jump table */ var symEntryPtr, symHash, symbolObj, valEntryPtr, v2 uintptr var _ /* search at bp+0 */ TTcl_HashSearch _, _, _, _, _ = symEntryPtr, symHash, symbolObj, valEntryPtr, v2 symHash = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjtPtr /* Hash entry for the resolutions */ /* * Look up every jump target in the jump hash. */ symEntryPtr = XTcl_FirstHashEntry(tls, symHash, bp) for { if !(symEntryPtr != libc.UintptrFromInt32(0)) { break } symbolObj = (*TTcl_HashEntry)(unsafe.Pointer(symEntryPtr)).FclientData if (*TTcl_Obj)(unsafe.Pointer(symbolObj)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(symbolObj)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, symbolObj, libc.UintptrFromInt32(0)) } valEntryPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16)).FfindProc})))(tls, assemEnvPtr+16, v2) if valEntryPtr == libc.UintptrFromInt32(0) { _ReportUndefinedLabel(tls, assemEnvPtr, bbPtr, symbolObj) return int32(TCL_ERROR) } goto _1 _1: ; symEntryPtr = XTcl_NextHashEntry(tls, bp) } return TCL_OK } /* *----------------------------------------------------------------------------- * * ReportUndefinedLabel -- * * Report that a basic block refers to an undefined jump label * * Side effects: * Stores an error message, error code, and line number information in * the assembler's Tcl interpreter. * *----------------------------------------------------------------------------- */ func _ReportUndefinedLabel(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr, jumpTarget uintptr) { bp := tls.Alloc(48) defer tls.Free(48) /* Label of a jump target */ var envPtr, interp, v1, v2 uintptr _, _, _, _ = envPtr, interp, v1, v2 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { if (*TTcl_Obj)(unsafe.Pointer(jumpTarget)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(jumpTarget)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, jumpTarget, libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+4322, libc.VaList(bp+8, v1))) if (*TTcl_Obj)(unsafe.Pointer(jumpTarget)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(jumpTarget)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, jumpTarget, libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4343, v2, libc.UintptrFromInt32(0))) XTcl_SetErrorLine(tls, interp, (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpLine) } } /* *----------------------------------------------------------------------------- * * MoveCodeForJumps -- * * Move bytecodes in memory to accommodate JUMP1 instructions that have * expanded to become JUMP4's. * *----------------------------------------------------------------------------- */ func _MoveCodeForJumps(tls *libc.TLS, assemEnvPtr uintptr, mustMove int32) { /* Number of bytes of added code */ var bbPtr, envPtr uintptr var topOffset int32 _, _, _ = bbPtr, envPtr, topOffset envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Bytecode offset of the following basic * block before code motion */ /* * Make sure that there is enough space in the bytecode array to * accommodate the expanded code. */ for (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd < (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(mustMove) { XTclExpandCodeArray(tls, envPtr) } /* * Iterate through the bytecodes in reverse order, and move them upward to * their new homes. */ topOffset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) bbPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb for { if !(bbPtr != libc.UintptrFromInt32(0)) { break } libc.Xmemmove(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart+uintptr((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset), (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart+uintptr((*TBasicBlock)(unsafe.Pointer(bbPtr)).ForiginalStartOffset), libc.Uint64FromInt32(topOffset-(*TBasicBlock)(unsafe.Pointer(bbPtr)).ForiginalStartOffset)) topOffset = (*TBasicBlock)(unsafe.Pointer(bbPtr)).ForiginalStartOffset *(*int32)(unsafe.Pointer(bbPtr + 12)) += (*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset - (*TBasicBlock)(unsafe.Pointer(bbPtr)).ForiginalStartOffset goto _1 _1: ; bbPtr = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FprevPtr } *(*uintptr)(unsafe.Pointer(envPtr + 152)) += uintptr(mustMove) } /* *----------------------------------------------------------------------------- * * FillInJumpOffsets -- * * Fill in the final offsets of all jump instructions once bytecode * locations have been completely determined. * *----------------------------------------------------------------------------- */ func _FillInJumpOffsets(tls *libc.TLS, assemEnvPtr uintptr) { /* Assembly environment */ var bbPtr, entry, envPtr, jumpTarget, v2 uintptr var fromOffset, targetOffset int32 _, _, _, _, _, _, _ = bbPtr, entry, envPtr, fromOffset, jumpTarget, targetOffset, v2 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Bytecode location of a jump instruction's * target */ bbPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb for { if !(bbPtr != libc.UintptrFromInt32(0)) { break } if (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget, libc.UintptrFromInt32(0)) } entry = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16)).FfindProc})))(tls, assemEnvPtr+16, v2) jumpTarget = (*TTcl_HashEntry)(unsafe.Pointer(entry)).FclientData fromOffset = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset targetOffset = (*TBasicBlock)(unsafe.Pointer(jumpTarget)).FstartOffset if (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fflags&int32(BB_JUMP1) != 0 { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(targetOffset - fromOffset)) } else { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(targetOffset-fromOffset) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(targetOffset-fromOffset) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(targetOffset-fromOffset) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(fromOffset) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(targetOffset - fromOffset)) } } if (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fflags&int32(BB_JUMPTABLE) != 0 { _ResolveJumpTableTargets(tls, assemEnvPtr, bbPtr) } goto _1 _1: ; bbPtr = (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 } } /* *----------------------------------------------------------------------------- * * ResolveJumpTableTargets -- * * Puts bytecode addresses for the targets of a jumptable into the * table * * Results: * Returns TCL_OK if they are, TCL_ERROR if they aren't. * *----------------------------------------------------------------------------- */ func _ResolveJumpTableTargets(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* Basic block that ends in a jump table */ var auxDataIndex int32 var envPtr, jumpTargetBBPtr, realJumpEntryPtr, realJumpHashPtr, realJumpTablePtr, symEntryPtr, symHash, symbolObj, valEntryPtr, v2, v3 uintptr var _ /* junk at bp+24 */ int32 var _ /* search at bp+0 */ TTcl_HashSearch _, _, _, _, _, _, _, _, _, _, _, _ = auxDataIndex, envPtr, jumpTargetBBPtr, realJumpEntryPtr, realJumpHashPtr, realJumpTablePtr, symEntryPtr, symHash, symbolObj, valEntryPtr, v2, v3 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ symHash = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjtPtr auxDataIndex = libc.Int32FromUint32(uint32(*(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpOffset) + libc.UintptrFromInt32(1))))<= min { mid = (min + max) / int32(2) c = _NonThrowingByteCodes[mid] if libc.Int32FromUint8(opcode) < libc.Int32FromUint8(c) { max = mid - int32(1) } else { if libc.Int32FromUint8(opcode) > libc.Int32FromUint8(c) { min = mid + int32(1) } else { /* * Opcode is nonthrowing. */ return 0 } } } return int32(1) } /* *----------------------------------------------------------------------------- * * CheckStack -- * * Audit stack usage in a block of assembly code. * * Results: * Returns a standard Tcl result. * * Side effects: * Updates stack depth on entry for all basic blocks in the flowgraph. * Calculates the max stack depth used in the program, and updates the * compilation environment to reflect it. * *----------------------------------------------------------------------------- */ func _CheckStack(tls *libc.TLS, assemEnvPtr uintptr) (r int32) { /* Assembly environment */ var envPtr uintptr var maxDepth TTcl_Size _, _ = envPtr, maxDepth envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Maximum stack depth overall */ /* * Checking the head block will check all the other blocks recursively. */ (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FmaxDepth = 0 if _StackCheckBasicBlock(tls, assemEnvPtr, (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb, libc.UintptrFromInt32(0), 0) == int32(TCL_ERROR) { return int32(TCL_ERROR) } /* * Post the max stack depth back to the compilation environment. */ maxDepth = int64((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FmaxDepth) + (*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth if maxDepth > (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth { (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = maxDepth } /* * If the exit is reachable, make sure that the program exits with 1 * operand on the stack. */ if _StackCheckExit(tls, assemEnvPtr) != TCL_OK { return int32(TCL_ERROR) } /* * Reset the visited state on all basic blocks. */ _ResetVisitedBasicBlocks(tls, assemEnvPtr) return TCL_OK } /* *----------------------------------------------------------------------------- * * StackCheckBasicBlock -- * * Checks stack consumption for a basic block (and recursively for its * successors). * * Results: * Returns a standard Tcl result. * * Side effects: * Updates initial stack depth for the basic block and its successors. * (Final and maximum stack depth are relative to initial, and are not * touched). * * This procedure eventually checks, for the entire flow graph, whether stack * balance is consistent. It is an error for a given basic block to be * reachable along multiple flow paths with different stack depths. * *----------------------------------------------------------------------------- */ func _StackCheckBasicBlock(tls *libc.TLS, assemEnvPtr uintptr, blockPtr uintptr, predecessor uintptr, initialStackDepth int32) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Stack depth on entry to the block */ var entry, envPtr, interp, jtEntry, jumpTarget, targetLabel, v1, v3 uintptr var maxDepth, result, stackDepth int32 var _ /* jtSearch at bp+0 */ TTcl_HashSearch _, _, _, _, _, _, _, _, _, _, _ = entry, envPtr, interp, jtEntry, jumpTarget, maxDepth, result, stackDepth, targetLabel, v1, v3 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Hash entry in the label table */ if (*TBasicBlock)(unsafe.Pointer(blockPtr)).Fflags&int32(BB_VISITED) != 0 { /* * If the block is already visited, check stack depth for consistency * among the paths that reach it. */ if (*TBasicBlock)(unsafe.Pointer(blockPtr)).FinitialStackDepth == initialStackDepth { return TCL_OK } if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+4461, int64(-int32(1)))) /* * TODO - add execution trace of both paths */ XTcl_SetErrorLine(tls, interp, (*TBasicBlock)(unsafe.Pointer(blockPtr)).FstartLine) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4510, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } /* * If the block is not already visited, set the 'predecessor' link to * indicate how control got to it. Set the initial stack depth to the * current stack depth in the flow of control. */ *(*int32)(unsafe.Pointer(blockPtr + 112)) |= int32(BB_VISITED) (*TBasicBlock)(unsafe.Pointer(blockPtr)).Fpredecessor = predecessor (*TBasicBlock)(unsafe.Pointer(blockPtr)).FinitialStackDepth = initialStackDepth /* * Calculate minimum stack depth, and flag an error if the block * underflows the stack. */ if initialStackDepth+(*TBasicBlock)(unsafe.Pointer(blockPtr)).FminStackDepth < 0 { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+4519, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4510, libc.UintptrFromInt32(0))) _AddBasicBlockRangeToErrorInfo(tls, assemEnvPtr, blockPtr) XTcl_SetErrorLine(tls, interp, (*TBasicBlock)(unsafe.Pointer(blockPtr)).FstartLine) } return int32(TCL_ERROR) } /* * Make sure that the block doesn't try to pop below the stack level of an * enclosing catch. */ if (*TBasicBlock)(unsafe.Pointer(blockPtr)).FenclosingCatch != uintptr(0) && initialStackDepth+(*TBasicBlock)(unsafe.Pointer(blockPtr)).FminStackDepth < (*TBasicBlock1)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(blockPtr)).FenclosingCatch)).FinitialStackDepth+(*TBasicBlock1)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(blockPtr)).FenclosingCatch)).FfinalStackDepth { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+4535, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4582, libc.UintptrFromInt32(0))) _AddBasicBlockRangeToErrorInfo(tls, assemEnvPtr, blockPtr) XTcl_SetErrorLine(tls, interp, (*TBasicBlock)(unsafe.Pointer(blockPtr)).FstartLine) } return int32(TCL_ERROR) } /* * Update maximum stgack depth. */ maxDepth = initialStackDepth + (*TBasicBlock)(unsafe.Pointer(blockPtr)).FmaxStackDepth if maxDepth > (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FmaxDepth { (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FmaxDepth = maxDepth } /* * Calculate stack depth on exit from the block, and invoke this procedure * recursively to check successor blocks. */ stackDepth = initialStackDepth + (*TBasicBlock)(unsafe.Pointer(blockPtr)).FfinalStackDepth result = TCL_OK if (*TBasicBlock)(unsafe.Pointer(blockPtr)).Fflags&int32(BB_FALLTHRU) != 0 { result = _StackCheckBasicBlock(tls, assemEnvPtr, (*TBasicBlock)(unsafe.Pointer(blockPtr)).Fsuccessor1, blockPtr, stackDepth) } if result == TCL_OK && (*TBasicBlock)(unsafe.Pointer(blockPtr)).FjumpTarget != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(blockPtr)).FjumpTarget)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(blockPtr)).FjumpTarget)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, (*TBasicBlock)(unsafe.Pointer(blockPtr)).FjumpTarget, libc.UintptrFromInt32(0)) } entry = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16)).FfindProc})))(tls, assemEnvPtr+16, v1) jumpTarget = (*TTcl_HashEntry)(unsafe.Pointer(entry)).FclientData result = _StackCheckBasicBlock(tls, assemEnvPtr, jumpTarget, blockPtr, stackDepth) } /* * All blocks referenced in a jump table are successors. */ if (*TBasicBlock)(unsafe.Pointer(blockPtr)).Fflags&int32(BB_JUMPTABLE) != 0 { jtEntry = XTcl_FirstHashEntry(tls, (*TBasicBlock)(unsafe.Pointer(blockPtr)).FjtPtr, bp) for { if !(result == TCL_OK && jtEntry != libc.UintptrFromInt32(0)) { break } targetLabel = (*TTcl_HashEntry)(unsafe.Pointer(jtEntry)).FclientData if (*TTcl_Obj)(unsafe.Pointer(targetLabel)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(targetLabel)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, targetLabel, libc.UintptrFromInt32(0)) } entry = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16)).FfindProc})))(tls, assemEnvPtr+16, v3) jumpTarget = (*TTcl_HashEntry)(unsafe.Pointer(entry)).FclientData result = _StackCheckBasicBlock(tls, assemEnvPtr, jumpTarget, blockPtr, stackDepth) goto _2 _2: ; jtEntry = XTcl_NextHashEntry(tls, bp) } } return result } /* *----------------------------------------------------------------------------- * * StackCheckExit -- * * Makes sure that the net stack effect of an entire assembly language * script is to push 1 result. * * Results: * Returns a standard Tcl result, with an error message in the * interpreter result if the stack is wrong. * * Side effects: * If the assembly code had a net stack effect of zero, emits code to the * concluding block to push a null result. In any case, updates the stack * depth in the compile environment to reflect the net effect of the * assembly code. * *----------------------------------------------------------------------------- */ func _StackCheckExit(tls *libc.TLS, assemEnvPtr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Assembly environment */ var curr_bb, envPtr, interp uintptr var depth, litIndex int32 _, _, _, _, _ = curr_bb, depth, envPtr, interp, litIndex envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Index in the literal pool of the empty * string */ curr_bb = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb /* Final basic block in the assembly */ /* * Don't perform these checks if execution doesn't reach the exit (either * because of an infinite loop or because the only return is from the * middle. */ if (*TBasicBlock)(unsafe.Pointer(curr_bb)).Fflags&int32(BB_VISITED) != 0 { /* * Exit with no operands; push an empty one. */ depth = (*TBasicBlock)(unsafe.Pointer(curr_bb)).FfinalStackDepth + (*TBasicBlock)(unsafe.Pointer(curr_bb)).FinitialStackDepth if depth == 0 { /* * Emit a 'push' of the empty literal. */ litIndex = XTclRegisterLiteral(tls, envPtr, __ccgo_ts+1945, 0, 0) /* * Assumes that 'push' is at slot 0 in TalInstructionTable. */ _BBEmitInst1or4(tls, assemEnvPtr, 0, litIndex, 0) depth++ } /* * Exit with unbalanced stack. */ if depth != int32(1) { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+4598, libc.VaList(bp+8, depth))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4510, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } /* * Record stack usage. */ *(*TTcl_Size)(unsafe.Pointer(envPtr + 64)) += int64(depth) } return TCL_OK } /* *----------------------------------------------------------------------------- * * ProcessCatches -- * * First pass of 'catch' processing. * * Results: * Returns a standard Tcl result, with an appropriate error message if * the result is TCL_ERROR. * * Side effects: * Labels all basic blocks with their enclosing catches. * *----------------------------------------------------------------------------- */ func _ProcessCatches(tls *libc.TLS, assemEnvPtr uintptr) (r int32) { /* Assembly environment */ var blockPtr uintptr _ = blockPtr /* Pointer to a basic block */ /* * Clear the catch state of all basic blocks. */ blockPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb for { if !(blockPtr != libc.UintptrFromInt32(0)) { break } (*TBasicBlock)(unsafe.Pointer(blockPtr)).FcatchState = int32(BBCS_UNKNOWN) (*TBasicBlock)(unsafe.Pointer(blockPtr)).FenclosingCatch = libc.UintptrFromInt32(0) goto _1 _1: ; blockPtr = (*TBasicBlock)(unsafe.Pointer(blockPtr)).Fsuccessor1 } /* * Start the check recursively from the first basic block, which is * outside any exception context */ if _ProcessCatchesInBasicBlock(tls, assemEnvPtr, (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb, libc.UintptrFromInt32(0), int32(BBCS_NONE), 0) != TCL_OK { return int32(TCL_ERROR) } /* * Check for unclosed catch on exit. */ if _CheckForUnclosedCatches(tls, assemEnvPtr) != TCL_OK { return int32(TCL_ERROR) } /* * Now there's enough information to build the exception ranges. */ if _BuildExceptionRanges(tls, assemEnvPtr) != TCL_OK { return int32(TCL_ERROR) } /* * Finally, restore any exception ranges from embedded scripts. */ _RestoreEmbeddedExceptionRanges(tls, assemEnvPtr) return TCL_OK } /* *----------------------------------------------------------------------------- * * ProcessCatchesInBasicBlock -- * * First-pass catch processing for one basic block. * * Results: * Returns a standard Tcl result, with error message in the interpreter * result if an error occurs. * * This procedure checks consistency of the exception context through the * assembler program, and records the enclosing 'catch' for every basic block. * *----------------------------------------------------------------------------- */ func _ProcessCatchesInBasicBlock(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr, enclosing uintptr, state BasicBlockCatchState, catchDepth int32) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Depth of nesting of catches */ var changed, result int32 var entry, envPtr, fallThruEnclosing, interp, jtEntry, jumpEnclosing, jumpTarget, targetLabel, v1, v3 uintptr var fallThruState, jumpState BasicBlockCatchState var _ /* jtSearch at bp+0 */ TTcl_HashSearch _, _, _, _, _, _, _, _, _, _, _, _, _, _ = changed, entry, envPtr, fallThruEnclosing, fallThruState, interp, jtEntry, jumpEnclosing, jumpState, jumpTarget, result, targetLabel, v1, v3 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Catch state of the jump target */ changed = 0 /* Entry from the label table */ /* * Update the state of the current block, checking for consistency. Set * 'changed' to 1 if the state changes and successor blocks need to be * rechecked. */ if (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchState == int32(BBCS_UNKNOWN) { (*TBasicBlock)(unsafe.Pointer(bbPtr)).FenclosingCatch = enclosing } else { if (*TBasicBlock)(unsafe.Pointer(bbPtr)).FenclosingCatch != enclosing { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+4651, int64(-int32(1)))) XTcl_SetErrorLine(tls, interp, (*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartLine) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4719, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } } if state > (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchState { (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchState = state changed = int32(1) } /* * If this block has been visited before, and its state hasn't changed, * we're done with it for now. */ if !(changed != 0) { return TCL_OK } (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth = catchDepth /* * Determine enclosing catch and 'caught' state for the fallthrough and * the jump target. Default for both is the state of the current block. */ fallThruEnclosing = enclosing fallThruState = state jumpEnclosing = enclosing jumpState = state /* * TODO: Make sure that the test cases include validating that a natural * loop can't include 'beginCatch' or 'endCatch' */ if (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fflags&int32(BB_BEGINCATCH) != 0 { /* * If the block begins a catch, the state for the successor is 'in * catch'. The jump target is the exception exit, and the state of the * jump target is 'caught.' */ fallThruEnclosing = bbPtr fallThruState = int32(BBCS_INCATCH) jumpEnclosing = bbPtr jumpState = int32(BBCS_CAUGHT) catchDepth++ } if (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fflags&int32(BB_ENDCATCH) != 0 { /* * If the block ends a catch, the state for the successor is whatever * the state was on entry to the catch. */ if enclosing == libc.UintptrFromInt32(0) { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+4728, int64(-int32(1)))) XTcl_SetErrorLine(tls, interp, (*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartLine) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4772, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } fallThruEnclosing = (*TBasicBlock)(unsafe.Pointer(enclosing)).FenclosingCatch fallThruState = (*TBasicBlock)(unsafe.Pointer(enclosing)).FcatchState catchDepth-- } /* * Visit any successor blocks with the appropriate exception context */ result = TCL_OK if (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fflags&int32(BB_FALLTHRU) != 0 { result = _ProcessCatchesInBasicBlock(tls, assemEnvPtr, (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1, fallThruEnclosing, fallThruState, catchDepth) } if result == TCL_OK && (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjumpTarget, libc.UintptrFromInt32(0)) } entry = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16)).FfindProc})))(tls, assemEnvPtr+16, v1) jumpTarget = (*TTcl_HashEntry)(unsafe.Pointer(entry)).FclientData result = _ProcessCatchesInBasicBlock(tls, assemEnvPtr, jumpTarget, jumpEnclosing, jumpState, catchDepth) } /* * All blocks referenced in a jump table are successors. */ if (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fflags&int32(BB_JUMPTABLE) != 0 { jtEntry = XTcl_FirstHashEntry(tls, (*TBasicBlock)(unsafe.Pointer(bbPtr)).FjtPtr, bp) for { if !(result == TCL_OK && jtEntry != libc.UintptrFromInt32(0)) { break } targetLabel = (*TTcl_HashEntry)(unsafe.Pointer(jtEntry)).FclientData if (*TTcl_Obj)(unsafe.Pointer(targetLabel)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(targetLabel)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, targetLabel, libc.UintptrFromInt32(0)) } entry = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16)).FfindProc})))(tls, assemEnvPtr+16, v3) jumpTarget = (*TTcl_HashEntry)(unsafe.Pointer(entry)).FclientData result = _ProcessCatchesInBasicBlock(tls, assemEnvPtr, jumpTarget, jumpEnclosing, jumpState, catchDepth) goto _2 _2: ; jtEntry = XTcl_NextHashEntry(tls, bp) } } return result } /* *----------------------------------------------------------------------------- * * CheckForUnclosedCatches -- * * Checks that a sequence of assembly code has no unclosed catches on * exit. * * Results: * Returns a standard Tcl result, with an error message for unclosed * catches. * *----------------------------------------------------------------------------- */ func _CheckForUnclosedCatches(tls *libc.TLS, assemEnvPtr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Assembly environment */ var envPtr, interp uintptr _, _ = envPtr, interp envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Tcl interpreter */ if (*TBasicBlock)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FcatchState >= int32(BBCS_INCATCH) { if (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fflags&int32(TCL_EVAL_DIRECT) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+4784, int64(-int32(1)))) XTcl_SetErrorLine(tls, interp, (*TBasicBlock1)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer((*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fcurr_bb)).FenclosingCatch)).FstartLine) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+3663, __ccgo_ts+4830, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } return TCL_OK } /* *----------------------------------------------------------------------------- * * BuildExceptionRanges -- * * Walks through the assembly code and builds exception ranges for the * catches embedded therein. * * Results: * Returns a standard Tcl result with an error message in the interpreter * if anything is unsuccessful. * * Side effects: * Each contiguous block of code with a given catch exit is assigned an * exception range at the appropriate level. * Exception ranges in embedded blocks have their levels corrected and * collated into the table. * Blocks that end with 'beginCatch' are associated with the innermost * exception range of the following block. * *----------------------------------------------------------------------------- */ func _BuildExceptionRanges(tls *libc.TLS, assemEnvPtr uintptr) (r int32) { /* Assembly environment */ var bbPtr, catchIndices, catches, envPtr, prevPtr uintptr var catchDepth, i, maxCatchDepth int32 _, _, _, _, _, _, _, _ = bbPtr, catchDepth, catchIndices, catches, envPtr, i, maxCatchDepth, prevPtr envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Current basic block */ prevPtr = libc.UintptrFromInt32(0) /* Previous basic block */ catchDepth = 0 /* Current catch depth */ maxCatchDepth = 0 /* * Determine the max catch depth for the entire assembly script * (excluding embedded eval's and expr's, which will be handled later). */ bbPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb for { if !(bbPtr != libc.UintptrFromInt32(0)) { break } if (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth > maxCatchDepth { maxCatchDepth = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth } goto _1 _1: ; bbPtr = (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 } /* * Allocate memory for a stack of active catches. */ catches = XTcl_Alloc(tls, libc.Uint64FromInt32(maxCatchDepth)*uint64(8)) catchIndices = XTcl_Alloc(tls, libc.Uint64FromInt32(maxCatchDepth)*uint64(4)) i = 0 for { if !(i < maxCatchDepth) { break } *(*uintptr)(unsafe.Pointer(catches + uintptr(i)*8)) = libc.UintptrFromInt32(0) *(*int32)(unsafe.Pointer(catchIndices + uintptr(i)*4)) = -int32(1) goto _2 _2: ; i++ } /* * Walk through the basic blocks and manage exception ranges. */ bbPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb for { if !(bbPtr != libc.UintptrFromInt32(0)) { break } _UnstackExpiredCatches(tls, envPtr, bbPtr, catchDepth, catches, catchIndices) _LookForFreshCatches(tls, bbPtr, catches) _StackFreshCatches(tls, assemEnvPtr, bbPtr, catchDepth, catches, catchIndices) /* * If the last block was a 'begin catch', fill in the exception range. */ catchDepth = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth if prevPtr != libc.UintptrFromInt32(0) && (*TBasicBlock)(unsafe.Pointer(prevPtr)).Fflags&int32(BB_BEGINCATCH) != 0 { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - libc.UintptrFromInt32(4))) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth-int32(1))*4))) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - libc.UintptrFromInt32(4) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth-int32(1))*4))) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - libc.UintptrFromInt32(4) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth-int32(1))*4))) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - libc.UintptrFromInt32(4) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth-int32(1))*4)))) } prevPtr = bbPtr goto _3 _3: ; bbPtr = (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 } /* Make sure that all catches are closed */ if catchDepth != 0 { XTcl_Panic(tls, __ccgo_ts+4844, 0) } /* Free temp storage */ XTclpFree(tls, catchIndices) XTclpFree(tls, catches) return TCL_OK } /* *----------------------------------------------------------------------------- * * UnstackExpiredCatches -- * * Unstacks and closes the exception ranges for any catch contexts that * were active in the previous basic block but are inactive in the * current one. * *----------------------------------------------------------------------------- */ func _UnstackExpiredCatches(tls *libc.TLS, envPtr uintptr, bbPtr uintptr, catchDepth int32, catches uintptr, catchIndices uintptr) { /* Indices of the exception ranges * corresponding to the catch contexts */ var block, range1 uintptr var catchState TBasicBlockCatchState _, _, _ = block, catchState, range1 /* State of the code relative to the catch * block being examined ("in catch" or * "caught"). */ /* * Unstack any catches that are deeper than the nesting level of the basic * block being entered. */ for catchDepth > (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth { catchDepth-- if *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != libc.UintptrFromInt32(0) { range1 = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)))*56 (*TExceptionRange)(unsafe.Pointer(range1)).FnumCodeBytes = int64((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - (*TExceptionRange)(unsafe.Pointer(range1)).FcodeOffset *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) = libc.UintptrFromInt32(0) *(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)) = -int32(1) } } /* * Unstack any catches that don't match the basic block being entered, * either because they are no longer part of the context, or because the * context has changed from INCATCH to CAUGHT. */ catchState = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchState block = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FenclosingCatch for catchDepth > 0 { catchDepth-- if *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != libc.UintptrFromInt32(0) { if *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != block || catchState >= int32(BBCS_CAUGHT) { range1 = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)))*56 (*TExceptionRange)(unsafe.Pointer(range1)).FnumCodeBytes = int64((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) - (*TExceptionRange)(unsafe.Pointer(range1)).FcodeOffset *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) = libc.UintptrFromInt32(0) *(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)) = -int32(1) } catchState = (*TBasicBlock)(unsafe.Pointer(block)).FcatchState block = (*TBasicBlock)(unsafe.Pointer(block)).FenclosingCatch } } } /* *----------------------------------------------------------------------------- * * LookForFreshCatches -- * * Determines whether a basic block being entered needs any exception * ranges that are not already stacked. * * Does not create the ranges: this procedure iterates from the innermost * catch outward, but exception ranges must be created from the outermost * catch inward. * *----------------------------------------------------------------------------- */ func _LookForFreshCatches(tls *libc.TLS, bbPtr uintptr, catches uintptr) { /* Array of catch contexts that are already * entered */ var block uintptr var catchDepth int32 var catchState TBasicBlockCatchState _, _, _ = block, catchDepth, catchState /* Nesting depth of the current catch */ catchState = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchState block = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FenclosingCatch catchDepth = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth for catchDepth > 0 { catchDepth-- if *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != block && catchState < int32(BBCS_CAUGHT) { *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) = block } catchState = (*TBasicBlock)(unsafe.Pointer(block)).FcatchState block = (*TBasicBlock)(unsafe.Pointer(block)).FenclosingCatch } } /* *----------------------------------------------------------------------------- * * StackFreshCatches -- * * Make ExceptionRange records for any catches that are in the basic * block being entered and were not in the previous basic block. * *----------------------------------------------------------------------------- */ func _StackFreshCatches(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr, catchDepth int32, catches uintptr, catchIndices uintptr) { /* Indices of the exception ranges * corresponding to the catch contexts */ var block, entryPtr, envPtr, errorExit, range1, v3 uintptr var v2 int64 _, _, _, _, _, _, _ = block, entryPtr, envPtr, errorExit, range1, v2, v3 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr catchDepth = 0 /* * Iterate through the enclosing catch blocks from the outside in, * looking for ones that don't have exception ranges (and are uncaught) */ catchDepth = 0 for { if !(catchDepth < (*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth) { break } if *(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)) == -int32(1) && *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) != libc.UintptrFromInt32(0) { /* * Create an exception range for a block that needs one. */ block = *(*uintptr)(unsafe.Pointer(catches + uintptr(catchDepth)*8)) *(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)) = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr)) range1 = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(*(*int32)(unsafe.Pointer(catchIndices + uintptr(catchDepth)*4)))*56 (*TExceptionRange)(unsafe.Pointer(range1)).FnestingLevel = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth + int64(catchDepth) if libc.Uint64FromInt64((*TExceptionRange)(unsafe.Pointer(range1)).FnestingLevel)+uint64(1)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth)+uint64(1) { v2 = (*TExceptionRange)(unsafe.Pointer(range1)).FnestingLevel + int64(1) } else { v2 = (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = v2 (*TExceptionRange)(unsafe.Pointer(range1)).FcodeOffset = int64((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset) if (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(block)).FjumpTarget)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(block)).FjumpTarget)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, (*TBasicBlock)(unsafe.Pointer(block)).FjumpTarget, libc.UintptrFromInt32(0)) } entryPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(assemEnvPtr + 16)).FfindProc})))(tls, assemEnvPtr+16, v3) if entryPtr == libc.UintptrFromInt32(0) { XTcl_Panic(tls, __ccgo_ts+4926, 0) } errorExit = (*TTcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData (*TExceptionRange)(unsafe.Pointer(range1)).FcatchOffset = int64((*TBasicBlock)(unsafe.Pointer(errorExit)).FstartOffset) } goto _1 _1: ; catchDepth++ } } /* *----------------------------------------------------------------------------- * * RestoreEmbeddedExceptionRanges -- * * Processes an assembly script, replacing any exception ranges that * were present in embedded code. * *----------------------------------------------------------------------------- */ func _RestoreEmbeddedExceptionRanges(tls *libc.TLS, assemEnvPtr uintptr) { /* Assembly environment */ var bbPtr, envPtr, range1 uintptr var catchIndex, i, rangeBase int32 var opcode uint8 var rangeIndex Tsize_t _, _, _, _, _, _, _, _ = bbPtr, catchIndex, envPtr, i, opcode, range1, rangeBase, rangeIndex envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* * Walk the basic blocks looking for exceptions in embedded scripts. */ bbPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb for { if !(bbPtr != libc.UintptrFromInt32(0)) { break } if (*TBasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionCount != 0 { /* * Reinstall the embedded exceptions and track their nesting level */ rangeBase = int32((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) i = 0 for { if !(i < (*TBasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionCount) { break } range1 = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptions + uintptr(i)*56 rangeIndex = libc.Uint64FromInt64(XTclCreateExceptRange(tls, (*TExceptionRange)(unsafe.Pointer(range1)).Ftype1, envPtr)) *(*TTcl_Size)(unsafe.Pointer(range1 + 8)) += (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth + int64((*TBasicBlock)(unsafe.Pointer(bbPtr)).FcatchDepth) libc.Xmemcpy(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr+uintptr(rangeIndex)*56, range1, uint64(56)) if (*TExceptionRange)(unsafe.Pointer(range1)).FnestingLevel+int64(1) >= (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth+int64(1) { (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = (*TExceptionRange)(unsafe.Pointer(range1)).FnestingLevel + int64(1) } goto _2 _2: ; i++ } /* * Walk through the bytecode of the basic block, and relocate * INST_BEGIN_CATCH4 instructions to the new locations */ i = (*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartOffset for i < (*TBasicBlock1)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1)).FstartOffset { opcode = *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i))) if libc.Int32FromUint8(opcode) == int32(INST_BEGIN_CATCH4) { catchIndex = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + libc.UintptrFromInt32(1))))<= (*TBasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionBase && catchIndex < (*TBasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionBase+(*TBasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionCount { catchIndex -= (*TBasicBlock)(unsafe.Pointer(bbPtr)).FforeignExceptionBase catchIndex += rangeBase *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(catchIndex) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(catchIndex) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(catchIndex) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(i) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(catchIndex)) } } i = int32(int64(i) + XtclInstructionTable[opcode].FnumBytes) } } goto _1 _1: ; bbPtr = (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 } } /* *----------------------------------------------------------------------------- * * ResetVisitedBasicBlocks -- * * Turns off the 'visited' flag in all basic blocks at the conclusion * of a pass. * *----------------------------------------------------------------------------- */ func _ResetVisitedBasicBlocks(tls *libc.TLS, assemEnvPtr uintptr) { /* Assembly environment */ var block uintptr _ = block block = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).Fhead_bb for { if !(block != libc.UintptrFromInt32(0)) { break } *(*int32)(unsafe.Pointer(block + 112)) &= ^int32(BB_VISITED) goto _1 _1: ; block = (*TBasicBlock)(unsafe.Pointer(block)).Fsuccessor1 } } /* *----------------------------------------------------------------------------- * * AddBasicBlockRangeToErrorInfo -- * * Updates the error info of the Tcl interpreter to show a given basic * block in the code. * * This procedure is used to label the callstack with source location * information when reporting an error in stack checking. * *----------------------------------------------------------------------------- */ func _AddBasicBlockRangeToErrorInfo(tls *libc.TLS, assemEnvPtr uintptr, bbPtr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* Basic block in which the error is found */ var _isobjPtr, _objPtr, cachePtr, envPtr, interp, lineNo, v3 uintptr var v1 bool var v2 TTcl_Size var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _, _, _, _, _, _, _ = _isobjPtr, _objPtr, cachePtr, envPtr, interp, lineNo, v1, v2, v3 envPtr = (*TAssemblyEnv)(unsafe.Pointer(assemEnvPtr)).FenvPtr /* Compilation environment */ interp = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr /* Line number in the source */ XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+4994, int64(-int32(1)))) if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { lineNo = XTclThreadAllocObj(tls) } else { lineNo = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(lineNo + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(lineNo)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(lineNo)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(lineNo)).FinternalRep)) = int64((*TBasicBlock)(unsafe.Pointer(bbPtr)).FstartLine) (*TTcl_Obj)(unsafe.Pointer(lineNo)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) (*TTcl_Obj)(unsafe.Pointer(lineNo)).FrefCount++ XTcl_AppendObjToErrorInfo(tls, interp, lineNo) XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+5031, int64(-int32(1)))) if (*TBasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1 != libc.UintptrFromInt32(0) { *(*TTcl_WideInt)(unsafe.Pointer(&*(*TTcl_ObjInternalRep)(unsafe.Pointer(bp)))) = int64((*TBasicBlock1)(unsafe.Pointer((*TBasicBlock)(unsafe.Pointer(bbPtr)).Fsuccessor1)).FstartLine) _isobjPtr = lineNo if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } XTcl_StoreInternalRep(tls, lineNo, uintptr(unsafe.Pointer(&XtclIntType)), bp) XTcl_AppendObjToErrorInfo(tls, interp, lineNo) } else { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+5037, int64(-int32(1)))) } _objPtr = lineNo v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } } /* *----------------------------------------------------------------------------- * * DupAssembleCodeInternalRep -- * * Part of the Tcl object type implementation for Tcl assembly language * bytecode. We do not copy the bytecode internalrep. Instead, we return * without setting copyPtr->typePtr, so the copy is a plain string copy * of the assembly source, and if it is to be used as a compiled * expression, it will need to be reprocessed. * * This makes sense, because with Tcl's copy-on-write practices, the * usual (only?) time Tcl_DuplicateObj() will be called is when the copy * is about to be modified, which would invalidate any copied bytecode * anyway. The only reason it might make sense to copy the bytecode is if * we had some modifying routines that operated directly on the internalrep, * as we do for lists and dicts. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ func _DupAssembleCodeInternalRep(tls *libc.TLS, dummy4311 uintptr, dummy4312 uintptr) { return } /* *----------------------------------------------------------------------------- * * FreeAssembleCodeInternalRep -- * * Part of the Tcl object type implementation for Tcl expression * bytecode. Frees the storage allocated to hold the internal rep, unless * ref counts indicate bytecode execution is still in progress. * * Results: * None. * * Side effects: * May free allocated memory. Leaves objPtr untyped. * *----------------------------------------------------------------------------- */ func _FreeAssembleCodeInternalRep(tls *libc.TLS, objPtr uintptr) { var codePtr, irPtr, v1, v2 uintptr _, _, _, _ = codePtr, irPtr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_assembleCodeType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } codePtr = v2 XTclReleaseByteCode(tls, codePtr) } type TBasicBlock1 = struct { ForiginalStartOffset int32 FstartOffset int32 FstartLine int32 FjumpOffset int32 FjumpLine int32 FprevPtr uintptr Fpredecessor uintptr Fsuccessor1 uintptr FjumpTarget uintptr FinitialStackDepth int32 FminStackDepth int32 FmaxStackDepth int32 FfinalStackDepth int32 FcatchState BasicBlockCatchState FcatchDepth int32 FenclosingCatch uintptr FforeignExceptionBase int32 FforeignExceptionCount int32 FforeignExceptions uintptr FjtPtr uintptr Fflags int32 } /* Epoch of the tcl environment * (if changed with tcl-env). */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* Forward declaration */ type TThreadSpecificData1 = struct { FasyncReady int32 FasyncActive int32 } /* * One of the following structures exists for each asynchronous handler: */ type TAsyncHandler = struct { Fready int32 FnextPtr uintptr FprevPtr uintptr Fproc uintptr FclientData uintptr ForiginTsd uintptr ForiginThrdId TTcl_ThreadId FnotifierData uintptr } type TThreadSpecificData = struct { FasyncReady int32 FasyncActive int32 } var _dataKey TTcl_ThreadDataKey // C documentation // // /* Mutex to protect linked-list of AsyncHandlers in the process. */ var _asyncMutex TTcl_Mutex // C documentation // // /* List of all existing handlers of the process. */ var _firstHandler = libc.UintptrFromInt32(0) var _lastHandler = libc.UintptrFromInt32(0) /* *---------------------------------------------------------------------- * * TclFinalizeAsync -- * * Finalizes the thread local data structure for the async * subsystem. * * Results: * None. * * Side effects: * Cleans up left-over async handlers for the calling thread. * *---------------------------------------------------------------------- */ func XTclFinalizeAsync(tls *libc.TLS) { var nextToken, toDelete, token uintptr var self TTcl_ThreadId _, _, _, _ = nextToken, self, toDelete, token toDelete = libc.UintptrFromInt32(0) self = XTcl_GetCurrentThread(tls) XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) token = _firstHandler for { if !(token != libc.UintptrFromInt32(0)) { break } nextToken = (*TAsyncHandler)(unsafe.Pointer(token)).FnextPtr if (*TAsyncHandler)(unsafe.Pointer(token)).ForiginThrdId == self { if (*TAsyncHandler)(unsafe.Pointer(token)).FprevPtr == libc.UintptrFromInt32(0) { _firstHandler = (*TAsyncHandler)(unsafe.Pointer(token)).FnextPtr if _firstHandler == libc.UintptrFromInt32(0) { _lastHandler = libc.UintptrFromInt32(0) break } } else { (*TAsyncHandler1)(unsafe.Pointer((*TAsyncHandler)(unsafe.Pointer(token)).FprevPtr)).FnextPtr = (*TAsyncHandler)(unsafe.Pointer(token)).FnextPtr if token == _lastHandler { _lastHandler = (*TAsyncHandler)(unsafe.Pointer(token)).FprevPtr } } if (*TAsyncHandler)(unsafe.Pointer(token)).FnextPtr != libc.UintptrFromInt32(0) { (*TAsyncHandler1)(unsafe.Pointer((*TAsyncHandler)(unsafe.Pointer(token)).FnextPtr)).FprevPtr = (*TAsyncHandler)(unsafe.Pointer(token)).FprevPtr } (*TAsyncHandler)(unsafe.Pointer(token)).FnextPtr = toDelete (*TAsyncHandler)(unsafe.Pointer(token)).FprevPtr = libc.UintptrFromInt32(0) toDelete = token } token = nextToken goto _1 _1: } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) for toDelete != libc.UintptrFromInt32(0) { token = toDelete toDelete = (*TAsyncHandler)(unsafe.Pointer(toDelete)).FnextPtr XTclpFree(tls, token) } } /* *---------------------------------------------------------------------- * * Tcl_AsyncCreate -- * * This procedure creates the data structures for an asynchronous * handler, so that no memory has to be allocated when the handler is * activated. * * Results: * The return value is a token for the handler, which can be used to * activate it later on. * * Side effects: * Information about the handler is recorded. * *---------------------------------------------------------------------- */ func XTcl_AsyncCreate(tls *libc.TLS, proc uintptr, clientData uintptr) (r TTcl_AsyncHandler) { /* Argument to pass to handler. */ var asyncPtr, tsdPtr uintptr _, _ = asyncPtr, tsdPtr tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&_dataKey)), int64(8)) asyncPtr = XTcl_Alloc(tls, uint64(64)) (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).Fready = 0 (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr = libc.UintptrFromInt32(0) (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FprevPtr = libc.UintptrFromInt32(0) (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).Fproc = proc (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FclientData = clientData (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).ForiginTsd = tsdPtr (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).ForiginThrdId = XTcl_GetCurrentThread(tls) (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FnotifierData = XTclpNotifierData(tls) XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) if _firstHandler == libc.UintptrFromInt32(0) { _firstHandler = asyncPtr } else { (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FprevPtr = _lastHandler (*TAsyncHandler)(unsafe.Pointer(_lastHandler)).FnextPtr = asyncPtr } _lastHandler = asyncPtr XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) return asyncPtr } /* *---------------------------------------------------------------------- * * Tcl_AsyncMark -- * * This procedure is called to request that an asynchronous handler be * invoked as soon as possible. It's typically called from an interrupt * handler, where it isn't safe to do anything that depends on or * modifies application state. * * Results: * None. * * Side effects: * The handler gets marked for invocation later. * *---------------------------------------------------------------------- */ func XTcl_AsyncMark(tls *libc.TLS, async TTcl_AsyncHandler) { /* Token for handler. */ var token uintptr _ = token token = async XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) (*TAsyncHandler)(unsafe.Pointer(token)).Fready = int32(1) if !((*TThreadSpecificData1)(unsafe.Pointer((*TAsyncHandler)(unsafe.Pointer(token)).ForiginTsd)).FasyncActive != 0) { (*TThreadSpecificData1)(unsafe.Pointer((*TAsyncHandler)(unsafe.Pointer(token)).ForiginTsd)).FasyncReady = int32(1) XTcl_ThreadAlert(tls, (*TAsyncHandler)(unsafe.Pointer(token)).ForiginThrdId) } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) } /* *---------------------------------------------------------------------- * * Tcl_AsyncMarkFromSignal -- * * This procedure is similar to Tcl_AsyncMark but must be used * in POSIX signal contexts. In addition to Tcl_AsyncMark the * signal number is passed. * * Results: * True, when the handler will be marked, false otherwise. * * Side effects: * The handler gets marked for invocation later. * *---------------------------------------------------------------------- */ func XTcl_AsyncMarkFromSignal(tls *libc.TLS, async TTcl_AsyncHandler, sigNumber int32) (r int32) { /* Signal number. */ var token uintptr _ = token token = async return XTclAsyncNotifier(tls, sigNumber, (*TAsyncHandler)(unsafe.Pointer(token)).ForiginThrdId, (*TAsyncHandler)(unsafe.Pointer(token)).FnotifierData, token, -int32(1)) } /* *---------------------------------------------------------------------- * * TclAsyncMarkFromNotifier -- * * This procedure is called from the notifier thread and * invokes Tcl_AsyncMark for specifically marked handlers. * * Results: * None. * * Side effects: * Handlers get marked for invocation later. * *---------------------------------------------------------------------- */ func XTclAsyncMarkFromNotifier(tls *libc.TLS) { var token uintptr _ = token XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) token = _firstHandler for { if !(token != libc.UintptrFromInt32(0)) { break } if (*TAsyncHandler)(unsafe.Pointer(token)).Fready == -int32(1) { (*TAsyncHandler)(unsafe.Pointer(token)).Fready = int32(1) if !((*TThreadSpecificData1)(unsafe.Pointer((*TAsyncHandler)(unsafe.Pointer(token)).ForiginTsd)).FasyncActive != 0) { (*TThreadSpecificData1)(unsafe.Pointer((*TAsyncHandler)(unsafe.Pointer(token)).ForiginTsd)).FasyncReady = int32(1) XTcl_ThreadAlert(tls, (*TAsyncHandler)(unsafe.Pointer(token)).ForiginThrdId) } } goto _1 _1: ; token = (*TAsyncHandler)(unsafe.Pointer(token)).FnextPtr } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) } /* *---------------------------------------------------------------------- * * Tcl_AsyncInvoke -- * * This procedure is called at a "safe" time at background level to * invoke any active asynchronous handlers. * * Results: * The return value is a normal Tcl result, which is intended to replace * the code argument as the current completion code for interp. * * Side effects: * Depends on the handlers that are active. * *---------------------------------------------------------------------- */ func XTcl_AsyncInvoke(tls *libc.TLS, interp uintptr, code int32) (r int32) { /* If interp is non-NULL, this gives * completion code from command that just * completed. */ var asyncPtr, tsdPtr uintptr var self TTcl_ThreadId _, _, _ = asyncPtr, self, tsdPtr tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&_dataKey)), int64(8)) self = XTcl_GetCurrentThread(tls) XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) if (*TThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncReady == 0 { XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) return code } (*TThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncReady = 0 (*TThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncActive = int32(1) if interp == libc.UintptrFromInt32(0) { code = 0 } /* * Make one or more passes over the list of handlers, invoking at most one * handler in each pass. After invoking a handler, go back to the start of * the list again so that (a) if a new higher-priority handler gets marked * while executing a lower priority handler, we execute the higher- * priority handler next, and (b) if a handler gets deleted during the * execution of a handler, then the list structure may change so it isn't * safe to continue down the list anyway. */ for int32(1) != 0 { asyncPtr = _firstHandler for { if !(asyncPtr != libc.UintptrFromInt32(0)) { break } if (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).ForiginThrdId != self { goto _1 } if (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).Fready != 0 { break } goto _1 _1: ; asyncPtr = (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr } if asyncPtr == libc.UintptrFromInt32(0) { break } (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).Fready = 0 XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) code = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*TAsyncHandler)(unsafe.Pointer(asyncPtr)).Fproc})))(tls, (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FclientData, interp, code) XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) } (*TThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncActive = 0 XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) return code } /* *---------------------------------------------------------------------- * * Tcl_AsyncDelete -- * * Frees up all the state for an asynchronous handler. The handler should * never be used again. * * Results: * None. * * Side effects: * The state associated with the handler is deleted. * * Failure to locate the handler in current thread private list * of async handlers will result in panic; exception: the list * is already empty (potential trouble?). * Consequently, threads should create and delete handlers * themselves. I.e. a handler created by one should not be * deleted by some other thread. * *---------------------------------------------------------------------- */ func XTcl_AsyncDelete(tls *libc.TLS, async TTcl_AsyncHandler) { /* Token for handler to delete. */ var asyncPtr uintptr _ = asyncPtr asyncPtr = async /* * Assure early handling of the constraint */ if (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).ForiginThrdId != XTcl_GetCurrentThread(tls) { XTcl_Panic(tls, __ccgo_ts+5058, 0) } XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) if (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FprevPtr == libc.UintptrFromInt32(0) { _firstHandler = (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr if _firstHandler == libc.UintptrFromInt32(0) { _lastHandler = libc.UintptrFromInt32(0) } } else { (*TAsyncHandler1)(unsafe.Pointer((*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FprevPtr)).FnextPtr = (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr if asyncPtr == _lastHandler { _lastHandler = (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FprevPtr } } if (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr != libc.UintptrFromInt32(0) { (*TAsyncHandler1)(unsafe.Pointer((*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FnextPtr)).FprevPtr = (*TAsyncHandler)(unsafe.Pointer(asyncPtr)).FprevPtr } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_asyncMutex))) XTclpFree(tls, asyncPtr) } /* *---------------------------------------------------------------------- * * Tcl_AsyncReady -- * * This procedure can be used to tell whether Tcl_AsyncInvoke needs to be * called. This procedure is the external interface for checking the * thread-specific asyncReady variable. * * Results: * The return value is 1 whenever a handler is ready and is 0 when no * handlers are ready. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_AsyncReady(tls *libc.TLS) (r int32) { var tsdPtr uintptr _ = tsdPtr tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&_dataKey)), int64(8)) return (*TThreadSpecificData)(unsafe.Pointer(tsdPtr)).FasyncReady } func XTclGetAsyncReadyPtr(tls *libc.TLS) (r uintptr) { var tsdPtr uintptr _ = tsdPtr tsdPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&_dataKey)), int64(8)) return tsdPtr } type TAsyncHandler1 = struct { Fready int32 FnextPtr uintptr FprevPtr uintptr Fproc uintptr FclientData uintptr ForiginTsd uintptr ForiginThrdId TTcl_ThreadId FnotifierData uintptr } const CMD_IS_SAFE = 1 const COROUTINE_ARGUMENTS_ARBITRARY = -2 const COROUTINE_ARGUMENTS_SINGLE_OPTIONAL = -1 const CORO_ACTIVATE_YIELD = "NULL" const CORO_STACK_INITIAL_SIZE = 200 const DIGIT_BIT = 28 const DTraceCmdReturn = "NULL" const INTERIM_HACK_NAME = "___tmp" const INTERP_STACK_INITIAL_SIZE = 2000 const LTM_PRIME_2MSB_ON = 8 const LTM_PRIME_BBS = 1 const LTM_PRIME_SAFE = 2 const MATH_FUNC_PREFIX_LEN = 17 const MATH_OP_PREFIX_LEN = 15 const MAX_EXACT = 9.007199254740991e+15 const MP_BIG_ENDIAN = 1 const MP_BUF = -5 const MP_DIGIT_BIT = 28 const MP_DIGIT_MAX = "MP_MASK" const MP_EQ = 0 const MP_ERR = -1 const MP_GT = 1 const MP_ITER = -4 const MP_LITTLE_ENDIAN = -1 const MP_LSB_FIRST = -1 const MP_LT = -1 const MP_MEM = -2 const MP_MSB_FIRST = 1 const MP_NATIVE_ENDIAN = 0 const MP_NEG = 1 const MP_NO = 0 const MP_OKAY = 0 const MP_PRIME_2MSB_ON = 8 const MP_PRIME_BBS = 1 const MP_PRIME_SAFE = 2 const MP_RANGE = -3 const MP_SIZEOF_MP_DIGIT = 0 const MP_VAL = -3 const MP_YES = 1 const MP_ZPOS = 0 const PRIME_SIZE = 256 const PRIVATE_MP_PRIME_TAB_SIZE = 256 const RAND_IA = 16807 const RAND_IM = 2147483647 const RAND_IQ = 127773 const RAND_IR = 2836 const RAND_MASK = 123459876 const TCLTOMMATH_EPOCH = 0 const TCLTOMMATH_REVISION = 0 const TCL_FPCLASSIFY_MODE = 0 const bn_reverse = 0 const mp_add = 0 const mp_add_d = 0 const mp_and = 0 const mp_clamp = 0 const mp_clear = 0 const mp_clear_multi = 0 const mp_cmp = 0 const mp_cmp_d = 0 const mp_cmp_mag = 0 const mp_cnt_lsb = 0 const mp_copy = 0 const mp_count_bits = 0 const mp_div = 0 const mp_div_2 = 0 const mp_div_2d = 0 const mp_div_d = 0 const mp_exch = 0 const mp_expt_d = 0 const mp_expt_n = 0 const mp_get_mag_u64 = 0 const mp_grow = 0 const mp_init = 0 const mp_init_copy = 0 const mp_init_i64 = 0 const mp_init_multi = 0 const mp_init_set = 0 const mp_init_size = 0 const mp_init_u64 = 0 const mp_lshd = 0 const mp_mod = 0 const mp_mod_2d = 0 const mp_mul = 0 const mp_mul_2 = 0 const mp_mul_2d = 0 const mp_mul_d = 0 const mp_neg = 0 const mp_or = 0 const mp_pack = 0 const mp_pack_count = 0 const mp_radix_size = 0 const mp_read_radix = 0 const mp_rshd = 0 const mp_s_rmap = 0 const mp_s_rmap_reverse = 0 const mp_s_rmap_reverse_sz = 0 const mp_set_i64 = 0 const mp_set_u64 = 0 const mp_shrink = 0 const mp_signed_rsh = 0 const mp_sqrt = 0 const mp_sub = 0 const mp_sub_d = 0 const mp_tc_and = 0 const mp_tc_div_2d = 0 const mp_tc_or = 0 const mp_tc_xor = 0 const mp_to_radix = 0 const mp_to_ubin = 0 const mp_to_unsigned_bin = 0 const mp_to_unsigned_bin_n = 0 const mp_toradix_n = 0 const mp_ubin_size = 0 const mp_unpack = 0 const mp_word = 0 const mp_xor = 0 const mp_zero = 0 const s_mp_add = 0 const s_mp_balance_mul = 0 const s_mp_div_3 = 0 const s_mp_karatsuba_mul = 0 const s_mp_karatsuba_sqr = 0 const s_mp_mul_digs = 0 const s_mp_mul_digs_fast = 0 const s_mp_reverse = 0 const s_mp_sqr = 0 const s_mp_sqr_fast = 0 const s_mp_sub = 0 const s_mp_toom_mul = 0 const s_mp_toom_sqr = 0 type Tmp_digit = uint32 type Tprivate_mp_word = uint64 type Tmp_sign = int32 type Tmp_ord = int32 type Tmp_bool = int32 type Tmp_err = int32 type Tmp_order = int32 type Tmp_endian = int32 type Tmp_int = struct { Fused int32 Falloc int32 Fsign Tmp_sign Fdp uintptr } type Tmp_int1 = struct { Fused int32 Falloc int32 Fsign Tmp_sign Fdp uintptr } type TTclTomMathStubs = struct { Fmagic int32 Fhooks uintptr FtclBN_epoch uintptr FtclBN_revision uintptr FtclBN_mp_add uintptr FtclBN_mp_add_d uintptr FtclBN_mp_and uintptr FtclBN_mp_clamp uintptr FtclBN_mp_clear uintptr FtclBN_mp_clear_multi uintptr FtclBN_mp_cmp uintptr FtclBN_mp_cmp_d uintptr FtclBN_mp_cmp_mag uintptr FtclBN_mp_copy uintptr FtclBN_mp_count_bits uintptr FtclBN_mp_div uintptr FtclBN_mp_div_d uintptr FtclBN_mp_div_2 uintptr FtclBN_mp_div_2d uintptr Freserved17 uintptr FtclBN_mp_exch uintptr FtclBN_mp_expt_n uintptr FtclBN_mp_grow uintptr FtclBN_mp_init uintptr FtclBN_mp_init_copy uintptr FtclBN_mp_init_multi uintptr FtclBN_mp_init_set uintptr FtclBN_mp_init_size uintptr FtclBN_mp_lshd uintptr FtclBN_mp_mod uintptr FtclBN_mp_mod_2d uintptr FtclBN_mp_mul uintptr FtclBN_mp_mul_d uintptr FtclBN_mp_mul_2 uintptr FtclBN_mp_mul_2d uintptr FtclBN_mp_neg uintptr FtclBN_mp_or uintptr FtclBN_mp_radix_size uintptr FtclBN_mp_read_radix uintptr FtclBN_mp_rshd uintptr FtclBN_mp_shrink uintptr Freserved39 uintptr Freserved40 uintptr FtclBN_mp_sqrt uintptr FtclBN_mp_sub uintptr FtclBN_mp_sub_d uintptr Freserved44 uintptr Freserved45 uintptr Freserved46 uintptr FtclBN_mp_ubin_size uintptr FtclBN_mp_xor uintptr FtclBN_mp_zero uintptr Freserved50 uintptr Freserved51 uintptr Freserved52 uintptr Freserved53 uintptr Freserved54 uintptr Freserved55 uintptr Freserved56 uintptr Freserved57 uintptr Freserved58 uintptr Freserved59 uintptr Freserved60 uintptr Freserved61 uintptr Freserved62 uintptr FtclBN_mp_cnt_lsb uintptr Freserved64 uintptr FtclBN_mp_init_i64 uintptr FtclBN_mp_init_u64 uintptr Freserved67 uintptr FtclBN_mp_set_u64 uintptr FtclBN_mp_get_mag_u64 uintptr FtclBN_mp_set_i64 uintptr FtclBN_mp_unpack uintptr FtclBN_mp_pack uintptr Freserved73 uintptr Freserved74 uintptr Freserved75 uintptr FtclBN_mp_signed_rsh uintptr FtclBN_mp_pack_count uintptr FtclBN_mp_to_ubin uintptr Freserved79 uintptr FtclBN_mp_to_radix uintptr } /* * Determine whether we're using IEEE floating point */ /* Largest odd integer that can be represented exactly in a double */ /* * This is the script cancellation struct and hash table. The hash table is * used to keep track of the information necessary to process script * cancellation requests, including the original interp, asynchronous handler * tokens (created by Tcl_AsyncCreate), and the clientData and flags arguments * passed to Tcl_CancelEval on a per-interp basis. The cancelLock mutex is * used for protecting calls to Tcl_CancelEval as well as protecting access to * the hash table below. */ type TCancelInfo = struct { Finterp uintptr Fasync TTcl_AsyncHandler Fresult uintptr Flength TTcl_Size FclientData uintptr Fflags int32 } var _cancelTable TTcl_HashTable var _cancelTableInitialized = int32(0) /* 0 means not yet initialized. */ var _cancelLock TTcl_Mutex /* * Table used to map command implementation functions to a human-readable type * name, for [info type]. The keys in the table are function addresses, and * the values in the table are static char* containing strings in Tcl's * internal encoding (almost UTF-8). */ var _commandTypeTable TTcl_HashTable var _commandTypeInit = int32(0) var _commandTypeLock TTcl_Mutex /* * Magical counts for the number of arguments accepted by a coroutine command * after particular kinds of [yield]. */ /* * The following structure define the commands in the Tcl core. */ type TCmdInfo = struct { Fname uintptr FobjProc uintptr FcompileProc uintptr FnreProc uintptr Fflags int32 } /* CMD_COMPILES_EXPANDED - Whether the compiler for this command can handle * expansion for itself rather than needing the generic layer to take care of * it for it. Defined in tclInt.h. */ /* * The following struct states that the command it talks about (a subcommand * of one of Tcl's built-in ensembles) is unsafe and must be hidden when an * interpreter is made safe. (TclHideUnsafeCommands accesses an array of these * structs.) Alas, we can't sensibly just store the information directly in * the commands. */ type TUnsafeEnsembleInfo = struct { FensembleNsName uintptr FcommandName uintptr } /* * The built-in commands, and the functions that implement them: */ func _procObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { return XTcl_ProcObjCmd(tls, clientData, interp, int64(objc), objv) } var _builtInCmds = [90]TCmdInfo{ 0: { Fname: __ccgo_ts + 2125, Fflags: int32(CMD_IS_SAFE), }, 1: { Fname: __ccgo_ts + 5117, Fflags: int32(CMD_IS_SAFE), }, 2: { Fname: __ccgo_ts + 5123, Fflags: int32(CMD_IS_SAFE), }, 3: { Fname: __ccgo_ts + 5129, Fflags: int32(CMD_IS_SAFE), }, 4: { Fname: __ccgo_ts + 2273, Fflags: int32(CMD_IS_SAFE), }, 5: { Fname: __ccgo_ts + 5135, Fflags: int32(CMD_IS_SAFE), }, 6: { Fname: __ccgo_ts + 5141, Fflags: int32(CMD_IS_SAFE), }, 7: { Fname: __ccgo_ts + 5150, Fflags: int32(CMD_IS_SAFE), }, 8: { Fname: __ccgo_ts + 5161, Fflags: int32(CMD_IS_SAFE), }, 9: { Fname: __ccgo_ts + 5171, Fflags: int32(CMD_IS_SAFE), }, 10: { Fname: __ccgo_ts + 5181, Fflags: int32(CMD_IS_SAFE), }, 11: { Fname: __ccgo_ts + 2464, Fflags: int32(CMD_IS_SAFE), }, 12: { Fname: __ccgo_ts + 2523, Fflags: int32(CMD_IS_SAFE), }, 13: { Fname: __ccgo_ts + 5187, Fflags: int32(CMD_IS_SAFE), }, 14: { Fname: __ccgo_ts + 5191, Fflags: int32(CMD_IS_SAFE), }, 15: { Fname: __ccgo_ts + 5199, Fflags: int32(CMD_IS_SAFE), }, 16: { Fname: __ccgo_ts + 5206, Fflags: int32(CMD_IS_SAFE), }, 17: { Fname: __ccgo_ts + 5217, Fflags: int32(CMD_IS_SAFE), }, 18: { Fname: __ccgo_ts + 5224, Fflags: int32(CMD_IS_SAFE), }, 19: { Fname: __ccgo_ts + 2542, Fflags: int32(CMD_IS_SAFE), }, 20: { Fname: __ccgo_ts + 5227, Fflags: int32(CMD_IS_SAFE), }, 21: { Fname: __ccgo_ts + 2733, Fflags: int32(CMD_IS_SAFE), }, 22: { Fname: __ccgo_ts + 5232, Fflags: int32(CMD_IS_SAFE), }, 23: { Fname: __ccgo_ts + 5240, Fflags: int32(CMD_IS_SAFE), }, 24: { Fname: __ccgo_ts + 5246, Fflags: int32(CMD_IS_SAFE), }, 25: { Fname: __ccgo_ts + 5253, Fflags: int32(CMD_IS_SAFE), }, 26: { Fname: __ccgo_ts + 2860, Fflags: libc.Int32FromInt32(CMD_IS_SAFE) | libc.Int32FromInt32(CMD_COMPILES_EXPANDED), }, 27: { Fname: __ccgo_ts + 5261, Fflags: int32(CMD_IS_SAFE), }, 28: { Fname: __ccgo_ts + 5269, Fflags: int32(CMD_IS_SAFE), }, 29: { Fname: __ccgo_ts + 5274, Fflags: int32(CMD_IS_SAFE), }, 30: { Fname: __ccgo_ts + 5279, Fflags: int32(CMD_IS_SAFE), }, 31: { Fname: __ccgo_ts + 5286, Fflags: int32(CMD_IS_SAFE), }, 32: { Fname: __ccgo_ts + 5294, Fflags: int32(CMD_IS_SAFE), }, 33: { Fname: __ccgo_ts + 5302, Fflags: int32(CMD_IS_SAFE), }, 34: { Fname: __ccgo_ts + 5311, Fflags: int32(CMD_IS_SAFE), }, 35: { Fname: __ccgo_ts + 5320, Fflags: int32(CMD_IS_SAFE), }, 36: { Fname: __ccgo_ts + 5328, Fflags: int32(CMD_IS_SAFE), }, 37: { Fname: __ccgo_ts + 5333, Fflags: int32(CMD_IS_SAFE), }, 38: { Fname: __ccgo_ts + 5338, Fflags: int32(CMD_IS_SAFE), }, 39: { Fname: __ccgo_ts + 5344, Fflags: int32(CMD_IS_SAFE), }, 40: { Fname: __ccgo_ts + 5352, Fflags: int32(CMD_IS_SAFE), }, 41: { Fname: __ccgo_ts + 3092, Fflags: int32(CMD_IS_SAFE), }, 42: { Fname: __ccgo_ts + 5357, Fflags: int32(CMD_IS_SAFE), }, 43: { Fname: __ccgo_ts + 5364, Fflags: int32(CMD_IS_SAFE), }, 44: { Fname: __ccgo_ts + 5371, Fflags: int32(CMD_IS_SAFE), }, 45: { Fname: __ccgo_ts + 5378, Fflags: int32(CMD_IS_SAFE), }, 46: { Fname: __ccgo_ts + 5383, Fflags: int32(CMD_IS_SAFE), }, 47: { Fname: __ccgo_ts + 5387, Fflags: int32(CMD_IS_SAFE), }, 48: { Fname: __ccgo_ts + 5393, Fflags: int32(CMD_IS_SAFE), }, 49: { Fname: __ccgo_ts + 5399, Fflags: int32(CMD_IS_SAFE), }, 50: { Fname: __ccgo_ts + 5406, Fflags: int32(CMD_IS_SAFE), }, 51: { Fname: __ccgo_ts + 5415, Fflags: int32(CMD_IS_SAFE), }, 52: { Fname: __ccgo_ts + 5421, Fflags: int32(CMD_IS_SAFE), }, 53: { Fname: __ccgo_ts + 5427, Fflags: int32(CMD_IS_SAFE), }, 54: { Fname: __ccgo_ts + 3450, Fflags: int32(CMD_IS_SAFE), }, 55: { Fname: __ccgo_ts + 5431, Fflags: int32(CMD_IS_SAFE), }, 56: { Fname: __ccgo_ts + 3496, Fflags: int32(CMD_IS_SAFE), }, 57: { Fname: __ccgo_ts + 3502, Fflags: int32(CMD_IS_SAFE), }, 58: { Fname: __ccgo_ts + 5439, Fflags: int32(CMD_IS_SAFE), }, 59: { Fname: __ccgo_ts + 3522, Fflags: int32(CMD_IS_SAFE), }, 60: { Fname: __ccgo_ts + 5445, Fflags: int32(CMD_IS_SAFE), }, 61: { Fname: __ccgo_ts + 5453, Fflags: int32(CMD_IS_SAFE), }, 62: { Fname: __ccgo_ts + 5459, }, 63: { Fname: __ccgo_ts + 5462, Fflags: int32(CMD_IS_SAFE), }, 64: { Fname: __ccgo_ts + 5468, Fflags: int32(CMD_IS_SAFE), }, 65: { Fname: __ccgo_ts + 5472, }, 66: { Fname: __ccgo_ts + 5477, }, 67: { Fname: __ccgo_ts + 5482, Fflags: int32(CMD_IS_SAFE), }, 68: { Fname: __ccgo_ts + 5491, }, 69: { Fname: __ccgo_ts + 5502, Fflags: int32(CMD_IS_SAFE), }, 70: { Fname: __ccgo_ts + 5508, Fflags: int32(CMD_IS_SAFE), }, 71: { Fname: __ccgo_ts + 5518, Fflags: int32(CMD_IS_SAFE), }, 72: { Fname: __ccgo_ts + 5524, Fflags: int32(CMD_IS_SAFE), }, 73: { Fname: __ccgo_ts + 5529, }, 74: { Fname: __ccgo_ts + 2927, }, 75: { Fname: __ccgo_ts + 5534, }, 76: { Fname: __ccgo_ts + 5539, Fflags: int32(CMD_IS_SAFE), }, 77: { Fname: __ccgo_ts + 5543, Fflags: int32(CMD_IS_SAFE), }, 78: { Fname: __ccgo_ts + 5548, }, 79: { Fname: __ccgo_ts + 5552, Fflags: int32(CMD_IS_SAFE), }, 80: { Fname: __ccgo_ts + 5557, Fflags: int32(CMD_IS_SAFE), }, 81: { Fname: __ccgo_ts + 5562, }, 82: { Fname: __ccgo_ts + 5569, }, 83: { Fname: __ccgo_ts + 5576, Fflags: int32(CMD_IS_SAFE), }, 84: { Fname: __ccgo_ts + 5581, Fflags: int32(CMD_IS_SAFE), }, 85: { Fname: __ccgo_ts + 5586, Fflags: int32(CMD_IS_SAFE), }, 86: { Fname: __ccgo_ts + 5595, }, 87: { Fname: __ccgo_ts + 5602, Fflags: int32(CMD_IS_SAFE), }, 88: { Fname: __ccgo_ts + 5609, Fflags: int32(CMD_IS_SAFE), }, 89: {}, } func init() { p := unsafe.Pointer(&_builtInCmds) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(XTcl_AppendObjCmd) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileAppendCmd) *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(XTcl_ApplyObjCmd) *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(XTclNRApplyObjCmd) *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(XTcl_BreakObjCmd) *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(XTclCompileBreakCmd) *(*uintptr)(unsafe.Add(p, 128)) = __ccgo_fp(XTcl_CatchObjCmd) *(*uintptr)(unsafe.Add(p, 136)) = __ccgo_fp(XTclCompileCatchCmd) *(*uintptr)(unsafe.Add(p, 144)) = __ccgo_fp(XTclNRCatchObjCmd) *(*uintptr)(unsafe.Add(p, 168)) = __ccgo_fp(XTcl_ConcatObjCmd) *(*uintptr)(unsafe.Add(p, 176)) = __ccgo_fp(XTclCompileConcatCmd) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(XTcl_ConstObjCmd) *(*uintptr)(unsafe.Add(p, 216)) = __ccgo_fp(XTclCompileConstCmd) *(*uintptr)(unsafe.Add(p, 248)) = __ccgo_fp(XTcl_ContinueObjCmd) *(*uintptr)(unsafe.Add(p, 256)) = __ccgo_fp(XTclCompileContinueCmd) *(*uintptr)(unsafe.Add(p, 304)) = __ccgo_fp(_TclNRCoroInjectObjCmd) *(*uintptr)(unsafe.Add(p, 344)) = __ccgo_fp(_TclNRCoroProbeObjCmd) *(*uintptr)(unsafe.Add(p, 384)) = __ccgo_fp(XTclNRCoroutineObjCmd) *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(XTcl_ErrorObjCmd) *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(XTclCompileErrorCmd) *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(XTcl_EvalObjCmd) *(*uintptr)(unsafe.Add(p, 464)) = __ccgo_fp(XTclNREvalObjCmd) *(*uintptr)(unsafe.Add(p, 488)) = __ccgo_fp(XTcl_ExprObjCmd) *(*uintptr)(unsafe.Add(p, 496)) = __ccgo_fp(XTclCompileExprCmd) *(*uintptr)(unsafe.Add(p, 504)) = __ccgo_fp(XTclNRExprObjCmd) *(*uintptr)(unsafe.Add(p, 528)) = __ccgo_fp(XTcl_ForObjCmd) *(*uintptr)(unsafe.Add(p, 536)) = __ccgo_fp(XTclCompileForCmd) *(*uintptr)(unsafe.Add(p, 544)) = __ccgo_fp(XTclNRForObjCmd) *(*uintptr)(unsafe.Add(p, 568)) = __ccgo_fp(XTcl_ForeachObjCmd) *(*uintptr)(unsafe.Add(p, 576)) = __ccgo_fp(XTclCompileForeachCmd) *(*uintptr)(unsafe.Add(p, 584)) = __ccgo_fp(XTclNRForeachCmd) *(*uintptr)(unsafe.Add(p, 608)) = __ccgo_fp(XTcl_FormatObjCmd) *(*uintptr)(unsafe.Add(p, 616)) = __ccgo_fp(XTclCompileFormatCmd) *(*uintptr)(unsafe.Add(p, 648)) = __ccgo_fp(_FloatClassifyObjCmd) *(*uintptr)(unsafe.Add(p, 688)) = __ccgo_fp(XTcl_GlobalObjCmd) *(*uintptr)(unsafe.Add(p, 696)) = __ccgo_fp(XTclCompileGlobalCmd) *(*uintptr)(unsafe.Add(p, 728)) = __ccgo_fp(XTcl_IfObjCmd) *(*uintptr)(unsafe.Add(p, 736)) = __ccgo_fp(XTclCompileIfCmd) *(*uintptr)(unsafe.Add(p, 744)) = __ccgo_fp(XTclNRIfObjCmd) *(*uintptr)(unsafe.Add(p, 768)) = __ccgo_fp(XTcl_IncrObjCmd) *(*uintptr)(unsafe.Add(p, 776)) = __ccgo_fp(XTclCompileIncrCmd) *(*uintptr)(unsafe.Add(p, 808)) = __ccgo_fp(XTcl_JoinObjCmd) *(*uintptr)(unsafe.Add(p, 848)) = __ccgo_fp(XTcl_LappendObjCmd) *(*uintptr)(unsafe.Add(p, 856)) = __ccgo_fp(XTclCompileLappendCmd) *(*uintptr)(unsafe.Add(p, 888)) = __ccgo_fp(XTcl_LassignObjCmd) *(*uintptr)(unsafe.Add(p, 896)) = __ccgo_fp(XTclCompileLassignCmd) *(*uintptr)(unsafe.Add(p, 928)) = __ccgo_fp(XTcl_LeditObjCmd) *(*uintptr)(unsafe.Add(p, 968)) = __ccgo_fp(XTcl_LindexObjCmd) *(*uintptr)(unsafe.Add(p, 976)) = __ccgo_fp(XTclCompileLindexCmd) *(*uintptr)(unsafe.Add(p, 1008)) = __ccgo_fp(XTcl_LinsertObjCmd) *(*uintptr)(unsafe.Add(p, 1016)) = __ccgo_fp(XTclCompileLinsertCmd) *(*uintptr)(unsafe.Add(p, 1048)) = __ccgo_fp(XTcl_ListObjCmd) *(*uintptr)(unsafe.Add(p, 1056)) = __ccgo_fp(XTclCompileListCmd) *(*uintptr)(unsafe.Add(p, 1088)) = __ccgo_fp(XTcl_LlengthObjCmd) *(*uintptr)(unsafe.Add(p, 1096)) = __ccgo_fp(XTclCompileLlengthCmd) *(*uintptr)(unsafe.Add(p, 1128)) = __ccgo_fp(XTcl_LmapObjCmd) *(*uintptr)(unsafe.Add(p, 1136)) = __ccgo_fp(XTclCompileLmapCmd) *(*uintptr)(unsafe.Add(p, 1144)) = __ccgo_fp(XTclNRLmapCmd) *(*uintptr)(unsafe.Add(p, 1168)) = __ccgo_fp(XTcl_LpopObjCmd) *(*uintptr)(unsafe.Add(p, 1208)) = __ccgo_fp(XTcl_LrangeObjCmd) *(*uintptr)(unsafe.Add(p, 1216)) = __ccgo_fp(XTclCompileLrangeCmd) *(*uintptr)(unsafe.Add(p, 1248)) = __ccgo_fp(XTcl_LremoveObjCmd) *(*uintptr)(unsafe.Add(p, 1288)) = __ccgo_fp(XTcl_LrepeatObjCmd) *(*uintptr)(unsafe.Add(p, 1328)) = __ccgo_fp(XTcl_LreplaceObjCmd) *(*uintptr)(unsafe.Add(p, 1336)) = __ccgo_fp(XTclCompileLreplaceCmd) *(*uintptr)(unsafe.Add(p, 1368)) = __ccgo_fp(XTcl_LreverseObjCmd) *(*uintptr)(unsafe.Add(p, 1408)) = __ccgo_fp(XTcl_LsearchObjCmd) *(*uintptr)(unsafe.Add(p, 1448)) = __ccgo_fp(XTcl_LseqObjCmd) *(*uintptr)(unsafe.Add(p, 1488)) = __ccgo_fp(XTcl_LsetObjCmd) *(*uintptr)(unsafe.Add(p, 1496)) = __ccgo_fp(XTclCompileLsetCmd) *(*uintptr)(unsafe.Add(p, 1528)) = __ccgo_fp(XTcl_LsortObjCmd) *(*uintptr)(unsafe.Add(p, 1568)) = __ccgo_fp(XTcl_PackageObjCmd) *(*uintptr)(unsafe.Add(p, 1584)) = __ccgo_fp(XTclNRPackageObjCmd) *(*uintptr)(unsafe.Add(p, 1608)) = __ccgo_fp(_procObjCmd) *(*uintptr)(unsafe.Add(p, 1648)) = __ccgo_fp(XTcl_RegexpObjCmd) *(*uintptr)(unsafe.Add(p, 1656)) = __ccgo_fp(XTclCompileRegexpCmd) *(*uintptr)(unsafe.Add(p, 1688)) = __ccgo_fp(XTcl_RegsubObjCmd) *(*uintptr)(unsafe.Add(p, 1696)) = __ccgo_fp(XTclCompileRegsubCmd) *(*uintptr)(unsafe.Add(p, 1728)) = __ccgo_fp(XTcl_RenameObjCmd) *(*uintptr)(unsafe.Add(p, 1768)) = __ccgo_fp(XTcl_ReturnObjCmd) *(*uintptr)(unsafe.Add(p, 1776)) = __ccgo_fp(XTclCompileReturnCmd) *(*uintptr)(unsafe.Add(p, 1808)) = __ccgo_fp(XTcl_ScanObjCmd) *(*uintptr)(unsafe.Add(p, 1848)) = __ccgo_fp(XTcl_SetObjCmd) *(*uintptr)(unsafe.Add(p, 1856)) = __ccgo_fp(XTclCompileSetCmd) *(*uintptr)(unsafe.Add(p, 1888)) = __ccgo_fp(XTcl_SplitObjCmd) *(*uintptr)(unsafe.Add(p, 1928)) = __ccgo_fp(XTcl_SubstObjCmd) *(*uintptr)(unsafe.Add(p, 1936)) = __ccgo_fp(XTclCompileSubstCmd) *(*uintptr)(unsafe.Add(p, 1944)) = __ccgo_fp(XTclNRSubstObjCmd) *(*uintptr)(unsafe.Add(p, 1968)) = __ccgo_fp(XTcl_SwitchObjCmd) *(*uintptr)(unsafe.Add(p, 1976)) = __ccgo_fp(XTclCompileSwitchCmd) *(*uintptr)(unsafe.Add(p, 1984)) = __ccgo_fp(XTclNRSwitchObjCmd) *(*uintptr)(unsafe.Add(p, 2016)) = __ccgo_fp(XTclCompileTailcallCmd) *(*uintptr)(unsafe.Add(p, 2024)) = __ccgo_fp(XTclNRTailcallObjCmd) *(*uintptr)(unsafe.Add(p, 2048)) = __ccgo_fp(XTcl_ThrowObjCmd) *(*uintptr)(unsafe.Add(p, 2056)) = __ccgo_fp(XTclCompileThrowCmd) *(*uintptr)(unsafe.Add(p, 2088)) = __ccgo_fp(XTcl_TraceObjCmd) *(*uintptr)(unsafe.Add(p, 2128)) = __ccgo_fp(XTcl_TryObjCmd) *(*uintptr)(unsafe.Add(p, 2136)) = __ccgo_fp(XTclCompileTryCmd) *(*uintptr)(unsafe.Add(p, 2144)) = __ccgo_fp(XTclNRTryObjCmd) *(*uintptr)(unsafe.Add(p, 2168)) = __ccgo_fp(XTcl_UnsetObjCmd) *(*uintptr)(unsafe.Add(p, 2176)) = __ccgo_fp(XTclCompileUnsetCmd) *(*uintptr)(unsafe.Add(p, 2208)) = __ccgo_fp(XTcl_UplevelObjCmd) *(*uintptr)(unsafe.Add(p, 2224)) = __ccgo_fp(XTclNRUplevelObjCmd) *(*uintptr)(unsafe.Add(p, 2248)) = __ccgo_fp(XTcl_UpvarObjCmd) *(*uintptr)(unsafe.Add(p, 2256)) = __ccgo_fp(XTclCompileUpvarCmd) *(*uintptr)(unsafe.Add(p, 2288)) = __ccgo_fp(XTcl_VariableObjCmd) *(*uintptr)(unsafe.Add(p, 2296)) = __ccgo_fp(XTclCompileVariableCmd) *(*uintptr)(unsafe.Add(p, 2328)) = __ccgo_fp(XTcl_WhileObjCmd) *(*uintptr)(unsafe.Add(p, 2336)) = __ccgo_fp(XTclCompileWhileCmd) *(*uintptr)(unsafe.Add(p, 2344)) = __ccgo_fp(XTclNRWhileObjCmd) *(*uintptr)(unsafe.Add(p, 2376)) = __ccgo_fp(XTclCompileYieldCmd) *(*uintptr)(unsafe.Add(p, 2384)) = __ccgo_fp(XTclNRYieldObjCmd) *(*uintptr)(unsafe.Add(p, 2416)) = __ccgo_fp(XTclCompileYieldToCmd) *(*uintptr)(unsafe.Add(p, 2424)) = __ccgo_fp(XTclNRYieldToObjCmd) *(*uintptr)(unsafe.Add(p, 2448)) = __ccgo_fp(XTcl_AfterObjCmd) *(*uintptr)(unsafe.Add(p, 2488)) = __ccgo_fp(XTcl_CdObjCmd) *(*uintptr)(unsafe.Add(p, 2528)) = __ccgo_fp(XTcl_CloseObjCmd) *(*uintptr)(unsafe.Add(p, 2568)) = __ccgo_fp(XTcl_EofObjCmd) *(*uintptr)(unsafe.Add(p, 2608)) = __ccgo_fp(XTcl_ExecObjCmd) *(*uintptr)(unsafe.Add(p, 2648)) = __ccgo_fp(XTcl_ExitObjCmd) *(*uintptr)(unsafe.Add(p, 2688)) = __ccgo_fp(XTcl_FblockedObjCmd) *(*uintptr)(unsafe.Add(p, 2728)) = __ccgo_fp(XTcl_FconfigureObjCmd) *(*uintptr)(unsafe.Add(p, 2768)) = __ccgo_fp(XTcl_FcopyObjCmd) *(*uintptr)(unsafe.Add(p, 2808)) = __ccgo_fp(XTcl_FileEventObjCmd) *(*uintptr)(unsafe.Add(p, 2848)) = __ccgo_fp(XTcl_FlushObjCmd) *(*uintptr)(unsafe.Add(p, 2888)) = __ccgo_fp(XTcl_GetsObjCmd) *(*uintptr)(unsafe.Add(p, 2928)) = __ccgo_fp(XTcl_GlobObjCmd) *(*uintptr)(unsafe.Add(p, 2968)) = __ccgo_fp(XTcl_LoadObjCmd) *(*uintptr)(unsafe.Add(p, 3008)) = __ccgo_fp(XTcl_OpenObjCmd) *(*uintptr)(unsafe.Add(p, 3048)) = __ccgo_fp(XTcl_PidObjCmd) *(*uintptr)(unsafe.Add(p, 3088)) = __ccgo_fp(XTcl_PutsObjCmd) *(*uintptr)(unsafe.Add(p, 3128)) = __ccgo_fp(XTcl_PwdObjCmd) *(*uintptr)(unsafe.Add(p, 3168)) = __ccgo_fp(XTcl_ReadObjCmd) *(*uintptr)(unsafe.Add(p, 3208)) = __ccgo_fp(XTcl_SeekObjCmd) *(*uintptr)(unsafe.Add(p, 3248)) = __ccgo_fp(XTcl_SocketObjCmd) *(*uintptr)(unsafe.Add(p, 3288)) = __ccgo_fp(XTcl_SourceObjCmd) *(*uintptr)(unsafe.Add(p, 3304)) = __ccgo_fp(XTclNRSourceObjCmd) *(*uintptr)(unsafe.Add(p, 3328)) = __ccgo_fp(XTcl_TellObjCmd) *(*uintptr)(unsafe.Add(p, 3368)) = __ccgo_fp(XTcl_TimeObjCmd) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(XTcl_TimeRateObjCmd) *(*uintptr)(unsafe.Add(p, 3448)) = __ccgo_fp(XTcl_UnloadObjCmd) *(*uintptr)(unsafe.Add(p, 3488)) = __ccgo_fp(XTcl_UpdateObjCmd) *(*uintptr)(unsafe.Add(p, 3528)) = __ccgo_fp(XTcl_VwaitObjCmd) } /* * Information about which pieces of ensembles to hide when making an * interpreter safe: */ var _unsafeEnsembleCommands = [56]TUnsafeEnsembleInfo{ 0: { FensembleNsName: __ccgo_ts + 5615, }, 1: { FensembleNsName: __ccgo_ts + 5615, FcommandName: __ccgo_ts + 5624, }, 2: { FensembleNsName: __ccgo_ts + 5615, FcommandName: __ccgo_ts + 5629, }, 3: { FensembleNsName: __ccgo_ts + 5636, }, 4: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5641, }, 5: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5647, }, 6: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5658, }, 7: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5663, }, 8: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5670, }, 9: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5678, }, 10: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5689, }, 11: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5696, }, 12: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5706, }, 13: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5711, }, 14: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5723, }, 15: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5730, }, 16: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5735, }, 17: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5741, }, 18: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5747, }, 19: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5753, }, 20: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5764, }, 21: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5774, }, 22: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5780, }, 23: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5789, }, 24: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5364, }, 25: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5798, }, 26: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5807, }, 27: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5812, }, 28: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5817, }, 29: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5822, }, 30: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5830, }, 31: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5839, }, 32: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5851, }, 33: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5856, }, 34: { FensembleNsName: __ccgo_ts + 5636, FcommandName: __ccgo_ts + 5864, }, 35: { FensembleNsName: __ccgo_ts + 5873, FcommandName: __ccgo_ts + 5878, }, 36: { FensembleNsName: __ccgo_ts + 5873, FcommandName: __ccgo_ts + 5886, }, 37: { FensembleNsName: __ccgo_ts + 5903, FcommandName: __ccgo_ts + 2860, }, 38: { FensembleNsName: __ccgo_ts + 5903, FcommandName: __ccgo_ts + 5911, }, 39: { FensembleNsName: __ccgo_ts + 5903, FcommandName: __ccgo_ts + 5918, }, 40: { FensembleNsName: __ccgo_ts + 5903, FcommandName: __ccgo_ts + 5924, }, 41: { FensembleNsName: __ccgo_ts + 5934, }, 42: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5940, }, 43: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5689, }, 44: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5873, }, 45: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 2860, }, 46: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5950, }, 47: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5957, }, 48: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5964, }, 49: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5970, }, 50: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5976, }, 51: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5982, }, 52: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5988, }, 53: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 5998, }, 54: { FensembleNsName: __ccgo_ts + 5934, FcommandName: __ccgo_ts + 6003, }, 55: {}, } type TBuiltinFuncDef = struct { Fname uintptr FobjCmdProc uintptr Ffn uintptr } var _BuiltinFuncTable = [38]TBuiltinFuncDef{ 0: { Fname: __ccgo_ts + 6011, }, 1: { Fname: __ccgo_ts + 6015, }, 2: { Fname: __ccgo_ts + 6020, }, 3: { Fname: __ccgo_ts + 6025, }, 4: { Fname: __ccgo_ts + 6030, }, 5: { Fname: __ccgo_ts + 6036, }, 6: { Fname: __ccgo_ts + 6041, }, 7: { Fname: __ccgo_ts + 6046, }, 8: { Fname: __ccgo_ts + 6050, }, 9: { Fname: __ccgo_ts + 6055, }, 10: { Fname: __ccgo_ts + 6062, }, 11: { Fname: __ccgo_ts + 6069, }, 12: { Fname: __ccgo_ts + 6073, }, 13: { Fname: __ccgo_ts + 6079, }, 14: { Fname: __ccgo_ts + 6084, }, 15: { Fname: __ccgo_ts + 6090, }, 16: { Fname: __ccgo_ts + 6094, }, 17: { Fname: __ccgo_ts + 6103, }, 18: { Fname: __ccgo_ts + 6109, }, 19: { Fname: __ccgo_ts + 6115, }, 20: { Fname: __ccgo_ts + 6124, }, 21: { Fname: __ccgo_ts + 6130, }, 22: { Fname: __ccgo_ts + 6142, }, 23: { Fname: __ccgo_ts + 6154, }, 24: { Fname: __ccgo_ts + 6158, }, 25: { Fname: __ccgo_ts + 6164, }, 26: { Fname: __ccgo_ts + 6168, }, 27: { Fname: __ccgo_ts + 6172, }, 28: { Fname: __ccgo_ts + 6176, }, 29: { Fname: __ccgo_ts + 6181, }, 30: { Fname: __ccgo_ts + 6187, }, 31: { Fname: __ccgo_ts + 6191, }, 32: { Fname: __ccgo_ts + 6196, }, 33: { Fname: __ccgo_ts + 6201, }, 34: { Fname: __ccgo_ts + 6207, }, 35: { Fname: __ccgo_ts + 6211, }, 36: { Fname: __ccgo_ts + 6216, }, 37: {}, } func init() { p := unsafe.Pointer(&_BuiltinFuncTable) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_ExprAbsFunc) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(libc.Xasin) *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_ExprBinaryFunc) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(libc.Xatan2) *(*uintptr)(unsafe.Add(p, 128)) = __ccgo_fp(_ExprBoolFunc) *(*uintptr)(unsafe.Add(p, 152)) = __ccgo_fp(_ExprCeilFunc) *(*uintptr)(unsafe.Add(p, 176)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 184)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 200)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 224)) = __ccgo_fp(_ExprDoubleFunc) *(*uintptr)(unsafe.Add(p, 248)) = __ccgo_fp(_ExprIntFunc) *(*uintptr)(unsafe.Add(p, 272)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 280)) = __ccgo_fp(libc.Xexp) *(*uintptr)(unsafe.Add(p, 296)) = __ccgo_fp(_ExprFloorFunc) *(*uintptr)(unsafe.Add(p, 320)) = __ccgo_fp(_ExprBinaryFunc) *(*uintptr)(unsafe.Add(p, 328)) = __ccgo_fp(libc.Xfmod) *(*uintptr)(unsafe.Add(p, 344)) = __ccgo_fp(_ExprBinaryFunc) *(*uintptr)(unsafe.Add(p, 352)) = __ccgo_fp(libc.Xhypot) *(*uintptr)(unsafe.Add(p, 368)) = __ccgo_fp(_ExprIntFunc) *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_ExprIsFiniteFunc) *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(_ExprIsInfinityFunc) *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_ExprIsNaNFunc) *(*uintptr)(unsafe.Add(p, 464)) = __ccgo_fp(_ExprIsNormalFunc) *(*uintptr)(unsafe.Add(p, 488)) = __ccgo_fp(_ExprIsqrtFunc) *(*uintptr)(unsafe.Add(p, 512)) = __ccgo_fp(_ExprIsSubnormalFunc) *(*uintptr)(unsafe.Add(p, 536)) = __ccgo_fp(_ExprIsUnorderedFunc) *(*uintptr)(unsafe.Add(p, 560)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 568)) = __ccgo_fp(libc.Xlog) *(*uintptr)(unsafe.Add(p, 584)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 592)) = __ccgo_fp(libc.Xlog10) *(*uintptr)(unsafe.Add(p, 608)) = __ccgo_fp(_ExprMaxFunc) *(*uintptr)(unsafe.Add(p, 632)) = __ccgo_fp(_ExprMinFunc) *(*uintptr)(unsafe.Add(p, 656)) = __ccgo_fp(_ExprBinaryFunc) *(*uintptr)(unsafe.Add(p, 664)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 680)) = __ccgo_fp(_ExprRandFunc) *(*uintptr)(unsafe.Add(p, 704)) = __ccgo_fp(_ExprRoundFunc) *(*uintptr)(unsafe.Add(p, 728)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 736)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 752)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 760)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 776)) = __ccgo_fp(_ExprSqrtFunc) *(*uintptr)(unsafe.Add(p, 800)) = __ccgo_fp(_ExprSrandFunc) *(*uintptr)(unsafe.Add(p, 824)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 832)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 848)) = __ccgo_fp(_ExprUnaryFunc) *(*uintptr)(unsafe.Add(p, 856)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 872)) = __ccgo_fp(_ExprWideFunc) } /* * TIP#174's math operators. All are safe. */ type TOpCmdInfo = struct { Fname uintptr FobjProc uintptr FcompileProc uintptr Fi struct { Fidentity [0]int32 FnumArgs int32 } Fexpected uintptr } var _mathOpCmds = [28]TOpCmdInfo{ 0: { Fname: __ccgo_ts + 6221, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(1)})), Fexpected: __ccgo_ts + 6223, }, 1: { Fname: __ccgo_ts + 6231, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(1)})), Fexpected: __ccgo_ts + 3611, }, 2: { Fname: __ccgo_ts + 6233, }, 3: { Fname: __ccgo_ts + 6235, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(1)})), }, 4: { Fname: __ccgo_ts + 6237, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: -int32(1)})), }, 5: { Fname: __ccgo_ts + 6239, }, 6: { Fname: __ccgo_ts + 6241, }, 7: { Fname: __ccgo_ts + 6243, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(1)})), }, 8: { Fname: __ccgo_ts + 6246, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(2)})), Fexpected: __ccgo_ts + 6249, }, 9: { Fname: __ccgo_ts + 6263, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(2)})), Fexpected: __ccgo_ts + 6249, }, 10: { Fname: __ccgo_ts + 6266, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(2)})), Fexpected: __ccgo_ts + 6268, }, 11: { Fname: __ccgo_ts + 6284, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(2)})), Fexpected: __ccgo_ts + 6287, }, 12: { Fname: __ccgo_ts + 6299, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(2)})), Fexpected: __ccgo_ts + 6287, }, 13: { Fname: __ccgo_ts + 6302, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(2)})), Fexpected: __ccgo_ts + 6305, }, 14: { Fname: __ccgo_ts + 6316, Fi: *(*struct { Fidentity [0]int32 FnumArgs int32 })(unsafe.Pointer(&struct{ f int32 }{f: int32(2)})), Fexpected: __ccgo_ts + 6305, }, 15: { Fname: __ccgo_ts + 6319, Fexpected: __ccgo_ts + 6321, }, 16: { Fname: __ccgo_ts + 6339, Fexpected: __ccgo_ts + 6321, }, 17: { Fname: __ccgo_ts + 6341, }, 18: { Fname: __ccgo_ts + 6343, }, 19: { Fname: __ccgo_ts + 6346, }, 20: { Fname: __ccgo_ts + 6348, }, 21: { Fname: __ccgo_ts + 6351, }, 22: { Fname: __ccgo_ts + 2461, }, 23: { Fname: __ccgo_ts + 2988, }, 24: { Fname: __ccgo_ts + 2845, }, 25: { Fname: __ccgo_ts + 2539, }, 26: { Fname: __ccgo_ts + 2536, }, 27: {}, } func init() { p := unsafe.Pointer(&_mathOpCmds) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(XTclSingleOpCmd) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileInvertOpCmd) *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(XTclSingleOpCmd) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(XTclCompileNotOpCmd) *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(XTclVariadicOpCmd) *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(XTclCompileAddOpCmd) *(*uintptr)(unsafe.Add(p, 128)) = __ccgo_fp(XTclVariadicOpCmd) *(*uintptr)(unsafe.Add(p, 136)) = __ccgo_fp(XTclCompileMulOpCmd) *(*uintptr)(unsafe.Add(p, 168)) = __ccgo_fp(XTclVariadicOpCmd) *(*uintptr)(unsafe.Add(p, 176)) = __ccgo_fp(XTclCompileAndOpCmd) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(XTclVariadicOpCmd) *(*uintptr)(unsafe.Add(p, 216)) = __ccgo_fp(XTclCompileOrOpCmd) *(*uintptr)(unsafe.Add(p, 248)) = __ccgo_fp(XTclVariadicOpCmd) *(*uintptr)(unsafe.Add(p, 256)) = __ccgo_fp(XTclCompileXorOpCmd) *(*uintptr)(unsafe.Add(p, 288)) = __ccgo_fp(XTclVariadicOpCmd) *(*uintptr)(unsafe.Add(p, 296)) = __ccgo_fp(XTclCompilePowOpCmd) *(*uintptr)(unsafe.Add(p, 328)) = __ccgo_fp(XTclSingleOpCmd) *(*uintptr)(unsafe.Add(p, 336)) = __ccgo_fp(XTclCompileLshiftOpCmd) *(*uintptr)(unsafe.Add(p, 368)) = __ccgo_fp(XTclSingleOpCmd) *(*uintptr)(unsafe.Add(p, 376)) = __ccgo_fp(XTclCompileRshiftOpCmd) *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(XTclSingleOpCmd) *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(XTclCompileModOpCmd) *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(XTclSingleOpCmd) *(*uintptr)(unsafe.Add(p, 456)) = __ccgo_fp(XTclCompileNeqOpCmd) *(*uintptr)(unsafe.Add(p, 488)) = __ccgo_fp(XTclSingleOpCmd) *(*uintptr)(unsafe.Add(p, 496)) = __ccgo_fp(XTclCompileStrneqOpCmd) *(*uintptr)(unsafe.Add(p, 528)) = __ccgo_fp(XTclSingleOpCmd) *(*uintptr)(unsafe.Add(p, 536)) = __ccgo_fp(XTclCompileInOpCmd) *(*uintptr)(unsafe.Add(p, 568)) = __ccgo_fp(XTclSingleOpCmd) *(*uintptr)(unsafe.Add(p, 576)) = __ccgo_fp(XTclCompileNiOpCmd) *(*uintptr)(unsafe.Add(p, 608)) = __ccgo_fp(XTclNoIdentOpCmd) *(*uintptr)(unsafe.Add(p, 616)) = __ccgo_fp(XTclCompileMinusOpCmd) *(*uintptr)(unsafe.Add(p, 648)) = __ccgo_fp(XTclNoIdentOpCmd) *(*uintptr)(unsafe.Add(p, 656)) = __ccgo_fp(XTclCompileDivOpCmd) *(*uintptr)(unsafe.Add(p, 688)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 696)) = __ccgo_fp(XTclCompileLessOpCmd) *(*uintptr)(unsafe.Add(p, 728)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 736)) = __ccgo_fp(XTclCompileLeqOpCmd) *(*uintptr)(unsafe.Add(p, 768)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 776)) = __ccgo_fp(XTclCompileGreaterOpCmd) *(*uintptr)(unsafe.Add(p, 808)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 816)) = __ccgo_fp(XTclCompileGeqOpCmd) *(*uintptr)(unsafe.Add(p, 848)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 856)) = __ccgo_fp(XTclCompileEqOpCmd) *(*uintptr)(unsafe.Add(p, 888)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 896)) = __ccgo_fp(XTclCompileStreqOpCmd) *(*uintptr)(unsafe.Add(p, 928)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 936)) = __ccgo_fp(XTclCompileStrLtOpCmd) *(*uintptr)(unsafe.Add(p, 968)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 976)) = __ccgo_fp(XTclCompileStrLeOpCmd) *(*uintptr)(unsafe.Add(p, 1008)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 1016)) = __ccgo_fp(XTclCompileStrGtOpCmd) *(*uintptr)(unsafe.Add(p, 1048)) = __ccgo_fp(XTclSortingOpCmd) *(*uintptr)(unsafe.Add(p, 1056)) = __ccgo_fp(XTclCompileStrGeOpCmd) } /* *---------------------------------------------------------------------- * * TclFinalizeEvaluation -- * * Finalizes the script cancellation hash table. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclFinalizeEvaluation(tls *libc.TLS) { XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_cancelLock))) if _cancelTableInitialized == int32(1) { XTcl_DeleteHashTable(tls, uintptr(unsafe.Pointer(&_cancelTable))) _cancelTableInitialized = 0 } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_cancelLock))) XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_commandTypeLock))) if _commandTypeInit != 0 { XTcl_DeleteHashTable(tls, uintptr(unsafe.Pointer(&_commandTypeTable))) _commandTypeInit = 0 } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_commandTypeLock))) } /* *---------------------------------------------------------------------- * * buildInfoObjCmd -- * * Implements tcl::build-info command. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _buildInfoObjCmd2(tls *libc.TLS, clientData uintptr, interp uintptr, objc TTcl_Size, objv uintptr) (r1 int32) { bp := tls.Alloc(96) defer tls.Free(96) /* Argument objects. */ var arg, buildData, p, q, r, v10, v11, v12, v13, v17, v18, v19, v21, v22, v7, v8, v9 uintptr var _ /* buf at bp+0 */ [80]uint8 var _ /* idx at bp+88 */ int32 var _ /* len at bp+80 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = arg, buildData, p, q, r, v10, v11, v12, v13, v17, v18, v19, v21, v22, v7, v8, v9 buildData = clientData if objc > int64(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+6389) return int32(TCL_ERROR) } else { if objc < int64(2) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, buildData, int64(-libc.Int32FromInt32(1)))) return TCL_OK } } /* * Query for a specific piece of build info */ if XTcl_GetIndexFromObjStruct(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&_identifiers)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), libc.UintptrFromInt32(0), libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<......" */ XTcl_PkgProvideEx(tls, interp, __ccgo_ts+7146, __ccgo_ts+7219, uintptr(unsafe.Pointer(&XtclStubs))) XTcl_PkgProvideEx(tls, interp, __ccgo_ts+7241, __ccgo_ts+7219, uintptr(unsafe.Pointer(&XtclStubs))) buildInfoCmd = XTcl_CreateObjCommand(tls, interp, __ccgo_ts+7245, __ccgo_fp(_buildInfoObjCmd), version, libc.UintptrFromInt32(0)) XTcl_GetCommandInfoFromToken(tls, buildInfoCmd, bp+40) (*(*TTcl_CmdInfo)(unsafe.Pointer(bp + 40))).FobjProc2 = __ccgo_fp(_buildInfoObjCmd2) (*(*TTcl_CmdInfo)(unsafe.Pointer(bp + 40))).FobjClientData2 = version XTcl_SetCommandInfoFromToken(tls, buildInfoCmd, bp+40) if XTclTommath_Init(tls, interp) != TCL_OK { XTcl_Panic(tls, __ccgo_ts+7263, libc.VaList(bp+128, XTcl_GetStringFromObj(tls, XTcl_GetObjResult(tls, interp), libc.UintptrFromInt32(0)))) } if XTclOOInit(tls, interp) != TCL_OK { XTcl_Panic(tls, __ccgo_ts+7263, libc.VaList(bp+128, XTcl_GetStringFromObj(tls, XTcl_GetObjResult(tls, interp), libc.UintptrFromInt32(0)))) } if XTclZlibInit(tls, interp) != TCL_OK || XTclZipfs_Init(tls, interp) != TCL_OK { XTcl_Panic(tls, __ccgo_ts+7263, libc.VaList(bp+128, XTcl_GetStringFromObj(tls, XTcl_GetObjResult(tls, interp), libc.UintptrFromInt32(0)))) } (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).FcallbackPtr = libc.UintptrFromInt32(0) return interp } func _DeleteOpCmdClientData(tls *libc.TLS, clientData uintptr) { var occdPtr uintptr _ = occdPtr occdPtr = clientData XTclpFree(tls, occdPtr) } /* * --------------------------------------------------------------------- * * TclRegisterCommandTypeName, TclGetCommandTypeName -- * * Command type registration and lookup mechanism. Everything is keyed by * the Tcl_ObjCmdProc for the command, and that is used as the *key* into * the hash table that maps to constant strings that are names. (It is * recommended that those names be ASCII.) * * --------------------------------------------------------------------- */ func XTclRegisterCommandTypeName(tls *libc.TLS, implementationProc uintptr, nameStr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var hPtr uintptr var _ /* isNew at bp+0 */ int32 _ = hPtr XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_commandTypeLock))) if _commandTypeInit == 0 { XTcl_InitHashTable(tls, uintptr(unsafe.Pointer(&_commandTypeTable)), int32(TCL_ONE_WORD_KEYS)) _commandTypeInit = int32(1) } if nameStr != libc.UintptrFromInt32(0) { hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&_commandTypeTable)))).FcreateProc})))(tls, uintptr(unsafe.Pointer(&_commandTypeTable)), implementationProc, bp) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = nameStr } else { hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&_commandTypeTable)))).FfindProc})))(tls, uintptr(unsafe.Pointer(&_commandTypeTable)), implementationProc) if hPtr != libc.UintptrFromInt32(0) { XTcl_DeleteHashEntry(tls, hPtr) } } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_commandTypeLock))) } func XTclGetCommandTypeName(tls *libc.TLS, command TTcl_Command) (r uintptr) { var cmdPtr, hPtr, name, procPtr uintptr _, _, _, _ = cmdPtr, hPtr, name, procPtr cmdPtr = command procPtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc name = __ccgo_ts + 7266 if procPtr == libc.UintptrFromInt32(0) { procPtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc } XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_commandTypeLock))) if _commandTypeInit != 0 { hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&_commandTypeTable)))).FfindProc})))(tls, uintptr(unsafe.Pointer(&_commandTypeTable)), procPtr) if hPtr != 0 && (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData != 0 { name = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData } } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_commandTypeLock))) return name } /* *---------------------------------------------------------------------- * * TclHideUnsafeCommands -- * * Hides base commands that are not marked as safe from this interpreter. * * Results: * TCL_OK if it succeeds, TCL_ERROR else. * * Side effects: * Hides functionality in an interpreter. * *---------------------------------------------------------------------- */ func XTclHideUnsafeCommands(tls *libc.TLS, interp uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Hide commands in this interpreter. */ var cachePtr, cachePtr1, cmdInfoPtr, cmdName, hideName, unsafePtr, v11, v3, v4, v6, v8 uintptr var v10, v7 TTcl_Size var v12, v5, v9 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cmdInfoPtr, cmdName, hideName, unsafePtr, v10, v11, v12, v3, v4, v5, v6, v7, v8, v9 if interp == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } cmdInfoPtr = uintptr(unsafe.Pointer(&_builtInCmds)) for { if !((*TCmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fname != libc.UintptrFromInt32(0)) { break } if !((*TCmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fflags&libc.Int32FromInt32(CMD_IS_SAFE) != 0) { XTcl_HideCommand(tls, interp, (*TCmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fname, (*TCmdInfo)(unsafe.Pointer(cmdInfoPtr)).Fname) } goto _1 _1: ; cmdInfoPtr += 40 } unsafePtr = uintptr(unsafe.Pointer(&_unsafeEnsembleCommands)) for { if !((*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FensembleNsName != 0) { break } if (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FcommandName != 0 { /* * Hide an ensemble subcommand. */ cmdName = XTcl_ObjPrintf(tls, __ccgo_ts+7273, libc.VaList(bp+8, (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FensembleNsName, (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FcommandName)) hideName = XTcl_ObjPrintf(tls, __ccgo_ts+7287, libc.VaList(bp+8, (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FensembleNsName, (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FcommandName)) if (*TTcl_Obj)(unsafe.Pointer(cmdName)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(cmdName)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, cmdName, libc.UintptrFromInt32(0)) } if v5 = XTclRenameCommand(tls, interp, v3, __ccgo_ts+7297) != TCL_OK; !v5 { if (*TTcl_Obj)(unsafe.Pointer(hideName)).Fbytes != 0 { v4 = (*TTcl_Obj)(unsafe.Pointer(hideName)).Fbytes } else { v4 = XTcl_GetStringFromObj(tls, hideName, libc.UintptrFromInt32(0)) } } if v5 || XTcl_HideCommand(tls, interp, __ccgo_ts+7297, v4) != TCL_OK { XTcl_Panic(tls, __ccgo_ts+7304, libc.VaList(bp+8, (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FensembleNsName, (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FcommandName, XTcl_GetStringFromObj(tls, XTcl_GetObjResult(tls, interp), libc.UintptrFromInt32(0)))) } if (*TTcl_Obj)(unsafe.Pointer(cmdName)).Fbytes != 0 { v6 = (*TTcl_Obj)(unsafe.Pointer(cmdName)).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, cmdName, libc.UintptrFromInt32(0)) } XTcl_CreateObjCommand(tls, interp, v6, __ccgo_fp(_BadEnsembleSubcommand), unsafePtr, libc.UintptrFromInt32(0)) v8 = cmdName v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if !(v7 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(cmdName)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(cmdName)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(cmdName)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(cmdName)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(cmdName)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(cmdName)).Flength = int64(-libc.Int32FromInt32(1)) if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, cmdName) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(cmdName + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = cmdName (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, cmdName) } } v11 = hideName v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if !(v10 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(hideName)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(hideName)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(hideName)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(hideName)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(hideName)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(hideName)).Flength = int64(-libc.Int32FromInt32(1)) if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, hideName) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(hideName + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = hideName (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, hideName) } } } else { /* * Hide an ensemble main command (for compatibility). */ if XTcl_HideCommand(tls, interp, (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FensembleNsName, (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FensembleNsName) != TCL_OK { XTcl_Panic(tls, __ccgo_ts+7336, libc.VaList(bp+8, (*TUnsafeEnsembleInfo)(unsafe.Pointer(unsafePtr)).FensembleNsName, XTcl_GetStringFromObj(tls, XTcl_GetObjResult(tls, interp), libc.UintptrFromInt32(0)))) } } goto _2 _2: ; unsafePtr += 16 } return TCL_OK } /* *---------------------------------------------------------------------- * * BadEnsembleSubcommand -- * * Command used to act as a backstop implementation when subcommands of * ensembles are unsafe (the real implementations of the subcommands are * hidden). The clientData is description of what was hidden. * * Results: * A standard Tcl result (always a TCL_ERROR). * * Side effects: * None. * *---------------------------------------------------------------------- */ func _BadEnsembleSubcommand(tls *libc.TLS, clientData uintptr, interp uintptr, dummy1521 int32, dummy1522 uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var infoPtr uintptr _ = infoPtr infoPtr = clientData XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+7365, libc.VaList(bp+8, (*TUnsafeEnsembleInfo)(unsafe.Pointer(infoPtr)).FcommandName, (*TUnsafeEnsembleInfo)(unsafe.Pointer(infoPtr)).FensembleNsName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7407, __ccgo_ts+7412, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* *-------------------------------------------------------------- * * Tcl_CallWhenDeleted -- * * Arrange for a function to be called before a given interpreter is * deleted. The function is called as soon as Tcl_DeleteInterp is called; * if Tcl_CallWhenDeleted is called on an interpreter that has already * been deleted, the function will be called when the last Tcl_Release is * done on the interpreter. * * Results: * None. * * Side effects: * When Tcl_DeleteInterp is invoked to delete interp, proc will be * invoked. See the manual entry for details. * *-------------------------------------------------------------- */ func XTcl_CallWhenDeleted(tls *libc.TLS, interp uintptr, proc uintptr, clientData uintptr) { bp := tls.Alloc(80) defer tls.Free(80) /* One-word value to pass to proc. */ var assocDataCounterPtr, dPtr, hPtr, iPtr uintptr var _ /* buffer at bp+4 */ [56]uint8 var _ /* isNew at bp+0 */ int32 _, _, _, _ = assocDataCounterPtr, dPtr, hPtr, iPtr iPtr = interp assocDataCounterPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&_assocDataCounterKey)), int64(4)) dPtr = XTcl_Alloc(tls, uint64(16)) libc.X__builtin_snprintf(tls, bp+4, uint64(56), __ccgo_ts+7423, libc.VaList(bp+72, *(*int32)(unsafe.Pointer(assocDataCounterPtr)))) *(*int32)(unsafe.Pointer(assocDataCounterPtr))++ if (*TInterp)(unsafe.Pointer(iPtr)).FassocData == libc.UintptrFromInt32(0) { (*TInterp)(unsafe.Pointer(iPtr)).FassocData = XTcl_Alloc(tls, uint64(104)) XTcl_InitHashTable(tls, (*TInterp)(unsafe.Pointer(iPtr)).FassocData, TCL_STRING_KEYS) } hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FassocData)).FcreateProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FassocData, bp+4, bp) (*TAssocData)(unsafe.Pointer(dPtr)).Fproc = proc (*TAssocData)(unsafe.Pointer(dPtr)).FclientData = clientData (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = dPtr } var _assocDataCounterKey TTcl_ThreadDataKey /* *-------------------------------------------------------------- * * Tcl_DontCallWhenDeleted -- * * Cancel the arrangement for a function to be called when a given * interpreter is deleted. * * Results: * None. * * Side effects: * If proc and clientData were previously registered as a callback via * Tcl_CallWhenDeleted, they are unregistered. If they weren't previously * registered then nothing happens. * *-------------------------------------------------------------- */ func XTcl_DontCallWhenDeleted(tls *libc.TLS, interp uintptr, proc uintptr, clientData uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* One-word value to pass to proc. */ var dPtr, hPtr, hTablePtr, iPtr uintptr var _ /* hSearch at bp+0 */ TTcl_HashSearch _, _, _, _ = dPtr, hPtr, hTablePtr, iPtr iPtr = interp hTablePtr = (*TInterp)(unsafe.Pointer(iPtr)).FassocData if hTablePtr == libc.UintptrFromInt32(0) { return } hPtr = XTcl_FirstHashEntry(tls, hTablePtr, bp) for { if !(hPtr != libc.UintptrFromInt32(0)) { break } dPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData if (*TAssocData)(unsafe.Pointer(dPtr)).Fproc == proc && (*TAssocData)(unsafe.Pointer(dPtr)).FclientData == clientData { XTclpFree(tls, dPtr) XTcl_DeleteHashEntry(tls, hPtr) return } goto _1 _1: ; hPtr = XTcl_NextHashEntry(tls, bp) } } /* *---------------------------------------------------------------------- * * Tcl_SetAssocData -- * * Creates a named association between user-specified data, a delete * function and this interpreter. If the association already exists the * data is overwritten with the new data. The delete function will be * invoked when the interpreter is deleted. * * Results: * None. * * Side effects: * Sets the associated data, creates the association if needed. * *---------------------------------------------------------------------- */ func XTcl_SetAssocData(tls *libc.TLS, interp uintptr, name uintptr, proc uintptr, clientData uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* One-word value to pass to proc. */ var dPtr, hPtr, iPtr uintptr var _ /* isNew at bp+0 */ int32 _, _, _ = dPtr, hPtr, iPtr iPtr = interp if (*TInterp)(unsafe.Pointer(iPtr)).FassocData == libc.UintptrFromInt32(0) { (*TInterp)(unsafe.Pointer(iPtr)).FassocData = XTcl_Alloc(tls, uint64(104)) XTcl_InitHashTable(tls, (*TInterp)(unsafe.Pointer(iPtr)).FassocData, TCL_STRING_KEYS) } hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FassocData)).FcreateProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FassocData, name, bp) if *(*int32)(unsafe.Pointer(bp)) == 0 { dPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData } else { dPtr = XTcl_Alloc(tls, uint64(16)) } (*TAssocData)(unsafe.Pointer(dPtr)).Fproc = proc (*TAssocData)(unsafe.Pointer(dPtr)).FclientData = clientData (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = dPtr } /* *---------------------------------------------------------------------- * * Tcl_DeleteAssocData -- * * Deletes a named association of user-specified data with the specified * interpreter. * * Results: * None. * * Side effects: * Deletes the association. * *---------------------------------------------------------------------- */ func XTcl_DeleteAssocData(tls *libc.TLS, interp uintptr, name uintptr) { /* Name of association. */ var dPtr, hPtr, iPtr uintptr _, _, _ = dPtr, hPtr, iPtr iPtr = interp if (*TInterp)(unsafe.Pointer(iPtr)).FassocData == libc.UintptrFromInt32(0) { return } hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FassocData)).FfindProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FassocData, name) if hPtr == libc.UintptrFromInt32(0) { return } dPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData XTcl_DeleteHashEntry(tls, hPtr) if (*TAssocData)(unsafe.Pointer(dPtr)).Fproc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TAssocData)(unsafe.Pointer(dPtr)).Fproc})))(tls, (*TAssocData)(unsafe.Pointer(dPtr)).FclientData, interp) } XTclpFree(tls, dPtr) } /* *---------------------------------------------------------------------- * * Tcl_GetAssocData -- * * Returns the client data associated with this name in the specified * interpreter. * * Results: * The client data in the AssocData record denoted by the named * association, or NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_GetAssocData(tls *libc.TLS, interp uintptr, name uintptr, procPtr uintptr) (r uintptr) { /* Pointer to place to store address of * current deletion callback. */ var dPtr, hPtr, iPtr uintptr _, _, _ = dPtr, hPtr, iPtr iPtr = interp if (*TInterp)(unsafe.Pointer(iPtr)).FassocData == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FassocData)).FfindProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FassocData, name) if hPtr == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } dPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData if procPtr != libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(procPtr)) = (*TAssocData)(unsafe.Pointer(dPtr)).Fproc } return (*TAssocData)(unsafe.Pointer(dPtr)).FclientData } /* *---------------------------------------------------------------------- * * Tcl_InterpDeleted -- * * Returns nonzero if the interpreter has been deleted with a call to * Tcl_DeleteInterp. * * Results: * Nonzero if the interpreter is deleted, zero otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_InterpDeleted(tls *libc.TLS, interp uintptr) (r int32) { var v1 int32 _ = v1 if (*TInterp)(unsafe.Pointer(interp)).Fflags&int32(DELETED) != 0 { v1 = int32(1) } else { v1 = 0 } return v1 } /* *---------------------------------------------------------------------- * * Tcl_DeleteInterp -- * * Ensures that the interpreter will be deleted eventually. If there are * no Tcl_Preserve calls in effect for this interpreter, it is deleted * immediately, otherwise the interpreter is deleted when the last * Tcl_Preserve is matched by a call to Tcl_Release. In either case, the * function runs the currently registered deletion callbacks. * * Results: * None. * * Side effects: * The interpreter is marked as deleted. The caller may still use it * safely if there are calls to Tcl_Preserve in effect for the * interpreter, but further calls to Tcl_Eval etc in this interpreter * will fail. * *---------------------------------------------------------------------- */ func XTcl_DeleteInterp(tls *libc.TLS, interp uintptr) { /* Token for command interpreter (returned by * a previous call to Tcl_CreateInterp). */ var iPtr uintptr _ = iPtr iPtr = interp /* * If the interpreter has already been marked deleted, just punt. */ if (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(DELETED) != 0 { return } /* * Mark the interpreter as deleted. No further evals will be allowed. * Increase the compileEpoch as a signal to compiled bytecodes. */ *(*int32)(unsafe.Pointer(iPtr + 368)) |= int32(DELETED) (*TInterp)(unsafe.Pointer(iPtr)).FcompileEpoch++ /* * Ensure that the interpreter is eventually deleted. */ XTcl_EventuallyFree(tls, interp, __ccgo_fp(_DeleteInterpProc)) } /* *---------------------------------------------------------------------- * * DeleteInterpProc -- * * Helper function to delete an interpreter. This function is called when * the last call to Tcl_Preserve on this interpreter is matched by a call * to Tcl_Release. The function cleans up all resources used in the * interpreter and calls all currently registered interpreter deletion * callbacks. * * Results: * None. * * Side effects: * Whatever the interpreter deletion callbacks do. Frees resources used * by the interpreter. * *---------------------------------------------------------------------- */ func _DeleteInterpProc(tls *libc.TLS, blockPtr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* Interpreter to delete. */ var _objPtr, _objPtr1, _objPtr10, _objPtr11, _objPtr12, _objPtr13, _objPtr14, _objPtr15, _objPtr16, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, _objPtr8, _objPtr9, cancelInfo, cfPtr, dPtr, eclPtr, hPtr, hTablePtr, iPtr, interp, nextResPtr, procPtr, resPtr, v10, v12, v14, v16, v18, v2, v20, v22, v24, v26, v28, v30, v32, v34, v36, v39, v4, v8 uintptr var i, v1, v11, v13, v15, v17, v19, v21, v23, v25, v27, v29, v3, v31, v35, v38, v7, v9 TTcl_Size var _ /* search at bp+0 */ TTcl_HashSearch _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr10, _objPtr11, _objPtr12, _objPtr13, _objPtr14, _objPtr15, _objPtr16, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, _objPtr8, _objPtr9, cancelInfo, cfPtr, dPtr, eclPtr, hPtr, hTablePtr, i, iPtr, interp, nextResPtr, procPtr, resPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v34, v35, v36, v38, v39, v4, v7, v8, v9 interp = blockPtr iPtr = interp /* * Punt if there is an error in the Tcl_Release/Tcl_Preserve matchup, * unless we are exiting. */ if (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels > 0 && !(XTclInExit(tls) != 0) { XTcl_Panic(tls, __ccgo_ts+7442, 0) } /* * The interpreter should already be marked deleted; otherwise how did we * get here? */ if !((*TInterp)(unsafe.Pointer(iPtr)).Fflags&libc.Int32FromInt32(DELETED) != 0) { XTcl_Panic(tls, __ccgo_ts+7484, 0) } /* * TIP #219, Tcl Channel Reflection API. Discard a leftover state. */ if (*TInterp)(unsafe.Pointer(iPtr)).FchanMsg != libc.UintptrFromInt32(0) { _objPtr = (*TInterp)(unsafe.Pointer(iPtr)).FchanMsg v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } (*TInterp)(unsafe.Pointer(iPtr)).FchanMsg = libc.UintptrFromInt32(0) } /* * TIP #285, Script cancellation support. Delete this interp from the * global hash table of CancelInfo structs. */ XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_cancelLock))) hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cancelTable)))).FfindProc})))(tls, uintptr(unsafe.Pointer(&_cancelTable)), iPtr) if hPtr != libc.UintptrFromInt32(0) { cancelInfo = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData if cancelInfo != libc.UintptrFromInt32(0) { if (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fresult != libc.UintptrFromInt32(0) { XTclpFree(tls, (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fresult) } XTclpFree(tls, cancelInfo) } XTcl_DeleteHashEntry(tls, hPtr) } if (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancel != libc.UintptrFromInt32(0) { XTcl_AsyncDelete(tls, (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancel) (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancel = libc.UintptrFromInt32(0) } if (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg != libc.UintptrFromInt32(0) { _objPtr1 = (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg = libc.UintptrFromInt32(0) } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_cancelLock))) /* * Shut down all limit handler callback scripts that call back into this * interpreter. Then eliminate all limit handlers for this interpreter. */ XTclRemoveScriptLimitCallbacks(tls, interp) XTclLimitRemoveAllHandlers(tls, interp) /* * Dismantle the namespace here, before we clear the assocData. If any * background errors occur here, they will be deleted below. * * Dismantle the namespace after freeing the iPtr->handle so that each * bytecode releases its literals without caring to update the literal * table, as it will be freed later in this function without further use. */ XTclHandleFree(tls, (*TInterp)(unsafe.Pointer(iPtr)).Fhandle) XTclTeardownNamespace(tls, (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr) /* * Delete all the hidden commands. */ hTablePtr = (*TInterp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr if hTablePtr != libc.UintptrFromInt32(0) { /* * Non-pernicious deletion. The deletion callbacks will not be allowed * to create any new hidden or non-hidden commands. * Tcl_DeleteCommandFromToken will remove the entry from the * hiddenCmdTablePtr. */ hPtr = XTcl_FirstHashEntry(tls, hTablePtr, bp) for { if !(hPtr != libc.UintptrFromInt32(0)) { break } XTcl_DeleteCommandFromToken(tls, interp, (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData) goto _5 _5: ; hPtr = XTcl_NextHashEntry(tls, bp) } XTcl_DeleteHashTable(tls, hTablePtr) XTclpFree(tls, hTablePtr) } if (*TInterp)(unsafe.Pointer(iPtr)).FassocData != libc.UintptrFromInt32(0) { hTablePtr = (*TInterp)(unsafe.Pointer(iPtr)).FassocData /* * Invoke deletion callbacks; note that a callback can create new * callbacks, so we iterate. */ hPtr = XTcl_FirstHashEntry(tls, hTablePtr, bp) for { if !(hPtr != libc.UintptrFromInt32(0)) { break } dPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData XTcl_DeleteHashEntry(tls, hPtr) if (*TAssocData)(unsafe.Pointer(dPtr)).Fproc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TAssocData)(unsafe.Pointer(dPtr)).Fproc})))(tls, (*TAssocData)(unsafe.Pointer(dPtr)).FclientData, interp) } XTclpFree(tls, dPtr) goto _6 _6: ; hPtr = XTcl_FirstHashEntry(tls, hTablePtr, bp) } XTcl_DeleteHashTable(tls, hTablePtr) XTclpFree(tls, hTablePtr) (*TInterp)(unsafe.Pointer(iPtr)).FassocData = libc.UintptrFromInt32(0) } /* * Pop the root frame pointer and finish deleting the global * namespace. The order is important [Bug 1658572]. */ if (*TInterp)(unsafe.Pointer(iPtr)).FframePtr != (*TInterp)(unsafe.Pointer(iPtr)).FrootFramePtr && !(XTclInExit(tls) != 0) { XTcl_Panic(tls, __ccgo_ts+7542, 0) } XTcl_PopCallFrame(tls, interp) XTclpFree(tls, (*TInterp)(unsafe.Pointer(iPtr)).FrootFramePtr) (*TInterp)(unsafe.Pointer(iPtr)).FrootFramePtr = libc.UintptrFromInt32(0) XTcl_DeleteNamespace(tls, (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr) /* * Free up the result *after* deleting variables, since variable deletion * could have transferred ownership of the result string to Tcl. */ _objPtr2 = (*TInterp)(unsafe.Pointer(iPtr)).FobjResultPtr v8 = _objPtr2 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr2) } (*TInterp)(unsafe.Pointer(iPtr)).FobjResultPtr = libc.UintptrFromInt32(0) _objPtr3 = (*TInterp)(unsafe.Pointer(iPtr)).FecVar v10 = _objPtr3 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr3) } if (*TInterp)(unsafe.Pointer(iPtr)).FerrorCode != 0 { _objPtr4 = (*TInterp)(unsafe.Pointer(iPtr)).FerrorCode v12 = _objPtr4 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr4) } (*TInterp)(unsafe.Pointer(iPtr)).FerrorCode = libc.UintptrFromInt32(0) } _objPtr5 = (*TInterp)(unsafe.Pointer(iPtr)).FeiVar v14 = _objPtr5 v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if v13 <= int64(1) { XTclFreeObj(tls, _objPtr5) } if (*TInterp)(unsafe.Pointer(iPtr)).FerrorInfo != 0 { _objPtr6 = (*TInterp)(unsafe.Pointer(iPtr)).FerrorInfo v16 = _objPtr6 v15 = *(*TTcl_Size)(unsafe.Pointer(v16)) *(*TTcl_Size)(unsafe.Pointer(v16))-- if v15 <= int64(1) { XTclFreeObj(tls, _objPtr6) } (*TInterp)(unsafe.Pointer(iPtr)).FerrorInfo = libc.UintptrFromInt32(0) } _objPtr7 = (*TInterp)(unsafe.Pointer(iPtr)).FerrorStack v18 = _objPtr7 v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if v17 <= int64(1) { XTclFreeObj(tls, _objPtr7) } (*TInterp)(unsafe.Pointer(iPtr)).FerrorStack = libc.UintptrFromInt32(0) _objPtr8 = (*TInterp)(unsafe.Pointer(iPtr)).FupLiteral v20 = _objPtr8 v19 = *(*TTcl_Size)(unsafe.Pointer(v20)) *(*TTcl_Size)(unsafe.Pointer(v20))-- if v19 <= int64(1) { XTclFreeObj(tls, _objPtr8) } _objPtr9 = (*TInterp)(unsafe.Pointer(iPtr)).FcallLiteral v22 = _objPtr9 v21 = *(*TTcl_Size)(unsafe.Pointer(v22)) *(*TTcl_Size)(unsafe.Pointer(v22))-- if v21 <= int64(1) { XTclFreeObj(tls, _objPtr9) } _objPtr10 = (*TInterp)(unsafe.Pointer(iPtr)).FinnerLiteral v24 = _objPtr10 v23 = *(*TTcl_Size)(unsafe.Pointer(v24)) *(*TTcl_Size)(unsafe.Pointer(v24))-- if v23 <= int64(1) { XTclFreeObj(tls, _objPtr10) } _objPtr11 = (*TInterp)(unsafe.Pointer(iPtr)).FinnerContext v26 = _objPtr11 v25 = *(*TTcl_Size)(unsafe.Pointer(v26)) *(*TTcl_Size)(unsafe.Pointer(v26))-- if v25 <= int64(1) { XTclFreeObj(tls, _objPtr11) } if (*TInterp)(unsafe.Pointer(iPtr)).FreturnOpts != 0 { _objPtr12 = (*TInterp)(unsafe.Pointer(iPtr)).FreturnOpts v28 = _objPtr12 v27 = *(*TTcl_Size)(unsafe.Pointer(v28)) *(*TTcl_Size)(unsafe.Pointer(v28))-- if v27 <= int64(1) { XTclFreeObj(tls, _objPtr12) } } XTclFreePackageInfo(tls, iPtr) for (*TInterp)(unsafe.Pointer(iPtr)).FtracePtr != libc.UintptrFromInt32(0) { XTcl_DeleteTrace(tls, iPtr, (*TInterp)(unsafe.Pointer(iPtr)).FtracePtr) } if (*TInterp)(unsafe.Pointer(iPtr)).FexecEnvPtr != libc.UintptrFromInt32(0) { XTclDeleteExecEnv(tls, (*TInterp)(unsafe.Pointer(iPtr)).FexecEnvPtr) } if (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile != 0 { _objPtr13 = (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile v30 = _objPtr13 v29 = *(*TTcl_Size)(unsafe.Pointer(v30)) *(*TTcl_Size)(unsafe.Pointer(v30))-- if v29 <= int64(1) { XTclFreeObj(tls, _objPtr13) } (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile = libc.UintptrFromInt32(0) } _objPtr14 = (*TInterp)(unsafe.Pointer(iPtr)).FemptyObjPtr v32 = _objPtr14 v31 = *(*TTcl_Size)(unsafe.Pointer(v32)) *(*TTcl_Size)(unsafe.Pointer(v32))-- if v31 <= int64(1) { XTclFreeObj(tls, _objPtr14) } (*TInterp)(unsafe.Pointer(iPtr)).FemptyObjPtr = libc.UintptrFromInt32(0) resPtr = (*TInterp)(unsafe.Pointer(iPtr)).FresolverPtr for resPtr != 0 { nextResPtr = (*TResolverScheme)(unsafe.Pointer(resPtr)).FnextPtr XTclpFree(tls, (*TResolverScheme)(unsafe.Pointer(resPtr)).Fname) XTclpFree(tls, resPtr) resPtr = nextResPtr } /* * Free up literal objects created for scripts compiled by the * interpreter. */ XTclDeleteLiteralTable(tls, interp, iPtr+264) /* * TIP #280 - Release the arrays for ByteCode/Proc extension, and * contents. */ hPtr = XTcl_FirstHashEntry(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlinePBodyPtr, bp) for { if !(hPtr != libc.UintptrFromInt32(0)) { break } cfPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData if (*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlinePBodyPtr)).FkeyType == -int32(1) { v34 = *(*uintptr)(unsafe.Pointer(hPtr + 32)) } else { v34 = hPtr + 32 } procPtr = v34 (*TProc)(unsafe.Pointer(procPtr)).FiPtr = libc.UintptrFromInt32(0) if cfPtr != 0 { if (*TCmdFrame)(unsafe.Pointer(cfPtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { _objPtr15 = (*TCmdFrame)(unsafe.Pointer(cfPtr)).Fdata.Feval.Fpath v36 = _objPtr15 v35 = *(*TTcl_Size)(unsafe.Pointer(v36)) *(*TTcl_Size)(unsafe.Pointer(v36))-- if v35 <= int64(1) { XTclFreeObj(tls, _objPtr15) } } XTclpFree(tls, (*TCmdFrame)(unsafe.Pointer(cfPtr)).Fline) XTclpFree(tls, cfPtr) } XTcl_DeleteHashEntry(tls, hPtr) goto _33 _33: ; hPtr = XTcl_NextHashEntry(tls, bp) } XTcl_DeleteHashTable(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlinePBodyPtr) XTclpFree(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlinePBodyPtr) (*TInterp)(unsafe.Pointer(iPtr)).FlinePBodyPtr = libc.UintptrFromInt32(0) /* * See also tclCompile.c, TclCleanupByteCode */ hPtr = XTcl_FirstHashEntry(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr, bp) for { if !(hPtr != libc.UintptrFromInt32(0)) { break } eclPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData if (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { _objPtr16 = (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fpath v39 = _objPtr16 v38 = *(*TTcl_Size)(unsafe.Pointer(v39)) *(*TTcl_Size)(unsafe.Pointer(v39))-- if v38 <= int64(1) { XTclFreeObj(tls, _objPtr16) } } i = 0 for { if !(i < (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc) { break } XTclpFree(tls, (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(i)*32))).Fline) goto _40 _40: ; i++ } if (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc != libc.UintptrFromInt32(0) { XTclpFree(tls, (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc) } XTclpFree(tls, eclPtr) XTcl_DeleteHashEntry(tls, hPtr) goto _37 _37: ; hPtr = XTcl_NextHashEntry(tls, bp) } XTcl_DeleteHashTable(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr) XTclpFree(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr) (*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr = libc.UintptrFromInt32(0) /* * Location stack for uplevel/eval/... scripts which were passed through * proc arguments. Actually we track all arguments as we do not and cannot * know which arguments will be used as scripts and which will not. */ if (*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr)).FnumEntries != 0 && !(XTclInExit(tls) != 0) { /* * When the interp goes away we have nothing on the stack, so there * are no arguments, so this table has to be empty. */ XTcl_Panic(tls, __ccgo_ts+7607, 0) } XTcl_DeleteHashTable(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr) XTclpFree(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr) (*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr = libc.UintptrFromInt32(0) if (*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr)).FnumEntries != 0 && !(XTclInExit(tls) != 0) { /* * When the interp goes away we have nothing on the stack, so there * are no arguments, so this table has to be empty. */ XTcl_Panic(tls, __ccgo_ts+7607, 0) } XTcl_DeleteHashTable(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr) XTclpFree(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr) (*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr = libc.UintptrFromInt32(0) /* * Squelch the tables of traces on variables and searches over arrays in * the in the interpreter. */ XTcl_DeleteHashTable(tls, iPtr+792) XTcl_DeleteHashTable(tls, iPtr+896) XTclpFree(tls, iPtr) } /* *--------------------------------------------------------------------------- * * Tcl_HideCommand -- * * Makes a command hidden so that it cannot be invoked from within an * interpreter, only from within an ancestor. * * Results: * A standard Tcl result; also leaves a message in the interp's result if * an error occurs. * * Side effects: * Removes a command from the command table and create an entry into the * hidden command table under the specified token name. * *--------------------------------------------------------------------------- */ func XTcl_HideCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, hiddenCmdToken uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Token name of the to-be-hidden command. */ var cmd TTcl_Command var cmdPtr, hPtr, hiddenCmdTablePtr, iPtr uintptr var _ /* isNew at bp+0 */ int32 _, _, _, _, _ = cmd, cmdPtr, hPtr, hiddenCmdTablePtr, iPtr iPtr = interp if (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(DELETED) != 0 { /* * The interpreter is being deleted. Do not create any new structures, * because it is not safe to modify the interpreter. */ return int32(TCL_ERROR) } /* * Disallow hiding of commands that are currently in a namespace or * renaming (as part of hiding) into a namespace (because the current * implementation with a single global table and the needed uniqueness of * names cause problems with namespaces). * * We don't need to check for "::" in cmdName because the real check is on * the nsPtr below. * * hiddenCmdToken is just a string which is not interpreted in any way. It * may contain :: but the string is not interpreted as a namespace * qualifier command name. Thus, hiding foo::bar to foo::bar and then * trying to expose or invoke ::foo::bar will NOT work; but if the * application always uses the same strings it will get consistent * behaviour. * * But as we currently limit ourselves to the global namespace only for * the source, in order to avoid potential confusion, lets prevent "::" in * the token too. - dl */ if libc.Xstrstr(tls, hiddenCmdToken, __ccgo_ts+7650) != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+7653, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+7718, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Find the command to hide. An error is returned if cmdName can't be * found. Look up the command only from the global namespace. Full path of * the command must be given if using namespaces. */ cmd = XTcl_FindCommand(tls, interp, cmdName, libc.UintptrFromInt32(0), libc.Int32FromInt32(TCL_LEAVE_ERR_MSG)|libc.Int32FromInt32(TCL_GLOBAL_ONLY)) if cmd == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } cmdPtr = cmd /* * Check that the command is really in global namespace */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr != (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+7730, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7793, __ccgo_ts+7798, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Initialize the hidden command table if necessary. */ hiddenCmdTablePtr = (*TInterp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr if hiddenCmdTablePtr == libc.UintptrFromInt32(0) { hiddenCmdTablePtr = XTcl_Alloc(tls, uint64(104)) XTcl_InitHashTable(tls, hiddenCmdTablePtr, TCL_STRING_KEYS) (*TInterp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr = hiddenCmdTablePtr } /* * It is an error to move an exposed command to a hidden command with * hiddenCmdToken if a hidden command with the name hiddenCmdToken already * exists. */ hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(hiddenCmdTablePtr)).FcreateProc})))(tls, hiddenCmdTablePtr, hiddenCmdToken, bp) if !(*(*int32)(unsafe.Pointer(bp)) != 0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+7809, libc.VaList(bp+16, hiddenCmdToken))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7793, __ccgo_ts+7850, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * NB: This code is currently 'like' a rename to a special separate name * table. Changes here and in TclRenameCommand must be kept in synch until * the common parts are actually factorized out. */ /* * Remove the hash entry for the command from the interpreter command * table. This is like deleting the command, so bump its command epoch * to invalidate any cached references that point to the command. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr != libc.UintptrFromInt32(0) { XTcl_DeleteHashEntry(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr) (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = libc.UintptrFromInt32(0) (*TCommand)(unsafe.Pointer(cmdPtr)).FcmdEpoch++ } /* * The list of command exported from the namespace might have changed. * However, we do not need to recompute this just yet; next time we need * the info will be soon enough. */ if (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FnumExportPatterns != 0 { (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FexportLookupEpoch++ } if (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcommandPathLength != 0 { (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcmdRefEpoch++ } /* * Now link the hash table entry with the command structure. We ensured * above that the nsPtr was right. */ (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr /* * If the command being hidden has a compile function, increment the * interpreter's compileEpoch to invalidate its compiled code. This makes * sure that we don't later try to execute old code compiled with * command-specific (i.e., inline) bytecodes for the now-hidden command. * This field is checked in Tcl_EvalObj and ObjInterpProc, and code whose * compilation epoch doesn't match is recompiled. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc != libc.UintptrFromInt32(0) { (*TInterp)(unsafe.Pointer(iPtr)).FcompileEpoch++ } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_ExposeCommand -- * * Makes a previously hidden command callable from inside the interpreter * instead of only by its ancestors. * * Results: * A standard Tcl result. If an error occurs, a message is left in the * interp's result. * * Side effects: * Moves commands from one hash table to another. * *---------------------------------------------------------------------- */ func XTcl_ExposeCommand(tls *libc.TLS, interp uintptr, hiddenCmdToken uintptr, cmdName uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Name of to-be-exposed command. */ var cmdPtr, hPtr, hiddenCmdTablePtr, iPtr, nsPtr uintptr var _ /* isNew at bp+0 */ int32 _, _, _, _, _ = cmdPtr, hPtr, hiddenCmdTablePtr, iPtr, nsPtr iPtr = interp if (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(DELETED) != 0 { /* * The interpreter is being deleted. Do not create any new structures, * because it is not safe to modify the interpreter. */ return int32(TCL_ERROR) } /* * Check that we have a regular name for the command (that the user is not * trying to do an expose and a rename (to another namespace) at the same * time). */ if libc.Xstrstr(tls, cmdName, __ccgo_ts+7650) != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+7865, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7932, __ccgo_ts+7798, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Get the command from the hidden command table: */ hPtr = libc.UintptrFromInt32(0) hiddenCmdTablePtr = (*TInterp)(unsafe.Pointer(iPtr)).FhiddenCmdTablePtr if hiddenCmdTablePtr != libc.UintptrFromInt32(0) { hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(hiddenCmdTablePtr)).FfindProc})))(tls, hiddenCmdTablePtr, hiddenCmdToken) } if hPtr == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+7939, libc.VaList(bp+16, hiddenCmdToken))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+7718, hiddenCmdToken, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } cmdPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData /* * Check that we have a true global namespace command (enforced by * Tcl_HideCommand but let's double check. (If it was not, we would not * really know how to handle it). */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr != (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr { /* * This case is theoretically impossible, we might rather Tcl_Panic * than 'nicely' erroring out ? */ XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+7974, int64(-libc.Int32FromInt32(1)))) return int32(TCL_ERROR) } /* * This is the global table. */ nsPtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr /* * It is an error to overwrite an existing exposed command as a result of * exposing a previously hidden command. */ hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(nsPtr + 184)).FcreateProc})))(tls, nsPtr+184, cmdName, bp) if !(*(*int32)(unsafe.Pointer(bp)) != 0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+8030, libc.VaList(bp+16, cmdName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7932, __ccgo_ts+8066, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Command resolvers (per-interp, per-namespace) might have resolved to a * command for the given namespace scope with this command not being * registered with the namespace's command table. During BC compilation, * the so-resolved command turns into a CmdName literal. Without * invalidating a possible CmdName literal here explicitly, such literals * keep being reused while pointing to overhauled commands. */ XTclInvalidateCmdLiteral(tls, interp, cmdName, nsPtr) /* * The list of command exported from the namespace might have changed. * However, we do not need to recompute this just yet; next time we need * the info will be soon enough. */ if (*TNamespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns != 0 { (*TNamespace)(unsafe.Pointer(nsPtr)).FexportLookupEpoch++ } if (*TNamespace)(unsafe.Pointer(nsPtr)).FcommandPathLength != 0 { (*TNamespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++ } /* * Remove the hash entry for the command from the interpreter hidden * command table. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr != libc.UintptrFromInt32(0) { XTcl_DeleteHashEntry(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr) (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = libc.UintptrFromInt32(0) } /* * Now link the hash table entry with the command structure. This is like * creating a new command, so deal with any shadowing of commands in the * global namespace. */ (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr /* * Not needed as we are only in the global namespace (but would be needed * again if we supported namespace command hiding) * * TclResetShadowedCmdRefs(interp, cmdPtr); */ /* * If the command being exposed has a compile function, increment * interpreter's compileEpoch to invalidate its compiled code. This makes * sure that we don't later try to execute old code compiled assuming the * command is hidden. This field is checked in Tcl_EvalObj and * ObjInterpProc, and code whose compilation epoch doesn't match is * recompiled. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc != libc.UintptrFromInt32(0) { (*TInterp)(unsafe.Pointer(iPtr)).FcompileEpoch++ } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_CreateCommand -- * * Define a new command in a command table. * * Results: * The return value is a token for the command, which can be used in * future calls to Tcl_GetCommandName. * * Side effects: * If a command named cmdName already exists for interp, it is deleted. * In the future, when cmdName is seen as the name of a command by * Tcl_Eval, proc will be called. To support the bytecode interpreter, * the command is created with a wrapper Tcl_ObjCmdProc * (InvokeStringCommand) that eventually calls proc. When the command * is deleted from the table, deleteProc will be called. See the manual * entry for details on the calling sequence. * *---------------------------------------------------------------------- */ func XTcl_CreateCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, proc uintptr, clientData uintptr, deleteProc uintptr) (r TTcl_Command) { bp := tls.Alloc(48) defer tls.Free(48) /* If not NULL, gives a function to call when * this command is deleted. */ var cmdPtr, dataPtr, hPtr, iPtr, oldRefPtr, refCmdPtr, v2 uintptr var deleted int32 var v1 TTcl_Size var _ /* dummy1 at bp+24 */ uintptr var _ /* dummy2 at bp+32 */ uintptr var _ /* isNew at bp+16 */ int32 var _ /* nsPtr at bp+0 */ uintptr var _ /* tail at bp+8 */ uintptr _, _, _, _, _, _, _, _, _ = cmdPtr, dataPtr, deleted, hPtr, iPtr, oldRefPtr, refCmdPtr, v1, v2 iPtr = interp oldRefPtr = libc.UintptrFromInt32(0) *(*int32)(unsafe.Pointer(bp + 16)) = 0 deleted = 0 if (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(DELETED) != 0 { /* * The interpreter is being deleted. Don't create any new commands; * it's not safe to muck with the interpreter anymore. */ return libc.UintptrFromInt32(0) } /* * If the command name we seek to create already exists, we need to * delete that first. That can be tricky in the presence of traces. * Loop until we no longer find an existing command in the way, or * until we've deleted one command and that didn't finish the job. */ for int32(1) != 0 { /* * Determine where the command should reside. If its name contains * namespace qualifiers, we put it in the specified namespace; * otherwise, we always put it in the global namespace. */ if libc.Xstrstr(tls, cmdName, __ccgo_ts+7650) != libc.UintptrFromInt32(0) { XTclGetNamespaceForQualName(tls, interp, cmdName, libc.UintptrFromInt32(0), int32(TCL_CREATE_NS_IF_UNKNOWN), bp, bp+24, bp+32, bp+8) if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) || *(*uintptr)(unsafe.Pointer(bp + 8)) == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } } else { *(*uintptr)(unsafe.Pointer(bp)) = (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr *(*uintptr)(unsafe.Pointer(bp + 8)) = cmdName } hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 184)).FcreateProc})))(tls, *(*uintptr)(unsafe.Pointer(bp))+184, *(*uintptr)(unsafe.Pointer(bp + 8)), bp+16) if *(*int32)(unsafe.Pointer(bp + 16)) != 0 || deleted != 0 { /* * isNew - No conflict with existing command. * deleted - We've already deleted a conflicting command */ break } /* * An existing command conflicts. Try to delete it... */ cmdPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData /* * Be careful to preserve any existing import links so we can restore * them down below. That way, you can redefine a command and its * import status will remain intact. */ (*TCommand)(unsafe.Pointer(cmdPtr)).FrefCount++ if (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr != 0 { *(*int32)(unsafe.Pointer(cmdPtr + 88)) |= int32(CMD_REDEF_IN_PROGRESS) } XTcl_DeleteCommandFromToken(tls, interp, cmdPtr) if (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_REDEF_IN_PROGRESS) != 0 { oldRefPtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr = libc.UintptrFromInt32(0) } v2 = cmdPtr + 16 v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclpFree(tls, cmdPtr) } deleted = int32(1) } if !(*(*int32)(unsafe.Pointer(bp + 16)) != 0) { /* * If the deletion callback recreated the command, just throw away the * new command (if we try to delete it again, we could get stuck in an * infinite loop). */ XTclpFree(tls, (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData) } if !(deleted != 0) { /* * Command resolvers (per-interp, per-namespace) might have resolved * to a command for the given namespace scope with this command not * being registered with the namespace's command table. During BC * compilation, the so-resolved command turns into a CmdName literal. * Without invalidating a possible CmdName literal here explicitly, * such literals keep being reused while pointing to overhauled * commands. */ XTclInvalidateCmdLiteral(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp))) /* * The list of command exported from the namespace might have changed. * However, we do not need to recompute this just yet; next time we * need the info will be soon enough. */ if (*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnumExportPatterns != 0 { (*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FexportLookupEpoch++ } if (*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcommandPathLength != 0 { (*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcmdRefEpoch++ } XTclInvalidateNsPath(tls, *(*uintptr)(unsafe.Pointer(bp))) } cmdPtr = XTcl_Alloc(tls, uint64(120)) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr = *(*uintptr)(unsafe.Pointer(bp)) (*TCommand)(unsafe.Pointer(cmdPtr)).FrefCount = int64(1) (*TCommand)(unsafe.Pointer(cmdPtr)).FcmdEpoch = 0 (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc = libc.UintptrFromInt32(0) (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc = __ccgo_fp(_InvokeStringCommand) (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData = cmdPtr (*TCommand)(unsafe.Pointer(cmdPtr)).Fproc = proc (*TCommand)(unsafe.Pointer(cmdPtr)).FclientData = clientData (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc = deleteProc (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteData = clientData (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags = 0 (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr = libc.UintptrFromInt32(0) (*TCommand)(unsafe.Pointer(cmdPtr)).FtracePtr = libc.UintptrFromInt32(0) (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc = libc.UintptrFromInt32(0) /* * Plug in any existing import references found above. Be sure to update * all of these references to point to the new command. */ if oldRefPtr != libc.UintptrFromInt32(0) { (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr = oldRefPtr for oldRefPtr != libc.UintptrFromInt32(0) { refCmdPtr = (*TImportRef)(unsafe.Pointer(oldRefPtr)).FimportedCmdPtr dataPtr = (*TCommand)(unsafe.Pointer(refCmdPtr)).FobjClientData (*TImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr = cmdPtr oldRefPtr = (*TImportRef)(unsafe.Pointer(oldRefPtr)).FnextPtr } } /* * We just created a command, so in its namespace and all of its parent * namespaces, it may shadow global commands with the same name. If any * shadowed commands are found, invalidate all cached command references * in the affected namespaces. */ XTclResetShadowedCmdRefs(tls, interp, cmdPtr) return cmdPtr } /* *---------------------------------------------------------------------- * * Tcl_CreateObjCommand -- * * Define a new object-based command in a command table. * * Results: * The return value is a token for the command, which can be used in * future calls to Tcl_GetCommandName. * * Side effects: * If a command named "cmdName" already exists for interp, it is * first deleted. Then the new command is created from the arguments. * * In the future, during bytecode evaluation when "cmdName" is seen as * the name of a command by Tcl_EvalObj or Tcl_Eval, the object-based * Tcl_ObjCmdProc proc will be called. When the command is deleted from * the table, deleteProc will be called. See the manual entry for details * on the calling sequence. * *---------------------------------------------------------------------- */ type TCmdWrapperInfo = struct { Fproc uintptr FclientData uintptr FdeleteProc uintptr FdeleteData uintptr FnreProc uintptr } func _cmdWrapperProc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var info uintptr _ = info info = clientData if objc < 0 { objc = -int32(1) } return (*(*func(*libc.TLS, uintptr, uintptr, TTcl_Size, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TCmdWrapperInfo)(unsafe.Pointer(info)).Fproc})))(tls, (*TCmdWrapperInfo)(unsafe.Pointer(info)).FclientData, interp, int64(objc), objv) } func _cmdWrapperDeleteProc(tls *libc.TLS, clientData uintptr) { var deleteProc, info uintptr _, _ = deleteProc, info info = clientData clientData = (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteData deleteProc = (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteProc XTclpFree(tls, info) if deleteProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{deleteProc})))(tls, clientData) } } func XTcl_CreateObjCommand2(tls *libc.TLS, interp uintptr, cmdName uintptr, proc uintptr, clientData uintptr, deleteProc uintptr) (r TTcl_Command) { /* If not NULL, gives a function to call when * this command is deleted. */ var info, v1 uintptr _, _ = info, v1 info = XTcl_Alloc(tls, uint64(40)) (*TCmdWrapperInfo)(unsafe.Pointer(info)).Fproc = proc (*TCmdWrapperInfo)(unsafe.Pointer(info)).FclientData = clientData (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteProc = deleteProc (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteData = clientData if proc != 0 { v1 = __ccgo_fp(_cmdWrapperProc) } else { v1 = libc.UintptrFromInt32(0) } return XTcl_CreateObjCommand(tls, interp, cmdName, v1, info, __ccgo_fp(_cmdWrapperDeleteProc)) } func XTcl_CreateObjCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, proc uintptr, clientData uintptr, deleteProc uintptr) (r TTcl_Command) { bp := tls.Alloc(32) defer tls.Free(32) /* If not NULL, gives a function to call when * this command is deleted. */ var iPtr uintptr var _ /* dummy1 at bp+16 */ uintptr var _ /* dummy2 at bp+24 */ uintptr var _ /* nsPtr at bp+0 */ uintptr var _ /* tail at bp+8 */ uintptr _ = iPtr iPtr = interp if (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(DELETED) != 0 { /* * The interpreter is being deleted. Don't create any new commands; * it's not safe to muck with the interpreter anymore. */ return libc.UintptrFromInt32(0) } /* * Determine where the command should reside. If its name contains * namespace qualifiers, we put it in the specified namespace; * otherwise, we always put it in the global namespace. */ if libc.Xstrstr(tls, cmdName, __ccgo_ts+7650) != libc.UintptrFromInt32(0) { XTclGetNamespaceForQualName(tls, interp, cmdName, libc.UintptrFromInt32(0), int32(TCL_CREATE_NS_IF_UNKNOWN), bp, bp+16, bp+24, bp+8) if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) || *(*uintptr)(unsafe.Pointer(bp + 8)) == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } } else { *(*uintptr)(unsafe.Pointer(bp)) = (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr *(*uintptr)(unsafe.Pointer(bp + 8)) = cmdName } return XTclCreateObjCommandInNs(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp)), proc, clientData, deleteProc) } func XTclCreateObjCommandInNs(tls *libc.TLS, interp uintptr, cmdName uintptr, namesp uintptr, proc uintptr, clientData uintptr, deleteProc uintptr) (r TTcl_Command) { bp := tls.Alloc(16) defer tls.Free(16) /* If not NULL, gives a function to call when * this command is deleted. */ var cmdPtr, dataPtr, hPtr, nsPtr, oldRefPtr, refCmdPtr, v2, v4 uintptr var deleted int32 var v1, v3 TTcl_Size var _ /* isNew at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _ = cmdPtr, dataPtr, deleted, hPtr, nsPtr, oldRefPtr, refCmdPtr, v1, v2, v3, v4 deleted = 0 *(*int32)(unsafe.Pointer(bp)) = 0 oldRefPtr = libc.UintptrFromInt32(0) nsPtr = namesp /* * If the command name we seek to create already exists, we need to delete * that first. That can be tricky in the presence of traces. Loop until we * no longer find an existing command in the way, or until we've deleted * one command and that didn't finish the job. */ for int32(1) != 0 { hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(nsPtr + 184)).FcreateProc})))(tls, nsPtr+184, cmdName, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 || deleted != 0 { /* * isNew - No conflict with existing command. * deleted - We've already deleted a conflicting command */ break } /* * An existing command conflicts. Try to delete it... */ cmdPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData /* * Command already exists; delete it. Be careful to preserve any * existing import links so we can restore them down below. That way, * you can redefine a command and its import status will remain * intact. */ (*TCommand)(unsafe.Pointer(cmdPtr)).FrefCount++ if (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr != 0 { *(*int32)(unsafe.Pointer(cmdPtr + 88)) |= int32(CMD_REDEF_IN_PROGRESS) } /* * Make sure namespace doesn't get deallocated. */ (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FrefCount++ XTcl_DeleteCommandFromToken(tls, interp, cmdPtr) nsPtr = XTclEnsureNamespace(tls, interp, (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr) XTclNsDecrRefCount(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr) if (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_REDEF_IN_PROGRESS) != 0 { oldRefPtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr = libc.UintptrFromInt32(0) } v2 = cmdPtr + 16 v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclpFree(tls, cmdPtr) } deleted = int32(1) } if !(*(*int32)(unsafe.Pointer(bp)) != 0) { /* * If the deletion callback recreated the command, just throw away the * new command (if we try to delete it again, we could get stuck in an * infinite loop). */ XTclpFree(tls, (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData) } if !(deleted != 0) { /* * Command resolvers (per-interp, per-namespace) might have resolved * to a command for the given namespace scope with this command not * being registered with the namespace's command table. During BC * compilation, the so-resolved command turns into a CmdName literal. * Without invalidating a possible CmdName literal here explicitly, * such literals keep being reused while pointing to overhauled * commands. */ XTclInvalidateCmdLiteral(tls, interp, cmdName, nsPtr) /* * The list of command exported from the namespace might have changed. * However, we do not need to recompute this just yet; next time we * need the info will be soon enough. */ if (*TNamespace)(unsafe.Pointer(nsPtr)).FnumExportPatterns != 0 { (*TNamespace)(unsafe.Pointer(nsPtr)).FexportLookupEpoch++ } if (*TNamespace)(unsafe.Pointer(nsPtr)).FcommandPathLength != 0 { (*TNamespace)(unsafe.Pointer(nsPtr)).FcmdRefEpoch++ } XTclInvalidateNsPath(tls, nsPtr) } cmdPtr = XTcl_Alloc(tls, uint64(120)) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr = nsPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FrefCount = int64(1) (*TCommand)(unsafe.Pointer(cmdPtr)).FcmdEpoch = 0 (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc = libc.UintptrFromInt32(0) (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc = proc (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData = clientData (*TCommand)(unsafe.Pointer(cmdPtr)).Fproc = libc.UintptrFromInt32(0) (*TCommand)(unsafe.Pointer(cmdPtr)).FclientData = cmdPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc = deleteProc (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteData = clientData (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags = 0 (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr = libc.UintptrFromInt32(0) (*TCommand)(unsafe.Pointer(cmdPtr)).FtracePtr = libc.UintptrFromInt32(0) (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc = libc.UintptrFromInt32(0) /* * Plug in any existing import references found above. Be sure to update * all of these references to point to the new command. */ if oldRefPtr != libc.UintptrFromInt32(0) { (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr = oldRefPtr for oldRefPtr != libc.UintptrFromInt32(0) { refCmdPtr = (*TImportRef)(unsafe.Pointer(oldRefPtr)).FimportedCmdPtr dataPtr = (*TCommand)(unsafe.Pointer(refCmdPtr)).FobjClientData (*TCommand)(unsafe.Pointer(cmdPtr)).FrefCount++ v4 = (*TImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr + 16 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclpFree(tls, (*TImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr) } (*TImportedCmdData)(unsafe.Pointer(dataPtr)).FrealCmdPtr = cmdPtr oldRefPtr = (*TImportRef)(unsafe.Pointer(oldRefPtr)).FnextPtr } } /* * We just created a command, so in its namespace and all of its parent * namespaces, it may shadow global commands with the same name. If any * shadowed commands are found, invalidate all cached command references * in the affected namespaces. */ XTclResetShadowedCmdRefs(tls, interp, cmdPtr) return cmdPtr } /* *---------------------------------------------------------------------- * * InvokeStringCommand -- * * "Wrapper" Tcl_ObjCmdProc used to call an existing string-based * Tcl_CmdProc if no object-based function exists for a command. A * pointer to this function is stored as the Tcl_ObjCmdProc in a Command * structure. It simply turns around and calls the string Tcl_CmdProc in * the Command structure. * * Results: * A standard Tcl object result value. * * Side effects: * Besides those side effects of the called Tcl_CmdProc, * InvokeStringCommand allocates and frees storage. * *---------------------------------------------------------------------- */ func _InvokeStringCommand(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var argv, cmdPtr, v2 uintptr var i, result int32 _, _, _, _, _ = argv, cmdPtr, i, result, v2 cmdPtr = clientData argv = XTclStackAlloc(tls, interp, libc.Uint64FromInt32(objc+libc.Int32FromInt32(1))*uint64(8)) i = 0 for { if !(i < objc) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), libc.UintptrFromInt32(0)) } *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)) = v2 goto _1 _1: ; i++ } *(*uintptr)(unsafe.Pointer(argv + uintptr(objc)*8)) = uintptr(0) /* * Invoke the command's string-based Tcl_CmdProc. */ result = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TCommand)(unsafe.Pointer(cmdPtr)).Fproc})))(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FclientData, interp, objc, argv) XTclStackFree(tls, interp, argv) return result } /* *---------------------------------------------------------------------- * * TclRenameCommand -- * * Called to give an existing Tcl command a different name. Both the old * command name and the new command name can have "::" namespace * qualifiers. If the new command has a different namespace context, the * command will be moved to that namespace and will execute in the * context of that new namespace. * * If the new command name is NULL or the null string, the command is * deleted. * * Results: * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. * * Side effects: * If anything goes wrong, an error message is returned in the * interpreter's result object. * *---------------------------------------------------------------------- */ func XTclRenameCommand(tls *libc.TLS, interp uintptr, oldName uintptr, newName uintptr) (r int32) { bp := tls.Alloc(320) defer tls.Free(320) /* New command name. */ var cachePtr, cachePtr1, cmdNsPtr, cmdPtr, hPtr, iPtr, oldFullName, oldHPtr, v1, v3, v5, v7 uintptr var cmd TTcl_Command var result int32 var v2, v8 bool var v4, v6 TTcl_Size var _ /* dummy1 at bp+16 */ uintptr var _ /* dummy2 at bp+24 */ uintptr var _ /* isNew at bp+32 */ int32 var _ /* newFullName at bp+40 */ TTcl_DString var _ /* newNsPtr at bp+8 */ uintptr var _ /* newTail at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cmd, cmdNsPtr, cmdPtr, hPtr, iPtr, oldFullName, oldHPtr, result, v1, v2, v3, v4, v5, v6, v7, v8 iPtr = interp /* * Find the existing command. An error is returned if cmdName can't be * found. */ cmd = XTcl_FindCommand(tls, interp, oldName, libc.UintptrFromInt32(0), 0) cmdPtr = cmd if cmdPtr == libc.UintptrFromInt32(0) { if newName == libc.UintptrFromInt32(0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(newName))) == int32('\000') { v1 = __ccgo_ts + 5663 } else { v1 = __ccgo_ts + 5364 } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+8081, libc.VaList(bp+272, v1, oldName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+272, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+8118, oldName, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * If the new command name is NULL or empty, delete the command. Do this * with Tcl_DeleteCommandFromToken, since we already have the command. */ if newName == libc.UintptrFromInt32(0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(newName))) == int32('\000') { XTcl_DeleteCommandFromToken(tls, interp, cmd) return TCL_OK } cmdNsPtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { oldFullName = XTclThreadAllocObj(tls) } else { oldFullName = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldFullName + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(oldFullName)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(oldFullName)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(oldFullName)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(oldFullName)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(oldFullName)).FrefCount++ XTcl_GetCommandFullName(tls, interp, cmd, oldFullName) /* * Make sure that the destination command does not already exist. The * rename operation is like creating a command, so we should automatically * create the containing namespaces just like Tcl_CreateObjCommand would. */ XTclGetNamespaceForQualName(tls, interp, newName, libc.UintptrFromInt32(0), int32(TCL_CREATE_NS_IF_UNKNOWN), bp+8, bp+16, bp+24, bp) if *(*uintptr)(unsafe.Pointer(bp + 8)) == libc.UintptrFromInt32(0) || *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+8126, libc.VaList(bp+272, newName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+272, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+8118, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } if (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 184)).FfindProc})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8))+184, *(*uintptr)(unsafe.Pointer(bp))) != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+8165, libc.VaList(bp+272, newName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+272, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+8220, __ccgo_ts+8227, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } /* * Warning: any changes done in the code here are likely to be needed in * Tcl_HideCommand code too (until the common parts are extracted out). * - dl */ /* * Put the command in the new namespace so we can check for an alias loop. * Since we are adding a new command to a namespace, we must handle any * shadowing of the global commands that this might create. */ oldHPtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 184)).FcreateProc})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8))+184, *(*uintptr)(unsafe.Pointer(bp)), bp+32) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = hPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) XTclResetShadowedCmdRefs(tls, interp, cmdPtr) /* * Now check for an alias loop. If we detect one, put everything back the * way it was and report the error. */ result = XTclPreventAliasLoop(tls, interp, interp, cmdPtr) if result != TCL_OK { XTcl_DeleteHashEntry(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr) (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = oldHPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr = cmdNsPtr goto done } /* * The list of command exported from the namespace might have changed. * However, we do not need to recompute this just yet; next time we need * the info will be soon enough. These might refer to the same variable, * but that's no big deal. */ if (*TNamespace)(unsafe.Pointer(cmdNsPtr)).FnumExportPatterns != 0 { (*TNamespace)(unsafe.Pointer(cmdNsPtr)).FexportLookupEpoch++ } if (*TNamespace)(unsafe.Pointer(cmdNsPtr)).FcommandPathLength != 0 { (*TNamespace)(unsafe.Pointer(cmdNsPtr)).FcmdRefEpoch++ } if (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FnumExportPatterns != 0 { (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FexportLookupEpoch++ } if (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcommandPathLength != 0 { (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcmdRefEpoch++ } /* * Command resolvers (per-interp, per-namespace) might have resolved to a * command for the given namespace scope with this command not being * registered with the namespace's command table. During BC compilation, * the so-resolved command turns into a CmdName literal. Without * invalidating a possible CmdName literal here explicitly, such literals * keep being reused while pointing to overhauled commands. */ XTclInvalidateCmdLiteral(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr) /* * Script for rename traces can delete the command "oldName". Therefore * increment the reference count for cmdPtr so that it's Command structure * is freed only towards the end of this function by calling * TclCleanupCommand. * * The trace function needs to get a fully qualified name for old and new * commands [Tcl bug #651271], or else there's no way for the trace * function to get the namespace from which the old command is being * renamed! */ XTcl_DStringInit(tls, bp+40) XTcl_DStringAppend(tls, bp+40, (*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FfullName, int64(-libc.Int32FromInt32(1))) if *(*uintptr)(unsafe.Pointer(bp + 8)) != (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr { XTcl_DStringAppend(tls, bp+40, __ccgo_ts+7650, libc.Int64FromUint64(libc.Uint64FromInt64(3)-libc.Uint64FromInt32(1))) } XTcl_DStringAppend(tls, bp+40, *(*uintptr)(unsafe.Pointer(bp)), int64(-libc.Int32FromInt32(1))) (*TCommand)(unsafe.Pointer(cmdPtr)).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(oldFullName)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(oldFullName)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, oldFullName, libc.UintptrFromInt32(0)) } _CallCommandTraces(tls, iPtr, cmdPtr, v3, (*TTcl_DString)(unsafe.Pointer(bp+40)).Fstring1, int32(TCL_TRACE_RENAME)) XTcl_DStringFree(tls, bp+40) /* * The new command name is okay, so remove the command from its current * namespace. This is like deleting the command, so bump the cmdEpoch to * invalidate any cached references to the command. */ XTcl_DeleteHashEntry(tls, oldHPtr) (*TCommand)(unsafe.Pointer(cmdPtr)).FcmdEpoch++ /* * If the command being renamed has a compile function, increment the * interpreter's compileEpoch to invalidate its compiled code. This makes * sure that we don't later try to execute old code compiled for the * now-renamed command. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc != libc.UintptrFromInt32(0) { (*TInterp)(unsafe.Pointer(iPtr)).FcompileEpoch++ } /* * Now free the Command structure, if the "oldName" command has been * deleted by invocation of rename traces. */ v5 = cmdPtr + 16 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclpFree(tls, cmdPtr) } result = TCL_OK goto done done: ; v7 = oldFullName v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if !(v6 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(oldFullName)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(oldFullName)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(oldFullName)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(oldFullName)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(oldFullName)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(oldFullName)).Flength = int64(-libc.Int32FromInt32(1)) if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, oldFullName) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldFullName + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = oldFullName (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, oldFullName) } } return result } /* *---------------------------------------------------------------------- * * Tcl_SetCommandInfo -- * * Modifies various information about a Tcl command. Note that this * function will not change a command's namespace; use TclRenameCommand * to do that. Also, the isNativeObjectProc member of *infoPtr is * ignored. * * Results: * If cmdName exists in interp, then the information at *infoPtr is * stored with the command in place of the current information and 1 is * returned. If the command doesn't exist then 0 is returned. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_SetCommandInfo(tls *libc.TLS, interp uintptr, cmdName uintptr, infoPtr uintptr) (r int32) { /* Where to find information to store in the * command. */ var cmd TTcl_Command _ = cmd cmd = XTcl_FindCommand(tls, interp, cmdName, libc.UintptrFromInt32(0), 0) return XTcl_SetCommandInfoFromToken(tls, cmd, infoPtr) } /* *---------------------------------------------------------------------- * * Tcl_SetCommandInfoFromToken -- * * Modifies various information about a Tcl command. Note that this * function will not change a command's namespace; use TclRenameCommand * to do that. Also, the isNativeObjectProc member of *infoPtr is * ignored. * * Results: * If cmdName exists in interp, then the information at *infoPtr is * stored with the command in place of the current information and 1 is * returned. If the command doesn't exist then 0 is returned. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _invokeObj2Command(tls *libc.TLS, clientData uintptr, interp uintptr, objc TTcl_Size, objv uintptr) (r int32) { /* Argument objects. */ var cmdPtr uintptr var result int32 _, _ = cmdPtr, result cmdPtr = clientData if objc > int64(INT_MAX) { return XTclCommandWordLimitError(tls, interp, objc) } if (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc != libc.UintptrFromInt32(0) { result = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc})))(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData, interp, int32(objc), objv) } else { result = XTcl_NRCallObjProc(tls, interp, (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc, (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData, objc, objv) } return result } func _cmdWrapper2Proc(tls *libc.TLS, clientData uintptr, interp uintptr, objc TTcl_Size, objv uintptr) (r int32) { var cmdPtr uintptr _ = cmdPtr cmdPtr = clientData if objc > int64(INT_MAX) { return XTclCommandWordLimitError(tls, interp, objc) } return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc})))(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData, interp, int32(objc), objv) } func XTcl_SetCommandInfoFromToken(tls *libc.TLS, cmd TTcl_Command, infoPtr uintptr) (r int32) { var cmdPtr, info, info1 uintptr _, _, _ = cmdPtr, info, info1 /* Internal representation of the command */ if cmd == libc.UintptrFromInt32(0) { return 0 } /* * The isNativeObjectProc and nsPtr members of *infoPtr are ignored. */ cmdPtr = cmd (*TCommand)(unsafe.Pointer(cmdPtr)).Fproc = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).Fproc (*TCommand)(unsafe.Pointer(cmdPtr)).FclientData = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FclientData if (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc == libc.UintptrFromInt32(0) { (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc = __ccgo_fp(_InvokeStringCommand) (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData = cmdPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc = libc.UintptrFromInt32(0) } else { if (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc != (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc { (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc = libc.UintptrFromInt32(0) (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc } (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjClientData } if (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc == __ccgo_fp(_cmdWrapperDeleteProc) { info = (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteData if (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc2 == libc.UintptrFromInt32(0) { (*TCmdWrapperInfo)(unsafe.Pointer(info)).Fproc = __ccgo_fp(_invokeObj2Command) (*TCmdWrapperInfo)(unsafe.Pointer(info)).FclientData = cmdPtr (*TCmdWrapperInfo)(unsafe.Pointer(info)).FnreProc = libc.UintptrFromInt32(0) } else { if (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc2 != (*TCmdWrapperInfo)(unsafe.Pointer(info)).Fproc { (*TCmdWrapperInfo)(unsafe.Pointer(info)).FnreProc = libc.UintptrFromInt32(0) (*TCmdWrapperInfo)(unsafe.Pointer(info)).Fproc = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc2 } (*TCmdWrapperInfo)(unsafe.Pointer(info)).FclientData = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjClientData2 } (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteProc = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteProc (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteData = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteData } else { if (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc2 != libc.UintptrFromInt32(0) && (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc2 != __ccgo_fp(_cmdWrapper2Proc) { info1 = XTcl_Alloc(tls, uint64(40)) (*TCmdWrapperInfo)(unsafe.Pointer(info1)).Fproc = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc2 (*TCmdWrapperInfo)(unsafe.Pointer(info1)).FclientData = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjClientData2 (*TCmdWrapperInfo)(unsafe.Pointer(info1)).FnreProc = libc.UintptrFromInt32(0) (*TCmdWrapperInfo)(unsafe.Pointer(info1)).FdeleteProc = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteProc (*TCmdWrapperInfo)(unsafe.Pointer(info1)).FdeleteData = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteData (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc = __ccgo_fp(_cmdWrapperDeleteProc) (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteData = info1 } else { (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteProc (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteData = (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteData } } return int32(1) } /* *---------------------------------------------------------------------- * * Tcl_GetCommandInfo -- * * Returns various information about a Tcl command. * * Results: * If cmdName exists in interp, then *infoPtr is modified to hold * information about cmdName and 1 is returned. If the command doesn't * exist then 0 is returned and *infoPtr isn't modified. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_GetCommandInfo(tls *libc.TLS, interp uintptr, cmdName uintptr, infoPtr uintptr) (r int32) { /* Where to store information about * command. */ var cmd TTcl_Command _ = cmd cmd = XTcl_FindCommand(tls, interp, cmdName, libc.UintptrFromInt32(0), 0) return XTcl_GetCommandInfoFromToken(tls, cmd, infoPtr) } /* *---------------------------------------------------------------------- * * Tcl_GetCommandInfoFromToken -- * * Returns various information about a Tcl command. * * Results: * Copies information from the command identified by 'cmd' into a * caller-supplied structure and returns 1. If the 'cmd' is NULL, leaves * the structure untouched and returns 0. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_GetCommandInfoFromToken(tls *libc.TLS, cmd TTcl_Command, infoPtr uintptr) (r int32) { var cmdPtr, info uintptr _, _ = cmdPtr, info /* Internal representation of the command */ if cmd == libc.UintptrFromInt32(0) { return 0 } /* * Set isNativeObjectProc 1 if objProc was registered by a call to * Tcl_CreateObjCommand. Set isNativeObjectProc 2 if objProc was * registered by a call to Tcl_CreateObjCommand2. Otherwise set it to 0. */ cmdPtr = cmd (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FisNativeObjectProc = libc.BoolInt32((*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc != __ccgo_fp(_InvokeStringCommand)) (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc = (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjClientData = (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).Fproc = (*TCommand)(unsafe.Pointer(cmdPtr)).Fproc (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FclientData = (*TCommand)(unsafe.Pointer(cmdPtr)).FclientData if (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc == __ccgo_fp(_cmdWrapperDeleteProc) { info = (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteData (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteProc = (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteProc (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteData = (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteData (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc2 = (*TCmdWrapperInfo)(unsafe.Pointer(info)).Fproc (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjClientData2 = (*TCmdWrapperInfo)(unsafe.Pointer(info)).FclientData if (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc == __ccgo_fp(_cmdWrapperProc) { (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FisNativeObjectProc = int32(2) } } else { (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteProc = (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FdeleteData = (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteData (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjProc2 = __ccgo_fp(_cmdWrapper2Proc) (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FobjClientData2 = cmdPtr } (*TTcl_CmdInfo)(unsafe.Pointer(infoPtr)).FnamespacePtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr return int32(1) } /* *---------------------------------------------------------------------- * * Tcl_GetCommandName -- * * Given a token returned by Tcl_CreateObjCommand, this function returns the * current name of the command (which may have changed due to renaming). * * Results: * The return value is the name of the given command. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_GetCommandName(tls *libc.TLS, dummy3505 uintptr, command TTcl_Command) (r uintptr) { /* Token for command returned by a previous * call to Tcl_CreateObjCommand. The command must * not have been deleted. */ var cmdPtr, v1 uintptr _, _ = cmdPtr, v1 cmdPtr = command if cmdPtr == libc.UintptrFromInt32(0) || (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr == libc.UintptrFromInt32(0) { /* * This should only happen if command was "created" after the * interpreter began to be deleted, so there isn't really any command. * Just return an empty string. */ return __ccgo_ts + 1945 } if (*TTcl_HashTable)(unsafe.Pointer((*TTcl_HashEntry)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr)).FtablePtr)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer((*TTcl_HashEntry)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr)).FtablePtr)).FkeyType == -int32(1) { v1 = *(*uintptr)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr + 32)) } else { v1 = (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr + 32 } return v1 } /* *---------------------------------------------------------------------- * * Tcl_GetCommandFullName -- * * Given a token returned by, e.g., Tcl_CreateObjCommand or Tcl_FindCommand, * this function appends to an object the command's full name, qualified * by a sequence of parent namespace names. The command's fully-qualified * name may have changed due to renaming. * * Results: * None. * * Side effects: * The command's fully-qualified name is appended to the string * representation of objPtr. * *---------------------------------------------------------------------- */ func XTcl_GetCommandFullName(tls *libc.TLS, interp uintptr, command TTcl_Command, objPtr uintptr) { /* Points to the object onto which the * command's full name is appended. */ var cmdPtr, iPtr, name, v1 uintptr _, _, _, _ = cmdPtr, iPtr, name, v1 iPtr = interp cmdPtr = command /* * Add the full name of the containing namespace, followed by the "::" * separator, and the command name. */ if cmdPtr != libc.UintptrFromInt32(0) && (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr != libc.UintptrFromInt32(0) { if (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr != libc.UintptrFromInt32(0) { XTcl_AppendToObj(tls, objPtr, (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FfullName, int64(-libc.Int32FromInt32(1))) if (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr != (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr { XTcl_AppendToObj(tls, objPtr, __ccgo_ts+7650, int64(2)) } } if (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer((*TTcl_HashEntry)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr)).FtablePtr)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer((*TTcl_HashEntry)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr)).FtablePtr)).FkeyType == -int32(1) { v1 = *(*uintptr)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr + 32)) } else { v1 = (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr + 32 } name = v1 XTcl_AppendToObj(tls, objPtr, name, int64(-libc.Int32FromInt32(1))) } } } /* *---------------------------------------------------------------------- * * Tcl_DeleteCommand -- * * Remove the given command from the given interpreter. * * Results: * 0 is returned if the command was deleted successfully. -1 is returned * if there didn't exist a command by that name. * * Side effects: * cmdName will no longer be recognized as a valid command for interp. * *---------------------------------------------------------------------- */ func XTcl_DeleteCommand(tls *libc.TLS, interp uintptr, cmdName uintptr) (r int32) { /* Name of command to remove. */ var cmd TTcl_Command _ = cmd /* * Find the desired command and delete it. */ cmd = XTcl_FindCommand(tls, interp, cmdName, libc.UintptrFromInt32(0), 0) if cmd == libc.UintptrFromInt32(0) { return -int32(1) } return XTcl_DeleteCommandFromToken(tls, interp, cmd) } /* *---------------------------------------------------------------------- * * Tcl_DeleteCommandFromToken -- * * Removes the given command from the given interpreter. This function * resembles Tcl_DeleteCommand, but takes a Tcl_Command token instead of * a command name for efficiency. * * Results: * 0 is returned if the command was deleted successfully. -1 is returned * if there didn't exist a command by that name. * * Side effects: * The command specified by "cmd" will no longer be recognized as a valid * command for "interp". * *---------------------------------------------------------------------- */ func XTcl_DeleteCommandFromToken(tls *libc.TLS, interp uintptr, cmd TTcl_Command) (r int32) { /* Token for command to delete. */ var cmdPtr, iPtr, nextPtr, nextRefPtr, refPtr, tracePtr, v2, v5 uintptr var importCmd TTcl_Command var v1, v4 TTcl_Size _, _, _, _, _, _, _, _, _, _, _ = cmdPtr, iPtr, importCmd, nextPtr, nextRefPtr, refPtr, tracePtr, v1, v2, v4, v5 iPtr = interp cmdPtr = cmd /* * The code here is tricky. We can't delete the hash table entry before * invoking the deletion callback because there are cases where the * deletion callback needs to invoke the command (e.g. object systems such * as OTcl). However, this means that the callback could try to delete or * rename the command. The deleted flag allows us to detect these cases * and skip nested deletes. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_DYING) != 0 { /* * Another deletion is already in progress. Remove the hash table * entry now, but don't invoke a callback or free the command * structure. Take care to only remove the hash entry if it has not * already been removed; otherwise if we manage to hit this function * three times, everything goes up in smoke. [Bug 1220058] */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr != libc.UintptrFromInt32(0) { XTcl_DeleteHashEntry(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr) (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = libc.UintptrFromInt32(0) } /* * Bump the command epoch counter. This will invalidate all cached * references that point to this command. */ (*TCommand)(unsafe.Pointer(cmdPtr)).FcmdEpoch++ return 0 } /* * We must delete this command, even though both traces and delete procs * may try to avoid this (renaming the command etc). Also traces and * delete procs may try to delete the command themselves. This flag * declares that a delete is in progress and that recursive deletes should * be ignored. */ *(*int32)(unsafe.Pointer(cmdPtr + 88)) |= int32(CMD_DYING) /* * Call each functions and then delete the trace. */ (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FrefCount++ if (*TCommand)(unsafe.Pointer(cmdPtr)).FtracePtr != libc.UintptrFromInt32(0) { /* CallCommandTraces() does not cmdPtr, that's * done just before Tcl_DeleteCommandFromToken() returns */ _CallCommandTraces(tls, iPtr, cmdPtr, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), int32(TCL_TRACE_DELETE)) /* * Now delete these traces. */ tracePtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FtracePtr for tracePtr != libc.UintptrFromInt32(0) { nextPtr = (*TCommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr v2 = tracePtr + 32 v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclpFree(tls, tracePtr) } tracePtr = nextPtr } (*TCommand)(unsafe.Pointer(cmdPtr)).FtracePtr = libc.UintptrFromInt32(0) } /* * The list of commands exported from the namespace might have changed. * However, we do not need to recompute this just yet; next time we need * the info will be soon enough. */ if (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FnumExportPatterns != 0 { (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FexportLookupEpoch++ } if (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcommandPathLength != 0 { (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).FcmdRefEpoch++ } XTclNsDecrRefCount(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr) /* * If the command being deleted has a compile function, increment the * interpreter's compileEpoch to invalidate its compiled code. This makes * sure that we don't later try to execute old code compiled with * command-specific (i.e., inline) bytecodes for the now-deleted command. * This field is checked in Tcl_EvalObj and ObjInterpProc, and code whose * compilation epoch doesn't match is recompiled. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc != libc.UintptrFromInt32(0) { (*TInterp)(unsafe.Pointer(iPtr)).FcompileEpoch++ } if !((*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&libc.Int32FromInt32(CMD_REDEF_IN_PROGRESS) != 0) { /* * Delete any imports of this routine before deleting this routine itself. * See issue 688fcc7082fa. */ refPtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FimportRefPtr for { if !(refPtr != libc.UintptrFromInt32(0)) { break } nextRefPtr = (*TImportRef)(unsafe.Pointer(refPtr)).FnextPtr importCmd = (*TImportRef)(unsafe.Pointer(refPtr)).FimportedCmdPtr XTcl_DeleteCommandFromToken(tls, interp, importCmd) goto _3 _3: ; refPtr = nextRefPtr } } if (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc != libc.UintptrFromInt32(0) { /* * Delete the command's client data. If this was an imported command * created when a command was imported into a namespace, this client * data will be a pointer to a ImportedCmdData structure describing * the "real" command that this imported command refers to. * * If you are getting a crash during the call to deleteProc and * cmdPtr->deleteProc is a pointer to the function free(), the most * likely cause is that your extension allocated memory for the * clientData argument to Tcl_CreateObjCommand with the Tcl_Alloc() * macro and you are now trying to deallocate this memory with free() * instead of Tcl_Free(). You should pass a pointer to your own method * that calls Tcl_Free(). */ (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc})))(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteData) } /* * Don't use hPtr to delete the hash entry here, because it's possible * that the deletion callback renamed the command. Instead, use * cmdPtr->hptr, and make sure that no-one else has already deleted the * hash entry. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr != libc.UintptrFromInt32(0) { XTcl_DeleteHashEntry(tls, (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr) (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr = libc.UintptrFromInt32(0) /* * Bump the command epoch counter. This will invalidate all cached * references that point to this command. */ (*TCommand)(unsafe.Pointer(cmdPtr)).FcmdEpoch++ } /* * A number of tests for particular kinds of commands are done by checking * whether the objProc field holds a known value. Set the field to NULL so * that such tests won't have false positives when applied to deleted * commands. */ (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc = libc.UintptrFromInt32(0) /* * Now free the Command structure, unless there is another reference to it * from a CmdName Tcl object in some ByteCode code sequence. In that case, * delay the cleanup until all references are either discarded (when a * ByteCode is freed) or replaced by a new reference (when a cached * CmdName Command reference is found to be invalid and * TclNRExecuteByteCode looks up the command in the command hashtable). */ *(*int32)(unsafe.Pointer(cmdPtr + 88)) |= int32(CMD_DEAD) v5 = cmdPtr + 16 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclpFree(tls, cmdPtr) } return 0 } /* *---------------------------------------------------------------------- * * CallCommandTraces -- * * Abstraction of the code to call traces on a command. * * Results: * Currently always NULL. * * Side effects: * Anything; this may recursively evaluate scripts and code exists to do * just that. * *---------------------------------------------------------------------- */ func _CallCommandTraces(tls *libc.TLS, iPtr uintptr, cmdPtr uintptr, oldName uintptr, newName uintptr, flags int32) (r uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* Flags indicating the type of traces to * trigger, either TCL_TRACE_DELETE or * TCL_TRACE_RENAME. */ var cachePtr, cachePtr1, oldNamePtr, result, tracePtr, v3, v5, v7 uintptr var state TTcl_InterpState var v2, v8 bool var v4, v6 TTcl_Size var _ /* active at bp+0 */ TActiveCommandTrace _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, oldNamePtr, result, state, tracePtr, v2, v3, v4, v5, v6, v7, v8 oldNamePtr = libc.UintptrFromInt32(0) state = libc.UintptrFromInt32(0) if (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_TRACE_ACTIVE) != 0 { /* * While a rename trace is active, we will not process any more rename * traces; while a delete trace is active we will never reach here - * because Tcl_DeleteCommandFromToken checks for the condition * (cmdPtr->flags & CMD_DYING) and returns immediately when a * command deletion is in progress. For all other traces, delete * traces will not be invoked but a call to TraceCommandProc will * ensure that tracePtr->clientData is freed whenever the command * "oldName" is deleted. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(TCL_TRACE_RENAME) != 0 { flags &= ^libc.Int32FromInt32(TCL_TRACE_RENAME) } if flags == 0 { return libc.UintptrFromInt32(0) } } *(*int32)(unsafe.Pointer(cmdPtr + 88)) |= int32(CMD_TRACE_ACTIVE) result = libc.UintptrFromInt32(0) (*(*TActiveCommandTrace)(unsafe.Pointer(bp))).FnextPtr = (*TInterp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr (*(*TActiveCommandTrace)(unsafe.Pointer(bp))).FreverseScan = 0 (*TInterp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr = bp if flags&int32(TCL_TRACE_DELETE) != 0 { flags |= int32(TCL_TRACE_DESTROYED) } (*(*TActiveCommandTrace)(unsafe.Pointer(bp))).FcmdPtr = cmdPtr XTcl_Preserve(tls, iPtr) tracePtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FtracePtr for { if !(tracePtr != libc.UintptrFromInt32(0)) { break } (*(*TActiveCommandTrace)(unsafe.Pointer(bp))).FnextTracePtr = (*TCommandTrace)(unsafe.Pointer(tracePtr)).FnextPtr if !((*TCommandTrace)(unsafe.Pointer(tracePtr)).Fflags&flags != 0) { goto _1 } *(*int32)(unsafe.Pointer(cmdPtr + 88)) |= (*TCommandTrace)(unsafe.Pointer(tracePtr)).Fflags if oldName == libc.UintptrFromInt32(0) { if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { oldNamePtr = XTclThreadAllocObj(tls) } else { oldNamePtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldNamePtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).FrefCount++ XTcl_GetCommandFullName(tls, iPtr, cmdPtr, oldNamePtr) if (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, oldNamePtr, libc.UintptrFromInt32(0)) } oldName = v3 } (*TCommandTrace)(unsafe.Pointer(tracePtr)).FrefCount++ if state == libc.UintptrFromInt32(0) { state = XTcl_SaveInterpState(tls, iPtr, TCL_OK) } (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TCommandTrace)(unsafe.Pointer(tracePtr)).FtraceProc})))(tls, (*TCommandTrace)(unsafe.Pointer(tracePtr)).FclientData, iPtr, oldName, newName, flags) *(*int32)(unsafe.Pointer(cmdPtr + 88)) &= ^(*TCommandTrace)(unsafe.Pointer(tracePtr)).Fflags v5 = tracePtr + 32 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclpFree(tls, tracePtr) } goto _1 _1: ; tracePtr = (*(*TActiveCommandTrace)(unsafe.Pointer(bp))).FnextTracePtr } if state != 0 { XTcl_RestoreInterpState(tls, iPtr, state) } /* * If a new object was created to hold the full oldName, free it now. */ if oldNamePtr != libc.UintptrFromInt32(0) { v7 = oldNamePtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if !(v6 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(oldNamePtr)).Flength = int64(-libc.Int32FromInt32(1)) if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, oldNamePtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldNamePtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = oldNamePtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, oldNamePtr) } } } /* * Restore the variable's flags, remove the record of our active traces, * and then return. */ *(*int32)(unsafe.Pointer(cmdPtr + 88)) &= ^libc.Int32FromInt32(CMD_TRACE_ACTIVE) (*TInterp)(unsafe.Pointer(iPtr)).FactiveCmdTracePtr = (*(*TActiveCommandTrace)(unsafe.Pointer(bp))).FnextPtr XTcl_Release(tls, iPtr) return result } /* *---------------------------------------------------------------------- * * CancelEvalProc -- * * Marks this interpreter as being canceled. This causes current * executions to be unwound as the interpreter enters a state where it * refuses to execute more commands or handle [catch] or [try], yet the * interpreter is still able to execute further commands after the * cancelation is cleared (unlike if it is deleted). * * Results: * The value given for the code argument. * * Side effects: * Transfers a message from the cancellation message to the interpreter. * *---------------------------------------------------------------------- */ func _CancelEvalProc(tls *libc.TLS, clientData uintptr, dummy3952 uintptr, code int32) (r int32) { /* Current return code from command. */ var cancelInfo, iPtr uintptr _, _ = cancelInfo, iPtr cancelInfo = clientData if cancelInfo != libc.UintptrFromInt32(0) { XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_cancelLock))) iPtr = (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Finterp if iPtr != libc.UintptrFromInt32(0) { /* * Setting the CANCELED flag will cause the script in progress to * be canceled as soon as possible. The core honors this flag at * all the necessary places to ensure script cancellation is * responsive. Extensions can check for this flag by calling * Tcl_Canceled and checking if TCL_ERROR is returned or they can * choose to ignore the script cancellation flag and the * associated functionality altogether. Currently, the only other * flag we care about here is the TCL_CANCEL_UNWIND flag (from * Tcl_CancelEval). We do not want to simply combine all the flags * from original Tcl_CancelEval call with the interp flags here * just in case the caller passed flags that might cause behaviour * unrelated to script cancellation. */ *(*int32)(unsafe.Pointer(iPtr + 368)) |= int32(CANCELED) if ((*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fflags|int32(CANCELED))&int32(TCL_CANCEL_UNWIND) != 0 { *(*int32)(unsafe.Pointer(iPtr + 368)) |= int32(TCL_CANCEL_UNWIND) } /* * Now, we must set the script cancellation flags on all the child * interpreters belonging to this one. */ XTclSetChildCancelFlags(tls, iPtr, (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fflags|int32(CANCELED), 0) /* * Create the result object now so that Tcl_Canceled can avoid * locking the cancelLock mutex. */ if (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fresult != libc.UintptrFromInt32(0) { XTcl_SetStringObj(tls, (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg, (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fresult, (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Flength) } else { XTcl_SetObjLength(tls, (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg, 0) } } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_cancelLock))) } return code } /* *---------------------------------------------------------------------- * * TclCleanupCommand -- * * This function frees up a Command structure unless it is still * referenced from an interpreter's command hashtable or from a CmdName * Tcl object representing the name of a command in a ByteCode * instruction sequence. * * Results: * None. * * Side effects: * Memory gets freed unless a reference to the Command structure still * exists. In that case the cleanup is delayed until the command is * deleted or when the last ByteCode referring to it is freed. * *---------------------------------------------------------------------- */ func XTclCleanupCommand(tls *libc.TLS, cmdPtr uintptr) { /* Points to the Command structure to * be freed. */ var v1 TTcl_Size var v2 uintptr _, _ = v1, v2 v2 = cmdPtr + 16 v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclpFree(tls, cmdPtr) } } /* *---------------------------------------------------------------------- * * TclInterpReady -- * * Check if an interpreter is ready to eval commands or scripts, i.e., if * it was not deleted and if the nesting level is not too high. * * Results: * The return value is TCL_OK if it the interpreter is ready, TCL_ERROR * otherwise. * * Side effects: * The interpreter's result is cleared. * *---------------------------------------------------------------------- */ func XTclInterpReady(tls *libc.TLS, interp uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var iPtr uintptr _ = iPtr iPtr = interp /* * Reset the interpreter's result and clear out any previous error * information. */ XTcl_ResetResult(tls, interp) /* * If the interpreter has been deleted, return an error. */ if (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(DELETED) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+8241, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+8285, __ccgo_ts+8241, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } if (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).Frewind != 0 { return int32(TCL_ERROR) } /* * Make sure the script being evaluated (if any) has not been canceled. */ if ((*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(CANCELED) != 0 || (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(TCL_CANCEL_UNWIND) != 0) && TCL_OK != XTcl_Canceled(tls, interp, int32(TCL_LEAVE_ERR_MSG)) { return int32(TCL_ERROR) } /* * Check depth of nested calls to Tcl_Eval: if this gets too large, it's * probably because of an infinite loop somewhere. */ if (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels <= (*TInterp)(unsafe.Pointer(iPtr)).FmaxNestingDepth { return TCL_OK } XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+8293, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+8338, __ccgo_ts+8344, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * TclResetCancellation -- * * Reset the script cancellation flags if the nesting level * (iPtr->numLevels) for the interp is zero or argument force is * non-zero. * * Results: * A standard Tcl result. * * Side effects: * The script cancellation flags for the interp may be reset. * *---------------------------------------------------------------------- */ func XTclResetCancellation(tls *libc.TLS, interp uintptr, force int32) (r int32) { var iPtr uintptr _ = iPtr iPtr = interp if iPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if force != 0 || (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels == 0 { *(*int32)(unsafe.Pointer(iPtr + 368)) &= ^(libc.Int32FromInt32(CANCELED) | libc.Int32FromInt32(TCL_CANCEL_UNWIND)) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_Canceled -- * * Check if the script in progress has been canceled, i.e., * Tcl_CancelEval was called for this interpreter or any of its parent * interpreters. * * Results: * The return value is TCL_OK if the script evaluation has not been * canceled, TCL_ERROR otherwise. * * If "flags" contains TCL_LEAVE_ERR_MSG, an error message is returned in * the interpreter's result object. Otherwise, the interpreter's result * object is left unchanged. If "flags" contains TCL_CANCEL_UNWIND, * TCL_ERROR will only be returned if the script evaluation is being * completely unwound. * * Side effects: * The CANCELED flag for the interp will be reset if it is set. * *---------------------------------------------------------------------- */ func XTcl_Canceled(tls *libc.TLS, interp uintptr, flags int32) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var iPtr, id, message, v1 uintptr var _ /* length at bp+0 */ TTcl_Size _, _, _, _ = iPtr, id, message, v1 iPtr = interp /* * Has the current script in progress for this interpreter been canceled * or is the stack being unwound due to the previous script cancellation? */ if !((*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(CANCELED) != 0 || (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(TCL_CANCEL_UNWIND) != 0) { return TCL_OK } /* * The CANCELED flag is a one-shot flag that is reset immediately upon * being detected; however, if the TCL_CANCEL_UNWIND flag is set we will * continue to report that the script in progress has been canceled * thereby allowing the evaluation stack for the interp to be fully * unwound. */ *(*int32)(unsafe.Pointer(iPtr + 368)) &= ^libc.Int32FromInt32(CANCELED) /* * The CANCELED flag was detected and reset; however, if the caller * specified the TCL_CANCEL_UNWIND flag, we only return TCL_ERROR * (indicating that the script in progress has been canceled) if the * evaluation stack for the interp is being fully unwound. */ if flags&int32(TCL_CANCEL_UNWIND) != 0 && !((*TInterp)(unsafe.Pointer(iPtr)).Fflags&libc.Int32FromInt32(TCL_CANCEL_UNWIND) != 0) { return TCL_OK } /* * If the TCL_LEAVE_ERR_MSG flags bit is set, place an error in the * interp's result; otherwise, we leave it alone. */ if flags&int32(TCL_LEAVE_ERR_MSG) != 0 { message = libc.UintptrFromInt32(0) /* * Setup errorCode variables so that we can differentiate between * being canceled and unwound. */ if (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, (*TInterp)(unsafe.Pointer(iPtr)).FasyncCancelMsg, bp) } message = v1 } else { *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 } if (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(TCL_CANCEL_UNWIND) != 0 { id = __ccgo_ts + 8350 if *(*TTcl_Size)(unsafe.Pointer(bp)) == 0 { message = __ccgo_ts + 8358 } } else { id = __ccgo_ts + 8371 if *(*TTcl_Size)(unsafe.Pointer(bp)) == 0 { message = __ccgo_ts + 8379 } } XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, message, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+8393, id, message, libc.UintptrFromInt32(0))) } /* * Return TCL_ERROR to the caller (not necessarily just the Tcl core * itself) that indicates further processing of the script or command in * progress should halt gracefully and as soon as possible. */ return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * Tcl_CancelEval -- * * This function schedules the cancellation of the current script in the * given interpreter. * * Results: * The return value is a standard Tcl completion code such as TCL_OK or * TCL_ERROR. Since the interp may belong to a different thread, no error * message can be left in the interp's result. * * Side effects: * The script in progress in the specified interpreter will be canceled * with TCL_ERROR after asynchronous handlers are invoked at the next * Tcl_Canceled check. * *---------------------------------------------------------------------- */ func XTcl_CancelEval(tls *libc.TLS, interp uintptr, resultObjPtr uintptr, clientData uintptr, flags int32) (r int32) { /* Collection of OR-ed bits that control * the cancellation of the script. Only * TCL_CANCEL_UNWIND is currently * supported. */ var cachePtr, cancelInfo, hPtr, result, v1, v3 uintptr var code int32 var v2 TTcl_Size var v4 bool _, _, _, _, _, _, _, _, _ = cachePtr, cancelInfo, code, hPtr, result, v1, v2, v3, v4 code = int32(TCL_ERROR) if interp == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_cancelLock))) if _cancelTableInitialized != int32(1) { /* * No CancelInfo hash table (Tcl_CreateInterp has never been called?) */ goto done } hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&_cancelTable)))).FfindProc})))(tls, uintptr(unsafe.Pointer(&_cancelTable)), interp) if hPtr == libc.UintptrFromInt32(0) { /* * No CancelInfo record for this interpreter. */ goto done } cancelInfo = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData /* * Populate information needed by the interpreter thread to fulfill the * cancellation request. Currently, clientData is ignored. If the * TCL_CANCEL_UNWIND flags bit is set, the script in progress is not * allowed to catch the script cancellation because the evaluation stack * for the interp is completely unwound. */ if resultObjPtr != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(resultObjPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(cancelInfo + 24)) = (*TTcl_Obj)(unsafe.Pointer(resultObjPtr)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(resultObjPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, resultObjPtr, cancelInfo+24) } result = v1 (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fresult = XTcl_Realloc(tls, (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fresult, libc.Uint64FromInt64((*TCancelInfo)(unsafe.Pointer(cancelInfo)).Flength)) libc.Xmemcpy(tls, (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fresult, result, libc.Uint64FromInt64((*TCancelInfo)(unsafe.Pointer(cancelInfo)).Flength)) v3 = resultObjPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if !(v2 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(resultObjPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(resultObjPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(resultObjPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(resultObjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(resultObjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(resultObjPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, resultObjPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObjPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = resultObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, resultObjPtr) } } /* Discard their result object. */ } else { (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fresult = libc.UintptrFromInt32(0) (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Flength = 0 } (*TCancelInfo)(unsafe.Pointer(cancelInfo)).FclientData = clientData (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fflags = flags XTcl_AsyncMark(tls, (*TCancelInfo)(unsafe.Pointer(cancelInfo)).Fasync) code = TCL_OK goto done done: ; XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_cancelLock))) return code } /* *---------------------------------------------------------------------- * * Tcl_InterpActive -- * * Returns non-zero if the specified interpreter is in use, i.e. if there * is an evaluation currently active in the interpreter. * * Results: * See above. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_InterpActive(tls *libc.TLS, interp uintptr) (r int32) { return libc.BoolInt32((*TInterp)(unsafe.Pointer(interp)).FnumLevels > 0) } /* *---------------------------------------------------------------------- * * Tcl_EvalObjv -- * * This function evaluates a Tcl command that has already been parsed * into words, with one Tcl_Obj holding each word. * * Results: * The return value is a standard Tcl completion code such as TCL_OK or * TCL_ERROR. A result or error message is left in interp's result. * * Side effects: * Always pushes a callback. Other side effects depend on the command. * *---------------------------------------------------------------------- */ func XTcl_EvalObjv(tls *libc.TLS, interp uintptr, objc TTcl_Size, objv uintptr, flags int32) (r int32) { /* Collection of OR-ed bits that control the * evaluation of the script. Only * TCL_EVAL_GLOBAL, TCL_EVAL_INVOKE and * TCL_EVAL_NOERR are currently supported. */ var result int32 var rootPtr uintptr _, _ = result, rootPtr rootPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr result = XTclNREvalObjv(tls, interp, objc, objv, flags, libc.UintptrFromInt32(0)) return XTclNRRunCallbacks(tls, interp, result, rootPtr) } func XTclNREvalObjv(tls *libc.TLS, interp uintptr, objc TTcl_Size, objv uintptr, flags int32, cmdPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* NULL if the Command is to be looked up * here, otherwise the pointer to the * requested Command struct to be invoked. */ var _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr uintptr var v1, v2 bool var _ /* _callbackPtr at bp+0 */ uintptr var _ /* _callbackPtr at bp+8 */ uintptr _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr, v1, v2 iPtr = interp /* * data[1] stores a marker for use by tailcalls; it will be set to 1 by * command redirectors (imports, alias, ensembles) so that tailcall skips * this callback (that marks the end of the target command) and goes back * to the end of the source command. */ if (*TInterp)(unsafe.Pointer(iPtr)).FdeferredCallbacks != 0 { (*TInterp)(unsafe.Pointer(iPtr)).FdeferredCallbacks = libc.UintptrFromInt32(0) } else { if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_NRCommand) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) } (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels++ if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(_EvalObjvCore) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = cmdPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = uintptr(int64(flags)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = uintptr(objc) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = objv (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) return TCL_OK } func _EvalObjvCore(tls *libc.TLS, data uintptr, interp uintptr, dummy4438 int32) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var _objPtr, _objPtr1, _objPtr2, _objPtr3, cachePtr, cachePtr1, commandPtr, iPtr, lookupNsPtr, objv, preCmdPtr, v1, v3, v5, v8 uintptr var code, enterTracesDone, flags int32 var objc, v2, v4 TTcl_Size var v6, v7 bool var _ /* _callbackPtr at bp+16 */ uintptr var _ /* _callbackPtr at bp+8 */ uintptr var _ /* cmdPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, cachePtr, cachePtr1, code, commandPtr, enterTracesDone, flags, iPtr, lookupNsPtr, objc, objv, preCmdPtr, v1, v2, v3, v4, v5, v6, v7, v8 *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) preCmdPtr = *(*uintptr)(unsafe.Pointer(data)) flags = int32(int64(*(*uintptr)(unsafe.Pointer(data + 1*8)))) objc = int64(*(*uintptr)(unsafe.Pointer(data + 2*8))) objv = *(*uintptr)(unsafe.Pointer(data + 3*8)) iPtr = interp lookupNsPtr = libc.UintptrFromInt32(0) enterTracesDone = 0 /* * Push records for task to be done on return, in INVERSE order. First, if * needed, the exception handlers (as they should happen last). */ if !(flags&libc.Int32FromInt32(TCL_EVAL_NOERR) != 0) { _TEOV_PushExceptionHandlers(tls, interp, objc, objv, flags) } if TCL_OK != XTclInterpReady(tls, interp) { return int32(TCL_ERROR) } if objc == 0 { return TCL_OK } if (*TInterp)(unsafe.Pointer(iPtr)).Flimit.Fexceeded != 0 { /* generate error message if not yet already logged at this stage */ if !((*TInterp)(unsafe.Pointer(iPtr)).Fflags&libc.Int32FromInt32(ERR_ALREADY_LOGGED) != 0) { XTcl_LimitCheck(tls, interp) } return int32(TCL_ERROR) } /* * Configure evaluation context to match the requested flags. */ if (*TInterp)(unsafe.Pointer(iPtr)).FlookupNsPtr != 0 { /* * Capture the namespace we should do command name resolution in, as * instructed by our caller sneaking it in to us in a private interp * field. Clear that field right away so we cannot possibly have its * use leak where it should not. The sneaky message pass is done. * * Use of this mechanism overrides the TCL_EVAL_GLOBAL flag. * TODO: Is that a bug? */ lookupNsPtr = (*TInterp)(unsafe.Pointer(iPtr)).FlookupNsPtr (*TInterp)(unsafe.Pointer(iPtr)).FlookupNsPtr = libc.UintptrFromInt32(0) } else { if flags&int32(TCL_EVAL_INVOKE) != 0 { lookupNsPtr = (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr } else { /* * TCL_EVAL_INVOKE was not set: clear rewrite rules */ XTclResetRewriteEnsemble(tls, interp, int32(1)) if flags&int32(TCL_EVAL_GLOBAL) != 0 { _TEOV_SwitchVarFrame(tls, interp) lookupNsPtr = (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr } } } /* * Lookup the Command to dispatch. */ goto reresolve reresolve: ; if preCmdPtr != 0 { /* * Caller gave it to us. */ if !((*TCommand)(unsafe.Pointer(preCmdPtr)).Fflags&libc.Int32FromInt32(CMD_DEAD) != 0) { /* * So long as it exists, use it. */ *(*uintptr)(unsafe.Pointer(bp)) = preCmdPtr } else { if flags&int32(TCL_EVAL_NORESOLVE) != 0 { /* * When it's been deleted, and we're told not to attempt resolving * it ourselves, all we can do is raise an error. */ XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+8400, 0)) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+8436, __ccgo_ts+8441, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } } } if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = _TEOV_LookupCmdFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), lookupNsPtr) if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { return _TEOV_NotFound(tls, interp, objc, objv, lookupNsPtr) } } if enterTracesDone != 0 || (*TInterp)(unsafe.Pointer(iPtr)).FtracePtr != 0 || (*TCommand)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fflags&int32(CMD_HAS_EXEC_TRACES) != 0 { if flags&int32(TCL_EVAL_SOURCE_IN_FRAME) != 0 { v1 = (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr } else { v1 = libc.UintptrFromInt32(0) } commandPtr = XTclGetSourceFromFrame(tls, v1, objc, objv) (*TTcl_Obj)(unsafe.Pointer(commandPtr)).FrefCount++ if !(enterTracesDone != 0) { code = _TEOV_RunEnterTraces(tls, interp, bp, commandPtr, objc, objv) /* * Send any exception from enter traces back as an exception * raised by the traced command. * TODO: Is this a bug? Letting an execution trace BREAK or * CONTINUE or RETURN in the place of the traced command? Would * either converting all exceptions to TCL_ERROR, or just * swallowing them be better? (Swallowing them has the problem of * permanently hiding program errors.) */ if code != TCL_OK { _objPtr = commandPtr v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } return code } /* * If the enter traces made the resolved cmdPtr unusable, go back * and resolve again, but next time don't run enter traces again. */ if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { enterTracesDone = int32(1) _objPtr1 = commandPtr v5 = _objPtr1 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr1) } goto reresolve } } /* * Schedule leave traces. Raise the refCount on the resolved cmdPtr, * so that when it passes to the leave traces we know it's still * valid. */ (*TCommand)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount++ if v6 = interp == libc.UintptrFromInt32(0); !v6 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v6 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr2 = XTclThreadAllocObj(tls) } else { _objPtr2 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr2 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr2 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(_TEOV_RunLeaveTraces) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = uintptr(objc) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = commandPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = objv (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) } if v7 = interp == libc.UintptrFromInt32(0); !v7 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v7 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr3 = XTclThreadAllocObj(tls) } else { _objPtr3 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr3 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 16)) = _objPtr3 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FprocPtr = __ccgo_fp(_Dispatch) if (*TCommand)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnreProc != 0 { v8 = (*TCommand)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnreProc } else { v8 = (*TCommand)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FobjProc } *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)) = v8 *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 1*8)) = (*TCommand)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FobjClientData *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 2*8)) = uintptr(objc) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 3*8)) = objv (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) return TCL_OK } func _Dispatch(tls *libc.TLS, data uintptr, interp uintptr, dummy4602 int32) (r int32) { var clientData, iPtr, objProc, objv uintptr var objc TTcl_Size _, _, _, _, _ = clientData, iPtr, objProc, objc, objv objProc = *(*uintptr)(unsafe.Pointer(data)) clientData = *(*uintptr)(unsafe.Pointer(data + 1*8)) objc = int64(*(*uintptr)(unsafe.Pointer(data + 2*8))) objv = *(*uintptr)(unsafe.Pointer(data + 3*8)) iPtr = interp (*TInterp)(unsafe.Pointer(iPtr)).FcmdCount++ return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{objProc})))(tls, clientData, interp, int32(objc), objv) } func XTclNRRunCallbacks(tls *libc.TLS, interp uintptr, result int32, rootPtr uintptr) (r int32) { /* All callbacks down to rootPtr not inclusive * are to be run. */ var cachePtr, callbackPtr, procPtr uintptr var v1 bool _, _, _, _ = cachePtr, callbackPtr, procPtr, v1 for (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr != rootPtr { callbackPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr procPtr = (*TNRE_callback)(unsafe.Pointer(callbackPtr)).FprocPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = (*TNRE_callback)(unsafe.Pointer(callbackPtr)).FnextPtr result = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{procPtr})))(tls, callbackPtr+8, interp, result) if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, callbackPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(callbackPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = callbackPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } return result } func _NRCommand(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, iPtr, listPtr uintptr var v1, v5 bool var v2, v3, v4 int32 var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, iPtr, listPtr, v1, v2, v3, v4, v5 iPtr = interp (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels-- /* * If there is a tailcall, schedule it next */ if *(*uintptr)(unsafe.Pointer(data + 1*8)) != 0 && *(*uintptr)(unsafe.Pointer(data + 1*8)) != uintptr(int64(libc.Int32FromInt32(1))) { listPtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) *(*uintptr)(unsafe.Pointer(data + 1*8)) = libc.UintptrFromInt32(0) if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(XTclNRTailcallEval) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = listPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) } /* OPT ?? * Do not interrupt a series of cleanups with async or limit checks: * just check at the end? */ if *(*int32)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FasyncReadyPtr)) != 0 { result = XTcl_AsyncInvoke(tls, interp, result) } if result == TCL_OK && ((*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(CANCELED) != 0 || (*TInterp)(unsafe.Pointer(iPtr)).Fflags&int32(TCL_CANCEL_UNWIND) != 0) { result = XTcl_Canceled(tls, interp, int32(TCL_LEAVE_ERR_MSG)) } if v5 = result == TCL_OK; v5 { if (*TInterp)(unsafe.Pointer(iPtr)).Flimit.Factive == 0 { v2 = 0 } else { (*TInterp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker++ if (*TInterp)(unsafe.Pointer(iPtr)).Flimit.Factive&int32(TCL_LIMIT_COMMANDS) != 0 && ((*TInterp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity == int32(1) || (*TInterp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker%(*TInterp)(unsafe.Pointer(iPtr)).Flimit.FcmdGranularity == 0) { v3 = int32(1) } else { if (*TInterp)(unsafe.Pointer(iPtr)).Flimit.Factive&int32(TCL_LIMIT_TIME) != 0 && ((*TInterp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity == int32(1) || (*TInterp)(unsafe.Pointer(iPtr)).Flimit.FgranularityTicker%(*TInterp)(unsafe.Pointer(iPtr)).Flimit.FtimeGranularity == 0) { v4 = int32(1) } else { v4 = 0 } v3 = v4 } v2 = v3 } } if v5 && v2 != 0 { result = XTcl_LimitCheck(tls, interp) } return result } /* *---------------------------------------------------------------------- * * TEOV_Exception - * TEOV_LookupCmdFromObj - * TEOV_RunEnterTraces - * TEOV_RunLeaveTraces - * TEOV_NotFound - * * These are helper functions for Tcl_EvalObjv. * *---------------------------------------------------------------------- */ func _TEOV_PushExceptionHandlers(tls *libc.TLS, interp uintptr, objc TTcl_Size, objv uintptr, flags int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr uintptr var v1, v2 bool var _ /* _callbackPtr at bp+0 */ uintptr var _ /* _callbackPtr at bp+8 */ uintptr _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr, v1, v2 iPtr = interp /* * If any error processing is necessary, push the appropriate records. * Note that we have to push them in the inverse order: first the one that * has to run last. */ if !(flags&libc.Int32FromInt32(TCL_EVAL_INVOKE) != 0) { /* * Error messages */ if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_TEOV_Error) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = uintptr(objc) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = objv *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) } if (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels == int64(1) { /* * No CONTINUE or BREAK at level 0, manage RETURN */ if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(_TEOV_Exception) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = uintptr(int64((*TInterp)(unsafe.Pointer(iPtr)).FevalFlags)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) } } func _TEOV_SwitchVarFrame(tls *libc.TLS, interp uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, iPtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _ = _objPtr, cachePtr, iPtr, v1 iPtr = interp /* * Change the varFrame to be the rootVarFrame, and push a record to * restore things at the end. */ if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_TEOV_RestoreVarFrame) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*TInterp)(unsafe.Pointer(iPtr)).FrootFramePtr } func _TEOV_RestoreVarFrame(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr = *(*uintptr)(unsafe.Pointer(data)) return result } func _TEOV_Exception(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { var allowExceptions int32 var iPtr uintptr _, _ = allowExceptions, iPtr iPtr = interp allowExceptions = int32(int64(*(*uintptr)(unsafe.Pointer(data))) & libc.Int64FromInt32(TCL_ALLOW_EXCEPTIONS)) if result != TCL_OK { if result == int32(TCL_RETURN) { result = XTclUpdateReturnInfo(tls, iPtr) } if result != TCL_OK && result != int32(TCL_ERROR) && !(allowExceptions != 0) { _ProcessUnexpectedResult(tls, interp, result) result = int32(TCL_ERROR) } } /* * We are returning to level 0, so should process TclResetCancellation. As * numLevels has not *yet* been decreased, do not call it: do the thing * here directly. */ *(*int32)(unsafe.Pointer(iPtr + 368)) &= ^(libc.Int32FromInt32(CANCELED) | libc.Int32FromInt32(TCL_CANCEL_UNWIND)) return result } func _TEOV_Error(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cmdString, iPtr, listPtr, objv, v1, v3 uintptr var objc, v2 TTcl_Size var _ /* cmdLen at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _ = _objPtr, cmdString, iPtr, listPtr, objc, objv, v1, v2, v3 iPtr = interp objc = int64(*(*uintptr)(unsafe.Pointer(data))) objv = *(*uintptr)(unsafe.Pointer(data + 1*8)) if result == int32(TCL_ERROR) && !((*TInterp)(unsafe.Pointer(iPtr)).Fflags&libc.Int32FromInt32(ERR_ALREADY_LOGGED) != 0) { /* * If there was an error, a command string will be needed for the * error log: get it out of the itemPtr. The details depend on the * type. */ listPtr = XTcl_NewListObj(tls, objc, objv) if (*TTcl_Obj)(unsafe.Pointer(listPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(listPtr)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(listPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, listPtr, bp) } cmdString = v1 XTcl_LogCommandInfo(tls, interp, cmdString, cmdString, *(*TTcl_Size)(unsafe.Pointer(bp))) _objPtr = listPtr v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } } *(*int32)(unsafe.Pointer(iPtr + 368)) &= ^libc.Int32FromInt32(ERR_ALREADY_LOGGED) return result } func _TEOV_NotFound(tls *libc.TLS, interp uintptr, objc TTcl_Size, objv uintptr, lookupNsPtr uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var _objPtr, _objPtr1, cachePtr, cachePtr1, cmdPtr, currNsPtr, iPtr, newObjv, savedNsPtr, varFramePtr, v10, v6, v7 uintptr var i, newObjc, v9 TTcl_Size var v1, v11 bool var v3, v4 int64 var _ /* _callbackPtr at bp+16 */ uintptr var _ /* handlerObjc at bp+0 */ TTcl_Size var _ /* handlerObjv at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, cmdPtr, currNsPtr, i, iPtr, newObjc, newObjv, savedNsPtr, varFramePtr, v1, v10, v11, v3, v4, v6, v7, v9 iPtr = interp varFramePtr = (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr currNsPtr = libc.UintptrFromInt32(0) /* Used to check for and invoke any registered * unknown command handler for the current * namespace (TIP 181). */ savedNsPtr = libc.UintptrFromInt32(0) currNsPtr = (*TCallFrame)(unsafe.Pointer(varFramePtr)).FnsPtr if currNsPtr == libc.UintptrFromInt32(0) || (*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr == libc.UintptrFromInt32(0) { currNsPtr = (*TInterp)(unsafe.Pointer(iPtr)).FglobalNsPtr if currNsPtr == libc.UintptrFromInt32(0) { XTcl_Panic(tls, __ccgo_ts+8456, 0) } } /* * Check to see if the resolution namespace has lost its unknown handler. * If so, reset it to "::unknown". */ if (*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr == libc.UintptrFromInt32(0) { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { (*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr = XTclThreadAllocObj(tls) } else { (*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FrefCount = 0 if libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes, __ccgo_ts+8501, libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Fbytes + uintptr(libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(10) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FrefCount++ } /* * Get the list of words for the unknown handler and allocate enough space * to hold both the handler prefix and all words of the command invocation * itself. */ if (*TTcl_Obj)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))).Fptr2)).FspanStart } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))).Fptr1 + 40 + uintptr(v3)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))).Fptr2)).FspanLength } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v4 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), (*TNamespace)(unsafe.Pointer(currNsPtr)).FunknownHandlerPtr, bp, bp+8) } newObjc = objc + *(*TTcl_Size)(unsafe.Pointer(bp)) newObjv = XTclStackAlloc(tls, interp, uint64(8)*libc.Uint64FromInt64(newObjc)) /* * Copy command prefix from unknown handler and add on the real command's * full argument list. Note that we only use memcpy() once because we have * to increment the reference count of all the handler arguments anyway. */ i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp))) { break } *(*uintptr)(unsafe.Pointer(newObjv + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(newObjv + uintptr(i)*8)))).FrefCount++ goto _5 _5: ; i++ } libc.Xmemcpy(tls, newObjv+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*8, objv, uint64(8)*libc.Uint64FromInt64(objc)) /* * Look up and invoke the handler (by recursive call to this function). If * there is no handler at all, instead of doing the recursive call we just * generate a generic error message; it would be an infinite-recursion * nightmare otherwise. * * In this case we worry a bit less about recursion for now, and call the * "blocking" interface. */ cmdPtr = _TEOV_LookupCmdFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(newObjv)), lookupNsPtr) if cmdPtr == libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 { v6 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+8511, libc.VaList(bp+32, v6))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 { v7 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+8118, v7, libc.UintptrFromInt32(0))) /* * Release any resources we locked and allocated during the handler * call. */ i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp))) { break } _objPtr = *(*uintptr)(unsafe.Pointer(newObjv + uintptr(i)*8)) v10 = _objPtr v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr) } goto _8 _8: ; i++ } XTclStackFree(tls, interp, newObjv) return int32(TCL_ERROR) } if lookupNsPtr != 0 { savedNsPtr = (*TCallFrame)(unsafe.Pointer(varFramePtr)).FnsPtr (*TCallFrame)(unsafe.Pointer(varFramePtr)).FnsPtr = lookupNsPtr } XTclSkipTailcall(tls, interp) if v11 = interp == libc.UintptrFromInt32(0); !v11 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v11 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 16)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FprocPtr = __ccgo_fp(_TEOV_NotFoundCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)) = uintptr(*(*TTcl_Size)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 1*8)) = newObjv *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 2*8)) = savedNsPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) return XTclNREvalObjv(tls, interp, newObjc, newObjv, int32(TCL_EVAL_NOERR), libc.UintptrFromInt32(0)) } func _TEOV_NotFoundCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { var _objPtr, iPtr, objv, savedNsPtr, v3 uintptr var i, objc, v2 TTcl_Size _, _, _, _, _, _, _, _ = _objPtr, i, iPtr, objc, objv, savedNsPtr, v2, v3 iPtr = interp objc = int64(*(*uintptr)(unsafe.Pointer(data))) objv = *(*uintptr)(unsafe.Pointer(data + 1*8)) savedNsPtr = *(*uintptr)(unsafe.Pointer(data + 2*8)) if savedNsPtr != 0 { (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = savedNsPtr } /* * Release any resources we locked and allocated during the handler call. */ i = 0 for { if !(i < objc) { break } _objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } goto _1 _1: ; i++ } XTclStackFree(tls, interp, objv) return result } func _TEOV_RunEnterTraces(tls *libc.TLS, interp uintptr, cmdPtrPtr uintptr, commandPtr uintptr, objc TTcl_Size, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cachePtr, cmdPtr, command, iPtr, info, v1, v3 uintptr var cmdEpoch, newEpoch, v2 TTcl_Size var traceCode int32 var v4 bool var _ /* length at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cmdEpoch, cmdPtr, command, iPtr, info, newEpoch, traceCode, v1, v2, v3, v4 iPtr = interp cmdPtr = *(*uintptr)(unsafe.Pointer(cmdPtrPtr)) cmdEpoch = (*TCommand)(unsafe.Pointer(cmdPtr)).FcmdEpoch traceCode = TCL_OK if (*TTcl_Obj)(unsafe.Pointer(commandPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(commandPtr)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(commandPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, commandPtr, bp) } command = v1 /* * Call trace functions. * Execute any command or execution traces. Note that we bump up the * command's reference count for the duration of the calling of the * traces so that the structure doesn't go away underneath our feet. */ (*TCommand)(unsafe.Pointer(cmdPtr)).FrefCount++ if (*TInterp)(unsafe.Pointer(iPtr)).FtracePtr != 0 { traceCode = XTclCheckInterpTraces(tls, interp, command, *(*TTcl_Size)(unsafe.Pointer(bp)), cmdPtr, TCL_OK, int32(TCL_TRACE_ENTER_EXEC), objc, objv) } if (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_HAS_EXEC_TRACES) != 0 && traceCode == TCL_OK { traceCode = XTclCheckExecutionTraces(tls, interp, command, *(*TTcl_Size)(unsafe.Pointer(bp)), cmdPtr, TCL_OK, int32(TCL_TRACE_ENTER_EXEC), objc, objv) } newEpoch = (*TCommand)(unsafe.Pointer(cmdPtr)).FcmdEpoch v3 = cmdPtr + 16 v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclpFree(tls, cmdPtr) } if traceCode != TCL_OK { if traceCode == int32(TCL_ERROR) { if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { info = XTclThreadAllocObj(tls) } else { info = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(info + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(info)).FrefCount = 0 if libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(info)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(info)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(info)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(info)).Fbytes, __ccgo_ts+8537, libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(info)).Fbytes + uintptr(libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(info)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(23) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(info)).FtypePtr = libc.UintptrFromInt32(0) XTcl_AppendLimitedToObj(tls, info, command, *(*TTcl_Size)(unsafe.Pointer(bp)), int64(55), __ccgo_ts+8560) XTcl_AppendToObj(tls, info, __ccgo_ts+8564, int64(2)) XTcl_AppendObjToErrorInfo(tls, interp, info) *(*int32)(unsafe.Pointer(iPtr + 368)) |= int32(ERR_ALREADY_LOGGED) } return traceCode } if cmdEpoch != newEpoch { *(*uintptr)(unsafe.Pointer(cmdPtrPtr)) = libc.UintptrFromInt32(0) } return TCL_OK } func _TEOV_RunLeaveTraces(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, cmdPtr, command, commandPtr, iPtr, info, objv, v1, v3, v6 uintptr var objc, v2, v5 TTcl_Size var traceCode int32 var v4 bool var _ /* length at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cmdPtr, command, commandPtr, iPtr, info, objc, objv, traceCode, v1, v2, v3, v4, v5, v6 iPtr = interp traceCode = TCL_OK objc = int64(*(*uintptr)(unsafe.Pointer(data))) commandPtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) cmdPtr = *(*uintptr)(unsafe.Pointer(data + 2*8)) objv = *(*uintptr)(unsafe.Pointer(data + 3*8)) if (*TTcl_Obj)(unsafe.Pointer(commandPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(commandPtr)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(commandPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, commandPtr, bp) } command = v1 if !((*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&libc.Int32FromInt32(CMD_DYING) != 0) { if (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_HAS_EXEC_TRACES) != 0 { traceCode = XTclCheckExecutionTraces(tls, interp, command, *(*TTcl_Size)(unsafe.Pointer(bp)), cmdPtr, result, int32(TCL_TRACE_LEAVE_EXEC), objc, objv) } if (*TInterp)(unsafe.Pointer(iPtr)).FtracePtr != libc.UintptrFromInt32(0) && traceCode == TCL_OK { traceCode = XTclCheckInterpTraces(tls, interp, command, *(*TTcl_Size)(unsafe.Pointer(bp)), cmdPtr, result, int32(TCL_TRACE_LEAVE_EXEC), objc, objv) } } /* * As cmdPtr is set, TclNRRunCallbacks is about to reduce the numlevels. * Prevent that by resetting the cmdPtr field and dealing right here with * cmdPtr->refCount. */ v3 = cmdPtr + 16 v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclpFree(tls, cmdPtr) } if traceCode != TCL_OK { if traceCode == int32(TCL_ERROR) { if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { info = XTclThreadAllocObj(tls) } else { info = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(info + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(info)).FrefCount = 0 if libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(info)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(info)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(info)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(info)).Fbytes, __ccgo_ts+8567, libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(info)).Fbytes + uintptr(libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(info)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(23) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(info)).FtypePtr = libc.UintptrFromInt32(0) XTcl_AppendLimitedToObj(tls, info, command, *(*TTcl_Size)(unsafe.Pointer(bp)), int64(55), __ccgo_ts+8560) XTcl_AppendToObj(tls, info, __ccgo_ts+8564, int64(2)) XTcl_AppendObjToErrorInfo(tls, interp, info) *(*int32)(unsafe.Pointer(iPtr + 368)) |= int32(ERR_ALREADY_LOGGED) } result = traceCode } _objPtr = commandPtr v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } return result } func _TEOV_LookupCmdFromObj(tls *libc.TLS, interp uintptr, namePtr uintptr, lookupNsPtr uintptr) (r uintptr) { var cmdPtr, iPtr, savedNsPtr uintptr _, _, _ = cmdPtr, iPtr, savedNsPtr iPtr = interp savedNsPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr if lookupNsPtr != 0 { (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = lookupNsPtr } cmdPtr = XTcl_GetCommandFromObj(tls, interp, namePtr) (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr = savedNsPtr return cmdPtr } /* *---------------------------------------------------------------------- * * Tcl_EvalTokensStandard -- * * Given an array of tokens parsed from a Tcl command (e.g., the tokens * that make up a word or the index for an array variable) this function * evaluates the tokens and concatenates their values to form a single * result value. * * Results: * The return value is a standard Tcl completion code such as TCL_OK or * TCL_ERROR. A result or error message is left in interp's result. * * Side effects: * Depends on the array of tokens being evaled. * *---------------------------------------------------------------------- */ func XTcl_EvalTokensStandard(tls *libc.TLS, interp uintptr, tokenPtr uintptr, count TTcl_Size) (r int32) { /* Number of tokens to consider at tokenPtr. * Must be at least 1. */ return XTclSubstTokens(tls, interp, tokenPtr, count, libc.UintptrFromInt32(0), int64(1), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0)) } /* *---------------------------------------------------------------------- * * Tcl_EvalEx, TclEvalEx -- * * This function evaluates a Tcl script without using the compiler or * byte-code interpreter. It just parses the script, creates values for * each word of each command, then calls EvalObjv to execute each * command. * * Results: * The return value is a standard Tcl completion code such as TCL_OK or * TCL_ERROR. A result or error message is left in interp's result. * * Side effects: * Depends on the script. * * TIP #280 : Keep public API, internally extended API. *---------------------------------------------------------------------- */ func XTcl_EvalEx(tls *libc.TLS, interp uintptr, script uintptr, numBytes TTcl_Size, flags int32) (r int32) { /* Collection of OR-ed bits that control the * evaluation of the script. Only * TCL_EVAL_GLOBAL is currently supported. */ return XTclEvalEx(tls, interp, script, numBytes, flags, int64(1), libc.UintptrFromInt32(0), script) } func XTclEvalEx(tls *libc.TLS, interp uintptr, script uintptr, numBytes TTcl_Size, flags int32, _line TTcl_Size, clNextOuter uintptr, outerScript uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) *(*TTcl_Size)(unsafe.Pointer(bp)) = _line /* continuation line data. This is set only in * TclSubstTokens(), to properly handle * [...]-nested commands. The 'outerScript' * refers to the most-outer script containing * the embedded command, which is referred to * by 'script'. The 'clNextOuter' refers to * the current entry in the table of * continuation lines in this "main script", * and the character offsets are relative to * the 'outerScript' as well. * * If outerScript == script, then this call is * for the outer-most script/command. See * Tcl_EvalEx() and TclEvalObjEx() for places * generating arguments for which this is * true. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, cachePtr, copy1, eeFramePtr, expand, expandStack, iPtr, lcopy, lineSpace, lines, linesStack, next, norm, objv, objvSpace, p, parsePtr, savedVarFramePtr, stackObjArray, temp, tokenPtr, wordStart, v1, v10, v13, v14, v15, v2, v23, v26, v29, v32, v34 uintptr var additionalObjsCount, bytesLeft, commandLength, i, numWords, objIdx, objectsNeeded, objectsUsed, wordIdx, v12, v16, v20, v21, v22, v24, v25, v28, v31, v33, v9 TTcl_Size var allowExceptions, code, expandRequested, gotParse, minObjs, v3, v7 int32 var v11, v18, v19, v6, v8 int64 var v4 bool var _ /* clNext at bp+8 */ uintptr var _ /* elements at bp+48 */ uintptr var _ /* numElements at bp+32 */ TTcl_Size var _ /* numElements at bp+40 */ TTcl_Size var _ /* wordCLNext at bp+24 */ uintptr var _ /* wordLine at bp+16 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, additionalObjsCount, allowExceptions, bytesLeft, cachePtr, code, commandLength, copy1, eeFramePtr, expand, expandRequested, expandStack, gotParse, i, iPtr, lcopy, lineSpace, lines, linesStack, minObjs, next, norm, numWords, objIdx, objectsNeeded, objectsUsed, objv, objvSpace, p, parsePtr, savedVarFramePtr, stackObjArray, temp, tokenPtr, wordIdx, wordStart, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v28, v29, v3, v31, v32, v33, v34, v4, v6, v7, v8, v9 iPtr = interp minObjs = int32(20) code = TCL_OK /* Saves old copy of iPtr->varFramePtr in case * TCL_EVAL_GLOBAL was set. */ allowExceptions = (*TInterp)(unsafe.Pointer(iPtr)).FevalFlags & int32(TCL_ALLOW_EXCEPTIONS) gotParse = 0 objectsUsed = 0 /* These variables keep track of how much * state has been allocated while evaluating * the script, so that it can be freed * properly if an error occurs. */ parsePtr = XTclStackAlloc(tls, interp, uint64(744)) eeFramePtr = XTclStackAlloc(tls, interp, uint64(88)) stackObjArray = XTclStackAlloc(tls, interp, libc.Uint64FromInt32(minObjs)*uint64(8)) expandStack = XTclStackAlloc(tls, interp, libc.Uint64FromInt32(minObjs)*uint64(4)) linesStack = XTclStackAlloc(tls, interp, libc.Uint64FromInt32(minObjs)*uint64(8)) /* TIP #280 Structures for tracking of command * locations. */ *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0) /* Pointer for the tracking of invisible * continuation lines. Initialized only if the * caller gave us a table of locations to * track, via scriptCLLocPtr. It always refers * to the table entry holding the location of * the next invisible continuation line to * look for, while parsing the script. */ if (*TInterp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr != 0 { if clNextOuter != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = clNextOuter } else { *(*uintptr)(unsafe.Pointer(bp + 8)) = (*TInterp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr + 8 } } if numBytes < 0 { numBytes = libc.Int64FromUint64(libc.Xstrlen(tls, script)) } XTcl_ResetResult(tls, interp) savedVarFramePtr = (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr if flags&int32(TCL_EVAL_GLOBAL) != 0 { (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*TInterp)(unsafe.Pointer(iPtr)).FrootFramePtr } /* * Each iteration through the following loop parses the next command from * the script and then executes it. */ v1 = stackObjArray objvSpace = v1 objv = v1 v2 = linesStack lineSpace = v2 lines = v2 expand = expandStack p = script bytesLeft = numBytes /* * TIP #280 Initialize tracking. Do not push on the frame stack yet. * * We open a new context, either for a sourced script, or 'eval'. * For sourced files we always have a path object, even if nothing was * specified in the interp itself. That makes code using it simpler as * NULL checks can be left out. Sourced file without path in the * 'scriptFile' is possible during Tcl initialization. */ if (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr != 0 { v3 = (*TCmdFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).Flevel + int32(1) } else { v3 = int32(1) } (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Flevel = v3 (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).FframePtr = (*TInterp)(unsafe.Pointer(iPtr)).FframePtr (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).FnextPtr = (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fnline = 0 (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fline = libc.UintptrFromInt32(0) (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).FcmdObj = libc.UintptrFromInt32(0) (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr = eeFramePtr if (*TInterp)(unsafe.Pointer(iPtr)).FevalFlags&int32(TCL_EVAL_FILE) != 0 { /* * Set up for a sourced file. */ (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Ftype1 = int32(TCL_LOCATION_SOURCE) if (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile != 0 { /* * Normalization here, to have the correct pwd. Should have * negligible impact on performance, as the norm should have been * done already by the 'source' invoking us, and it caches the * result. */ norm = XTcl_FSGetNormalizedPath(tls, interp, (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile) if norm == libc.UintptrFromInt32(0) { /* * Error message in the interp result. */ code = int32(TCL_ERROR) goto error } (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath = norm } else { if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath = XTclThreadAllocObj(tls) } else { (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath)).FrefCount = 0 if libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath)).Fbytes, __ccgo_ts+1945, libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath)).Fbytes + uintptr(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath)).FtypePtr = libc.UintptrFromInt32(0) } (*TTcl_Obj)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath)).FrefCount++ } else { /* * Set up for plain eval. */ (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Ftype1 = TCL_LOCATION_EVAL (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath = libc.UintptrFromInt32(0) } (*TInterp)(unsafe.Pointer(iPtr)).FevalFlags = 0 for cond := true; cond; cond = bytesLeft > 0 { if XTcl_ParseCommand(tls, interp, p, bytesLeft, 0, parsePtr) != TCL_OK { code = int32(TCL_ERROR) XTcl_LogCommandInfo(tls, interp, script, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm+uintptr(1))-int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)) goto posterror } /* * TIP #280 Track lines. The parser may have skipped text till it * found the command we are now at. We have to count the lines in this * block, and do not forget invisible continuation lines. */ XTclAdvanceLines(tls, bp, p, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart) XTclAdvanceContinuations(tls, bp, bp+8, int32(int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64(outerScript))) gotParse = int32(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > 0 { /* * TIP #280. Track lines within the words of the current * command. We use a separate pointer into the table of * continuation line locations to not lose our position for the * per-command parsing. */ *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_Size)(unsafe.Pointer(bp)) wordStart = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart *(*uintptr)(unsafe.Pointer(bp + 24)) = *(*uintptr)(unsafe.Pointer(bp + 8)) objectsNeeded = 0 numWords = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords /* * Generate an array of objects for the words of the command. */ if numWords > int64(minObjs) { expand = XTcl_Alloc(tls, libc.Uint64FromInt64(numWords)*uint64(4)) objvSpace = XTcl_Alloc(tls, libc.Uint64FromInt64(numWords)*uint64(8)) lineSpace = XTcl_Alloc(tls, libc.Uint64FromInt64(numWords)*uint64(8)) } expandRequested = 0 objv = objvSpace lines = lineSpace (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr = (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).FnextPtr objectsUsed = 0 tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr for { if !(objectsUsed < numWords) { break } /* * TIP #280. Track lines to current word. Save the information * on a per-word basis, signaling dynamic words as needed. * Make the information available to the recursively called * evaluator as well, including the type of context (source * vs. eval). */ XTclAdvanceLines(tls, bp+16, wordStart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart) XTclAdvanceContinuations(tls, bp+16, bp+24, int32(int64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)-int64(outerScript))) wordStart = (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart if XTclWordKnownAtCompileTime(tls, tokenPtr, libc.UintptrFromInt32(0)) != 0 { v6 = *(*TTcl_Size)(unsafe.Pointer(bp + 16)) } else { v6 = int64(-int32(1)) } *(*TTcl_Size)(unsafe.Pointer(lines + uintptr(objectsUsed)*8)) = v6 if (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { *(*int32)(unsafe.Pointer(iPtr + 256)) |= int32(TCL_EVAL_FILE) } code = XTclSubstTokens(tls, interp, tokenPtr+uintptr(1)*32, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents, libc.UintptrFromInt32(0), *(*TTcl_Size)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 24)), outerScript) (*TInterp)(unsafe.Pointer(iPtr)).FevalFlags = 0 if code != TCL_OK { break } *(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)) = XTcl_GetObjResult(tls, interp) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)))).FrefCount++ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_EXPAND_WORD) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)) + 32))).Fptr2 != 0 { v8 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)) + 32))).Fptr2)).FspanLength } else { v8 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = v8 v7 = libc.Int32FromInt32(TCL_OK) } else { v7 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)), bp+32) } code = v7 if code == int32(TCL_ERROR) { /* * Attempt to expand a non-list. */ XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+8590, libc.VaList(bp+64, objectsUsed))) _objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)) v10 = _objPtr v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr) } break } expandRequested = int32(1) *(*int32)(unsafe.Pointer(expand + uintptr(objectsUsed)*4)) = int32(1) if *(*TTcl_Size)(unsafe.Pointer(bp + 32)) != 0 { v11 = *(*TTcl_Size)(unsafe.Pointer(bp + 32)) } else { v11 = int64(1) } additionalObjsCount = v11 } else { *(*int32)(unsafe.Pointer(expand + uintptr(objectsUsed)*4)) = 0 additionalObjsCount = int64(1) } /* Currently max command words in INT_MAX */ if additionalObjsCount > int64(INT_MAX) || objectsNeeded > int64(INT_MAX)-additionalObjsCount { code = XTclCommandWordLimitError(tls, interp, int64(-int32(1))) _objPtr1 = *(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)) v13 = _objPtr1 v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if v12 <= int64(1) { XTclFreeObj(tls, _objPtr1) } break } objectsNeeded += additionalObjsCount if *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 { XTclContinuationsEnterDerived(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objectsUsed)*8)), int64(wordStart)-int64(outerScript), *(*uintptr)(unsafe.Pointer(bp + 24))) } goto _5 _5: ; objectsUsed++ tokenPtr += uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+int64(1)) * 32 } /* for loop */ (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr = eeFramePtr if code != TCL_OK { goto error } if expandRequested != 0 { /* * Some word expansion was requested. Check for objv resize. */ copy1 = objvSpace lcopy = lineSpace wordIdx = numWords objIdx = objectsNeeded - int64(1) if numWords > int64(minObjs) || objectsNeeded > int64(minObjs) { v14 = XTcl_Alloc(tls, libc.Uint64FromInt64(objectsNeeded)*uint64(8)) objvSpace = v14 objv = v14 v15 = XTcl_Alloc(tls, libc.Uint64FromInt64(objectsNeeded)*uint64(8)) lineSpace = v15 lines = v15 } objectsUsed = 0 for { v16 = wordIdx wordIdx-- if !(v16 != 0) { break } if *(*int32)(unsafe.Pointer(expand + uintptr(wordIdx)*4)) != 0 { temp = *(*uintptr)(unsafe.Pointer(copy1 + uintptr(wordIdx)*8)) if (*TTcl_Obj)(unsafe.Pointer(temp)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(temp + 32))).Fptr2 != 0 { v18 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(temp + 32))).Fptr2)).FspanStart } else { v18 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(temp + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 48)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(temp + 32))).Fptr1 + 40 + uintptr(v18)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(temp + 32))).Fptr2 != 0 { v19 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(temp + 32))).Fptr2)).FspanLength } else { v19 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(temp + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = v19 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), temp, bp+40, bp+48) } objectsUsed += *(*TTcl_Size)(unsafe.Pointer(bp + 40)) for { v20 = *(*TTcl_Size)(unsafe.Pointer(bp + 40)) *(*TTcl_Size)(unsafe.Pointer(bp + 40))-- if !(v20 != 0) { break } *(*TTcl_Size)(unsafe.Pointer(lines + uintptr(objIdx)*8)) = int64(-int32(1)) v21 = objIdx objIdx-- *(*uintptr)(unsafe.Pointer(objv + uintptr(v21)*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 40)))*8)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 40)))*8)))).FrefCount++ } _objPtr2 = temp v23 = _objPtr2 v22 = *(*TTcl_Size)(unsafe.Pointer(v23)) *(*TTcl_Size)(unsafe.Pointer(v23))-- if v22 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } else { *(*TTcl_Size)(unsafe.Pointer(lines + uintptr(objIdx)*8)) = *(*TTcl_Size)(unsafe.Pointer(lcopy + uintptr(wordIdx)*8)) v24 = objIdx objIdx-- *(*uintptr)(unsafe.Pointer(objv + uintptr(v24)*8)) = *(*uintptr)(unsafe.Pointer(copy1 + uintptr(wordIdx)*8)) objectsUsed++ } } objv += uintptr(objIdx+int64(1)) * 8 if copy1 != stackObjArray { XTclpFree(tls, copy1) } if lcopy != linesStack { XTclpFree(tls, lcopy) } } /* * Execute the command and free the objects for its words. * * TIP #280: Remember the command itself for 'info frame'. We * shorten the visible command by one char to exclude the * termination character, if necessary. Here is where we put our * frame on the stack of frames too. _After_ the nested commands * have been executed. */ (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fcmd = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Flen1 = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm == (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart+uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize)-uintptr(1) { (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Flen1-- } (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fnline = objectsUsed (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fline = lines XTclArgumentEnter(tls, interp, objv, objectsUsed, eeFramePtr) code = XTcl_EvalObjv(tls, interp, objectsUsed, objv, libc.Int32FromInt32(TCL_EVAL_NOERR)|libc.Int32FromInt32(TCL_EVAL_SOURCE_IN_FRAME)) XTclArgumentRelease(tls, interp, objv, objectsUsed) (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fline = libc.UintptrFromInt32(0) (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fnline = 0 if (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).FcmdObj != 0 { _objPtr3 = (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).FcmdObj v26 = _objPtr3 v25 = *(*TTcl_Size)(unsafe.Pointer(v26)) *(*TTcl_Size)(unsafe.Pointer(v26))-- if v25 <= int64(1) { XTclFreeObj(tls, _objPtr3) } (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).FcmdObj = libc.UintptrFromInt32(0) } if code != TCL_OK { goto error } i = 0 for { if !(i < objectsUsed) { break } _objPtr4 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) v29 = _objPtr4 v28 = *(*TTcl_Size)(unsafe.Pointer(v29)) *(*TTcl_Size)(unsafe.Pointer(v29))-- if v28 <= int64(1) { XTclFreeObj(tls, _objPtr4) } goto _27 _27: ; i++ } objectsUsed = 0 if objvSpace != stackObjArray { XTclpFree(tls, objvSpace) objvSpace = stackObjArray XTclpFree(tls, lineSpace) lineSpace = linesStack } /* * Free expand separately since objvSpace could have been * reallocated above. */ if expand != expandStack { XTclpFree(tls, expand) expand = expandStack } } /* * Advance to the next command in the script. * * TIP #280 Track Lines. Now we track how many lines were in the * executed command. */ next = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize) bytesLeft -= int64(next) - int64(p) p = next XTclAdvanceLines(tls, bp, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, p) XTcl_FreeParse(tls, parsePtr) gotParse = 0 } (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr = savedVarFramePtr code = TCL_OK goto cleanup_return goto error error: ; /* * Generate and log various pieces of error information. */ if (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels == 0 { if code == int32(TCL_RETURN) { code = XTclUpdateReturnInfo(tls, iPtr) } if code != TCL_OK && code != int32(TCL_ERROR) && !(allowExceptions != 0) { _ProcessUnexpectedResult(tls, interp, code) code = int32(TCL_ERROR) } } if code == int32(TCL_ERROR) && !((*TInterp)(unsafe.Pointer(iPtr)).Fflags&libc.Int32FromInt32(ERR_ALREADY_LOGGED) != 0) { commandLength = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm == (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart+uintptr(commandLength)-uintptr(1) { /* * The terminator character (such as ; or ]) of the command where * the error occurred is the last character in the parsed command. * Reduce the length by one so that the error message doesn't * include the terminator character. */ commandLength -= int64(1) } XTcl_LogCommandInfo(tls, interp, script, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, commandLength) } goto posterror posterror: ; *(*int32)(unsafe.Pointer(iPtr + 368)) &= ^libc.Int32FromInt32(ERR_ALREADY_LOGGED) /* * Then free resources that had been allocated to the command. */ i = 0 for { if !(i < objectsUsed) { break } _objPtr5 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) v32 = _objPtr5 v31 = *(*TTcl_Size)(unsafe.Pointer(v32)) *(*TTcl_Size)(unsafe.Pointer(v32))-- if v31 <= int64(1) { XTclFreeObj(tls, _objPtr5) } goto _30 _30: ; i++ } if gotParse != 0 { XTcl_FreeParse(tls, parsePtr) } if objvSpace != stackObjArray { XTclpFree(tls, objvSpace) XTclpFree(tls, lineSpace) } if expand != expandStack { XTclpFree(tls, expand) } (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr = savedVarFramePtr goto cleanup_return cleanup_return: ; /* * TIP #280. Release the local CmdFrame, and its contents. */ (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr = (*TCmdFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).FnextPtr if (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { _objPtr6 = (*TCmdFrame)(unsafe.Pointer(eeFramePtr)).Fdata.Feval.Fpath v34 = _objPtr6 v33 = *(*TTcl_Size)(unsafe.Pointer(v34)) *(*TTcl_Size)(unsafe.Pointer(v34))-- if v33 <= int64(1) { XTclFreeObj(tls, _objPtr6) } } XTclStackFree(tls, interp, linesStack) XTclStackFree(tls, interp, expandStack) XTclStackFree(tls, interp, stackObjArray) XTclStackFree(tls, interp, eeFramePtr) XTclStackFree(tls, interp, parsePtr) return code } /* *---------------------------------------------------------------------- * * TclAdvanceLines -- * * This function is a helper which counts the number of lines in a block * of text and advances an external counter. * * Results: * None. * * Side effects: * The specified counter is advanced per the number of lines found. * * TIP #280 *---------------------------------------------------------------------- */ func XTclAdvanceLines(tls *libc.TLS, line uintptr, start uintptr, end uintptr) { var p uintptr _ = p p = start for { if !(p < end) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('\n') { *(*TTcl_Size)(unsafe.Pointer(line))++ } goto _1 _1: ; p++ } } /* *---------------------------------------------------------------------- * * TclAdvanceContinuations -- * * This procedure is a helper which counts the number of continuation * lines (CL) in a block of text using a table of CL locations and * advances an external counter, and the pointer into the table. * * Results: * None. * * Side effects: * The specified counter is advanced per the number of continuation lines * found. * * TIP #280 *---------------------------------------------------------------------- */ func XTclAdvanceContinuations(tls *libc.TLS, line uintptr, clNextPtrPtr uintptr, loc int32) { /* * Track the invisible continuation lines embedded in a script, if any. * Here they are just spaces (already). They were removed by * TclSubstTokens via TclParseBackslash. * * *clNextPtrPtr <=> We have continuation lines to track. * **clNextPtrPtr >= 0 <=> We are not beyond the last possible location. * loc >= **clNextPtrPtr <=> We stepped beyond the current cont. line. */ for *(*uintptr)(unsafe.Pointer(clNextPtrPtr)) != 0 && *(*TTcl_Size)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(clNextPtrPtr)))) >= 0 && int64(loc) >= *(*TTcl_Size)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(clNextPtrPtr)))) { /* * We just stepped over an invisible continuation line. Adjust the * line counter and step to the table entry holding the location of * the next continuation line to track. */ *(*TTcl_Size)(unsafe.Pointer(line))++ *(*uintptr)(unsafe.Pointer(clNextPtrPtr)) += 8 } } /* *---------------------------------------------------------------------- * Note: The whole data structure access for argument location tracking is * hidden behind these three functions. The only parts open are the lineLAPtr * field in the Interp structure. The CFWord definition is internal to here. * Should make it easier to redo the data structures if we find something more * space/time efficient. */ /* *---------------------------------------------------------------------- * * TclArgumentEnter -- * * This procedure is a helper for the TIP #280 uplevel extension. It * enters location references for the arguments of a command to be * invoked. Only the first entry has the actual data, further entries * simply count the usage up. * * Results: * None. * * Side effects: * May allocate memory. * * TIP #280 *---------------------------------------------------------------------- */ func XTclArgumentEnter(tls *libc.TLS, interp uintptr, objv uintptr, objc TTcl_Size, cfPtr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var cfwPtr, hPtr, iPtr uintptr var i TTcl_Size var _ /* isNew at bp+0 */ int32 _, _, _, _ = cfwPtr, hPtr, i, iPtr iPtr = interp i = int64(1) for { if !(i < objc) { break } /* * Ignore argument words without line information (= dynamic). If they * are variables they may have location information associated with * that, either through globally recorded 'set' invocations, or * literals in bytecode. Either way there is no need to record * something here. */ if *(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(cfPtr)).Fline + uintptr(i)*8)) < 0 { goto _1 } hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr)).FcreateProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { /* * The word is not on the stack yet, remember the current location * and initialize references. */ cfwPtr = XTcl_Alloc(tls, uint64(24)) (*TCFWord)(unsafe.Pointer(cfwPtr)).FframePtr = cfPtr (*TCFWord)(unsafe.Pointer(cfwPtr)).Fword = i (*TCFWord)(unsafe.Pointer(cfwPtr)).FrefCount = int64(1) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cfwPtr } else { /* * The word is already on the stack, its current location is not * relevant. Just remember the reference to prevent early removal. */ cfwPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData (*TCFWord)(unsafe.Pointer(cfwPtr)).FrefCount++ } goto _1 _1: ; i++ } } /* *---------------------------------------------------------------------- * * TclArgumentRelease -- * * This procedure is a helper for the TIP #280 uplevel extension. It * removes the location references for the arguments of a command just * done. Usage is counted down, the data is removed only when no user is * left over. * * Results: * None. * * Side effects: * May release memory. * * TIP #280 *---------------------------------------------------------------------- */ func XTclArgumentRelease(tls *libc.TLS, interp uintptr, objv uintptr, objc TTcl_Size) { var cfwPtr, hPtr, iPtr, v3 uintptr var i, v2 TTcl_Size _, _, _, _, _, _ = cfwPtr, hPtr, i, iPtr, v2, v3 iPtr = interp i = int64(1) for { if !(i < objc) { break } hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr)).FfindProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) if !(hPtr != 0) { goto _1 } cfwPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData v3 = cfwPtr + 16 v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 > int64(1) { goto _1 } XTclpFree(tls, cfwPtr) XTcl_DeleteHashEntry(tls, hPtr) goto _1 _1: ; i++ } } /* *---------------------------------------------------------------------- * * TclArgumentBCEnter -- * * This procedure is a helper for the TIP #280 uplevel extension. It * enters location references for the literal arguments of commands in * bytecode about to be invoked. Only the first entry has the actual * data, further entries simply count the usage up. * * Results: * None. * * Side effects: * May allocate memory. * * TIP #280 *---------------------------------------------------------------------- */ func XTclArgumentBCEnter(tls *libc.TLS, interp uintptr, objv uintptr, objc TTcl_Size, codePtr uintptr, cfPtr uintptr, cmd TTcl_Size, pc TTcl_Size) { bp := tls.Alloc(16) defer tls.Free(16) var cfwPtr, ePtr, eclPtr, hPtr, hePtr, iPtr, lastPtr uintptr var word TTcl_Size var _ /* isNew at bp+0 */ int32 _, _, _, _, _, _, _, _ = cfwPtr, ePtr, eclPtr, hPtr, hePtr, iPtr, lastPtr, word lastPtr = libc.UintptrFromInt32(0) iPtr = interp hePtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr)).FfindProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr, codePtr) if !(hePtr != 0) { return } eclPtr = (*TTcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData ePtr = (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(cmd)*32 /* * ePtr->nline is the number of words originally parsed. * * objc is the number of elements getting invoked. * * If they are not the same, we arrived here by compiling an * ensemble dispatch. Ensemble subcommands that lead to script * evaluation are not supposed to get compiled, because a command * such as [info level] in the script can expose some of the dispatch * shenanigans. This means that we don't have to tend to the * housekeeping, and can escape now. */ if (*TECL)(unsafe.Pointer(ePtr)).Fnline != objc { return } /* * Having disposed of the ensemble cases, we can state... * A few truths ... * (1) ePtr->nline == objc * (2) (ePtr->line[word] < 0) => !literal, for all words * (3) (word == 0) => !literal * * Item (2) is why we can use objv to get the literals, and do not * have to save them at compile time. */ word = int64(1) for { if !(word < objc) { break } if *(*TTcl_Size)(unsafe.Pointer((*TECL)(unsafe.Pointer(ePtr)).Fline + uintptr(word)*8)) >= 0 { hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr)).FcreateProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(word)*8)), bp) cfwPtr = XTcl_Alloc(tls, uint64(48)) (*TCFWordBC)(unsafe.Pointer(cfwPtr)).FframePtr = cfPtr (*TCFWordBC)(unsafe.Pointer(cfwPtr)).Fobj = *(*uintptr)(unsafe.Pointer(objv + uintptr(word)*8)) (*TCFWordBC)(unsafe.Pointer(cfwPtr)).Fpc = pc (*TCFWordBC)(unsafe.Pointer(cfwPtr)).Fword = word (*TCFWordBC)(unsafe.Pointer(cfwPtr)).FnextPtr = lastPtr lastPtr = cfwPtr if *(*int32)(unsafe.Pointer(bp)) != 0 { /* * The word is not on the stack yet, remember the current * location and initialize references. */ (*TCFWordBC)(unsafe.Pointer(cfwPtr)).FprevPtr = libc.UintptrFromInt32(0) } else { /* * The object is already on the stack, however it may have * a different location now (literal sharing may map * multiple location to a single Tcl_Obj*. Save the old * information in the new structure. */ (*TCFWordBC)(unsafe.Pointer(cfwPtr)).FprevPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData } (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cfwPtr } goto _1 _1: ; word++ } /* for */ (*TCmdFrame)(unsafe.Pointer(cfPtr)).Flitarg = lastPtr } /* *---------------------------------------------------------------------- * * TclArgumentBCRelease -- * * This procedure is a helper for the TIP #280 uplevel extension. It * removes the location references for the literal arguments of commands * in bytecode just done. Usage is counted down, the data is removed only * when no user is left over. * * Results: * None. * * Side effects: * May release memory. * * TIP #280 *---------------------------------------------------------------------- */ func XTclArgumentBCRelease(tls *libc.TLS, interp uintptr, cfPtr uintptr) { var cfwPtr, hPtr, iPtr, nextPtr, xPtr uintptr _, _, _, _, _ = cfwPtr, hPtr, iPtr, nextPtr, xPtr iPtr = interp cfwPtr = (*TCmdFrame)(unsafe.Pointer(cfPtr)).Flitarg for cfwPtr != 0 { nextPtr = (*TCFWordBC)(unsafe.Pointer(cfwPtr)).FnextPtr hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr)).FfindProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr, (*TCFWordBC)(unsafe.Pointer(cfwPtr)).Fobj) xPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData if xPtr != cfwPtr { XTcl_Panic(tls, __ccgo_ts+8616, 0) } if (*TCFWordBC)(unsafe.Pointer(cfwPtr)).FprevPtr != 0 { (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = (*TCFWordBC)(unsafe.Pointer(cfwPtr)).FprevPtr } else { XTcl_DeleteHashEntry(tls, hPtr) } XTclpFree(tls, cfwPtr) cfwPtr = nextPtr } (*TCmdFrame)(unsafe.Pointer(cfPtr)).Flitarg = libc.UintptrFromInt32(0) } /* *---------------------------------------------------------------------- * * TclArgumentGet -- * * This procedure is a helper for the TIP #280 uplevel extension. It * finds the location references for a Tcl_Obj, if any. * * Results: * None. * * Side effects: * Writes found location information into the result arguments. * * TIP #280 *---------------------------------------------------------------------- */ func XTclArgumentGet(tls *libc.TLS, interp uintptr, obj uintptr, cfPtrPtr uintptr, wordPtr uintptr) { var cfwPtr, cfwPtr1, framePtr, hPtr, iPtr uintptr var v1 int32 var v2 bool _, _, _, _, _, _, _ = cfwPtr, cfwPtr1, framePtr, hPtr, iPtr, v1, v2 iPtr = interp /* * An object which either has no string rep or else is a canonical list is * guaranteed to have been generated dynamically: bail out, this cannot * have a usable absolute location. _Do not touch_ the information the set * up by the caller. It knows better than us. */ if v2 = !((*TTcl_Obj)(unsafe.Pointer(obj)).Fbytes != libc.UintptrFromInt32(0)); !v2 { if (*TTcl_Obj)(unsafe.Pointer(obj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { v1 = libc.BoolInt32((*TTcl_Obj)(unsafe.Pointer(obj)).Fbytes == libc.UintptrFromInt32(0) || (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(obj + 32))).Fptr1)).Fflags&int32(LISTSTORE_CANONICAL) != 0 || (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(obj + 32))).Fptr2 != libc.UintptrFromInt32(0)) } else { v1 = 0 } } if v2 || v1 != 0 { return } /* * First look for location information recorded in the argument * stack. That is nearest. */ hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr)).FfindProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLAPtr, obj) if hPtr != 0 { cfwPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData *(*int32)(unsafe.Pointer(wordPtr)) = int32((*TCFWord)(unsafe.Pointer(cfwPtr)).Fword) *(*uintptr)(unsafe.Pointer(cfPtrPtr)) = (*TCFWord)(unsafe.Pointer(cfwPtr)).FframePtr return } /* * Check if the Tcl_Obj has location information as a bytecode literal, in * that stack. */ hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr)).FfindProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineLABCPtr, obj) if hPtr != 0 { cfwPtr1 = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData framePtr = (*TCFWordBC)(unsafe.Pointer(cfwPtr1)).FframePtr (*(*struct { FcodePtr uintptr Fpc uintptr })(unsafe.Pointer(framePtr + 40))).Fpc = (*TByteCode)(unsafe.Pointer((*(*struct { FcodePtr uintptr Fpc uintptr })(unsafe.Pointer(framePtr + 40))).FcodePtr)).FcodeStart + uintptr((*TCFWordBC)(unsafe.Pointer(cfwPtr1)).Fpc) *(*uintptr)(unsafe.Pointer(cfPtrPtr)) = (*TCFWordBC)(unsafe.Pointer(cfwPtr1)).FframePtr *(*int32)(unsafe.Pointer(wordPtr)) = int32((*TCFWordBC)(unsafe.Pointer(cfwPtr1)).Fword) return } } /* *---------------------------------------------------------------------- * * Tcl_EvalObjEx, TclEvalObjEx -- * * Execute Tcl commands stored in a Tcl object. These commands are * compiled into bytecodes if necessary, unless TCL_EVAL_DIRECT is * specified. * * If the flag TCL_EVAL_DIRECT is passed in, the value of invoker * must be NULL. Support for non-NULL invokers in that mode has * been removed since it was unused and untested. Failure to * follow this limitation will lead to an assertion panic. * * Results: * The return value is one of the return codes defined in tcl.h (such as * TCL_OK), and the interpreter's result contains a value to supplement * the return code. * * Side effects: * The object is converted, if necessary, to a ByteCode object that holds * the bytecode instructions for the commands. Executing the commands * will almost certainly have side effects that depend on those commands. * * TIP #280 : Keep public API, internally extended API. *---------------------------------------------------------------------- */ func XTcl_EvalObjEx(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) (r int32) { /* Collection of OR-ed bits that control the * evaluation of the script. Supported values * are TCL_EVAL_GLOBAL and TCL_EVAL_DIRECT. */ return XTclEvalObjEx(tls, interp, objPtr, flags, libc.UintptrFromInt32(0), 0) } func XTclEvalObjEx(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32, invoker uintptr, word int32) (r int32) { /* Index of the word which is in objPtr. */ var result int32 var rootPtr uintptr _, _ = result, rootPtr result = TCL_OK rootPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr result = XTclNREvalObjEx(tls, interp, objPtr, flags, invoker, word) return XTclNRRunCallbacks(tls, interp, result, rootPtr) } func XTclNREvalObjEx(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32, invoker uintptr, word int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Index of the word which is in objPtr. */ var _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr2, codePtr, eoFramePtr, iPtr, listPtr, saveCLLocPtr, savedVarFramePtr, script, v10, v8 uintptr var allowExceptions, result, v1, v2 int32 var v11, v3, v7 bool var v5, v6 int64 var v9 TTcl_Size var _ /* _callbackPtr at bp+16 */ uintptr var _ /* _callbackPtr at bp+24 */ uintptr var _ /* numSrcBytes at bp+32 */ TTcl_Size var _ /* objc at bp+0 */ TTcl_Size var _ /* objv at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, allowExceptions, cachePtr, cachePtr1, cachePtr2, codePtr, eoFramePtr, iPtr, listPtr, result, saveCLLocPtr, savedVarFramePtr, script, v1, v10, v11, v2, v3, v5, v6, v7, v8, v9 iPtr = interp /* * This function consists of three independent blocks for: direct * evaluation of canonical lists, compilation and bytecode execution and * finally direct evaluation. Precisely one of these blocks will be run. */ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { v1 = libc.BoolInt32((*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes == libc.UintptrFromInt32(0) || (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1)).Fflags&int32(LISTSTORE_CANONICAL) != 0 || (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2 != libc.UintptrFromInt32(0)) } else { v1 = 0 } if v1 != 0 { eoFramePtr = libc.UintptrFromInt32(0) /* * Canonical List Optimization: In this case, we * can safely use Tcl_EvalObjv instead and get an appreciable * improvement in execution speed. This is because it allows us to * avoid a setFromAny step that would just pack everything into a * string and back out again. * * This also preserves any associations between list elements and * location information for such elements. */ /* * Shimmer protection! Always pass an unshared obj. The caller could * incr the refCount of objPtr AFTER calling us! To be completely safe * we always make a copy. The callback takes care of the refCounts for * both listPtr and objPtr. * * TODO: Create a test to demo this need, or eliminate it. * FIXME OPT: preserve just the internal rep? */ (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ listPtr = XTclListObjCopy(tls, interp, objPtr) (*TTcl_Obj)(unsafe.Pointer(listPtr)).FrefCount++ if word != -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { /* * TIP #280 Structures for tracking lines. As we know that this is * dynamic execution we ignore the invoker, even if known. * * TIP #280. We do _not_ compute all the line numbers for the * words in the command. For the eval of a pure list the most * sensible choice is to put all words on line 1. Given that we * neither need memory for them nor compute anything. 'line' is * left NULL. The two places using this information (TclInfoFrame, * and TclInitCompileEnv), are special-cased to use the proper * line number directly instead of accessing the 'line' array. * * Note that we use (word==INTMIN) to signal that no command frame * should be pushed, as needed by alias and ensemble redirections. */ eoFramePtr = XTclStackAlloc(tls, interp, uint64(88)) (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).Fnline = 0 (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).Fline = libc.UintptrFromInt32(0) (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).Ftype1 = TCL_LOCATION_EVAL if (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr == libc.UintptrFromInt32(0) { v2 = int32(1) } else { v2 = (*TCmdFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).Flevel + int32(1) } (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).Flevel = v2 (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).FframePtr = (*TInterp)(unsafe.Pointer(iPtr)).FframePtr (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).FnextPtr = (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).FcmdObj = objPtr (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).Fcmd = libc.UintptrFromInt32(0) (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).Flen1 = 0 (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).Fdata.Feval.Fpath = libc.UintptrFromInt32(0) (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr = eoFramePtr flags |= int32(TCL_EVAL_SOURCE_IN_FRAME) } XTclMarkTailcall(tls, interp) if v3 = interp == libc.UintptrFromInt32(0); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 16)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FprocPtr = __ccgo_fp(_TEOEx_ListCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)) = listPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 1*8)) = eoFramePtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 2*8)) = objPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2)).FspanStart } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1 + 40 + uintptr(v5)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 != 0 { v6 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2)).FspanLength } else { v6 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v6 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), listPtr, bp, bp+8) } return XTclNREvalObjv(tls, interp, *(*TTcl_Size)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), flags, libc.UintptrFromInt32(0)) } if !(flags&libc.Int32FromInt32(TCL_EVAL_DIRECT) != 0) { /* * Let the compiler/engine subsystem do the evaluation. * * TIP #280 The invoker provides us with the context for the script. * We transfer this to the byte code compiler. */ allowExceptions = (*TInterp)(unsafe.Pointer(iPtr)).FevalFlags & int32(TCL_ALLOW_EXCEPTIONS) savedVarFramePtr = libc.UintptrFromInt32(0) /* Saves old copy of * iPtr->varFramePtr in case * TCL_EVAL_GLOBAL was set. */ if XTclInterpReady(tls, interp) != TCL_OK { return int32(TCL_ERROR) } if flags&int32(TCL_EVAL_GLOBAL) != 0 { savedVarFramePtr = (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr = (*TInterp)(unsafe.Pointer(iPtr)).FrootFramePtr } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ codePtr = XTclCompileObj(tls, interp, objPtr, invoker, word) if v7 = interp == libc.UintptrFromInt32(0); !v7 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v7 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 24)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FprocPtr = __ccgo_fp(_TEOEx_ByteCodeCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8)) = savedVarFramePtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 1*8)) = objPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 2*8)) = uintptr(int64(allowExceptions)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 24)) return XTclNRExecuteByteCode(tls, interp, codePtr) } /* * Now we check if we have data about invisible continuation lines for * the script, and make it available to the direct script parser and * evaluator we are about to call, if so. * * It may be possible that the script Tcl_Obj* can be free'd while the * evaluator is using it, leading to the release of the associated * ContLineLoc structure as well. To ensure that the latter doesn't * happen we set a lock on it. We release this lock later in this * function, after the evaluator is done. The relevant "lineCLPtr" * hashtable is managed in the file "tclObj.c". * * Another important action is to save (and later restore) the * continuation line information of the caller, in case we are * executing nested commands in the eval/direct path. */ saveCLLocPtr = (*TInterp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr (*TInterp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr = XTclContinuationsGet(tls, objPtr) (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v8 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v8 = XTcl_GetStringFromObj(tls, objPtr, bp+32) } script = v8 result = XTcl_EvalEx(tls, interp, script, *(*TTcl_Size)(unsafe.Pointer(bp + 32)), flags) v10 = objPtr v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if !(v9 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v11 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v11 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v11 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, objPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = objPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, objPtr) } } (*TInterp)(unsafe.Pointer(iPtr)).FscriptCLLocPtr = saveCLLocPtr return result return r } func _TEOEx_ByteCodeCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var allowExceptions int32 var cachePtr, iPtr, objPtr, savedVarFramePtr, script, v1, v3 uintptr var v2 TTcl_Size var v4 bool var _ /* numSrcBytes at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _ = allowExceptions, cachePtr, iPtr, objPtr, savedVarFramePtr, script, v1, v2, v3, v4 iPtr = interp savedVarFramePtr = *(*uintptr)(unsafe.Pointer(data)) objPtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) allowExceptions = int32(int64(*(*uintptr)(unsafe.Pointer(data + 2*8)))) if (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels == 0 { if result == int32(TCL_RETURN) { result = XTclUpdateReturnInfo(tls, iPtr) } if result != TCL_OK && result != int32(TCL_ERROR) && !(allowExceptions != 0) { _ProcessUnexpectedResult(tls, interp, result) result = int32(TCL_ERROR) if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, objPtr, bp) } script = v1 XTcl_LogCommandInfo(tls, interp, script, script, *(*TTcl_Size)(unsafe.Pointer(bp))) } /* * We are returning to level 0, so should call TclResetCancellation. * Let us just unset the flags inline. */ *(*int32)(unsafe.Pointer(iPtr + 368)) &= ^(libc.Int32FromInt32(CANCELED) | libc.Int32FromInt32(TCL_CANCEL_UNWIND)) } (*TInterp)(unsafe.Pointer(iPtr)).FevalFlags = 0 /* * Restore the callFrame if this was a TCL_EVAL_GLOBAL. */ if savedVarFramePtr != 0 { (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr = savedVarFramePtr } v3 = objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if !(v2 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, objPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, objPtr) } } return result } func _TEOEx_ListCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { var cachePtr, cachePtr1, eoFramePtr, iPtr, listPtr, objPtr, v2, v5 uintptr var v1, v4 TTcl_Size var v3, v6 bool _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, eoFramePtr, iPtr, listPtr, objPtr, v1, v2, v3, v4, v5, v6 iPtr = interp listPtr = *(*uintptr)(unsafe.Pointer(data)) eoFramePtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) objPtr = *(*uintptr)(unsafe.Pointer(data + 2*8)) /* * Remove the cmdFrame */ if eoFramePtr != 0 { (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr = (*TCmdFrame)(unsafe.Pointer(eoFramePtr)).FnextPtr XTclStackFree(tls, interp, eoFramePtr) } v2 = objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, objPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = objPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, objPtr) } } v5 = listPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if !(v4 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(listPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(listPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(listPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(listPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, listPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = listPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, listPtr) } } return result } /* *---------------------------------------------------------------------- * * ProcessUnexpectedResult -- * * Function called by Tcl_EvalObj to set the interpreter's result value * to an appropriate error message when the code it evaluates returns an * unexpected result code (not TCL_OK and not TCL_ERROR) to the topmost * evaluation level. * * Results: * None. * * Side effects: * The interpreter result is set to an error message appropriate to the * result code. * *---------------------------------------------------------------------- */ func _ProcessUnexpectedResult(tls *libc.TLS, interp uintptr, returnCode int32) { bp := tls.Alloc(64) defer tls.Free(64) /* The unexpected result code. */ var _ /* buf at bp+0 */ [24]uint8 XTcl_ResetResult(tls, interp) if returnCode == int32(TCL_BREAK) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+8653, int64(-libc.Int32FromInt32(1)))) } else { if returnCode == int32(TCL_CONTINUE) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+8687, int64(-libc.Int32FromInt32(1)))) } else { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+8724, libc.VaList(bp+32, returnCode))) } } libc.X__builtin_snprintf(tls, bp, uint64(24), __ccgo_ts+260, libc.VaList(bp+32, returnCode)) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+8754, bp, libc.UintptrFromInt32(0))) } /* *--------------------------------------------------------------------------- * * Tcl_ExprLong, Tcl_ExprDouble, Tcl_ExprBoolean -- * * Functions to evaluate an expression and return its value in a * particular form. * * Results: * Each of the functions below returns a standard Tcl result. If an error * occurs then an error message is left in the interp's result. Otherwise * the value of the expression, in the appropriate form, is stored at * *ptr. If the expression had a result that was incompatible with the * desired form then an error is returned. * * Side effects: * None. * *--------------------------------------------------------------------------- */ func XTcl_ExprLong(tls *libc.TLS, interp uintptr, exprstring uintptr, ptr uintptr) (r int32) { /* Where to store result. */ var _objPtr, exprPtr, v2 uintptr var result int32 var v1 TTcl_Size _, _, _, _, _ = _objPtr, exprPtr, result, v1, v2 result = TCL_OK if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(exprstring))) == int32('\000') { /* * Legacy compatibility - return 0 for the zero-length string. */ *(*int64)(unsafe.Pointer(ptr)) = 0 } else { exprPtr = XTcl_NewStringObj(tls, exprstring, int64(-libc.Int32FromInt32(1))) (*TTcl_Obj)(unsafe.Pointer(exprPtr)).FrefCount++ result = XTcl_ExprLongObj(tls, interp, exprPtr, ptr) _objPtr = exprPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return result } func XTcl_ExprDouble(tls *libc.TLS, interp uintptr, exprstring uintptr, ptr uintptr) (r int32) { /* Where to store result. */ var _objPtr, exprPtr, v2 uintptr var result int32 var v1 TTcl_Size _, _, _, _, _ = _objPtr, exprPtr, result, v1, v2 result = TCL_OK if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(exprstring))) == int32('\000') { /* * Legacy compatibility - return 0 for the zero-length string. */ *(*float64)(unsafe.Pointer(ptr)) = float64(0) } else { exprPtr = XTcl_NewStringObj(tls, exprstring, int64(-libc.Int32FromInt32(1))) (*TTcl_Obj)(unsafe.Pointer(exprPtr)).FrefCount++ result = XTcl_ExprDoubleObj(tls, interp, exprPtr, ptr) _objPtr = exprPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } /* Discard the expression object. */ } return result } func XTcl_ExprBoolean(tls *libc.TLS, interp uintptr, exprstring uintptr, ptr uintptr) (r int32) { /* Where to store 0/1 result. */ var _objPtr, exprPtr, v2 uintptr var result int32 var v1 TTcl_Size _, _, _, _, _ = _objPtr, exprPtr, result, v1, v2 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(exprstring))) == int32('\000') { /* * An empty string. Just set the result boolean to 0 (false). */ *(*int32)(unsafe.Pointer(ptr)) = 0 return TCL_OK } else { exprPtr = XTcl_NewStringObj(tls, exprstring, int64(-libc.Int32FromInt32(1))) (*TTcl_Obj)(unsafe.Pointer(exprPtr)).FrefCount++ result = XTcl_ExprBooleanObj(tls, interp, exprPtr, ptr) _objPtr = exprPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return result } return r } /* *-------------------------------------------------------------- * * Tcl_ExprLongObj, Tcl_ExprDoubleObj, Tcl_ExprBooleanObj -- * * Functions to evaluate an expression in an object and return its value * in a particular form. * * Results: * Each of the functions below returns a standard Tcl result object. If * an error occurs then an error message is left in the interpreter's * result. Otherwise the value of the expression, in the appropriate * form, is stored at *ptr. If the expression had a result that was * incompatible with the desired form then an error is returned. * * Side effects: * None. * *-------------------------------------------------------------- */ func XTcl_ExprLongObj(tls *libc.TLS, interp uintptr, objPtr uintptr, ptr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Where to store long result. */ var _objPtr, _objPtr1, v2, v5 uintptr var result, v3 int32 var v1, v4 TTcl_Size var _ /* big at bp+32 */ Tmp_int var _ /* d at bp+16 */ float64 var _ /* internalPtr at bp+24 */ uintptr var _ /* resultPtr at bp+0 */ uintptr var _ /* type at bp+8 */ int32 _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, result, v1, v2, v3, v4, v5 result = XTcl_ExprObj(tls, interp, objPtr, bp) if result != TCL_OK { return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+24, bp+8) != TCL_OK { return int32(TCL_ERROR) } switch *(*int32)(unsafe.Pointer(bp + 8)) { case int32(TCL_NUMBER_DOUBLE): *(*float64)(unsafe.Pointer(bp + 16)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))) _objPtr = *(*uintptr)(unsafe.Pointer(bp)) v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } if XTcl_InitBignumFromDouble(tls, interp, *(*float64)(unsafe.Pointer(bp + 16)), bp+32) != TCL_OK { return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(bp)) = XTcl_NewBignumObj(tls, bp+32) /* FALLTHRU */ fallthrough case int32(TCL_NUMBER_INT): fallthrough case int32(TCL_NUMBER_BIG): if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*int64)(unsafe.Pointer(ptr)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetLongFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), ptr) } result = v3 case int32(TCL_NUMBER_NAN): XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+16) result = int32(TCL_ERROR) } _objPtr1 = *(*uintptr)(unsafe.Pointer(bp)) v5 = _objPtr1 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr1) } /* Discard the result object. */ return result } func XTcl_ExprDoubleObj(tls *libc.TLS, interp uintptr, objPtr uintptr, ptr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Where to store double result. */ var _objPtr, v2 uintptr var result int32 var v1 TTcl_Size var _ /* internalPtr at bp+16 */ uintptr var _ /* resultPtr at bp+0 */ uintptr var _ /* type at bp+8 */ int32 _, _, _, _ = _objPtr, result, v1, v2 result = XTcl_ExprObj(tls, interp, objPtr, bp) if result != TCL_OK { return int32(TCL_ERROR) } result = XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+16, bp+8) if result == TCL_OK { switch *(*int32)(unsafe.Pointer(bp + 8)) { case int32(TCL_NUMBER_NAN): result = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), ptr) case int32(TCL_NUMBER_DOUBLE): *(*float64)(unsafe.Pointer(ptr)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) result = TCL_OK default: result = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), ptr) } } _objPtr = *(*uintptr)(unsafe.Pointer(bp)) v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } /* Discard the result object. */ return result } func XTcl_ExprBooleanObj(tls *libc.TLS, interp uintptr, objPtr uintptr, ptr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Where to store 0/1 result. */ var _objPtr, v2 uintptr var result int32 var v1 TTcl_Size var _ /* resultPtr at bp+0 */ uintptr _, _, _, _ = _objPtr, result, v1, v2 result = XTcl_ExprObj(tls, interp, objPtr, bp) if result == TCL_OK { result = XTcl_GetBoolFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), ptr) _objPtr = *(*uintptr)(unsafe.Pointer(bp)) v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } /* Discard the result object. */ } return result } /* *---------------------------------------------------------------------- * * TclObjInvokeNamespace -- * * Object version: Invokes a Tcl command, given an objv/objc, from either * the exposed or hidden set of commands in the given interpreter. * * NOTE: The command is invoked in the global stack frame of the * interpreter or namespace, thus it cannot see any current state on the * stack of that interpreter. * * Results: * A standard Tcl result. * * Side effects: * Whatever the command does. * *---------------------------------------------------------------------- */ func XTclObjInvokeNamespace(tls *libc.TLS, interp uintptr, objc TTcl_Size, objv uintptr, nsPtr uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Combination of flags controlling the call: * TCL_INVOKE_HIDDEN, TCL_INVOKE_NO_UNKNOWN, * or TCL_INVOKE_NO_TRACEBACK. */ var result int32 var _ /* framePtr at bp+0 */ uintptr _ = result /* * Make the specified namespace the current namespace and invoke the * command. */ XTclPushStackFrame(tls, interp, bp, nsPtr, 0) result = XTclObjInvoke(tls, interp, objc, objv, flags) XTclPopStackFrame(tls, interp) return result } /* *---------------------------------------------------------------------- * * TclObjInvoke -- * * Invokes a Tcl command, given an objv/objc, from either the exposed or * the hidden sets of commands in the given interpreter. * * Results: * A standard Tcl object result. * * Side effects: * Whatever the command does. * *---------------------------------------------------------------------- */ func XTclObjInvoke(tls *libc.TLS, interp uintptr, objc TTcl_Size, objv uintptr, flags int32) (r int32) { /* Combination of flags controlling the call: * TCL_INVOKE_HIDDEN, TCL_INVOKE_NO_UNKNOWN, * or TCL_INVOKE_NO_TRACEBACK. */ if interp == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if objc < int64(1) || objv == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+8777, int64(-libc.Int32FromInt32(1)))) return int32(TCL_ERROR) } if flags&(libc.Int32FromInt32(1)< int64(1) { _objPtr = (*TInterp)(unsafe.Pointer(iPtr)).FerrorInfo v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } (*TInterp)(unsafe.Pointer(iPtr)).FerrorInfo = XTcl_DuplicateObj(tls, (*TInterp)(unsafe.Pointer(iPtr)).FerrorInfo) (*TTcl_Obj)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FerrorInfo)).FrefCount++ } XTcl_AppendToObj(tls, (*TInterp)(unsafe.Pointer(iPtr)).FerrorInfo, message, *(*TTcl_Size)(unsafe.Pointer(bp))) } _objPtr1 = objPtr v5 = _objPtr1 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } /* *---------------------------------------------------------------------- * * Tcl_VarEval -- * * Given a variable number of string arguments, concatenate them all * together and execute the result as a Tcl command. * * Results: * A standard Tcl return result. An error message or other result may be * left in the interp. * * Side effects: * Depends on what was done by the command. * *---------------------------------------------------------------------- */ func XTcl_VarEval(tls *libc.TLS, interp uintptr, va uintptr) (r int32) { bp := tls.Alloc(224) defer tls.Free(224) var argList Tva_list var result int32 var string1 uintptr var _ /* buf at bp+0 */ TTcl_DString _, _, _ = argList, result, string1 argList = va /* * Copy the strings one after the other into a single larger string. Use * stack-allocated space for small commands, but if the command gets too * large than call Tcl_Alloc to create the space. */ XTcl_DStringInit(tls, bp) for int32(1) != 0 { string1 = libc.VaUintptr(&argList) if string1 == libc.UintptrFromInt32(0) { break } XTcl_DStringAppend(tls, bp, string1, int64(-libc.Int32FromInt32(1))) } result = XTcl_EvalEx(tls, interp, (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1, int64(-libc.Int32FromInt32(1)), 0) XTcl_DStringFree(tls, bp) return result } /* *---------------------------------------------------------------------- * * Tcl_SetRecursionLimit -- * * Set the maximum number of recursive calls that may be active for an * interpreter at once. * * Results: * The return value is the old limit on nesting for interp. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_SetRecursionLimit(tls *libc.TLS, interp uintptr, depth TTcl_Size) (r TTcl_Size) { /* New value for maximum depth. */ var iPtr uintptr var old TTcl_Size _, _ = iPtr, old iPtr = interp old = (*TInterp)(unsafe.Pointer(iPtr)).FmaxNestingDepth if depth > 0 { (*TInterp)(unsafe.Pointer(iPtr)).FmaxNestingDepth = depth } return old } /* *---------------------------------------------------------------------- * * Tcl_AllowExceptions -- * * Sets a flag in an interpreter so that exceptions can occur in the next * call to Tcl_Eval without them being turned into errors. * * Results: * None. * * Side effects: * The TCL_ALLOW_EXCEPTIONS flag gets set in the interpreter's evalFlags * structure. See the reference documentation for more details. * *---------------------------------------------------------------------- */ func XTcl_AllowExceptions(tls *libc.TLS, interp uintptr) { /* Interpreter in which to set flag. */ var iPtr uintptr _ = iPtr iPtr = interp *(*int32)(unsafe.Pointer(iPtr + 256)) |= int32(TCL_ALLOW_EXCEPTIONS) } /* *---------------------------------------------------------------------- * * Tcl_GetVersion -- * * Get the Tcl major, minor, and patchlevel version numbers and the * release type. A patch is a release type TCL_FINAL_RELEASE with a * patchLevel > 0. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTcl_GetVersion(tls *libc.TLS, majorV uintptr, minorV uintptr, patchLevelV uintptr, type1 uintptr) { if majorV != libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(majorV)) = int32(TCL_MAJOR_VERSION) } if minorV != libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(minorV)) = TCL_MINOR_VERSION } if patchLevelV != libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(patchLevelV)) = int32(TCL_RELEASE_SERIAL) } if type1 != libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(type1)) = int32(TCL_FINAL_RELEASE) } } /* *---------------------------------------------------------------------- * * Math Functions -- * * This page contains the functions that implement all of the built-in * math functions for expressions. * * Results: * Each function returns TCL_OK if it succeeds and pushes an Tcl object * holding the result. If it fails it returns TCL_ERROR and leaves an * error message in the interpreter's result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _ExprCeilFunc(tls *libc.TLS, dummy7043 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Actual parameter list. */ var code int32 var _ /* big at bp+8 */ Tmp_int var _ /* d at bp+0 */ float64 _ = code if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } code = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) if code != TCL_OK { return int32(TCL_ERROR) } if XTcl_GetBignumFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) == TCL_OK { XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, XTclCeil(tls, bp+8))) XTclBN_mp_clear(tls, bp+8) } else { XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, libc.Xceil(tls, *(*float64)(unsafe.Pointer(bp))))) } return TCL_OK } func _ExprFloorFunc(tls *libc.TLS, dummy7083 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Actual parameter list. */ var code int32 var _ /* big at bp+8 */ Tmp_int var _ /* d at bp+0 */ float64 _ = code if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } code = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) if code != TCL_OK { return int32(TCL_ERROR) } if XTcl_GetBignumFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) == TCL_OK { XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, XTclFloor(tls, bp+8))) XTclBN_mp_clear(tls, bp+8) } else { XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, libc.Xfloor(tls, *(*float64)(unsafe.Pointer(bp))))) } return TCL_OK } func _ExprIsqrtFunc(tls *libc.TLS, dummy7123 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) /* Actual parameter list. */ var err Tmp_err var exact, v1, v2 int32 var _ /* big at bp+32 */ Tmp_int var _ /* d at bp+16 */ float64 var _ /* ptr at bp+0 */ uintptr var _ /* root at bp+56 */ Tmp_int var _ /* type at bp+8 */ int32 var _ /* w at bp+24 */ TTcl_WideInt _, _, _, _ = err, exact, v1, v2 exact = 0 /* Flag ==1 if the argument can be represented * in a double as an exact integer. */ /* * Check syntax. */ if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } /* * Make sure that the arg is a number. */ if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+8) != TCL_OK { return int32(TCL_ERROR) } switch *(*int32)(unsafe.Pointer(bp + 8)) { case int32(TCL_NUMBER_NAN): XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16) return int32(TCL_ERROR) case int32(TCL_NUMBER_DOUBLE): *(*float64)(unsafe.Pointer(bp + 16)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) if *(*float64)(unsafe.Pointer(bp + 16)) < libc.Float64FromInt32(0) { goto negarg } if *(*float64)(unsafe.Pointer(bp + 16)) <= float64(9.007199254740991e+15) { exact = int32(1) } if !(exact != 0) { if XTcl_InitBignumFromDouble(tls, interp, *(*float64)(unsafe.Pointer(bp + 16)), bp+32) != TCL_OK { return int32(TCL_ERROR) } } case int32(TCL_NUMBER_BIG): if XTcl_GetBignumFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+32) != TCL_OK { return int32(TCL_ERROR) } if (*Tmp_int)(unsafe.Pointer(bp+32)).Fsign != MP_ZPOS { v1 = int32(MP_YES) } else { v1 = MP_NO } if v1 != 0 { XTclBN_mp_clear(tls, bp+32) goto negarg } default: if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 24)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FinternalRep)) v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+24) } if v2 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_WideInt)(unsafe.Pointer(bp + 24)) < 0 { goto negarg } *(*float64)(unsafe.Pointer(bp + 16)) = float64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 24))) if *(*float64)(unsafe.Pointer(bp + 16)) < float64(9.007199254740991e+15) { exact = int32(1) } if !(exact != 0) { XTcl_GetBignumFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+32) } break } if exact != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64(libc.Xsqrt(tls, *(*float64)(unsafe.Pointer(bp + 16)))))) } else { err = XTclBN_mp_init(tls, bp+56) if err == MP_OKAY { err = XTclBN_mp_sqrt(tls, bp+32, bp+56) } XTclBN_mp_clear(tls, bp+32) if err != MP_OKAY { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewBignumObj(tls, bp+56)) } return TCL_OK goto negarg negarg: ; XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+8886, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, __ccgo_ts+8919, __ccgo_ts+8925, __ccgo_ts+8932, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } func _ExprSqrtFunc(tls *libc.TLS, dummy7229 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Actual parameter list. */ var code int32 var err Tmp_err var v1 uint64 var v3 bool var _ /* __u at bp+0 */ struct { F__i [0]uint64 F__f float64 } var _ /* big at bp+16 */ Tmp_int var _ /* d at bp+8 */ float64 var _ /* root at bp+40 */ Tmp_int _, _, _, _ = code, err, v1, v3 if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } code = XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) if code != TCL_OK { return int32(TCL_ERROR) } if v3 = *(*float64)(unsafe.Pointer(bp + 8)) >= float64(0); v3 { *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(bp + 8)) v1 = *(*uint64)(unsafe.Pointer(bp)) goto _2 _2: } if v3 && libc.BoolInt32(v1&(-libc.Uint64FromUint64(1)>>libc.Int32FromInt32(1)) == libc.Uint64FromUint64(0x7ff)<>libc.Int32FromInt32(1)) > libc.Uint64FromUint64(0x7ff)<>libc.Int32FromInt32(1)) == libc.Uint64FromUint64(0x7ff)< 0 { goto unChanged } else { if l == 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+40) } bytes = v1 for *(*TTcl_Size)(unsafe.Pointer(bp + 40)) != 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes))) == int32('-') { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, 0)) return TCL_OK } bytes++ *(*TTcl_Size)(unsafe.Pointer(bp + 40))-- } } goto unChanged } else { if l == libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))+libc.Uint64FromInt32(1)) { if uint64(8) > uint64(8) { *(*TTcl_WideUInt)(unsafe.Pointer(bp + 48)) = -libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) + libc.Uint64FromInt32(1))) if XTclBN_mp_init(tls, bp+16) != MP_OKAY || XTclBN_mp_unpack(tls, bp+16, uint64(1), int32(1), uint64(8), 0, uint64(0), bp+48) != MP_OKAY { return int32(TCL_ERROR) } if XTclBN_mp_neg(tls, bp+16, bp+16) != MP_OKAY { return int32(TCL_ERROR) } } else { if XTclBN_mp_init_i64(tls, bp+16, l) != MP_OKAY { return int32(TCL_ERROR) } } goto tooLarge } } } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, -l)) return TCL_OK } if *(*int32)(unsafe.Pointer(bp + 8)) == int32(TCL_NUMBER_DOUBLE) { *(*float64)(unsafe.Pointer(bp + 56)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) /* * We need to distinguish here between positive 0.0 and negative -0.0. * [Bug 2954959] */ if *(*float64)(unsafe.Pointer(bp + 56)) == -libc.Float64FromFloat64(0) { if !(libc.Xmemcmp(tls, bp+56, uintptr(unsafe.Pointer(&_poszero)), uint64(8)) != 0) { goto unChanged } } else { if *(*float64)(unsafe.Pointer(bp + 56)) > -libc.Float64FromFloat64(0) { goto unChanged } } XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, -*(*float64)(unsafe.Pointer(bp + 56)))) return TCL_OK } if !(*(*int32)(unsafe.Pointer(bp + 8)) == int32(TCL_NUMBER_BIG)) { goto _2 } if (*Tmp_int)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fsign != MP_ZPOS { v5 = int32(MP_YES) } else { v5 = MP_NO } if !(v5 != 0) { goto _3 } XTcl_GetBignumFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16) goto tooLarge tooLarge: ; if XTclBN_mp_neg(tls, bp+16, bp+16) != MP_OKAY { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewBignumObj(tls, bp+16)) goto _4 _3: ; goto unChanged unChanged: ; XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) _4: ; return TCL_OK _2: ; if *(*int32)(unsafe.Pointer(bp + 8)) == int32(TCL_NUMBER_NAN) { XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+64) return int32(TCL_ERROR) } return TCL_OK } var _poszero = float64(0) func _ExprBoolFunc(tls *libc.TLS, dummy7506 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Actual parameter vector. */ var _ /* value at bp+0 */ int32 if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTcl_GetBoolFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp) != TCL_OK { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(*(*int32)(unsafe.Pointer(bp)) != 0))) return TCL_OK } func _ExprDoubleFunc(tls *libc.TLS, dummy7527 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Actual parameter vector. */ var _ /* dResult at bp+0 */ float64 if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, *(*float64)(unsafe.Pointer(bp)))) return TCL_OK } func _ExprIntFunc(tls *libc.TLS, dummy7554 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Actual parameter vector. */ var result TTcl_WideInt var _ /* big at bp+24 */ Tmp_int var _ /* d at bp+0 */ float64 var _ /* ptr at bp+16 */ uintptr var _ /* type at bp+8 */ int32 _ = result if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16, bp+8) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 8)) == int32(TCL_NUMBER_DOUBLE) { *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) if *(*float64)(unsafe.Pointer(bp)) >= float64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) || *(*float64)(unsafe.Pointer(bp)) <= float64(libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))+libc.Uint64FromInt32(1))) { if XTcl_InitBignumFromDouble(tls, interp, *(*float64)(unsafe.Pointer(bp)), bp+24) != TCL_OK { /* Infinity */ return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewBignumObj(tls, bp+24)) return TCL_OK } else { result = int64(*(*float64)(unsafe.Pointer(bp))) XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, result)) return TCL_OK } } if *(*int32)(unsafe.Pointer(bp + 8)) != int32(TCL_NUMBER_NAN) { /* * All integers are already of integer type. */ XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) return TCL_OK } /* * Get the error message for NaN. */ XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) return int32(TCL_ERROR) } func _ExprWideFunc(tls *libc.TLS, dummy7610 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Actual parameter vector. */ var _ /* wResult at bp+0 */ TTcl_WideInt if _ExprIntFunc(tls, libc.UintptrFromInt32(0), interp, objc, objv) != TCL_OK { return int32(TCL_ERROR) } XTclGetWideBitsFromObj(tls, libc.UintptrFromInt32(0), XTcl_GetObjResult(tls, interp), bp) XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, *(*TTcl_WideInt)(unsafe.Pointer(bp)))) return TCL_OK } // C documentation // // /* // * Common implmentation of max() and min(). // */ func _ExprMaxMinFunc(tls *libc.TLS, dummy7631 uintptr, interp uintptr, objc int32, objv uintptr, op int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Comparison direction */ var i int32 var res uintptr var _ /* d at bp+0 */ float64 var _ /* ptr at bp+16 */ uintptr var _ /* type at bp+8 */ int32 _, _ = i, res if objc < int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } res = *(*uintptr)(unsafe.Pointer(objv + 1*8)) i = int32(1) for { if !(i < objc) { break } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+16, bp+8) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 8)) == int32(TCL_NUMBER_NAN) { /* * Get the error message for NaN. */ XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp) return int32(TCL_ERROR) } if XTclCompareTwoNumbers(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), res) == op { res = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) } goto _1 _1: ; i++ } XTcl_SetObjResult(tls, interp, res) return TCL_OK } func _ExprMaxFunc(tls *libc.TLS, dummy7672 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Actual parameter vector. */ return _ExprMaxMinFunc(tls, libc.UintptrFromInt32(0), interp, objc, objv, int32(MP_GT)) } func _ExprMinFunc(tls *libc.TLS, dummy7683 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Actual parameter vector. */ return _ExprMaxMinFunc(tls, libc.UintptrFromInt32(0), interp, objc, objv, -int32(1)) } func _ExprRandFunc(tls *libc.TLS, dummy7694 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Actual parameter vector. */ var cachePtr, iPtr, oResult uintptr var dResult float64 var tmp int64 var v1 bool _, _, _, _, _, _ = cachePtr, dResult, iPtr, oResult, tmp, v1 iPtr = interp if objc != int32(1) { _MathFuncWrongNumArgs(tls, interp, int32(1), objc, objv) return int32(TCL_ERROR) } if !((*TInterp)(unsafe.Pointer(iPtr)).Fflags&libc.Int32FromInt32(RAND_SEED_INITIALIZED) != 0) { *(*int32)(unsafe.Pointer(iPtr + 368)) |= int32(RAND_SEED_INITIALIZED) /* * To ensure different seeds in different threads (bug #416643), * take into consideration the thread this interp is running in. */ (*TInterp)(unsafe.Pointer(iPtr)).FrandSeed = libc.Int64FromUint64(XTclpGetClicks(tls) + uint64(XTcl_GetCurrentThread(tls))*uint64(4093)) /* * Make sure 1 <= randSeed <= (2^31) - 2. See below. */ *(*int64)(unsafe.Pointer(iPtr + 376)) &= int64(0x7FFFFFFF) if (*TInterp)(unsafe.Pointer(iPtr)).FrandSeed == 0 || (*TInterp)(unsafe.Pointer(iPtr)).FrandSeed == int64(0x7FFFFFFF) { *(*int64)(unsafe.Pointer(iPtr + 376)) ^= int64(123459876) } } /* * Generate the random number using the linear congruential generator * defined by the following recurrence: * seed = ( IA * seed ) mod IM * where IA is 16807 and IM is (2^31) - 1. The recurrence maps a seed in * the range [1, IM - 1] to a new seed in that same range. The recurrence * maps IM to 0, and maps 0 back to 0, so those two values must not be * allowed as initial values of seed. * * In order to avoid potential problems with integer overflow, the * recurrence is implemented in terms of additional constants IQ and IR * such that * IM = IA*IQ + IR * None of the operations in the implementation overflows a 32-bit signed * integer, and the C type long is guaranteed to be at least 32 bits wide. * * For more details on how this algorithm works, refer to the following * papers: * * S.K. Park & K.W. Miller, "Random number generators: good ones are hard * to find," Comm ACM 31(10):1192-1201, Oct 1988 * * W.H. Press & S.A. Teukolsky, "Portable random number generators," * Computers in Physics 6(5):522-524, Sep/Oct 1992. */ tmp = (*TInterp)(unsafe.Pointer(iPtr)).FrandSeed / int64(RAND_IQ) (*TInterp)(unsafe.Pointer(iPtr)).FrandSeed = int64(RAND_IA)*((*TInterp)(unsafe.Pointer(iPtr)).FrandSeed-tmp*int64(RAND_IQ)) - int64(RAND_IR)*tmp if (*TInterp)(unsafe.Pointer(iPtr)).FrandSeed < 0 { *(*int64)(unsafe.Pointer(iPtr + 376)) += int64(RAND_IM) } /* * Since the recurrence keeps seed values in the range [1, RAND_IM - 1], * dividing by RAND_IM yields a double in the range (0, 1). */ dResult = float64(float64((*TInterp)(unsafe.Pointer(iPtr)).FrandSeed) * (libc.Float64FromFloat64(1) / libc.Float64FromInt32(RAND_IM))) /* * Push a Tcl object with the result. */ if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { oResult = XTclThreadAllocObj(tls) } else { oResult = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oResult + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(oResult)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(oResult)).Fbytes = libc.UintptrFromInt32(0) *(*float64)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(oResult)).FinternalRep)) = dResult (*TTcl_Obj)(unsafe.Pointer(oResult)).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType)) XTcl_SetObjResult(tls, interp, oResult) return TCL_OK } func _ExprRoundFunc(tls *libc.TLS, dummy7787 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Parameter vector. */ var err Tmp_err var fractPart float64 var max, min, result TTcl_WideInt var _ /* big at bp+32 */ Tmp_int var _ /* d at bp+0 */ float64 var _ /* intPart at bp+24 */ float64 var _ /* ptr at bp+8 */ uintptr var _ /* type at bp+16 */ int32 _, _, _, _, _ = err, fractPart, max, min, result if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+16) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 16)) == int32(TCL_NUMBER_DOUBLE) { max = libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(1)) min = libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) + libc.Uint64FromInt32(1)) fractPart = libc.Xmodf(tls, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))), bp+24) if fractPart <= -libc.Float64FromFloat64(0.5) { min++ } else { if fractPart >= float64(0.5) { max-- } } if *(*float64)(unsafe.Pointer(bp + 24)) >= float64(max) || *(*float64)(unsafe.Pointer(bp + 24)) <= float64(min) { err = MP_OKAY if XTcl_InitBignumFromDouble(tls, interp, *(*float64)(unsafe.Pointer(bp + 24)), bp+32) != TCL_OK { /* Infinity */ return int32(TCL_ERROR) } if fractPart <= -libc.Float64FromFloat64(0.5) { err = XTclBN_mp_sub_d(tls, bp+32, uint32(1), bp+32) } else { if fractPart >= float64(0.5) { err = XTclBN_mp_add_d(tls, bp+32, uint32(1), bp+32) } } if err != MP_OKAY { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewBignumObj(tls, bp+32)) return TCL_OK } else { result = int64(*(*float64)(unsafe.Pointer(bp + 24))) if fractPart <= -libc.Float64FromFloat64(0.5) { result-- } else { if fractPart >= float64(0.5) { result++ } } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, result)) return TCL_OK } } if *(*int32)(unsafe.Pointer(bp + 16)) != int32(TCL_NUMBER_NAN) { /* * All integers are already rounded */ XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) return TCL_OK } /* * Get the error message for NaN. */ XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) return int32(TCL_ERROR) } func _ExprSrandFunc(tls *libc.TLS, dummy7866 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Parameter vector. */ var iPtr uintptr var _ /* w at bp+0 */ TTcl_WideInt _ = iPtr iPtr = interp *(*TTcl_WideInt)(unsafe.Pointer(bp)) = 0 /* Initialized to avoid compiler warning. */ /* * Convert argument and use it to reset the seed. */ if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTclGetWideBitsFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK { return int32(TCL_ERROR) } /* * Reset the seed. Make sure 1 <= randSeed <= 2^31 - 2. See comments in * ExprRandFunc for more details. */ *(*int32)(unsafe.Pointer(iPtr + 368)) |= int32(RAND_SEED_INITIALIZED) (*TInterp)(unsafe.Pointer(iPtr)).FrandSeed = *(*TTcl_WideInt)(unsafe.Pointer(bp)) & int64(0x7FFFFFFF) if (*TInterp)(unsafe.Pointer(iPtr)).FrandSeed == 0 || (*TInterp)(unsafe.Pointer(iPtr)).FrandSeed == int64(0x7FFFFFFF) { *(*int64)(unsafe.Pointer(iPtr + 376)) ^= int64(123459876) } /* * To avoid duplicating the random number generation code we simply clean * up our state and call the real random number function. That function * will always succeed. */ return _ExprRandFunc(tls, libc.UintptrFromInt32(0), interp, int32(1), objv) } /* *---------------------------------------------------------------------- * * Double Classification Functions -- * * This page contains the functions that implement all of the built-in * math functions for classifying IEEE doubles. * * These have to be a little bit careful while Tcl_GetDoubleFromObj() * rejects NaN values, which these functions *explicitly* accept. * * Results: * Each function returns TCL_OK if it succeeds and pushes an Tcl object * holding the result. If it fails it returns TCL_ERROR and leaves an * error message in the interpreter's result. * * Side effects: * None. * *---------------------------------------------------------------------- * * Older MSVC is supported by Tcl, but doesn't have fpclassify(). Of course. * But it does sometimes have _fpclass() which does almost the same job; if * even that is absent, we grobble around directly in the platform's binary * representation of double. * * The ClassifyDouble() function makes all that conform to a common API * (effectively the C99 standard API renamed), and just delegates to the * standard macro on platforms that do it correctly. */ func _ClassifyDouble(tls *libc.TLS, d float64) (r int32) { return libc.X__fpclassify(tls, d) } func _ExprIsFiniteFunc(tls *libc.TLS, dummy8055 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Actual parameter list */ var result int32 var _ /* d at bp+0 */ float64 var _ /* ptr at bp+8 */ uintptr var _ /* type at bp+16 */ int32 _ = result result = 0 if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+16) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 16)) != int32(TCL_NUMBER_NAN) { if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK { return int32(TCL_ERROR) } *(*int32)(unsafe.Pointer(bp + 16)) = _ClassifyDouble(tls, *(*float64)(unsafe.Pointer(bp))) result = libc.BoolInt32(*(*int32)(unsafe.Pointer(bp + 16)) != int32(FP_INFINITE) && *(*int32)(unsafe.Pointer(bp + 16)) != FP_NAN) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(result != 0))) return TCL_OK } func _ExprIsInfinityFunc(tls *libc.TLS, dummy8086 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Actual parameter list */ var result int32 var _ /* d at bp+0 */ float64 var _ /* ptr at bp+8 */ uintptr var _ /* type at bp+16 */ int32 _ = result result = 0 if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+16) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 16)) != int32(TCL_NUMBER_NAN) { if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK { return int32(TCL_ERROR) } result = libc.BoolInt32(_ClassifyDouble(tls, *(*float64)(unsafe.Pointer(bp))) == int32(FP_INFINITE)) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(result != 0))) return TCL_OK } func _ExprIsNaNFunc(tls *libc.TLS, dummy8116 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Actual parameter list */ var result int32 var _ /* d at bp+0 */ float64 var _ /* ptr at bp+8 */ uintptr var _ /* type at bp+16 */ int32 _ = result result = int32(1) if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+16) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 16)) != int32(TCL_NUMBER_NAN) { if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK { return int32(TCL_ERROR) } result = libc.BoolInt32(_ClassifyDouble(tls, *(*float64)(unsafe.Pointer(bp))) == FP_NAN) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(result != 0))) return TCL_OK } func _ExprIsNormalFunc(tls *libc.TLS, dummy8146 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Actual parameter list */ var result int32 var _ /* d at bp+0 */ float64 var _ /* ptr at bp+8 */ uintptr var _ /* type at bp+16 */ int32 _ = result result = 0 if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+16) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 16)) != int32(TCL_NUMBER_NAN) { if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK { return int32(TCL_ERROR) } result = libc.BoolInt32(_ClassifyDouble(tls, *(*float64)(unsafe.Pointer(bp))) == int32(FP_NORMAL)) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(result != 0))) return TCL_OK } func _ExprIsSubnormalFunc(tls *libc.TLS, dummy8176 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Actual parameter list */ var result int32 var _ /* d at bp+0 */ float64 var _ /* ptr at bp+8 */ uintptr var _ /* type at bp+16 */ int32 _ = result result = 0 if objc != int32(2) { _MathFuncWrongNumArgs(tls, interp, int32(2), objc, objv) return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+16) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 16)) != int32(TCL_NUMBER_NAN) { if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK { return int32(TCL_ERROR) } result = libc.BoolInt32(_ClassifyDouble(tls, *(*float64)(unsafe.Pointer(bp))) == int32(FP_SUBNORMAL)) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(result != 0))) return TCL_OK } func _ExprIsUnorderedFunc(tls *libc.TLS, dummy8206 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Actual parameter list */ var d float64 var result int32 var _ /* ptr at bp+0 */ uintptr var _ /* type at bp+8 */ int32 _, _ = d, result result = 0 if objc != int32(3) { _MathFuncWrongNumArgs(tls, interp, int32(3), objc, objv) return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp, bp+8) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 8)) == int32(TCL_NUMBER_NAN) { result = int32(1) } else { d = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) result = libc.BoolInt32(_ClassifyDouble(tls, d) == FP_NAN) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp, bp+8) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 8)) == int32(TCL_NUMBER_NAN) { result |= int32(1) } else { d = *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) result |= libc.BoolInt32(_ClassifyDouble(tls, d) == FP_NAN) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(result != 0))) return TCL_OK } func _FloatClassifyObjCmd(tls *libc.TLS, dummy8247 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Actual parameter list */ var cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, objPtr uintptr var v10, v11, v12, v8, v9 bool var _ /* d at bp+0 */ float64 var _ /* ptr at bp+8 */ uintptr var _ /* type at bp+16 */ int32 _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, objPtr, v10, v11, v12, v8, v9 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+8974) return int32(TCL_ERROR) } if XTcl_GetNumberFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+16) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 16)) == int32(TCL_NUMBER_NAN) { goto gotNaN } else { if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK { return int32(TCL_ERROR) } } switch _ClassifyDouble(tls, *(*float64)(unsafe.Pointer(bp))) { case int32(FP_INFINITE): goto _1 case FP_NAN: goto _2 case int32(FP_NORMAL): goto _3 case int32(FP_SUBNORMAL): goto _4 case int32(FP_ZERO): goto _5 default: goto _6 } goto _7 _1: ; if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 if libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, __ccgo_ts+8985, libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(9) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) goto _7 _2: ; goto gotNaN gotNaN: ; if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, __ccgo_ts+8994, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) goto _7 _3: ; if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 if libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, __ccgo_ts+8998, libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(7) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) goto _7 _4: ; if v11 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v11 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v11 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 if libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, __ccgo_ts+9005, libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(10) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) goto _7 _5: ; if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, __ccgo_ts+765, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) goto _7 _6: ; XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+9015, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(bp))))) return int32(TCL_ERROR) _7: ; XTcl_SetObjResult(tls, interp, objPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * MathFuncWrongNumArgs -- * * Generate an error message when a math function presents the wrong * number of arguments. * * Results: * None. * * Side effects: * An error message is stored in the interpreter result. * *---------------------------------------------------------------------- */ func _MathFuncWrongNumArgs(tls *libc.TLS, interp uintptr, expected int32, found int32, objv uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* Actual parameter vector. */ var name, tail, v1, v2 uintptr _, _, _, _ = name, tail, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), libc.UintptrFromInt32(0)) } name = v1 tail = name + uintptr(libc.Xstrlen(tls, name)) for tail > name+uintptr(1) { tail-- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(tail))) == int32(':') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(tail + uintptr(-libc.Int32FromInt32(1))))) == int32(':') { name = tail + uintptr(1) break } } if found < expected { v2 = __ccgo_ts + 9045 } else { v2 = __ccgo_ts + 9056 } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+9065, libc.VaList(bp+8, v2, name))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+9101, libc.UintptrFromInt32(0))) } /* *---------------------------------------------------------------------- * * Tcl_NRCallObjProc -- * * This function calls an objProc directly while managing things properly * if it happens to be an NR objProc. It is meant to be used by extenders * that provide an NR implementation of a command, as this function * permits a trivial coding of the non-NR objProc. * * Results: * The return value is a standard Tcl completion code such as TCL_OK or * TCL_ERROR. A result or error message is left in interp's result. * * Side effects: * Depends on the objProc. * *---------------------------------------------------------------------- */ func XTcl_NRCallObjProc(tls *libc.TLS, interp uintptr, objProc uintptr, clientData uintptr, objc TTcl_Size, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, rootPtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _ = _objPtr, cachePtr, rootPtr, v1 rootPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_Dispatch) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = objProc *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = clientData *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = uintptr(objc) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = objv (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return XTclNRRunCallbacks(tls, interp, TCL_OK, rootPtr) } func _wrapperNRObjProc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var info, proc uintptr _, _ = info, proc info = clientData clientData = (*TCmdWrapperInfo)(unsafe.Pointer(info)).FclientData proc = (*TCmdWrapperInfo)(unsafe.Pointer(info)).Fproc XTclpFree(tls, info) if objc < 0 { objc = -int32(1) } return (*(*func(*libc.TLS, uintptr, uintptr, TTcl_Size, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, clientData, interp, int64(objc), objv) } func XTcl_NRCallObjProc2(tls *libc.TLS, interp uintptr, objProc uintptr, clientData uintptr, objc TTcl_Size, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, info, rootPtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _ = _objPtr, cachePtr, info, rootPtr, v1 if objc > int64(INT_MAX) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+9111) return int32(TCL_ERROR) } rootPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr info = XTcl_Alloc(tls, uint64(40)) (*TCmdWrapperInfo)(unsafe.Pointer(info)).FclientData = clientData (*TCmdWrapperInfo)(unsafe.Pointer(info)).Fproc = objProc if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_Dispatch) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = __ccgo_fp(_wrapperNRObjProc) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = info *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = uintptr(objc) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = objv (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return XTclNRRunCallbacks(tls, interp, TCL_OK, rootPtr) } /* *---------------------------------------------------------------------- * * Tcl_NRCreateCommand -- * * Define a new NRE-enabled object-based command in a command table. * * Results: * The return value is a token for the command, which can be used in * future calls to Tcl_GetCommandName. * * Side effects: * If no command named "cmdName" already exists for interp, one is * created. Otherwise, if a command does exist, then if the object-based * Tcl_ObjCmdProc is InvokeStringCommand, we assume Tcl_CreateCommand * was called previously for the same command and just set its * Tcl_ObjCmdProc to the argument "proc"; otherwise, we delete the old * command. * * In the future, during bytecode evaluation when "cmdName" is seen as * the name of a command by Tcl_EvalObj or Tcl_Eval, the object-based * Tcl_ObjCmdProc proc will be called. When the command is deleted from * the table, deleteProc will be called. See the manual entry for details * on the calling sequence. * *---------------------------------------------------------------------- */ func _cmdWrapperNreProc(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var info uintptr _ = info info = clientData if objc < 0 { objc = -int32(1) } return (*(*func(*libc.TLS, uintptr, uintptr, TTcl_Size, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TCmdWrapperInfo)(unsafe.Pointer(info)).FnreProc})))(tls, (*TCmdWrapperInfo)(unsafe.Pointer(info)).FclientData, interp, int64(objc), objv) } func XTcl_NRCreateCommand2(tls *libc.TLS, interp uintptr, cmdName uintptr, proc uintptr, nreProc uintptr, clientData uintptr, deleteProc uintptr) (r TTcl_Command) { /* If not NULL, gives a function to call when * this command is deleted. */ var info, v1, v2 uintptr _, _, _ = info, v1, v2 info = XTcl_Alloc(tls, uint64(40)) (*TCmdWrapperInfo)(unsafe.Pointer(info)).Fproc = proc (*TCmdWrapperInfo)(unsafe.Pointer(info)).FclientData = clientData (*TCmdWrapperInfo)(unsafe.Pointer(info)).FnreProc = nreProc (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteProc = deleteProc (*TCmdWrapperInfo)(unsafe.Pointer(info)).FdeleteData = clientData if proc != 0 { v1 = __ccgo_fp(_cmdWrapperProc) } else { v1 = libc.UintptrFromInt32(0) } if nreProc != 0 { v2 = __ccgo_fp(_cmdWrapperNreProc) } else { v2 = libc.UintptrFromInt32(0) } return XTcl_NRCreateCommand(tls, interp, cmdName, v1, v2, info, __ccgo_fp(_cmdWrapperDeleteProc)) } func XTcl_NRCreateCommand(tls *libc.TLS, interp uintptr, cmdName uintptr, proc uintptr, nreProc uintptr, clientData uintptr, deleteProc uintptr) (r TTcl_Command) { /* If not NULL, gives a function to call when * this command is deleted. */ var cmdPtr uintptr _ = cmdPtr cmdPtr = XTcl_CreateObjCommand(tls, interp, cmdName, proc, clientData, deleteProc) (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc = nreProc return cmdPtr } func XTclNRCreateCommandInNs(tls *libc.TLS, interp uintptr, cmdName uintptr, nsPtr uintptr, proc uintptr, nreProc uintptr, clientData uintptr, deleteProc uintptr) (r TTcl_Command) { var cmdPtr uintptr _ = cmdPtr cmdPtr = XTclCreateObjCommandInNs(tls, interp, cmdName, nsPtr, proc, clientData, deleteProc) (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc = nreProc return cmdPtr } /**************************************************************************** * Stuff for the public api ****************************************************************************/ func XTcl_NREvalObj(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) (r int32) { return XTclNREvalObjEx(tls, interp, objPtr, flags, libc.UintptrFromInt32(0), -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) } func XTcl_NREvalObjv(tls *libc.TLS, interp uintptr, objc TTcl_Size, objv uintptr, flags int32) (r int32) { /* Collection of OR-ed bits that control the * evaluation of the script. Only * TCL_EVAL_GLOBAL, TCL_EVAL_INVOKE and * TCL_EVAL_NOERR are currently supported. */ return XTclNREvalObjv(tls, interp, objc, objv, flags, libc.UintptrFromInt32(0)) } func XTcl_NRCmdSwap(tls *libc.TLS, interp uintptr, cmd TTcl_Command, objc TTcl_Size, objv uintptr, flags int32) (r int32) { return XTclNREvalObjv(tls, interp, objc, objv, flags|int32(TCL_EVAL_NOERR), cmd) } /***************************************************************************** * Tailcall related code ***************************************************************************** * * The steps of the tailcall dance are as follows: * * 1. when [tailcall] is invoked, it stores the corresponding callback in * the current CallFrame and returns TCL_RETURN * 2. when the CallFrame is popped, it calls TclSetTailcall to store the * callback in the proper NRCommand callback - the spot where the command * that pushed the CallFrame is completely cleaned up * 3. when the NRCommand callback runs, it schedules the tailcall callback * to run immediately after it returns * * One delicate point is to properly define the NRCommand where the tailcall * will execute. There are functions whose purpose is to help define the * precise spot: * TclMarkTailcall: if the NEXT command to be pushed tailcalls, execution * should continue right here * TclSkipTailcall: if the NEXT command to be pushed tailcalls, execution * should continue after the CURRENT command is fully returned ("skip * the next command: we are redirecting to it, tailcalls should run * after WE return") * TclPushTailcallPoint: the search for a tailcalling spot cannot traverse * this point. This is special for OO, as some of the oo constructs * that behave like commands may not push an NRCommand callback. */ func XTclMarkTailcall(tls *libc.TLS, interp uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, iPtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _ = _objPtr, cachePtr, iPtr, v1 iPtr = interp if (*TInterp)(unsafe.Pointer(iPtr)).FdeferredCallbacks == libc.UintptrFromInt32(0) { if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_NRCommand) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) (*TInterp)(unsafe.Pointer(iPtr)).FdeferredCallbacks = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr } } func XTclSkipTailcall(tls *libc.TLS, interp uintptr) { var iPtr uintptr _ = iPtr iPtr = interp XTclMarkTailcall(tls, interp) *(*uintptr)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FdeferredCallbacks + 8 + 1*8)) = uintptr(int64(libc.Int32FromInt32(1))) } func XTclPushTailcallPoint(tls *libc.TLS, interp uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _ = _objPtr, cachePtr, v1 if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_NRCommand) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) (*TInterp)(unsafe.Pointer(interp)).FnumLevels++ } /* *---------------------------------------------------------------------- * * TclSetTailcall -- * * Splice a tailcall command in the proper spot of the NRE callback * stack, so that it runs at the right time. * *---------------------------------------------------------------------- */ func XTclSetTailcall(tls *libc.TLS, interp uintptr, listPtr uintptr) { var runPtr uintptr _ = runPtr runPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr for { if !(runPtr != 0) { break } if (*TNRE_callback)(unsafe.Pointer(runPtr)).FprocPtr == __ccgo_fp(_NRCommand) && !(*(*uintptr)(unsafe.Pointer(runPtr + 8 + 1*8)) != 0) { break } goto _1 _1: ; runPtr = (*TNRE_callback)(unsafe.Pointer(runPtr)).FnextPtr } if !(runPtr != 0) { XTcl_Panic(tls, __ccgo_ts+9118, 0) } *(*uintptr)(unsafe.Pointer(runPtr + 8 + 1*8)) = listPtr } /* *---------------------------------------------------------------------- * * TclNRTailcallObjCmd -- * * Prepare the tailcall as a list and store it in the current * varFrame. When the frame is later popped the tailcall will be spliced * at the proper place. * * Results: * The first NRCommand callback that is not marked to be skipped is * updated so that its data[1] field contains the tailcall list. * *---------------------------------------------------------------------- */ func XTclNRTailcallObjCmd(tls *libc.TLS, dummy8827 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, iPtr, listPtr, nsPtr, v2 uintptr var v1 TTcl_Size _, _, _, _, _, _ = _objPtr, iPtr, listPtr, nsPtr, v1, v2 iPtr = interp if objc < int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+9183) return int32(TCL_ERROR) } if !((*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FisProcCallFrame&libc.Int32FromInt32(1) != 0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9203, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+9261, __ccgo_ts+9270, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Invocation without args just clears a scheduled tailcall; invocation * with an argument replaces any previously scheduled tailcall. */ if (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FtailcallPtr != 0 { _objPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FtailcallPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FtailcallPtr = libc.UintptrFromInt32(0) } /* * Create the callback to actually evaluate the tailcalled * command, then set it in the varFrame so that PopCallFrame can use it * at the proper time. */ if objc > int32(1) { nsPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr /* * The tailcall data is in a Tcl list: the first element is the * namespace, the rest the command to be tailcalled. */ listPtr = XTcl_NewListObj(tls, int64(objc), objv) XTclListObjSetElement(tls, libc.UintptrFromInt32(0), listPtr, 0, XTclNewNamespaceObj(tls, nsPtr)) (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FtailcallPtr = listPtr } return int32(TCL_RETURN) } /* *---------------------------------------------------------------------- * * TclNRTailcallEval -- * * This NREcallback actually causes the tailcall to be evaluated. * *---------------------------------------------------------------------- */ func XTclNRTailcallEval(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, _objPtr1, cachePtr, iPtr, listPtr, nsObjPtr, v5 uintptr var v2, v3 int64 var v4 TTcl_Size var v6 bool var _ /* _callbackPtr at bp+24 */ uintptr var _ /* nsPtr at bp+0 */ uintptr var _ /* objc at bp+8 */ TTcl_Size var _ /* objv at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, iPtr, listPtr, nsObjPtr, v2, v3, v4, v5, v6 iPtr = interp listPtr = *(*uintptr)(unsafe.Pointer(data)) if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v3 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, interp, listPtr, bp+8, bp+16) } nsObjPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))) if result == TCL_OK { result = XTclGetNamespaceFromObj(tls, interp, nsObjPtr, bp) } if result != TCL_OK { /* * Tailcall execution was preempted, eg by an intervening catch or by * a now-gone namespace: cleanup and return. */ _objPtr = listPtr v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } return result } /* * Perform the tailcall */ XTclMarkTailcall(tls, interp) if v6 = interp == libc.UintptrFromInt32(0); !v6 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v6 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 24)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FprocPtr = __ccgo_fp(XTclNRReleaseValues) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8)) = listPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 24)) (*TInterp)(unsafe.Pointer(iPtr)).FlookupNsPtr = *(*uintptr)(unsafe.Pointer(bp)) return XTclNREvalObjv(tls, interp, *(*TTcl_Size)(unsafe.Pointer(bp + 8))-int64(1), *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(1)*8, 0, libc.UintptrFromInt32(0)) } func XTclNRReleaseValues(tls *libc.TLS, data uintptr, dummy8931 uintptr, result int32) (r int32) { var _objPtr, v2 uintptr var i int32 var v1 TTcl_Size _, _, _, _ = _objPtr, i, v1, v2 i = 0 for i < int32(4) { if *(*uintptr)(unsafe.Pointer(data + uintptr(i)*8)) != 0 { _objPtr = *(*uintptr)(unsafe.Pointer(data + uintptr(i)*8)) v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } else { break } i++ } return result } func XTcl_NRAddCallback(tls *libc.TLS, interp uintptr, postProcPtr uintptr, data0 uintptr, data1 uintptr, data2 uintptr, data3 uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _ = _objPtr, cachePtr, v1 if !(postProcPtr != 0) { XTcl_Panic(tls, __ccgo_ts+9278, 0) } if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = postProcPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = data0 *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = data1 *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = data2 *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = data3 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) } /* *---------------------------------------------------------------------- * * TclNRCoroutineObjCmd -- (and friends) * * This object-based function is invoked to process the "coroutine" Tcl * command. It is heavily based on "apply". * * Results: * A standard Tcl object result value. * * Side effects: * A new procedure gets created. * * ** FIRST EXPERIMENTAL IMPLEMENTATION ** * * It is fairly amateurish and not up to our standards - mainly in terms of * error messages and [info] interaction. Just to test the infrastructure in * teov and tebc. *---------------------------------------------------------------------- */ func XTclNRYieldObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, cachePtr, corPtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _ = _objPtr, cachePtr, corPtr, v1 corPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcorPtr if objc > int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+9317) return int32(TCL_ERROR) } if !(corPtr != 0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9331, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+9371, __ccgo_ts+9381, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } if objc == int32(2) { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) } if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(XTclNRCoroutineActivateCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = corPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = clientData *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return TCL_OK } func XTclNRYieldToObjCmd(tls *libc.TLS, dummy9019 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var corPtr, listPtr, nsPtr uintptr _, _, _ = corPtr, listPtr, nsPtr corPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcorPtr nsPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+9395) return int32(TCL_ERROR) } if !(corPtr != 0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9413, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+9371, __ccgo_ts+9381, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } if (*TNamespace)(unsafe.Pointer(nsPtr)).Fflags&int32(NS_DYING) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9455, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+9371, __ccgo_ts+9491, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Add the tailcall in the caller env, then just yield. * * This is essentially code from TclNRTailcallObjCmd */ listPtr = XTcl_NewListObj(tls, int64(objc), objv) XTclListObjSetElement(tls, libc.UintptrFromInt32(0), listPtr, 0, XTclNewNamespaceObj(tls, nsPtr)) /* * Add the callback in the caller's env, then instruct TEBC to yield. */ (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr /* Not calling Tcl_IncrRefCount(listPtr) here because listPtr is private */ XTclSetTailcall(tls, interp, listPtr) (*TCoroutineData)(unsafe.Pointer(corPtr)).FyieldPtr = listPtr (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr return XTclNRYieldObjCmd(tls, uintptr(int64(libc.Int32FromInt32(1))), interp, int32(1), objv) } func _RewindCoroutineCallback(tls *libc.TLS, data uintptr, interp uintptr, dummy9074 int32) (r int32) { return XTcl_RestoreInterpState(tls, interp, *(*uintptr)(unsafe.Pointer(data))) } func _RewindCoroutine(tls *libc.TLS, corPtr uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, interp uintptr var state TTcl_InterpState var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _ = _objPtr, cachePtr, interp, state, v1 interp = (*TExecEnv1)(unsafe.Pointer((*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).Finterp state = XTcl_SaveInterpState(tls, interp, result) (*TExecEnv1)(unsafe.Pointer((*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).Frewind = int32(1) if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_RewindCoroutineCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = state *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return XTclNRInterpCoroutine(tls, corPtr, interp, 0, libc.UintptrFromInt32(0)) } func _DeleteCoroutine(tls *libc.TLS, clientData uintptr) { var corPtr, interp, rootPtr uintptr _, _, _ = corPtr, interp, rootPtr corPtr = clientData interp = (*TExecEnv1)(unsafe.Pointer((*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).Finterp rootPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr if (*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel == libc.UintptrFromInt32(0) { XTclNRRunCallbacks(tls, interp, _RewindCoroutine(tls, corPtr, TCL_OK), rootPtr) } } func _NRCoroutineCallerCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { var cmdPtr, corPtr uintptr _, _ = cmdPtr, corPtr corPtr = *(*uintptr)(unsafe.Pointer(data)) cmdPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr /* * This is the last callback in the caller execEnv, right before switching * to the coroutine's */ if !((*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr != 0) { /* * The execEnv was wound down but not deleted for our sake. We finish * the job here. The caller context has already been restored. */ XTclpFree(tls, corPtr) return result } (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr = (*TInterp)(unsafe.Pointer(interp)).FframePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr = (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr = (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr = (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr (*TInterp)(unsafe.Pointer(interp)).FframePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr if (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_DYING) != 0 { /* * The command was deleted while it was running: wind down the * execEnv, this will do the complete cleanup. RewindCoroutine will * restore both the caller's context and interp state. */ return _RewindCoroutine(tls, corPtr, result) } return result } func _NRCoroutineExitCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { var cmdPtr, corPtr, v2 uintptr var v1 TTcl_Size _, _, _, _ = cmdPtr, corPtr, v1, v2 corPtr = *(*uintptr)(unsafe.Pointer(data)) cmdPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr /* * This runs at the bottom of the Coroutine's execEnv: it will be executed * when the coroutine returns or is wound down, but not when it yields. It * deletes the coroutine and restores the caller's environment. */ (*TCommand)(unsafe.Pointer(cmdPtr)).FdeleteProc = libc.UintptrFromInt32(0) XTcl_DeleteCommandFromToken(tls, interp, cmdPtr) v2 = cmdPtr + 16 v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclpFree(tls, cmdPtr) } (*TExecEnv1)(unsafe.Pointer((*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).FcorPtr = libc.UintptrFromInt32(0) XTclDeleteExecEnv(tls, (*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr) (*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr = libc.UintptrFromInt32(0) (*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel = libc.UintptrFromInt32(0) /* * #280. * Drop the coroutine-owned copy of the lineLABCPtr hashtable for literal * command arguments in bytecode. */ XTcl_DeleteHashTable(tls, (*TCoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr) XTclpFree(tls, (*TCoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr) (*TCoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr = libc.UintptrFromInt32(0) (*TInterp)(unsafe.Pointer(interp)).FframePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr (*TInterp)(unsafe.Pointer(interp)).FnumLevels++ return result } /* *---------------------------------------------------------------------- * * TclNRCoroutineActivateCallback -- * * This is the workhorse for coroutines: it implements both yield and * resume. * * It is important that both be implemented in the same callback: the * detection of the impossibility to suspend due to a busy C-stack relies * on the precise position of a local variable in the stack. We do not * want the compiler to play tricks on us, either by moving things around * or inlining. * *---------------------------------------------------------------------- */ func XTclNRCoroutineActivateCallback(tls *libc.TLS, data uintptr, interp uintptr, dummy9225 int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, _objPtr1, cachePtr, corPtr, runPtr, stackLevel, type1, v4 uintptr var numLevels, numLevels1, v3 TTcl_Size var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, corPtr, numLevels, numLevels1, runPtr, stackLevel, type1, v1, v3, v4 corPtr = *(*uintptr)(unsafe.Pointer(data)) stackLevel = _TclGetCStackPtr(tls) if !((*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel != 0) { /* * -- Coroutine is suspended -- * Push the callback to restore the caller's context on yield or * return. */ if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_NRCoroutineCallerCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = corPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) /* * Record the stackLevel at which the resume is happening, then swap * the interp's environment to make it suitable to run this coroutine. */ (*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel = stackLevel numLevels = (*TCoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels (*TCoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels = (*TInterp)(unsafe.Pointer(interp)).FnumLevels (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr = (*TInterp)(unsafe.Pointer(interp)).FframePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr = (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr = (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr = (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr (*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr = (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr (*TInterp)(unsafe.Pointer(interp)).FframePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr *(*TTcl_Size)(unsafe.Pointer(interp + 72)) += numLevels } else { /* * Coroutine is active: yield */ if (*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel != stackLevel { (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr if (*TCoroutineData)(unsafe.Pointer(corPtr)).FyieldPtr != 0 { runPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr for { if !(runPtr != 0) { break } if *(*uintptr)(unsafe.Pointer(runPtr + 8 + 1*8)) == (*TCoroutineData)(unsafe.Pointer(corPtr)).FyieldPtr { _objPtr1 = *(*uintptr)(unsafe.Pointer(runPtr + 8 + 1*8)) v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } *(*uintptr)(unsafe.Pointer(runPtr + 8 + 1*8)) = libc.UintptrFromInt32(0) (*TCoroutineData)(unsafe.Pointer(corPtr)).FyieldPtr = libc.UintptrFromInt32(0) break } goto _2 _2: ; runPtr = (*TNRE_callback)(unsafe.Pointer(runPtr)).FnextPtr } } (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9510, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+9371, __ccgo_ts+9537, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } type1 = *(*uintptr)(unsafe.Pointer(data + 1*8)) if type1 == libc.UintptrFromInt32(0) { (*TCoroutineData)(unsafe.Pointer(corPtr)).Fnargs = int64(-libc.Int32FromInt32(1)) } else { if type1 == uintptr(int64(libc.Int32FromInt32(1))) { (*TCoroutineData)(unsafe.Pointer(corPtr)).Fnargs = int64(-libc.Int32FromInt32(2)) } else { XTcl_Panic(tls, __ccgo_ts+9548, 0) } } (*TCoroutineData)(unsafe.Pointer(corPtr)).FyieldPtr = libc.UintptrFromInt32(0) (*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel = libc.UintptrFromInt32(0) numLevels1 = (*TInterp)(unsafe.Pointer(interp)).FnumLevels (*TInterp)(unsafe.Pointer(interp)).FnumLevels = (*TCoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels (*TCoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels = numLevels1 - (*TCoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr } return TCL_OK } /* *---------------------------------------------------------------------- * * CoroTypeObjCmd -- * * Implementation of [::tcl::unsupported::corotype] command. * *---------------------------------------------------------------------- */ func _CoroTypeObjCmd(tls *libc.TLS, dummy9316 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var cmdPtr, corPtr, v1 uintptr _, _, _ = cmdPtr, corPtr, v1 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+2290) return int32(TCL_ERROR) } /* * Look up the coroutine. */ cmdPtr = XTcl_GetCommandFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) if !(cmdPtr != 0) || (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc != __ccgo_fp(XTclNRInterpCoroutine) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9598, int64(-libc.Int32FromInt32(1)))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+9371, v1, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * An active coroutine is "active". Can't tell what it might do in the * future. */ corPtr = (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData if !((*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel == libc.UintptrFromInt32(0)) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9641, int64(-libc.Int32FromInt32(1)))) return TCL_OK } /* * Inactive coroutines are classified by the (effective) command used to * suspend them, which matters when you're injecting a probe. */ switch (*TCoroutineData)(unsafe.Pointer(corPtr)).Fnargs { case int64(-libc.Int32FromInt32(1)): XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+3522, int64(-libc.Int32FromInt32(1)))) return TCL_OK case int64(-libc.Int32FromInt32(2)): XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+5445, int64(-libc.Int32FromInt32(1)))) return TCL_OK default: XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9648, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+9371, __ccgo_ts+9671, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } return r } /* *---------------------------------------------------------------------- * * TclNRCoroInjectObjCmd, TclNRCoroProbeObjCmd -- * * Implementation of [coroinject] and [coroprobe] commands. * *---------------------------------------------------------------------- */ func _GetCoroutineFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, errMsg uintptr) (r uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var cmdPtr, v1 uintptr _, _ = cmdPtr, v1 /* * How to get a coroutine from its handle. */ cmdPtr = XTcl_GetCommandFromObj(tls, interp, objPtr) if !(cmdPtr != 0) || (*TCommand)(unsafe.Pointer(cmdPtr)).FnreProc != __ccgo_fp(XTclNRInterpCoroutine) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, errMsg, int64(-libc.Int32FromInt32(1)))) if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, objPtr, libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+9371, v1, libc.UintptrFromInt32(0))) return libc.UintptrFromInt32(0) } return (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData } func _TclNRCoroInjectObjCmd(tls *libc.TLS, dummy9406 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, cachePtr, corPtr, savedEEPtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _ = _objPtr, cachePtr, corPtr, savedEEPtr, v1 /* * Usage more or less like tailcall: * coroinject coroName cmd ?arg1 arg2 ...? */ if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+9680) return int32(TCL_ERROR) } corPtr = _GetCoroutineFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_ts+9709) if !(corPtr != 0) { return int32(TCL_ERROR) } if !((*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel == libc.UintptrFromInt32(0)) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9752, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+9371, __ccgo_ts+9805, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Add the callback to the coro's execEnv, so that it is the first thing * to happen when the coro is resumed. */ savedEEPtr = (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_InjectHandler) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = corPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = XTcl_NewListObj(tls, int64(objc-int32(2)), objv+uintptr(2)*8) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = uintptr((*TCoroutineData)(unsafe.Pointer(corPtr)).Fnargs) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = savedEEPtr return TCL_OK } func _TclNRCoroProbeObjCmd(tls *libc.TLS, dummy9451 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var _objPtr, _objPtr1, cachePtr, cachePtr1, savedEEPtr uintptr var numLevels TTcl_Size var v1, v2 bool var _ /* _callbackPtr at bp+16 */ uintptr var _ /* _callbackPtr at bp+8 */ uintptr var _ /* corPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, numLevels, savedEEPtr, v1, v2 /* * Usage more or less like tailcall: * coroprobe coroName cmd ?arg1 arg2 ...? */ if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+9680) return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(bp)) = _GetCoroutineFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_ts+9812) if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { return int32(TCL_ERROR) } if !((*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FstackLevel == libc.UintptrFromInt32(0)) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9861, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+9371, __ccgo_ts+9805, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Add the callback to the coro's execEnv, so that it is the first thing * to happen when the coro is resumed. */ savedEEPtr = (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FeePtr if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(_InjectHandler) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = XTcl_NewListObj(tls, int64(objc-int32(2)), objv+uintptr(2)*8) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = uintptr((*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fnargs) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = *(*uintptr)(unsafe.Pointer(bp)) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = savedEEPtr /* * Now we immediately transfer control to the coroutine to run our probe. * TRICKY STUFF copied from the [yield] implementation. * * Push the callback to restore the caller's context on yield back. */ if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 16)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FprocPtr = __ccgo_fp(_NRCoroutineCallerCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)) = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) /* * Record the stackLevel at which the resume is happening, then swap * the interp's environment to make it suitable to run this coroutine. */ (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FstackLevel = bp numLevels = (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FauxNumLevels (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FauxNumLevels = (*TInterp)(unsafe.Pointer(interp)).FnumLevels /* * Do the actual stack swap. */ (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fcaller.FframePtr = (*TInterp)(unsafe.Pointer(interp)).FframePtr (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fcaller.FvarFramePtr = (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fcaller.FcmdFramePtr = (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fcaller.FlineLABCPtr = (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FcallerEEPtr = (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr (*TInterp)(unsafe.Pointer(interp)).FframePtr = (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Frunning.FframePtr (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr = (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Frunning.FvarFramePtr (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr = (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Frunning.FcmdFramePtr (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr = (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Frunning.FlineLABCPtr (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FeePtr *(*TTcl_Size)(unsafe.Pointer(interp + 72)) += numLevels return TCL_OK } /* *---------------------------------------------------------------------- * * InjectHandler, InjectHandlerPostProc -- * * Part of the implementation of [coroinject] and [coroprobe]. These are * run inside the context of the coroutine being injected/probed into. * * InjectHandler runs a script (possibly adding arguments) in the context * of the coroutine. The script is specified as a one-shot list (with * reference count equal to 1) in data[1]. This function also arranges * for InjectHandlerPostProc to be the part that runs after the script * completes. * * InjectHandlerPostProc cleans up after InjectHandler (deleting the * list) and, for the [coroprobe] command *only*, yields back to the * caller context (i.e., where [coroprobe] was run). *s *---------------------------------------------------------------------- */ func _InjectHandler(tls *libc.TLS, data uintptr, interp uintptr, dummy9548 int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, cachePtr, cachePtr1, corPtr, isProbe, listPtr, nargsObj uintptr var nargs TTcl_Size var v1, v2 bool var v4, v5 int64 var _ /* _callbackPtr at bp+16 */ uintptr var _ /* objc at bp+0 */ TTcl_Size var _ /* objv at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, corPtr, isProbe, listPtr, nargs, nargsObj, v1, v2, v4, v5 corPtr = *(*uintptr)(unsafe.Pointer(data)) listPtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) nargs = int64(*(*uintptr)(unsafe.Pointer(data + 2*8))) isProbe = *(*uintptr)(unsafe.Pointer(data + 3*8)) if !(isProbe != 0) { /* * If this is [coroinject], add the extra arguments now. */ if nargs == int64(-libc.Int32FromInt32(1)) { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, XTcl_NewStringObj(tls, __ccgo_ts+3522, int64(-libc.Int32FromInt32(1)))) } else { if nargs == int64(-libc.Int32FromInt32(2)) { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, XTcl_NewStringObj(tls, __ccgo_ts+5445, int64(-libc.Int32FromInt32(1)))) } else { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { nargsObj = XTclThreadAllocObj(tls) } else { nargsObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(nargsObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(nargsObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(nargsObj)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(nargsObj)).FinternalRep)) = nargs (*TTcl_Obj)(unsafe.Pointer(nargsObj)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, nargsObj) } } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, XTcl_GetObjResult(tls, interp)) } /* * Call the user's script; we're in the right place. */ (*TTcl_Obj)(unsafe.Pointer(listPtr)).FrefCount++ XTclMarkTailcall(tls, interp) if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 16)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FprocPtr = __ccgo_fp(_InjectHandlerPostCall) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)) = corPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 1*8)) = listPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 2*8)) = uintptr(nargs) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 3*8)) = isProbe (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2)).FspanStart } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1 + 40 + uintptr(v4)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2)).FspanLength } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v5 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), listPtr, bp, bp+8) } return XTclNREvalObjv(tls, interp, *(*TTcl_Size)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), 0, libc.UintptrFromInt32(0)) } func _InjectHandlerPostCall(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { var _objPtr, corPtr, isProbe, listPtr, v2 uintptr var nargs, numLevels, v1 TTcl_Size _, _, _, _, _, _, _, _ = _objPtr, corPtr, isProbe, listPtr, nargs, numLevels, v1, v2 corPtr = *(*uintptr)(unsafe.Pointer(data)) listPtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) nargs = int64(*(*uintptr)(unsafe.Pointer(data + 2*8))) isProbe = *(*uintptr)(unsafe.Pointer(data + 3*8)) /* * Delete the command words for what we just executed. */ _objPtr = listPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } /* * If we were doing a probe, splice ourselves back out of the stack * cleanly here. General injection should instead just look after itself. * * Code from guts of [yield] implementation. */ if isProbe != 0 { if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+9920, int64(-int32(1)))) } (*TCoroutineData)(unsafe.Pointer(corPtr)).Fnargs = nargs (*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel = libc.UintptrFromInt32(0) numLevels = (*TInterp)(unsafe.Pointer(interp)).FnumLevels (*TInterp)(unsafe.Pointer(interp)).FnumLevels = (*TCoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels (*TCoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels = numLevels - (*TCoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr } return result } func XTclNRInterpCoroutine(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Argument objects. */ var _objPtr, cachePtr, corPtr, v1 uintptr var v2 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _ = _objPtr, cachePtr, corPtr, v1, v2 corPtr = clientData if !((*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel == libc.UintptrFromInt32(0)) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+9960, libc.VaList(bp+16, v1))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+9371, __ccgo_ts+9994, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Parse all the arguments to work out what to feed as the result of the * [yield]. TRICKY POINT: objc==0 happens here! It occurs when a coroutine * is deleted! */ switch (*TCoroutineData)(unsafe.Pointer(corPtr)).Fnargs { case int64(-libc.Int32FromInt32(1)): if objc == int32(2) { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) } else { if objc > int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+9999) return int32(TCL_ERROR) } } default: if (*TCoroutineData)(unsafe.Pointer(corPtr)).Fnargs+int64(1) != int64(objc) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+10005, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+9101, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* fallthrough */ fallthrough case int64(-libc.Int32FromInt32(2)): if objc > int32(1) { XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, int64(objc-int32(1)), objv+uintptr(1)*8)) } break } if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(XTclNRCoroutineActivateCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = corPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return TCL_OK } /* *---------------------------------------------------------------------- * * TclNRCoroutineObjCmd -- * * Implementation of [coroutine] command; see documentation for * description of what this does. * *---------------------------------------------------------------------- */ func XTclNRCoroutineObjCmd(tls *libc.TLS, dummy9696 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) /* Argument objects. */ var _objPtr, _objPtr1, cachePtr, cachePtr1, cmdPtr, corPtr, hePtr, inNsPtr, lookupNsPtr, newPtr, procName, v1, v3 uintptr var v4, v5 bool var _ /* _callbackPtr at bp+64 */ uintptr var _ /* _callbackPtr at bp+72 */ uintptr var _ /* altNsPtr at bp+16 */ uintptr var _ /* cxtNsPtr at bp+24 */ uintptr var _ /* hSearch at bp+32 */ TTcl_HashSearch var _ /* isNew at bp+56 */ int32 var _ /* nsPtr at bp+8 */ uintptr var _ /* simpleName at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, cmdPtr, corPtr, hePtr, inNsPtr, lookupNsPtr, newPtr, procName, v1, v3, v4, v5 inNsPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr lookupNsPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+10061) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } procName = v1 XTclGetNamespaceForQualName(tls, interp, procName, inNsPtr, 0, bp+8, bp+16, bp+24, bp) if *(*uintptr)(unsafe.Pointer(bp + 8)) == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+10080, libc.VaList(bp+88, procName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+10127, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+10137, libc.VaList(bp+88, procName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+8118, procName, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * We ARE creating the coroutine command: allocate the corresponding * struct and create the corresponding command. */ corPtr = XTcl_Alloc(tls, uint64(128)) cmdPtr = XTclNRCreateCommandInNs(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), libc.UintptrFromInt32(0), __ccgo_fp(XTclNRInterpCoroutine), corPtr, __ccgo_fp(_DeleteCoroutine)) (*TCoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr = cmdPtr (*TCommand)(unsafe.Pointer(cmdPtr)).FrefCount++ /* * #280. * Provide the new coroutine with its own copy of the lineLABCPtr * hashtable for literal command arguments in bytecode. Note that * CFWordBC chains are not duplicated, only the entrypoints to them. This * means that in the presence of coroutines each chain is potentially a * tree. Like the chain -> tree conversion of the CmdFrame stack. */ (*TCoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr = XTcl_Alloc(tls, uint64(104)) XTcl_InitHashTable(tls, (*TCoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr, int32(TCL_ONE_WORD_KEYS)) hePtr = XTcl_FirstHashEntry(tls, (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr, bp+32) for { if !(hePtr != 0) { break } if (*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr)).FkeyType == -int32(1) { v3 = *(*uintptr)(unsafe.Pointer(hePtr + 32)) } else { v3 = hePtr + 32 } newPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TCoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr)).FcreateProc})))(tls, (*TCoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr, v3, bp+56) (*TTcl_HashEntry)(unsafe.Pointer(newPtr)).FclientData = (*TTcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData goto _2 _2: ; hePtr = XTcl_NextHashEntry(tls, bp+32) } /* * Create the base context. */ (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr = (*TInterp)(unsafe.Pointer(interp)).FrootFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr = (*TInterp)(unsafe.Pointer(interp)).FrootFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr = libc.UintptrFromInt32(0) (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FlineLABCPtr (*TCoroutineData)(unsafe.Pointer(corPtr)).FstackLevel = libc.UintptrFromInt32(0) (*TCoroutineData)(unsafe.Pointer(corPtr)).FauxNumLevels = 0 (*TCoroutineData)(unsafe.Pointer(corPtr)).FyieldPtr = libc.UintptrFromInt32(0) /* * Create the coro's execEnv, switch to it to push the exit and coro * command callbacks, then switch back. */ (*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr = XTclCreateExecEnv(tls, interp, uint64(CORO_STACK_INITIAL_SIZE)) (*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr = (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr (*TExecEnv1)(unsafe.Pointer((*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr)).FcorPtr = corPtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr = (*TInterp)(unsafe.Pointer(interp)).FframePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr = (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr = (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr = (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr (*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr = (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr (*TInterp)(unsafe.Pointer(interp)).FframePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FeePtr if v4 = interp == libc.UintptrFromInt32(0); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 64)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FprocPtr = __ccgo_fp(_NRCoroutineExitCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 8)) = corPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 64)) /* * Ensure that the command is looked up in the correct namespace. */ (*TInterp)(unsafe.Pointer(interp)).FlookupNsPtr = lookupNsPtr XTcl_NREvalObj(tls, interp, XTcl_NewListObj(tls, int64(objc-int32(2)), objv+uintptr(2)*8), 0) (*TInterp)(unsafe.Pointer(interp)).FnumLevels-- (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FframePtr = (*TInterp)(unsafe.Pointer(interp)).FframePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FvarFramePtr = (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FcmdFramePtr = (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr (*TCoroutineData)(unsafe.Pointer(corPtr)).Frunning.FlineLABCPtr = (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr (*TInterp)(unsafe.Pointer(interp)).FframePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FframePtr (*TInterp)(unsafe.Pointer(interp)).FvarFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FvarFramePtr (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr (*TInterp)(unsafe.Pointer(interp)).FlineLABCPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FlineLABCPtr (*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr /* * Now just resume the coroutine. */ if v5 = interp == libc.UintptrFromInt32(0); !v5 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v5 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 72)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FprocPtr = __ccgo_fp(XTclNRCoroutineActivateCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + 8)) = corPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 72)) return TCL_OK } /* * This is used in the [info] ensemble */ func XTclInfoCoroutineCmd(tls *libc.TLS, dummy9830 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var cachePtr, corPtr, namePtr uintptr var v1 bool _, _, _, _ = cachePtr, corPtr, namePtr, v1 corPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcorPtr if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } if corPtr != 0 && !((*TCommand1)(unsafe.Pointer((*TCoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr)).Fflags&libc.Int32FromInt32(CMD_DYING) != 0) { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { namePtr = XTclThreadAllocObj(tls) } else { namePtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(namePtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(namePtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(namePtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(namePtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(namePtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_GetCommandFullName(tls, interp, (*TCoroutineData)(unsafe.Pointer(corPtr)).FcmdPtr, namePtr) XTcl_SetObjResult(tls, interp, namePtr) } return TCL_OK } type TExecEnv1 = struct { FexecStackPtr uintptr Fconstants [2]uintptr Finterp uintptr FcallbackPtr uintptr FcorPtr uintptr Frewind int32 } const BINARY_ALL = -1 const BINARY_NOCOUNT = -2 const BINARY_SCAN_MAX_CACHE = 260 const BINARY_SIGNED = 0 const BINARY_UNSIGNED = 1 const FLT_MAX1 = 3.4028234663852886e+38 /* * The following tables are used by the binary encoders */ var _HexDigits = [16]uint8{ 0: uint8('0'), 1: uint8('1'), 2: uint8('2'), 3: uint8('3'), 4: uint8('4'), 5: uint8('5'), 6: uint8('6'), 7: uint8('7'), 8: uint8('8'), 9: uint8('9'), 10: uint8('a'), 11: uint8('b'), 12: uint8('c'), 13: uint8('d'), 14: uint8('e'), 15: uint8('f'), } var _UueDigits = [65]uint8{ 0: uint8('`'), 1: uint8('!'), 2: uint8('"'), 3: uint8('#'), 4: uint8('$'), 5: uint8('%'), 6: uint8('&'), 7: uint8('\''), 8: uint8('('), 9: uint8(')'), 10: uint8('*'), 11: uint8('+'), 12: uint8(','), 13: uint8('-'), 14: uint8('.'), 15: uint8('/'), 16: uint8('0'), 17: uint8('1'), 18: uint8('2'), 19: uint8('3'), 20: uint8('4'), 21: uint8('5'), 22: uint8('6'), 23: uint8('7'), 24: uint8('8'), 25: uint8('9'), 26: uint8(':'), 27: uint8(';'), 28: uint8('<'), 29: uint8('='), 30: uint8('>'), 31: uint8('?'), 32: uint8('@'), 33: uint8('A'), 34: uint8('B'), 35: uint8('C'), 36: uint8('D'), 37: uint8('E'), 38: uint8('F'), 39: uint8('G'), 40: uint8('H'), 41: uint8('I'), 42: uint8('J'), 43: uint8('K'), 44: uint8('L'), 45: uint8('M'), 46: uint8('N'), 47: uint8('O'), 48: uint8('P'), 49: uint8('Q'), 50: uint8('R'), 51: uint8('S'), 52: uint8('T'), 53: uint8('U'), 54: uint8('V'), 55: uint8('W'), 56: uint8('X'), 57: uint8('Y'), 58: uint8('Z'), 59: uint8('['), 60: uint8('\\'), 61: uint8(']'), 62: uint8('^'), 63: uint8('_'), 64: uint8('`'), } var _B64Digits = [65]uint8{ 0: uint8('A'), 1: uint8('B'), 2: uint8('C'), 3: uint8('D'), 4: uint8('E'), 5: uint8('F'), 6: uint8('G'), 7: uint8('H'), 8: uint8('I'), 9: uint8('J'), 10: uint8('K'), 11: uint8('L'), 12: uint8('M'), 13: uint8('N'), 14: uint8('O'), 15: uint8('P'), 16: uint8('Q'), 17: uint8('R'), 18: uint8('S'), 19: uint8('T'), 20: uint8('U'), 21: uint8('V'), 22: uint8('W'), 23: uint8('X'), 24: uint8('Y'), 25: uint8('Z'), 26: uint8('a'), 27: uint8('b'), 28: uint8('c'), 29: uint8('d'), 30: uint8('e'), 31: uint8('f'), 32: uint8('g'), 33: uint8('h'), 34: uint8('i'), 35: uint8('j'), 36: uint8('k'), 37: uint8('l'), 38: uint8('m'), 39: uint8('n'), 40: uint8('o'), 41: uint8('p'), 42: uint8('q'), 43: uint8('r'), 44: uint8('s'), 45: uint8('t'), 46: uint8('u'), 47: uint8('v'), 48: uint8('w'), 49: uint8('x'), 50: uint8('y'), 51: uint8('z'), 52: uint8('0'), 53: uint8('1'), 54: uint8('2'), 55: uint8('3'), 56: uint8('4'), 57: uint8('5'), 58: uint8('6'), 59: uint8('7'), 60: uint8('8'), 61: uint8('9'), 62: uint8('+'), 63: uint8('/'), 64: uint8('='), } /* * How to construct the ensembles. */ var _binaryMap = [5]TEnsembleImplMap{ 0: { Fname: __ccgo_ts + 5199, }, 1: { Fname: __ccgo_ts + 5378, }, 2: { Fname: __ccgo_ts + 10185, }, 3: { Fname: __ccgo_ts + 10192, }, 4: {}, } func init() { p := unsafe.Pointer(&_binaryMap) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_BinaryFormatCmd) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileBasicMin1ArgCmd) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_BinaryScanCmd) *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(XTclCompileBasicMin2ArgCmd) } var _encodeMap = [4]TEnsembleImplMap{ 0: { Fname: __ccgo_ts + 10199, }, 1: { Fname: __ccgo_ts + 10203, }, 2: { Fname: __ccgo_ts + 10212, }, 3: {}, } func init() { p := unsafe.Pointer(&_encodeMap) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_BinaryEncodeHex) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_BinaryEncodeUu) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_BinaryEncode64) } var _decodeMap = [4]TEnsembleImplMap{ 0: { Fname: __ccgo_ts + 10199, }, 1: { Fname: __ccgo_ts + 10203, }, 2: { Fname: __ccgo_ts + 10212, }, 3: {}, } func init() { p := unsafe.Pointer(&_decodeMap) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_BinaryDecodeHex) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileBasic1Or2ArgCmd) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_BinaryDecodeUu) *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(XTclCompileBasic1Or2ArgCmd) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_BinaryDecode64) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(XTclCompileBasic1Or2ArgCmd) } /* * The following Tcl_ObjType represents an array of bytes. The intent is to * allow arbitrary binary data to pass through Tcl as a Tcl value without loss * or damage. Such values are useful for things like encoded strings or Tk * images to name just two. * * A bytearray is an ordered sequence of bytes. Each byte is an integer value * in the range [0-255]. To be a Tcl value type, we need a way to encode each * value in the value set as a Tcl string. A simple encoding is to * represent each byte value as the same codepoint value. A bytearray of N * bytes is encoded into a Tcl string of N characters where the codepoint of * each character is the value of corresponding byte. This approach creates a * one-to-one map between all bytearray values and a subset of Tcl string * values. Tcl string values outside that subset do no represent any valid * bytearray value. Attempts to treat those values as bytearrays will lead * to errors. See TIP 568 for how this differs from Tcl 8. */ var _properByteArrayType = TTcl_ObjType{ Fname: __ccgo_ts + 10219, } func init() { p := unsafe.Pointer(&_properByteArrayType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_FreeProperByteArrayInternalRep) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_DupProperByteArrayInternalRep) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_UpdateStringOfByteArray) } /* * The following structure is the internal rep for a ByteArray object. Keeps * track of how much memory has been used and how much has been allocated for * the byte array to enable growing and shrinking of the ByteArray object with * fewer mallocs. */ type TByteArray = struct { Fused TTcl_Size Fallocated TTcl_Size } func XTclIsPureByteArray(tls *libc.TLS, objPtr uintptr) (r int32) { return libc.BoolInt32((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType))) } /* *---------------------------------------------------------------------- * * Tcl_NewByteArrayObj -- * * This procedure is creates a new ByteArray object and initializes it * from the given array of bytes. * * Results: * The newly created object is returned. This object has no initial * string representation. The returned object has a ref count of 0. * * Side effects: * Memory allocated for new object and copy of byte array argument. * *---------------------------------------------------------------------- */ func XTcl_NewByteArrayObj(tls *libc.TLS, bytes uintptr, numBytes TTcl_Size) (r uintptr) { /* Number of bytes in the array, * must be >= 0. */ var cachePtr, objPtr uintptr var v1 bool _, _, _ = cachePtr, objPtr, v1 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_SetByteArrayObj(tls, objPtr, bytes, numBytes) return objPtr } /* *---------------------------------------------------------------------- * * Tcl_DbNewByteArrayObj -- * * This procedure is normally called when debugging: i.e., when * TCL_MEM_DEBUG is defined. It is the same as the Tcl_NewByteArrayObj * above except that it calls Tcl_DbCkalloc directly with the file name * and line number from its caller. This simplifies debugging since then * the [memory active] command will report the correct file name and line * number when reporting objects that haven't been freed. * * When TCL_MEM_DEBUG is not defined, this procedure just returns the * result of calling Tcl_NewByteArrayObj. * * Results: * The newly created object is returned. This object has no initial * string representation. The returned object has a ref count of 0. * * Side effects: * Memory allocated for new object and copy of byte array argument. * *---------------------------------------------------------------------- */ func XTcl_DbNewByteArrayObj(tls *libc.TLS, bytes uintptr, numBytes TTcl_Size, dummy290 uintptr, dummy291 int32) (r uintptr) { return XTcl_NewByteArrayObj(tls, bytes, numBytes) } /* *--------------------------------------------------------------------------- * * Tcl_SetByteArrayObj -- * * Modify an object to be a ByteArray object and to have the specified * array of bytes as its value. * * Results: * None. * * Side effects: * The object's old string rep and internal rep is freed. Memory * allocated for copy of byte array argument. * *---------------------------------------------------------------------- */ func XTcl_SetByteArrayObj(tls *libc.TLS, objPtr uintptr, bytes uintptr, numBytes TTcl_Size) { bp := tls.Alloc(32) defer tls.Free(32) /* Number of bytes in the array, * must be >= 0 */ var _isobjPtr, byteArrayPtr uintptr var v1 uint64 var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _ = _isobjPtr, byteArrayPtr, v1 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > int64(1) { XTcl_Panic(tls, __ccgo_ts+10229, libc.VaList(bp+24, __ccgo_ts+10258)) } _isobjPtr = objPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } if numBytes < 0 || libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))-libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16)) < numBytes { XTcl_Panic(tls, __ccgo_ts+10278, 0) v1 = libc.Uint64FromInt32(libc.Int32FromInt32(0)) } else { v1 = uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt64(numBytes) } byteArrayPtr = XTcl_Alloc(tls, v1) (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fused = numBytes (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated = numBytes if bytes != libc.UintptrFromInt32(0) && numBytes > 0 { libc.Xmemcpy(tls, byteArrayPtr+16, bytes, libc.Uint64FromInt64(numBytes)) } (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr1 = byteArrayPtr XTcl_StoreInternalRep(tls, objPtr, uintptr(unsafe.Pointer(&_properByteArrayType)), bp) } /* *---------------------------------------------------------------------- * * TclGetBytesFromObj -- * * Attempt to extract the value from objPtr in the representation * of a byte sequence. On success return the extracted byte sequence. * On failure, return NULL and record error message and code in * interp (if not NULL). * * Results: * NULL or pointer to array of bytes representing the ByteArray object. * Writes number of bytes in array to *numBytesPtr. * *---------------------------------------------------------------------- */ func XTcl_GetBytesFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, numBytesPtr uintptr) (r uintptr) { /* If non-NULL, write the number of bytes * in the array here */ var baPtr, irPtr, v1, v2 uintptr _, _, _, _ = baPtr, irPtr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr == libc.UintptrFromInt32(0) { if int32(TCL_ERROR) == _SetByteArrayFromAny(tls, interp, int64(-libc.Int32FromInt32(1)), objPtr) { return libc.UintptrFromInt32(0) } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v2 = objPtr + 32 } else { v2 = libc.UintptrFromInt32(0) } irPtr = v2 } baPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 if numBytesPtr != libc.UintptrFromInt32(0) { *(*TTcl_Size)(unsafe.Pointer(numBytesPtr)) = (*TByteArray)(unsafe.Pointer(baPtr)).Fused } return baPtr + 16 } func XTclGetBytesFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr, numBytesPtr uintptr) (r uintptr) { bp := tls.Alloc(48) defer tls.Free(48) /* If non-NULL, write the number of bytes * in the array here */ var bytes uintptr var _ /* numBytes at bp+0 */ TTcl_Size _ = bytes *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 bytes = XTcl_GetBytesFromObj(tls, interp, objPtr, bp) if bytes != 0 && numBytesPtr != 0 { if *(*TTcl_Size)(unsafe.Pointer(bp)) > int64(INT_MAX) { /* Caller asked for numBytes to be written to an int, but the * value is outside the int range. */ if interp != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+10340, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+10377, __ccgo_ts+10381, libc.UintptrFromInt32(0))) } return libc.UintptrFromInt32(0) } else { *(*int32)(unsafe.Pointer(numBytesPtr)) = int32(*(*TTcl_Size)(unsafe.Pointer(bp))) } } return bytes } /* *---------------------------------------------------------------------- * * Tcl_SetByteArrayLength -- * * This procedure changes the length of the byte array for this object. * Once the caller has set the length of the array, it is acceptable to * directly modify the bytes in the array up until Tcl_GetStringFromObj() * has been called on this object. * * Results: * The new byte array of the specified length. * * Side effects: * Allocates enough memory for an array of bytes of the requested size. * When growing the array, the old array is copied to the new array; new * bytes are undefined. When shrinking, the old array is truncated to the * specified length. * *---------------------------------------------------------------------- */ func XTcl_SetByteArrayLength(tls *libc.TLS, objPtr uintptr, numBytes TTcl_Size) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* Number of bytes in resized array * Must be >= 0 */ var _isobjPtr, byteArrayPtr, irPtr, v1, v2 uintptr var v3 uint64 _, _, _, _, _, _ = _isobjPtr, byteArrayPtr, irPtr, v1, v2, v3 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > int64(1) { XTcl_Panic(tls, __ccgo_ts+10229, libc.VaList(bp+8, __ccgo_ts+10390)) } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr == libc.UintptrFromInt32(0) { if int32(TCL_ERROR) == _SetByteArrayFromAny(tls, libc.UintptrFromInt32(0), numBytes, objPtr) { return libc.UintptrFromInt32(0) } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v2 = objPtr + 32 } else { v2 = libc.UintptrFromInt32(0) } irPtr = v2 } byteArrayPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 if numBytes > (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated { if numBytes < 0 || libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))-libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16)) < numBytes { XTcl_Panic(tls, __ccgo_ts+10278, 0) v3 = libc.Uint64FromInt32(libc.Int32FromInt32(0)) } else { v3 = uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt64(numBytes) } byteArrayPtr = XTcl_Realloc(tls, byteArrayPtr, v3) (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated = numBytes (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 = byteArrayPtr } _isobjPtr = objPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fused = numBytes return byteArrayPtr + 16 } /* *---------------------------------------------------------------------- * * MakeByteArray -- * * Generate a ByteArray internal rep from the string rep of objPtr. * The generated byte sequence may have no more than limit bytes. * A negative value for limit indicates no limit imposed. If * boolean argument demandProper is true, then no byte sequence should * be output to the caller (write NULL instead). When no bytes sequence * is output and interp is not NULL, leave an error message and error * code in interp explaining why a proper byte sequence could not be * made. * * Results: * Returns a boolean indicating whether the bytes generated (up to * limit bytes) are a proper representation of (a limited prefix of) * the string. Writes a pointer to the generated ByteArray to * *byteArrayPtrPtr. If not NULL it needs to be released with Tcl_Free(). * *---------------------------------------------------------------------- */ func _MakeByteArray(tls *libc.TLS, interp uintptr, objPtr uintptr, limit TTcl_Size, demandProper int32, byteArrayPtrPtr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var byteArrayPtr, dst, dstEnd, src, srcEnd, v1, v6 uintptr var count, proper int32 var numBytes TTcl_Size var v2, v5 int64 var v3 uint64 var _ /* ch at bp+8 */ int32 var _ /* length at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _ = byteArrayPtr, count, dst, dstEnd, numBytes, proper, src, srcEnd, v1, v2, v3, v5, v6 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, objPtr, bp) } src = v1 if limit >= 0 && limit < *(*TTcl_Size)(unsafe.Pointer(bp)) { v2 = limit } else { v2 = *(*TTcl_Size)(unsafe.Pointer(bp)) } numBytes = v2 if numBytes < 0 || libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))-libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16)) < numBytes { XTcl_Panic(tls, __ccgo_ts+10278, 0) v3 = libc.Uint64FromInt32(libc.Int32FromInt32(0)) } else { v3 = uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt64(numBytes) } byteArrayPtr = XTcl_Alloc(tls, v3) dst = byteArrayPtr + 16 dstEnd = dst + uintptr(numBytes) srcEnd = src + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp))) proper = int32(1) for { if !(src < srcEnd && dst < dstEnd) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp + 8)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) v5 = int64(libc.Int32FromInt32(1)) } else { v5 = XTcl_UtfToUniChar(tls, src, bp+8) } count = int32(v5) if *(*int32)(unsafe.Pointer(bp + 8)) > int32(255) { proper = 0 if demandProper != 0 { if interp != 0 { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+10413, libc.VaList(bp+24, int64(dst)-T__predefined_ptrdiff_t(byteArrayPtr+16), src, *(*int32)(unsafe.Pointer(bp + 8))))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+10473, libc.UintptrFromInt32(0))) } XTclpFree(tls, byteArrayPtr) *(*uintptr)(unsafe.Pointer(byteArrayPtrPtr)) = libc.UintptrFromInt32(0) return proper } } src += uintptr(count) v6 = dst dst++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp + 8))) goto _4 _4: } (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fused = int64(dst) - T__predefined_ptrdiff_t(byteArrayPtr+16) (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated = numBytes *(*uintptr)(unsafe.Pointer(byteArrayPtrPtr)) = byteArrayPtr return proper } func _TclNarrowToBytes(tls *libc.TLS, objPtr uintptr) (r uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var _isobjPtr, cachePtr, v1 uintptr var v2 bool var _ /* byteArrayPtr at bp+16 */ uintptr var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _, _ = _isobjPtr, cachePtr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } if libc.UintptrFromInt32(0) == v1 { if 0 == _MakeByteArray(tls, libc.UintptrFromInt32(0), objPtr, int64(-libc.Int32FromInt32(1)), 0, bp+16) { if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) _isobjPtr = objPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } } (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr1 = *(*uintptr)(unsafe.Pointer(bp + 16)) XTcl_StoreInternalRep(tls, objPtr, uintptr(unsafe.Pointer(&_properByteArrayType)), bp) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ return objPtr } /* *---------------------------------------------------------------------- * * SetByteArrayFromAny -- * * Generate the ByteArray internal rep from the string rep. * * Results: * Tcl return code indicating OK or ERROR. * * Side effects: * A ByteArray struct may be stored as the internal rep of objPtr. * *---------------------------------------------------------------------- */ func _SetByteArrayFromAny(tls *libc.TLS, interp uintptr, limit TTcl_Size, objPtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* The object to convert to type ByteArray. */ var _ /* byteArrayPtr at bp+0 */ uintptr var _ /* ir at bp+8 */ TTcl_ObjInternalRep if 0 == _MakeByteArray(tls, interp, objPtr, limit, int32(1), bp) { return int32(TCL_ERROR) } (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp + 8))).Fptr1 = *(*uintptr)(unsafe.Pointer(bp)) XTcl_StoreInternalRep(tls, objPtr, uintptr(unsafe.Pointer(&_properByteArrayType)), bp+8) return TCL_OK } /* *---------------------------------------------------------------------- * * FreeByteArrayInternalRep -- * * Deallocate the storage associated with a ByteArray data object's * internal representation. * * Results: * None. * * Side effects: * Frees memory. * *---------------------------------------------------------------------- */ func _FreeProperByteArrayInternalRep(tls *libc.TLS, objPtr uintptr) { /* Object with internal rep to free. */ var v1 uintptr _ = v1 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } XTclpFree(tls, (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(v1))).Fptr1) } /* *---------------------------------------------------------------------- * * DupByteArrayInternalRep -- * * Initialize the internal representation of a ByteArray Tcl_Obj to a * copy of the internal representation of an existing ByteArray object. * * Results: * None. * * Side effects: * Allocates memory. * *---------------------------------------------------------------------- */ func _DupProperByteArrayInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* Object with internal rep to set. */ var copyArrayPtr, srcArrayPtr, v1 uintptr var length TTcl_Size var v2 uint64 var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _, _, _ = copyArrayPtr, length, srcArrayPtr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(srcPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v1 = srcPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } srcArrayPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(v1))).Fptr1 length = (*TByteArray)(unsafe.Pointer(srcArrayPtr)).Fused if length < 0 || libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))-libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16)) < length { XTcl_Panic(tls, __ccgo_ts+10278, 0) v2 = libc.Uint64FromInt32(libc.Int32FromInt32(0)) } else { v2 = uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt64(length) } copyArrayPtr = XTcl_Alloc(tls, v2) (*TByteArray)(unsafe.Pointer(copyArrayPtr)).Fused = length (*TByteArray)(unsafe.Pointer(copyArrayPtr)).Fallocated = length libc.Xmemcpy(tls, copyArrayPtr+16, srcArrayPtr+16, libc.Uint64FromInt64(length)) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr1 = copyArrayPtr XTcl_StoreInternalRep(tls, copyPtr, uintptr(unsafe.Pointer(&_properByteArrayType)), bp) } /* *---------------------------------------------------------------------- * * UpdateStringOfByteArray -- * * Update the string representation for a ByteArray data object. * * Results: * None. * * Side effects: * The object's string is set to a valid string that results from the * ByteArray-to-string conversion. * *---------------------------------------------------------------------- */ func _UpdateStringOfByteArray(tls *libc.TLS, objPtr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* ByteArray object whose string rep to * update. */ var byteArrayPtr, dst, dst1, irPtr, src, v1 uintptr var i, length, size TTcl_Size var v3, v4, v5, v6 bool _, _, _, _, _, _, _, _, _, _, _, _, _ = byteArrayPtr, dst, dst1, i, irPtr, length, size, src, v1, v3, v4, v5, v6 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 byteArrayPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 src = byteArrayPtr + 16 length = (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fused size = length /* * How much space will string rep need? */ i = 0 for { if !(i < length) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src + uintptr(i)))) == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src + uintptr(i)))) > int32(127) { size++ } goto _2 _2: ; i++ } if size == length { dst = XTcl_InitStringRep(tls, objPtr, src, libc.Uint64FromInt64(size)) if v4 = size != 0; v4 { if v3 = dst != 0; !v3 { XTcl_Panic(tls, __ccgo_ts+10479, libc.VaList(bp+8, libc.Uint64FromInt64(size))) } } _ = v4 && (v3 || libc.Bool(libc.Int32FromInt32(1) != 0)) } else { dst1 = XTcl_InitStringRep(tls, objPtr, libc.UintptrFromInt32(0), libc.Uint64FromInt64(size)) if v6 = size != 0; v6 { if v5 = dst1 != 0; !v5 { XTcl_Panic(tls, __ccgo_ts+10479, libc.VaList(bp+8, libc.Uint64FromInt64(size))) } } _ = v6 && (v5 || libc.Bool(libc.Int32FromInt32(1) != 0)) i = 0 for { if !(i < length) { break } dst1 += uintptr(XTcl_UniCharToUtf(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src + uintptr(i)))), dst1)) goto _7 _7: ; i++ } } } /* *---------------------------------------------------------------------- * * 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] * *---------------------------------------------------------------------- */ func XTclAppendBytesToByteArray(tls *libc.TLS, objPtr uintptr, bytes uintptr, len1 TTcl_Size) { bp := tls.Alloc(32) defer tls.Free(32) var _isobjPtr, byteArrayPtr, irPtr, v1, v2 uintptr var needed TTcl_Size var _ /* newCapacity at bp+0 */ TTcl_Size _, _, _, _, _, _ = _isobjPtr, byteArrayPtr, irPtr, needed, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount > int64(1) { XTcl_Panic(tls, __ccgo_ts+10229, libc.VaList(bp+16, __ccgo_ts+10505)) } if len1 < 0 { XTcl_Panic(tls, __ccgo_ts+10531, libc.VaList(bp+16, __ccgo_ts+10505)) } if len1 == 0 { /* * Append zero bytes is a no-op. */ return } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr == libc.UintptrFromInt32(0) { if int32(TCL_ERROR) == _SetByteArrayFromAny(tls, libc.UintptrFromInt32(0), int64(-libc.Int32FromInt32(1)), objPtr) { XTcl_Panic(tls, __ccgo_ts+10589, 0) } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_properByteArrayType)) { v2 = objPtr + 32 } else { v2 = libc.UintptrFromInt32(0) } irPtr = v2 } byteArrayPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 /* * If we need to, resize the allocated space in the byte array. */ if libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))-libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16))-(*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fused < len1 { /* Will wrap around !! */ XTcl_Panic(tls, __ccgo_ts+10630, 0) } needed = (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fused + len1 if needed > (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated { byteArrayPtr = XTclReallocElemsEx(tls, byteArrayPtr, needed, int64(1), libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16)), bp) (*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fallocated = *(*TTcl_Size)(unsafe.Pointer(bp)) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 = byteArrayPtr } if bytes != 0 { libc.Xmemcpy(tls, byteArrayPtr+16+uintptr((*TByteArray)(unsafe.Pointer(byteArrayPtr)).Fused), bytes, libc.Uint64FromInt64(len1)) } *(*TTcl_Size)(unsafe.Pointer(byteArrayPtr)) += len1 _isobjPtr = objPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } } /* *---------------------------------------------------------------------- * * TclInitBinaryCmd -- * * This function is called to create the "binary" Tcl command. See the * user documentation for details on what it does. * * Results: * A command token for the new command. * * Side effects: * Creates a new binary command as a mapped ensemble. * *---------------------------------------------------------------------- */ func XTclInitBinaryCmd(tls *libc.TLS, interp uintptr) (r TTcl_Command) { var binaryEnsemble TTcl_Command _ = binaryEnsemble binaryEnsemble = XTclMakeEnsemble(tls, interp, __ccgo_ts+10664, uintptr(unsafe.Pointer(&_binaryMap))) XTclMakeEnsemble(tls, interp, __ccgo_ts+10671, uintptr(unsafe.Pointer(&_encodeMap))) XTclMakeEnsemble(tls, interp, __ccgo_ts+10685, uintptr(unsafe.Pointer(&_decodeMap))) return binaryEnsemble } /* *---------------------------------------------------------------------- * * BinaryFormatCmd -- * * This procedure implements the "binary format" Tcl command. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _BinaryFormatCmd(tls *libc.TLS, dummy837 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) /* Argument objects. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, buffer, bytes, cachePtr, copy1, errorString, errorValue, last, last1, maxPos, resultPtr, str, v1, v35, v39, v40, v43, v44, v47, v48, v49, v50, v51, v54, v55, v58, v59, v60, v61, v67 uintptr var arg, c, value, v29, v31, v36, v37 int32 var i, offset, size, v38, v42, v46, v53, v57, v66 TTcl_Size var pad uint8 var v30, v32, v33, v63, v64 int64 var v34 bool var _ /* buf at bp+85 */ [5]uint8 var _ /* ch at bp+80 */ TTcl_UniChar var _ /* cmd at bp+0 */ uint8 var _ /* count at bp+8 */ TTcl_Size var _ /* cursor at bp+32 */ uintptr var _ /* flags at bp+16 */ int32 var _ /* format at bp+24 */ uintptr var _ /* length at bp+40 */ TTcl_Size var _ /* listc at bp+48 */ TTcl_Size var _ /* listc at bp+64 */ TTcl_Size var _ /* listv at bp+56 */ uintptr var _ /* listv at bp+72 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, arg, buffer, bytes, c, cachePtr, copy1, errorString, errorValue, i, last, last1, maxPos, offset, pad, resultPtr, size, str, value, v1, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v42, v43, v44, v46, v47, v48, v49, v50, v51, v53, v54, v55, v57, v58, v59, v60, v61, v63, v64, v66, v67 /* Index of next argument to consume. */ value = 0 /* Pointer to current position in format * string. */ resultPtr = libc.UintptrFromInt32(0) if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+10699) return int32(TCL_ERROR) } /* * To avoid copying the data, we format the string in two passes. The * first pass computes the size of the output buffer. The second pass * places the formatted data into the buffer. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } *(*uintptr)(unsafe.Pointer(bp + 24)) = v1 arg = int32(2) offset = 0 *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = 0 for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24))))) != int32('\000') { str = *(*uintptr)(unsafe.Pointer(bp + 24)) *(*int32)(unsafe.Pointer(bp + 16)) = 0 if !(_GetFormatSpec(tls, bp+24, bp, bp+8, bp+16) != 0) { break } switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) { case int32('H'): goto _2 case int32('h'): goto _3 case int32('B'): goto _4 case int32('b'): goto _5 case int32('A'): goto _6 case int32('a'): goto _7 case int32('c'): goto _8 case int32('S'): goto _9 case int32('s'): goto _10 case int32('t'): goto _11 case int32('I'): goto _12 case int32('i'): goto _13 case int32('n'): goto _14 case int32('W'): goto _15 case int32('w'): goto _16 case int32('m'): goto _17 case int32('f'): goto _18 case int32('R'): goto _19 case int32('r'): goto _20 case int32('d'): goto _21 case int32('Q'): goto _22 case int32('q'): goto _23 case int32('x'): goto _24 case int32('X'): goto _25 case int32('@'): goto _26 default: goto _27 } goto _28 _7: ; _6: ; _5: ; _4: ; _3: ; _2: ; /* * For string-type specifiers, the count corresponds to the number * of bytes in a single argument. */ if arg >= objc { goto badIndex } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { if XTcl_GetBytesFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+8) == libc.UintptrFromInt32(0) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8))) } } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } } arg++ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('a') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('A') { offset += *(*TTcl_Size)(unsafe.Pointer(bp + 8)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('b') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('B') { offset += (*(*TTcl_Size)(unsafe.Pointer(bp + 8)) + int64(7)) / int64(8) } else { offset += (*(*TTcl_Size)(unsafe.Pointer(bp + 8)) + int64(1)) / int64(2) } } goto _28 _8: ; size = int64(1) goto doNumbers _11: ; _10: ; _9: ; size = int64(2) goto doNumbers _14: ; _13: ; _12: ; size = int64(4) goto doNumbers _17: ; _16: ; _15: ; size = int64(8) goto doNumbers _20: ; _19: ; _18: ; size = int64(4) goto doNumbers _23: ; _22: ; _21: ; size = int64(8) goto doNumbers doNumbers: ; if arg >= objc { goto badIndex } /* * For number-type specifiers, the count corresponds to the number * of elements in the list stored in a single argument. If no * count is specified, then the argument is taken as a single * non-list value. */ if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { arg++ *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } else { /* * The macro evals its args more than once: avoid arg++ */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2 != 0 { v30 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2)).FspanLength } else { v30 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 48)) = v30 v29 = libc.Int32FromInt32(TCL_OK) } else { v29 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+48) } if v29 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 48)) } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > *(*TTcl_Size)(unsafe.Pointer(bp + 48)) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+10722, int64(-int32(1)))) return int32(TCL_ERROR) } } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2 != 0 { v32 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2)).FspanStart } else { v32 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 56)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr1 + 40 + uintptr(v32)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2 != 0 { v33 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2)).FspanLength } else { v33 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 48)) = v33 v31 = libc.Int32FromInt32(TCL_OK) } else { v31 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+48, bp+56) } if v31 != TCL_OK { return int32(TCL_ERROR) } arg++ } offset += *(*TTcl_Size)(unsafe.Pointer(bp + 8)) * size goto _28 _24: ; if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+10770, int64(-int32(1)))) return int32(TCL_ERROR) } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } } offset += *(*TTcl_Size)(unsafe.Pointer(bp + 8)) goto _28 _25: ; if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > offset || *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = offset } if offset > *(*TTcl_Size)(unsafe.Pointer(bp + 40)) { *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = offset } offset -= *(*TTcl_Size)(unsafe.Pointer(bp + 8)) goto _28 _26: ; if offset > *(*TTcl_Size)(unsafe.Pointer(bp + 40)) { *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = offset } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { offset = *(*TTcl_Size)(unsafe.Pointer(bp + 40)) } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { goto badCount } else { offset = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) } } goto _28 _27: ; errorString = str goto badField _28: } if offset > *(*TTcl_Size)(unsafe.Pointer(bp + 40)) { *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = offset } if *(*TTcl_Size)(unsafe.Pointer(bp + 40)) == 0 { return TCL_OK } /* * Prepare the result object by preallocating the calculated number of * bytes and filling with nulls. */ if v34 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v34 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v34 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { resultPtr = XTclThreadAllocObj(tls) } else { resultPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = libc.UintptrFromInt32(0) buffer = XTcl_SetByteArrayLength(tls, resultPtr, *(*TTcl_Size)(unsafe.Pointer(bp + 40))) libc.Xmemset(tls, buffer, 0, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 40)))) /* * Pack the data into the result object. Note that we can skip the error * checking during this pass, since we have already parsed the string * once. */ arg = int32(2) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v35 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v35 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } *(*uintptr)(unsafe.Pointer(bp + 24)) = v35 *(*uintptr)(unsafe.Pointer(bp + 32)) = buffer maxPos = *(*uintptr)(unsafe.Pointer(bp + 32)) for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24))))) != 0 { *(*int32)(unsafe.Pointer(bp + 16)) = 0 if !(_GetFormatSpec(tls, bp+24, bp, bp+8, bp+16) != 0) { break } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) != int32('@') { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) != int32('x') { arg++ } continue } switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) { case int32('a'): fallthrough case int32('A'): if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('a') { v36 = int32('\000') } else { v36 = int32(' ') } pad = libc.Uint8FromInt32(v36) v37 = arg arg++ copy1 = _TclNarrowToBytes(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(v37)*8))) bytes = XTcl_GetBytesFromObj(tls, libc.UintptrFromInt32(0), copy1, bp+40) if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 40)) } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } } if *(*TTcl_Size)(unsafe.Pointer(bp + 40)) >= *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), bytes, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) } else { libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), bytes, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 40)))) libc.Xmemset(tls, *(*uintptr)(unsafe.Pointer(bp + 32))+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 40))), libc.Int32FromUint8(pad), libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8))-*(*TTcl_Size)(unsafe.Pointer(bp + 40)))) } *(*uintptr)(unsafe.Pointer(bp + 32)) += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) _objPtr = copy1 v39 = _objPtr v38 = *(*TTcl_Size)(unsafe.Pointer(v39)) *(*TTcl_Size)(unsafe.Pointer(v39))-- if v38 <= int64(1) { XTclFreeObj(tls, _objPtr) } case int32('b'): fallthrough case int32('B'): if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Flength v40 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Fbytes } else { v40 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+40) } str = v40 arg++ if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 40)) } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } } last = *(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr((*(*TTcl_Size)(unsafe.Pointer(bp + 8))+libc.Int64FromInt32(7))/libc.Int64FromInt32(8)) if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > *(*TTcl_Size)(unsafe.Pointer(bp + 40)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 40)) } value = 0 errorString = __ccgo_ts + 10664 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('B') { offset = 0 for { if !(offset < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } value <<= int32(1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str + uintptr(offset)))) == int32('1') { value |= int32(1) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str + uintptr(offset)))) != int32('0') { errorValue = str _objPtr1 = resultPtr v43 = _objPtr1 v42 = *(*TTcl_Size)(unsafe.Pointer(v43)) *(*TTcl_Size)(unsafe.Pointer(v43))-- if v42 <= int64(1) { XTclFreeObj(tls, _objPtr1) } goto badValue } } if (offset+int64(1))%int64(8) == 0 { v44 = *(*uintptr)(unsafe.Pointer(bp + 32)) *(*uintptr)(unsafe.Pointer(bp + 32))++ *(*uint8)(unsafe.Pointer(v44)) = libc.Uint8FromInt32(value) value = 0 } goto _41 _41: ; offset++ } } else { offset = 0 for { if !(offset < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } value >>= int32(1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str + uintptr(offset)))) == int32('1') { value |= int32(128) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str + uintptr(offset)))) != int32('0') { errorValue = str _objPtr2 = resultPtr v47 = _objPtr2 v46 = *(*TTcl_Size)(unsafe.Pointer(v47)) *(*TTcl_Size)(unsafe.Pointer(v47))-- if v46 <= int64(1) { XTclFreeObj(tls, _objPtr2) } goto badValue } } if !((offset+libc.Int64FromInt32(1))%libc.Int64FromInt32(8) != 0) { v48 = *(*uintptr)(unsafe.Pointer(bp + 32)) *(*uintptr)(unsafe.Pointer(bp + 32))++ *(*uint8)(unsafe.Pointer(v48)) = libc.Uint8FromInt32(value) value = 0 } goto _45 _45: ; offset++ } } if offset%int64(8) != 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('B') { value = int32(int64(value) << (libc.Int64FromInt32(8) - offset%libc.Int64FromInt32(8))) } else { value = int32(int64(value) >> (libc.Int64FromInt32(8) - offset%libc.Int64FromInt32(8))) } v49 = *(*uintptr)(unsafe.Pointer(bp + 32)) *(*uintptr)(unsafe.Pointer(bp + 32))++ *(*uint8)(unsafe.Pointer(v49)) = libc.Uint8FromInt32(value) } for *(*uintptr)(unsafe.Pointer(bp + 32)) < last { v50 = *(*uintptr)(unsafe.Pointer(bp + 32)) *(*uintptr)(unsafe.Pointer(bp + 32))++ *(*uint8)(unsafe.Pointer(v50)) = uint8('\000') } case int32('h'): fallthrough case int32('H'): if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Flength v51 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).Fbytes } else { v51 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+40) } str = v51 arg++ if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 40)) } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } } last1 = *(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr((*(*TTcl_Size)(unsafe.Pointer(bp + 8))+libc.Int64FromInt32(1))/libc.Int64FromInt32(2)) if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > *(*TTcl_Size)(unsafe.Pointer(bp + 40)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 40)) } value = 0 errorString = __ccgo_ts + 10811 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('H') { offset = 0 for { if !(offset < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } value <<= int32(4) if !(libc.Xisxdigit(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str + uintptr(offset))))) != 0) { /* INTL: digit */ errorValue = str _objPtr3 = resultPtr v54 = _objPtr3 v53 = *(*TTcl_Size)(unsafe.Pointer(v54)) *(*TTcl_Size)(unsafe.Pointer(v54))-- if v53 <= int64(1) { XTclFreeObj(tls, _objPtr3) } goto badValue } c = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str + uintptr(offset)))) - int32('0') if c > int32(9) { c += libc.Int32FromUint8('0') - libc.Int32FromUint8('A') + libc.Int32FromInt32(10) } if c > int32(16) { c += libc.Int32FromUint8('A') - libc.Int32FromUint8('a') } value |= c & int32(0xF) if offset%int64(2) != 0 { v55 = *(*uintptr)(unsafe.Pointer(bp + 32)) *(*uintptr)(unsafe.Pointer(bp + 32))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint8FromInt32(value)) value = 0 } goto _52 _52: ; offset++ } } else { offset = 0 for { if !(offset < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } value >>= int32(4) if !(libc.Xisxdigit(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str + uintptr(offset))))) != 0) { /* INTL: digit */ errorValue = str _objPtr4 = resultPtr v58 = _objPtr4 v57 = *(*TTcl_Size)(unsafe.Pointer(v58)) *(*TTcl_Size)(unsafe.Pointer(v58))-- if v57 <= int64(1) { XTclFreeObj(tls, _objPtr4) } goto badValue } c = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str + uintptr(offset)))) - int32('0') if c > int32(9) { c += libc.Int32FromUint8('0') - libc.Int32FromUint8('A') + libc.Int32FromInt32(10) } if c > int32(16) { c += libc.Int32FromUint8('A') - libc.Int32FromUint8('a') } value |= c << int32(4) & int32(0xF0) if offset%int64(2) != 0 { v59 = *(*uintptr)(unsafe.Pointer(bp + 32)) *(*uintptr)(unsafe.Pointer(bp + 32))++ *(*uint8)(unsafe.Pointer(v59)) = libc.Uint8FromInt32(value & libc.Int32FromInt32(0xFF)) value = 0 } goto _56 _56: ; offset++ } } if offset%int64(2) != 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('H') { value <<= int32(4) } else { value >>= int32(4) } v60 = *(*uintptr)(unsafe.Pointer(bp + 32)) *(*uintptr)(unsafe.Pointer(bp + 32))++ *(*uint8)(unsafe.Pointer(v60)) = libc.Uint8FromInt32(value) } for *(*uintptr)(unsafe.Pointer(bp + 32)) < last1 { v61 = *(*uintptr)(unsafe.Pointer(bp + 32)) *(*uintptr)(unsafe.Pointer(bp + 32))++ *(*uint8)(unsafe.Pointer(v61)) = uint8('\000') } case int32('c'): fallthrough case int32('t'): fallthrough case int32('s'): fallthrough case int32('S'): fallthrough case int32('n'): fallthrough case int32('i'): fallthrough case int32('I'): fallthrough case int32('m'): fallthrough case int32('w'): fallthrough case int32('W'): fallthrough case int32('r'): fallthrough case int32('R'): fallthrough case int32('d'): fallthrough case int32('q'): fallthrough case int32('Q'): fallthrough case int32('f'): if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { /* * Note that we are casting away the const-ness of objv, but * this is safe since we aren't going to modify the array. */ *(*uintptr)(unsafe.Pointer(bp + 72)) = objv + uintptr(arg)*8 *(*TTcl_Size)(unsafe.Pointer(bp + 64)) = int64(1) *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } else { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2 != 0 { v63 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2)).FspanStart } else { v63 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 72)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr1 + 40 + uintptr(v63)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2 != 0 { v64 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr2)).FspanLength } else { v64 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 64)) = v64 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), bp+64, bp+72) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 64)) } } arg++ i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } if _FormatNumber(tls, interp, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 72)) + uintptr(i)*8)), bp+32) != TCL_OK { _objPtr5 = resultPtr v67 = _objPtr5 v66 = *(*TTcl_Size)(unsafe.Pointer(v67)) *(*TTcl_Size)(unsafe.Pointer(v67))-- if v66 <= int64(1) { XTclFreeObj(tls, _objPtr5) } return int32(TCL_ERROR) } goto _65 _65: ; i++ } case int32('x'): if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } libc.Xmemset(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), 0, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) *(*uintptr)(unsafe.Pointer(bp + 32)) += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) case int32('X'): if *(*uintptr)(unsafe.Pointer(bp + 32)) > maxPos { maxPos = *(*uintptr)(unsafe.Pointer(bp + 32)) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) || *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > int64(*(*uintptr)(unsafe.Pointer(bp + 32)))-int64(buffer) { *(*uintptr)(unsafe.Pointer(bp + 32)) = buffer } else { *(*uintptr)(unsafe.Pointer(bp + 32)) -= uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) } case int32('@'): if *(*uintptr)(unsafe.Pointer(bp + 32)) > maxPos { maxPos = *(*uintptr)(unsafe.Pointer(bp + 32)) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*uintptr)(unsafe.Pointer(bp + 32)) = maxPos } else { *(*uintptr)(unsafe.Pointer(bp + 32)) = buffer + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) } break } } XTcl_SetObjResult(tls, interp, resultPtr) return TCL_OK goto badValue badValue: ; XTcl_ResetResult(tls, interp) XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+10823, libc.VaList(bp+104, errorString, errorValue))) return int32(TCL_ERROR) goto badCount badCount: ; errorString = __ccgo_ts + 10863 goto error goto badIndex badIndex: ; errorString = __ccgo_ts + 10901 goto error goto badField badField: ; *(*TTcl_UniChar)(unsafe.Pointer(bp + 80)) = 0 *(*[5]uint8)(unsafe.Pointer(bp + 85)) = [5]uint8{} if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(errorString))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp + 80)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(errorString))) _ = libc.Int32FromInt32(1) } else { XTcl_UtfToUniChar(tls, errorString, bp+80) } (*(*[5]uint8)(unsafe.Pointer(bp + 85)))[XTcl_UniCharToUtf(tls, *(*TTcl_UniChar)(unsafe.Pointer(bp + 80)), bp+85)] = uint8('\000') XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+10948, libc.VaList(bp+104, bp+85))) return int32(TCL_ERROR) goto error error: ; XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, errorString, int64(-int32(1)))) return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * BinaryScanCmd -- * * This procedure implements the "binary scan" Tcl command. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _BinaryScanCmd(tls *libc.TLS, dummy1349 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(192) defer tls.Free(192) /* Argument objects. */ var arg, value, v36, v40 int32 var buffer, cachePtr, cachePtr1, cachePtr2, dest, dest1, elementPtr, errorString, resultPtr, src, src1, src2, src3, str, valuePtr, v1, v32, v34, v35, v38, v39, v42, v44, v45, v47, v48 uintptr var i, offset, size TTcl_Size var v31, v41, v49 bool var _ /* buf at bp+160 */ [5]uint8 var _ /* ch at bp+152 */ TTcl_UniChar var _ /* cmd at bp+0 */ uint8 var _ /* count at bp+8 */ TTcl_Size var _ /* flags at bp+16 */ int32 var _ /* format at bp+24 */ uintptr var _ /* length at bp+32 */ TTcl_Size var _ /* numberCacheHash at bp+40 */ TTcl_HashTable var _ /* numberCachePtr at bp+144 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = arg, buffer, cachePtr, cachePtr1, cachePtr2, dest, dest1, elementPtr, errorString, i, offset, resultPtr, size, src, src1, src2, src3, str, value, valuePtr, v1, v31, v32, v34, v35, v36, v38, v39, v40, v41, v42, v44, v45, v47, v48, v49 /* Index of next argument to consume. */ value = 0 /* Pointer to current position in format * string. */ resultPtr = libc.UintptrFromInt32(0) *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = 0 if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+10973) return int32(TCL_ERROR) } buffer = XTcl_GetBytesFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+32) if buffer == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(bp + 144)) = bp + 40 XTcl_InitHashTable(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), int32(TCL_ONE_WORD_KEYS)) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), libc.UintptrFromInt32(0)) } *(*uintptr)(unsafe.Pointer(bp + 24)) = v1 arg = int32(3) offset = 0 for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24))))) != int32('\000') { str = *(*uintptr)(unsafe.Pointer(bp + 24)) *(*int32)(unsafe.Pointer(bp + 16)) = 0 if !(_GetFormatSpec(tls, bp+24, bp, bp+8, bp+16) != 0) { goto done } switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) { case int32('C'): goto _2 case int32('A'): goto _3 case int32('a'): goto _4 case int32('B'): goto _5 case int32('b'): goto _6 case int32('H'): goto _7 case int32('h'): goto _8 case int32('c'): goto _9 case int32('S'): goto _10 case int32('s'): goto _11 case int32('t'): goto _12 case int32('I'): goto _13 case int32('i'): goto _14 case int32('n'): goto _15 case int32('W'): goto _16 case int32('w'): goto _17 case int32('m'): goto _18 case int32('f'): goto _19 case int32('R'): goto _20 case int32('r'): goto _21 case int32('d'): goto _22 case int32('Q'): goto _23 case int32('q'): goto _24 case int32('x'): goto _25 case int32('X'): goto _26 case int32('@'): goto _27 default: goto _28 } goto _29 _4: ; _3: ; _2: ; if arg >= objc { _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) goto badIndex } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 32)) - offset } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > *(*TTcl_Size)(unsafe.Pointer(bp + 32))-offset { goto done } } src = buffer + uintptr(offset) size = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) /* * Apply C string semantics or trim trailing * nulls and spaces, if necessary. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('C') { i = 0 for { if !(i < size) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src + uintptr(i)))) == int32('\000') { size = i break } goto _30 _30: ; i++ } } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('A') { for size > 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src + uintptr(size-int64(1))))) != int32('\000') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src + uintptr(size-int64(1))))) != int32(' ') { break } size-- } } } /* * Have to do this #ifdef-fery because (as part of defining * Tcl_NewByteArrayObj) we removed the #def that hides this stuff * normally. If this code ever gets copied to another file, it * should be changed back to the simpler version. */ valuePtr = XTcl_NewByteArrayObj(tls, src, size) resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), libc.UintptrFromInt32(0), valuePtr, int32(TCL_LEAVE_ERR_MSG)) arg++ if resultPtr == libc.UintptrFromInt32(0) { _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) return int32(TCL_ERROR) } offset += *(*TTcl_Size)(unsafe.Pointer(bp + 8)) goto _29 _6: ; _5: ; if arg >= objc { _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) goto badIndex } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*(*TTcl_Size)(unsafe.Pointer(bp + 32)) - offset) * int64(8) } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > (*(*TTcl_Size)(unsafe.Pointer(bp + 32))-offset)*int64(8) { goto done } } src1 = buffer + uintptr(offset) if v31 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v31 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v31 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { valuePtr = XTclThreadAllocObj(tls) } else { valuePtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valuePtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_SetObjLength(tls, valuePtr, *(*TTcl_Size)(unsafe.Pointer(bp + 8))) if (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 { v32 = (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes } else { v32 = XTcl_GetStringFromObj(tls, valuePtr, libc.UintptrFromInt32(0)) } dest = v32 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('b') { i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } if i%int64(8) != 0 { value >>= int32(1) } else { v34 = src1 src1++ value = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v34))) } v35 = dest dest++ if value&int32(1) != 0 { v36 = int32('1') } else { v36 = int32('0') } *(*uint8)(unsafe.Pointer(v35)) = libc.Uint8FromInt32(v36) goto _33 _33: ; i++ } } else { i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } if i%int64(8) != 0 { value <<= int32(1) } else { v38 = src1 src1++ value = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v38))) } v39 = dest dest++ if value&int32(0x80) != 0 { v40 = int32('1') } else { v40 = int32('0') } *(*uint8)(unsafe.Pointer(v39)) = libc.Uint8FromInt32(v40) goto _37 _37: ; i++ } } resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), libc.UintptrFromInt32(0), valuePtr, int32(TCL_LEAVE_ERR_MSG)) arg++ if resultPtr == libc.UintptrFromInt32(0) { _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) return int32(TCL_ERROR) } offset += (*(*TTcl_Size)(unsafe.Pointer(bp + 8)) + int64(7)) / int64(8) goto _29 _8: ; _7: ; if arg >= objc { _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) goto badIndex } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*(*TTcl_Size)(unsafe.Pointer(bp + 32)) - offset) * int64(2) } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > (*(*TTcl_Size)(unsafe.Pointer(bp + 32))-offset)*int64(2) { goto done } } src2 = buffer + uintptr(offset) if v41 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v41 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v41 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { valuePtr = XTclThreadAllocObj(tls) } else { valuePtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valuePtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_SetObjLength(tls, valuePtr, *(*TTcl_Size)(unsafe.Pointer(bp + 8))) if (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 { v42 = (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes } else { v42 = XTcl_GetStringFromObj(tls, valuePtr, libc.UintptrFromInt32(0)) } dest1 = v42 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32('h') { i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } if i%int64(2) != 0 { value >>= int32(4) } else { v44 = src2 src2++ value = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v44))) } v45 = dest1 dest1++ *(*uint8)(unsafe.Pointer(v45)) = _hexdigit[value&int32(0xF)] goto _43 _43: ; i++ } } else { i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } if i%int64(2) != 0 { value <<= int32(4) } else { v47 = src2 src2++ value = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v47))) } v48 = dest1 dest1++ *(*uint8)(unsafe.Pointer(v48)) = _hexdigit[value>>int32(4)&int32(0xF)] goto _46 _46: ; i++ } } resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), libc.UintptrFromInt32(0), valuePtr, int32(TCL_LEAVE_ERR_MSG)) arg++ if resultPtr == libc.UintptrFromInt32(0) { _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) return int32(TCL_ERROR) } offset += (*(*TTcl_Size)(unsafe.Pointer(bp + 8)) + int64(1)) / int64(2) goto _29 _9: ; size = int64(1) goto scanNumber _12: ; _11: ; _10: ; size = int64(2) goto scanNumber _15: ; _14: ; _13: ; size = int64(4) goto scanNumber _18: ; _17: ; _16: ; size = int64(8) goto scanNumber _21: ; _20: ; _19: ; size = int64(4) goto scanNumber _24: ; _23: ; _22: ; size = int64(8) /* fall through */ goto scanNumber scanNumber: ; if arg >= objc { _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) goto badIndex } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { if *(*TTcl_Size)(unsafe.Pointer(bp + 32)) < size+offset { goto done } valuePtr = _ScanNumber(tls, buffer+uintptr(offset), libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))), *(*int32)(unsafe.Pointer(bp + 16)), bp+144) offset += size } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*(*TTcl_Size)(unsafe.Pointer(bp + 32)) - offset) / size } if *(*TTcl_Size)(unsafe.Pointer(bp + 32))-offset < *(*TTcl_Size)(unsafe.Pointer(bp + 8))*size { goto done } if v49 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v49 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v49 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { valuePtr = XTclThreadAllocObj(tls) } else { valuePtr = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valuePtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = libc.UintptrFromInt32(0) src3 = buffer + uintptr(offset) i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } elementPtr = _ScanNumber(tls, src3, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))), *(*int32)(unsafe.Pointer(bp + 16)), bp+144) src3 += uintptr(size) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), valuePtr, elementPtr) goto _50 _50: ; i++ } offset += *(*TTcl_Size)(unsafe.Pointer(bp + 8)) * size } resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(arg)*8)), libc.UintptrFromInt32(0), valuePtr, int32(TCL_LEAVE_ERR_MSG)) arg++ if resultPtr == libc.UintptrFromInt32(0) { _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) return int32(TCL_ERROR) } goto _29 _25: ; if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) || *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > *(*TTcl_Size)(unsafe.Pointer(bp + 32))-offset { offset = *(*TTcl_Size)(unsafe.Pointer(bp + 32)) } else { offset += *(*TTcl_Size)(unsafe.Pointer(bp + 8)) } goto _29 _26: ; if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) || *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > offset { offset = 0 } else { offset -= *(*TTcl_Size)(unsafe.Pointer(bp + 8)) } goto _29 _27: ; if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(2)) { _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) goto badCount } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(-int32(1)) || *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > *(*TTcl_Size)(unsafe.Pointer(bp + 32)) { offset = *(*TTcl_Size)(unsafe.Pointer(bp + 32)) } else { offset = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) } goto _29 _28: ; _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) errorString = str goto badField _29: } /* * Set the result to the last position of the cursor. */ goto done done: ; XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64(arg-int32(3)))) _DeleteScanNumberCache(tls, *(*uintptr)(unsafe.Pointer(bp + 144))) return TCL_OK goto badCount badCount: ; errorString = __ccgo_ts + 10863 goto error goto badIndex badIndex: ; errorString = __ccgo_ts + 10901 goto error goto badField badField: ; *(*TTcl_UniChar)(unsafe.Pointer(bp + 152)) = 0 *(*[5]uint8)(unsafe.Pointer(bp + 160)) = [5]uint8{} if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(errorString))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp + 152)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(errorString))) _ = libc.Int32FromInt32(1) } else { XTcl_UtfToUniChar(tls, errorString, bp+152) } (*(*[5]uint8)(unsafe.Pointer(bp + 160)))[XTcl_UniCharToUtf(tls, *(*TTcl_UniChar)(unsafe.Pointer(bp + 152)), bp+160)] = uint8('\000') XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+10948, libc.VaList(bp+176, bp+160))) return int32(TCL_ERROR) goto error error: ; XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, errorString, int64(-int32(1)))) return int32(TCL_ERROR) } var _hexdigit = [17]uint8{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'} /* *---------------------------------------------------------------------- * * GetFormatSpec -- * * This function parses the format strings used in the binary format and * scan commands. * * Results: * Moves the formatPtr to the start of the next command. Returns the * current command character and count in cmdPtr and countPtr. The count * is set to BINARY_ALL if the count character was '*' or BINARY_NOCOUNT * if no count was specified. Returns 1 on success, or 0 if the string * did not have a format specifier. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _GetFormatSpec(tls *libc.TLS, formatPtr uintptr, cmdPtr uintptr, countPtr uintptr, flagsPtr uintptr) (r int32) { /* Pointer to field flags */ var count uint64 _ = count /* * Skip any leading blanks. */ for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr))))) == int32(' ') { *(*uintptr)(unsafe.Pointer(formatPtr))++ } /* * The string was empty, except for whitespace, so fail. */ if !(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr)))) != 0) { return 0 } /* * Extract the command character and any trailing digits or '*'. */ *(*uint8)(unsafe.Pointer(cmdPtr)) = *(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr)))) *(*uintptr)(unsafe.Pointer(formatPtr))++ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr))))) == int32('u') { *(*uintptr)(unsafe.Pointer(formatPtr))++ *(*int32)(unsafe.Pointer(flagsPtr)) |= int32(BINARY_UNSIGNED) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr))))) == int32('*') { *(*uintptr)(unsafe.Pointer(formatPtr))++ *(*TTcl_Size)(unsafe.Pointer(countPtr)) = int64(-int32(1)) } else { if libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(formatPtr)))))-uint32('0') < uint32(10)) != 0 { *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0 count = libc.Xstrtoull(tls, *(*uintptr)(unsafe.Pointer(formatPtr)), formatPtr, int32(10)) if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != 0 || count > libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) { *(*TTcl_Size)(unsafe.Pointer(countPtr)) = libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(1)) } else { *(*TTcl_Size)(unsafe.Pointer(countPtr)) = libc.Int64FromUint64(count) } } else { *(*TTcl_Size)(unsafe.Pointer(countPtr)) = int64(-int32(2)) } } return int32(1) } /* *---------------------------------------------------------------------- * * NeedReversing -- * * This routine determines, if bytes of a number need to be re-ordered, * and returns a numeric code indicating the re-ordering to be done. * This depends on the endianness of the machine and the desired format. * It is in effect a table (whose contents depend on the endianness of * the system) describing whether a value needs reversing or not. Anyone * porting the code to a big-endian platform should take care to make * sure that they define WORDS_BIGENDIAN though this is already done by * configure for the Unix build; little-endian platforms (including * Windows) don't need to do anything. * * Results: * 0 No re-ordering needed. * 1 Reverse the bytes: 01234567 <-> 76543210 (little to big) * 2 Apply this re-ordering: 01234567 <-> 45670123 (Nokia to little) * 3 Apply this re-ordering: 01234567 <-> 32107654 (Nokia to big) * * Side effects: * None * *---------------------------------------------------------------------- */ func _NeedReversing(tls *libc.TLS, format int32) (r int32) { switch format { /* native floats and doubles: never reverse */ case int32('d'): fallthrough case int32('f'): /* big endian ints: never reverse */ fallthrough case int32('I'): fallthrough case int32('S'): fallthrough case int32('W'): /* native ints: reverse if we're little-endian */ fallthrough case int32('n'): fallthrough case int32('t'): fallthrough case int32('m'): /* f: reverse if we're little-endian */ fallthrough case int32('Q'): fallthrough case int32('R'): return 0 /* small endian floats: reverse if we're big-endian */ fallthrough case int32('q'): fallthrough case int32('r'): /* small endian ints: always reverse */ fallthrough case int32('i'): fallthrough case int32('s'): fallthrough case int32('w'): return int32(1) } XTcl_Panic(tls, __ccgo_ts+11006, 0) return 0 } /* *---------------------------------------------------------------------- * * CopyNumber -- * * This routine is called by FormatNumber and ScanNumber to copy a * floating-point number. If required, bytes are reversed while copying. * The behaviour is only fully defined when used with IEEE float and * double values (guaranteed to be 4 and 8 bytes long, respectively.) * * Results: * None * * Side effects: * Copies length bytes * *---------------------------------------------------------------------- */ func _CopyNumber(tls *libc.TLS, from uintptr, to uintptr, length Tsize_t, type1 int32) { /* What type of thing are we copying? */ var fromPtr, fromPtr1, fromPtr2, toPtr, toPtr1, toPtr2 uintptr _, _, _, _, _, _ = fromPtr, fromPtr1, fromPtr2, toPtr, toPtr1, toPtr2 switch _NeedReversing(tls, type1) { case 0: libc.Xmemcpy(tls, to, from, length) case int32(1): fromPtr = from toPtr = to switch length { case uint64(4): *(*uint8)(unsafe.Pointer(toPtr)) = *(*uint8)(unsafe.Pointer(fromPtr + 3)) *(*uint8)(unsafe.Pointer(toPtr + 1)) = *(*uint8)(unsafe.Pointer(fromPtr + 2)) *(*uint8)(unsafe.Pointer(toPtr + 2)) = *(*uint8)(unsafe.Pointer(fromPtr + 1)) *(*uint8)(unsafe.Pointer(toPtr + 3)) = *(*uint8)(unsafe.Pointer(fromPtr)) case uint64(8): *(*uint8)(unsafe.Pointer(toPtr)) = *(*uint8)(unsafe.Pointer(fromPtr + 7)) *(*uint8)(unsafe.Pointer(toPtr + 1)) = *(*uint8)(unsafe.Pointer(fromPtr + 6)) *(*uint8)(unsafe.Pointer(toPtr + 2)) = *(*uint8)(unsafe.Pointer(fromPtr + 5)) *(*uint8)(unsafe.Pointer(toPtr + 3)) = *(*uint8)(unsafe.Pointer(fromPtr + 4)) *(*uint8)(unsafe.Pointer(toPtr + 4)) = *(*uint8)(unsafe.Pointer(fromPtr + 3)) *(*uint8)(unsafe.Pointer(toPtr + 5)) = *(*uint8)(unsafe.Pointer(fromPtr + 2)) *(*uint8)(unsafe.Pointer(toPtr + 6)) = *(*uint8)(unsafe.Pointer(fromPtr + 1)) *(*uint8)(unsafe.Pointer(toPtr + 7)) = *(*uint8)(unsafe.Pointer(fromPtr)) break } case int32(2): fromPtr1 = from toPtr1 = to *(*uint8)(unsafe.Pointer(toPtr1)) = *(*uint8)(unsafe.Pointer(fromPtr1 + 4)) *(*uint8)(unsafe.Pointer(toPtr1 + 1)) = *(*uint8)(unsafe.Pointer(fromPtr1 + 5)) *(*uint8)(unsafe.Pointer(toPtr1 + 2)) = *(*uint8)(unsafe.Pointer(fromPtr1 + 6)) *(*uint8)(unsafe.Pointer(toPtr1 + 3)) = *(*uint8)(unsafe.Pointer(fromPtr1 + 7)) *(*uint8)(unsafe.Pointer(toPtr1 + 4)) = *(*uint8)(unsafe.Pointer(fromPtr1)) *(*uint8)(unsafe.Pointer(toPtr1 + 5)) = *(*uint8)(unsafe.Pointer(fromPtr1 + 1)) *(*uint8)(unsafe.Pointer(toPtr1 + 6)) = *(*uint8)(unsafe.Pointer(fromPtr1 + 2)) *(*uint8)(unsafe.Pointer(toPtr1 + 7)) = *(*uint8)(unsafe.Pointer(fromPtr1 + 3)) case int32(3): fromPtr2 = from toPtr2 = to *(*uint8)(unsafe.Pointer(toPtr2)) = *(*uint8)(unsafe.Pointer(fromPtr2 + 3)) *(*uint8)(unsafe.Pointer(toPtr2 + 1)) = *(*uint8)(unsafe.Pointer(fromPtr2 + 2)) *(*uint8)(unsafe.Pointer(toPtr2 + 2)) = *(*uint8)(unsafe.Pointer(fromPtr2 + 1)) *(*uint8)(unsafe.Pointer(toPtr2 + 3)) = *(*uint8)(unsafe.Pointer(fromPtr2)) *(*uint8)(unsafe.Pointer(toPtr2 + 4)) = *(*uint8)(unsafe.Pointer(fromPtr2 + 7)) *(*uint8)(unsafe.Pointer(toPtr2 + 5)) = *(*uint8)(unsafe.Pointer(fromPtr2 + 6)) *(*uint8)(unsafe.Pointer(toPtr2 + 6)) = *(*uint8)(unsafe.Pointer(fromPtr2 + 5)) *(*uint8)(unsafe.Pointer(toPtr2 + 7)) = *(*uint8)(unsafe.Pointer(fromPtr2 + 4)) break } } /* *---------------------------------------------------------------------- * * FormatNumber -- * * This routine is called by Tcl_BinaryObjCmd to format a number into a * location pointed at by cursor. * * Results: * A standard Tcl result. * * Side effects: * Moves the cursor to the next location to be written into. * *---------------------------------------------------------------------- */ func _FormatNumber(tls *libc.TLS, interp uintptr, type1 int32, src uintptr, cursorPtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Pointer to index into destination buffer. */ var irPtr, irPtr1, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v7, v8, v9 uintptr var v3, v4 float32 var _ /* dvalue at bp+0 */ float64 var _ /* fvalue at bp+16 */ float32 var _ /* wvalue at bp+8 */ TTcl_WideInt _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = irPtr, irPtr1, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v7, v8, v9 switch type1 { case int32('d'): fallthrough case int32('q'): fallthrough case int32('Q'): /* * Double-precision floating point values. Tcl_GetDoubleFromObj * returns TCL_ERROR for NaN, but we can check by comparing the * object's type pointer. */ if XTcl_GetDoubleFromObj(tls, interp, src, bp) != TCL_OK { if (*TTcl_Obj)(unsafe.Pointer(src)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) { v1 = src + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(irPtr)) } _CopyNumber(tls, bp, *(*uintptr)(unsafe.Pointer(cursorPtr)), uint64(8), type1) *(*uintptr)(unsafe.Pointer(cursorPtr)) += uintptr(8) return TCL_OK case int32('f'): fallthrough case int32('r'): fallthrough case int32('R'): /* * Single-precision floating point values. Tcl_GetDoubleFromObj * returns TCL_ERROR for NaN, but we can check by comparing the * object's type pointer. */ if XTcl_GetDoubleFromObj(tls, interp, src, bp) != TCL_OK { if (*TTcl_Obj)(unsafe.Pointer(src)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) { v2 = src + 32 } else { v2 = libc.UintptrFromInt32(0) } irPtr1 = v2 if irPtr1 == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(irPtr1)) } /* * Because some compilers will generate floating point exceptions on * an overflow cast (e.g. Borland), we restrict the values to the * valid range for float. */ if libc.Xfabs(tls, *(*float64)(unsafe.Pointer(bp))) > libc.Float64FromFloat32(3.4028234663852886e+38) { if libc.Xfabs(tls, *(*float64)(unsafe.Pointer(bp))) > libc.Float64FromFloat32(3.4028234663852886e+38)+libc.Xpow(tls, libc.Float64FromInt32(2), float64(libc.Int32FromInt32(FLT_MAX_EXP)-libc.Int32FromInt32(FLT_MANT_DIG)-libc.Int32FromInt32(1))) { if *(*float64)(unsafe.Pointer(bp)) >= float64(0) { v3 = libc.X__builtin_inff(tls) } else { v3 = -libc.X__builtin_inff(tls) } *(*float32)(unsafe.Pointer(bp + 16)) = v3 // c99 } else { if *(*float64)(unsafe.Pointer(bp)) >= float64(0) { v4 = libc.Float32FromFloat32(3.4028234663852886e+38) } else { v4 = -libc.Float32FromFloat32(3.4028234663852886e+38) } *(*float32)(unsafe.Pointer(bp + 16)) = v4 } } else { *(*float32)(unsafe.Pointer(bp + 16)) = float32(*(*float64)(unsafe.Pointer(bp))) } _CopyNumber(tls, bp+16, *(*uintptr)(unsafe.Pointer(cursorPtr)), uint64(4), type1) *(*uintptr)(unsafe.Pointer(cursorPtr)) += uintptr(4) return TCL_OK /* * 64-bit integer values. */ fallthrough case int32('w'): fallthrough case int32('W'): fallthrough case int32('m'): if XTclGetWideBitsFromObj(tls, interp, src, bp+8) != TCL_OK { return int32(TCL_ERROR) } if _NeedReversing(tls, type1) != 0 { v6 = cursorPtr v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) v8 = cursorPtr v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(8)) v10 = cursorPtr v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(16)) v12 = cursorPtr v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(24)) v14 = cursorPtr v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(32)) v16 = cursorPtr v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(40)) v18 = cursorPtr v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(48)) v20 = cursorPtr v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(56)) } else { v22 = cursorPtr v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(56)) v24 = cursorPtr v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(48)) v26 = cursorPtr v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(40)) v28 = cursorPtr v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(32)) v30 = cursorPtr v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(24)) v32 = cursorPtr v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(16)) v34 = cursorPtr v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(8)) v36 = cursorPtr v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) } return TCL_OK /* * 32-bit integer values. */ fallthrough case int32('i'): fallthrough case int32('I'): fallthrough case int32('n'): if XTclGetWideBitsFromObj(tls, interp, src, bp+8) != TCL_OK { return int32(TCL_ERROR) } if _NeedReversing(tls, type1) != 0 { v38 = cursorPtr v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) v40 = cursorPtr v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(8)) v42 = cursorPtr v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(16)) v44 = cursorPtr v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(24)) } else { v46 = cursorPtr v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(24)) v48 = cursorPtr v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(16)) v50 = cursorPtr v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(8)) v52 = cursorPtr v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) } return TCL_OK /* * 16-bit integer values. */ fallthrough case int32('s'): fallthrough case int32('S'): fallthrough case int32('t'): if XTclGetWideBitsFromObj(tls, interp, src, bp+8) != TCL_OK { return int32(TCL_ERROR) } if _NeedReversing(tls, type1) != 0 { v54 = cursorPtr v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) v56 = cursorPtr v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(8)) } else { v58 = cursorPtr v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(8)) v60 = cursorPtr v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) } return TCL_OK /* * 8-bit integer values. */ fallthrough case int32('c'): if XTclGetWideBitsFromObj(tls, interp, src, bp+8) != TCL_OK { return int32(TCL_ERROR) } v62 = cursorPtr v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) return TCL_OK default: XTcl_Panic(tls, __ccgo_ts+11006, 0) return int32(TCL_ERROR) } return r } /* *---------------------------------------------------------------------- * * ScanNumber -- * * This routine is called by Tcl_BinaryObjCmd to scan a number out of a * buffer. * * Results: * Returns a newly created object containing the scanned number. This * object has a ref count of zero. * * Side effects: * Might reuse an object in the number cache, place a new object in the * cache, or delete the cache and set the reference to it (itself passed * in by reference) to NULL. * *---------------------------------------------------------------------- */ func _ScanNumber(tls *libc.TLS, buffer uintptr, type1 int32, flags int32, numberCachePtrPtr uintptr) (r uintptr) { bp := tls.Alloc(48) defer tls.Free(48) /* Place to look for cache of scanned value * objects, or NULL if too many different * numbers have been scanned. */ var bigObj, cachePtr, hPtr, objPtr, tablePtr uintptr var uwvalue TTcl_WideUInt var value int64 var v18 bool var _ /* big at bp+24 */ Tmp_int var _ /* dvalue at bp+8 */ float64 var _ /* fvalue at bp+0 */ float32 var _ /* isNew at bp+16 */ int32 _, _, _, _, _, _, _, _ = bigObj, cachePtr, hPtr, objPtr, tablePtr, uwvalue, value, v18 /* * We cannot rely on the compiler to properly sign extend integer values * when we cast from smaller values to larger values because we don't know * the exact size of the integer types. So, we have to handle sign * extension explicitly by checking the high bit and padding with 1's as * needed. This practice is disabled if the BINARY_UNSIGNED flag is set. */ switch type1 { case int32('c'): goto _1 case int32('t'): goto _2 case int32('S'): goto _3 case int32('s'): goto _4 case int32('n'): goto _5 case int32('I'): goto _6 case int32('i'): goto _7 case int32('m'): goto _8 case int32('W'): goto _9 case int32('w'): goto _10 case int32('r'): goto _11 case int32('R'): goto _12 case int32('f'): goto _13 case int32('q'): goto _14 case int32('Q'): goto _15 case int32('d'): goto _16 } goto _17 _1: ; /* * Characters need special handling. We want to produce a signed * result, but on some platforms (such as AIX) chars are unsigned. To * deal with this, check for a value that should be negative but * isn't. */ value = libc.Int64FromUint8(*(*uint8)(unsafe.Pointer(buffer))) if !(flags&libc.Int32FromInt32(BINARY_UNSIGNED) != 0) { if value&int64(0x80) != 0 { value |= int64(-int32(0x100)) } } goto returnNumericObject /* * 16-bit numeric values. We need the sign extension trick (see above) * here as well. */ _4: ; _3: ; _2: ; if _NeedReversing(tls, type1) != 0 { value = int64(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buffer))) + libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buffer + 1)))< 0 { value -= libc.Int64FromUint32(libc.Uint32FromUint32(1) << libc.Int32FromInt32(31)) value -= libc.Int64FromUint32(libc.Uint32FromUint32(1) << libc.Int32FromInt32(31)) } goto returnNumericObject returnNumericObject: ; if *(*uintptr)(unsafe.Pointer(numberCachePtrPtr)) == libc.UintptrFromInt32(0) { return XTcl_NewWideIntObj(tls, value) } else { tablePtr = *(*uintptr)(unsafe.Pointer(numberCachePtrPtr)) hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(tablePtr)).FcreateProc})))(tls, tablePtr, uintptr(value), bp+16) if !(*(*int32)(unsafe.Pointer(bp + 16)) != 0) { return (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData } if (*TTcl_HashTable)(unsafe.Pointer(tablePtr)).FnumEntries <= int64(BINARY_SCAN_MAX_CACHE) { if v18 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v18 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v18 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep)) = value (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = objPtr return objPtr } /* * We've overflowed the cache! Someone's parsing a LOT of varied * binary data in a single call! Bail out by switching back to the * old behaviour for the rest of the scan. * * Note that anyone just using the 'c' conversion (for bytes) * cannot trigger this. */ _DeleteScanNumberCache(tls, tablePtr) *(*uintptr)(unsafe.Pointer(numberCachePtrPtr)) = libc.UintptrFromInt32(0) return XTcl_NewWideIntObj(tls, value) } /* * Do not cache wide (64-bit) values; they are already too large to * use as keys. */ _10: ; _9: ; _8: ; if _NeedReversing(tls, type1) != 0 { uwvalue = uint64(*(*uint8)(unsafe.Pointer(buffer))) | uint64(*(*uint8)(unsafe.Pointer(buffer + 1)))<>int32(4)&int32(0x0F)] v4 = cursor cursor++ *(*uint8)(unsafe.Pointer(v4)) = _HexDigits[libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(offset))))&int32(0x0F)] goto _2 _2: ; offset++ } XTcl_SetObjResult(tls, interp, resultObj) return TCL_OK } /* *---------------------------------------------------------------------- * * BinaryDecodeHex -- * * Implement the [binary decode hex] binary encoding. * * Results: * Interp result set to an decoded byte array object * * Side effects: * None * *---------------------------------------------------------------------- */ func _BinaryDecodeHex(tls *libc.TLS, dummy2481 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var begin, cachePtr, cachePtr1, cursor, data, dataend, datastart, resultObj, v10, v3, v4, v6, v7 uintptr var c uint8 var cut, size, v9 TTcl_Size var i, pure, strict, value int32 var v11, v2 bool var _ /* count at bp+8 */ TTcl_Size var _ /* index at bp+0 */ int32 var _ /* ucs4 at bp+16 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = begin, c, cachePtr, cachePtr1, cursor, cut, data, dataend, datastart, i, pure, resultObj, size, strict, value, v10, v11, v2, v3, v4, v6, v7, v9 resultObj = libc.UintptrFromInt32(0) pure = int32(1) strict = 0 cut = 0 *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 if objc < int32(2) || objc > int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+11042) return int32(TCL_ERROR) } i = int32(1) for { if !(i < objc-int32(1)) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_optStrings)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<= dataend { value <<= int32(4) break } v6 = data data++ c = *(*uint8)(unsafe.Pointer(v6)) if !(libc.Xisxdigit(tls, libc.Int32FromUint8(c)) != 0) { if strict != 0 || !(XTclIsSpaceProc(tls, libc.Int32FromUint8(c)) != 0) { goto badChar } i-- goto _5 } value <<= int32(4) c = uint8(int32(c) - libc.Int32FromUint8('0')) if libc.Int32FromUint8(c) > int32(9) { c = uint8(int32(c) + (libc.Int32FromUint8('0') - libc.Int32FromUint8('A') + libc.Int32FromInt32(10))) } if libc.Int32FromUint8(c) > int32(16) { c = uint8(int32(c) + (libc.Int32FromUint8('A') - libc.Int32FromUint8('a'))) } value |= libc.Int32FromUint8(c) & int32(0xF) goto _5 _5: ; i++ } if i < int32(2) { cut++ } v7 = cursor cursor++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(value) value = 0 } if cut > size { cut = size } XTcl_SetByteArrayLength(tls, resultObj, int64(cursor)-int64(begin)-cut) XTcl_SetObjResult(tls, interp, resultObj) return TCL_OK goto badChar badChar: ; if pure != 0 { *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromUint8(c) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data - libc.UintptrFromInt32(1)))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data - libc.UintptrFromInt32(1)))) _ = libc.Int32FromInt32(1) } else { XTcl_UtfToUniChar(tls, data-libc.UintptrFromInt32(1), bp+16) } } v10 = resultObj v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if !(v9 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(resultObj)).Flength = int64(-libc.Int32FromInt32(1)) if v11 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v11 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v11 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, resultObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = resultObj (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, resultObj) } } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+11064, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 16)), int64(data)-int64(datastart)-int64(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+11120, __ccgo_ts+11127, __ccgo_ts+11134, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } var _optStrings = [2]uintptr{ 0: __ccgo_ts + 11034, 1: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * BinaryEncode64 -- * * This procedure implements the "binary encode base64" Tcl command. * * Results: * The base64 encoded value prescribed by the input arguments. * *---------------------------------------------------------------------- */ func _BinaryEncode64(tls *libc.TLS, dummy2606 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var adjusted, purewrap, v2 int32 var cachePtr, cursor, data, limit, resultObj, wrapchar, v10, v11, v12, v13, v3, v5, v8, v9 uintptr var d [3]uint8 var i, offset, outindex, size TTcl_Size var v4 bool var _ /* count at bp+24 */ TTcl_Size var _ /* index at bp+16 */ int32 var _ /* maxlen at bp+0 */ TTcl_WideInt var _ /* wrapcharlen at bp+8 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = adjusted, cachePtr, cursor, d, data, i, limit, offset, outindex, purewrap, resultObj, size, wrapchar, v10, v11, v12, v13, v2, v3, v4, v5, v8, v9 *(*TTcl_WideInt)(unsafe.Pointer(bp)) = 0 wrapchar = __ccgo_ts + 286 *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(1) purewrap = int32(1) outindex = 0 *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = 0 if objc < int32(2) || objc%int32(2) != 0 { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+11160) return int32(TCL_ERROR) } i = int64(1) for { if !(i < int64(objc-int32(1))) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_optStrings1)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< 0 { cursor = libc.UintptrFromInt32(0) size = (*(*TTcl_Size)(unsafe.Pointer(bp + 24))*int64(4)/int64(3) + int64(3)) & int64(^libc.Int32FromInt32(3)) /* ensure 4 byte chunks */ if *(*TTcl_WideInt)(unsafe.Pointer(bp)) > 0 && size > *(*TTcl_WideInt)(unsafe.Pointer(bp)) { adjusted = int32(size + *(*TTcl_Size)(unsafe.Pointer(bp + 8))*(size / *(*TTcl_WideInt)(unsafe.Pointer(bp)))) if size%*(*TTcl_WideInt)(unsafe.Pointer(bp)) == 0 { adjusted = int32(int64(adjusted) - *(*TTcl_Size)(unsafe.Pointer(bp + 8))) } size = int64(adjusted) if purewrap == 0 { /* Wrapchar is (possibly) non-byte, so build result as * general string, not bytearray */ XTcl_SetObjLength(tls, resultObj, size) if (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 { v5 = (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes } else { v5 = XTcl_GetStringFromObj(tls, resultObj, libc.UintptrFromInt32(0)) } cursor = v5 } } if cursor == libc.UintptrFromInt32(0) { cursor = XTcl_SetByteArrayLength(tls, resultObj, size) } limit = cursor + uintptr(size) offset = 0 for { if !(offset < *(*TTcl_Size)(unsafe.Pointer(bp + 24))) { break } d = [3]uint8{} i = 0 for { if !(i < int64(3) && offset+i < *(*TTcl_Size)(unsafe.Pointer(bp + 24))) { break } d[i] = *(*uint8)(unsafe.Pointer(data + uintptr(offset+i))) goto _7 _7: ; i++ } v8 = cursor cursor++ *(*uint8)(unsafe.Pointer(v8)) = _B64Digits[libc.Int32FromUint8(d[0])>>int32(2)] outindex++ if *(*TTcl_WideInt)(unsafe.Pointer(bp)) > 0 && cursor != limit { if outindex == *(*TTcl_WideInt)(unsafe.Pointer(bp)) { libc.Xmemcpy(tls, cursor, wrapchar, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) cursor += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) outindex = 0 } } if cursor > limit { XTcl_Panic(tls, __ccgo_ts+11240, 0) } v9 = cursor cursor++ *(*uint8)(unsafe.Pointer(v9)) = _B64Digits[libc.Int32FromUint8(d[0])&int32(0x03)<>int32(4)] outindex++ if *(*TTcl_WideInt)(unsafe.Pointer(bp)) > 0 && cursor != limit { if outindex == *(*TTcl_WideInt)(unsafe.Pointer(bp)) { libc.Xmemcpy(tls, cursor, wrapchar, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) cursor += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) outindex = 0 } } if cursor > limit { XTcl_Panic(tls, __ccgo_ts+11240, 0) } if offset+int64(1) < *(*TTcl_Size)(unsafe.Pointer(bp + 24)) { v10 = cursor cursor++ *(*uint8)(unsafe.Pointer(v10)) = _B64Digits[libc.Int32FromUint8(d[int32(1)])&int32(0x0F)<>int32(6)] outindex++ if *(*TTcl_WideInt)(unsafe.Pointer(bp)) > 0 && cursor != limit { if outindex == *(*TTcl_WideInt)(unsafe.Pointer(bp)) { libc.Xmemcpy(tls, cursor, wrapchar, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) cursor += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) outindex = 0 } } if cursor > limit { XTcl_Panic(tls, __ccgo_ts+11240, 0) } } else { v11 = cursor cursor++ *(*uint8)(unsafe.Pointer(v11)) = _B64Digits[int32(64)] outindex++ if *(*TTcl_WideInt)(unsafe.Pointer(bp)) > 0 && cursor != limit { if outindex == *(*TTcl_WideInt)(unsafe.Pointer(bp)) { libc.Xmemcpy(tls, cursor, wrapchar, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) cursor += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) outindex = 0 } } if cursor > limit { XTcl_Panic(tls, __ccgo_ts+11240, 0) } } if offset+int64(2) < *(*TTcl_Size)(unsafe.Pointer(bp + 24)) { v12 = cursor cursor++ *(*uint8)(unsafe.Pointer(v12)) = _B64Digits[libc.Int32FromUint8(d[int32(2)])&int32(0x3F)] outindex++ if *(*TTcl_WideInt)(unsafe.Pointer(bp)) > 0 && cursor != limit { if outindex == *(*TTcl_WideInt)(unsafe.Pointer(bp)) { libc.Xmemcpy(tls, cursor, wrapchar, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) cursor += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) outindex = 0 } } if cursor > limit { XTcl_Panic(tls, __ccgo_ts+11240, 0) } } else { v13 = cursor cursor++ *(*uint8)(unsafe.Pointer(v13)) = _B64Digits[int32(64)] outindex++ if *(*TTcl_WideInt)(unsafe.Pointer(bp)) > 0 && cursor != limit { if outindex == *(*TTcl_WideInt)(unsafe.Pointer(bp)) { libc.Xmemcpy(tls, cursor, wrapchar, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) cursor += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) outindex = 0 } } if cursor > limit { XTcl_Panic(tls, __ccgo_ts+11240, 0) } } goto _6 _6: ; offset += int64(3) } } XTcl_SetObjResult(tls, interp, resultObj) return TCL_OK } var _optStrings1 = [3]uintptr{ 0: __ccgo_ts + 11142, 1: __ccgo_ts + 11150, 2: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * BinaryEncodeUu -- * * This implements the uuencode binary encoding. Input is broken into 6 * bit chunks and a lookup table is used to turn these values into output * characters. This differs from the generic code above in that line * lengths are also encoded. * * Results: * Interp result set to an encoded byte array object * * Side effects: * None * *---------------------------------------------------------------------- */ func _BinaryEncodeUu(tls *libc.TLS, dummy2732 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var bits, i, v14 int32 var cachePtr, cursor, data, p, resultObj, start, wrapchar, v13, v15, v19, v2, v20, v22 uintptr var j, lineLen, numBytes, offset, rawLength, v17 TTcl_Size var n uint32 var v12 bool var _ /* SingleNewline at bp+8 */ [1]uint8 var _ /* count at bp+16 */ TTcl_Size var _ /* index at bp+0 */ int32 var _ /* lineLength at bp+4 */ int32 var _ /* wrapcharlen at bp+24 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bits, cachePtr, cursor, data, i, j, lineLen, n, numBytes, offset, p, rawLength, resultObj, start, wrapchar, v12, v13, v14, v15, v17, v19, v2, v20, v22 *(*int32)(unsafe.Pointer(bp + 4)) = int32(61) *(*[1]uint8)(unsafe.Pointer(bp + 8)) = [1]uint8{ 0: libc.Uint8FromInt32(libc.Int32FromUint8('\n')), } wrapchar = bp + 8 *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = 0 *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = int64(1) if objc < int32(2) || objc%int32(2) != 0 { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+11160) return int32(TCL_ERROR) } i = int32(1) for { if !(i < objc-int32(1)) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_optStrings2)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int32(85) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+11196, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, __ccgo_ts+2004, __ccgo_ts+11120, __ccgo_ts+11221, __ccgo_ts+11228, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } *(*int32)(unsafe.Pointer(bp + 4)) = (*(*int32)(unsafe.Pointer(bp + 4))-int32(1))&-int32(4) + int32(1) /* 5, 9, 13 ... */ case 1: if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)))).Flength v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)), bp+24) } wrapchar = v2 p = wrapchar numBytes = *(*TTcl_Size)(unsafe.Pointer(bp + 24)) _4: ; if !(numBytes != 0) { goto _3 } switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) { case int32('\r'): goto _5 case int32('\f'): goto _6 case int32('\v'): goto _7 case int32('\t'): goto _8 case int32('\n'): goto _9 default: goto _10 } goto _11 _8: ; _7: ; _6: ; _5: ; p++ numBytes-- goto _4 _9: ; numBytes-- goto _11 _10: ; goto badwrap badwrap: ; XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+11250, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, __ccgo_ts+2004, __ccgo_ts+11120, __ccgo_ts+11221, __ccgo_ts+11289, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) _11: ; goto _4 _3: ; if numBytes != 0 { goto badwrap } break } goto _1 _1: ; i += int32(2) } /* * Allocate the buffer. This is a little bit too long, but is "good * enough". */ offset = 0 data = XTcl_GetBytesFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), bp+16) if data == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { resultObj = XTclThreadAllocObj(tls) } else { resultObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(resultObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(resultObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr = libc.UintptrFromInt32(0) rawLength = int64((*(*int32)(unsafe.Pointer(bp + 4)) - int32(1)) * int32(3) / int32(4)) v13 = XTcl_SetByteArrayLength(tls, resultObj, (int64(*(*int32)(unsafe.Pointer(bp + 4)))+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*((*(*TTcl_Size)(unsafe.Pointer(bp + 16))+(rawLength-int64(1)))/rawLength)) cursor = v13 start = v13 v14 = libc.Int32FromInt32(0) bits = v14 n = libc.Uint32FromInt32(v14) /* * Encode the data. Each output line first has the length of raw data * encoded by the output line described in it by one encoded byte, then * the encoded data follows (encoding each 6 bits as one character). * Encoded lines are always terminated by a newline. */ for offset < *(*TTcl_Size)(unsafe.Pointer(bp + 16)) { lineLen = *(*TTcl_Size)(unsafe.Pointer(bp + 16)) - offset if lineLen > rawLength { lineLen = rawLength } v15 = cursor cursor++ *(*uint8)(unsafe.Pointer(v15)) = _UueDigits[lineLen] i = 0 for { if !(int64(i) < lineLen) { break } n <<= uint32(8) v17 = offset offset++ n |= uint32(*(*uint8)(unsafe.Pointer(data + uintptr(v17)))) bits += int32(8) for { if !(bits > int32(6)) { break } v19 = cursor cursor++ *(*uint8)(unsafe.Pointer(v19)) = _UueDigits[n>>(bits-int32(6))&uint32(0x3F)] goto _18 _18: ; bits -= int32(6) } goto _16 _16: ; i++ } if bits > 0 { n <<= uint32(8) v20 = cursor cursor++ *(*uint8)(unsafe.Pointer(v20)) = _UueDigits[n>>(bits+int32(2))&uint32(0x3F)] bits = 0 } j = 0 for { if !(j < *(*TTcl_Size)(unsafe.Pointer(bp + 24))) { break } v22 = cursor cursor++ *(*uint8)(unsafe.Pointer(v22)) = *(*uint8)(unsafe.Pointer(wrapchar + uintptr(j))) goto _21 _21: ; j++ } } /* * Fix the length of the output bytearray. */ XTcl_SetByteArrayLength(tls, resultObj, int64(cursor)-int64(start)) XTcl_SetObjResult(tls, interp, resultObj) return TCL_OK } var _optStrings2 = [3]uintptr{ 0: __ccgo_ts + 11142, 1: __ccgo_ts + 11150, 2: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * BinaryDecodeUu -- * * Decode a uuencoded string. * * Results: * Interp result set to an byte array object * * Side effects: * None * *---------------------------------------------------------------------- */ func _BinaryDecodeUu(tls *libc.TLS, dummy2884 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var begin, cachePtr, cachePtr1, cachePtr2, cursor, data, dataend, datastart, resultObj, v11, v13, v14, v16, v20, v3, v4, v5, v8, v9 uintptr var c, v7 uint8 var d [4]uint8 var i, lineLen, pure, strict, v10, v12 int32 var size, v15, v19 TTcl_Size var v17, v2, v21 bool var _ /* count at bp+8 */ TTcl_Size var _ /* index at bp+0 */ int32 var _ /* ucs4 at bp+16 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = begin, c, cachePtr, cachePtr1, cachePtr2, cursor, d, data, dataend, datastart, i, lineLen, pure, resultObj, size, strict, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v3, v4, v5, v7, v8, v9 resultObj = libc.UintptrFromInt32(0) pure = int32(1) strict = 0 *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 if objc < int32(2) || objc > int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+11042) return int32(TCL_ERROR) } i = int32(1) for { if !(i < objc-int32(1)) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_optStrings3)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int32(96) { if strict != 0 || !(XTclIsSpaceProc(tls, libc.Int32FromUint8(c)) != 0) { goto badUu } i-- continue } lineLen = (libc.Int32FromUint8(c) - int32(32)) & int32(0x3F) } /* * Now we read a four-character grouping. */ i = 0 for { if !(i < int32(4)) { break } if data < dataend { v8 = data data++ v7 = *(*uint8)(unsafe.Pointer(v8)) c = v7 d[i] = v7 if libc.Int32FromUint8(c) < int32(32) || libc.Int32FromUint8(c) > int32(96) { if strict != 0 { if !(XTclIsSpaceProc(tls, libc.Int32FromUint8(c)) != 0) { goto badUu } else { if libc.Int32FromUint8(c) == int32('\n') { goto shortUu } } } i-- goto _6 } } goto _6 _6: ; i++ } /* * Translate that grouping into (up to) three binary bytes output. */ if lineLen > 0 { v9 = cursor cursor++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32((libc.Int32FromUint8(d[0])-int32(0x20))&int32(0x3F)<>int32(4)) lineLen-- v10 = lineLen if v10 > 0 { v11 = cursor cursor++ *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32((libc.Int32FromUint8(d[int32(1)])-int32(0x20))&int32(0x3F)<>int32(2)) lineLen-- v12 = lineLen if v12 > 0 { v13 = cursor cursor++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32((libc.Int32FromUint8(d[int32(2)])-int32(0x20))&int32(0x3F)<= int32(32) && libc.Int32FromUint8(c) <= int32(96) { data-- break } else { if strict != 0 || !(XTclIsSpaceProc(tls, libc.Int32FromUint8(c)) != 0) { goto badUu } } } } } } /* * Sanity check, clean up and finish. */ if lineLen > 0 && strict != 0 { goto shortUu } XTcl_SetByteArrayLength(tls, resultObj, int64(cursor)-int64(begin)) XTcl_SetObjResult(tls, interp, resultObj) return TCL_OK goto shortUu shortUu: ; XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+11298, 0)) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+11120, __ccgo_ts+11127, __ccgo_ts+11318, libc.UintptrFromInt32(0))) v16 = resultObj v15 = *(*TTcl_Size)(unsafe.Pointer(v16)) *(*TTcl_Size)(unsafe.Pointer(v16))-- if !(v15 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(resultObj)).Flength = int64(-libc.Int32FromInt32(1)) if v17 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v17 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v17 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, resultObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = resultObj (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, resultObj) } } return int32(TCL_ERROR) goto badUu badUu: ; if pure != 0 { *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromUint8(c) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data - libc.UintptrFromInt32(1)))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data - libc.UintptrFromInt32(1)))) _ = libc.Int32FromInt32(1) } else { XTcl_UtfToUniChar(tls, data-libc.UintptrFromInt32(1), bp+16) } } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+11324, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 16)), int64(data)-int64(datastart)-int64(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+11120, __ccgo_ts+11127, __ccgo_ts+11134, libc.UintptrFromInt32(0))) v20 = resultObj v19 = *(*TTcl_Size)(unsafe.Pointer(v20)) *(*TTcl_Size)(unsafe.Pointer(v20))-- if !(v19 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(resultObj)).Flength = int64(-libc.Int32FromInt32(1)) if v21 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v21 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v21 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, resultObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = resultObj (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, resultObj) } } return int32(TCL_ERROR) } var _optStrings3 = [2]uintptr{ 0: __ccgo_ts + 11034, 1: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * BinaryDecode64 -- * * Decode a base64 encoded string. * * Results: * Interp result set to an byte array object * * Side effects: * None * *---------------------------------------------------------------------- */ func _BinaryDecode64(tls *libc.TLS, dummy3058 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var begin, cachePtr, cachePtr1, cursor, data, dataend, datastart, resultObj, v12, v3, v4, v6, v7, v8, v9 uintptr var c uint8 var cut, i, pure, strict int32 var size, v11 TTcl_Size var value uint64 var v13, v2 bool var _ /* count at bp+8 */ TTcl_Size var _ /* index at bp+0 */ int32 var _ /* ucs4 at bp+16 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = begin, c, cachePtr, cachePtr1, cursor, cut, data, dataend, datastart, i, pure, resultObj, size, strict, value, v11, v12, v13, v2, v3, v4, v6, v7, v8, v9 resultObj = libc.UintptrFromInt32(0) c = uint8('\000') begin = libc.UintptrFromInt32(0) cursor = libc.UintptrFromInt32(0) pure = int32(1) strict = 0 cut = 0 *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 if objc < int32(2) || objc > int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+11042) return int32(TCL_ERROR) } i = int32(1) for { if !(i < objc-int32(1)) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_optStrings4)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<= int32('a') && libc.Int32FromUint8(c) <= int32('z') { value = value<= int32('0') && libc.Int32FromUint8(c) <= int32('9') { value = value< int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(resultObj)).Flength = int64(-libc.Int32FromInt32(1)) if v13 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v13 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v13 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, resultObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = resultObj (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, resultObj) } } return int32(TCL_ERROR) } var _optStrings4 = [2]uintptr{ 0: __ccgo_ts + 11034, 1: libc.UintptrFromInt32(0), } const FALSE = 0 const FLT_MAX2 = 0 const TRUE = 1 /* This is the !TCL_MEM_DEBUG case */ /* *---------------------------------------------------------------------- * * Tcl_Alloc -- * * Interface to TclpAlloc when TCL_MEM_DEBUG is disabled. It does check * that memory was actually allocated. * *---------------------------------------------------------------------- */ func XTcl_Alloc(tls *libc.TLS, size Tsize_t) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var result uintptr _ = result result = XTclpAlloc(tls, size) /* * Most systems will not alloc(0), instead bumping it to one so that NULL * isn't returned. Some systems (AIX, Tru64) will alloc(0) by returning * NULL, so we have to check that the NULL we get is not in response to * alloc(0). * * The ANSI spec actually says that systems either return NULL *or* a * special pointer on failure, but we only check for NULL */ if result == libc.UintptrFromInt32(0) && size != 0 { XTcl_Panic(tls, __ccgo_ts+10479, libc.VaList(bp+8, size)) } return result } func XTcl_DbCkalloc(tls *libc.TLS, size Tsize_t, file uintptr, line int32) (r uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var result uintptr _ = result result = XTclpAlloc(tls, size) if result == libc.UintptrFromInt32(0) && size != 0 { libc.Xfflush(tls, libc.Xstdout) XTcl_Panic(tls, __ccgo_ts+11436, libc.VaList(bp+8, size, file, line)) } return result } /* *---------------------------------------------------------------------- * * Tcl_AttemptAlloc -- * * Interface to TclpAlloc when TCL_MEM_DEBUG is disabled. It does not * check that memory was actually allocated. * *---------------------------------------------------------------------- */ func XTcl_AttemptAlloc(tls *libc.TLS, size Tsize_t) (r uintptr) { return XTclpAlloc(tls, size) } func XTcl_AttemptDbCkalloc(tls *libc.TLS, size Tsize_t, dummy1090 uintptr, dummy1091 int32) (r uintptr) { return XTclpAlloc(tls, size) } /* *---------------------------------------------------------------------- * * Tcl_Realloc -- * * Interface to TclpRealloc when TCL_MEM_DEBUG is disabled. It does check * that memory was actually allocated. * *---------------------------------------------------------------------- */ func XTcl_Realloc(tls *libc.TLS, ptr uintptr, size Tsize_t) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var result uintptr _ = result result = XTclpRealloc(tls, ptr, size) if result == libc.UintptrFromInt32(0) && size != 0 { XTcl_Panic(tls, __ccgo_ts+11474, libc.VaList(bp+8, size)) } return result } func XTcl_DbCkrealloc(tls *libc.TLS, ptr uintptr, size Tsize_t, file uintptr, line int32) (r uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var result uintptr _ = result result = XTclpRealloc(tls, ptr, size) if result == libc.UintptrFromInt32(0) && size != 0 { libc.Xfflush(tls, libc.Xstdout) XTcl_Panic(tls, __ccgo_ts+11502, libc.VaList(bp+8, size, file, line)) } return result } /* *---------------------------------------------------------------------- * * Tcl_AttemptRealloc -- * * Interface to TclpRealloc when TCL_MEM_DEBUG is disabled. It does not * check that memory was actually allocated. * *---------------------------------------------------------------------- */ func XTcl_AttemptRealloc(tls *libc.TLS, ptr uintptr, size Tsize_t) (r uintptr) { return XTclpRealloc(tls, ptr, size) } func XTcl_AttemptDbCkrealloc(tls *libc.TLS, ptr uintptr, size Tsize_t, dummy1160 uintptr, dummy1161 int32) (r uintptr) { return XTclpRealloc(tls, ptr, size) } /* *---------------------------------------------------------------------- * * Tcl_Free -- * * Interface to TclpFree when TCL_MEM_DEBUG is disabled. Done here rather * in the macro to keep some modules from being compiled with * TCL_MEM_DEBUG enabled and some with it disabled. * *---------------------------------------------------------------------- */ func XTcl_Free(tls *libc.TLS, ptr uintptr) { XTclpFree(tls, ptr) } func XTcl_DbCkfree(tls *libc.TLS, ptr uintptr, dummy1188 uintptr, dummy1189 int32) { XTclpFree(tls, ptr) } // C documentation // // /* // *---------------------------------------------------------------------- // * // * Tcl_InitMemory -- // * // * Dummy initialization for memory command, which is only available if // * TCL_MEM_DEBUG is on. // * // *---------------------------------------------------------------------- // */ func XTcl_InitMemory(tls *libc.TLS, dummy1206 uintptr) { } func XTcl_DumpActiveMemory(tls *libc.TLS, dummy1212 uintptr) (r int32) { return TCL_OK } func XTcl_ValidateAllMemory(tls *libc.TLS, dummy1219 uintptr, dummy1220 int32) { } func XTclDumpMemoryInfo(tls *libc.TLS, dummy1226 uintptr, dummy1227 int32) (r int32) { return int32(1) } // C documentation // // /* // *------------------------------------------------------------------------ // * // * TclAllocElemsEx -- // * // * See TclAttemptAllocElemsEx. This function differs in that it panics // * on failure. // * // * Results: // * Non-NULL pointer to allocated memory block. // * // * Side effects: // * Panics if memory of at least the requested size could not be // * allocated. // * // *------------------------------------------------------------------------ // */ func XTclAllocElemsEx(tls *libc.TLS, elemCount TTcl_Size, elemSize TTcl_Size, leadSize TTcl_Size, capacityPtr uintptr) (r uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* OUTPUT: Actual capacity is stored here if * non-NULL. Only modified on success */ var ptr uintptr _ = ptr ptr = XTclAttemptReallocElemsEx(tls, libc.UintptrFromInt32(0), elemCount, elemSize, leadSize, capacityPtr) if ptr == libc.UintptrFromInt32(0) { XTcl_Panic(tls, __ccgo_ts+11542, libc.VaList(bp+8, elemCount, elemSize)) } return ptr } // C documentation // // /* // *------------------------------------------------------------------------ // * // * TclAttemptReallocElemsEx -- // * // * Attempts to allocate (oldPtr == NULL) or reallocate memory of the // * requested size plus some more for future growth. The amount of // * reallocation is adjusted depending on failure. // * // * // * Results: // * Pointer to allocated memory block which is at least as large // * as the requested size or NULL if allocation failed. // * // *------------------------------------------------------------------------ // */ func XTclAttemptReallocElemsEx(tls *libc.TLS, oldPtr uintptr, elemCount TTcl_Size, elemSize TTcl_Size, leadSize TTcl_Size, capacityPtr uintptr) (r uintptr) { /* OUTPUT: Actual capacity is stored here if * non-NULL. Only modified on success */ var attempt, limit1, v1, v2, v3, v5, v6, v7 TTcl_Size var ptr uintptr _, _, _, _, _, _, _, _, _ = attempt, limit1, ptr, v1, v2, v3, v5, v6, v7 limit1 = (libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)) - leadSize) / elemSize if elemCount > limit1 { return libc.UintptrFromInt32(0) } /* Loop trying for extra space, reducing request each time */ v1 = elemCount v2 = limit1 if v1 < v2-v1/libc.Int64FromInt32(2) { v3 = v1 + v1/int64(2) goto _4 } else { v3 = v2 goto _4 } _4: attempt = v3 ptr = libc.UintptrFromInt32(0) for attempt > elemCount { if oldPtr != 0 { ptr = XTcl_AttemptRealloc(tls, oldPtr, libc.Uint64FromInt64(leadSize+attempt*elemSize)) } else { ptr = XTcl_AttemptAlloc(tls, libc.Uint64FromInt64(leadSize+attempt*elemSize)) } if ptr != 0 { break } v5 = elemCount v6 = attempt if v5 < v6-libc.Int64FromInt32(1) { v7 = v5 + (v6-v5)/int64(2) goto _8 } else { v7 = v5 goto _8 } _8: attempt = v7 } /* Try exact size as a last resort */ if ptr == libc.UintptrFromInt32(0) { attempt = elemCount if oldPtr != 0 { ptr = XTcl_AttemptRealloc(tls, oldPtr, libc.Uint64FromInt64(leadSize+attempt*elemSize)) } else { ptr = XTcl_AttemptAlloc(tls, libc.Uint64FromInt64(leadSize+attempt*elemSize)) } } if ptr != 0 && capacityPtr != 0 { *(*TTcl_Size)(unsafe.Pointer(capacityPtr)) = attempt } return ptr } // C documentation // // /* // *------------------------------------------------------------------------ // * // * TclReallocElemsEx -- // * // * See TclAttemptReallocElemsEx. This function differs in that it panics // * on failure. // * // * Results: // * Non-NULL pointer to allocated memory block. // * // * Side effects: // * Panics if memory of at least the requested size could not be // * allocated. // * // *------------------------------------------------------------------------ // */ func XTclReallocElemsEx(tls *libc.TLS, oldPtr uintptr, elemCount TTcl_Size, elemSize TTcl_Size, leadSize TTcl_Size, capacityPtr uintptr) (r uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* OUTPUT: Actual capacity is stored here if * non-NULL. Only modified on success */ var ptr uintptr _ = ptr ptr = XTclAttemptReallocElemsEx(tls, oldPtr, elemCount, elemSize, leadSize, capacityPtr) if ptr == libc.UintptrFromInt32(0) { XTcl_Panic(tls, __ccgo_ts+11593, libc.VaList(bp+8, elemCount, elemSize)) } return ptr } /* *--------------------------------------------------------------------------- * * TclFinalizeMemorySubsystem -- * * This procedure is called to finalize all the structures that are used * by the memory allocator on a per-process basis. * * Results: * None. * * Side effects: * This subsystem is self-initializing, since memory can be allocated * before Tcl is formally initialized. After this call, this subsystem * has been reset to its initial state and is usable again. * *--------------------------------------------------------------------------- */ func XTclFinalizeMemorySubsystem(tls *libc.TLS) { } const CLOCK_FMT_SCN_STORAGE_GC_SIZE = 32 const CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE = 2 const ClockDefaultCenturySwitch = 38 const ClockDefaultYearCentury = 2000 const FOUR_CENTURIES = 146097 const FOUR_YEARS = 1461 const GREGORIAN_CHANGE_DATE = 2361222 const JDAY_1_JAN_1_CE_GREGORIAN = 1721426 const JDAY_1_JAN_1_CE_JULIAN = 1721424 const JULIAN_DAY_POSIX_EPOCH = 2440588 const MAX_FMT_RESULT_THRESHOLD = 2 const MIN_FMT_RESULT_BLOCK_ALLOC = 80 const MIN_FMT_RESULT_BLOCK_DELTA = 0 const ONE_CENTURY_GREGORIAN = 36524 const ONE_YEAR = 365 const RODDENBERRY = 1946 const SECONDS_PER_DAY = 86400 const TCL_CLOCK_PREFIX_LEN = 14 const TCL_INV_SECONDS = -67553994410557441 const TCL_MAX_SECONDS = 67553994410557440 const TCL_MIN_SECONDS = -67553994410557440 const WCHAR = 0 const wcscmp = 0 const wcscpy = 0 const wcslen = 0 type TTclStrIdx = struct { FchildTree TTclStrIdxTree FnextPtr uintptr FprevPtr uintptr Fkey uintptr Flength TTcl_Size Fvalue uintptr } type TTclStrIdxTree = struct { FfirstPtr uintptr FlastPtr uintptr } type TTclStrIdx1 = struct { FchildTree TTclStrIdxTree FnextPtr uintptr FprevPtr uintptr Fkey uintptr Flength TTcl_Size Fvalue uintptr } type DateInfoFlags = int32 const CLF_OPTIONAL = 1 const CLF_POSIXSEC = 2 const CLF_LOCALSEC = 4 const CLF_JULIANDAY = 8 const CLF_TIME = 16 const CLF_ZONE = 32 const CLF_CENTURY = 64 const CLF_DAYOFMONTH = 128 const CLF_DAYOFYEAR = 256 const CLF_MONTH = 512 const CLF_YEAR = 1024 const CLF_DAYOFWEEK = 2048 const CLF_ISO8601YEAR = 4096 const CLF_ISO8601WEEK = 8192 const CLF_ISO8601CENTURY = 16384 const CLF_SIGNED = 32768 const CLF_HAVEDATE = 1664 const CLF_DATE = 16264 const CLF_RELCONV = 131072 const CLF_ORDINALMONTH = 262144 const CLF_ASSEMBLE_DATE = 268435456 const CLF_ASSEMBLE_JULIANDAY = 536870912 const CLF_ASSEMBLE_SECONDS = 1073741824 type TClockLiteral = int32 type ClockLiteral = int32 const LIT__NIL = 0 const LIT__DEFAULT_FORMAT = 1 const LIT_SYSTEM = 2 const LIT_CURRENT = 3 const LIT_C = 4 const LIT_BCE = 5 const LIT_CE = 6 const LIT_DAYOFMONTH = 7 const LIT_DAYOFWEEK = 8 const LIT_DAYOFYEAR = 9 const LIT_ERA = 10 const LIT_GMT = 11 const LIT_GREGORIAN = 12 const LIT_INTEGER_VALUE_TOO_LARGE = 13 const LIT_ISO8601WEEK = 14 const LIT_ISO8601YEAR = 15 const LIT_JULIANDAY = 16 const LIT_LOCALSECONDS = 17 const LIT_MONTH = 18 const LIT_SECONDS = 19 const LIT_TZNAME = 20 const LIT_TZOFFSET = 21 const LIT_YEAR = 22 const LIT_TZDATA = 23 const LIT_GETSYSTEMTIMEZONE = 24 const LIT_SETUPTIMEZONE = 25 const LIT_MCGET = 26 const LIT_GETSYSTEMLOCALE = 27 const LIT_GETCURRENTLOCALE = 28 const LIT_LOCALIZE_FORMAT = 29 const LIT__END = 30 type TClockMsgCtLiteral = int32 type ClockMsgCtLiteral = int32 const MCLIT__NIL = 0 const MCLIT_MONTHS_FULL = 1 const MCLIT_MONTHS_ABBREV = 2 const MCLIT_MONTHS_COMB = 3 const MCLIT_DAYS_OF_WEEK_FULL = 4 const MCLIT_DAYS_OF_WEEK_ABBREV = 5 const MCLIT_DAYS_OF_WEEK_COMB = 6 const MCLIT_AM = 7 const MCLIT_PM = 8 const MCLIT_LOCALE_ERAS = 9 const MCLIT_BCE = 10 const MCLIT_CE = 11 const MCLIT_BCE2 = 12 const MCLIT_CE2 = 13 const MCLIT_BCE3 = 14 const MCLIT_CE3 = 15 const MCLIT_LOCALE_NUMERALS = 16 const MCLIT__END = 17 type TclDateFieldsFlags = int32 const CLF_CTZ = 16 type TTclDateFields = struct { Fseconds TTcl_WideInt FlocalSeconds TTcl_WideInt FtzOffset int32 FjulianDay TTcl_WideInt FisBce int32 Fgregorian int32 Fyear int32 FdayOfYear int32 Fmonth int32 FdayOfMonth int32 Fiso8601Year int32 Fiso8601Week int32 FdayOfWeek int32 Fhour int32 Fminutes int32 FsecondOfMin TTcl_WideInt FsecondOfDay TTcl_WideInt Fflags int32 FtzName uintptr } type TMERIDIAN = int32 type _MERIDIAN = int32 const MERam = 0 const MERpm = 1 const MER24 = 2 type TDateInfo = struct { FdateStart uintptr FdateInput uintptr FdateEnd uintptr Fdate TTclDateFields Fflags int32 FerrFlags int32 FdateMeridian TMERIDIAN FdateTimezone int32 FdateDSTmode int32 FdateRelMonth TTcl_WideInt FdateRelDay TTcl_WideInt FdateRelSeconds TTcl_WideInt FdateMonthOrdinalIncr int32 FdateMonthOrdinal int32 FdateDayOrdinal int32 FdateRelPointer uintptr FdateSpaceCount int32 FdateDigitCount int32 FdateCentury int32 Fmessages uintptr Fseparatrix uintptr } type ClockFmtScnCmdArgsFlags = int32 const CLF_VALIDATE_S1 = 1 const CLF_VALIDATE_S2 = 2 const CLF_VALIDATE = 3 const CLF_EXTENDED = 16 const CLF_STRICT = 256 const CLF_LOCALE_USED = 32768 type TClockClientData = struct { FrefCount Tsize_t Fliterals uintptr FmcLiterals uintptr FmcLitIdxs uintptr FmcDicts uintptr FlastTZEpoch Tsize_t FcurrentYearCentury int32 FyearOfCenturySwitch int32 FvalidMinYear int32 FvalidMaxYear int32 FmaxJDN float64 FsystemTimeZone uintptr FsystemSetupTZData uintptr FgmtSetupTimeZoneUnnorm uintptr FgmtSetupTimeZone uintptr FgmtSetupTZData uintptr FgmtTZName uintptr FlastSetupTimeZoneUnnorm uintptr FlastSetupTimeZone uintptr FlastSetupTZData uintptr FprevSetupTimeZoneUnnorm uintptr FprevSetupTimeZone uintptr FprevSetupTZData uintptr FdefaultLocale uintptr FdefaultLocaleDict uintptr FcurrentLocale uintptr FcurrentLocaleDict uintptr FlastUsedLocaleUnnorm uintptr FlastUsedLocale uintptr FlastUsedLocaleDict uintptr FprevUsedLocaleUnnorm uintptr FprevUsedLocale uintptr FprevUsedLocaleDict uintptr FlastBase struct { FtimezoneObj uintptr Fdate TTclDateFields } FlastTZOffsCache [2]TClockLastTZOffs FdefFlags int32 } type TClockFmtScnCmdArgs = struct { FdataPtr uintptr Finterp uintptr FformatObj uintptr FlocaleObj uintptr FtimezoneObj uintptr FbaseObj uintptr Fflags int32 FmcDictObj uintptr } type TClockLastTZOffs = struct { FtimezoneObj uintptr Fchangeover int32 FlocalSeconds TTcl_WideInt FrangesVal [2]TTcl_WideInt FtzOffset int32 FtzName uintptr } type TClockScanToken = struct { Fmap1 uintptr FtokWord struct { Fstart uintptr Fend uintptr } FendDistance uint16 FlookAhMin uint16 FlookAhMax uint16 FlookAhTok uint16 } type TCLCKTOK_TYPE = int32 type _CLCKTOK_TYPE = int32 const CTOKT_INT = 1 const CTOKT_WIDE = 2 const CTOKT_PARSER = 3 const CTOKT_SPACE = 4 const CTOKT_WORD = 5 const CTOKT_CHAR = 6 const CFMTT_PROC = 7 type TClockScanTokenMap = struct { Ftype1 uint16 Fflags uint16 FclearFlags uint16 FminSize uint16 FmaxSize uint16 Foffs uint16 Fparser uintptr Fdata uintptr } type TClockScanToken1 = struct { Fmap1 uintptr FtokWord struct { Fstart uintptr Fend uintptr } FendDistance uint16 FlookAhMin uint16 FlookAhMax uint16 FlookAhTok uint16 } type TDateFormat = struct { FresMem uintptr FresEnd uintptr Foutput uintptr Fdate TTclDateFields FlocaleEra uintptr } type ClockFormatTokenMapFlags = int32 const CLFMT_INCR = 8 const CLFMT_DECR = 16 const CLFMT_CALC = 32 const CLFMT_LOCALE_INDX = 256 type TClockFormatToken = struct { Fmap1 uintptr FtokWord struct { Fstart uintptr Fend uintptr } } type TClockFormatTokenMap = struct { Ftype1 uint16 Ftostr uintptr Fwidth uint16 Fflags uint16 Fdivider uint16 Fdivmod uint16 Foffs uint16 Ffmtproc uintptr Fdata uintptr } type TClockFormatToken1 = struct { Fmap1 uintptr FtokWord struct { Fstart uintptr Fend uintptr } } type TClockFmtScnStorage = struct { FobjRefCount int32 FscnTok uintptr FscnTokC uint32 FscnSpaceCount uint32 FfmtTok uintptr FfmtTokC uint32 FnextPtr uintptr FprevPtr uintptr FfmtMinAlloc Tsize_t } type TClockFmtScnStorage1 = struct { FobjRefCount int32 FscnTok uintptr FscnTokC uint32 FscnSpaceCount uint32 FfmtTok uintptr FfmtTokC uint32 FnextPtr uintptr FprevPtr uintptr FfmtMinAlloc Tsize_t } /* * Table of the days in each month, leap and common years */ var _hath = [2][12]int32{ 0: { 0: int32(31), 1: int32(28), 2: int32(31), 3: int32(30), 4: int32(31), 5: int32(30), 6: int32(31), 7: int32(31), 8: int32(30), 9: int32(31), 10: int32(30), 11: int32(31), }, 1: { 0: int32(31), 1: int32(29), 2: int32(31), 3: int32(30), 4: int32(31), 5: int32(30), 6: int32(31), 7: int32(31), 8: int32(30), 9: int32(31), 10: int32(30), 11: int32(31), }, } var _daysInPriorMonths = [2][13]int32{ 0: { 1: int32(31), 2: int32(59), 3: int32(90), 4: int32(120), 5: int32(151), 6: int32(181), 7: int32(212), 8: int32(243), 9: int32(273), 10: int32(304), 11: int32(334), 12: int32(365), }, 1: { 1: int32(31), 2: int32(60), 3: int32(91), 4: int32(121), 5: int32(152), 6: int32(182), 7: int32(213), 8: int32(244), 9: int32(274), 10: int32(305), 11: int32(335), 12: int32(366), }, } /* * Enumeration of the string literals used in [clock] */ var _Literals = [30]uintptr{ 0: __ccgo_ts + 1945, 1: __ccgo_ts + 11646, 2: __ccgo_ts + 5629, 3: __ccgo_ts + 11670, 4: __ccgo_ts + 11678, 5: __ccgo_ts + 11680, 6: __ccgo_ts + 11684, 7: __ccgo_ts + 11687, 8: __ccgo_ts + 11698, 9: __ccgo_ts + 11708, 10: __ccgo_ts + 11718, 11: __ccgo_ts + 11722, 12: __ccgo_ts + 11727, 13: __ccgo_ts + 11737, 14: __ccgo_ts + 11774, 15: __ccgo_ts + 11786, 16: __ccgo_ts + 11798, 17: __ccgo_ts + 11808, 18: __ccgo_ts + 11821, 19: __ccgo_ts + 11827, 20: __ccgo_ts + 11835, 21: __ccgo_ts + 11842, 22: __ccgo_ts + 11851, 23: __ccgo_ts + 11856, 24: __ccgo_ts + 11877, 25: __ccgo_ts + 11909, 26: __ccgo_ts + 11937, 27: __ccgo_ts + 11957, 28: __ccgo_ts + 11987, 29: __ccgo_ts + 12010, } // C documentation // // /* Msgcat literals for exact match (mcKey) */ var _MsgCtLiterals = [17]uintptr{ 0: __ccgo_ts + 1945, 1: __ccgo_ts + 12039, 2: __ccgo_ts + 12051, 3: __ccgo_ts + 12065, 4: __ccgo_ts + 12077, 5: __ccgo_ts + 12095, 6: __ccgo_ts + 12115, 7: __ccgo_ts + 12133, 8: __ccgo_ts + 12136, 9: __ccgo_ts + 12139, 10: __ccgo_ts + 11680, 11: __ccgo_ts + 11684, 12: __ccgo_ts + 12151, 13: __ccgo_ts + 12158, 14: __ccgo_ts + 12163, 15: __ccgo_ts + 12168, 16: __ccgo_ts + 12173, } // C documentation // // /* Msgcat index literals prefixed with _IDX_, used for quick dictionary search */ var _MsgCtLitIdxs = [17]uintptr{ 0: __ccgo_ts + 12189, 1: __ccgo_ts + 12195, 2: __ccgo_ts + 12212, 3: __ccgo_ts + 12231, 4: __ccgo_ts + 12248, 5: __ccgo_ts + 12271, 6: __ccgo_ts + 12296, 7: __ccgo_ts + 12319, 8: __ccgo_ts + 12327, 9: __ccgo_ts + 12335, 10: __ccgo_ts + 12352, 11: __ccgo_ts + 12361, 12: __ccgo_ts + 12369, 13: __ccgo_ts + 12381, 14: __ccgo_ts + 12391, 15: __ccgo_ts + 12401, 16: __ccgo_ts + 12411, } var _eras = [3]uintptr{ 0: __ccgo_ts + 11684, 1: __ccgo_ts + 11680, 2: libc.UintptrFromInt32(0), } /* * Thread specific data block holding a 'struct tm' for the 'gmtime' and * 'localtime' library calls. */ var _tmKey TTcl_ThreadDataKey /* * Mutex protecting 'gmtime', 'localtime' and 'mktime' calls and the statics * in the date parsing code. */ var _clockMutex TTcl_Mutex /* * Structure containing description of "native" clock commands to create. */ type TClockCommand = struct { Fname uintptr FobjCmdProc uintptr FcompileProc uintptr FclientData uintptr } var _clockCommands = [14]TClockCommand{ 0: { Fname: __ccgo_ts + 2121, }, 1: { Fname: __ccgo_ts + 12432, }, 2: { Fname: __ccgo_ts + 5199, }, 3: { Fname: __ccgo_ts + 12439, }, 4: { Fname: __ccgo_ts + 12446, FclientData: uintptr(int64(libc.Int32FromInt32(1))), }, 5: { Fname: __ccgo_ts + 12459, FclientData: uintptr(int64(libc.Int32FromInt32(2))), }, 6: { Fname: __ccgo_ts + 5378, }, 7: { Fname: __ccgo_ts + 11827, FclientData: uintptr(int64(libc.Int32FromInt32(3))), }, 8: { Fname: __ccgo_ts + 12472, }, 9: { Fname: __ccgo_ts + 12490, }, 10: { Fname: __ccgo_ts + 12504, }, 11: { Fname: __ccgo_ts + 12536, }, 12: { Fname: __ccgo_ts + 5129, }, 13: {}, } func init() { p := unsafe.Pointer(&_clockCommands) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_ClockAddObjCmd) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileBasicMin1ArgCmd) *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_ClockClicksObjCmd) *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(XTclCompileClockClicksCmd) *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_ClockFormatObjCmd) *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(XTclCompileBasicMin1ArgCmd) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_ClockGetenvObjCmd) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(XTclCompileBasicMin1ArgCmd) *(*uintptr)(unsafe.Add(p, 136)) = __ccgo_fp(_ClockMicrosecondsObjCmd) *(*uintptr)(unsafe.Add(p, 144)) = __ccgo_fp(XTclCompileClockReadingCmd) *(*uintptr)(unsafe.Add(p, 168)) = __ccgo_fp(_ClockMillisecondsObjCmd) *(*uintptr)(unsafe.Add(p, 176)) = __ccgo_fp(XTclCompileClockReadingCmd) *(*uintptr)(unsafe.Add(p, 200)) = __ccgo_fp(_ClockScanObjCmd) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(XTclCompileBasicMin1ArgCmd) *(*uintptr)(unsafe.Add(p, 232)) = __ccgo_fp(_ClockSecondsObjCmd) *(*uintptr)(unsafe.Add(p, 240)) = __ccgo_fp(XTclCompileClockReadingCmd) *(*uintptr)(unsafe.Add(p, 264)) = __ccgo_fp(_ClockConvertlocaltoutcObjCmd) *(*uintptr)(unsafe.Add(p, 296)) = __ccgo_fp(_ClockGetdatefieldsObjCmd) *(*uintptr)(unsafe.Add(p, 328)) = __ccgo_fp(_ClockGetjuliandayfromerayearmonthdayObjCmd) *(*uintptr)(unsafe.Add(p, 360)) = __ccgo_fp(_ClockGetjuliandayfromerayearweekdayObjCmd) *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_ClockSafeCatchCmd) *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(XTclCompileBasicMin1ArgCmd) } /* *---------------------------------------------------------------------- * * TclClockInit -- * * Registers the 'clock' subcommands with the Tcl interpreter and * initializes its client data (which consists mostly of constant * Tcl_Obj's that it is too much trouble to keep recreating). * * Results: * None. * * Side effects: * Installs the commands and creates the client data * *---------------------------------------------------------------------- */ func XTclClockInit(tls *libc.TLS, interp uintptr) { bp := tls.Alloc(64) defer tls.Free(64) /* Tcl interpreter */ var clientData, clockCmdPtr, cmdPtr, data, v3, v4, v5 uintptr var i int32 var _ /* cmdName at bp+0 */ [50]uint8 _, _, _, _, _, _, _, _ = clientData, clockCmdPtr, cmdPtr, data, i, v3, v4, v5 /* * Register handler to finalize clock on exit. */ if !(_initialized != 0) { XTcl_CreateExitHandler(tls, __ccgo_fp(_ClockFinalize), libc.UintptrFromInt32(0)) _initialized = int32(1) } /* * Safe interps get [::clock] as alias to a parent, so do not need their * own copies of the support routines. */ if XTcl_IsSafe(tls, interp) != 0 { return } /* * Create the client data, which is a refcounted literal pool. */ data = XTcl_Alloc(tls, uint64(488)) (*TClockClientData)(unsafe.Pointer(data)).FrefCount = uint64(0) (*TClockClientData)(unsafe.Pointer(data)).Fliterals = XTcl_Alloc(tls, uint64(LIT__END)*libc.Uint64FromInt64(8)) i = 0 for { if !(i < int32(LIT__END)) { break } *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(data)).Fliterals + uintptr(i)*8)) = XTcl_NewStringObj(tls, _Literals[i], int64(-libc.Int32FromInt32(1))) if *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(data)).Fliterals + uintptr(i)*8)) != 0 { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(data)).Fliterals + uintptr(i)*8)))).FrefCount++ } goto _1 _1: ; i++ } (*TClockClientData)(unsafe.Pointer(data)).FmcLiterals = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FmcLitIdxs = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FmcDicts = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FlastTZEpoch = uint64(0) (*TClockClientData)(unsafe.Pointer(data)).FcurrentYearCentury = int32(ClockDefaultYearCentury) (*TClockClientData)(unsafe.Pointer(data)).FyearOfCenturySwitch = int32(ClockDefaultCenturySwitch) (*TClockClientData)(unsafe.Pointer(data)).FvalidMinYear = -libc.Int32FromInt32(1) - libc.Int32FromInt32(0x7fffffff) (*TClockClientData)(unsafe.Pointer(data)).FvalidMaxYear = int32(INT_MAX) /* corresponds max of JDN in sqlite - 9999-12-31 23:59:59 per default */ (*TClockClientData)(unsafe.Pointer(data)).FmaxJDN = float64(5.373484499999994e+06) (*TClockClientData)(unsafe.Pointer(data)).FsystemTimeZone = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FsystemSetupTZData = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTimeZoneUnnorm = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTimeZone = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTZData = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FgmtTZName = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTimeZoneUnnorm = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTimeZone = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTZData = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTimeZoneUnnorm = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTimeZone = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTZData = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FdefaultLocale = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FdefaultLocaleDict = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FcurrentLocale = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FcurrentLocaleDict = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocaleUnnorm = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocale = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocaleDict = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocaleUnnorm = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocale = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocaleDict = libc.UintptrFromInt32(0) (*TClockClientData)(unsafe.Pointer(data)).FlastBase.FtimezoneObj = libc.UintptrFromInt32(0) libc.Xmemset(tls, data+368, 0, uint64(112)) (*TClockClientData)(unsafe.Pointer(data)).FdefFlags = int32(CLF_VALIDATE) /* * Install the commands. */ libc.Xmemcpy(tls, bp, __ccgo_ts+12567, uint64(TCL_CLOCK_PREFIX_LEN)) clockCmdPtr = uintptr(unsafe.Pointer(&_clockCommands)) for { if !((*TClockCommand)(unsafe.Pointer(clockCmdPtr)).Fname != libc.UintptrFromInt32(0)) { break } libc.Xstrcpy(tls, bp+uintptr(TCL_CLOCK_PREFIX_LEN), (*TClockCommand)(unsafe.Pointer(clockCmdPtr)).Fname) v3 = (*TClockCommand)(unsafe.Pointer(clockCmdPtr)).FclientData clientData = v3 if !(v3 != 0) { clientData = data (*TClockClientData)(unsafe.Pointer(data)).FrefCount++ } if (*TClockCommand)(unsafe.Pointer(clockCmdPtr)).FclientData != 0 { v4 = libc.UintptrFromInt32(0) } else { v4 = __ccgo_fp(_ClockDeleteCmdProc) } cmdPtr = XTcl_CreateObjCommand(tls, interp, bp, (*TClockCommand)(unsafe.Pointer(clockCmdPtr)).FobjCmdProc, clientData, v4) if (*TClockCommand)(unsafe.Pointer(clockCmdPtr)).FcompileProc != 0 { v5 = (*TClockCommand)(unsafe.Pointer(clockCmdPtr)).FcompileProc } else { v5 = __ccgo_fp(XTclCompileBasicMin0ArgCmd) } (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc = v5 goto _2 _2: ; clockCmdPtr += 32 } cmdPtr = XTcl_CreateObjCommand(tls, interp, __ccgo_ts+12582, __ccgo_fp(_ClockConfigureObjCmd), data, __ccgo_fp(_ClockDeleteCmdProc)) (*TClockClientData)(unsafe.Pointer(data)).FrefCount++ (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc = __ccgo_fp(XTclCompileBasicMin0ArgCmd) } var _initialized int32 /* global clock engine initialized (in process) */ /* *---------------------------------------------------------------------- * * ClockConfigureClear -- * * Clean up cached resp. run-time storages used in clock commands. * * Shared usage for clean-up (ClockDeleteCmdProc) and "configure -clear". * * Results: * None. * *---------------------------------------------------------------------- */ func _ClockConfigureClear(tls *libc.TLS, data uintptr) { var _objPtr, _objPtr1, _objPtr10, _objPtr11, _objPtr12, _objPtr13, _objPtr14, _objPtr15, _objPtr16, _objPtr17, _objPtr18, _objPtr19, _objPtr2, _objPtr20, _objPtr21, _objPtr22, _objPtr23, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, _objPtr8, _objPtr9, v10, v12, v14, v16, v18, v2, v20, v22, v24, v26, v28, v30, v32, v34, v36, v38, v4, v40, v42, v44, v46, v48, v6, v8 uintptr var v1, v11, v13, v15, v17, v19, v21, v23, v25, v27, v29, v3, v31, v33, v35, v37, v39, v41, v43, v45, v47, v5, v7, v9 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr10, _objPtr11, _objPtr12, _objPtr13, _objPtr14, _objPtr15, _objPtr16, _objPtr17, _objPtr18, _objPtr19, _objPtr2, _objPtr20, _objPtr21, _objPtr22, _objPtr23, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, _objPtr8, _objPtr9, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v5, v6, v7, v8, v9 XClockFrmScnClearCaches(tls) (*TClockClientData)(unsafe.Pointer(data)).FlastTZEpoch = uint64(0) if (*TClockClientData)(unsafe.Pointer(data)).FsystemTimeZone != libc.UintptrFromInt32(0) { _objPtr = (*TClockClientData)(unsafe.Pointer(data)).FsystemTimeZone v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } (*TClockClientData)(unsafe.Pointer(data)).FsystemTimeZone = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FsystemSetupTZData != libc.UintptrFromInt32(0) { _objPtr1 = (*TClockClientData)(unsafe.Pointer(data)).FsystemSetupTZData v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } (*TClockClientData)(unsafe.Pointer(data)).FsystemSetupTZData = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTimeZoneUnnorm != libc.UintptrFromInt32(0) { _objPtr2 = (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTimeZoneUnnorm v6 = _objPtr2 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr2) } (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTimeZoneUnnorm = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTimeZone != libc.UintptrFromInt32(0) { _objPtr3 = (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTimeZone v8 = _objPtr3 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr3) } (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTimeZone = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTZData != libc.UintptrFromInt32(0) { _objPtr4 = (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTZData v10 = _objPtr4 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr4) } (*TClockClientData)(unsafe.Pointer(data)).FgmtSetupTZData = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FgmtTZName != libc.UintptrFromInt32(0) { _objPtr5 = (*TClockClientData)(unsafe.Pointer(data)).FgmtTZName v12 = _objPtr5 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr5) } (*TClockClientData)(unsafe.Pointer(data)).FgmtTZName = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTimeZoneUnnorm != libc.UintptrFromInt32(0) { _objPtr6 = (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTimeZoneUnnorm v14 = _objPtr6 v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if v13 <= int64(1) { XTclFreeObj(tls, _objPtr6) } (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTimeZoneUnnorm = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTimeZone != libc.UintptrFromInt32(0) { _objPtr7 = (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTimeZone v16 = _objPtr7 v15 = *(*TTcl_Size)(unsafe.Pointer(v16)) *(*TTcl_Size)(unsafe.Pointer(v16))-- if v15 <= int64(1) { XTclFreeObj(tls, _objPtr7) } (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTimeZone = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTZData != libc.UintptrFromInt32(0) { _objPtr8 = (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTZData v18 = _objPtr8 v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if v17 <= int64(1) { XTclFreeObj(tls, _objPtr8) } (*TClockClientData)(unsafe.Pointer(data)).FlastSetupTZData = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTimeZoneUnnorm != libc.UintptrFromInt32(0) { _objPtr9 = (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTimeZoneUnnorm v20 = _objPtr9 v19 = *(*TTcl_Size)(unsafe.Pointer(v20)) *(*TTcl_Size)(unsafe.Pointer(v20))-- if v19 <= int64(1) { XTclFreeObj(tls, _objPtr9) } (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTimeZoneUnnorm = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTimeZone != libc.UintptrFromInt32(0) { _objPtr10 = (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTimeZone v22 = _objPtr10 v21 = *(*TTcl_Size)(unsafe.Pointer(v22)) *(*TTcl_Size)(unsafe.Pointer(v22))-- if v21 <= int64(1) { XTclFreeObj(tls, _objPtr10) } (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTimeZone = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTZData != libc.UintptrFromInt32(0) { _objPtr11 = (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTZData v24 = _objPtr11 v23 = *(*TTcl_Size)(unsafe.Pointer(v24)) *(*TTcl_Size)(unsafe.Pointer(v24))-- if v23 <= int64(1) { XTclFreeObj(tls, _objPtr11) } (*TClockClientData)(unsafe.Pointer(data)).FprevSetupTZData = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FdefaultLocale != libc.UintptrFromInt32(0) { _objPtr12 = (*TClockClientData)(unsafe.Pointer(data)).FdefaultLocale v26 = _objPtr12 v25 = *(*TTcl_Size)(unsafe.Pointer(v26)) *(*TTcl_Size)(unsafe.Pointer(v26))-- if v25 <= int64(1) { XTclFreeObj(tls, _objPtr12) } (*TClockClientData)(unsafe.Pointer(data)).FdefaultLocale = libc.UintptrFromInt32(0) } (*TClockClientData)(unsafe.Pointer(data)).FdefaultLocaleDict = libc.UintptrFromInt32(0) if (*TClockClientData)(unsafe.Pointer(data)).FcurrentLocale != libc.UintptrFromInt32(0) { _objPtr13 = (*TClockClientData)(unsafe.Pointer(data)).FcurrentLocale v28 = _objPtr13 v27 = *(*TTcl_Size)(unsafe.Pointer(v28)) *(*TTcl_Size)(unsafe.Pointer(v28))-- if v27 <= int64(1) { XTclFreeObj(tls, _objPtr13) } (*TClockClientData)(unsafe.Pointer(data)).FcurrentLocale = libc.UintptrFromInt32(0) } (*TClockClientData)(unsafe.Pointer(data)).FcurrentLocaleDict = libc.UintptrFromInt32(0) if (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocaleUnnorm != libc.UintptrFromInt32(0) { _objPtr14 = (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocaleUnnorm v30 = _objPtr14 v29 = *(*TTcl_Size)(unsafe.Pointer(v30)) *(*TTcl_Size)(unsafe.Pointer(v30))-- if v29 <= int64(1) { XTclFreeObj(tls, _objPtr14) } (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocaleUnnorm = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocale != libc.UintptrFromInt32(0) { _objPtr15 = (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocale v32 = _objPtr15 v31 = *(*TTcl_Size)(unsafe.Pointer(v32)) *(*TTcl_Size)(unsafe.Pointer(v32))-- if v31 <= int64(1) { XTclFreeObj(tls, _objPtr15) } (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocale = libc.UintptrFromInt32(0) } (*TClockClientData)(unsafe.Pointer(data)).FlastUsedLocaleDict = libc.UintptrFromInt32(0) if (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocaleUnnorm != libc.UintptrFromInt32(0) { _objPtr16 = (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocaleUnnorm v34 = _objPtr16 v33 = *(*TTcl_Size)(unsafe.Pointer(v34)) *(*TTcl_Size)(unsafe.Pointer(v34))-- if v33 <= int64(1) { XTclFreeObj(tls, _objPtr16) } (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocaleUnnorm = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocale != libc.UintptrFromInt32(0) { _objPtr17 = (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocale v36 = _objPtr17 v35 = *(*TTcl_Size)(unsafe.Pointer(v36)) *(*TTcl_Size)(unsafe.Pointer(v36))-- if v35 <= int64(1) { XTclFreeObj(tls, _objPtr17) } (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocale = libc.UintptrFromInt32(0) } (*TClockClientData)(unsafe.Pointer(data)).FprevUsedLocaleDict = libc.UintptrFromInt32(0) if (*TClockClientData)(unsafe.Pointer(data)).FlastBase.FtimezoneObj != libc.UintptrFromInt32(0) { _objPtr18 = (*TClockClientData)(unsafe.Pointer(data)).FlastBase.FtimezoneObj v38 = _objPtr18 v37 = *(*TTcl_Size)(unsafe.Pointer(v38)) *(*TTcl_Size)(unsafe.Pointer(v38))-- if v37 <= int64(1) { XTclFreeObj(tls, _objPtr18) } (*TClockClientData)(unsafe.Pointer(data)).FlastBase.FtimezoneObj = libc.UintptrFromInt32(0) } if (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368))).FtimezoneObj != libc.UintptrFromInt32(0) { _objPtr19 = (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368))).FtimezoneObj v40 = _objPtr19 v39 = *(*TTcl_Size)(unsafe.Pointer(v40)) *(*TTcl_Size)(unsafe.Pointer(v40))-- if v39 <= int64(1) { XTclFreeObj(tls, _objPtr19) } (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368))).FtimezoneObj = libc.UintptrFromInt32(0) } if (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368))).FtzName != libc.UintptrFromInt32(0) { _objPtr20 = (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368))).FtzName v42 = _objPtr20 v41 = *(*TTcl_Size)(unsafe.Pointer(v42)) *(*TTcl_Size)(unsafe.Pointer(v42))-- if v41 <= int64(1) { XTclFreeObj(tls, _objPtr20) } (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368))).FtzName = libc.UintptrFromInt32(0) } if (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368 + 1*56))).FtimezoneObj != libc.UintptrFromInt32(0) { _objPtr21 = (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368 + 1*56))).FtimezoneObj v44 = _objPtr21 v43 = *(*TTcl_Size)(unsafe.Pointer(v44)) *(*TTcl_Size)(unsafe.Pointer(v44))-- if v43 <= int64(1) { XTclFreeObj(tls, _objPtr21) } (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368 + 1*56))).FtimezoneObj = libc.UintptrFromInt32(0) } if (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368 + 1*56))).FtzName != libc.UintptrFromInt32(0) { _objPtr22 = (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368 + 1*56))).FtzName v46 = _objPtr22 v45 = *(*TTcl_Size)(unsafe.Pointer(v46)) *(*TTcl_Size)(unsafe.Pointer(v46))-- if v45 <= int64(1) { XTclFreeObj(tls, _objPtr22) } (*(*TClockLastTZOffs)(unsafe.Pointer(data + 368 + 1*56))).FtzName = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FmcDicts != libc.UintptrFromInt32(0) { _objPtr23 = (*TClockClientData)(unsafe.Pointer(data)).FmcDicts v48 = _objPtr23 v47 = *(*TTcl_Size)(unsafe.Pointer(v48)) *(*TTcl_Size)(unsafe.Pointer(v48))-- if v47 <= int64(1) { XTclFreeObj(tls, _objPtr23) } (*TClockClientData)(unsafe.Pointer(data)).FmcDicts = libc.UintptrFromInt32(0) } } // C documentation // // /* // *---------------------------------------------------------------------- // * // * ClockDeleteCmdProc -- // * // * Remove a reference to the clock client data, and clean up memory // * when it's all gone. // * // * Results: // * None. // * // *---------------------------------------------------------------------- // */ func _ClockDeleteCmdProc(tls *libc.TLS, clientData uintptr) { /* Opaque pointer to the client data */ var _objPtr, _objPtr1, _objPtr2, data, v11, v2, v5, v8 uintptr var i int32 var v1 Tsize_t var v10, v4, v7 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, data, i, v1, v10, v11, v2, v4, v5, v7, v8 data = clientData v2 = data v1 = *(*Tsize_t)(unsafe.Pointer(v2)) *(*Tsize_t)(unsafe.Pointer(v2))-- if v1 <= uint64(1) { i = 0 for { if !(i < int32(LIT__END)) { break } _objPtr = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(data)).Fliterals + uintptr(i)*8)) v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } goto _3 _3: ; i++ } if (*TClockClientData)(unsafe.Pointer(data)).FmcLiterals != libc.UintptrFromInt32(0) { i = 0 for { if !(i < int32(MCLIT__END)) { break } _objPtr1 = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(data)).FmcLiterals + uintptr(i)*8)) v8 = _objPtr1 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr1) } goto _6 _6: ; i++ } XTclpFree(tls, (*TClockClientData)(unsafe.Pointer(data)).FmcLiterals) (*TClockClientData)(unsafe.Pointer(data)).FmcLiterals = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(data)).FmcLitIdxs != libc.UintptrFromInt32(0) { i = 0 for { if !(i < int32(MCLIT__END)) { break } _objPtr2 = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(data)).FmcLitIdxs + uintptr(i)*8)) v11 = _objPtr2 v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if v10 <= int64(1) { XTclFreeObj(tls, _objPtr2) } goto _9 _9: ; i++ } XTclpFree(tls, (*TClockClientData)(unsafe.Pointer(data)).FmcLitIdxs) (*TClockClientData)(unsafe.Pointer(data)).FmcLitIdxs = libc.UintptrFromInt32(0) } _ClockConfigureClear(tls, data) XTclpFree(tls, (*TClockClientData)(unsafe.Pointer(data)).Fliterals) XTclpFree(tls, data) } } // C documentation // // /* // *---------------------------------------------------------------------- // * // * SavePrevTimezoneObj -- // * // * Used to store previously used/cached time zone (makes it reusable). // * // * This enables faster switch between time zones (e. g. to convert from // * one to another). // * // * Results: // * None. // * // *---------------------------------------------------------------------- // */ func _SavePrevTimezoneObj(tls *libc.TLS, dataPtr uintptr) { /* Client data containing literal pool */ var _objPtr, _objPtr1, _objPtr2, nval, nval1, nval2, prev, prev1, prev2, timezoneObj, v2, v4, v6 uintptr var v1, v3, v5 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, nval, nval1, nval2, prev, prev1, prev2, timezoneObj, v1, v2, v3, v4, v5, v6 timezoneObj = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone if timezoneObj != 0 && timezoneObj != (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone { nval = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } nval1 = timezoneObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone != nval1 { prev1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone = nval1 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone)).FrefCount++ } if prev1 != libc.UintptrFromInt32(0) { _objPtr1 = prev1 v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } } nval2 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTZData != nval2 { prev2 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTZData (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTZData = nval2 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTZData != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTZData)).FrefCount++ } if prev2 != libc.UintptrFromInt32(0) { _objPtr2 = prev2 v6 = _objPtr2 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } } } } /* *---------------------------------------------------------------------- * * NormTimezoneObj -- * * Normalizes the timezone object (used for caching puposes). * * If already cached time zone could be found, returns this * object (last setup or last used, system (current) or gmt). * * Results: * Normalized tcl object pointer. * *---------------------------------------------------------------------- */ func _NormTimezoneObj(tls *libc.TLS, dataPtr uintptr, timezoneObj uintptr, loaded uintptr) (r uintptr) { /* Used to recognized TZ was loaded */ var _objPtr, _objPtr1, _objPtr2, nval, nval1, nval2, prev, prev1, prev2, tz, v1, v10, v13, v2, v5, v6, v9 uintptr var v11, v3, v7 bool var v12, v4, v8 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, nval, nval1, nval2, prev, prev1, prev2, tz, v1, v10, v11, v12, v13, v2, v3, v4, v5, v6, v7, v8, v9 *(*int32)(unsafe.Pointer(loaded)) = int32(1) if timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm && (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != libc.UintptrFromInt32(0) { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone } if timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm && (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone != libc.UintptrFromInt32(0) { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone } if timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm && (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZone != libc.UintptrFromInt32(0) { return *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_GMT)*8)) } if timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone || timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone || timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZone || timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone { return timezoneObj } if (*TTcl_Obj)(unsafe.Pointer(timezoneObj)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(timezoneObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, timezoneObj, libc.UintptrFromInt32(0)) } tz = v1 if v3 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != libc.UintptrFromInt32(0); v3 { if (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone, libc.UintptrFromInt32(0)) } } if v3 && libc.Xstrcmp(tls, tz, v2) == 0 { nval = timezoneObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } return (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone } if v7 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone != libc.UintptrFromInt32(0); v7 { if (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone)).Fbytes != 0 { v6 = (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone)).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone, libc.UintptrFromInt32(0)) } } if v7 && libc.Xstrcmp(tls, tz, v6) == 0 { nval1 = timezoneObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm != nval1 { prev1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm = nval1 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm)).FrefCount++ } if prev1 != libc.UintptrFromInt32(0) { _objPtr1 = prev1 v9 = _objPtr1 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } } return (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone } if v11 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone != libc.UintptrFromInt32(0); v11 { if (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone)).Fbytes != 0 { v10 = (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone)).Fbytes } else { v10 = XTcl_GetStringFromObj(tls, (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone, libc.UintptrFromInt32(0)) } } if v11 && libc.Xstrcmp(tls, tz, v10) == 0 { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone } if libc.Xstrcmp(tls, tz, _Literals[int32(LIT_GMT)]) == 0 { nval2 = timezoneObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm != nval2 { prev2 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm = nval2 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm)).FrefCount++ } if prev2 != libc.UintptrFromInt32(0) { _objPtr2 = prev2 v13 = _objPtr2 v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if v12 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } } if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZone == libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(loaded)) = 0 } return *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_GMT)*8)) } /* unknown/unloaded tz - recache/revalidate later as last-setup if needed */ *(*int32)(unsafe.Pointer(loaded)) = 0 return timezoneObj } /* *---------------------------------------------------------------------- * * ClockGetSystemLocale -- * * Returns system locale. * * Executes ::tcl::clock::GetSystemLocale in given interpreter. * * Results: * Returns system locale tcl object. * *---------------------------------------------------------------------- */ func _ClockGetSystemLocale(tls *libc.TLS, dataPtr uintptr, interp uintptr) (r uintptr) { /* Tcl interpreter */ if XTcl_EvalObjv(tls, interp, int64(1), (*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals+uintptr(LIT_GETSYSTEMLOCALE)*8, 0) != TCL_OK { return libc.UintptrFromInt32(0) } return XTcl_GetObjResult(tls, interp) } /* *---------------------------------------------------------------------- * * ClockGetCurrentLocale -- * * Returns current locale. * * Executes ::tcl::clock::mclocale in given interpreter. * * Results: * Returns current locale tcl object. * *---------------------------------------------------------------------- */ func _ClockGetCurrentLocale(tls *libc.TLS, dataPtr uintptr, interp uintptr) (r uintptr) { /* Tcl interpreter */ var _objPtr, nval, prev, v2 uintptr var v1 TTcl_Size _, _, _, _, _ = _objPtr, nval, prev, v1, v2 if XTcl_EvalObjv(tls, interp, int64(1), (*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals+uintptr(LIT_GETCURRENTLOCALE)*8, 0) != TCL_OK { return libc.UintptrFromInt32(0) } nval = XTcl_GetObjResult(tls, interp) if (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocaleDict = libc.UintptrFromInt32(0) XTcl_ResetResult(tls, interp) return (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale } /* *---------------------------------------------------------------------- * * SavePrevLocaleObj -- * * Used to store previously used/cached locale (makes it reusable). * * This enables faster switch between locales (e. g. to convert from one to another). * * Results: * None. * *---------------------------------------------------------------------- */ func _SavePrevLocaleObj(tls *libc.TLS, dataPtr uintptr) { /* Client data containing literal pool */ var _objPtr, _objPtr1, localeObj, nval, nval1, prev, prev1, v2, v4 uintptr var v1, v3 TTcl_Size _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, localeObj, nval, nval1, prev, prev1, v1, v2, v3, v4 localeObj = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale if localeObj != 0 && localeObj != (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale { nval = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } nval1 = localeObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale != nval1 { prev1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale = nval1 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale)).FrefCount++ } if prev1 != libc.UintptrFromInt32(0) { _objPtr1 = prev1 v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } } /* mcDicts owns reference to dict */ (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleDict = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleDict } } /* *---------------------------------------------------------------------- * * NormLocaleObj -- * * Normalizes the locale object (used for caching puposes). * * If already cached locale could be found, returns this * object (current, system (OS) or last used locales). * * Results: * Normalized tcl object pointer. * *---------------------------------------------------------------------- */ func _NormLocaleObj(tls *libc.TLS, dataPtr uintptr, interp uintptr, localeObj uintptr, mcDictObj uintptr) (r uintptr) { var _objPtr, _objPtr1, _objPtr2, _objPtr3, loc, loc2, nval, nval1, nval2, nval3, prev, prev1, prev2, prev3, v1, v12, v13, v18, v19, v2, v20, v23, v25, v27, v3, v7 uintptr var v10, v14, v15, v16, v21, v22, v4, v5, v6, v8, v9 bool var v11, v17, v24, v26 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, loc, loc2, nval, nval1, nval2, nval3, prev, prev1, prev2, prev3, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v3, v4, v5, v6, v7, v8, v9 if localeObj == libc.UintptrFromInt32(0) || localeObj == *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_C)*8)) || localeObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale { *(*uintptr)(unsafe.Pointer(mcDictObj)) = (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocaleDict if (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale != 0 { v1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale } else { v1 = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_C)*8)) } return v1 } if localeObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale || localeObj == *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_CURRENT)*8)) { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale == libc.UintptrFromInt32(0) { _ClockGetCurrentLocale(tls, dataPtr, interp) } *(*uintptr)(unsafe.Pointer(mcDictObj)) = (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocaleDict return (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale } if localeObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale || localeObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm { *(*uintptr)(unsafe.Pointer(mcDictObj)) = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleDict return (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale } if localeObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale || localeObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm { *(*uintptr)(unsafe.Pointer(mcDictObj)) = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleDict return (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale } if (*TTcl_Obj)(unsafe.Pointer(localeObj)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(localeObj)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, localeObj, libc.UintptrFromInt32(0)) } loc = v2 if v6 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale != libc.UintptrFromInt32(0); v6 { if v5 = localeObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale; !v5 { if v4 = (*TTcl_Obj)(unsafe.Pointer(localeObj)).Flength == (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale)).Flength; v4 { if (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale, libc.UintptrFromInt32(0)) } } } } if v6 && (v5 || v4 && libc.Xstrcasecmp(tls, loc, v3) == 0) { *(*uintptr)(unsafe.Pointer(mcDictObj)) = (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocaleDict return (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale } if v10 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale != libc.UintptrFromInt32(0); v10 { if v9 = localeObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale; !v9 { if v8 = (*TTcl_Obj)(unsafe.Pointer(localeObj)).Flength == (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale)).Flength; v8 { if (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale)).Fbytes != 0 { v7 = (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale)).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale, libc.UintptrFromInt32(0)) } } } } if v10 && (v9 || v8 && libc.Xstrcasecmp(tls, loc, v7) == 0) { *(*uintptr)(unsafe.Pointer(mcDictObj)) = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleDict nval = localeObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v12 = _objPtr v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } return (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale } if v16 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale != libc.UintptrFromInt32(0); v16 { if v15 = localeObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale; !v15 { if v14 = (*TTcl_Obj)(unsafe.Pointer(localeObj)).Flength == (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale)).Flength; v14 { if (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale)).Fbytes != 0 { v13 = (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale)).Fbytes } else { v13 = XTcl_GetStringFromObj(tls, (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale, libc.UintptrFromInt32(0)) } } } } if v16 && (v15 || v14 && libc.Xstrcasecmp(tls, loc, v13) == 0) { *(*uintptr)(unsafe.Pointer(mcDictObj)) = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleDict nval1 = localeObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm != nval1 { prev1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm = nval1 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocaleUnnorm)).FrefCount++ } if prev1 != libc.UintptrFromInt32(0) { _objPtr1 = prev1 v18 = _objPtr1 v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if v17 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } } return (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevUsedLocale } if v22 = (*TTcl_Obj)(unsafe.Pointer(localeObj)).Flength == int64(1) && libc.Xstrcasecmp(tls, loc, _Literals[int32(LIT_C)]) == 0; !v22 { if v21 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale != 0; v21 { if (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale)).Fbytes != 0 { v20 = (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale)).Fbytes } else { v20 = XTcl_GetStringFromObj(tls, (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale, libc.UintptrFromInt32(0)) } v19 = v20 loc2 = v19 } } if v22 || v21 && v19 != 0 && (*TTcl_Obj)(unsafe.Pointer(localeObj)).Flength == (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale)).Flength && libc.Xstrcasecmp(tls, loc, loc2) == 0 { *(*uintptr)(unsafe.Pointer(mcDictObj)) = (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocaleDict if (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale != 0 { v23 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale } else { v23 = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_C)*8)) } return v23 } if (*TTcl_Obj)(unsafe.Pointer(localeObj)).Flength == int64(7) && libc.Xstrcasecmp(tls, loc, _Literals[int32(LIT_CURRENT)]) == 0 { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale == libc.UintptrFromInt32(0) { _ClockGetCurrentLocale(tls, dataPtr, interp) } *(*uintptr)(unsafe.Pointer(mcDictObj)) = (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocaleDict return (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale } if (*TTcl_Obj)(unsafe.Pointer(localeObj)).Flength == int64(6) && libc.Xstrcasecmp(tls, loc, _Literals[int32(LIT_SYSTEM)]) == 0 { _SavePrevLocaleObj(tls, dataPtr) nval2 = localeObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm != nval2 { prev2 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm = nval2 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm)).FrefCount++ } if prev2 != libc.UintptrFromInt32(0) { _objPtr2 = prev2 v25 = _objPtr2 v24 = *(*TTcl_Size)(unsafe.Pointer(v25)) *(*TTcl_Size)(unsafe.Pointer(v25))-- if v24 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } } localeObj = _ClockGetSystemLocale(tls, dataPtr, interp) nval3 = localeObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale != nval3 { prev3 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale = nval3 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale)).FrefCount++ } if prev3 != libc.UintptrFromInt32(0) { _objPtr3 = prev3 v27 = _objPtr3 v26 = *(*TTcl_Size)(unsafe.Pointer(v27)) *(*TTcl_Size)(unsafe.Pointer(v27))-- if v26 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } } *(*uintptr)(unsafe.Pointer(mcDictObj)) = libc.UintptrFromInt32(0) return localeObj } *(*uintptr)(unsafe.Pointer(mcDictObj)) = libc.UintptrFromInt32(0) return localeObj } /* *---------------------------------------------------------------------- * * ClockMCDict -- * * Retrieves a localized storage dictionary object for the given * locale object. * * This corresponds with call `::tcl::clock::mcget locale`. * Cached representation stored in options (for further access). * * Results: * Tcl-object contains smart reference to msgcat dictionary. * *---------------------------------------------------------------------- */ func XClockMCDict(tls *libc.TLS, opts uintptr) (r uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, _objPtr1, _objPtr2, dataPtr, nval, nval1, prev, prev1, v3, v5, v7 uintptr var i int32 var ref, v2, v4, v6 TTcl_Size var _ /* callargs at bp+0 */ [2]uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, dataPtr, i, nval, nval1, prev, prev1, ref, v2, v3, v4, v5, v6, v7 dataPtr = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr /* if dict not yet retrieved */ if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { /* if locale was not yet used */ if !((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags&int32(CLF_LOCALE_USED) != 0) { (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj = _NormLocaleObj(tls, dataPtr, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj, opts+56) if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, XTcl_NewStringObj(tls, __ccgo_ts+12619, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, libc.VaList(bp+24, __ccgo_ts+12666, __ccgo_ts+12672, libc.UintptrFromInt32(0))) return libc.UintptrFromInt32(0) } *(*int32)(unsafe.Pointer(opts + 48)) |= int32(CLF_LOCALE_USED) /* check locale literals already available (on demand creation) */ if (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLiterals == libc.UintptrFromInt32(0) { (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLiterals = XTcl_Alloc(tls, uint64(MCLIT__END)*libc.Uint64FromInt64(8)) i = 0 for { if !(i < int32(MCLIT__END)) { break } *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLiterals + uintptr(i)*8)) = XTcl_NewStringObj(tls, _MsgCtLiterals[i], int64(-libc.Int32FromInt32(1))) if *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLiterals + uintptr(i)*8)) != 0 { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLiterals + uintptr(i)*8)))).FrefCount++ } goto _1 _1: ; i++ } } } /* check or obtain mcDictObj (be sure it's modifiable) */ if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) || (*TTcl_Obj)(unsafe.Pointer((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj)).FrefCount > int64(1) { ref = int64(1) /* first try to find locale catalog dict */ if (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcDicts == libc.UintptrFromInt32(0) { nval = XTcl_NewDictObj(tls) if (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcDicts != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcDicts (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcDicts = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcDicts != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcDicts)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } } XTcl_DictObjGet(tls, libc.UintptrFromInt32(0), (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcDicts, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj, opts+56) if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp)))[0] = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_MCGET)*8)) (*(*[2]uintptr)(unsafe.Pointer(bp)))[int32(1)] = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj if XTcl_EvalObjv(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, int64(2), bp, 0) != TCL_OK { return libc.UintptrFromInt32(0) } (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj = XTcl_GetObjResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp) XTcl_ResetResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp) ref = 0 /* new object is not yet referenced */ } /* be sure that object reference doesn't increase (dict changeable) */ if (*TTcl_Obj)(unsafe.Pointer((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj)).FrefCount > ref { /* smart reference (shared dict as object with no ref-counter) */ (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj = XTclDictObjSmartRef(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj) } /* create exactly one reference to catalog / make it searchable for future */ XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcDicts, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj) if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj == *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_C)*8)) || (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale { (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocaleDict = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj } if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale { (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocaleDict = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj } else { if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale { (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleDict = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj } else { _SavePrevLocaleObj(tls, dataPtr) nval1 = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale != nval1 { prev1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale = nval1 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocale)).FrefCount++ } if prev1 != libc.UintptrFromInt32(0) { _objPtr1 = prev1 v5 = _objPtr1 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } } if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm != libc.UintptrFromInt32(0) { _objPtr2 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm v7 = _objPtr2 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr2) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleUnnorm = libc.UintptrFromInt32(0) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastUsedLocaleDict = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj } } } } return (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj } /* *---------------------------------------------------------------------- * * ClockMCGet -- * * Retrieves a msgcat value for the given literal integer mcKey * from localized storage (corresponding given locale object) * by mcLiterals[mcKey] (e. g. MONTHS_FULL). * * Results: * Tcl-object contains localized value. * *---------------------------------------------------------------------- */ func XClockMCGet(tls *libc.TLS, opts uintptr, mcKey int32) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* valObj at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { XClockMCDict(tls, opts) if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } } XTcl_DictObjGet(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr)).FmcLiterals + uintptr(mcKey)*8)), bp) return *(*uintptr)(unsafe.Pointer(bp)) /* or NULL in obscure case if Tcl_DictObjGet failed */ } /* *---------------------------------------------------------------------- * * ClockMCGetIdx -- * * Retrieves an indexed msgcat value for the given literal integer mcKey * from localized storage (corresponding given locale object) * by mcLitIdxs[mcKey] (e. g. _IDX_MONTHS_FULL). * * Results: * Tcl-object contains localized indexed value. * *---------------------------------------------------------------------- */ func XClockMCGetIdx(tls *libc.TLS, opts uintptr, mcKey int32) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var dataPtr uintptr var _ /* valObj at bp+0 */ uintptr _ = dataPtr dataPtr = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { XClockMCDict(tls, opts) if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } } /* try to get indices object */ if (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLitIdxs == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } if XTcl_DictObjGet(tls, libc.UintptrFromInt32(0), (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLitIdxs + uintptr(mcKey)*8)), bp) != TCL_OK { return libc.UintptrFromInt32(0) } return *(*uintptr)(unsafe.Pointer(bp)) } /* *---------------------------------------------------------------------- * * ClockMCSetIdx -- * * Sets an indexed msgcat value for the given literal integer mcKey * in localized storage (corresponding given locale object) * by mcLitIdxs[mcKey] (e. g. _IDX_MONTHS_FULL). * * Results: * Returns a standard Tcl result. * *---------------------------------------------------------------------- */ func XClockMCSetIdx(tls *libc.TLS, opts uintptr, mcKey int32, valObj uintptr) (r int32) { var dataPtr uintptr var i int32 _, _ = dataPtr, i dataPtr = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { XClockMCDict(tls, opts) if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } /* if literal storage for indices not yet created */ if (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLitIdxs == libc.UintptrFromInt32(0) { (*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLitIdxs = XTcl_Alloc(tls, uint64(MCLIT__END)*libc.Uint64FromInt64(8)) i = 0 for { if !(i < int32(MCLIT__END)) { break } *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLitIdxs + uintptr(i)*8)) = XTcl_NewStringObj(tls, _MsgCtLitIdxs[i], int64(-libc.Int32FromInt32(1))) if *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLitIdxs + uintptr(i)*8)) != 0 { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLitIdxs + uintptr(i)*8)))).FrefCount++ } goto _1 _1: ; i++ } } return XTcl_DictObjPut(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLitIdxs + uintptr(mcKey)*8)), valObj) } func _TimezoneLoaded(tls *libc.TLS, dataPtr uintptr, timezoneObj uintptr, tzUnnormObj uintptr) { /* Name of zone was loaded */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, nval, nval1, nval2, nval3, prev, prev1, prev2, prev3, v10, v2, v4, v6, v8 uintptr var v1, v3, v5, v7, v9 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, nval, nval1, nval2, nval3, prev, prev1, prev2, prev3, v1, v10, v2, v3, v4, v5, v6, v7, v8, v9 /* don't overwrite last-setup with GMT (special case) */ if timezoneObj == *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_GMT)*8)) { /* mark GMT zone loaded */ if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZone == libc.UintptrFromInt32(0) { nval = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_GMT)*8)) if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZone != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZone (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZone = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZone != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZone)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } } nval1 = tzUnnormObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm != nval1 { prev1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm = nval1 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm)).FrefCount++ } if prev1 != libc.UintptrFromInt32(0) { _objPtr1 = prev1 v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } } return } /* last setup zone loaded */ if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != timezoneObj { _SavePrevTimezoneObj(tls, dataPtr) nval2 = timezoneObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != nval2 { prev2 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone = nval2 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone)).FrefCount++ } if prev2 != libc.UintptrFromInt32(0) { _objPtr2 = prev2 v6 = _objPtr2 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } } if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData != libc.UintptrFromInt32(0) { _objPtr3 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData v8 = _objPtr3 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr3) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData = libc.UintptrFromInt32(0) } } nval3 = tzUnnormObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm != nval3 { prev3 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm = nval3 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm)).FrefCount++ } if prev3 != libc.UintptrFromInt32(0) { _objPtr4 = prev3 v10 = _objPtr4 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr4) } } } } /* *---------------------------------------------------------------------- * * ClockConfigureObjCmd -- * * This function is invoked to process the Tcl "::tcl::unsupported::clock::configure" * (internal, unsupported) command. * * Usage: * ::tcl::unsupported::clock::configure ?-option ?value?? * * Results: * Returns a standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _ClockConfigureObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) /* Parameter vector */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, dataPtr, nval, nval1, nval2, prev, prev1, prev2, timezoneObj, v10, v12, v3, v5, v7, v9 uintptr var i, v11, v2, v4, v6, v8 TTcl_Size var lastTZEpoch Tsize_t var token TTcl_Command var v13, v14, v15, v16 int32 var _ /* ensFlags at bp+36 */ int32 var _ /* jd at bp+24 */ float64 var _ /* loaded at bp+4 */ int32 var _ /* optionIndex at bp+0 */ int32 var _ /* val at bp+32 */ int32 var _ /* year at bp+12 */ int32 var _ /* year at bp+16 */ int32 var _ /* year at bp+20 */ int32 var _ /* year at bp+8 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, dataPtr, i, lastTZEpoch, nval, nval1, nval2, prev, prev1, prev2, timezoneObj, token, v10, v11, v12, v13, v14, v15, v16, v2, v3, v4, v5, v6, v7, v8, v9 dataPtr = clientData i = int64(1) for { if !(i < int64(objc)) { break } v2 = i i++ if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(v2)*8)), uintptr(unsafe.Pointer(&_options)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<= int64(objc) && (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone != libc.UintptrFromInt32(0) && (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastTZEpoch == lastTZEpoch { XTcl_SetObjResult(tls, interp, (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone) } case 10: if i < int64(objc) { timezoneObj = _NormTimezoneObj(tls, dataPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+4) if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) { _TimezoneLoaded(tls, dataPtr, timezoneObj, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) } XTcl_SetObjResult(tls, interp, timezoneObj) } else { if i+int64(1) >= int64(objc) && (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone) } } case 0: if i < int64(objc) { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale != *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) { nval1 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) if (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale != nval1 { prev1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale = nval1 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale)).FrefCount++ } if prev1 != libc.UintptrFromInt32(0) { _objPtr2 = prev1 v9 = _objPtr2 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } } (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocaleDict = libc.UintptrFromInt32(0) } } if i+int64(1) >= int64(objc) { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale != 0 { v10 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefaultLocale } else { v10 = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_C)*8)) } XTcl_SetObjResult(tls, interp, v10) } case 2: if i < int64(objc) { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale != *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) { nval2 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) if (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale != nval2 { prev2 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale = nval2 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale)).FrefCount++ } if prev2 != libc.UintptrFromInt32(0) { _objPtr3 = prev2 v12 = _objPtr3 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } } (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocaleDict = libc.UintptrFromInt32(0) } } if i+int64(1) >= int64(objc) && (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentLocale) } case 3: if i < int64(objc) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep))) v13 = libc.Int32FromInt32(TCL_OK) } else { v13 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+8) } if v13 != TCL_OK { return int32(TCL_ERROR) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentYearCentury = *(*int32)(unsafe.Pointer(bp + 8)) if i+int64(1) >= int64(objc) { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) } goto _1 } if i+int64(1) >= int64(objc) { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64((*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentYearCentury))) } case 4: if i < int64(objc) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp + 12)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep))) v14 = libc.Int32FromInt32(TCL_OK) } else { v14 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+12) } if v14 != TCL_OK { return int32(TCL_ERROR) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FyearOfCenturySwitch = *(*int32)(unsafe.Pointer(bp + 12)) XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) goto _1 } if i+int64(1) >= int64(objc) { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64((*TClockClientData)(unsafe.Pointer(dataPtr)).FyearOfCenturySwitch))) } case 5: if i < int64(objc) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp + 16)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep))) v15 = libc.Int32FromInt32(TCL_OK) } else { v15 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+16) } if v15 != TCL_OK { return int32(TCL_ERROR) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FvalidMinYear = *(*int32)(unsafe.Pointer(bp + 16)) XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) goto _1 } if i+int64(1) >= int64(objc) { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64((*TClockClientData)(unsafe.Pointer(dataPtr)).FvalidMinYear))) } case 6: if i < int64(objc) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp + 20)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep))) v16 = libc.Int32FromInt32(TCL_OK) } else { v16 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+20) } if v16 != TCL_OK { return int32(TCL_ERROR) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FvalidMaxYear = *(*int32)(unsafe.Pointer(bp + 20)) XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) goto _1 } if i+int64(1) >= int64(objc) { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64((*TClockClientData)(unsafe.Pointer(dataPtr)).FvalidMaxYear))) } case 7: if i < int64(objc) { if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+24) != TCL_OK { return int32(TCL_ERROR) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FmaxJDN = *(*float64)(unsafe.Pointer(bp + 24)) XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) goto _1 } if i+int64(1) >= int64(objc) { XTcl_SetObjResult(tls, interp, XTcl_NewDoubleObj(tls, (*TClockClientData)(unsafe.Pointer(dataPtr)).FmaxJDN)) } case 8: if i < int64(objc) { if XTcl_GetBoolFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp+32) != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 32)) != 0 { *(*int32)(unsafe.Pointer(dataPtr + 480)) |= int32(CLF_VALIDATE) } else { *(*int32)(unsafe.Pointer(dataPtr + 480)) &= ^int32(CLF_VALIDATE) } } if i+int64(1) >= int64(objc) { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64((*TClockClientData)(unsafe.Pointer(dataPtr)).FdefFlags&int32(CLF_VALIDATE) != 0))) } case 1: _ClockConfigureClear(tls, dataPtr) case 9: /* * Init completed. * Compile clock ensemble (performance purposes). */ token = XTcl_FindCommand(tls, interp, __ccgo_ts+12826, libc.UintptrFromInt32(0), int32(TCL_GLOBAL_ONLY)) if !(token != 0) { return int32(TCL_ERROR) } *(*int32)(unsafe.Pointer(bp + 36)) = 0 if XTcl_GetEnsembleFlags(tls, interp, token, bp+36) != TCL_OK { return int32(TCL_ERROR) } *(*int32)(unsafe.Pointer(bp + 36)) |= int32(ENSEMBLE_COMPILE) if XTcl_SetEnsembleFlags(tls, interp, token, *(*int32)(unsafe.Pointer(bp + 36))) != TCL_OK { return int32(TCL_ERROR) } break } goto _1 _1: ; i++ } return TCL_OK } var _options = [13]uintptr{ 0: __ccgo_ts + 12682, 1: __ccgo_ts + 12698, 2: __ccgo_ts + 12705, 3: __ccgo_ts + 12721, 4: __ccgo_ts + 12735, 5: __ccgo_ts + 12751, 6: __ccgo_ts + 12761, 7: __ccgo_ts + 12771, 8: __ccgo_ts + 12780, 9: __ccgo_ts + 12790, 10: __ccgo_ts + 12805, 11: __ccgo_ts + 12815, 12: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * ClockGetTZData -- * * Retrieves tzdata table for given normalized timezone. * * Results: * Returns a tcl object with tzdata. * * Side effects: * The tzdata can be cached in ClockClientData structure. * *---------------------------------------------------------------------- */ func _ClockGetTZData(tls *libc.TLS, dataPtr uintptr, interp uintptr, timezoneObj uintptr) (r uintptr) { /* Name of the timezone */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, nval, nval1, nval2, out, prev, prev1, prev2, ret, v2, v4, v6, v8 uintptr var v1, v3, v5, v7 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, nval, nval1, nval2, out, prev, prev1, prev2, ret, v1, v2, v3, v4, v5, v6, v7, v8 out = libc.UintptrFromInt32(0) /* if cached (if already setup this one) */ if timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone || timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData != libc.UintptrFromInt32(0) { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData } out = dataPtr + 136 } /* differentiate GMT and system zones, because used often */ /* simple caching, because almost used the tz-data of last timezone */ if timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemSetupTZData != libc.UintptrFromInt32(0) { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemSetupTZData } out = dataPtr + 80 } else { if timezoneObj == *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_GMT)*8)) || timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTimeZoneUnnorm { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTZData != libc.UintptrFromInt32(0) { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTZData } out = dataPtr + 104 } else { if timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone || timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTZData != libc.UintptrFromInt32(0) { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTZData } out = dataPtr + 160 } } } ret = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_TZDATA)*8)), timezoneObj, int32(TCL_LEAVE_ERR_MSG)) /* cache using corresponding slot and as last used */ if out != libc.UintptrFromInt32(0) { nval = ret if *(*uintptr)(unsafe.Pointer(out)) != nval { prev = *(*uintptr)(unsafe.Pointer(out)) *(*uintptr)(unsafe.Pointer(out)) = nval if *(*uintptr)(unsafe.Pointer(out)) != 0 { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(out)))).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } } else { if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != timezoneObj { _SavePrevTimezoneObj(tls, dataPtr) nval1 = timezoneObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != nval1 { prev1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone = nval1 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone)).FrefCount++ } if prev1 != libc.UintptrFromInt32(0) { _objPtr1 = prev1 v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } } if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm != libc.UintptrFromInt32(0) { _objPtr2 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm v6 = _objPtr2 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr2) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm = libc.UintptrFromInt32(0) } nval2 = ret if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData != nval2 { prev2 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData = nval2 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTZData)).FrefCount++ } if prev2 != libc.UintptrFromInt32(0) { _objPtr3 = prev2 v8 = _objPtr3 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } } } } return ret } /* *---------------------------------------------------------------------- * * ClockGetSystemTimeZone -- * * Returns system (current) timezone. * * If system zone not yet cached, it executes ::tcl::clock::GetSystemTimeZone * in given interpreter and caches its result. * * Results: * Returns normalized timezone object. * *---------------------------------------------------------------------- */ func _ClockGetSystemTimeZone(tls *libc.TLS, dataPtr uintptr, interp uintptr) (r uintptr) { /* Tcl interpreter */ var _objPtr, _objPtr1, _objPtr2, nval, prev, v2, v4, v6 uintptr var v1, v3, v5 TTcl_Size _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, nval, prev, v1, v2, v3, v4, v5, v6 /* if known (cached and same epoch) - return now */ if (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone != libc.UintptrFromInt32(0) && (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastTZEpoch == _TzsetIfNecessary(tls) { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone } if (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone != libc.UintptrFromInt32(0) { _objPtr = (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone = libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemSetupTZData != libc.UintptrFromInt32(0) { _objPtr1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemSetupTZData v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemSetupTZData = libc.UintptrFromInt32(0) } if XTcl_EvalObjv(tls, interp, int64(1), (*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals+uintptr(LIT_GETSYSTEMTIMEZONE)*8, 0) != TCL_OK { return libc.UintptrFromInt32(0) } if (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone == libc.UintptrFromInt32(0) { nval = XTcl_GetObjResult(tls, interp) if (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr2 = prev v6 = _objPtr2 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } } } XTcl_ResetResult(tls, interp) return (*TClockClientData)(unsafe.Pointer(dataPtr)).FsystemTimeZone } /* *---------------------------------------------------------------------- * * ClockSetupTimeZone -- * * Sets up the timezone. Loads tzdata, etc. * * Results: * Returns normalized timezone object. * *---------------------------------------------------------------------- */ func XClockSetupTimeZone(tls *libc.TLS, dataPtr uintptr, interp uintptr, timezoneObj uintptr) (r uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, nval, prev, v2 uintptr var v1 TTcl_Size var _ /* callargs at bp+8 */ [2]uintptr var _ /* loaded at bp+0 */ int32 _, _, _, _, _ = _objPtr, nval, prev, v1, v2 /* if cached (if already setup this one) */ if timezoneObj == *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_GMT)*8)) && (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtSetupTZData != libc.UintptrFromInt32(0) { return timezoneObj } if (timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone || timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm) && (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone != libc.UintptrFromInt32(0) { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZone } if (timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone || timezoneObj == (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZoneUnnorm) && (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone != libc.UintptrFromInt32(0) { return (*TClockClientData)(unsafe.Pointer(dataPtr)).FprevSetupTimeZone } /* differentiate normalized (last, GMT and system) zones, because used often and already set */ (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)] = _NormTimezoneObj(tls, dataPtr, timezoneObj, bp) /* if loaded (setup already called for this TZ) */ if *(*int32)(unsafe.Pointer(bp)) != 0 { return (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)] } /* before setup just take a look in TZData variable */ if XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_TZDATA)*8)), timezoneObj, 0) != 0 { /* put it to last slot and return normalized */ _TimezoneLoaded(tls, dataPtr, (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)], timezoneObj) return (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)] } /* setup now */ (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0] = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_SETUPTIMEZONE)*8)) if XTcl_EvalObjv(tls, interp, int64(2), bp+8, 0) == TCL_OK { /* save unnormalized last used */ nval = timezoneObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastSetupTimeZoneUnnorm)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } return (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)] } return libc.UintptrFromInt32(0) } /* *---------------------------------------------------------------------- * * ClockFormatNumericTimeZone -- * * Formats a time zone as +hhmmss * * Parameters: * z - Time zone in seconds east of Greenwich * * Results: * Returns the time zone object (formatted in a numeric form) * * Side effects: * None. * *---------------------------------------------------------------------- */ func XClockFormatNumericTimeZone(tls *libc.TLS, z int32) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var p uintptr var _ /* buf at bp+0 */ [13]uint8 _ = p if z < 0 { z = -z *(*uint8)(unsafe.Pointer(bp)) = uint8('-') } else { *(*uint8)(unsafe.Pointer(bp)) = uint8('+') } XTclItoAw(tls, bp+uintptr(1), z/int32(3600), uint8('0'), uint16(2)) z %= int32(3600) p = XTclItoAw(tls, bp+uintptr(3), z/int32(60), uint8('0'), uint16(2)) z %= int32(60) if z != 0 { p = XTclItoAw(tls, bp+uintptr(5), z, uint8('0'), uint16(2)) } return XTcl_NewStringObj(tls, bp, int64(p)-T__predefined_ptrdiff_t(bp)) } /* *---------------------------------------------------------------------- * * ClockConvertlocaltoutcObjCmd -- * * Tcl command that converts a UTC time to a local time by whatever means * is available. * * Usage: * ::tcl::clock::ConvertUTCToLocal dictionary timezone changeover * * Parameters: * dict - Dictionary containing a 'localSeconds' entry. * timezone - Time zone * changeover - Julian Day of the adoption of the Gregorian calendar. * * Results: * Returns a standard Tcl result. * * Side effects: * On success, sets the interpreter result to the given dictionary * augmented with a 'seconds' field giving the UTC time. On failure, * leaves an error message in the interpreter result. * *---------------------------------------------------------------------- */ func _ClockConvertlocaltoutcObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) /* Parameter vector */ var _objPtr, dataPtr, dict, v5 uintptr var created, status, v1, v2 int32 var v3 bool var v4 TTcl_Size var _ /* changeover at bp+8 */ int32 var _ /* fields at bp+16 */ TTclDateFields var _ /* secondsObj at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _ = _objPtr, created, dataPtr, dict, status, v1, v2, v3, v4, v5 dataPtr = clientData created = 0 (*(*TTclDateFields)(unsafe.Pointer(bp + 16))).FtzName = libc.UintptrFromInt32(0) /* * Check params and convert time. */ if objc != int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+12834) return int32(TCL_ERROR) } dict = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if XTcl_DictObjGet(tls, interp, dict, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_LOCALSECONDS)*8)), bp) != TCL_OK { return int32(TCL_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+12859, int64(-libc.Int32FromInt32(1)))) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 16 + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+16+8) } if v3 = v1 != TCL_OK; !v3 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep))) v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+8) } } if v3 || v2 != TCL_OK || _ConvertLocalToUTC(tls, dataPtr, interp, bp+16, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp + 8))) != 0 { return int32(TCL_ERROR) } /* * Copy-on-write; set the 'seconds' field in the dictionary and place the * modified dictionary in the interpreter result. */ if (*TTcl_Obj)(unsafe.Pointer(dict)).FrefCount > int64(1) { dict = XTcl_DuplicateObj(tls, dict) created = int32(1) (*TTcl_Obj)(unsafe.Pointer(dict)).FrefCount++ } status = XTcl_DictObjPut(tls, interp, dict, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_SECONDS)*8)), XTcl_NewWideIntObj(tls, (*(*TTclDateFields)(unsafe.Pointer(bp + 16))).Fseconds)) if status == TCL_OK { XTcl_SetObjResult(tls, interp, dict) } if created != 0 { _objPtr = dict v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return status } /* *---------------------------------------------------------------------- * * ClockGetdatefieldsObjCmd -- * * Tcl command that determines the values that [clock format] will use in * formatting a date, and populates a dictionary with them. * * Usage: * ::tcl::clock::GetDateFields seconds timezone changeover * * Parameters: * seconds - Time expressed in seconds from the Posix epoch. * timezone - Time zone in which time is to be expressed. * changeover - Julian Day Number at which the current locale adopted * the Gregorian calendar * * Results: * Returns a dictonary populated with the fields: * seconds - Seconds from the Posix epoch * localSeconds - Nominal seconds from the Posix epoch in the * local time zone. * tzOffset - Time zone offset in seconds east of Greenwich * tzName - Time zone name * julianDay - Julian Day Number in the local time zone * *---------------------------------------------------------------------- */ func _ClockGetdatefieldsObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) /* Parameter vector */ var _objPtr, dataPtr, dict, lit, v5 uintptr var v1, v2, v6 int32 var v3 bool var v4 TTcl_Size var _ /* changeover at bp+112 */ int32 var _ /* fields at bp+0 */ TTclDateFields _, _, _, _, _, _, _, _, _, _ = _objPtr, dataPtr, dict, lit, v1, v2, v3, v4, v5, v6 dataPtr = clientData lit = (*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals (*(*TTclDateFields)(unsafe.Pointer(bp))).FtzName = libc.UintptrFromInt32(0) /* * Check params. */ if objc != int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+12902) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } if v3 = v1 != TCL_OK; !v3 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp + 112)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep))) v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+112) } } if v3 || v2 != TCL_OK { return int32(TCL_ERROR) } /* * fields.seconds could be an unsigned number that overflowed. Make sure * that it isn't. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_INTEGER_VALUE_TOO_LARGE)*8))) return int32(TCL_ERROR) } /* Extract fields */ if _ClockGetDateFields(tls, dataPtr, interp, bp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*int32)(unsafe.Pointer(bp + 112))) != TCL_OK { return int32(TCL_ERROR) } /* Make dict of fields */ dict = XTcl_NewDictObj(tls) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_LOCALSECONDS)*8)), XTcl_NewWideIntObj(tls, (*(*TTclDateFields)(unsafe.Pointer(bp))).FlocalSeconds)) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_SECONDS)*8)), XTcl_NewWideIntObj(tls, (*(*TTclDateFields)(unsafe.Pointer(bp))).Fseconds)) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_TZNAME)*8)), (*(*TTclDateFields)(unsafe.Pointer(bp))).FtzName) _objPtr = (*(*TTclDateFields)(unsafe.Pointer(bp))).FtzName v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_TZOFFSET)*8)), XTcl_NewWideIntObj(tls, int64((*(*TTclDateFields)(unsafe.Pointer(bp))).FtzOffset))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_JULIANDAY)*8)), XTcl_NewWideIntObj(tls, (*(*TTclDateFields)(unsafe.Pointer(bp))).FjulianDay)) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_GREGORIAN)*8)), XTcl_NewWideIntObj(tls, int64((*(*TTclDateFields)(unsafe.Pointer(bp))).Fgregorian))) if (*(*TTclDateFields)(unsafe.Pointer(bp))).FisBce != 0 { v6 = int32(LIT_BCE) } else { v6 = int32(LIT_CE) } XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_ERA)*8)), *(*uintptr)(unsafe.Pointer(lit + uintptr(v6)*8))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_YEAR)*8)), XTcl_NewWideIntObj(tls, int64((*(*TTclDateFields)(unsafe.Pointer(bp))).Fyear))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_DAYOFYEAR)*8)), XTcl_NewWideIntObj(tls, int64((*(*TTclDateFields)(unsafe.Pointer(bp))).FdayOfYear))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_MONTH)*8)), XTcl_NewWideIntObj(tls, int64((*(*TTclDateFields)(unsafe.Pointer(bp))).Fmonth))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_DAYOFMONTH)*8)), XTcl_NewWideIntObj(tls, int64((*(*TTclDateFields)(unsafe.Pointer(bp))).FdayOfMonth))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_ISO8601YEAR)*8)), XTcl_NewWideIntObj(tls, int64((*(*TTclDateFields)(unsafe.Pointer(bp))).Fiso8601Year))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_ISO8601WEEK)*8)), XTcl_NewWideIntObj(tls, int64((*(*TTclDateFields)(unsafe.Pointer(bp))).Fiso8601Week))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_DAYOFWEEK)*8)), XTcl_NewWideIntObj(tls, int64((*(*TTclDateFields)(unsafe.Pointer(bp))).FdayOfWeek))) XTcl_SetObjResult(tls, interp, dict) return TCL_OK } /* *---------------------------------------------------------------------- * * ClockGetDateFields -- * * Converts given UTC time (seconds in a TclDateFields structure) * to local time and determines the values that clock routines will * use in scanning or formatting a date. * * Results: * Date-time values are stored in structure "fields". * Returns a standard Tcl result. * *---------------------------------------------------------------------- */ func _ClockGetDateFields(tls *libc.TLS, dataPtr uintptr, interp uintptr, fields uintptr, timezoneObj uintptr, changeover int32) (r int32) { /* Julian Day Number */ /* * Convert UTC time to local. */ if XConvertUTCToLocal(tls, dataPtr, interp, fields, timezoneObj, changeover) != TCL_OK { return int32(TCL_ERROR) } /* * Extract Julian day and seconds of the day. */ (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay = (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds + libc.Int64FromInt32(JULIAN_DAY_POSIX_EPOCH)*libc.Int64FromInt32(SECONDS_PER_DAY) if (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay >= int64(SECONDS_PER_DAY) || (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay <= int64(-int32(SECONDS_PER_DAY)) { *(*TTcl_WideInt)(unsafe.Pointer(fields + 24)) /= int64(SECONDS_PER_DAY) (*TTclDateFields)(unsafe.Pointer(fields)).FsecondOfDay = int64(int32((*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds % libc.Int64FromInt32(SECONDS_PER_DAY))) } else { (*TTclDateFields)(unsafe.Pointer(fields)).FsecondOfDay = int64(int32((*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay)) (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay = libc.Int64FromInt32(0) } if (*TTclDateFields)(unsafe.Pointer(fields)).FsecondOfDay < 0 { *(*TTcl_WideInt)(unsafe.Pointer(fields + 88)) += int64(SECONDS_PER_DAY) /* JD is affected, if switched into negative (avoid 24 hours difference) */ if (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay <= 0 { (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay-- } } /* * Convert to Julian or Gregorian calendar. */ _GetGregorianEraYearDay(tls, fields, changeover) _GetMonthDay(tls, fields) _GetYearWeekDay(tls, fields, changeover) return TCL_OK } /* *---------------------------------------------------------------------- * * ClockGetjuliandayfromerayearmonthdayObjCmd -- * * Tcl command that converts a time from era-year-month-day to a Julian * Day Number. * * Parameters: * dict - Dictionary that contains 'era', 'year', 'month' and * 'dayOfMonth' keys. * changeover - Julian Day of changeover to the Gregorian calendar * * Results: * Result is either TCL_OK, with the interpreter result being the * dictionary augmented with a 'julianDay' key, or TCL_ERROR, * with the result being an error message. * *---------------------------------------------------------------------- */ func _FetchEraField(tls *libc.TLS, interp uintptr, dict uintptr, key uintptr, storePtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* value at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) if XTcl_DictObjGet(tls, interp, dict, key, bp) != TCL_OK { return int32(TCL_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+12930, int64(-libc.Int32FromInt32(1)))) return int32(TCL_ERROR) } return XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), uintptr(unsafe.Pointer(&_eras)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11718, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(storePtr)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FinternalRep))) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), storePtr) } return v1 } func _ClockGetjuliandayfromerayearmonthdayObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) /* Parameter vector */ var _objPtr, data, dict, lit, v4 uintptr var copied, status, v1 int32 var v2 bool var v3 TTcl_Size var _ /* changeover at bp+112 */ int32 var _ /* fields at bp+0 */ TTclDateFields var _ /* isBce at bp+116 */ int32 _, _, _, _, _, _, _, _, _, _ = _objPtr, copied, data, dict, lit, status, v1, v2, v3, v4 data = clientData lit = (*TClockClientData)(unsafe.Pointer(data)).Fliterals copied = 0 *(*int32)(unsafe.Pointer(bp + 116)) = 0 (*(*TTclDateFields)(unsafe.Pointer(bp))).FtzName = libc.UintptrFromInt32(0) /* * Check params. */ if objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+12970) return int32(TCL_ERROR) } dict = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if v2 = _FetchEraField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_ERA)*8)), bp+116) != TCL_OK || _FetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_YEAR)*8)), bp+40) != TCL_OK || _FetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_MONTH)*8)), bp+48) != TCL_OK || _FetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_DAYOFMONTH)*8)), bp+52) != TCL_OK; !v2 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp + 112)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep))) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+112) } } if v2 || v1 != TCL_OK { return int32(TCL_ERROR) } (*(*TTclDateFields)(unsafe.Pointer(bp))).FisBce = *(*int32)(unsafe.Pointer(bp + 116)) /* * Get Julian day. */ XGetJulianDayFromEraYearMonthDay(tls, bp, *(*int32)(unsafe.Pointer(bp + 112))) /* * Store Julian day in the dictionary - copy on write. */ if (*TTcl_Obj)(unsafe.Pointer(dict)).FrefCount > int64(1) { dict = XTcl_DuplicateObj(tls, dict) (*TTcl_Obj)(unsafe.Pointer(dict)).FrefCount++ copied = int32(1) } status = XTcl_DictObjPut(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_JULIANDAY)*8)), XTcl_NewWideIntObj(tls, (*(*TTclDateFields)(unsafe.Pointer(bp))).FjulianDay)) if status == TCL_OK { XTcl_SetObjResult(tls, interp, dict) } if copied != 0 { _objPtr = dict v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return status } /* *---------------------------------------------------------------------- * * ClockGetjuliandayfromerayearweekdayObjCmd -- * * Tcl command that converts a time from the ISO calendar to a Julian Day * Number. * * Parameters: * dict - Dictionary that contains 'era', 'iso8601Year', 'iso8601Week' * and 'dayOfWeek' keys. * changeover - Julian Day of changeover to the Gregorian calendar * * Results: * Result is either TCL_OK, with the interpreter result being the * dictionary augmented with a 'julianDay' key, or TCL_ERROR, with the * result being an error message. * *---------------------------------------------------------------------- */ func _ClockGetjuliandayfromerayearweekdayObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) /* Parameter vector */ var _objPtr, data, dict, lit, v4 uintptr var copied, status, v1 int32 var v2 bool var v3 TTcl_Size var _ /* changeover at bp+112 */ int32 var _ /* fields at bp+0 */ TTclDateFields var _ /* isBce at bp+116 */ int32 _, _, _, _, _, _, _, _, _, _ = _objPtr, copied, data, dict, lit, status, v1, v2, v3, v4 data = clientData lit = (*TClockClientData)(unsafe.Pointer(data)).Fliterals copied = 0 *(*int32)(unsafe.Pointer(bp + 116)) = 0 (*(*TTclDateFields)(unsafe.Pointer(bp))).FtzName = libc.UintptrFromInt32(0) /* * Check params. */ if objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+12970) return int32(TCL_ERROR) } dict = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if v2 = _FetchEraField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_ERA)*8)), bp+116) != TCL_OK || _FetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_ISO8601YEAR)*8)), bp+56) != TCL_OK || _FetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_ISO8601WEEK)*8)), bp+60) != TCL_OK || _FetchIntField(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_DAYOFWEEK)*8)), bp+64) != TCL_OK; !v2 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp + 112)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep))) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+112) } } if v2 || v1 != TCL_OK { return int32(TCL_ERROR) } (*(*TTclDateFields)(unsafe.Pointer(bp))).FisBce = *(*int32)(unsafe.Pointer(bp + 116)) /* * Get Julian day. */ XGetJulianDayFromEraYearWeekDay(tls, bp, *(*int32)(unsafe.Pointer(bp + 112))) /* * Store Julian day in the dictionary - copy on write. */ if (*TTcl_Obj)(unsafe.Pointer(dict)).FrefCount > int64(1) { dict = XTcl_DuplicateObj(tls, dict) (*TTcl_Obj)(unsafe.Pointer(dict)).FrefCount++ copied = int32(1) } status = XTcl_DictObjPut(tls, interp, dict, *(*uintptr)(unsafe.Pointer(lit + uintptr(LIT_JULIANDAY)*8)), XTcl_NewWideIntObj(tls, (*(*TTclDateFields)(unsafe.Pointer(bp))).FjulianDay)) if status == TCL_OK { XTcl_SetObjResult(tls, interp, dict) } if copied != 0 { _objPtr = dict v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return status } /* *---------------------------------------------------------------------- * * ConvertLocalToUTC -- * * Converts a time (in a TclDateFields structure) from the local wall * clock to UTC. * * Results: * Returns a standard Tcl result. * * Side effects: * Populates the 'seconds' field if successful; stores an error message * in the interpreter result on failure. * *---------------------------------------------------------------------- */ func _ConvertLocalToUTC(tls *libc.TLS, dataPtr uintptr, interp uintptr, fields uintptr, timezoneObj uintptr, changeover int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Julian Day of the Gregorian transition */ var _objPtr, _objPtr1, _objPtr2, ltzoc, nval, prev, tzdata, v10, v6, v8 uintptr var seconds TTcl_WideInt var v2 int32 var v3, v4 int64 var v5, v7, v9 TTcl_Size var _ /* rangesVal at bp+16 */ [2]TTcl_WideInt var _ /* rowc at bp+0 */ TTcl_Size var _ /* rowv at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, ltzoc, nval, prev, seconds, tzdata, v10, v2, v3, v4, v5, v6, v7, v8, v9 ltzoc = libc.UintptrFromInt32(0) /* fast phase-out for shared GMT-object (don't need to convert UTC 2 UTC) */ if timezoneObj == *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_GMT)*8)) { (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds = (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset = 0 return TCL_OK } /* * Check cacheable conversion could be used * (last-period UTC2Local cache within the same TZ and seconds) */ *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 for { if !(*(*TTcl_Size)(unsafe.Pointer(bp)) < int64(2)) { break } ltzoc = dataPtr + 368 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*56 if timezoneObj != (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtimezoneObj || changeover != (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).Fchangeover { ltzoc = libc.UintptrFromInt32(0) goto _1 } seconds = (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds - int64((*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzOffset) if seconds >= *(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24)) && seconds < *(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24 + 1*8)) { /* the same time zone and offset (UTC time inside the last minute) */ (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset = (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzOffset (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds = seconds return TCL_OK } /* in the DST-hole (because of the check above) - correct localSeconds */ if (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds == (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FlocalSeconds { /* the same time zone and offset (but we'll shift local-time) */ (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset = (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzOffset (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds = seconds goto dstHole } goto _1 _1: ; *(*TTcl_Size)(unsafe.Pointer(bp))++ } /* * Unpack the tz data. */ tzdata = _ClockGetTZData(tls, dataPtr, interp, timezoneObj) if tzdata == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(tzdata)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2)).FspanStart } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr1 + 40 + uintptr(v3)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2)).FspanLength } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v4 v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_ListObjGetElements(tls, interp, tzdata, bp, bp+8) } if v2 != TCL_OK { return int32(TCL_ERROR) } /* * Special case: If the time zone is :localtime, the tzdata will be empty. * Use 'mktime' to convert the time to local */ if *(*TTcl_Size)(unsafe.Pointer(bp)) == 0 { if _ConvertLocalToUTCUsingC(tls, interp, fields, changeover) != TCL_OK { return int32(TCL_ERROR) } /* we cannot cache (ranges unknown yet) - todo: check later the DST-hole here */ return TCL_OK } else { if _ConvertLocalToUTCUsingTable(tls, interp, fields, int32(*(*TTcl_Size)(unsafe.Pointer(bp))), *(*uintptr)(unsafe.Pointer(bp + 8)), bp+16) != TCL_OK { return int32(TCL_ERROR) } seconds = (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds /* Cache the last conversion */ if ltzoc != libc.UintptrFromInt32(0) { /* slot was found above */ /* timezoneObj and changeover are the same */ nval = (*TTclDateFields)(unsafe.Pointer(fields)).FtzName if (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName != nval { prev = (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName = nval if (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } /* may be NULL */ } else { /* no TZ in cache - just move second slot down and use the first one */ ltzoc = dataPtr + 368 if (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtimezoneObj != libc.UintptrFromInt32(0) { _objPtr1 = (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtimezoneObj v8 = _objPtr1 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr1) } (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtimezoneObj = libc.UintptrFromInt32(0) } if (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtzName != libc.UintptrFromInt32(0) { _objPtr2 = (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtzName v10 = _objPtr2 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr2) } (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtzName = libc.UintptrFromInt32(0) } libc.Xmemcpy(tls, dataPtr+368+1*56, ltzoc, uint64(56)) (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtimezoneObj = timezoneObj if (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtimezoneObj != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtimezoneObj)).FrefCount++ } (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).Fchangeover = changeover (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName = (*TTclDateFields)(unsafe.Pointer(fields)).FtzName if (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName)).FrefCount++ } /* may be NULL */ } (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FlocalSeconds = (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds *(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24)) = (*(*[2]TTcl_WideInt)(unsafe.Pointer(bp + 16)))[0] *(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24 + 1*8)) = (*(*[2]TTcl_WideInt)(unsafe.Pointer(bp + 16)))[int32(1)] (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzOffset = (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset } /* check DST-hole: if retrieved seconds is out of range */ if !(*(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24)) > seconds || seconds >= *(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24 + 1*8))) { goto _11 } goto dstHole dstHole: ; /* because we don't know real TZ (we're outsize), just invalidate local * time (which could be verified in ClockValidDate later) */ (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds = -libc.Int64FromInt64(0x00F0000000000000) - libc.Int64FromInt32(1) /* not valid seconds */ _11: ; return TCL_OK } /* *---------------------------------------------------------------------- * * ConvertLocalToUTCUsingTable -- * * Converts a time (in a TclDateFields structure) from local time in a * given time zone to UTC. * * Results: * Returns a standard Tcl result. * * Side effects: * Stores an error message in the interpreter if an error occurs; if * successful, stores the 'seconds' field in 'fields. * *---------------------------------------------------------------------- */ func _ConvertLocalToUTCUsingTable(tls *libc.TLS, interp uintptr, fields uintptr, rowc int32, rowv uintptr, rangesVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Return bounds for time period */ var _objPtr, nval, prev, row, v10 uintptr var have [8]struct { FtzName uintptr FtzOffset int32 } var i, v9 TTcl_Size var nHave, v1, v5, v8 int32 var v2, v3 int64 var v4, v6 bool var _ /* cellc at bp+0 */ TTcl_Size var _ /* cellv at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, have, i, nHave, nval, prev, row, v1, v10, v2, v3, v4, v5, v6, v8, v9 nHave = 0 /* * Perform an initial lookup assuming that local == UTC, and locate the * last time conversion prior to that time. Get the offset from that row, * and look up again. Continue until we find an offset that we found * before. This definition, rather than "the same offset" ensures that we * don't enter an endless loop, as would otherwise happen when trying to * convert a non-existent time such as 02:30 during the US Spring Daylight * Saving Time transition. */ (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset = 0 (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds = (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds for int32(1) != 0 { row = XLookupLastTransition(tls, interp, (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds, int64(rowc), rowv, rangesVal) if v4 = row == libc.UintptrFromInt32(0); !v4 { if (*TTcl_Obj)(unsafe.Pointer(row)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v3 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjGetElements(tls, interp, row, bp, bp+8) } } if v6 = v4 || v1 != TCL_OK; !v6 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(fields + 16)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)))).FinternalRep))) v5 = libc.Int32FromInt32(TCL_OK) } else { v5 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)), fields+16) } } if v6 || v5 != TCL_OK { return int32(TCL_ERROR) } i = 0 for { if !(i < int64(nHave)) { break } if have[i].FtzOffset == (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset { goto found } goto _7 _7: ; i++ } if nHave == int32(8) { XTcl_Panic(tls, __ccgo_ts+12986, 0) } have[nHave].FtzName = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 3*8)) v8 = nHave nHave++ have[v8].FtzOffset = (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds = (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds - int64((*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset) } goto found found: ; (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset = have[i].FtzOffset (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds = (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds - int64((*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset) nval = have[i].FtzName if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != nval { prev = (*TTclDateFields)(unsafe.Pointer(fields)).FtzName (*TTclDateFields)(unsafe.Pointer(fields)).FtzName = nval if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TTclDateFields)(unsafe.Pointer(fields)).FtzName)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v10 = _objPtr v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } return TCL_OK } /* *---------------------------------------------------------------------- * * ConvertLocalToUTCUsingC -- * * Converts a time from local wall clock to UTC when the local time zone * cannot be determined. Uses 'mktime' to do the job. * * Results: * Returns a standard Tcl result. * * Side effects: * Stores an error message in the interpreter if an error occurs; if * successful, stores the 'seconds' field in 'fields. * *---------------------------------------------------------------------- */ func _ConvertLocalToUTCUsingC(tls *libc.TLS, interp uintptr, fields uintptr, changeover int32) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Julian Day of the Gregorian transition */ var localErrno, secondOfDay, v1 int32 var _ /* timeVal at bp+0 */ Ttm _, _, _ = localErrno, secondOfDay, v1 /* * Convert the given time to a date. */ (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay = (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds + libc.Int64FromInt32(JULIAN_DAY_POSIX_EPOCH)*libc.Int64FromInt32(SECONDS_PER_DAY) if (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay >= int64(SECONDS_PER_DAY) || (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay <= int64(-int32(SECONDS_PER_DAY)) { *(*TTcl_WideInt)(unsafe.Pointer(fields + 24)) /= int64(SECONDS_PER_DAY) secondOfDay = int32((*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds % libc.Int64FromInt32(SECONDS_PER_DAY)) } else { secondOfDay = int32((*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay) (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay = libc.Int64FromInt32(0) } if secondOfDay < 0 { secondOfDay += int32(SECONDS_PER_DAY) /* JD is affected, if switched into negative (avoid 24 hours difference) */ if (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay <= 0 { (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay-- } } _GetGregorianEraYearDay(tls, fields, changeover) _GetMonthDay(tls, fields) /* * Convert the date/time to a 'struct tm'. */ (*(*Ttm)(unsafe.Pointer(bp))).Ftm_year = (*TTclDateFields)(unsafe.Pointer(fields)).Fyear - int32(1900) (*(*Ttm)(unsafe.Pointer(bp))).Ftm_mon = (*TTclDateFields)(unsafe.Pointer(fields)).Fmonth - int32(1) (*(*Ttm)(unsafe.Pointer(bp))).Ftm_mday = (*TTclDateFields)(unsafe.Pointer(fields)).FdayOfMonth (*(*Ttm)(unsafe.Pointer(bp))).Ftm_hour = secondOfDay / int32(3600) % int32(24) (*(*Ttm)(unsafe.Pointer(bp))).Ftm_min = secondOfDay / int32(60) % int32(60) (*(*Ttm)(unsafe.Pointer(bp))).Ftm_sec = secondOfDay % int32(60) (*(*Ttm)(unsafe.Pointer(bp))).Ftm_isdst = -int32(1) (*(*Ttm)(unsafe.Pointer(bp))).Ftm_wday = -int32(1) (*(*Ttm)(unsafe.Pointer(bp))).Ftm_yday = -int32(1) /* * Get local time. It is rumored that mktime is not thread safe on some * platforms, so seize a mutex before attempting this. */ _TzsetIfNecessary(tls) XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_clockMutex))) *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0 (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds = int64(libc.Xmktime(tls, bp)) if (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds == int64(-int32(1)) { v1 = *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) } else { v1 = 0 } localErrno = v1 XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_clockMutex))) /* * If conversion fails, report an error. */ if localErrno != 0 || (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds == int64(-int32(1)) && (*(*Ttm)(unsafe.Pointer(bp))).Ftm_yday == -int32(1) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+13022, int64(-libc.Int32FromInt32(1)))) return int32(TCL_ERROR) } return TCL_OK } /* *---------------------------------------------------------------------- * * ConvertUTCToLocal -- * * Converts a time (in a TclDateFields structure) from UTC to local time. * * Results: * Returns a standard Tcl result. * * Side effects: * Populates the 'tzName' and 'tzOffset' fields. * *---------------------------------------------------------------------- */ func XConvertUTCToLocal(tls *libc.TLS, dataPtr uintptr, interp uintptr, fields uintptr, timezoneObj uintptr, changeover int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Julian Day of the Gregorian transition */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, ltzoc, nval, nval1, nval2, nval3, prev, prev1, prev2, prev3, tzdata, v10, v15, v17, v19, v5, v7 uintptr var v1, v11 int32 var v12, v13, v2, v3 int64 var v14, v16, v18, v4, v6, v9 TTcl_Size var _ /* rangesVal at bp+24 */ [2]TTcl_WideInt var _ /* rowc at bp+0 */ TTcl_Size var _ /* rowv at bp+8 */ uintptr var _ /* tzName at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, ltzoc, nval, nval1, nval2, nval3, prev, prev1, prev2, prev3, tzdata, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v3, v4, v5, v6, v7, v9 /* Pointers to the rows */ ltzoc = libc.UintptrFromInt32(0) /* fast phase-out for shared GMT-object (don't need to convert UTC 2 UTC) */ if timezoneObj == *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_GMT)*8)) { (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds = (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset = 0 if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtTZName == libc.UintptrFromInt32(0) { tzdata = _ClockGetTZData(tls, dataPtr, interp, timezoneObj) if (*TTcl_Obj)(unsafe.Pointer(tzdata)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v3 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjGetElements(tls, interp, tzdata, bp, bp+8) } if v1 != TCL_OK || XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))), int64(3), bp+16) != TCL_OK { return int32(TCL_ERROR) } nval = *(*uintptr)(unsafe.Pointer(bp + 16)) if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtTZName != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtTZName (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtTZName = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtTZName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtTZName)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } } nval1 = (*TClockClientData)(unsafe.Pointer(dataPtr)).FgmtTZName if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != nval1 { prev1 = (*TTclDateFields)(unsafe.Pointer(fields)).FtzName (*TTclDateFields)(unsafe.Pointer(fields)).FtzName = nval1 if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TTclDateFields)(unsafe.Pointer(fields)).FtzName)).FrefCount++ } if prev1 != libc.UintptrFromInt32(0) { _objPtr1 = prev1 v7 = _objPtr1 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } } return TCL_OK } /* * Check cacheable conversion could be used * (last-period UTC2Local cache within the same TZ and seconds) */ *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 for { if !(*(*TTcl_Size)(unsafe.Pointer(bp)) < int64(2)) { break } ltzoc = dataPtr + 368 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*56 if timezoneObj != (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtimezoneObj || changeover != (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).Fchangeover { ltzoc = libc.UintptrFromInt32(0) goto _8 } if (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds >= *(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24)) && (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds < *(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24 + 1*8)) { /* the same time zone and offset (UTC time inside the last minute) */ (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset = (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzOffset (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds = (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds + int64((*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset) nval2 = (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != nval2 { prev2 = (*TTclDateFields)(unsafe.Pointer(fields)).FtzName (*TTclDateFields)(unsafe.Pointer(fields)).FtzName = nval2 if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TTclDateFields)(unsafe.Pointer(fields)).FtzName)).FrefCount++ } if prev2 != libc.UintptrFromInt32(0) { _objPtr2 = prev2 v10 = _objPtr2 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } } return TCL_OK } goto _8 _8: ; *(*TTcl_Size)(unsafe.Pointer(bp))++ } /* * Unpack the tz data. */ tzdata = _ClockGetTZData(tls, dataPtr, interp, timezoneObj) if tzdata == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(tzdata)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2 != 0 { v12 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2)).FspanStart } else { v12 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr1 + 40 + uintptr(v12)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2 != 0 { v13 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr2)).FspanLength } else { v13 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tzdata + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v13 v11 = libc.Int32FromInt32(TCL_OK) } else { v11 = XTcl_ListObjGetElements(tls, interp, tzdata, bp, bp+8) } if v11 != TCL_OK { return int32(TCL_ERROR) } /* * Special case: If the time zone is :localtime, the tzdata will be empty. * Use 'localtime' to convert the time to local */ if *(*TTcl_Size)(unsafe.Pointer(bp)) == 0 { if _ConvertUTCToLocalUsingC(tls, interp, fields, changeover) != TCL_OK { return int32(TCL_ERROR) } /* signal we need to revalidate TZ epoch next time fields gets used. */ *(*int32)(unsafe.Pointer(fields + 96)) |= int32(CLF_CTZ) /* we cannot cache (ranges unknown yet) */ } else { if _ConvertUTCToLocalUsingTable(tls, interp, fields, *(*TTcl_Size)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), bp+24) != TCL_OK { return int32(TCL_ERROR) } /* converted using table (TZ isn't :localtime) */ *(*int32)(unsafe.Pointer(fields + 96)) &= ^int32(CLF_CTZ) /* Cache the last conversion */ if ltzoc != libc.UintptrFromInt32(0) { /* slot was found above */ /* timezoneObj and changeover are the same */ nval3 = (*TTclDateFields)(unsafe.Pointer(fields)).FtzName if (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName != nval3 { prev3 = (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName = nval3 if (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName)).FrefCount++ } if prev3 != libc.UintptrFromInt32(0) { _objPtr3 = prev3 v15 = _objPtr3 v14 = *(*TTcl_Size)(unsafe.Pointer(v15)) *(*TTcl_Size)(unsafe.Pointer(v15))-- if v14 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } } } else { /* no TZ in cache - just move second slot down and use the first one */ ltzoc = dataPtr + 368 if (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtimezoneObj != libc.UintptrFromInt32(0) { _objPtr4 = (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtimezoneObj v17 = _objPtr4 v16 = *(*TTcl_Size)(unsafe.Pointer(v17)) *(*TTcl_Size)(unsafe.Pointer(v17))-- if v16 <= int64(1) { XTclFreeObj(tls, _objPtr4) } (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtimezoneObj = libc.UintptrFromInt32(0) } if (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtzName != libc.UintptrFromInt32(0) { _objPtr5 = (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtzName v19 = _objPtr5 v18 = *(*TTcl_Size)(unsafe.Pointer(v19)) *(*TTcl_Size)(unsafe.Pointer(v19))-- if v18 <= int64(1) { XTclFreeObj(tls, _objPtr5) } (*(*TClockLastTZOffs)(unsafe.Pointer(dataPtr + 368 + 1*56))).FtzName = libc.UintptrFromInt32(0) } libc.Xmemcpy(tls, dataPtr+368+1*56, ltzoc, uint64(56)) (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtimezoneObj = timezoneObj if (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtimezoneObj != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtimezoneObj)).FrefCount++ } (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).Fchangeover = changeover (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName = (*TTclDateFields)(unsafe.Pointer(fields)).FtzName if (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzName)).FrefCount++ } } (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FlocalSeconds = (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds *(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24)) = (*(*[2]TTcl_WideInt)(unsafe.Pointer(bp + 24)))[0] *(*TTcl_WideInt)(unsafe.Pointer(ltzoc + 24 + 1*8)) = (*(*[2]TTcl_WideInt)(unsafe.Pointer(bp + 24)))[int32(1)] (*TClockLastTZOffs)(unsafe.Pointer(ltzoc)).FtzOffset = (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset } return TCL_OK } /* *---------------------------------------------------------------------- * * ConvertUTCToLocalUsingTable -- * * Converts UTC to local time, given a table of transition points * * Results: * Returns a standard Tcl result * * Side effects: * On success, fills fields->tzName, fields->tzOffset and * fields->localSeconds. On failure, places an error message in the * interpreter result. * *---------------------------------------------------------------------- */ func _ConvertUTCToLocalUsingTable(tls *libc.TLS, interp uintptr, fields uintptr, rowc TTcl_Size, rowv uintptr, rangesVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Return bounds for time period */ var _objPtr, nval, prev, row, v8 uintptr var v1, v5 int32 var v2, v3 int64 var v4, v6 bool var v7 TTcl_Size var _ /* cellc at bp+0 */ TTcl_Size var _ /* cellv at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, nval, prev, row, v1, v2, v3, v4, v5, v6, v7, v8 /* Pointers to the cells */ /* * Look up the nearest transition time. */ row = XLookupLastTransition(tls, interp, (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds, rowc, rowv, rangesVal) if v4 = row == libc.UintptrFromInt32(0); !v4 { if (*TTcl_Obj)(unsafe.Pointer(row)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(row + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v3 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjGetElements(tls, interp, row, bp, bp+8) } } if v6 = v4 || v1 != TCL_OK; !v6 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(fields + 16)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)))).FinternalRep))) v5 = libc.Int32FromInt32(TCL_OK) } else { v5 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)), fields+16) } } if v6 || v5 != TCL_OK { return int32(TCL_ERROR) } /* * Convert the time. */ nval = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 3*8)) if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != nval { prev = (*TTclDateFields)(unsafe.Pointer(fields)).FtzName (*TTclDateFields)(unsafe.Pointer(fields)).FtzName = nval if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TTclDateFields)(unsafe.Pointer(fields)).FtzName)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v8 = _objPtr v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds = (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds + int64((*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset) return TCL_OK } /* *---------------------------------------------------------------------- * * ConvertUTCToLocalUsingC -- * * Converts UTC to localtime in cases where the local time zone is not * determinable, using the C 'localtime' function to do it. * * Results: * Returns a standard Tcl result. * * Side effects: * On success, fills fields->tzName, fields->tzOffset and * fields->localSeconds. On failure, places an error message in the * interpreter result. * *---------------------------------------------------------------------- */ func _ConvertUTCToLocalUsingC(tls *libc.TLS, interp uintptr, fields uintptr, changeover int32) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Julian Day of the Gregorian transition */ var _objPtr, nval, p, prev, timeVal, v2 uintptr var diff int32 var v1 TTcl_Size var _ /* buffer at bp+8 */ [16]uint8 var _ /* tock at bp+0 */ Ttime_t _, _, _, _, _, _, _, _ = _objPtr, diff, nval, p, prev, timeVal, v1, v2 /* Buffer for time zone name */ /* * Use 'localtime' to determine local year, month, day, time of day. */ *(*Ttime_t)(unsafe.Pointer(bp)) = (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds if *(*Ttime_t)(unsafe.Pointer(bp)) != (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+13062, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+12666, __ccgo_ts+13108, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } _TzsetIfNecessary(tls) timeVal = _ThreadSafeLocalTime(tls, bp) if timeVal == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+13120, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+12666, __ccgo_ts+13187, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Fill in the date in 'fields' and use it to derive Julian Day. */ (*TTclDateFields)(unsafe.Pointer(fields)).FisBce = 0 (*TTclDateFields)(unsafe.Pointer(fields)).Fyear = (*Ttm)(unsafe.Pointer(timeVal)).Ftm_year + int32(1900) (*TTclDateFields)(unsafe.Pointer(fields)).Fmonth = (*Ttm)(unsafe.Pointer(timeVal)).Ftm_mon + int32(1) (*TTclDateFields)(unsafe.Pointer(fields)).FdayOfMonth = (*Ttm)(unsafe.Pointer(timeVal)).Ftm_mday XGetJulianDayFromEraYearMonthDay(tls, fields, changeover) /* * Convert that value to seconds. */ (*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds = (((*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay*int64(24)+int64((*Ttm)(unsafe.Pointer(timeVal)).Ftm_hour))*int64(60)+int64((*Ttm)(unsafe.Pointer(timeVal)).Ftm_min))*int64(60) + int64((*Ttm)(unsafe.Pointer(timeVal)).Ftm_sec) - libc.Int64FromInt32(JULIAN_DAY_POSIX_EPOCH)*libc.Int64FromInt32(SECONDS_PER_DAY) /* * Determine a time zone offset and name; just use +hhmm for the name. */ diff = int32((*TTclDateFields)(unsafe.Pointer(fields)).FlocalSeconds - (*TTclDateFields)(unsafe.Pointer(fields)).Fseconds) (*TTclDateFields)(unsafe.Pointer(fields)).FtzOffset = diff if diff < 0 { *(*uint8)(unsafe.Pointer(bp + 8)) = uint8('-') diff = -diff } else { *(*uint8)(unsafe.Pointer(bp + 8)) = uint8('+') } XTclItoAw(tls, bp+8+uintptr(1), diff/int32(3600), uint8('0'), uint16(2)) diff %= int32(3600) p = XTclItoAw(tls, bp+8+uintptr(3), diff/int32(60), uint8('0'), uint16(2)) diff %= int32(60) if diff != 0 { p = XTclItoAw(tls, bp+8+uintptr(5), diff, uint8('0'), uint16(2)) } nval = XTcl_NewStringObj(tls, bp+8, int64(p)-T__predefined_ptrdiff_t(bp+8)) if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != nval { prev = (*TTclDateFields)(unsafe.Pointer(fields)).FtzName (*TTclDateFields)(unsafe.Pointer(fields)).FtzName = nval if (*TTclDateFields)(unsafe.Pointer(fields)).FtzName != 0 { (*TTcl_Obj)(unsafe.Pointer((*TTclDateFields)(unsafe.Pointer(fields)).FtzName)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } return TCL_OK } /* *---------------------------------------------------------------------- * * LookupLastTransition -- * * Given a UTC time and a tzdata array, looks up the last transition on * or before the given time. * * Results: * Returns a pointer to the row, or NULL if an error occurs. * *---------------------------------------------------------------------- */ func XLookupLastTransition(tls *libc.TLS, interp uintptr, tick TTcl_WideInt, rowc TTcl_Size, rowv uintptr, rangesVal uintptr) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* Return bounds for time period */ var fromVal, toVal, v3 TTcl_WideInt var l, m, u TTcl_Size var v1, v4 int32 var v2, v5 bool var _ /* compObj at bp+0 */ uintptr var _ /* compVal at bp+8 */ TTcl_WideInt _, _, _, _, _, _, _, _, _, _ = fromVal, l, m, toVal, u, v1, v2, v3, v4, v5 fromVal = -libc.Int64FromInt64(0x7fffffffffffffff) - libc.Int64FromInt32(1) toVal = int64(0x7fffffffffffffff) /* * Examine the first row to make sure we're in bounds. */ if v2 = XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(rowv)), 0, bp) != TCL_OK; !v2 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+8) } } if v2 || v1 != TCL_OK { return libc.UintptrFromInt32(0) } /* * Bizarre case - first row doesn't begin at MIN_WIDE_INT. Return it * anyway. */ v3 = *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) fromVal = v3 if tick < v3 { if rangesVal != 0 { *(*TTcl_WideInt)(unsafe.Pointer(rangesVal)) = fromVal *(*TTcl_WideInt)(unsafe.Pointer(rangesVal + 1*8)) = toVal } return *(*uintptr)(unsafe.Pointer(rowv)) } /* * Binary-search to find the transition. */ l = 0 u = rowc - int64(1) for l < u { m = (l + u + int64(1)) / int64(2) if v5 = XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(rowv + uintptr(m)*8)), 0, bp) != TCL_OK; !v5 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), bp+8) } } if v5 || v4 != TCL_OK { return libc.UintptrFromInt32(0) } if tick >= *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) { l = m fromVal = *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) } else { u = m - int64(1) toVal = *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) } } if rangesVal != 0 { *(*TTcl_WideInt)(unsafe.Pointer(rangesVal)) = fromVal *(*TTcl_WideInt)(unsafe.Pointer(rangesVal + 1*8)) = toVal } return *(*uintptr)(unsafe.Pointer(rowv + uintptr(l)*8)) } /* *---------------------------------------------------------------------- * * GetYearWeekDay -- * * Given a date with Julian Calendar Day, compute the year, week, and day * in the ISO8601 calendar. * * Results: * None. * * Side effects: * Stores 'iso8601Year', 'iso8601Week' and 'dayOfWeek' in the date * fields. * *---------------------------------------------------------------------- */ func _GetYearWeekDay(tls *libc.TLS, fields uintptr, changeover int32) { bp := tls.Alloc(112) defer tls.Free(112) /* Julian Day Number of the Gregorian * transition */ var dayOfFiscalYear int32 var _ /* temp at bp+0 */ TTclDateFields _ = dayOfFiscalYear (*(*TTclDateFields)(unsafe.Pointer(bp))).FtzName = libc.UintptrFromInt32(0) /* * Find the given date, minus three days, plus one year. That date's * iso8601 year is an upper bound on the ISO8601 year of the given date. */ (*(*TTclDateFields)(unsafe.Pointer(bp))).FjulianDay = (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay - int64(3) _GetGregorianEraYearDay(tls, bp, changeover) if (*(*TTclDateFields)(unsafe.Pointer(bp))).FisBce != 0 { (*(*TTclDateFields)(unsafe.Pointer(bp))).Fiso8601Year = (*(*TTclDateFields)(unsafe.Pointer(bp))).Fyear - int32(1) } else { (*(*TTclDateFields)(unsafe.Pointer(bp))).Fiso8601Year = (*(*TTclDateFields)(unsafe.Pointer(bp))).Fyear + int32(1) } (*(*TTclDateFields)(unsafe.Pointer(bp))).Fiso8601Week = int32(1) (*(*TTclDateFields)(unsafe.Pointer(bp))).FdayOfWeek = int32(1) XGetJulianDayFromEraYearWeekDay(tls, bp, changeover) /* * temp.julianDay is now the start of an ISO8601 year, either the one * corresponding to the given date, or the one after. If we guessed high, * move one year earlier */ if (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay < (*(*TTclDateFields)(unsafe.Pointer(bp))).FjulianDay { if (*(*TTclDateFields)(unsafe.Pointer(bp))).FisBce != 0 { (*(*TTclDateFields)(unsafe.Pointer(bp))).Fiso8601Year += int32(1) } else { (*(*TTclDateFields)(unsafe.Pointer(bp))).Fiso8601Year -= int32(1) } XGetJulianDayFromEraYearWeekDay(tls, bp, changeover) } (*TTclDateFields)(unsafe.Pointer(fields)).Fiso8601Year = (*(*TTclDateFields)(unsafe.Pointer(bp))).Fiso8601Year dayOfFiscalYear = int32((*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay - (*(*TTclDateFields)(unsafe.Pointer(bp))).FjulianDay) (*TTclDateFields)(unsafe.Pointer(fields)).Fiso8601Week = dayOfFiscalYear/int32(7) + int32(1) (*TTclDateFields)(unsafe.Pointer(fields)).FdayOfWeek = (dayOfFiscalYear + int32(1)) % int32(7) if (*TTclDateFields)(unsafe.Pointer(fields)).FdayOfWeek < int32(1) { /* Mon .. Sun == 1 .. 7 */ *(*int32)(unsafe.Pointer(fields + 64)) += int32(7) } } /* *---------------------------------------------------------------------- * * GetGregorianEraYearDay -- * * Given a Julian Day Number, extracts the year and day of the year and * puts them into TclDateFields, along with the era (BCE or CE) and a * flag indicating whether the date is Gregorian or Julian. * * Results: * None. * * Side effects: * Stores 'era', 'gregorian', 'year', and 'dayOfYear'. * *---------------------------------------------------------------------- */ func _GetGregorianEraYearDay(tls *libc.TLS, fields uintptr, changeover int32) { /* Gregorian transition date */ var day, jday, n, year TTcl_WideInt _, _, _, _ = day, jday, n, year jday = (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay if jday >= int64(changeover) { /* * Gregorian calendar. */ (*TTclDateFields)(unsafe.Pointer(fields)).Fgregorian = int32(1) year = int64(1) /* * n = Number of 400-year cycles since 1 January, 1 CE in the * proleptic Gregorian calendar. day = remaining days. */ day = jday - int64(JDAY_1_JAN_1_CE_GREGORIAN) n = day / int64(FOUR_CENTURIES) day %= int64(FOUR_CENTURIES) if day < 0 { day += int64(FOUR_CENTURIES) n-- } year += int64(400) * n /* * n = number of centuries since the start of (year); * day = remaining days */ n = day / int64(ONE_CENTURY_GREGORIAN) day %= int64(ONE_CENTURY_GREGORIAN) if n > int64(3) { /* * 31 December in the last year of a 400-year cycle. */ n = int64(3) day += int64(ONE_CENTURY_GREGORIAN) } year += int64(100) * n } else { /* * Julian calendar. */ (*TTclDateFields)(unsafe.Pointer(fields)).Fgregorian = 0 year = int64(1) day = jday - int64(JDAY_1_JAN_1_CE_JULIAN) } /* * n = number of 4-year cycles; days = remaining days. */ n = day / int64(FOUR_YEARS) day %= int64(FOUR_YEARS) if day < 0 { day += int64(FOUR_YEARS) n-- } year += int64(4) * n /* * n = number of years; days = remaining days. */ n = day / int64(ONE_YEAR) day %= int64(ONE_YEAR) if n > int64(3) { /* * 31 December of a leap year. */ n = int64(3) day += int64(365) } year += n /* * store era/year/day back into fields. */ if year <= 0 { (*TTclDateFields)(unsafe.Pointer(fields)).FisBce = int32(1) (*TTclDateFields)(unsafe.Pointer(fields)).Fyear = int32(int64(1) - year) } else { (*TTclDateFields)(unsafe.Pointer(fields)).FisBce = 0 (*TTclDateFields)(unsafe.Pointer(fields)).Fyear = int32(year) } (*TTclDateFields)(unsafe.Pointer(fields)).FdayOfYear = int32(day + int64(1)) } /* *---------------------------------------------------------------------- * * GetMonthDay -- * * Given a date as year and day-of-year, find month and day. * * Results: * None. * * Side effects: * Stores 'month' and 'dayOfMonth' in the 'fields' structure. * *---------------------------------------------------------------------- */ func _GetMonthDay(tls *libc.TLS, fields uintptr) { /* Date to convert */ var day, month int32 var dipm uintptr _, _, _ = day, dipm, month day = (*TTclDateFields)(unsafe.Pointer(fields)).FdayOfYear dipm = uintptr(unsafe.Pointer(&_daysInPriorMonths)) + uintptr(XIsGregorianLeapYear(tls, fields))*52 /* * Estimate month by calculating `dayOfYear / (365/12)` */ month = day * int32(12) / *(*int32)(unsafe.Pointer(dipm + 12*4)) /* then do forwards backwards correction */ for int32(1) != 0 { if day > *(*int32)(unsafe.Pointer(dipm + uintptr(month)*4)) { if month >= int32(11) || day <= *(*int32)(unsafe.Pointer(dipm + uintptr(month+int32(1))*4)) { break } month++ } else { if month == 0 { break } month-- } } day -= *(*int32)(unsafe.Pointer(dipm + uintptr(month)*4)) (*TTclDateFields)(unsafe.Pointer(fields)).Fmonth = month + int32(1) (*TTclDateFields)(unsafe.Pointer(fields)).FdayOfMonth = day } /* *---------------------------------------------------------------------- * * GetJulianDayFromEraYearWeekDay -- * * Given a TclDateFields structure containing era, ISO8601 year, ISO8601 * week, and day of week, computes the Julian Day Number. * * Results: * None. * * Side effects: * Stores 'julianDay' in the fields. * *---------------------------------------------------------------------- */ func XGetJulianDayFromEraYearWeekDay(tls *libc.TLS, fields uintptr, changeover int32) { bp := tls.Alloc(112) defer tls.Free(112) /* Julian Day Number of the Gregorian * transition */ var firstMonday TTcl_WideInt var _ /* firstWeek at bp+0 */ TTclDateFields _ = firstMonday (*(*TTclDateFields)(unsafe.Pointer(bp))).FtzName = libc.UintptrFromInt32(0) /* * Find January 4 in the ISO8601 year, which will always be in week 1. */ (*(*TTclDateFields)(unsafe.Pointer(bp))).FisBce = (*TTclDateFields)(unsafe.Pointer(fields)).FisBce (*(*TTclDateFields)(unsafe.Pointer(bp))).Fyear = (*TTclDateFields)(unsafe.Pointer(fields)).Fiso8601Year (*(*TTclDateFields)(unsafe.Pointer(bp))).Fmonth = int32(1) (*(*TTclDateFields)(unsafe.Pointer(bp))).FdayOfMonth = int32(4) XGetJulianDayFromEraYearMonthDay(tls, bp, changeover) /* * Find Monday of week 1. */ firstMonday = _WeekdayOnOrBefore(tls, int32(1), (*(*TTclDateFields)(unsafe.Pointer(bp))).FjulianDay) /* * Advance to the given week and day. */ (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay = firstMonday + int64(int32(7)*((*TTclDateFields)(unsafe.Pointer(fields)).Fiso8601Week-int32(1))) + int64((*TTclDateFields)(unsafe.Pointer(fields)).FdayOfWeek) - int64(1) } /* *---------------------------------------------------------------------- * * GetJulianDayFromEraYearMonthDay -- * * Given era, year, month, and dayOfMonth (in TclDateFields), and the * Gregorian transition date, computes the Julian Day Number. * * Results: * None. * * Side effects: * Stores day number in 'julianDay' * *---------------------------------------------------------------------- */ func XGetJulianDayFromEraYearMonthDay(tls *libc.TLS, fields uintptr, changeover int32) { /* Gregorian transition date as a Julian Day */ var mm1, month, q, r int32 var year, ym1, ym1o100, ym1o4, ym1o400 TTcl_WideInt _, _, _, _, _, _, _, _, _ = mm1, month, q, r, year, ym1, ym1o100, ym1o4, ym1o400 if (*TTclDateFields)(unsafe.Pointer(fields)).FisBce != 0 { year = int64(int32(1) - (*TTclDateFields)(unsafe.Pointer(fields)).Fyear) } else { year = int64((*TTclDateFields)(unsafe.Pointer(fields)).Fyear) } /* * Reduce month modulo 12. */ month = (*TTclDateFields)(unsafe.Pointer(fields)).Fmonth mm1 = month - int32(1) q = mm1 / int32(12) r = mm1 % int32(12) if r < 0 { r += int32(12) q -= int32(1) } year += int64(q) month = r + int32(1) ym1 = year - int64(1) /* * Adjust the year after reducing the month. */ (*TTclDateFields)(unsafe.Pointer(fields)).Fgregorian = int32(1) if year < int64(1) { (*TTclDateFields)(unsafe.Pointer(fields)).FisBce = int32(1) (*TTclDateFields)(unsafe.Pointer(fields)).Fyear = int32(int64(1) - year) } else { (*TTclDateFields)(unsafe.Pointer(fields)).FisBce = 0 (*TTclDateFields)(unsafe.Pointer(fields)).Fyear = int32(year) } /* * Try an initial conversion in the Gregorian calendar. */ /* * Have to make sure quotient is truncated towards 0 when negative. * See above bug for details. The casts are necessary. */ if ym1 >= 0 { ym1o4 = ym1 / int64(4) } else { ym1o4 = int64(-libc.Int32FromUint32(libc.Uint32FromInt64(-ym1) / libc.Uint32FromInt32(4))) } if ym1%int64(4) < 0 { ym1o4-- } ym1o100 = ym1 / int64(100) if ym1%int64(100) < 0 { ym1o100-- } ym1o400 = ym1 / int64(400) if ym1%int64(400) < 0 { ym1o400-- } (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay = int64(libc.Int32FromInt32(JDAY_1_JAN_1_CE_GREGORIAN)-libc.Int32FromInt32(1)+(*TTclDateFields)(unsafe.Pointer(fields)).FdayOfMonth+*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_daysInPriorMonths)) + uintptr(XIsGregorianLeapYear(tls, fields))*52 + uintptr(month-int32(1))*4))) + int64(ONE_YEAR)*ym1 + ym1o4 - ym1o100 + ym1o400 /* * If the resulting date is before the Gregorian changeover, convert in * the Julian calendar instead. */ if (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay < int64(changeover) { (*TTclDateFields)(unsafe.Pointer(fields)).Fgregorian = 0 (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay = int64(libc.Int32FromInt32(JDAY_1_JAN_1_CE_JULIAN)-libc.Int32FromInt32(1)+(*TTclDateFields)(unsafe.Pointer(fields)).FdayOfMonth+*(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_daysInPriorMonths)) + libc.BoolUintptr(year%int64(4) == 0)*52 + uintptr(month-int32(1))*4))) + int64(365)*ym1 + ym1o4 } } /* *---------------------------------------------------------------------- * * GetJulianDayFromEraYearDay -- * * Given era, year, and dayOfYear (in TclDateFields), and the * Gregorian transition date, computes the Julian Day Number. * * Results: * None. * * Side effects: * Stores day number in 'julianDay' * *---------------------------------------------------------------------- */ func XGetJulianDayFromEraYearDay(tls *libc.TLS, fields uintptr, changeover int32) { /* Gregorian transition date as a Julian Day */ var year, ym1 TTcl_WideInt _, _ = year, ym1 /* Get absolute year number from the civil year */ if (*TTclDateFields)(unsafe.Pointer(fields)).FisBce != 0 { year = int64(int32(1) - (*TTclDateFields)(unsafe.Pointer(fields)).Fyear) } else { year = int64((*TTclDateFields)(unsafe.Pointer(fields)).Fyear) } ym1 = year - int64(1) /* Try the Gregorian calendar first. */ (*TTclDateFields)(unsafe.Pointer(fields)).Fgregorian = int32(1) (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay = int64(int32(1721425)+(*TTclDateFields)(unsafe.Pointer(fields)).FdayOfYear) + int64(365)*ym1 + ym1/int64(4) - ym1/int64(100) + ym1/int64(400) /* If the date is before the Gregorian change, use the Julian calendar. */ if (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay < int64(changeover) { (*TTclDateFields)(unsafe.Pointer(fields)).Fgregorian = 0 (*TTclDateFields)(unsafe.Pointer(fields)).FjulianDay = int64(int32(1721423)+(*TTclDateFields)(unsafe.Pointer(fields)).FdayOfYear) + int64(365)*ym1 + ym1/int64(4) } } /* *---------------------------------------------------------------------- * * IsGregorianLeapYear -- * * Tests whether a given year is a leap year, in either Julian or * Gregorian calendar. * * Results: * Returns 1 for a leap year, 0 otherwise. * *---------------------------------------------------------------------- */ func XIsGregorianLeapYear(tls *libc.TLS, fields uintptr) (r int32) { /* Date to test */ var year TTcl_WideInt _ = year year = int64((*TTclDateFields)(unsafe.Pointer(fields)).Fyear) if (*TTclDateFields)(unsafe.Pointer(fields)).FisBce != 0 { year = int64(1) - year } if year%int64(4) != 0 { return 0 } else { if !((*TTclDateFields)(unsafe.Pointer(fields)).Fgregorian != 0) { return int32(1) } else { if year%int64(400) == 0 { return int32(1) } else { if year%int64(100) == 0 { return 0 } else { return int32(1) } } } } return r } /* *---------------------------------------------------------------------- * * WeekdayOnOrBefore -- * * Finds the Julian Day Number of a given day of the week that falls on * or before a given date, expressed as Julian Day Number. * * Results: * Returns the Julian Day Number * *---------------------------------------------------------------------- */ func _WeekdayOnOrBefore(tls *libc.TLS, dayOfWeek int32, julianDay TTcl_WideInt) (r TTcl_WideInt) { /* Reference date */ var k int32 _ = k k = (dayOfWeek + int32(6)) % int32(7) if k < 0 { k += int32(7) } return julianDay - (julianDay-int64(k))%int64(7) } /* *---------------------------------------------------------------------- * * ClockGetenvObjCmd -- * * Tcl command that reads an environment variable from the system * * Usage: * ::tcl::clock::getEnv NAME * * Parameters: * NAME - Name of the environment variable desired * * Results: * Returns a standard Tcl result. Returns an error if the variable does * not exist, with a message left in the interpreter. Returns TCL_OK and * the value of the variable if the variable does exist, * *---------------------------------------------------------------------- */ func _ClockGetenvObjCmd(tls *libc.TLS, dummy3013 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var varName, varValue, v1 uintptr _, _, _ = varName, varValue, v1 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } varName = v1 varValue = libc.Xgetenv(tls, varName) if varValue != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, varValue, int64(-libc.Int32FromInt32(1)))) } return TCL_OK } /* *---------------------------------------------------------------------- * * ThreadSafeLocalTime -- * * Wrapper around the 'localtime' library function to make it thread * safe. * * Results: * Returns a pointer to a 'struct tm' in thread-specific data. * * Side effects: * Invokes localtime or localtime_r as appropriate. * *---------------------------------------------------------------------- */ func _ThreadSafeLocalTime(tls *libc.TLS, timePtr uintptr) (r uintptr) { /* Pointer to the number of seconds since the * local system's epoch */ var tmPtr uintptr _ = tmPtr /* * Get a thread-local buffer to hold the returned time. */ tmPtr = XTcl_GetThreadData(tls, uintptr(unsafe.Pointer(&_tmKey)), int64(56)) tmPtr = libc.Xlocaltime_r(tls, timePtr, tmPtr) return tmPtr } /*---------------------------------------------------------------------- * * ClockClicksObjCmd -- * * Returns a high-resolution counter. * * Results: * Returns a standard Tcl result. * * Side effects: * None. * * This function implements the 'clock clicks' Tcl command. Refer to the user * documentation for details on what it does. * *---------------------------------------------------------------------- */ func _ClockClicksObjCmd(tls *libc.TLS, dummy3117 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Parameter values */ var clicks TTcl_WideInt var _ /* index at bp+0 */ int32 var _ /* now at bp+8 */ TTcl_Time _ = clicks *(*int32)(unsafe.Pointer(bp)) = 2 clicks = 0 switch objc { case int32(1): case int32(2): if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&_clicksSwitches)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) { if XTclBN_mp_init_u64(tls, bp+16, uw_) != MP_OKAY { XTcl_Panic(tls, __ccgo_ts+13273, libc.VaList(bp+48, __ccgo_ts+13293)) } XTclSetBignumInternalRep(tls, timeObj, bp+16) } else { *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(timeObj)).FinternalRep)) = libc.Int64FromUint64(uw_) (*TTcl_Obj)(unsafe.Pointer(timeObj)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } XTcl_SetObjResult(tls, interp, timeObj) return TCL_OK } /*---------------------------------------------------------------------- * * ClockMicrosecondsObjCmd - * * Returns a count of microseconds since the epoch. * * Results: * Returns a standard Tcl result. * * Side effects: * None. * * This function implements the 'clock microseconds' Tcl command. Refer to the * user documentation for details on what it does. * *---------------------------------------------------------------------- */ func _ClockMicrosecondsObjCmd(tls *libc.TLS, dummy3226 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Parameter values */ if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, 0, objv, __ccgo_ts+13307) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, XTclpGetMicroseconds(tls))) return TCL_OK } func _ClockInitFmtScnArgs(tls *libc.TLS, dataPtr uintptr, interp uintptr, opts uintptr) { libc.Xmemset(tls, opts, 0, uint64(64)) (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr = dataPtr (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp = interp } /* *----------------------------------------------------------------------------- * * ClockParseFmtScnArgs -- * * Parses the arguments for sub-commands "scan", "format" and "add". * * Note: common options table used here, because for the options often used * the same literals (objects), so it avoids permanent "recompiling" of * option object representation to indexType with another table. * * Results: * Returns a standard Tcl result, and stores parsed options * (format, the locale, timezone and base) in structure "opts". * *----------------------------------------------------------------------------- */ type TClockOperation = int32 /* *----------------------------------------------------------------------------- * * ClockParseFmtScnArgs -- * * Parses the arguments for sub-commands "scan", "format" and "add". * * Note: common options table used here, because for the options often used * the same literals (objects), so it avoids permanent "recompiling" of * option object representation to indexType with another table. * * Results: * Returns a standard Tcl result, and stores parsed options * (format, the locale, timezone and base) in structure "opts". * *----------------------------------------------------------------------------- */ type ClockOperation = int32 const CLC_OP_FMT = 0 const /* Doing [clock format] */ CLC_OP_SCN = 1 const /* Doing [clock scan] */ CLC_OP_ADD = 2 func _ClockParseFmtScnArgs(tls *libc.TLS, opts uintptr, date uintptr, objc TTcl_Size, objv uintptr, operation TClockOperation, syntax uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) /* Syntax of the current command */ var _objPtr, baseObj, dataPtr, interp, nval, prev, v12, v15, v16, v17, v18, v4, v6 uintptr var baseIdx, i, v1, v14, v5 TTcl_Size var saw, v10, v3 int32 var v11, v7 bool var _ /* baseVal at bp+8 */ TTcl_WideInt var _ /* gmtFlag at bp+0 */ int32 var _ /* idx at bp+28 */ int32 var _ /* now at bp+32 */ TTcl_Time var _ /* num at bp+16 */ TTcl_WideInt var _ /* optionIndex at bp+4 */ int32 var _ /* val at bp+24 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, baseIdx, baseObj, dataPtr, i, interp, nval, prev, saw, v1, v10, v11, v12, v14, v15, v16, v17, v18, v3, v4, v5, v6, v7 interp = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp dataPtr = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr *(*int32)(unsafe.Pointer(bp)) = 0 saw = 0 /* Base time, expressed in seconds from the Epoch */ if operation == int32(CLC_OP_SCN) { /* default flags (from configure) */ *(*int32)(unsafe.Pointer(opts + 48)) |= (*TClockClientData)(unsafe.Pointer(dataPtr)).FdefFlags & int32(CLF_VALIDATE) } else { /* clock value (as current base) */ v1 = libc.Int64FromInt32(1) baseIdx = v1 (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FbaseObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(v1)*8)) saw |= libc.Int32FromInt32(1) << 0 } /* * Extract values for the keywords. */ i = int64(2) for { if !(i < objc) { break } /* bypass integers (offsets) by "clock add" */ if operation == int32(CLC_OP_ADD) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 16)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+16) } if v3 == TCL_OK { goto _2 } } /* get option */ if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_options1)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int64(0x00F0000000000000)) { goto _13 } goto baseOverflow baseOverflow: ; XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_INTEGER_VALUE_TOO_LARGE)*8))) i = baseIdx goto badOption _13: ; goto _9 _8: ; goto baseNow baseNow: ; XTcl_GetTime(tls, bp+32) *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = (*(*TTcl_Time)(unsafe.Pointer(bp + 32))).Fsec _9: ; /* * Extract year, month and day from the base time for the parser to use as * defaults */ /* check base fields already cached (by TZ, last-second cache) */ if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastBase.FtimezoneObj == (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj && (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastBase.Fdate.Fseconds == *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) && (!((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastBase.Fdate.Fflags&int32(CLF_CTZ) != 0) || (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastTZEpoch == _TzsetIfNecessary(tls)) { libc.Xmemcpy(tls, date, dataPtr+248+8, uint64(libc.UintptrFromInt32(0)+104)) } else { /* extact fields from base */ (*TTclDateFields)(unsafe.Pointer(date)).Fseconds = *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) if _ClockGetDateFields(tls, dataPtr, interp, date, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj, int32(GREGORIAN_CHANGE_DATE)) != TCL_OK { /* TODO - GREGORIAN_CHANGE_DATE should be locale-dependent */ return int32(TCL_ERROR) } /* cache last base */ libc.Xmemcpy(tls, dataPtr+248+8, date, uint64(libc.UintptrFromInt32(0)+104)) nval = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastBase.FtimezoneObj != nval { prev = (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastBase.FtimezoneObj (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastBase.FtimezoneObj = nval if (*TClockClientData)(unsafe.Pointer(dataPtr)).FlastBase.FtimezoneObj != 0 { (*TTcl_Obj)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FlastBase.FtimezoneObj)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v15 = _objPtr v14 = *(*TTcl_Size)(unsafe.Pointer(v15)) *(*TTcl_Size)(unsafe.Pointer(v15))-- if v14 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } } return TCL_OK goto badOptionMsg badOptionMsg: ; if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { v16 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v16 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+13504, libc.VaList(bp+56, v16, syntax))) goto badOption badOption: ; if i < objc { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { v18 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v18 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), libc.UintptrFromInt32(0)) } v17 = v18 } else { v17 = libc.UintptrFromInt32(0) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, __ccgo_ts+12666, __ccgo_ts+12672, v17, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } var _options1 = [7]uintptr{ 0: __ccgo_ts + 13326, 1: __ccgo_ts + 13332, 2: __ccgo_ts + 13340, 3: __ccgo_ts + 13345, 4: __ccgo_ts + 13353, 5: __ccgo_ts + 12780, 6: libc.UintptrFromInt32(0), } /* Index of an option. */ /* we accept "now" and "-now" as current date-time */ var _nowOpts = [3]uintptr{ 0: __ccgo_ts + 13454, 1: __ccgo_ts + 13458, 2: libc.UintptrFromInt32(0), } /*---------------------------------------------------------------------- * * ClockFormatObjCmd -- , clock format -- * * This function is invoked to process the Tcl "clock format" command. * * Formats a count of seconds since the Posix Epoch as a time of day. * * The 'clock format' command formats times of day for output. Refer * to the user documentation to see what it does. * * Results: * Returns a standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _ClockFormatObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(240) defer tls.Free(240) /* Parameter values */ var _objPtr, dataPtr, v2 uintptr var ret int32 var v1 TTcl_Size var _ /* dateFmt at bp+64 */ TDateFormat var _ /* opts at bp+0 */ TClockFmtScnCmdArgs _, _, _, _, _ = _objPtr, dataPtr, ret, v1, v2 dataPtr = clientData /* even number of arguments */ if objc&int32(1) == int32(1) { XTcl_WrongNumArgs(tls, interp, 0, objv, _syntax) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+216, __ccgo_ts+12666, __ccgo_ts+13624, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } libc.Xmemset(tls, bp+64, 0, uint64(144)) /* * Extract values for the keywords. */ _ClockInitFmtScnArgs(tls, dataPtr, interp, bp) ret = _ClockParseFmtScnArgs(tls, bp, bp+64+24, int64(objc), objv, int32(CLC_OP_FMT), __ccgo_ts+13637) if ret != TCL_OK { goto done } /* Default format */ if (*(*TClockFmtScnCmdArgs)(unsafe.Pointer(bp))).FformatObj == libc.UintptrFromInt32(0) { (*(*TClockFmtScnCmdArgs)(unsafe.Pointer(bp))).FformatObj = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT__DEFAULT_FORMAT)*8)) } /* Use compiled version of Format - */ ret = XClockFormat(tls, bp+64, bp) goto done done: ; if (*(*TDateFormat)(unsafe.Pointer(bp + 64))).Fdate.FtzName != libc.UintptrFromInt32(0) { _objPtr = (*(*TDateFormat)(unsafe.Pointer(bp + 64))).Fdate.FtzName v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } (*(*TDateFormat)(unsafe.Pointer(bp + 64))).Fdate.FtzName = libc.UintptrFromInt32(0) } return ret } var _syntax = __ccgo_ts + 13532 /* Common structure used for formatting */ /*---------------------------------------------------------------------- * * ClockScanObjCmd -- , clock scan -- * * This function is invoked to process the Tcl "clock scan" command. * * Inputs a count of seconds since the Posix Epoch as a time of day. * * The 'clock scan' command scans times of day on input. Refer to the * user documentation to see what it does. * * Results: * Returns a standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _ClockScanObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(336) defer tls.Free(336) /* Parameter values */ var _objPtr, dataPtr, info1, v5 uintptr var ret, v1 int32 var v2, v3 TTcl_WideInt var v4 TTcl_Size var _ /* opts at bp+0 */ TClockFmtScnCmdArgs var _ /* yy at bp+64 */ TDateInfo _, _, _, _, _, _, _, _, _ = _objPtr, dataPtr, info1, ret, v1, v2, v3, v4, v5 dataPtr = clientData info1 = bp + 64 /* even number of arguments */ if objc&int32(1) == int32(1) { XTcl_WrongNumArgs(tls, interp, 0, objv, _syntax1) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+312, __ccgo_ts+12666, __ccgo_ts+13624, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } libc.Xmemset(tls, bp+64, 0, uint64(240)) /* * Extract values for the keywords. */ _ClockInitFmtScnArgs(tls, dataPtr, interp, bp) ret = _ClockParseFmtScnArgs(tls, bp, bp+64+24, int64(objc), objv, int32(CLC_OP_SCN), __ccgo_ts+13794) if ret != TCL_OK { goto done } /* seconds are in localSeconds (relative base date), so reset time here */ v3 = libc.Int64FromInt32(0) (*TDateInfo)(unsafe.Pointer(info1)).Fdate.FsecondOfDay = v3 v2 = v3 (*TDateInfo)(unsafe.Pointer(info1)).Fdate.FsecondOfMin = v2 v1 = int32(v2) (*TDateInfo)(unsafe.Pointer(info1)).Fdate.Fminutes = v1 (*TDateInfo)(unsafe.Pointer(info1)).Fdate.Fhour = v1 (*TDateInfo)(unsafe.Pointer(info1)).FdateMeridian = int32(MER24) /* If free scan */ if (*(*TClockFmtScnCmdArgs)(unsafe.Pointer(bp))).FformatObj == libc.UintptrFromInt32(0) { /* Use compiled version of FreeScan - */ /* [SB] TODO: Perhaps someday we'll localize the legacy code. Right now, * it's not localized. */ if (*(*TClockFmtScnCmdArgs)(unsafe.Pointer(bp))).FlocaleObj != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+13848, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+312, __ccgo_ts+12666, __ccgo_ts+13893, libc.UintptrFromInt32(0))) ret = int32(TCL_ERROR) goto done } ret = _ClockFreeScan(tls, bp+64, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } else { /* Use compiled version of Scan - */ ret = XClockScan(tls, bp+64, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } if ret != TCL_OK { goto done } /* * If no GMT and not free-scan (where valid stage 1 is done in-between), * validate with stage 1 before local time conversion, otherwise it may * adjust date/time tokens to valid values */ if (*(*TClockFmtScnCmdArgs)(unsafe.Pointer(bp))).Fflags&int32(CLF_VALIDATE_S1) != 0 && (*TDateInfo)(unsafe.Pointer(info1)).Fflags&(int32(CLF_ASSEMBLE_SECONDS)|int32(CLF_LOCALSEC)) != 0 { ret = _ClockValidDate(tls, bp+64, bp, int32(CLF_VALIDATE_S1)) if ret != TCL_OK { goto done } } /* Convert date info structure into UTC seconds */ ret = _ClockScanCommit(tls, bp+64, bp) if ret != TCL_OK { goto done } /* Apply remaining validation rules, if expected */ if (*(*TClockFmtScnCmdArgs)(unsafe.Pointer(bp))).Fflags&int32(CLF_VALIDATE) != 0 { ret = _ClockValidDate(tls, bp+64, bp, (*(*TClockFmtScnCmdArgs)(unsafe.Pointer(bp))).Fflags&int32(CLF_VALIDATE)) if ret != TCL_OK { goto done } } goto done done: ; if (*(*TDateInfo)(unsafe.Pointer(bp + 64))).Fdate.FtzName != libc.UintptrFromInt32(0) { _objPtr = (*(*TDateInfo)(unsafe.Pointer(bp + 64))).Fdate.FtzName v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } (*(*TDateInfo)(unsafe.Pointer(bp + 64))).Fdate.FtzName = libc.UintptrFromInt32(0) } if ret != TCL_OK { return ret } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, (*(*TDateInfo)(unsafe.Pointer(bp + 64))).Fdate.Fseconds)) return TCL_OK } var _syntax1 = __ccgo_ts + 13674 /* Common structure used for parsing */ /*---------------------------------------------------------------------- * * ClockScanCommit -- * * Converts date info structure into UTC seconds. * * Results: * Returns a standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _ClockScanCommit(tls *libc.TLS, info uintptr, opts uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Format, locale, timezone and base */ var curJDN float64 _ = curJDN /* If needed assemble julianDay using year, month, etc. */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ASSEMBLE_JULIANDAY) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ISO8601WEEK) != 0 { XGetJulianDayFromEraYearWeekDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) } else { if !((*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_DAYOFYEAR) != 0) || (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_DAYOFMONTH)|int32(CLF_MONTH)) == int32(CLF_DAYOFMONTH)|int32(CLF_MONTH) { XGetJulianDayFromEraYearMonthDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) } else { XGetJulianDayFromEraYearDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) } } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_SECONDS) *(*int32)(unsafe.Pointer(info + 136)) &= ^int32(CLF_ASSEMBLE_JULIANDAY) } /* some overflow checks */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_JULIANDAY) != 0 { curJDN = float64((*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay) + (float64((*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay)-float64(libc.Int32FromInt32(SECONDS_PER_DAY)/libc.Int32FromInt32(2)))/libc.Float64FromInt32(SECONDS_PER_DAY) if curJDN > (*TClockClientData)(unsafe.Pointer((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr)).FmaxJDN { XTcl_SetObjResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, XTcl_NewStringObj(tls, __ccgo_ts+13914, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, libc.VaList(bp+8, __ccgo_ts+12666, __ccgo_ts+13952, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } } /* If seconds overflows the day (not valide case, or 24:00), increase days */ if (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay >= int64(SECONDS_PER_DAY) { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay += (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay / int64(SECONDS_PER_DAY) *(*TTcl_WideInt)(unsafe.Pointer(info + 24 + 88)) %= int64(SECONDS_PER_DAY) } /* Local seconds to UTC (stored in yydate.seconds) */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ASSEMBLE_SECONDS) != 0 { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FlocalSeconds = -int64(210866803200) + int64(SECONDS_PER_DAY)*(*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay + (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay } if (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_ASSEMBLE_SECONDS)|int32(CLF_LOCALSEC)) != 0 { if _ConvertLocalToUTC(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, info+24, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj, int32(GREGORIAN_CHANGE_DATE)) != TCL_OK { return int32(TCL_ERROR) } } /* Increment UTC seconds with relative time */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fseconds += (*TDateInfo)(unsafe.Pointer(info)).FdateRelSeconds return TCL_OK } /*---------------------------------------------------------------------- * * ClockValidDate -- * * Validate date info structure for wrong data (e. g. out of ranges). * * Results: * Returns a standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _ClockValidDate(tls *libc.TLS, info uintptr, opts uintptr, stage int32) (r int32) { bp := tls.Alloc(160) defer tls.Free(160) /* Stage to validate (1, 2 or 3 for both) */ var dataPtr, errCode, errMsg, h, v4 uintptr var tempCpyFlg, v1, v3 int32 var v2 bool var _ /* temp at bp+0 */ TTclDateFields _, _, _, _, _, _, _, _, _ = dataPtr, errCode, errMsg, h, tempCpyFlg, v1, v2, v3, v4 errMsg = __ccgo_ts + 1945 errCode = __ccgo_ts + 1945 tempCpyFlg = 0 dataPtr = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr if !(stage&int32(CLF_VALIDATE_S1) != 0) || !((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags&int32(CLF_VALIDATE_S1) != 0) { goto stage_2 } *(*int32)(unsafe.Pointer(opts + 48)) &= ^int32(CLF_VALIDATE_S1) /* stage 1 is done */ /* first year (used later in hath / daysInPriorMonths) */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_YEAR)|int32(CLF_ISO8601YEAR)) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ISO8601YEAR) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year < (*TClockClientData)(unsafe.Pointer(dataPtr)).FvalidMinYear || (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year > (*TClockClientData)(unsafe.Pointer(dataPtr)).FvalidMaxYear { errMsg = __ccgo_ts + 13965 errCode = __ccgo_ts + 13982 goto error } } if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_YEAR) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear < (*TClockClientData)(unsafe.Pointer(dataPtr)).FvalidMinYear || (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear > (*TClockClientData)(unsafe.Pointer(dataPtr)).FvalidMaxYear { errMsg = __ccgo_ts + 13991 errCode = __ccgo_ts + 11851 goto error } } else { if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ISO8601YEAR) != 0 { (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year /* used to recognize leap */ } } if (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_ISO8601YEAR)|int32(CLF_YEAR)) == int32(CLF_ISO8601YEAR)|int32(CLF_YEAR) { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear != (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year { errMsg = __ccgo_ts + 14004 errCode = __ccgo_ts + 11851 goto error } } } /* and month (used later in hath) */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_MONTH) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth < int32(1) || (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth > int32(12) { errMsg = __ccgo_ts + 14019 errCode = __ccgo_ts + 11821 goto error } } /* day of month */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_DAYOFMONTH)|int32(CLF_DAYOFWEEK)) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth < int32(1) || (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth > int32(31) { errMsg = __ccgo_ts + 14033 errCode = __ccgo_ts + 14045 goto error } if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_MONTH) != 0 { h = uintptr(unsafe.Pointer(&_hath)) + uintptr(XIsGregorianLeapYear(tls, info+24))*48 if (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth > *(*int32)(unsafe.Pointer(h + uintptr((*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth-int32(1))*4)) { errMsg = __ccgo_ts + 14033 errCode = __ccgo_ts + 14045 goto error } } } if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_DAYOFYEAR) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfYear < int32(1) || (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfYear > *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_daysInPriorMonths)) + uintptr(XIsGregorianLeapYear(tls, info+24))*52 + 12*4)) { errMsg = __ccgo_ts + 14049 errCode = __ccgo_ts + 14069 goto error } } /* mmdd !~ ddd */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_DAYOFYEAR)|int32(CLF_DAYOFMONTH)|int32(CLF_MONTH)) == int32(CLF_DAYOFYEAR)|int32(CLF_DAYOFMONTH)|int32(CLF_MONTH) { if !(tempCpyFlg != 0) { libc.Xmemcpy(tls, bp, info+24, uint64(112)) tempCpyFlg = int32(1) } XGetJulianDayFromEraYearDay(tls, bp, int32(GREGORIAN_CHANGE_DATE)) if (*(*TTclDateFields)(unsafe.Pointer(bp))).FjulianDay != (*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay { errMsg = __ccgo_ts + 14081 errCode = __ccgo_ts + 14045 goto error } } if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_TIME) != 0 { /* hour */ if v2 = (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour < 0; !v2 { if (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian == int32(MER24) { v1 = int32(23) } else { v1 = int32(12) } } if v2 || (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour > v1 { /* allow 24:00:00 as special case, see [aee9f2b916afd976] */ if (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian == int32(MER24) && (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour == int32(24) { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes != 0 || (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin != 0 { errMsg = __ccgo_ts + 14095 errCode = __ccgo_ts + 5581 goto error } /* 24:00 is next day 00:00, correct day of week if given */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_DAYOFWEEK) != 0 { v4 = info + 24 + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) if v3 > int32(7) { /* Mon .. Sun == 1 .. 7 */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = int32(1) } } } else { errMsg = __ccgo_ts + 14108 errCode = __ccgo_ts + 14128 goto error } } /* minutes */ if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes < 0 || (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes > int32(59) { errMsg = __ccgo_ts + 14133 errCode = __ccgo_ts + 14156 goto error } /* oldscan could return secondOfDay -1 by invalid time (see ToSeconds) */ if (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin < 0 || (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin > int64(59) || (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay <= int64(-int32(1)) { errMsg = __ccgo_ts + 14095 errCode = __ccgo_ts + 11827 goto error } } if !(stage&int32(CLF_VALIDATE_S2) != 0) || !((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags&int32(CLF_VALIDATE_S2) != 0) { return TCL_OK } /* * Further tests expected ready calculated julianDay (inclusive relative), * and time-zone conversion (local to UTC time). */ goto stage_2 stage_2: ; *(*int32)(unsafe.Pointer(opts + 48)) &= ^int32(CLF_VALIDATE_S2) /* stage 2 is done */ /* time, regarding the modifications by the time-zone (looks for given time * in between DST-time hole, so does not exist in this time-zone) */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_TIME) != 0 { /* * we don't need to do the backwards time-conversion (UTC to local) and * compare results, because the after conversion (local to UTC) we * should have valid localSeconds (was not invalidated to TCL_INV_SECONDS), * so if it was invalidated - invalid time, outside the time-zone (in DST-hole) */ if (*TDateInfo)(unsafe.Pointer(info)).Fdate.FlocalSeconds == -libc.Int64FromInt64(0x00F0000000000000)-libc.Int64FromInt32(1) { errMsg = __ccgo_ts + 14164 errCode = __ccgo_ts + 14212 goto error } } /* day of week */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_DAYOFWEEK) != 0 { if !(tempCpyFlg != 0) { libc.Xmemcpy(tls, bp, info+24, uint64(112)) tempCpyFlg = int32(1) } _GetYearWeekDay(tls, bp, int32(GREGORIAN_CHANGE_DATE)) if (*(*TTclDateFields)(unsafe.Pointer(bp))).FdayOfWeek != (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek { errMsg = __ccgo_ts + 14224 errCode = __ccgo_ts + 14244 goto error } } return TCL_OK goto error error: ; XTcl_SetObjResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, XTcl_ObjPrintf(tls, __ccgo_ts+14256, libc.VaList(bp+120, errMsg))) XTcl_SetErrorCode(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, libc.VaList(bp+120, __ccgo_ts+12666, __ccgo_ts+14291, errCode, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /*---------------------------------------------------------------------- * * ClockFreeScan -- * * Used by ClockScanObjCmd for free scanning without format. * * Results: * Returns a standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _ClockFreeScan(tls *libc.TLS, info uintptr, strObj uintptr, opts uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Command options */ var _objPtr, dataPtr, interp, tzObjStor, v1, v2, v4 uintptr var dstFlag, minEast, ret int32 var v3 TTcl_Size _, _, _, _, _, _, _, _, _, _, _ = _objPtr, dataPtr, dstFlag, interp, minEast, ret, tzObjStor, v1, v2, v3, v4 interp = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp dataPtr = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr ret = int32(TCL_ERROR) /* * Parse the date. The parser will fill a structure "info" with date, * time, time zone, relative month/day/seconds, relative weekday, ordinal * month. * Notice that many yy-defines point to values in the "info" or "date" * structure, e. g. yySecondOfDay -> info->date.secondOfDay or * yyMonth -> info->date.month (same as yydate.month) */ if (*TTcl_Obj)(unsafe.Pointer(strObj)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(strObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, strObj, libc.UintptrFromInt32(0)) } (*TDateInfo)(unsafe.Pointer(info)).FdateInput = v1 if XTclClockFreeScan(tls, interp, info) != TCL_OK { if (*TTcl_Obj)(unsafe.Pointer(strObj)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(strObj)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, strObj, libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+14301, libc.VaList(bp+8, v2, XTcl_GetStringFromObj(tls, XTcl_GetObjResult(tls, interp), libc.UintptrFromInt32(0))))) goto done } /* * If the caller supplied a date in the string, update the date with * the value. If the caller didn't specify a time with the date, default to * midnight. */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_YEAR) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear < int32(100) { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear >= (*TClockClientData)(unsafe.Pointer(dataPtr)).FyearOfCenturySwitch { *(*int32)(unsafe.Pointer(info + 24 + 40)) -= int32(100) } *(*int32)(unsafe.Pointer(info + 24 + 40)) += (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentYearCentury } (*TDateInfo)(unsafe.Pointer(info)).Fdate.FisBce = 0 *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_JULIANDAY) | int32(CLF_ASSEMBLE_SECONDS) } /* * If the caller supplied a time zone in the string, make it into a time * zone indicator of +-hhmm and setup this time zone. */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ZONE) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).FdateTimezone != 0 || !((*TDateInfo)(unsafe.Pointer(info)).FdateDSTmode != 0) { /* Real time zone from numeric zone */ tzObjStor = libc.UintptrFromInt32(0) minEast = -(*TDateInfo)(unsafe.Pointer(info)).FdateTimezone dstFlag = int32(1) - (*TDateInfo)(unsafe.Pointer(info)).FdateDSTmode tzObjStor = XClockFormatNumericTimeZone(tls, int32(60)*minEast+int32(3600)*dstFlag) (*TTcl_Obj)(unsafe.Pointer(tzObjStor)).FrefCount++ (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj = XClockSetupTimeZone(tls, dataPtr, interp, tzObjStor) _objPtr = tzObjStor v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } } else { /* simplest case - GMT / UTC */ (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj = XClockSetupTimeZone(tls, dataPtr, interp, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_GMT)*8))) } if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj == libc.UintptrFromInt32(0) { goto done } // TclSetObjRef(yydate.tzName, opts->timezoneObj); *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_SECONDS) } /* * For freescan apply validation rules (stage 1) before mixed with * relative time (otherwise always valid recalculated date & time). */ if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags&int32(CLF_VALIDATE) != 0 { if _ClockValidDate(tls, info, opts, int32(CLF_VALIDATE_S1)) != TCL_OK { goto done } } /* * Assemble date, time, zone into seconds-from-epoch */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_TIME)|int32(CLF_HAVEDATE)) == int32(CLF_HAVEDATE) { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay = 0 *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_SECONDS) } else { if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_TIME) != 0 { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay = int64(XToSeconds(tls, (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour, (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes, int32((*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin), (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian)) *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_SECONDS) } else { if (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_DAYOFWEEK)|int32(CLF_HAVEDATE)) == int32(CLF_DAYOFWEEK) || (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ORDINALMONTH) != 0 || (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_RELCONV) != 0 && ((*TDateInfo)(unsafe.Pointer(info)).FdateRelMonth != 0 || (*TDateInfo)(unsafe.Pointer(info)).FdateRelDay != 0) { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay = 0 *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_SECONDS) } else { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay = (*TDateInfo)(unsafe.Pointer(info)).Fdate.FlocalSeconds % int64(SECONDS_PER_DAY) } } } /* * Do relative times */ ret = _ClockCalcRelTime(tls, info) /* Free scanning completed - date ready */ goto done done: ; return ret return r } // C documentation // // /*---------------------------------------------------------------------- // * // * ClockCalcRelTime -- // * // * Used for calculating of relative times. // * // * Results: // * Returns a standard Tcl result. // * // * Side effects: // * None. // * // *---------------------------------------------------------------------- // */ func _ClockCalcRelTime(tls *libc.TLS, info uintptr) (r int32) { /* Date fields used for converting */ var h, m, monthDiff, prevDayOfWeek int32 var newSecs TTcl_WideInt var p1 uintptr _, _, _, _, _, _ = h, m, monthDiff, newSecs, prevDayOfWeek, p1 prevDayOfWeek = (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek /* preserve unchanged day of week */ /* * Because some calculations require in-between conversion of the * julian day, we can repeat this processing multiple times */ goto repeat_rel repeat_rel: ; if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_RELCONV) != 0 { /* * Relative conversion normally possible in UTC time only, because * of possible wrong local time increment if ignores in-between DST-hole. * (see test-cases clock-34.53, clock-34.54). * So increment date in julianDay, but time inside day in UTC (seconds). */ /* add months (or years in months) */ if (*TDateInfo)(unsafe.Pointer(info)).FdateRelMonth != 0 { /* if needed extract year, month, etc. again */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ASSEMBLE_DATE) != 0 { _GetGregorianEraYearDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) _GetMonthDay(tls, info+24) _GetYearWeekDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) *(*int32)(unsafe.Pointer(info + 136)) &= ^int32(CLF_ASSEMBLE_DATE) } /* add the requisite number of months */ p1 = info + 24 + 48 *(*int32)(unsafe.Pointer(p1)) = int32(int64(*(*int32)(unsafe.Pointer(p1))) + ((*TDateInfo)(unsafe.Pointer(info)).FdateRelMonth - libc.Int64FromInt32(1))) *(*int32)(unsafe.Pointer(info + 24 + 40)) += (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth / int32(12) m = (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth % int32(12) /* compiler fix for negative offs - wrap y, m = (0, -1) -> (-1, 11) */ if m < 0 { (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear-- m = int32(12) + m } (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = m + int32(1) /* if the day doesn't exist in the current month, repair it */ h = *(*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&_hath)) + uintptr(XIsGregorianLeapYear(tls, info+24))*48 + uintptr(m)*4)) if (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth > h { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = h } /* on demand (lazy) assemble julianDay using new year, month, etc. */ *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_JULIANDAY) | int32(CLF_ASSEMBLE_SECONDS) (*TDateInfo)(unsafe.Pointer(info)).FdateRelMonth = 0 } /* add days (or other parts aligned to days) */ if (*TDateInfo)(unsafe.Pointer(info)).FdateRelDay != 0 { /* assemble julianDay using new year, month, etc. */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ASSEMBLE_JULIANDAY) != 0 { XGetJulianDayFromEraYearMonthDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) *(*int32)(unsafe.Pointer(info + 136)) &= ^int32(CLF_ASSEMBLE_JULIANDAY) } (*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay += (*TDateInfo)(unsafe.Pointer(info)).FdateRelDay /* julianDay was changed, on demand (lazy) extract year, month, etc. again */ *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_DATE) | int32(CLF_ASSEMBLE_SECONDS) (*TDateInfo)(unsafe.Pointer(info)).FdateRelDay = 0 } /* relative time (seconds), if exceeds current date, do the day conversion and * leave rest of the increment in yyRelSeconds to add it hereafter in UTC seconds */ if (*TDateInfo)(unsafe.Pointer(info)).FdateRelSeconds != 0 { newSecs = (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay + (*TDateInfo)(unsafe.Pointer(info)).FdateRelSeconds /* if seconds increment outside of current date, increment day */ if newSecs/int64(SECONDS_PER_DAY) != (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay/int64(SECONDS_PER_DAY) { *(*TTcl_WideInt)(unsafe.Pointer(info + 168)) += newSecs / int64(SECONDS_PER_DAY) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay = 0 (*TDateInfo)(unsafe.Pointer(info)).FdateRelSeconds = newSecs % int64(SECONDS_PER_DAY) goto repeat_rel } } *(*int32)(unsafe.Pointer(info + 136)) &= ^int32(CLF_RELCONV) } /* * Do relative (ordinal) month */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ORDINALMONTH) != 0 { /* if needed extract year, month, etc. again */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ASSEMBLE_DATE) != 0 { _GetGregorianEraYearDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) _GetMonthDay(tls, info+24) _GetYearWeekDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) *(*int32)(unsafe.Pointer(info + 136)) &= ^int32(CLF_ASSEMBLE_DATE) } if (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinalIncr > 0 { monthDiff = (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinal - (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth if monthDiff <= 0 { monthDiff += int32(12) } (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinalIncr-- } else { monthDiff = (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth - (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinal if monthDiff >= 0 { monthDiff -= int32(12) } (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinalIncr++ } /* process it further via relative times */ *(*int32)(unsafe.Pointer(info + 24 + 40)) += (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinalIncr *(*TTcl_WideInt)(unsafe.Pointer(info + 160)) += int64(monthDiff) *(*int32)(unsafe.Pointer(info + 136)) &= ^int32(CLF_ORDINALMONTH) *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_RELCONV) | int32(CLF_ASSEMBLE_JULIANDAY) | int32(CLF_ASSEMBLE_SECONDS) goto repeat_rel } /* * Do relative weekday */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_DAYOFWEEK)|int32(CLF_HAVEDATE)) == int32(CLF_DAYOFWEEK) { /* restore scanned day of week */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = prevDayOfWeek /* if needed assemble julianDay now */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&int32(CLF_ASSEMBLE_JULIANDAY) != 0 { XGetJulianDayFromEraYearMonthDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) *(*int32)(unsafe.Pointer(info + 136)) &= ^int32(CLF_ASSEMBLE_JULIANDAY) } (*TDateInfo)(unsafe.Pointer(info)).Fdate.FisBce = 0 (*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay = _WeekdayOnOrBefore(tls, (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek, (*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay+int64(6)) + int64(int32(7)*(*TDateInfo)(unsafe.Pointer(info)).FdateDayOrdinal) if (*TDateInfo)(unsafe.Pointer(info)).FdateDayOrdinal > 0 { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay -= int64(7) } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_DATE) | int32(CLF_ASSEMBLE_SECONDS) } return TCL_OK } /*---------------------------------------------------------------------- * * ClockWeekdaysOffs -- * * Get offset in days for the number of week days corresponding the * given day of week (skipping Saturdays and Sundays). * * * Results: * Returns a day increment adjusted the given weekdays * *---------------------------------------------------------------------- */ func _ClockWeekdaysOffs(tls *libc.TLS, dayOfWeek int32, offs int32) (r int32) { var adj, day, resDayOfWeek, weeks int32 _, _, _, _ = adj, day, resDayOfWeek, weeks /* offset in days */ weeks = offs / int32(5) offs = offs % int32(5) /* compiler fix for negative offs - wrap (0, -1) -> (-1, 4) */ if offs < 0 { weeks-- offs = int32(5) + offs } offs += int32(7) * weeks /* resulting day of week */ day = offs % int32(7) /* compiler fix for negative offs - wrap (0, -1) -> (-1, 6) */ if day < 0 { day = int32(7) + day } resDayOfWeek = dayOfWeek + day /* adjust if we start from a weekend */ if dayOfWeek > int32(5) { adj = int32(5) - dayOfWeek offs += adj resDayOfWeek += adj } /* adjust if we end up on a weekend */ if resDayOfWeek > int32(5) { offs += int32(2) } return offs } /*---------------------------------------------------------------------- * * ClockAddObjCmd -- , clock add -- * * Adds an offset to a given time. * * Refer to the user documentation to see what it exactly does. * * Syntax: * clock add clockval ?count unit?... ?-option value? * * Parameters: * clockval -- Starting time value * count -- Amount of a unit of time to add * unit -- Unit of time to add, must be one of: * years year months month weeks week * days day hours hour minutes minute * seconds second * * Options: * -gmt BOOLEAN * Flag synonymous with '-timezone :GMT' * -timezone ZONE * Name of the time zone in which calculations are to be done. * -locale NAME * Name of the locale in which calculations are to be done. * Used to determine the Gregorian change date. * * Results: * Returns a standard Tcl result with the given time adjusted * by the given offset(s) in order. * * Notes: * It is possible that adding a number of months or years will adjust the * day of the month as well. For instance, the time at one month after * 31 January is either 28 or 29 February, because February has fewer * than 31 days. * *---------------------------------------------------------------------- */ func _ClockAddObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) /* Parameter values */ var _objPtr, dataPtr, info1, v9 uintptr var i, v8 TTcl_Size var ret, v3 int32 var v1 TTcl_WideInt var v4, v6 int64 var v5, v7 bool var _ /* offs at bp+312 */ TTcl_WideInt var _ /* opts at bp+0 */ TClockFmtScnCmdArgs var _ /* unitIndex at bp+304 */ int32 var _ /* yy at bp+64 */ TDateInfo _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, dataPtr, i, info1, ret, v1, v3, v4, v5, v6, v7, v8, v9 dataPtr = clientData /* Common structure used for parsing */ info1 = bp + 64 /* even number of arguments */ if objc&int32(1) == int32(1) { XTcl_WrongNumArgs(tls, interp, 0, objv, _syntax2) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+328, __ccgo_ts+12666, __ccgo_ts+13624, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } libc.Xmemset(tls, bp+64, 0, uint64(240)) /* * Extract values for the keywords. */ _ClockInitFmtScnArgs(tls, dataPtr, interp, bp) ret = _ClockParseFmtScnArgs(tls, bp, bp+64+24, int64(objc), objv, int32(CLC_OP_ADD), __ccgo_ts+14478) if ret != TCL_OK { goto done } /* time together as seconds of the day */ v1 = (*TDateInfo)(unsafe.Pointer(info1)).Fdate.FlocalSeconds % libc.Int64FromInt32(SECONDS_PER_DAY) (*TDateInfo)(unsafe.Pointer(info1)).Fdate.FsecondOfMin = v1 (*TDateInfo)(unsafe.Pointer(info1)).Fdate.FsecondOfDay = v1 /* seconds are in localSeconds (relative base date), so reset time here */ (*TDateInfo)(unsafe.Pointer(info1)).Fdate.Fhour = 0 (*TDateInfo)(unsafe.Pointer(info1)).Fdate.Fminutes = 0 (*TDateInfo)(unsafe.Pointer(info1)).FdateMeridian = int32(MER24) ret = int32(TCL_ERROR) /* * Find each offset and process date increment */ i = int64(2) for { if !(i < int64(objc)) { break } /* bypass not integers (options, allready processed above in ClockParseFmtScnArgs) */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+312) } if v3 != TCL_OK { goto _2 } /* get unit */ if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int64(1))*8)), uintptr(unsafe.Pointer(&_units)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+14506, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< v4; !v7 { if *(*int32)(unsafe.Pointer(bp + 304)) < 6 { v6 = int64(-int32(0x7fffffff)) } else { v6 = -int64(0x00F0000000000000) } } if v7 || *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) < v6 { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_INTEGER_VALUE_TOO_LARGE)*8))) goto done } /* nothing to do if zero quantity */ if !(*(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) != 0) { goto _2 } /* if in-between conversion needed (already have relative date/time), * correct date info, because the date may be changed, * so refresh it now */ if (*TDateInfo)(unsafe.Pointer(info1)).Fflags&int32(CLF_RELCONV) != 0 && (*(*int32)(unsafe.Pointer(bp + 304)) == 5 || (*TDateInfo)(unsafe.Pointer(info1)).FdateRelMonth != 0 || (*TDateInfo)(unsafe.Pointer(info1)).FdateRelDay != 0 || (*TDateInfo)(unsafe.Pointer(info1)).Fdate.FsecondOfMin+(*TDateInfo)(unsafe.Pointer(info1)).FdateRelSeconds > int64(SECONDS_PER_DAY) || (*TDateInfo)(unsafe.Pointer(info1)).Fdate.FsecondOfMin+(*TDateInfo)(unsafe.Pointer(info1)).FdateRelSeconds < 0) { if _ClockCalcRelTime(tls, info1) != TCL_OK { goto done } } /* process increment by offset + unit */ *(*int32)(unsafe.Pointer(info1 + 136)) |= int32(CLF_RELCONV) switch *(*int32)(unsafe.Pointer(bp + 304)) { case 0: *(*TTcl_WideInt)(unsafe.Pointer(info1 + 160)) += *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) * int64(12) case 1: *(*TTcl_WideInt)(unsafe.Pointer(info1 + 160)) += *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) case 2: fallthrough case 3: *(*TTcl_WideInt)(unsafe.Pointer(info1 + 168)) += *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) * int64(7) case 4: *(*TTcl_WideInt)(unsafe.Pointer(info1 + 168)) += *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) case 5: /* add number of week days (skipping Saturdays and Sundays) * to a relative days value. */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) = int64(_ClockWeekdaysOffs(tls, (*(*TDateInfo)(unsafe.Pointer(bp + 64))).Fdate.FdayOfWeek, int32(*(*TTcl_WideInt)(unsafe.Pointer(bp + 312))))) *(*TTcl_WideInt)(unsafe.Pointer(info1 + 168)) += *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) case 6: *(*TTcl_WideInt)(unsafe.Pointer(info1 + 176)) += *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) * int64(60) * int64(60) case 7: *(*TTcl_WideInt)(unsafe.Pointer(info1 + 176)) += *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) * int64(60) case 8: *(*TTcl_WideInt)(unsafe.Pointer(info1 + 176)) += *(*TTcl_WideInt)(unsafe.Pointer(bp + 312)) break } goto _2 _2: ; i += int64(2) } /* * Do relative times (if not yet already processed interim): */ if (*TDateInfo)(unsafe.Pointer(info1)).Fflags&int32(CLF_RELCONV) != 0 { if _ClockCalcRelTime(tls, info1) != TCL_OK { goto done } } /* Convert date info structure into UTC seconds */ ret = _ClockScanCommit(tls, bp+64, bp) goto done done: ; if (*(*TDateInfo)(unsafe.Pointer(bp + 64))).Fdate.FtzName != libc.UintptrFromInt32(0) { _objPtr = (*(*TDateInfo)(unsafe.Pointer(bp + 64))).Fdate.FtzName v9 = _objPtr v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr) } (*(*TDateInfo)(unsafe.Pointer(bp + 64))).Fdate.FtzName = libc.UintptrFromInt32(0) } if ret != TCL_OK { return ret } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, (*(*TDateInfo)(unsafe.Pointer(bp + 64))).Fdate.Fseconds)) return TCL_OK } var _syntax2 = __ccgo_ts + 14345 /* add "week" to units also (because otherwise ambiguous) */ var _units = [10]uintptr{ 0: __ccgo_ts + 14434, 1: __ccgo_ts + 14440, 2: __ccgo_ts + 14447, 3: __ccgo_ts + 14452, 4: __ccgo_ts + 14458, 5: __ccgo_ts + 14463, 6: __ccgo_ts + 14472, 7: __ccgo_ts + 14156, 8: __ccgo_ts + 11827, 9: libc.UintptrFromInt32(0), } /*---------------------------------------------------------------------- * * ClockSecondsObjCmd - * * Returns a count of microseconds since the epoch. * * Results: * Returns a standard Tcl result. * * Side effects: * None. * * This function implements the 'clock seconds' Tcl command. Refer to the user * documentation for details on what it does. * *---------------------------------------------------------------------- */ func _ClockSecondsObjCmd(tls *libc.TLS, dummy4548 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Parameter values */ var cachePtr, timeObj uintptr var uw_ TTcl_WideUInt var v1 bool var _ /* bignumValue_ at bp+16 */ Tmp_int var _ /* now at bp+0 */ TTcl_Time _, _, _, _ = cachePtr, timeObj, uw_, v1 if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, 0, objv, __ccgo_ts+14511) return int32(TCL_ERROR) } XTcl_GetTime(tls, bp) if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { timeObj = XTclThreadAllocObj(tls) } else { timeObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(timeObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(timeObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(timeObj)).Fbytes = libc.UintptrFromInt32(0) uw_ = libc.Uint64FromInt64((*(*TTcl_Time)(unsafe.Pointer(bp))).Fsec) if uw_ > libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) { if XTclBN_mp_init_u64(tls, bp+16, uw_) != MP_OKAY { XTcl_Panic(tls, __ccgo_ts+13273, libc.VaList(bp+48, __ccgo_ts+13293)) } XTclSetBignumInternalRep(tls, timeObj, bp+16) } else { *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(timeObj)).FinternalRep)) = libc.Int64FromUint64(uw_) (*TTcl_Obj)(unsafe.Pointer(timeObj)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } XTcl_SetObjResult(tls, interp, timeObj) return TCL_OK } // C documentation // // /* // *---------------------------------------------------------------------- // * // * ClockSafeCatchCmd -- // * // * Same as "::catch" command but avoids overwriting of interp state. // * // * See [554117edde] for more info (and proper solution). // * // *---------------------------------------------------------------------- // */ func _ClockSafeCatchCmd(tls *libc.TLS, dummy4580 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var _objPtr, iPtr, nval, prev, statePtr, v2 uintptr var flags, ret int32 var v1 TTcl_Size _, _, _, _, _, _, _, _, _ = _objPtr, flags, iPtr, nval, prev, ret, statePtr, v1, v2 iPtr = interp flags = 0 if objc == int32(1) { /* wrong # args : */ return XTcl_CatchObjCmd(tls, libc.UintptrFromInt32(0), interp, objc, objv) } statePtr = XTcl_SaveInterpState(tls, interp, 0) if !((*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FerrorInfo != 0) { /* todo: avoid traced get of errorInfo here */ (*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FerrorInfo = XTcl_ObjGetVar2(tls, interp, (*TInterp)(unsafe.Pointer(iPtr)).FeiVar, libc.UintptrFromInt32(0), 0) if (*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FerrorInfo != 0 { (*TTcl_Obj)(unsafe.Pointer((*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FerrorInfo)).FrefCount++ } flags |= int32(ERR_LEGACY_COPY) } if !((*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FerrorCode != 0) { /* todo: avoid traced get of errorCode here */ (*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FerrorCode = XTcl_ObjGetVar2(tls, interp, (*TInterp)(unsafe.Pointer(iPtr)).FecVar, libc.UintptrFromInt32(0), 0) if (*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FerrorCode != 0 { (*TTcl_Obj)(unsafe.Pointer((*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FerrorCode)).FrefCount++ } flags |= int32(ERR_LEGACY_COPY) } /* original catch */ ret = XTcl_CatchObjCmd(tls, libc.UintptrFromInt32(0), interp, objc, objv) if ret == int32(TCL_ERROR) { XTcl_DiscardInterpState(tls, statePtr) return int32(TCL_ERROR) } /* overwrite result in state with catch result */ nval = XTcl_GetObjResult(tls, interp) if (*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FobjResult != nval { prev = (*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FobjResult (*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FobjResult = nval if (*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FobjResult != 0 { (*TTcl_Obj)(unsafe.Pointer((*struct { Fstatus int32 Fflags int32 FreturnLevel int32 FreturnCode int32 FerrorInfo uintptr FerrorCode uintptr FreturnOpts uintptr FobjResult uintptr FerrorStack uintptr FresetErrorStack int32 })(unsafe.Pointer(statePtr)).FobjResult)).FrefCount++ } if prev != libc.UintptrFromInt32(0) { _objPtr = prev v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } /* set result (together with restore state) to interpreter */ XTcl_RestoreInterpState(tls, interp, statePtr) /* todo: unless ERR_LEGACY_COPY not set in restore (branch [bug-554117edde] not merged yet) */ *(*int32)(unsafe.Pointer(iPtr + 368)) |= flags & int32(ERR_LEGACY_COPY) return ret } /* *---------------------------------------------------------------------- * * TzsetIfNecessary -- * * Calls the tzset() library function if the contents of the TZ * environment variable has changed. * * Results: * An epoch counter to allow efficient checking if the timezone has * changed. * * Side effects: * Calls tzset. * *---------------------------------------------------------------------- */ type TClockTzStatic = struct { Fwas uintptr FlastRefresh int64 Fepoch Tsize_t FenvEpoch Tsize_t } var _tz = TClockTzStatic{ Fwas: uintptr(int64(-libc.Int32FromInt32(1))), } func _TzsetIfNecessary(tls *libc.TLS) (r Tsize_t) { bp := tls.Alloc(16) defer tls.Free(16) var epoch, v1, v3 Tsize_t var tzNow, v2, v4 uintptr var _ /* now at bp+0 */ TTcl_Time _, _, _, _, _, _ = epoch, tzNow, v1, v2, v3, v4 /* The tz.epoch that the TZ was read at. */ /* * Prevent performance regression on some platforms by resolving of system time zone: * small latency for check whether environment was changed (once per second) * no latency if environment was changed with tcl-env (compare both epoch values) */ XTcl_GetTime(tls, bp) if (*(*TTcl_Time)(unsafe.Pointer(bp))).Fsec == _tz.FlastRefresh && _tz.FenvEpoch == XTclEnvEpoch { return _tz.Fepoch } _tz.FenvEpoch = XTclEnvEpoch _tz.FlastRefresh = (*(*TTcl_Time)(unsafe.Pointer(bp))).Fsec /* check in lock */ XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_clockMutex))) tzNow = libc.Xgetenv(tls, __ccgo_ts+14525) if tzNow == libc.UintptrFromInt32(0) { tzNow = libc.Xgetenv(tls, __ccgo_ts+14532) } if tzNow != libc.UintptrFromInt32(0) && (_tz.Fwas == libc.UintptrFromInt32(0) || _tz.Fwas == uintptr(int64(-libc.Int32FromInt32(1))) || libc.Xstrcmp(tls, tzNow, _tz.Fwas) != 0) { libc.Xtzset(tls) if _tz.Fwas != libc.UintptrFromInt32(0) && _tz.Fwas != uintptr(int64(-libc.Int32FromInt32(1))) { XTclpFree(tls, _tz.Fwas) } _tz.Fwas = XTcl_Alloc(tls, uint64(1)*(libc.Xstrlen(tls, tzNow)+uint64(1))) libc.Xstrcpy(tls, _tz.Fwas, tzNow) v2 = uintptr(unsafe.Pointer(&_tz)) + 16 *(*Tsize_t)(unsafe.Pointer(v2))++ v1 = *(*Tsize_t)(unsafe.Pointer(v2)) epoch = v1 } else { if tzNow == libc.UintptrFromInt32(0) && _tz.Fwas != libc.UintptrFromInt32(0) { libc.Xtzset(tls) if _tz.Fwas != uintptr(int64(-libc.Int32FromInt32(1))) { XTclpFree(tls, _tz.Fwas) } _tz.Fwas = libc.UintptrFromInt32(0) v4 = uintptr(unsafe.Pointer(&_tz)) + 16 *(*Tsize_t)(unsafe.Pointer(v4))++ v3 = *(*Tsize_t)(unsafe.Pointer(v4)) epoch = v3 } else { epoch = _tz.Fepoch } } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_clockMutex))) return epoch } func _ClockFinalize(tls *libc.TLS, dummy4734 uintptr) { XClockFrmScnFinalize(tls) if _tz.Fwas != 0 && _tz.Fwas != uintptr(int64(-libc.Int32FromInt32(1))) { XTclpFree(tls, _tz.Fwas) } XTcl_MutexFinalize(tls, uintptr(unsafe.Pointer(&_clockMutex))) } const JDN_MAX_PRECBOUND = 100000000 const JDN_MAX_PRECISION = 8 const TCL_CLOCK_FULL_COMPAT = 1 var _ClockFmtMutex TTcl_Mutex /* Serializes access to common format list. */ /* * Derivation of tclStringHashKeyType with extra memory management trickery. */ var _ClockFmtScnStorageHashKeyType = TTcl_HashKeyType{ Fversion: int32(TCL_HASH_KEY_TYPE_VERSION), } func init() { p := unsafe.Pointer(&_ClockFmtScnStorageHashKeyType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(XTclHashStringKey) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompareStringKeys) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_ClockFmtScnStorageAllocProc) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_ClockFmtScnStorageFreeProc) } /* * Clock scan and format facilities. */ /* *---------------------------------------------------------------------- * * Clock_str2int, Clock_str2wideInt -- * * Fast inline-convertion of string to signed int or wide int by given * start/end. * * The given string should contain numbers chars only (because already * pre-validated within parsing routines) * * Results: * Returns a standard Tcl result. * TCL_OK - by successful conversion, TCL_ERROR by (wide) int overflow * *---------------------------------------------------------------------- */ func _Clock_str2int_no(tls *libc.TLS, out uintptr, p uintptr, e uintptr, sign int32) { var val int32 var v1 uintptr _, _ = val, v1 /* assert(e <= p + 10); */ val = 0 /* overflow impossible for 10 digits ("9..9"), so no needs to check at all */ for p < e { /* never overflows */ v1 = p p++ val = val*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1))) - int32('0')) } if sign < 0 { val = -val } *(*int32)(unsafe.Pointer(out)) = val } func _Clock_str2wideInt_no(tls *libc.TLS, out uintptr, p uintptr, e uintptr, sign int32) { var val TTcl_WideInt var v1 uintptr _, _ = val, v1 /* assert(e <= p + 18); */ val = 0 /* overflow impossible for 18 digits ("9..9"), so no needs to check at all */ for p < e { /* never overflows */ v1 = p p++ val = val*int64(10) + int64(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1)))-libc.Int32FromUint8('0')) } if sign < 0 { val = -val } *(*TTcl_WideInt)(unsafe.Pointer(out)) = val } /* int & Tcl_WideInt overflows may happens here (expected case) */ func _Clock_str2int(tls *libc.TLS, out uintptr, p uintptr, e uintptr, sign int32) (r int32) { var eNO, v1, v2, v3 uintptr var prev, prev1, val int32 _, _, _, _, _, _, _ = eNO, prev, prev1, val, v1, v2, v3 val = 0 /* overflow impossible for 10 digits ("9..9"), so no needs to check before */ eNO = p + uintptr(10) if eNO > e { eNO = e } for p < eNO { /* never overflows */ v1 = p p++ val = val*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1))) - int32('0')) } if sign >= 0 { for p < e { /* check for overflow */ prev = val v2 = p p++ val = val*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2))) - int32('0')) if val/int32(10) < prev { return int32(TCL_ERROR) } } } else { val = -val for p < e { /* check for overflow */ prev1 = val v3 = p p++ val = val*int32(10) - (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3))) - int32('0')) if val/int32(10) > prev1 { return int32(TCL_ERROR) } } } *(*int32)(unsafe.Pointer(out)) = val return TCL_OK } func _Clock_str2wideInt(tls *libc.TLS, out uintptr, p uintptr, e uintptr, sign int32) (r int32) { var eNO, v1, v2, v3 uintptr var prev, prev1, val TTcl_WideInt _, _, _, _, _, _, _ = eNO, prev, prev1, val, v1, v2, v3 val = 0 /* overflow impossible for 18 digits ("9..9"), so no needs to check before */ eNO = p + uintptr(18) if eNO > e { eNO = e } for p < eNO { /* never overflows */ v1 = p p++ val = val*int64(10) + int64(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1)))-libc.Int32FromUint8('0')) } if sign >= 0 { for p < e { /* check for overflow */ prev = val v2 = p p++ val = val*int64(10) + int64(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2)))-libc.Int32FromUint8('0')) if val/int64(10) < prev { return int32(TCL_ERROR) } } } else { val = -val for p < e { /* check for overflow */ prev1 = val v3 = p p++ val = val*int64(10) - int64(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3)))-libc.Int32FromUint8('0')) if val/int64(10) > prev1 { return int32(TCL_ERROR) } } } *(*TTcl_WideInt)(unsafe.Pointer(out)) = val return TCL_OK } func XTclAtoWIe(tls *libc.TLS, out uintptr, p uintptr, e uintptr, sign int32) (r int32) { return _Clock_str2wideInt(tls, out, p, e, sign) } /* *---------------------------------------------------------------------- * * Clock_itoaw, Clock_witoaw -- * * Fast inline-convertion of signed int or wide int to string, using * given padding with specified padchar and width (or without padding). * * This is a very fast replacement for sprintf("%02d"). * * Results: * Returns position in buffer after end of conversion result. * *---------------------------------------------------------------------- */ func _Clock_itoaw(tls *libc.TLS, buf uintptr, val int32, padchar uint8, width uint16) (r uintptr) { var c, c1, c2 uint8 var p, v1, v2, v3, v4, v5, v6, v7, v8 uintptr _, _, _, _, _, _, _, _, _, _, _, _ = c, c1, c2, p, v1, v2, v3, v4, v5, v6, v7, v8 /* positive integer */ if val >= 0 { /* check resp. recalculate width */ for libc.Int32FromUint16(width) <= int32(9) && val >= _wrange[width] { width++ } /* number to string backwards */ p = buf + uintptr(width) v1 = p p-- *(*uint8)(unsafe.Pointer(v1)) = uint8('\000') for cond := true; cond; cond = val > 0 { c = libc.Uint8FromInt32(val % int32(10)) val /= int32(10) v2 = p p-- *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32('0') + libc.Int32FromUint8(c)) } /* filling with pad-char */ for p >= buf { v3 = p p-- *(*uint8)(unsafe.Pointer(v3)) = padchar } return buf + uintptr(width) } /* negative integer */ if !(width != 0) { width++ } /* check resp. recalculate width (regarding sign) */ width-- for libc.Int32FromUint16(width) <= int32(9) && val <= -_wrange[width] { width++ } width++ /* number to string backwards */ p = buf + uintptr(width) v4 = p p-- *(*uint8)(unsafe.Pointer(v4)) = uint8('\000') /* differentiate platforms with -1 % 10 == 1 and -1 % 10 == -1 */ if -libc.Int32FromInt32(1)%libc.Int32FromInt32(10) == -int32(1) { for cond := true; cond; cond = val < 0 { c1 = libc.Uint8FromInt32(val % int32(10)) val /= int32(10) v5 = p p-- *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32('0') - libc.Int32FromUint8(c1)) } } else { for cond := true; cond; cond = val < 0 { c2 = libc.Uint8FromInt32(val % int32(10)) val /= int32(10) v6 = p p-- *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32('0') + libc.Int32FromUint8(c2)) } } /* sign by 0 padding */ if libc.Int32FromUint8(padchar) != int32('0') { v7 = p p-- *(*uint8)(unsafe.Pointer(v7)) = uint8('-') } /* filling with pad-char */ for p >= buf+uintptr(1) { v8 = p p-- *(*uint8)(unsafe.Pointer(v8)) = padchar } /* sign by non 0 padding */ if libc.Int32FromUint8(padchar) == int32('0') { *(*uint8)(unsafe.Pointer(p)) = uint8('-') } return buf + uintptr(width) } var _wrange = [10]int32{ 0: int32(1), 1: int32(10), 2: int32(100), 3: int32(1000), 4: int32(10000), 5: int32(100000), 6: int32(1000000), 7: int32(10000000), 8: int32(100000000), 9: int32(1000000000), } func XTclItoAw(tls *libc.TLS, buf uintptr, val int32, padchar uint8, width uint16) (r uintptr) { return _Clock_itoaw(tls, buf, val, padchar, width) } func _Clock_witoaw(tls *libc.TLS, buf uintptr, val TTcl_WideInt, padchar uint8, width uint16) (r uintptr) { var c, c1, c2 uint8 var p, v1, v2, v3, v4, v5, v6, v7, v8 uintptr var val2, val21 TTcl_WideInt _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, c1, c2, p, val2, val21, v1, v2, v3, v4, v5, v6, v7, v8 /* positive integer */ if val >= 0 { /* check resp. recalculate width */ if val >= int64(10000000000) { val2 = val / int64(10000000000) for libc.Int32FromUint16(width) <= int32(9) && val2 >= int64(_wrange1[width]) { width++ } width = uint16(int32(width) + libc.Int32FromInt32(10)) } else { for libc.Int32FromUint16(width) <= int32(9) && val >= int64(_wrange1[width]) { width++ } } /* number to string backwards */ p = buf + uintptr(width) v1 = p p-- *(*uint8)(unsafe.Pointer(v1)) = uint8('\000') for cond := true; cond; cond = val > 0 { c = libc.Uint8FromInt64(val % libc.Int64FromInt32(10)) val /= int64(10) v2 = p p-- *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32('0') + libc.Int32FromUint8(c)) } /* filling with pad-char */ for p >= buf { v3 = p p-- *(*uint8)(unsafe.Pointer(v3)) = padchar } return buf + uintptr(width) } /* negative integer */ if !(width != 0) { width++ } /* check resp. recalculate width (regarding sign) */ width-- if val <= -int64(10000000000) { val21 = val / int64(10000000000) for libc.Int32FromUint16(width) <= int32(9) && val21 <= int64(-_wrange1[width]) { width++ } width = uint16(int32(width) + libc.Int32FromInt32(10)) } else { for libc.Int32FromUint16(width) <= int32(9) && val <= int64(-_wrange1[width]) { width++ } } width++ /* number to string backwards */ p = buf + uintptr(width) v4 = p p-- *(*uint8)(unsafe.Pointer(v4)) = uint8('\000') /* differentiate platforms with -1 % 10 == 1 and -1 % 10 == -1 */ if -libc.Int32FromInt32(1)%libc.Int32FromInt32(10) == -int32(1) { for cond := true; cond; cond = val < 0 { c1 = libc.Uint8FromInt64(val % int64(10)) val /= int64(10) v5 = p p-- *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32('0') - libc.Int32FromUint8(c1)) } } else { for cond := true; cond; cond = val < 0 { c2 = libc.Uint8FromInt64(val % int64(10)) val /= int64(10) v6 = p p-- *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32('0') + libc.Int32FromUint8(c2)) } } /* sign by 0 padding */ if libc.Int32FromUint8(padchar) != int32('0') { v7 = p p-- *(*uint8)(unsafe.Pointer(v7)) = uint8('-') } /* filling with pad-char */ for p >= buf+uintptr(1) { v8 = p p-- *(*uint8)(unsafe.Pointer(v8)) = padchar } /* sign by non 0 padding */ if libc.Int32FromUint8(padchar) == int32('0') { *(*uint8)(unsafe.Pointer(p)) = uint8('-') } return buf + uintptr(width) } var _wrange1 = [10]int32{ 0: int32(1), 1: int32(10), 2: int32(100), 3: int32(1000), 4: int32(10000), 5: int32(100000), 6: int32(1000000), 7: int32(10000000), 8: int32(100000000), 9: int32(1000000000), } /* * Global GC as LIFO for released scan/format object storages. * * Used to holds last released CLOCK_FMT_SCN_STORAGE_GC_SIZE formats * (after last reference from Tcl-object will be removed). This is helpful * to avoid continuous (re)creation and compiling by some dynamically resp. * variable format objects, that could be often reused. * * As long as format storage is used resp. belongs to GC, it takes place in * FmtScnHashTable also. */ type TClockFmtScnStorage_GC = struct { FstackPtr uintptr FstackBound uintptr Fcount uint32 } /* * Global GC as LIFO for released scan/format object storages. * * Used to holds last released CLOCK_FMT_SCN_STORAGE_GC_SIZE formats * (after last reference from Tcl-object will be removed). This is helpful * to avoid continuous (re)creation and compiling by some dynamically resp. * variable format objects, that could be often reused. * * As long as format storage is used resp. belongs to GC, it takes place in * FmtScnHashTable also. */ var _ClockFmtScnStorage_GC = TClockFmtScnStorage_GC{} /* *---------------------------------------------------------------------- * * ClockFmtScnStorageGC_In -- * * Adds an format storage object to GC. * * If current GC is full (size larger as CLOCK_FMT_SCN_STORAGE_GC_SIZE) * this removes last unused storage at begin of GC stack (LIFO). * * Assumes caller holds the ClockFmtMutex. * * Results: * None. * *---------------------------------------------------------------------- */ func _ClockFmtScnStorageGC_In(tls *libc.TLS, entry uintptr) { var delEnt, v1 uintptr _, _ = delEnt, v1 /* add new entry */ (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FnextPtr = _ClockFmtScnStorage_GC.FstackPtr if _ClockFmtScnStorage_GC.FstackPtr != libc.UintptrFromInt32(0) { (*TClockFmtScnStorage)(unsafe.Pointer(_ClockFmtScnStorage_GC.FstackPtr)).FprevPtr = entry } (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FprevPtr = libc.UintptrFromInt32(0) _ClockFmtScnStorage_GC.FstackPtr = entry if _ClockFmtScnStorage_GC.FstackBound == libc.UintptrFromInt32(0) { _ClockFmtScnStorage_GC.FstackBound = entry } _ClockFmtScnStorage_GC.Fcount++ /* if GC ist full */ if _ClockFmtScnStorage_GC.Fcount > uint32(CLOCK_FMT_SCN_STORAGE_GC_SIZE) { /* GC stack is LIFO: delete first inserted entry */ delEnt = _ClockFmtScnStorage_GC.FstackBound _ClockFmtScnStorage_GC.FstackBound = (*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FprevPtr if (*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FprevPtr != libc.UintptrFromInt32(0) { (*TClockFmtScnStorage)(unsafe.Pointer((*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FprevPtr)).FnextPtr = (*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FnextPtr } else { _ClockFmtScnStorage_GC.FstackPtr = (*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FnextPtr } if (*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FnextPtr != libc.UintptrFromInt32(0) { (*TClockFmtScnStorage)(unsafe.Pointer((*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FnextPtr)).FprevPtr = (*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FprevPtr } _ClockFmtScnStorage_GC.Fcount-- v1 = libc.UintptrFromInt32(0) (*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FnextPtr = v1 (*TClockFmtScnStorage)(unsafe.Pointer(delEnt)).FprevPtr = v1 /* remove it now */ _ClockFmtScnStorageDelete(tls, delEnt) } } /* *---------------------------------------------------------------------- * * ClockFmtScnStorage_GC_Out -- * * Restores (for reusing) given format storage object from GC. * * Assumes caller holds the ClockFmtMutex. * * Results: * None. * *---------------------------------------------------------------------- */ func _ClockFmtScnStorage_GC_Out(tls *libc.TLS, entry uintptr) { var v1 uintptr _ = v1 if (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FprevPtr != libc.UintptrFromInt32(0) { (*TClockFmtScnStorage)(unsafe.Pointer((*TClockFmtScnStorage)(unsafe.Pointer(entry)).FprevPtr)).FnextPtr = (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FnextPtr } else { _ClockFmtScnStorage_GC.FstackPtr = (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FnextPtr } if (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FnextPtr != libc.UintptrFromInt32(0) { (*TClockFmtScnStorage)(unsafe.Pointer((*TClockFmtScnStorage)(unsafe.Pointer(entry)).FnextPtr)).FprevPtr = (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FprevPtr } _ClockFmtScnStorage_GC.Fcount-- if _ClockFmtScnStorage_GC.FstackBound == entry { _ClockFmtScnStorage_GC.FstackBound = (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FprevPtr } v1 = libc.UintptrFromInt32(0) (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FnextPtr = v1 (*TClockFmtScnStorage)(unsafe.Pointer(entry)).FprevPtr = v1 } // C documentation // // /* // * Global format storage hash table of type ClockFmtScnStorageHashKeyType // * (contains list of scan/format object storages, shared across all threads). // * // * Used for fast searching by format string. // */ var _FmtScnHashTable TTcl_HashTable var _initialized1 = int32(0) // C documentation // // /* // * Wrappers between pointers to hash entry and format storage object // */ func _HashEntry4FmtScn(tls *libc.TLS, fss uintptr) (r uintptr) { return fss + libc.UintptrFromInt32(1)*64 } func _FmtScn4HashEntry(tls *libc.TLS, hKeyPtr uintptr) (r uintptr) { return hKeyPtr - libc.UintptrFromInt64(64) } /* *---------------------------------------------------------------------- * * ClockFmtScnStorageAllocProc -- * * Allocate space for a hash entry containing format storage together * with the string key. * * Results: * The return value is a pointer to the created entry. * *---------------------------------------------------------------------- */ func _ClockFmtScnStorageAllocProc(tls *libc.TLS, dummy554 uintptr, keyPtr uintptr) (r uintptr) { /* Key to store in the hash table entry. */ var allocsize, size uint32 var fss, hPtr, string1 uintptr _, _, _, _, _ = allocsize, fss, hPtr, size, string1 string1 = keyPtr size = uint32(libc.Xstrlen(tls, string1) + uint64(1)) allocsize = uint32(libc.Uint64FromInt64(64) + libc.Uint64FromInt64(40)) allocsize += size if uint64(size) > uint64(8) { allocsize = uint32(uint64(allocsize) - libc.Uint64FromInt64(8)) } fss = XTcl_Alloc(tls, uint64(allocsize)) /* initialize */ libc.Xmemset(tls, fss, 0, uint64(64)) hPtr = _HashEntry4FmtScn(tls, fss) libc.Xmemcpy(tls, hPtr+32, string1, uint64(size)) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(0) /* currently unused */ return hPtr } /* *---------------------------------------------------------------------- * * ClockFmtScnStorageFreeProc -- * * Free format storage object and space of given hash entry. * * Results: * None. * *---------------------------------------------------------------------- */ func _ClockFmtScnStorageFreeProc(tls *libc.TLS, hPtr uintptr) { var fss uintptr _ = fss fss = _FmtScn4HashEntry(tls, hPtr) if (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTok != libc.UintptrFromInt32(0) { XTclpFree(tls, (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTok) (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTok = libc.UintptrFromInt32(0) (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC = uint32(0) } if (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTok != libc.UintptrFromInt32(0) { XTclpFree(tls, (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTok) (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTok = libc.UintptrFromInt32(0) (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC = uint32(0) } XTclpFree(tls, fss) } /* *---------------------------------------------------------------------- * * ClockFmtScnStorageDelete -- * * Delete format storage object. * * Results: * None. * *---------------------------------------------------------------------- */ func _ClockFmtScnStorageDelete(tls *libc.TLS, fss uintptr) { var hPtr uintptr _ = hPtr hPtr = _HashEntry4FmtScn(tls, fss) /* * This will delete a hash entry and call "Tcl_Free" for storage self, if * some additionally handling required, freeEntryProc can be used instead */ XTcl_DeleteHashEntry(tls, hPtr) } /* * Type definition of clock-format tcl object type. */ var _ClockFmtObjType = TTcl_ObjType{ Fname: __ccgo_ts + 14535, } func init() { p := unsafe.Pointer(&_ClockFmtObjType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_ClockFmtObj_FreeInternalRep) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_ClockFmtObj_DupInternalRep) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_ClockFmtObj_UpdateString) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_ClockFmtObj_SetFromAny) } func _ClockFmtObj_DupInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { var fss uintptr _ = fss fss = *(*uintptr)(unsafe.Pointer(srcPtr + 32)) if fss != libc.UintptrFromInt32(0) { XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FobjRefCount++ XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) } *(*uintptr)(unsafe.Pointer(copyPtr + 32)) = fss /* regards special case - format not localizable */ if *(*uintptr)(unsafe.Pointer(srcPtr + 32 + 8)) != srcPtr { *(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8)) = *(*uintptr)(unsafe.Pointer(srcPtr + 32 + 8)) if *(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8)) != 0 { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8)))).FrefCount++ } } else { *(*uintptr)(unsafe.Pointer(copyPtr + 32 + 8)) = copyPtr } (*TTcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr = uintptr(unsafe.Pointer(&_ClockFmtObjType)) /* if no format representation, dup string representation */ if fss == libc.UintptrFromInt32(0) { (*TTcl_Obj)(unsafe.Pointer(copyPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64((*TTcl_Obj)(unsafe.Pointer(srcPtr)).Flength+int64(1))) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(copyPtr)).Fbytes, (*TTcl_Obj)(unsafe.Pointer(srcPtr)).Fbytes, libc.Uint64FromInt64((*TTcl_Obj)(unsafe.Pointer(srcPtr)).Flength+int64(1))) (*TTcl_Obj)(unsafe.Pointer(copyPtr)).Flength = (*TTcl_Obj)(unsafe.Pointer(srcPtr)).Flength } } func _ClockFmtObj_FreeInternalRep(tls *libc.TLS, objPtr uintptr) { var _objPtr, fss, v2, v4 uintptr var v1 int32 var v3 TTcl_Size _, _, _, _, _, _ = _objPtr, fss, v1, v2, v3, v4 fss = *(*uintptr)(unsafe.Pointer(objPtr + 32)) if fss != libc.UintptrFromInt32(0) && _initialized1 != 0 { XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) /* decrement object reference count of format/scan storage */ v2 = fss *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) if v1 <= 0 { /* don't remove it right now (may be reusable), just add to GC */ _ClockFmtScnStorageGC_In(tls, fss) } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) } *(*uintptr)(unsafe.Pointer(objPtr + 32)) = libc.UintptrFromInt32(0) if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) != objPtr { if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) != libc.UintptrFromInt32(0) { _objPtr = *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) = libc.UintptrFromInt32(0) } } else { *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) = libc.UintptrFromInt32(0) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) } func _ClockFmtObj_SetFromAny(tls *libc.TLS, dummy717 uintptr, objPtr uintptr) (r int32) { /* validate string representation before free old internal representation */ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { _ = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { XTcl_GetStringFromObj(tls, objPtr, libc.UintptrFromInt32(0)) } /* free old internal representation */ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != libc.UintptrFromInt32(0) { if (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})))(tls, objPtr) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) } /* initial state of format object */ *(*uintptr)(unsafe.Pointer(objPtr + 32)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&_ClockFmtObjType)) return TCL_OK } func _ClockFmtObj_UpdateString(tls *libc.TLS, objPtr uintptr) { var fss, hPtr, name uintptr var len1, v1 Tsize_t _, _, _, _, _ = fss, hPtr, len1, name, v1 name = __ccgo_ts + 2095 fss = *(*uintptr)(unsafe.Pointer(objPtr + 32)) if fss != libc.UintptrFromInt32(0) { hPtr = _HashEntry4FmtScn(tls, fss) name = hPtr + 32 } len1 = libc.Xstrlen(tls, name) v1 = len1 len1++ (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = libc.Int64FromUint64(v1) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTclpAlloc(tls, len1) if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, name, len1) } } /* *---------------------------------------------------------------------- * * ClockFrmObjGetLocFmtKey -- * * Retrieves format key object used to search localized format. * * This is normally stored in second pointer of internal representation. * If format object is not localizable, it is equal the given format * pointer (special case to fast fallback by not-localizable formats). * * Results: * Returns tcl object with key or format object if not localizable. * * Side effects: * Converts given format object to ClockFmtObjType on demand for caching * the key inside its internal representation. * *---------------------------------------------------------------------- */ func XClockFrmObjGetLocFmtKey(tls *libc.TLS, interp uintptr, objPtr uintptr) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var keyObj, v1 uintptr _, _ = keyObj, v1 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&_ClockFmtObjType)) { if _ClockFmtObj_SetFromAny(tls, interp, objPtr) != TCL_OK { return libc.UintptrFromInt32(0) } } keyObj = *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) if keyObj != 0 { return keyObj } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, objPtr, libc.UintptrFromInt32(0)) } keyObj = XTcl_ObjPrintf(tls, __ccgo_ts+14548, libc.VaList(bp+8, v1)) *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) = keyObj if *(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)) != 0 { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objPtr + 32 + 8)))).FrefCount++ } return keyObj } /* *---------------------------------------------------------------------- * * FindOrCreateFmtScnStorage -- * * Retrieves format storage for given string format. * * This will find the given format in the global storage hash table * or create a format storage object on demaind and save the * reference in the first pointer of internal representation of given * object. * * Results: * Returns scan/format storage pointer to ClockFmtScnStorage. * * Side effects: * Converts given format object to ClockFmtObjType on demand for caching * the format storage reference inside its internal representation. * Increments objRefCount of the ClockFmtScnStorage reference. * *---------------------------------------------------------------------- */ func _FindOrCreateFmtScnStorage(tls *libc.TLS, interp uintptr, objPtr uintptr) (r uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var fss, hPtr, strFmt, v1, v2 uintptr var _ /* isNew at bp+0 */ int32 _, _, _, _, _ = fss, hPtr, strFmt, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, objPtr, libc.UintptrFromInt32(0)) } strFmt = v1 fss = libc.UintptrFromInt32(0) XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) /* if not yet initialized */ if !(_initialized1 != 0) { /* initialize hash table */ XTcl_InitCustomHashTable(tls, uintptr(unsafe.Pointer(&_FmtScnHashTable)), -int32(2), uintptr(unsafe.Pointer(&_ClockFmtScnStorageHashKeyType))) _initialized1 = int32(1) } /* get or create entry (and alocate storage) */ hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&_FmtScnHashTable)))).FcreateProc})))(tls, uintptr(unsafe.Pointer(&_FmtScnHashTable)), strFmt, bp) if hPtr != libc.UintptrFromInt32(0) { fss = _FmtScn4HashEntry(tls, hPtr) /* unlink if it is currently in GC */ if *(*int32)(unsafe.Pointer(bp)) == 0 && (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FobjRefCount == 0 { _ClockFmtScnStorage_GC_Out(tls, fss) } /* new reference, so increment in lock right now */ (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FobjRefCount++ *(*uintptr)(unsafe.Pointer(objPtr + 32)) = fss } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) if fss == libc.UintptrFromInt32(0) && interp != libc.UintptrFromInt32(0) { if strFmt != 0 { v2 = strFmt } else { v2 = __ccgo_ts + 1945 } XTcl_AppendResult(tls, interp, libc.VaList(bp+16, __ccgo_ts+14555, v2, __ccgo_ts+14586, libc.UintptrFromInt32(0))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+14588, libc.UintptrFromInt32(0))) } return fss } /* *---------------------------------------------------------------------- * * Tcl_GetClockFrmScnFromObj -- * * Returns a clock format/scan representation of (*objPtr), if possible. * If something goes wrong, NULL is returned, and if interp is non-NULL, * an error message is written there. * * Results: * Valid representation of type ClockFmtScnStorage. * * Side effects: * Caches the ClockFmtScnStorage reference as the internal rep of (*objPtr) * and in global hash table, shared across all threads. * *---------------------------------------------------------------------- */ func XTcl_GetClockFrmScnFromObj(tls *libc.TLS, interp uintptr, objPtr uintptr) (r uintptr) { var fss uintptr _ = fss if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != uintptr(unsafe.Pointer(&_ClockFmtObjType)) { if _ClockFmtObj_SetFromAny(tls, interp, objPtr) != TCL_OK { return libc.UintptrFromInt32(0) } } fss = *(*uintptr)(unsafe.Pointer(objPtr + 32)) if fss == libc.UintptrFromInt32(0) { fss = _FindOrCreateFmtScnStorage(tls, interp, objPtr) } return fss } /* *---------------------------------------------------------------------- * * ClockLocalizeFormat -- * * Wrap the format object in options to the localized format, * corresponding given locale. * * This searches localized format in locale catalog, and if not yet * exists, it executes ::tcl::clock::LocalizeFormat in given interpreter * and caches its result in the locale catalog. * * Results: * Localized format object. * * Side effects: * Caches the localized format inside locale catalog. * *---------------------------------------------------------------------- */ func XClockLocalizeFormat(tls *libc.TLS, opts uintptr) (r uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, _objPtr1, dataPtr, keyObj, v2, v4, v5 uintptr var v1, v3 TTcl_Size var _ /* callargs at bp+8 */ [4]uintptr var _ /* valObj at bp+0 */ uintptr _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, dataPtr, keyObj, v1, v2, v3, v4, v5 dataPtr = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) keyObj = XClockFrmObjGetLocFmtKey(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FformatObj) /* special case - format object is not localizable */ if keyObj == (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FformatObj { return (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FformatObj } /* prevents loss of key object if the format object (where key stored) * becomes changed (loses its internal representation during evals) */ (*TTcl_Obj)(unsafe.Pointer(keyObj)).FrefCount++ if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { XClockMCDict(tls, opts) if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj == libc.UintptrFromInt32(0) { goto done } } /* try to find in cache within locale mc-catalog */ if XTcl_DictObjGet(tls, libc.UintptrFromInt32(0), (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj, keyObj, bp) != TCL_OK { goto done } /* call LocalizeFormat locale format fmtkey */ if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).Fliterals + uintptr(LIT_LOCALIZE_FORMAT)*8)) (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)] = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FlocaleObj (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[int32(2)] = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FformatObj (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[int32(3)] = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj if XTcl_EvalObjv(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, int64(4), bp+8, 0) == TCL_OK { *(*uintptr)(unsafe.Pointer(bp)) = XTcl_GetObjResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp) } /* ensure mcDictObj remains unshared */ if (*TTcl_Obj)(unsafe.Pointer((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj)).FrefCount > int64(1) { /* smart reference (shared dict as object with no ref-counter) */ (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj = XTclDictObjSmartRef(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj) } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { goto done } /* cache it inside mc-dictionary (this incr. ref count of keyObj/valObj) */ if XTcl_DictObjPut(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FmcDictObj, keyObj, *(*uintptr)(unsafe.Pointer(bp))) != TCL_OK { *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) goto done } XTcl_ResetResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp) /* check special case - format object is not localizable */ if *(*uintptr)(unsafe.Pointer(bp)) == (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FformatObj { /* mark it as unlocalizable, by setting self as key (without refcount incr) */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&_ClockFmtObjType)) { if *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32 + 8)) != libc.UintptrFromInt32(0) { _objPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32 + 8)) v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32 + 8)) = libc.UintptrFromInt32(0) } *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32 + 8)) = *(*uintptr)(unsafe.Pointer(bp)) } } } goto done done: ; if keyObj != libc.UintptrFromInt32(0) { _objPtr1 = keyObj v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } keyObj = libc.UintptrFromInt32(0) } v5 = *(*uintptr)(unsafe.Pointer(bp)) (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FformatObj = v5 return v5 } /* *---------------------------------------------------------------------- * * FindTokenBegin -- * * Find begin of given scan token in string, corresponding token type. * * Results: * Position of token inside string if found. Otherwise - end of string. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FindTokenBegin(tls *libc.TLS, p uintptr, end uintptr, tok uintptr, flags int32) (r uintptr) { var c uint8 var v10, v12, v14, v21, v25, v27, v29 bool var v11, v13, v20, v26, v28 uintptr var v17, v18, v22, v23, v7, v8 int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, v10, v11, v12, v13, v14, v17, v18, v20, v21, v22, v23, v25, v26, v27, v28, v29, v7, v8 if p < end { /* next token a known token type */ switch libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Ftype1) { case int32(CTOKT_WIDE): goto _1 case int32(CTOKT_INT): goto _2 case int32(CTOKT_WORD): goto _3 case int32(CTOKT_SPACE): goto _4 case int32(CTOKT_CHAR): goto _5 } goto _6 _2: ; _1: ; if !(flags&int32(CLF_STRICT) != 0) { /* should match at least one digit or space */ for { if v10 = !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0); v10 { v7 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v8 = libc.BoolInt32(v7 == int32(' ') || libc.Uint32FromInt32(v7)-uint32('\t') < uint32(5)) goto _9 _9: } if v12 = v10 && !(v8 != 0); v12 { v11 = XTcl_UtfNext(tls, p) p = v11 } if !(v12 && v11 < end) { break } } } else { /* should match at least one digit */ for { if v14 = !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0); v14 { v13 = XTcl_UtfNext(tls, p) p = v13 } if !(v14 && v13 < end) { break } } } return p _3: ; c = *(*uint8)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fstart)) goto findChar _4: ; _16: ; v17 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v18 = libc.BoolInt32(v17 == int32(' ') || libc.Uint32FromInt32(v17)-uint32('\t') < uint32(5)) goto _19 _19: ; if v21 = !(v18 != 0); v21 { v20 = XTcl_UtfNext(tls, p) p = v20 } if !(v21 && v20 < end) { goto _15 } goto _16 _15: ; return p _5: ; c = *(*uint8)(unsafe.Pointer((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Fdata)) goto findChar findChar: ; if !(flags&int32(CLF_STRICT) != 0) { /* should match the char or space */ for { if v25 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) != libc.Int32FromUint8(c); v25 { v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v23 = libc.BoolInt32(v22 == int32(' ') || libc.Uint32FromInt32(v22)-uint32('\t') < uint32(5)) goto _24 _24: } if v27 = v25 && !(v23 != 0); v27 { v26 = XTcl_UtfNext(tls, p) p = v26 } if !(v27 && v26 < end) { break } } } else { /* should match the char */ for { if v29 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) != libc.Int32FromUint8(c); v29 { v28 = XTcl_UtfNext(tls, p) p = v28 } if !(v29 && v28 < end) { break } } } return p _6: } return p } /* *---------------------------------------------------------------------- * * DetermineGreedySearchLen -- * * Determine min/max lengths as exact as possible (speed, greedy match). * * Results: * None. Lengths are stored in *minLenPtr, *maxLenPtr. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _DetermineGreedySearchLen(tls *libc.TLS, opts uintptr, info uintptr, tok uintptr, minLenPtr uintptr, maxLenPtr uintptr) { var end, f, laTok, p uintptr var maxLen, minLen int32 _, _, _, _, _, _ = end, f, laTok, maxLen, minLen, p minLen = libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).FminSize) p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput + uintptr(minLen) end = (*TDateInfo)(unsafe.Pointer(info)).FdateEnd /* if still tokens available, try to correct minimum length */ if (*TClockScanToken)(unsafe.Pointer(tok+libc.UintptrFromInt32(1)*32)).Fmap1 != 0 { end -= uintptr(libc.Int32FromUint16((*TClockScanToken)(unsafe.Pointer(tok)).FendDistance) + (*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount) /* find position of next known token */ p = _FindTokenBegin(tls, p, end, tok+uintptr(1)*32, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags) if p < end { minLen = int32(int64(p) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput)) } } /* max length to the end regarding distance to end (min-width of following tokens) */ maxLen = int32(int64(end) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput)) /* several amendments */ if maxLen > libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).FmaxSize) { maxLen = libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).FmaxSize) } if minLen < libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).FminSize) { minLen = libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).FminSize) } if minLen > maxLen { maxLen = minLen } if int64(maxLen) > int64((*TDateInfo)(unsafe.Pointer(info)).FdateEnd)-int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) { maxLen = int32(int64((*TDateInfo)(unsafe.Pointer(info)).FdateEnd) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput)) } /* check digits rigth now */ if libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Ftype1) == int32(CTOKT_INT) || libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Ftype1) == int32(CTOKT_WIDE) { p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput end = p + uintptr(maxLen) if end > (*TDateInfo)(unsafe.Pointer(info)).FdateEnd { end = (*TDateInfo)(unsafe.Pointer(info)).FdateEnd } for libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-uint32('0') < uint32(10)) != 0 && p < end { p++ } maxLen = int32(int64(p) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput)) } /* try to get max length more precise for greedy match, * check the next ahead token available there */ if minLen < maxLen && (*TClockScanToken)(unsafe.Pointer(tok)).FlookAhTok != 0 { laTok = tok + uintptr((*TClockScanToken)(unsafe.Pointer(tok)).FlookAhTok)*32 + uintptr(1)*32 p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput + uintptr(maxLen) /* regards all possible spaces here (because they are optional) */ end = p + uintptr((*TClockScanToken)(unsafe.Pointer(tok)).FlookAhMax) + uintptr((*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount) + uintptr(1) if end > (*TDateInfo)(unsafe.Pointer(info)).FdateEnd { end = (*TDateInfo)(unsafe.Pointer(info)).FdateEnd } p += uintptr((*TClockScanToken)(unsafe.Pointer(tok)).FlookAhMin) if (*TClockScanToken)(unsafe.Pointer(laTok)).Fmap1 != 0 && p < end { /* try to find laTok between [lookAhMin, lookAhMax] */ for minLen < maxLen { f = _FindTokenBegin(tls, p, end, laTok, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags) /* if found (not below lookAhMax) */ if f < end { break } /* try again with fewer length */ maxLen-- p-- end-- } } else { if p > end { maxLen = int32(int64(maxLen) - (int64(p) - int64(end))) if maxLen < minLen { maxLen = minLen } } } } *(*int32)(unsafe.Pointer(minLenPtr)) = minLen *(*int32)(unsafe.Pointer(maxLenPtr)) = maxLen } /* *---------------------------------------------------------------------- * * ObjListSearch -- * * Find largest part of the input string from start regarding min and * max lengths in the given list (utf-8, case sensitive). * * Results: * TCL_OK - match found, TCL_RETURN - not matched, TCL_ERROR in error case. * * Side effects: * Input points to end of the found token in string. * *---------------------------------------------------------------------- */ func _ObjListSearch(tls *libc.TLS, info uintptr, val uintptr, lstv uintptr, lstc TTcl_Size, minLen int32, maxLen int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var f, ret, s, v10, v2, v3, v4, v5, v6 uintptr var i, lf TTcl_Size var v12 bool var v8, v9 int64 var _ /* ch1 at bp+0 */ TTcl_UniChar var _ /* ch2 at bp+4 */ TTcl_UniChar var _ /* l at bp+8 */ TTcl_Size var _ /* sf at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = f, i, lf, ret, s, v10, v12, v2, v3, v4, v5, v6, v8, v9 lf = int64(-int32(1)) /* search in list */ i = 0 for { if !(i < lstc) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(lstv + uintptr(i)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(lstv + uintptr(i)*8)))).Flength v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(lstv + uintptr(i)*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(lstv + uintptr(i)*8)), bp+8) } s = v2 if v12 = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) >= int64(minLen); v12 { v4 = (*TDateInfo)(unsafe.Pointer(info)).FdateInput v5 = s ret = v4 for { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4))) v8 = int64(libc.Int32FromInt32(1)) } else { v8 = XTcl_UtfToUniChar(tls, v4, bp) } v4 += uintptr(v8) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v5))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v5))) v9 = int64(libc.Int32FromInt32(1)) } else { v9 = XTcl_UtfToUniChar(tls, v5, bp+4) } v5 += uintptr(v9) if *(*TTcl_UniChar)(unsafe.Pointer(bp)) != *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(bp))) *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) = XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(bp + 4))) if *(*TTcl_UniChar)(unsafe.Pointer(bp)) != *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) { break } } *(*uintptr)(unsafe.Pointer(bp + 16)) = v5 goto _7 _7: ; v6 = v4 ret = v6 if !(v6 < (*TDateInfo)(unsafe.Pointer(info)).FdateInput+uintptr(maxLen) && v5 < s+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) { break } } v10 = ret goto _11 _11: v3 = v10 f = v3 } if v12 && v3 > (*TDateInfo)(unsafe.Pointer(info)).FdateInput { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(f) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) < int64(minLen) { goto _1 } /* found, try to find longest value (greedy search) */ if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) < int64(maxLen) && minLen != maxLen { lf = i minLen = int32(*(*TTcl_Size)(unsafe.Pointer(bp + 8)) + int64(1)) goto _1 } /* max possible - end of search */ *(*int32)(unsafe.Pointer(val)) = int32(i) *(*uintptr)(unsafe.Pointer(info + 8)) += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) break } goto _1 _1: ; i++ } /* if found */ if i < lstc { return TCL_OK } if lf >= 0 { *(*int32)(unsafe.Pointer(val)) = int32(lf) *(*uintptr)(unsafe.Pointer(info + 8)) += uintptr(minLen - int32(1)) return TCL_OK } return int32(TCL_RETURN) } /* *---------------------------------------------------------------------- * * ClockMCGetListIdxTree -- * * Retrieves localized string indexed tree in the locale catalog for * given literal index mcKey (and builds it on demand). * * Searches localized index in locale catalog, and if not yet exists, * creates string indexed tree and stores it in the locale catalog. * * Results: * Localized string index tree. * * Side effects: * Caches the localized string index tree inside locale catalog. * *---------------------------------------------------------------------- */ func _ClockMCGetListIdxTree(tls *libc.TLS, opts uintptr, mcKey int32) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, idxTree, objPtr, valObj, v1, v3, v8 uintptr var v2 bool var v4 int32 var v5, v6 int64 var v7 TTcl_Size var _ /* lstc at bp+8 */ TTcl_Size var _ /* lstv at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, idxTree, objPtr, valObj, v1, v2, v3, v4, v5, v6, v7, v8 objPtr = XClockMCGetIdx(tls, opts, mcKey) if v2 = objPtr != libc.UintptrFromInt32(0); v2 { v1 = XTclStrIdxTreeGetFromObj(tls, objPtr) idxTree = v1 } if v2 && v1 != libc.UintptrFromInt32(0) { return idxTree } else { objPtr = XTclStrIdxTreeNewObj(tls) v3 = XTclStrIdxTreeGetFromObj(tls, objPtr) idxTree = v3 if v3 == libc.UintptrFromInt32(0) { goto done /* unexpected, but ...*/ } valObj = XClockMCGet(tls, opts, mcKey) if valObj == libc.UintptrFromInt32(0) { goto done } if (*TTcl_Obj)(unsafe.Pointer(valObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr2)).FspanStart } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr1 + 40 + uintptr(v5)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr2 != 0 { v6 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr2)).FspanLength } else { v6 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v6 v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_ListObjGetElements(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, valObj, bp+8, bp) } if v4 != TCL_OK { goto done } if XTclStrIdxTreeBuildFromList(tls, idxTree, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp)), libc.UintptrFromInt32(0)) != TCL_OK { goto done } XClockMCSetIdx(tls, opts, mcKey, objPtr) objPtr = libc.UintptrFromInt32(0) } goto done done: ; if objPtr != 0 { _objPtr = objPtr v8 = _objPtr v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr) } idxTree = libc.UintptrFromInt32(0) } return idxTree } /* *---------------------------------------------------------------------- * * ClockMCGetMultiListIdxTree -- * * Retrieves localized string indexed tree in the locale catalog for * multiple lists by literal indices mcKeys (and builds it on demand). * * Searches localized index in locale catalog for mcKey, and if not * yet exists, creates string indexed tree and stores it in the * locale catalog. * * Results: * Localized string index tree. * * Side effects: * Caches the localized string index tree inside locale catalog. * *---------------------------------------------------------------------- */ func _ClockMCGetMultiListIdxTree(tls *libc.TLS, opts uintptr, mcKey int32, mcKeys uintptr) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, idxTree, objPtr, valObj, v1, v3, v8 uintptr var v2 bool var v4 int32 var v5, v6 int64 var v7 TTcl_Size var _ /* lstc at bp+8 */ TTcl_Size var _ /* lstv at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, idxTree, objPtr, valObj, v1, v2, v3, v4, v5, v6, v7, v8 objPtr = XClockMCGetIdx(tls, opts, mcKey) if v2 = objPtr != libc.UintptrFromInt32(0); v2 { v1 = XTclStrIdxTreeGetFromObj(tls, objPtr) idxTree = v1 } if v2 && v1 != libc.UintptrFromInt32(0) { return idxTree } else { objPtr = XTclStrIdxTreeNewObj(tls) v3 = XTclStrIdxTreeGetFromObj(tls, objPtr) idxTree = v3 if v3 == libc.UintptrFromInt32(0) { goto done /* unexpected, but ...*/ } for *(*int32)(unsafe.Pointer(mcKeys)) != 0 { valObj = XClockMCGet(tls, opts, *(*int32)(unsafe.Pointer(mcKeys))) if valObj == libc.UintptrFromInt32(0) { goto done } if (*TTcl_Obj)(unsafe.Pointer(valObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr2)).FspanStart } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr1 + 40 + uintptr(v5)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr2 != 0 { v6 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr2)).FspanLength } else { v6 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v6 v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_ListObjGetElements(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, valObj, bp+8, bp) } if v4 != TCL_OK { goto done } if XTclStrIdxTreeBuildFromList(tls, idxTree, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp)), libc.UintptrFromInt32(0)) != TCL_OK { goto done } mcKeys += 4 } XClockMCSetIdx(tls, opts, mcKey, objPtr) objPtr = libc.UintptrFromInt32(0) } goto done done: ; if objPtr != 0 { _objPtr = objPtr v8 = _objPtr v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr) } idxTree = libc.UintptrFromInt32(0) } return idxTree } /* *---------------------------------------------------------------------- * * ClockStrIdxTreeSearch -- * * Find largest part of the input string from start regarding lengths * in the given localized string indexed tree (utf-8, case sensitive). * * Results: * TCL_OK - match found and the index stored in *val, * TCL_RETURN - not matched or ambigous, * TCL_ERROR - in error case. * * Side effects: * Input points to end of the found token in string. * *---------------------------------------------------------------------- */ func _ClockStrIdxTreeSearch(tls *libc.TLS, info uintptr, idxTree uintptr, val uintptr, minLen int32, maxLen int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var f uintptr var _ /* foundItem at bp+0 */ uintptr _ = f f = XTclStrIdxTreeSearch(tls, libc.UintptrFromInt32(0), bp, idxTree, (*TDateInfo)(unsafe.Pointer(info)).FdateInput, (*TDateInfo)(unsafe.Pointer(info)).FdateInput+uintptr(maxLen)) if f <= (*TDateInfo)(unsafe.Pointer(info)).FdateInput || int64(f)-int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) < int64(minLen) { /* not found */ return int32(TCL_RETURN) } if !((*TTclStrIdx)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fvalue != 0) { /* ambigous */ return int32(TCL_RETURN) } *(*int32)(unsafe.Pointer(val)) = int32(int64((*TTclStrIdx)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fvalue)) /* shift input pointer */ (*TDateInfo)(unsafe.Pointer(info)).FdateInput = f return TCL_OK } func _FindWordEnd(tls *libc.TLS, tok uintptr, p uintptr, end uintptr) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var ret, x, v1, v2, v3, v4, v8 uintptr var v6, v7 int64 var _ /* ch1 at bp+0 */ TTcl_UniChar var _ /* ch2 at bp+4 */ TTcl_UniChar var _ /* pfnd at bp+8 */ uintptr _, _, _, _, _, _, _, _, _ = ret, x, v1, v2, v3, v4, v6, v7, v8 x = (*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fstart *(*uintptr)(unsafe.Pointer(bp + 8)) = p if x == (*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fend-uintptr(1) { /* fast phase-out for single char word */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(x))) { p++ v1 = p return v1 } } /* multi-char word */ v2 = x v3 = p ret = v2 for { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2))) v6 = int64(libc.Int32FromInt32(1)) } else { v6 = XTcl_UtfToUniChar(tls, v2, bp) } v2 += uintptr(v6) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3))) v7 = int64(libc.Int32FromInt32(1)) } else { v7 = XTcl_UtfToUniChar(tls, v3, bp+4) } v3 += uintptr(v7) if *(*TTcl_UniChar)(unsafe.Pointer(bp)) != *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(bp))) *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) = XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(bp + 4))) if *(*TTcl_UniChar)(unsafe.Pointer(bp)) != *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) { break } } *(*uintptr)(unsafe.Pointer(bp + 8)) = v3 goto _5 _5: ; v4 = v2 ret = v4 if !(v4 < (*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fend && v3 < end) { break } } v8 = ret goto _9 _9: x = v8 if x < (*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fend { /* no match -> error */ return libc.UintptrFromInt32(0) } return *(*uintptr)(unsafe.Pointer(bp + 8)) } func _ClockScnToken_Month_Proc(tls *libc.TLS, opts uintptr, info uintptr, tok uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var idxTree uintptr var ret int32 var _ /* maxLen at bp+8 */ int32 var _ /* minLen at bp+4 */ int32 var _ /* val at bp+0 */ int32 _, _ = idxTree, ret _DetermineGreedySearchLen(tls, opts, info, tok, bp+4, bp+8) /* get or create tree in msgcat dict */ idxTree = _ClockMCGetMultiListIdxTree(tls, opts, int32(MCLIT_MONTHS_COMB), uintptr(unsafe.Pointer(&_monthsKeys))) if idxTree == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } ret = _ClockStrIdxTreeSearch(tls, info, idxTree, bp, *(*int32)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8))) if ret != TCL_OK { return ret } (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = *(*int32)(unsafe.Pointer(bp)) return TCL_OK } var _monthsKeys = [3]int32{ 0: int32(MCLIT_MONTHS_FULL), 1: int32(MCLIT_MONTHS_ABBREV), } func _ClockScnToken_DayOfWeek_Proc(tls *libc.TLS, opts uintptr, info uintptr, tok uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var curTok uint8 var idxTree uintptr var ret int32 var _ /* maxLen at bp+8 */ int32 var _ /* minLen at bp+4 */ int32 var _ /* val at bp+0 */ int32 _, _, _ = curTok, idxTree, ret curTok = *(*uint8)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fstart)) _DetermineGreedySearchLen(tls, opts, info, tok, bp+4, bp+8) /* %u %w %Ou %Ow */ if libc.Int32FromUint8(curTok) != int32('a') && libc.Int32FromUint8(curTok) != int32('A') && (*(*int32)(unsafe.Pointer(bp + 4)) <= int32(1) && *(*int32)(unsafe.Pointer(bp + 8)) >= int32(1) || int64((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Fdata) != 0) { *(*int32)(unsafe.Pointer(bp)) = -int32(1) if int64((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Fdata) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput))) <= int32('9') { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput))) - int32('0') } } else { idxTree = _ClockMCGetListIdxTree(tls, opts, int32(int64((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Fdata))) if idxTree == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } ret = _ClockStrIdxTreeSearch(tls, info, idxTree, bp, *(*int32)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8))) if ret != TCL_OK { return ret } *(*int32)(unsafe.Pointer(bp))-- } if *(*int32)(unsafe.Pointer(bp)) == -int32(1) { return int32(TCL_RETURN) } if *(*int32)(unsafe.Pointer(bp)) == 0 { *(*int32)(unsafe.Pointer(bp)) = int32(7) } if *(*int32)(unsafe.Pointer(bp)) > int32(7) { XTcl_SetObjResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, XTcl_NewStringObj(tls, __ccgo_ts+14595, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, libc.VaList(bp+24, __ccgo_ts+12666, __ccgo_ts+14625, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = *(*int32)(unsafe.Pointer(bp)) (*TDateInfo)(unsafe.Pointer(info)).FdateInput++ return TCL_OK } /* %a %A */ idxTree = _ClockMCGetMultiListIdxTree(tls, opts, int32(MCLIT_DAYS_OF_WEEK_COMB), uintptr(unsafe.Pointer(&_dowKeys))) if idxTree == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } ret = _ClockStrIdxTreeSearch(tls, info, idxTree, bp, *(*int32)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8))) if ret != TCL_OK { return ret } *(*int32)(unsafe.Pointer(bp))-- if *(*int32)(unsafe.Pointer(bp)) == 0 { *(*int32)(unsafe.Pointer(bp)) = int32(7) } (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = *(*int32)(unsafe.Pointer(bp)) return TCL_OK } var _dowKeys = [3]int32{ 0: int32(MCLIT_DAYS_OF_WEEK_ABBREV), 1: int32(MCLIT_DAYS_OF_WEEK_FULL), } func _ClockScnToken_amPmInd_Proc(tls *libc.TLS, opts uintptr, info uintptr, tok uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var ret int32 var _ /* amPmObj at bp+16 */ [2]uintptr var _ /* maxLen at bp+8 */ int32 var _ /* minLen at bp+4 */ int32 var _ /* val at bp+0 */ int32 _ = ret _DetermineGreedySearchLen(tls, opts, info, tok, bp+4, bp+8) (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0] = XClockMCGet(tls, opts, int32(MCLIT_AM)) (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[int32(1)] = XClockMCGet(tls, opts, int32(MCLIT_PM)) if (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0] == libc.UintptrFromInt32(0) || (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[int32(1)] == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } ret = _ObjListSearch(tls, info, bp, bp+16, int64(2), *(*int32)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8))) if ret != TCL_OK { return ret } if *(*int32)(unsafe.Pointer(bp)) == 0 { (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian = int32(MERam) } else { (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian = int32(MERpm) } return TCL_OK } func _ClockScnToken_LocaleERA_Proc(tls *libc.TLS, opts uintptr, info uintptr, tok uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var dataPtr uintptr var ret int32 var _ /* eraObj at bp+16 */ [6]uintptr var _ /* maxLen at bp+8 */ int32 var _ /* minLen at bp+4 */ int32 var _ /* val at bp+0 */ int32 _, _ = dataPtr, ret dataPtr = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr _DetermineGreedySearchLen(tls, opts, info, tok, bp+4, bp+8) (*(*[6]uintptr)(unsafe.Pointer(bp + 16)))[0] = XClockMCGet(tls, opts, int32(MCLIT_BCE)) (*(*[6]uintptr)(unsafe.Pointer(bp + 16)))[int32(1)] = XClockMCGet(tls, opts, int32(MCLIT_CE)) (*(*[6]uintptr)(unsafe.Pointer(bp + 16)))[int32(2)] = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLiterals + uintptr(MCLIT_BCE2)*8)) (*(*[6]uintptr)(unsafe.Pointer(bp + 16)))[int32(3)] = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLiterals + uintptr(MCLIT_CE2)*8)) (*(*[6]uintptr)(unsafe.Pointer(bp + 16)))[int32(4)] = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLiterals + uintptr(MCLIT_BCE3)*8)) (*(*[6]uintptr)(unsafe.Pointer(bp + 16)))[int32(5)] = *(*uintptr)(unsafe.Pointer((*TClockClientData)(unsafe.Pointer(dataPtr)).FmcLiterals + uintptr(MCLIT_CE3)*8)) if (*(*[6]uintptr)(unsafe.Pointer(bp + 16)))[0] == libc.UintptrFromInt32(0) || (*(*[6]uintptr)(unsafe.Pointer(bp + 16)))[int32(1)] == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } ret = _ObjListSearch(tls, info, bp, bp+16, int64(6), *(*int32)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8))) if ret != TCL_OK { return ret } if *(*int32)(unsafe.Pointer(bp))&int32(1) != 0 { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FisBce = 0 } else { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FisBce = int32(1) } return TCL_OK } func _ClockScnToken_LocaleListMatcher_Proc(tls *libc.TLS, opts uintptr, info uintptr, tok uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var idxTree uintptr var ret, v1 int32 var _ /* maxLen at bp+8 */ int32 var _ /* minLen at bp+4 */ int32 var _ /* val at bp+0 */ int32 _, _, _ = idxTree, ret, v1 _DetermineGreedySearchLen(tls, opts, info, tok, bp+4, bp+8) /* get or create tree in msgcat dict */ idxTree = _ClockMCGetListIdxTree(tls, opts, int32(int64((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Fdata))) if idxTree == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } ret = _ClockStrIdxTreeSearch(tls, info, idxTree, bp, *(*int32)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8))) if ret != TCL_OK { return ret } if libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Foffs) > 0 { *(*int32)(unsafe.Pointer(bp))-- v1 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(info + uintptr((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Foffs))) = v1 } return TCL_OK } func _ClockScnToken_JDN_Proc(tls *libc.TLS, opts uintptr, info uintptr, tok uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var end, p, s, v2 uintptr var fractJDDiv, v1 int32 var v3 bool var _ /* fractJD at bp+16 */ int32 var _ /* intJD at bp+8 */ TTcl_WideInt var _ /* maxLen at bp+4 */ int32 var _ /* minLen at bp+0 */ int32 _, _, _, _, _, _, _ = end, fractJDDiv, p, s, v1, v2, v3 p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput *(*int32)(unsafe.Pointer(bp + 16)) = 0 fractJDDiv = int32(1) _DetermineGreedySearchLen(tls, opts, info, tok, bp, bp+4) end = (*TDateInfo)(unsafe.Pointer(info)).FdateInput + uintptr(*(*int32)(unsafe.Pointer(bp + 4))) /* currently positive astronomic dates only */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('+') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('-') { p++ } s = p for p < end && libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-uint32('0') < uint32(10)) != 0 { p++ } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput))) != int32('-') { v1 = int32(1) } else { v1 = -int32(1) } if _Clock_str2wideInt(tls, bp+8, s, p, v1) != TCL_OK { return int32(TCL_RETURN) } (*TDateInfo)(unsafe.Pointer(info)).FdateInput = p if v3 = p >= end; !v3 { v2 = p p++ } if v3 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2))) != int32('.') { /* allow pure integer JDN */ /* by astronomical JD the seconds of day offs is 12 hours */ if (*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Foffs != 0 { goto done } /* calendar JD */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay = *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) return TCL_OK } s = p for p < end && libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-uint32('0') < uint32(10)) != 0 { fractJDDiv *= int32(10) p++ } if _Clock_str2int(tls, bp+16, s, p, int32(1)) != TCL_OK { return int32(TCL_RETURN) } (*TDateInfo)(unsafe.Pointer(info)).FdateInput = p goto done done: ; /* * Build a date from julian day (integer and fraction). * Note, astronomical JDN starts at noon in opposite to calendar julianday. */ *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Foffs) + int32(libc.Int64FromInt32(SECONDS_PER_DAY)*int64(*(*int32)(unsafe.Pointer(bp + 16)))/int64(fractJDDiv)) if *(*int32)(unsafe.Pointer(bp + 16)) >= int32(SECONDS_PER_DAY) { *(*int32)(unsafe.Pointer(bp + 16)) %= int32(SECONDS_PER_DAY) *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) += int64(1) } (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay = int64(*(*int32)(unsafe.Pointer(bp + 16))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay = *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fseconds = -int64(210866803200) + int64(SECONDS_PER_DAY)**(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) + int64(*(*int32)(unsafe.Pointer(bp + 16))) *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_POSIXSEC) return TCL_OK } func _ClockScnToken_TimeZone_Proc(tls *libc.TLS, opts uintptr, info uintptr, tok uintptr) (r int32) { bp1 := tls.Alloc(32) defer tls.Free(32) var _objPtr, bp, p, tzObjStor, v1, v2, v3, v4, v5, v6, v8 uintptr var len1 int32 var v7 TTcl_Size var _ /* buf at bp+8 */ [10]uint8 var _ /* maxLen at bp+4 */ int32 var _ /* minLen at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, bp, len1, p, tzObjStor, v1, v2, v3, v4, v5, v6, v7, v8 len1 = 0 p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput tzObjStor = libc.UintptrFromInt32(0) _DetermineGreedySearchLen(tls, opts, info, tok, bp1, bp1+4) /* numeric timezone */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('+') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('-') { bp = bp1 + 8 v1 = bp bp++ v2 = p p++ *(*uint8)(unsafe.Pointer(v1)) = *(*uint8)(unsafe.Pointer(v2)) len1++ if *(*int32)(unsafe.Pointer(bp1 + 4)) > int32(9) { *(*int32)(unsafe.Pointer(bp1 + 4)) = int32(9) } /* cumulate zone into buf without ':' */ for len1+int32(1) < *(*int32)(unsafe.Pointer(bp1 + 4)) { if !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) { break } v3 = bp bp++ v4 = p p++ *(*uint8)(unsafe.Pointer(v3)) = *(*uint8)(unsafe.Pointer(v4)) len1++ if !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) { break } v5 = bp bp++ v6 = p p++ *(*uint8)(unsafe.Pointer(v5)) = *(*uint8)(unsafe.Pointer(v6)) len1++ if len1+int32(2) < *(*int32)(unsafe.Pointer(bp1 + 4)) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(':') { p++ len1++ } } } *(*uint8)(unsafe.Pointer(bp)) = uint8('\000') if len1 < *(*int32)(unsafe.Pointer(bp1)) { return int32(TCL_RETURN) } /* timezone */ tzObjStor = XTcl_NewStringObj(tls, bp1+8, int64(bp)-T__predefined_ptrdiff_t(bp1+8)) } else { /* legacy (alnum) timezone like CEST, etc. */ if *(*int32)(unsafe.Pointer(bp1 + 4)) > int32(4) { *(*int32)(unsafe.Pointer(bp1 + 4)) = int32(4) } for len1 < *(*int32)(unsafe.Pointer(bp1 + 4)) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))&int32(0x80) != 0 || !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))|libc.Uint32FromInt32(32)-libc.Uint32FromUint8('a') < libc.Uint32FromInt32(26)) != 0) && !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) { /* INTL: ISO only. */ break } p++ len1++ } if len1 < *(*int32)(unsafe.Pointer(bp1)) { return int32(TCL_RETURN) } /* timezone */ tzObjStor = XTcl_NewStringObj(tls, (*TDateInfo)(unsafe.Pointer(info)).FdateInput, int64(p)-int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput)) /* convert using dict */ } /* try to apply new time zone */ (*TTcl_Obj)(unsafe.Pointer(tzObjStor)).FrefCount++ (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj = XClockSetupTimeZone(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, tzObjStor) _objPtr = tzObjStor v8 = _objPtr v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr) } if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(info + 8)) += uintptr(len1) return TCL_OK } func _ClockScnToken_StarDate_Proc(tls *libc.TLS, opts uintptr, info uintptr, tok uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var end, p, ret, v1, v13, v2, v3, v7 uintptr var fractDayDiv, v10, v9 int32 var v12 bool var v5, v6 int64 var _ /* ch1 at bp+0 */ TTcl_UniChar var _ /* ch2 at bp+4 */ TTcl_UniChar var _ /* fractDay at bp+32 */ int32 var _ /* fractYear at bp+28 */ int32 var _ /* maxLen at bp+12 */ int32 var _ /* minLen at bp+8 */ int32 var _ /* s at bp+16 */ uintptr var _ /* year at bp+24 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _ = end, fractDayDiv, p, ret, v1, v10, v12, v13, v2, v3, v5, v6, v7, v9 p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput _DetermineGreedySearchLen(tls, opts, info, tok, bp+8, bp+12) end = (*TDateInfo)(unsafe.Pointer(info)).FdateInput + uintptr(*(*int32)(unsafe.Pointer(bp + 12))) /* stardate string */ v1 = p v2 = _stardatePref ret = v1 for { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1))) v5 = int64(libc.Int32FromInt32(1)) } else { v5 = XTcl_UtfToUniChar(tls, v1, bp) } v1 += uintptr(v5) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2))) v6 = int64(libc.Int32FromInt32(1)) } else { v6 = XTcl_UtfToUniChar(tls, v2, bp+4) } v2 += uintptr(v6) if *(*TTcl_UniChar)(unsafe.Pointer(bp)) != *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(bp))) if *(*TTcl_UniChar)(unsafe.Pointer(bp)) != *(*TTcl_UniChar)(unsafe.Pointer(bp + 4)) { break } } *(*uintptr)(unsafe.Pointer(bp + 16)) = v2 goto _4 _4: ; v3 = v1 ret = v3 if !(v3 < end && v2 < _stardatePref+uintptr(9)) { break } } v7 = ret goto _8 _8: p = v7 if p >= end || int64(p)-int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) < int64(9) { return int32(TCL_RETURN) } /* bypass spaces */ for { if v12 = p < end; v12 { v9 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v10 = libc.BoolInt32(v9 == int32(' ') || libc.Uint32FromInt32(v9)-uint32('\t') < uint32(5)) goto _11 _11: } if !(v12 && v10 != 0) { break } p++ } if p >= end { return int32(TCL_RETURN) } /* currently positive stardate only */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('+') { p++ } *(*uintptr)(unsafe.Pointer(bp + 16)) = p for p < end && libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-uint32('0') < uint32(10)) != 0 { p++ } if p >= end || int64(p)-int64(*(*uintptr)(unsafe.Pointer(bp + 16))) < int64(4) { return int32(TCL_RETURN) } if _Clock_str2int(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 16)), p-uintptr(3), int32(1)) != TCL_OK || _Clock_str2int(tls, bp+28, p-uintptr(3), p, int32(1)) != TCL_OK { return int32(TCL_RETURN) } v13 = p p++ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v13))) != int32('.') { return int32(TCL_RETURN) } *(*uintptr)(unsafe.Pointer(bp + 16)) = p fractDayDiv = int32(1) for p < end && libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(p)))-uint32('0') < uint32(10)) != 0 { fractDayDiv *= int32(10) p++ } if _Clock_str2int(tls, bp+32, *(*uintptr)(unsafe.Pointer(bp + 16)), p, int32(1)) != TCL_OK { return int32(TCL_RETURN) } (*TDateInfo)(unsafe.Pointer(info)).FdateInput = p /* Build a date from year and fraction. */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = *(*int32)(unsafe.Pointer(bp + 24)) + int32(RODDENBERRY) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FisBce = 0 (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fgregorian = int32(1) if XIsGregorianLeapYear(tls, info+24) != 0 { *(*int32)(unsafe.Pointer(bp + 28)) *= int32(366) } else { *(*int32)(unsafe.Pointer(bp + 28)) *= int32(365) } (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfYear = *(*int32)(unsafe.Pointer(bp + 28))/int32(1000) + int32(1) if *(*int32)(unsafe.Pointer(bp + 28))%int32(1000) >= int32(500) { (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfYear++ } XGetJulianDayFromEraYearDay(tls, info+24, int32(GREGORIAN_CHANGE_DATE)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FlocalSeconds = -int64(210866803200) + int64(SECONDS_PER_DAY)*(*TDateInfo)(unsafe.Pointer(info)).Fdate.FjulianDay + int64(libc.Int32FromInt32(SECONDS_PER_DAY)**(*int32)(unsafe.Pointer(bp + 32))/fractDayDiv) return TCL_OK } var _stardatePref = __ccgo_ts + 14638 /* * Descriptors for the various fields in [clock scan]. */ var _ScnSTokenMapIndex = __ccgo_ts + 14648 var _ScnSTokenMap = [22]TClockScanTokenMap{ 0: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_DAYOFMONTH), FminSize: uint16(1), FmaxSize: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 52)), }, 1: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_MONTH), FminSize: uint16(1), FmaxSize: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 48)), }, 2: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_MONTH), FmaxSize: uint16(0xffff), }, 3: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_YEAR), FminSize: uint16(1), FmaxSize: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 40)), }, 4: { Ftype1: uint16(CTOKT_INT), Fflags: libc.Uint16FromInt32(int32(CLF_YEAR) | int32(CLF_CENTURY)), FminSize: uint16(4), FmaxSize: uint16(4), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 40)), }, 5: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_TIME), FminSize: uint16(1), FmaxSize: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 68)), }, 6: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_TIME), FminSize: uint16(1), FmaxSize: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 72)), }, 7: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_TIME), FminSize: uint16(1), FmaxSize: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 80)), }, 8: { Ftype1: uint16(CTOKT_PARSER), FmaxSize: uint16(0xffff), }, 9: { Ftype1: uint16(CTOKT_WIDE), Fflags: libc.Uint16FromInt32(int32(CLF_JULIANDAY) | int32(CLF_SIGNED)), FminSize: uint16(1), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 24)), }, 10: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_DAYOFYEAR), FminSize: uint16(1), FmaxSize: uint16(3), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 44)), }, 11: { Ftype1: uint16(CTOKT_INT), Fflags: libc.Uint16FromInt32(int32(CLF_CENTURY) | int32(CLF_ISO8601CENTURY)), FminSize: uint16(1), FmaxSize: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 216)), }, 12: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_ISO8601YEAR), FminSize: uint16(2), FmaxSize: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 56)), }, 13: { Ftype1: uint16(CTOKT_INT), Fflags: libc.Uint16FromInt32(int32(CLF_ISO8601YEAR) | int32(CLF_ISO8601CENTURY)), FminSize: uint16(4), FmaxSize: uint16(4), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 56)), }, 14: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_ISO8601WEEK), FminSize: uint16(1), FmaxSize: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 60)), }, 15: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_DAYOFWEEK), FmaxSize: uint16(0xffff), }, 16: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_OPTIONAL), FmaxSize: uint16(0xffff), }, 17: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLF_OPTIONAL), FminSize: uint16(1), FmaxSize: uint16(2), }, 18: { Ftype1: uint16(CTOKT_WIDE), Fflags: libc.Uint16FromInt32(int32(CLF_POSIXSEC) | int32(CLF_SIGNED)), FminSize: uint16(1), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24)), }, 19: { Ftype1: uint16(CTOKT_CHAR), FminSize: uint16(1), FmaxSize: uint16(1), Fdata: __ccgo_ts + 286, }, 20: { Ftype1: uint16(CTOKT_CHAR), FminSize: uint16(1), FmaxSize: uint16(1), Fdata: __ccgo_ts + 14671, }, 21: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_LOCALSEC), FminSize: uint16(16), FmaxSize: uint16(30), }, } func init() { p := unsafe.Pointer(&_ScnSTokenMap) *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_ClockScnToken_Month_Proc) *(*uintptr)(unsafe.Add(p, 272)) = __ccgo_fp(_ClockScnToken_amPmInd_Proc) *(*uintptr)(unsafe.Add(p, 496)) = __ccgo_fp(_ClockScnToken_DayOfWeek_Proc) *(*uintptr)(unsafe.Add(p, 528)) = __ccgo_fp(_ClockScnToken_TimeZone_Proc) *(*uintptr)(unsafe.Add(p, 688)) = __ccgo_fp(_ClockScnToken_StarDate_Proc) } var _ScnSTokenMapAliasIndex = [2]uintptr{ 0: __ccgo_ts + 14673, 1: __ccgo_ts + 14687, } var _ScnETokenMapIndex = __ccgo_ts + 14701 var _ScnETokenMap = [5]TClockScanTokenMap{ 0: { Ftype1: uint16(CTOKT_PARSER), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 40)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 1: { Ftype1: uint16(CTOKT_PARSER), Fflags: libc.Uint16FromInt32(int32(CLF_JULIANDAY) | int32(CLF_SIGNED)), FminSize: uint16(1), FmaxSize: uint16(0xffff), }, 2: { Ftype1: uint16(CTOKT_PARSER), Fflags: libc.Uint16FromInt32(int32(CLF_JULIANDAY) | int32(CLF_SIGNED)), FminSize: uint16(1), FmaxSize: uint16(0xffff), Foffs: libc.Uint16FromInt32(libc.Int32FromInt32(SECONDS_PER_DAY) / libc.Int32FromInt32(2)), }, 3: { Ftype1: uint16(CTOKT_PARSER), FmaxSize: uint16(0xffff), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 4: { Ftype1: uint16(CTOKT_WIDE), Fflags: libc.Uint16FromInt32(int32(CLF_LOCALSEC) | int32(CLF_SIGNED)), FminSize: uint16(1), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 8)), }, } func init() { p := unsafe.Pointer(&_ScnETokenMap) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_ClockScnToken_LocaleERA_Proc) *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_ClockScnToken_JDN_Proc) *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_ClockScnToken_JDN_Proc) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_ClockScnToken_LocaleListMatcher_Proc) } var _ScnETokenMapAliasIndex = [2]uintptr{ 0: __ccgo_ts + 1945, 1: __ccgo_ts + 1945, } var _ScnOTokenMapIndex = __ccgo_ts + 14707 var _ScnOTokenMap = [7]TClockScanTokenMap{ 0: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_DAYOFMONTH), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 52)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 1: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_MONTH), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 48)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 2: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_YEAR), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 40)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 3: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_TIME), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 68)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 4: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_TIME), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 72)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 5: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_TIME), FmaxSize: uint16(0xffff), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 80)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 6: { Ftype1: uint16(CTOKT_PARSER), Fflags: uint16(CLF_DAYOFWEEK), FmaxSize: uint16(0xffff), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, } func init() { p := unsafe.Pointer(&_ScnOTokenMap) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_ClockScnToken_LocaleListMatcher_Proc) *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_ClockScnToken_LocaleListMatcher_Proc) *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_ClockScnToken_LocaleListMatcher_Proc) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_ClockScnToken_LocaleListMatcher_Proc) *(*uintptr)(unsafe.Add(p, 144)) = __ccgo_fp(_ClockScnToken_LocaleListMatcher_Proc) *(*uintptr)(unsafe.Add(p, 176)) = __ccgo_fp(_ClockScnToken_LocaleListMatcher_Proc) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(_ClockScnToken_DayOfWeek_Proc) } var _ScnOTokenMapAliasIndex = [2]uintptr{ 0: __ccgo_ts + 14715, 1: __ccgo_ts + 14721, } // C documentation // // /* Token map reserved for CTOKT_SPACE */ var _ScnSpaceTokenMap = TClockScanTokenMap{ Ftype1: uint16(CTOKT_SPACE), FminSize: uint16(1), FmaxSize: uint16(1), } var _ScnWordTokenMap = TClockScanTokenMap{ Ftype1: uint16(CTOKT_WORD), FminSize: uint16(1), FmaxSize: uint16(1), } func _EstimateTokenCount(tls *libc.TLS, fmt uintptr, end uintptr) (r uint32) { var p, v1 uintptr var tokcnt, v2 uint32 _, _, _, _ = p, tokcnt, v1, v2 p = fmt /* estimate token count by % char and format length */ tokcnt = uint32(0) for p <= end { v1 = p p++ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1))) == int32('%') { tokcnt++ p++ } } p = fmt + uintptr(tokcnt*uint32(2)) if p < end { if libc.Uint32FromInt64(int64(end)-int64(p)) < tokcnt { tokcnt = uint32(int64(tokcnt) + (int64(end) - int64(p))) } else { tokcnt += tokcnt } } tokcnt++ v2 = tokcnt return v2 } // C documentation // // /* // *---------------------------------------------------------------------- // */ func XClockGetOrParseScanFormat(tls *libc.TLS, interp uintptr, formatObj uintptr) (r uintptr) { /* Format container */ var aliasIndex, cp, e, fss, mapIndex, p, prevTok, prevTok1, scnMap, scnTok, tok, wordTok, v1, v13, v17, v2, v22, v26, v27, v6, p7, p8 uintptr var endDist, tokCnt uint32 var v10, v14, v15, v18, v19, v23, v24, v9 int32 var v12, v21 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aliasIndex, cp, e, endDist, fss, mapIndex, p, prevTok, prevTok1, scnMap, scnTok, tok, tokCnt, wordTok, v1, v10, v12, v13, v14, v15, v17, v18, v19, v2, v21, v22, v23, v24, v26, v27, v6, v9, p7, p8 fss = XTcl_GetClockFrmScnFromObj(tls, interp, formatObj) if fss == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } /* if format (scnTok) already tokenized */ if (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTok != libc.UintptrFromInt32(0) { return fss } XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) /* first time scanning - tokenize format */ if (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTok == libc.UintptrFromInt32(0) { v1 = _HashEntry4FmtScn(tls, fss) + 32 p = v1 e = v1 e += uintptr(libc.Xstrlen(tls, p)) /* estimate token count by % char and format length */ (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC = _EstimateTokenCount(tls, p, e) (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnSpaceCount = uint32(0) v2 = XTcl_Alloc(tls, uint64(32)*uint64((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC)) tok = v2 scnTok = v2 libc.Xmemset(tls, tok, 0, uint64(32)) tokCnt = uint32(1) for p < e { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) { case int32('%'): goto _3 default: goto _4 } goto _5 _3: ; scnMap = uintptr(unsafe.Pointer(&_ScnSTokenMap)) mapIndex = _ScnSTokenMapIndex aliasIndex = uintptr(unsafe.Pointer(&_ScnSTokenMapAliasIndex)) if p+uintptr(1) >= e { goto word_tok } p++ /* try to find modifier: */ switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) { case int32('%'): /* begin new word token - don't join with previous word token, * because current mapping should be "...%%..." -> "...%..." */ (*TClockScanToken)(unsafe.Pointer(tok)).Fmap1 = uintptr(unsafe.Pointer(&_ScnWordTokenMap)) (*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fstart = p (*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fend = p + uintptr(1) tok += 32 v6 = tok if v6 >= scnTok+uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC)*32 { scnTok = XTcl_Realloc(tls, scnTok, uint64((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC+libc.Uint32FromInt32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE))*uint64(32)) tok = scnTok + uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC)*32 *(*uint32)(unsafe.Pointer(fss + 16)) += uint32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE) } libc.Xmemset(tls, tok, 0, uint64(32)) tokCnt++ p++ continue case int32('E'): scnMap = uintptr(unsafe.Pointer(&_ScnETokenMap)) mapIndex = _ScnETokenMapIndex aliasIndex = uintptr(unsafe.Pointer(&_ScnETokenMapAliasIndex)) p++ case int32('O'): scnMap = uintptr(unsafe.Pointer(&_ScnOTokenMap)) mapIndex = _ScnOTokenMapIndex aliasIndex = uintptr(unsafe.Pointer(&_ScnOTokenMapAliasIndex)) p++ break } /* search direct index */ cp = libc.Xstrchr(tls, mapIndex, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))) if !(cp != 0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cp))) == int32('\000') { /* search wrapper index (multiple chars for same token) */ cp = libc.Xstrchr(tls, *(*uintptr)(unsafe.Pointer(aliasIndex)), libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))) if !(cp != 0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cp))) == int32('\000') { p-- if scnMap != uintptr(unsafe.Pointer(&_ScnSTokenMap)) { p-- } goto word_tok } cp = libc.Xstrchr(tls, mapIndex, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aliasIndex + 1*8)) + uintptr(int64(cp)-int64(*(*uintptr)(unsafe.Pointer(aliasIndex)))))))) if !(cp != 0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cp))) == int32('\000') { /* unexpected, but ... */ p-- if scnMap != uintptr(unsafe.Pointer(&_ScnSTokenMap)) { p-- } goto word_tok } } (*TClockScanToken)(unsafe.Pointer(tok)).Fmap1 = scnMap + uintptr(int64(cp)-int64(mapIndex))*32 (*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fstart = p /* calculate look ahead value by standing together tokens */ if tok > scnTok { prevTok = tok - uintptr(1)*32 for prevTok >= scnTok { if libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(prevTok)).Fmap1)).Ftype1) != libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Ftype1) { break } p7 = prevTok + 26 *(*uint16)(unsafe.Pointer(p7)) = uint16(int32(*(*uint16)(unsafe.Pointer(p7))) + libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).FminSize)) p8 = prevTok + 28 *(*uint16)(unsafe.Pointer(p8)) = uint16(int32(*(*uint16)(unsafe.Pointer(p8))) + libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).FmaxSize)) (*TClockScanToken)(unsafe.Pointer(prevTok)).FlookAhTok++ prevTok -= 32 } } /* increase space count used in format */ if v12 = libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Ftype1) == int32(CTOKT_CHAR); v12 { v9 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Fdata))) v10 = libc.BoolInt32(v9 == int32(' ') || libc.Uint32FromInt32(v9)-uint32('\t') < uint32(5)) goto _11 _11: } if v12 && v10 != 0 { (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnSpaceCount++ } /* next token */ tok += 32 v13 = tok if v13 >= scnTok+uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC)*32 { scnTok = XTcl_Realloc(tls, scnTok, uint64((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC+libc.Uint32FromInt32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE))*uint64(32)) tok = scnTok + uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC)*32 *(*uint32)(unsafe.Pointer(fss + 16)) += uint32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE) } libc.Xmemset(tls, tok, 0, uint64(32)) tokCnt++ p++ continue _4: ; v14 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v15 = libc.BoolInt32(v14 == int32(' ') || libc.Uint32FromInt32(v14)-uint32('\t') < uint32(5)) goto _16 _16: if v15 != 0 { (*TClockScanToken)(unsafe.Pointer(tok)).Fmap1 = uintptr(unsafe.Pointer(&_ScnSpaceTokenMap)) v17 = p p++ (*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fstart = v17 for { if v21 = p < e; v21 { v18 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v19 = libc.BoolInt32(v18 == int32(' ') || libc.Uint32FromInt32(v18)-uint32('\t') < uint32(5)) goto _20 _20: } if !(v21 && v19 != 0) { break } p++ } (*TClockScanToken)(unsafe.Pointer(tok)).FtokWord.Fend = p /* increase space count used in format */ (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnSpaceCount++ /* next token */ tok += 32 v22 = tok if v22 >= scnTok+uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC)*32 { scnTok = XTcl_Realloc(tls, scnTok, uint64((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC+libc.Uint32FromInt32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE))*uint64(32)) tok = scnTok + uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC)*32 *(*uint32)(unsafe.Pointer(fss + 16)) += uint32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE) } libc.Xmemset(tls, tok, 0, uint64(32)) tokCnt++ continue } goto word_tok word_tok: ; /* try continue with previous word token */ wordTok = tok - uintptr(1)*32 if wordTok < scnTok || (*TClockScanToken)(unsafe.Pointer(wordTok)).Fmap1 != uintptr(unsafe.Pointer(&_ScnWordTokenMap)) { /* start with new word token */ wordTok = tok (*TClockScanToken)(unsafe.Pointer(wordTok)).FtokWord.Fstart = p (*TClockScanToken)(unsafe.Pointer(wordTok)).Fmap1 = uintptr(unsafe.Pointer(&_ScnWordTokenMap)) } for cond := true; cond; cond = p < e && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) != int32('%') { v23 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v24 = libc.BoolInt32(v23 == int32(' ') || libc.Uint32FromInt32(v23)-uint32('\t') < uint32(5)) goto _25 _25: if v24 != 0 { (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnSpaceCount++ } p = XTcl_UtfNext(tls, p) } (*TClockScanToken)(unsafe.Pointer(wordTok)).FtokWord.Fend = p if wordTok == tok { tok += 32 v26 = tok if v26 >= scnTok+uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC)*32 { scnTok = XTcl_Realloc(tls, scnTok, uint64((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC+libc.Uint32FromInt32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE))*uint64(32)) tok = scnTok + uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC)*32 *(*uint32)(unsafe.Pointer(fss + 16)) += uint32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE) } libc.Xmemset(tls, tok, 0, uint64(32)) tokCnt++ } goto _5 _5: } /* calculate end distance value for each tokens */ if tok > scnTok { endDist = uint32(0) prevTok1 = tok - uintptr(1)*32 for prevTok1 >= scnTok { (*TClockScanToken)(unsafe.Pointer(prevTok1)).FendDistance = uint16(endDist) if libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(prevTok1)).Fmap1)).Ftype1) != int32(CTOKT_WORD) { endDist += uint32((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(prevTok1)).Fmap1)).FminSize) } else { endDist = uint32(int64(endDist) + (int64((*TClockScanToken)(unsafe.Pointer(prevTok1)).FtokWord.Fend) - int64((*TClockScanToken)(unsafe.Pointer(prevTok1)).FtokWord.Fstart))) } prevTok1 -= 32 } } /* correct count of real used tokens and free mem if desired * (1 is acceptable delta to prevent memory fragmentation) */ if (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC > tokCnt+libc.Uint32FromInt32(libc.Int32FromInt32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE)/libc.Int32FromInt32(2)) { v27 = XTclpRealloc(tls, scnTok, uint64(tokCnt)*uint64(32)) tok = v27 if v27 != libc.UintptrFromInt32(0) { scnTok = tok } } /* now we're ready - assign now to storage (note the threaded race condition) */ (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTok = scnTok (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTokC = tokCnt } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) return fss } // C documentation // // /* // *---------------------------------------------------------------------- // */ func XClockScan(tls *libc.TLS, info uintptr, strObj uintptr, opts uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Command options */ var dataPtr, end, fss, map1, p, tok, x, v1, v12, v19, v2, v25, v26, v4, p17, p18 uintptr var flags uint16 var ret, sign, v10, v13, v14, v21, v22, v27, v28, v30, v31, v33, v34, v37, v38, v40, v41, v44, v45, v5, v6, v9 int32 var v16, v24, v3, v36, v43, v47, v8 bool var _ /* minLen at bp+0 */ int32 var _ /* size at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dataPtr, end, flags, fss, map1, p, ret, sign, tok, x, v1, v10, v12, v13, v14, v16, v19, v2, v21, v22, v24, v25, v26, v27, v28, v3, v30, v31, v33, v34, v36, v37, v38, v4, v40, v41, v43, v44, v45, v47, v5, v6, v8, v9, p17, p18 dataPtr = (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr flags = uint16(0) ret = int32(TCL_ERROR) /* get localized format */ if XClockLocalizeFormat(tls, opts) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } v1 = XClockGetOrParseScanFormat(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FformatObj) fss = v1 if v3 = !(v1 != 0); !v3 { v2 = (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnTok tok = v2 } if v3 || !(v2 != 0) { return int32(TCL_ERROR) } /* prepare parsing */ (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian = int32(MER24) if (*TTcl_Obj)(unsafe.Pointer(strObj)).Fbytes != 0 { v4 = (*TTcl_Obj)(unsafe.Pointer(strObj)).Fbytes } else { v4 = XTcl_GetStringFromObj(tls, strObj, libc.UintptrFromInt32(0)) } p = v4 end = p + uintptr((*TTcl_Obj)(unsafe.Pointer(strObj)).Flength) /* in strict mode - bypass spaces at begin / end only (not between tokens) */ if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags&int32(CLF_STRICT) != 0 { for { if v8 = p < end; v8 { v5 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v6 = libc.BoolInt32(v5 == int32(' ') || libc.Uint32FromInt32(v5)-uint32('\t') < uint32(5)) goto _7 _7: } if !(v8 && v6 != 0) { break } p++ } } (*TDateInfo)(unsafe.Pointer(info)).FdateInput = p /* look ahead to count spaces (bypass it by count length and distances) */ x = end for p < end { v9 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v10 = libc.BoolInt32(v9 == int32(' ') || libc.Uint32FromInt32(v9)-uint32('\t') < uint32(5)) goto _11 _11: if v10 != 0 { p++ v12 = p x = v12 /* after first space in space block */ (*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount++ for { if v16 = p < end; v16 { v13 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v14 = libc.BoolInt32(v13 == int32(' ') || libc.Uint32FromInt32(v13)-uint32('\t') < uint32(5)) goto _15 _15: } if !(v16 && v14 != 0) { break } p++ (*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount++ } continue } x = end p++ } /* ignore more as 1 space at end */ p17 = info + 208 *(*int32)(unsafe.Pointer(p17)) = int32(int64(*(*int32)(unsafe.Pointer(p17))) - (int64(end) - int64(x))) end = x /* ignore mandatory spaces used in format */ p18 = info + 208 *(*int32)(unsafe.Pointer(p18)) = int32(uint32(*(*int32)(unsafe.Pointer(p18))) - (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FscnSpaceCount) if (*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount < 0 { (*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount = 0 } v19 = (*TDateInfo)(unsafe.Pointer(info)).FdateInput p = v19 (*TDateInfo)(unsafe.Pointer(info)).FdateStart = v19 (*TDateInfo)(unsafe.Pointer(info)).FdateEnd = end /* parse string */ for { if !((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1 != libc.UintptrFromInt32(0)) { break } map1 = (*TClockScanToken)(unsafe.Pointer(tok)).Fmap1 /* bypass spaces at begin of input before parsing each token */ if !((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags&int32(CLF_STRICT) != 0) && (libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Ftype1) != int32(CTOKT_SPACE) && libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Ftype1) != int32(CTOKT_WORD) && libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Ftype1) != int32(CTOKT_CHAR)) { for { if v24 = p < end; v24 { v21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v22 = libc.BoolInt32(v21 == int32(' ') || libc.Uint32FromInt32(v21)-uint32('\t') < uint32(5)) goto _23 _23: } if !(v24 && v22 != 0) { break } (*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount-- p++ } } (*TDateInfo)(unsafe.Pointer(info)).FdateInput = p /* end of input string */ if p >= end { break } switch libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Ftype1) { case int32(CTOKT_INT): fallthrough case int32(CTOKT_WIDE): sign = int32(1) if libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Fflags)&int32(CLF_SIGNED) != 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('+') { p++ v25 = p (*TDateInfo)(unsafe.Pointer(info)).FdateInput = v25 } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('-') { p++ v26 = p (*TDateInfo)(unsafe.Pointer(info)).FdateInput = v26 sign = -int32(1) } } } _DetermineGreedySearchLen(tls, opts, info, tok, bp, bp+4) if *(*int32)(unsafe.Pointer(bp + 4)) < libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).FminSize) { /* missing input -> error */ if libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Fflags)&int32(CLF_OPTIONAL) != 0 { goto _20 } goto not_match } /* string 2 number, put number into info structure by offset */ if (*TClockScanTokenMap)(unsafe.Pointer(map1)).Foffs != 0 { p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput x = p + uintptr(*(*int32)(unsafe.Pointer(bp + 4))) if libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Ftype1) == int32(CTOKT_INT) { if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(10) { _Clock_str2int_no(tls, info+uintptr((*TClockScanTokenMap)(unsafe.Pointer(map1)).Foffs), p, x, sign) } else { if _Clock_str2int(tls, info+uintptr((*TClockScanTokenMap)(unsafe.Pointer(map1)).Foffs), p, x, sign) != TCL_OK { goto overflow } } p = x } else { if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(18) { _Clock_str2wideInt_no(tls, info+uintptr((*TClockScanTokenMap)(unsafe.Pointer(map1)).Foffs), p, x, sign) } else { if _Clock_str2wideInt(tls, info+uintptr((*TClockScanTokenMap)(unsafe.Pointer(map1)).Foffs), p, x, sign) != TCL_OK { goto overflow } } p = x } flags = libc.Uint16FromInt32(libc.Int32FromUint16(flags) & ^libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).FclearFlags) | libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Fflags)) } case int32(CTOKT_PARSER): switch (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TClockScanTokenMap)(unsafe.Pointer(map1)).Fparser})))(tls, opts, info, tok) { case TCL_OK: case int32(TCL_RETURN): if libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Fflags)&int32(CLF_OPTIONAL) != 0 { (*TDateInfo)(unsafe.Pointer(info)).FdateInput = p goto _20 } goto not_match default: goto done } /* decrement count for possible spaces in match */ for p < (*TDateInfo)(unsafe.Pointer(info)).FdateInput { v27 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v28 = libc.BoolInt32(v27 == int32(' ') || libc.Uint32FromInt32(v27)-uint32('\t') < uint32(5)) goto _29 _29: if v28 != 0 { (*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount-- } p++ } p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput flags = libc.Uint16FromInt32(libc.Int32FromUint16(flags) & ^libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).FclearFlags) | libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer(map1)).Fflags)) case int32(CTOKT_SPACE): /* at least one space */ v30 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v31 = libc.BoolInt32(v30 == int32(' ') || libc.Uint32FromInt32(v30)-uint32('\t') < uint32(5)) goto _32 _32: if !(v31 != 0) { /* unmatched -> error */ goto not_match } /* don't decrement yySpaceCount by regular (first expected space), * already considered above with fss->scnSpaceCount */ p++ for { if v36 = p < end; v36 { v33 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v34 = libc.BoolInt32(v33 == int32(' ') || libc.Uint32FromInt32(v33)-uint32('\t') < uint32(5)) goto _35 _35: } if !(v36 && v34 != 0) { break } (*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount-- p++ } case int32(CTOKT_WORD): x = _FindWordEnd(tls, tok, p, end) if !(x != 0) { /* no match -> error */ goto not_match } p = x case int32(CTOKT_CHAR): x = (*TClockScanTokenMap)(unsafe.Pointer(map1)).Fdata if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(x))) != libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) { /* no match -> error */ goto not_match } v37 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(x))) v38 = libc.BoolInt32(v37 == int32(' ') || libc.Uint32FromInt32(v37)-uint32('\t') < uint32(5)) goto _39 _39: if v38 != 0 { (*TDateInfo)(unsafe.Pointer(info)).FdateSpaceCount-- } p++ break } goto _20 _20: ; tok += 32 } /* check end was reached */ if p < end { /* in non-strict mode bypass spaces at end of input */ if v43 = !((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags&int32(CLF_STRICT) != 0); v43 { v40 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v41 = libc.BoolInt32(v40 == int32(' ') || libc.Uint32FromInt32(v40)-uint32('\t') < uint32(5)) goto _42 _42: } if v43 && v41 != 0 { p++ for { if v47 = p < end; v47 { v44 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v45 = libc.BoolInt32(v44 == int32(' ') || libc.Uint32FromInt32(v44)-uint32('\t') < uint32(5)) goto _46 _46: } if !(v47 && v45 != 0) { break } p++ } } /* something after last token - wrong format */ if p < end { goto not_match } } /* end of string, check only optional tokens at end, otherwise - not match */ for (*TClockScanToken)(unsafe.Pointer(tok)).Fmap1 != libc.UintptrFromInt32(0) { if !((*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags&int32(CLF_STRICT) != 0) && libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Ftype1) == int32(CTOKT_SPACE) { tok += 32 if (*TClockScanToken)(unsafe.Pointer(tok)).Fmap1 == libc.UintptrFromInt32(0) { /* no tokens anymore - trailing spaces are mandatory */ goto not_match } } if !(libc.Int32FromUint16((*TClockScanTokenMap)(unsafe.Pointer((*TClockScanToken)(unsafe.Pointer(tok)).Fmap1)).Fflags)&int32(CLF_OPTIONAL) != 0) { goto not_match } tok += 32 } /* * Invalidate result */ flags = uint16(int32(flags) | (*TDateInfo)(unsafe.Pointer(info)).Fflags) /* seconds token (%s) take precedence over all other tokens */ if (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Fflags&int32(CLF_EXTENDED) != 0 || !(libc.Int32FromUint16(flags)&int32(CLF_POSIXSEC) != 0) { if libc.Int32FromUint16(flags)&int32(CLF_DATE) != 0 { if !(libc.Int32FromUint16(flags)&int32(CLF_JULIANDAY) != 0) { *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_SECONDS) | int32(CLF_ASSEMBLE_JULIANDAY) /* dd precedence below ddd */ switch libc.Int32FromUint16(flags) & (int32(CLF_MONTH) | int32(CLF_DAYOFYEAR) | int32(CLF_DAYOFMONTH)) { case int32(CLF_DAYOFYEAR) | int32(CLF_DAYOFMONTH): /* miss month: ddd over dd (without month) */ flags = uint16(int32(flags) & ^int32(CLF_DAYOFMONTH)) /* fallthrough */ fallthrough case int32(CLF_DAYOFYEAR): /* ddd over naked weekday */ if !(libc.Int32FromUint16(flags)&int32(CLF_ISO8601YEAR) != 0) { flags = uint16(int32(flags) & ^int32(CLF_ISO8601WEEK)) } case int32(CLF_MONTH) | int32(CLF_DAYOFYEAR) | int32(CLF_DAYOFMONTH): /* both available: mmdd over ddd */ fallthrough case int32(CLF_MONTH) | int32(CLF_DAYOFMONTH): fallthrough case int32(CLF_DAYOFMONTH): /* mmdd / dd over naked weekday */ if !(libc.Int32FromUint16(flags)&int32(CLF_ISO8601YEAR) != 0) { flags = uint16(int32(flags) & ^int32(CLF_ISO8601WEEK)) } break /* neither mmdd nor ddd available */ fallthrough case 0: /* but we have day of the week, which can be used */ if libc.Int32FromUint16(flags)&int32(CLF_DAYOFWEEK) != 0 { /* prefer week based calculation of julianday */ flags = uint16(int32(flags) | int32(CLF_ISO8601WEEK)) } } /* YearWeekDay below YearMonthDay */ if libc.Int32FromUint16(flags)&int32(CLF_ISO8601WEEK) != 0 && (libc.Int32FromUint16(flags)&(int32(CLF_YEAR)|int32(CLF_DAYOFYEAR)) == int32(CLF_YEAR)|int32(CLF_DAYOFYEAR) || libc.Int32FromUint16(flags)&(int32(CLF_YEAR)|int32(CLF_DAYOFMONTH)|int32(CLF_MONTH)) == int32(CLF_YEAR)|int32(CLF_DAYOFMONTH)|int32(CLF_MONTH)) { /* yy precedence below yyyy */ if !(libc.Int32FromUint16(flags)&int32(CLF_ISO8601CENTURY) != 0) && libc.Int32FromUint16(flags)&int32(CLF_CENTURY) != 0 { /* normally precedence of ISO is higher, but no century - so put it down */ flags = uint16(int32(flags) & ^int32(CLF_ISO8601WEEK)) } else { if !(libc.Int32FromUint16(flags)&int32(CLF_ISO8601YEAR) != 0) { /* yymmdd or yyddd over naked weekday */ flags = uint16(int32(flags) & ^int32(CLF_ISO8601WEEK)) } } } if libc.Int32FromUint16(flags)&int32(CLF_YEAR) != 0 { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear < int32(100) { if !(libc.Int32FromUint16(flags)&int32(CLF_CENTURY) != 0) { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear >= (*TClockClientData)(unsafe.Pointer(dataPtr)).FyearOfCenturySwitch { *(*int32)(unsafe.Pointer(info + 24 + 40)) -= int32(100) } *(*int32)(unsafe.Pointer(info + 24 + 40)) += (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentYearCentury } else { *(*int32)(unsafe.Pointer(info + 24 + 40)) += (*TDateInfo)(unsafe.Pointer(info)).FdateCentury * int32(100) } } } if libc.Int32FromUint16(flags)&(int32(CLF_ISO8601WEEK)|int32(CLF_ISO8601YEAR)) != 0 { if libc.Int32FromUint16(flags)&(int32(CLF_ISO8601YEAR)|int32(CLF_YEAR)) == int32(CLF_YEAR) { /* for calculations expected iso year */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year = (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear } else { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year < int32(100) { if !(libc.Int32FromUint16(flags)&int32(CLF_ISO8601CENTURY) != 0) { if (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year >= (*TClockClientData)(unsafe.Pointer(dataPtr)).FyearOfCenturySwitch { (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year -= int32(100) } (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year += (*TClockClientData)(unsafe.Pointer(dataPtr)).FcurrentYearCentury } else { (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year += (*TDateInfo)(unsafe.Pointer(info)).FdateCentury * int32(100) } } } if libc.Int32FromUint16(flags)&(int32(CLF_ISO8601YEAR)|int32(CLF_YEAR)) == int32(CLF_ISO8601YEAR) { /* for calculations expected year (e. g. CLF_ISO8601WEEK not set) */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fiso8601Year } } } } /* if no time - reset time */ if !(libc.Int32FromUint16(flags)&(int32(CLF_TIME)|int32(CLF_LOCALSEC)|int32(CLF_POSIXSEC)) != 0) { *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_SECONDS) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FlocalSeconds = 0 } if libc.Int32FromUint16(flags)&int32(CLF_TIME) != 0 { *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_SECONDS) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay = int64(XToSeconds(tls, (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour, (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes, int32((*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin), (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian)) } else { if !(libc.Int32FromUint16(flags)&(int32(CLF_LOCALSEC)|int32(CLF_POSIXSEC)) != 0) { *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ASSEMBLE_SECONDS) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfDay = (*TDateInfo)(unsafe.Pointer(info)).Fdate.FlocalSeconds % int64(SECONDS_PER_DAY) } } } /* tell caller which flags were set */ *(*int32)(unsafe.Pointer(info + 136)) |= libc.Int32FromUint16(flags) ret = TCL_OK goto done done: ; return ret /* Error case reporting. */ goto overflow overflow: ; XTcl_SetObjResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, XTcl_NewStringObj(tls, __ccgo_ts+11737, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, libc.VaList(bp+16, __ccgo_ts+12666, __ccgo_ts+13952, libc.UintptrFromInt32(0))) goto done goto not_match not_match: ; XTcl_SetObjResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, XTcl_NewStringObj(tls, __ccgo_ts+14727, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, libc.VaList(bp+16, __ccgo_ts+12666, __ccgo_ts+14771, libc.UintptrFromInt32(0))) goto done return r } func _FrmResultAllocate(tls *libc.TLS, dateFmt uintptr, len1 int32) (r int32) { var needed, newsize int32 var newRes uintptr _, _, _ = needed, newRes, newsize needed = int32(int64((*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput+uintptr(len1)) - int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresEnd)) if needed >= 0 { /* >= 0 - regards NTS zero */ newsize = int32(int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresEnd) - int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem) + int64(needed) + int64(libc.Int32FromInt32(MIN_FMT_RESULT_BLOCK_ALLOC)*libc.Int32FromInt32(2))) /* differentiate between stack and memory */ if !(int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresEnd)-int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem) > libc.Int64FromInt32(MIN_FMT_RESULT_BLOCK_ALLOC)) { newRes = XTclpAlloc(tls, libc.Uint64FromInt32(newsize)) if newRes == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } libc.Xmemcpy(tls, newRes, (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem, libc.Uint64FromInt64(int64((*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput)-int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem))) } else { newRes = XTclpRealloc(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem, libc.Uint64FromInt32(newsize)) if newRes == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = newRes + uintptr(int64((*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput)-int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem)) (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem = newRes (*TDateFormat)(unsafe.Pointer(dateFmt)).FresEnd = newRes + uintptr(newsize) } return TCL_OK } func _ClockFmtToken_HourAMPM_Proc(tls *libc.TLS, dummy2762 uintptr, dummy2763 uintptr, dummy2764 uintptr, val uintptr) (r int32) { *(*int32)(unsafe.Pointer(val)) = (*(*int32)(unsafe.Pointer(val))+int32(SECONDS_PER_DAY)-int32(3600))/int32(3600)%int32(12) + int32(1) return TCL_OK } func _ClockFmtToken_AMPM_Proc(tls *libc.TLS, opts uintptr, dateFmt uintptr, tok uintptr, val uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var mcObj, s, v1 uintptr var _ /* len at bp+0 */ TTcl_Size _, _, _ = mcObj, s, v1 if *(*int32)(unsafe.Pointer(val)) < libc.Int32FromInt32(SECONDS_PER_DAY)/libc.Int32FromInt32(2) { mcObj = XClockMCGet(tls, opts, int32(MCLIT_AM)) } else { mcObj = XClockMCGet(tls, opts, int32(MCLIT_PM)) } if mcObj == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(mcObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(mcObj)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(mcObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, mcObj, bp) } s = v1 if _FrmResultAllocate(tls, dateFmt, int32(*(*TTcl_Size)(unsafe.Pointer(bp)))) != TCL_OK { return int32(TCL_ERROR) } libc.Xmemcpy(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, s, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp))+int64(1))) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart))) == int32('p') { *(*TTcl_Size)(unsafe.Pointer(bp)) = XTcl_UtfToUpper(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput) } *(*uintptr)(unsafe.Pointer(dateFmt + 16)) += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp))) return TCL_OK } func _ClockFmtToken_StarDate_Proc(tls *libc.TLS, dummy2805 uintptr, dateFmt uintptr, dummy2807 uintptr, dummy2808 uintptr) (r int32) { var fractYear, v int32 var v1, v2 uintptr _, _, _, _ = fractYear, v, v1, v2 /* Get day of year, zero based */ v = (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FdayOfYear - int32(1) /* Convert day of year to a fractional year */ if XIsGregorianLeapYear(tls, dateFmt+24) != 0 { fractYear = int32(1000) * v / int32(366) } else { fractYear = int32(1000) * v / int32(365) } /* Put together the StarDate as "Stardate %02d%03d.%1d" */ if _FrmResultAllocate(tls, dateFmt, int32(30)) != TCL_OK { return int32(TCL_ERROR) } libc.Xmemcpy(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, __ccgo_ts+14786, uint64(9)) *(*uintptr)(unsafe.Pointer(dateFmt + 16)) += uintptr(9) (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.Fyear-int32(RODDENBERRY), uint8('0'), uint16(2)) (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, fractYear, uint8('0'), uint16(3)) v2 = dateFmt + 16 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = uint8('.') /* be sure positive after decimal point (note: clock-value can be negative) */ v = int32((*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FsecondOfDay / int64(libc.Int32FromInt32(SECONDS_PER_DAY)/libc.Int32FromInt32(10))) if v < 0 { v = int32(10) + v } (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, v, uint8('0'), uint16(1)) return TCL_OK } func _ClockFmtToken_WeekOfYear_Proc(tls *libc.TLS, dummy2842 uintptr, dateFmt uintptr, tok uintptr, val uintptr) (r int32) { var dow int32 _ = dow dow = (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FdayOfWeek if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart))) == int32('U') { if dow == int32(7) { dow = 0 } dow++ } *(*int32)(unsafe.Pointer(val)) = ((*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FdayOfYear - dow + int32(7)) / int32(7) return TCL_OK } func _ClockFmtToken_JDN_Proc(tls *libc.TLS, dummy2860 uintptr, dateFmt uintptr, tok uintptr, dummy2863 uintptr) (r int32) { var fractJD, v7 int32 var intJD TTcl_WideInt var p, v1, v2, v3, v4, v5, v6, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _ = fractJD, intJD, p, v1, v2, v3, v4, v5, v6, v7, v8, v9 intJD = (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FjulianDay /* Convert to JDN parts (regarding start offset) and time fraction */ fractJD = int32((*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FsecondOfDay - int64(libc.Int32FromUint16((*TClockFormatTokenMap)(unsafe.Pointer((*TClockFormatToken)(unsafe.Pointer(tok)).Fmap1)).Foffs))) /* 0 for calendar or 43200 for astro JD */ if fractJD < 0 { intJD-- fractJD += int32(SECONDS_PER_DAY) } if fractJD != 0 && intJD < 0 { /* avoid jump over 0, by negative JD's */ intJD++ if intJD == 0 { /* -0.0 / -0.9 has zero integer part, so append "-" extra */ if _FrmResultAllocate(tls, dateFmt, int32(1)) != TCL_OK { return int32(TCL_ERROR) } v2 = dateFmt + 16 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = uint8('-') } /* and inverse seconds of day, -0(75) -> -0.25 as float */ fractJD = int32(SECONDS_PER_DAY) - fractJD } /* 21 is max width of (negative) wide-int (rather smaller, but anyway a time fraction below) */ if _FrmResultAllocate(tls, dateFmt, int32(21)) != TCL_OK { return int32(TCL_ERROR) } (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_witoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, intJD, uint8('0'), uint16(1)) /* simplest cases .0 and .5 */ if !(fractJD != 0) || fractJD == libc.Int32FromInt32(SECONDS_PER_DAY)/libc.Int32FromInt32(2) { /* point + 0 or 5 */ if _FrmResultAllocate(tls, dateFmt, libc.Int32FromInt32(1)+libc.Int32FromInt32(1)) != TCL_OK { return int32(TCL_ERROR) } v4 = dateFmt + 16 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8('.') v6 = dateFmt + 16 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ if !(fractJD != 0) { v7 = int32('0') } else { v7 = int32('5') } *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(v7) *(*uint8)(unsafe.Pointer((*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput)) = uint8('\000') return TCL_OK } else { /* to float (part after floating point, + 0.5 to round it up) */ fractJD = int32(float64(float64(fractJD)*libc.Float64FromInt32(JDN_MAX_PRECBOUND))/libc.Float64FromInt32(SECONDS_PER_DAY) + libc.Float64FromFloat64(0.5)) /* point + integer (as time fraction after floating point) */ if _FrmResultAllocate(tls, dateFmt, libc.Int32FromInt32(1)+libc.Int32FromInt32(JDN_MAX_PRECISION)) != TCL_OK { return int32(TCL_ERROR) } v9 = dateFmt + 16 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8('.') p = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, fractJD, uint8('0'), uint16(JDN_MAX_PRECISION)) /* remove trailing zero's */ (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput++ for p > (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + uintptr(-libc.Int32FromInt32(1))))) == int32('0') { p-- } *(*uint8)(unsafe.Pointer(p)) = uint8('\000') (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = p } return TCL_OK } func _ClockFmtToken_TimeZone_Proc(tls *libc.TLS, opts uintptr, dateFmt uintptr, tok uintptr, dummy2935 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var objPtr, s, v1, v2, v3 uintptr var sign uint8 var z int32 var _ /* len at bp+0 */ TTcl_Size _, _, _, _, _, _, _ = objPtr, s, sign, z, v1, v2, v3 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart))) == int32('z') { z = (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FtzOffset sign = uint8('+') if z < 0 { z = -z sign = uint8('-') } if _FrmResultAllocate(tls, dateFmt, int32(7)) != TCL_OK { return int32(TCL_ERROR) } v2 = dateFmt + 16 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = sign (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, z/int32(3600), uint8('0'), uint16(2)) z %= int32(3600) (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, z/int32(60), uint8('0'), uint16(2)) z %= int32(60) if z != 0 { (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, z, uint8('0'), uint16(2)) } } else { /* convert seconds to local seconds to obtain tzName object */ if XConvertUTCToLocal(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FdataPtr, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, dateFmt+24, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FtimezoneObj, int32(GREGORIAN_CHANGE_DATE)) != TCL_OK { return int32(TCL_ERROR) } objPtr = (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FtzName if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v3 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, objPtr, bp) } s = v3 if _FrmResultAllocate(tls, dateFmt, int32(*(*TTcl_Size)(unsafe.Pointer(bp)))) != TCL_OK { return int32(TCL_ERROR) } libc.Xmemcpy(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, s, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp))+int64(1))) *(*uintptr)(unsafe.Pointer(dateFmt + 16)) += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp))) } return TCL_OK } func _ClockFmtToken_LocaleERA_Proc(tls *libc.TLS, opts uintptr, dateFmt uintptr, dummy2982 uintptr, dummy2983 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var mcObj, s, v1 uintptr var _ /* len at bp+0 */ TTcl_Size _, _, _ = mcObj, s, v1 if (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FisBce != 0 { mcObj = XClockMCGet(tls, opts, int32(MCLIT_BCE)) } else { mcObj = XClockMCGet(tls, opts, int32(MCLIT_CE)) } if mcObj == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(mcObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(mcObj)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(mcObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, mcObj, bp) } s = v1 if _FrmResultAllocate(tls, dateFmt, int32(*(*TTcl_Size)(unsafe.Pointer(bp)))) != TCL_OK { return int32(TCL_ERROR) } libc.Xmemcpy(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, s, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp))+int64(1))) *(*uintptr)(unsafe.Pointer(dateFmt + 16)) += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp))) return TCL_OK } func _ClockFmtToken_LocaleERAYear_Proc(tls *libc.TLS, opts uintptr, dateFmt uintptr, tok uintptr, val uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var mcObj, mcObj1, s, v4 uintptr var v1 int32 var v2, v3 int64 var _ /* len at bp+24 */ TTcl_Size var _ /* objPtr at bp+16 */ uintptr var _ /* rowc at bp+0 */ TTcl_Size var _ /* rowv at bp+8 */ uintptr _, _, _, _, _, _, _ = mcObj, mcObj1, s, v1, v2, v3, v4 if (*TDateFormat)(unsafe.Pointer(dateFmt)).FlocaleEra == libc.UintptrFromInt32(0) { mcObj = XClockMCGet(tls, opts, int32(MCLIT_LOCALE_ERAS)) if mcObj == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(mcObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mcObj + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mcObj + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mcObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mcObj + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mcObj + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mcObj + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mcObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v3 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjGetElements(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, mcObj, bp, bp+8) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp)) != 0 { (*TDateFormat)(unsafe.Pointer(dateFmt)).FlocaleEra = XLookupLastTransition(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.FlocalSeconds, *(*TTcl_Size)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), libc.UintptrFromInt32(0)) } if (*TDateFormat)(unsafe.Pointer(dateFmt)).FlocaleEra == libc.UintptrFromInt32(0) { (*TDateFormat)(unsafe.Pointer(dateFmt)).FlocaleEra = libc.UintptrFromInt32(1) } } /* if no LOCALE_ERAS in catalog or era not found */ if (*TDateFormat)(unsafe.Pointer(dateFmt)).FlocaleEra == libc.UintptrFromInt32(1) { if _FrmResultAllocate(tls, dateFmt, int32(11)) != TCL_OK { return int32(TCL_ERROR) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart))) == int32('C') { /* %EC */ *(*int32)(unsafe.Pointer(val)) = (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.Fyear / int32(100) (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, *(*int32)(unsafe.Pointer(val)), uint8('0'), uint16(2)) } else { /* %Ey */ *(*int32)(unsafe.Pointer(val)) = (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.Fyear % int32(100) (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, *(*int32)(unsafe.Pointer(val)), uint8('0'), uint16(2)) } } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart))) == int32('C') { /* %EC */ if XTcl_ListObjIndex(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TDateFormat)(unsafe.Pointer(dateFmt)).FlocaleEra, int64(1), bp+16) != TCL_OK { return int32(TCL_ERROR) } } else { /* %Ey */ if XTcl_ListObjIndex(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TDateFormat)(unsafe.Pointer(dateFmt)).FlocaleEra, int64(2), bp+16) != TCL_OK { return int32(TCL_ERROR) } if XTcl_GetIntFromObj(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, *(*uintptr)(unsafe.Pointer(bp + 16)), val) != TCL_OK { return int32(TCL_ERROR) } *(*int32)(unsafe.Pointer(val)) = (*TDateFormat)(unsafe.Pointer(dateFmt)).Fdate.Fyear - *(*int32)(unsafe.Pointer(val)) /* if year in locale numerals */ if *(*int32)(unsafe.Pointer(val)) >= 0 && *(*int32)(unsafe.Pointer(val)) < int32(100) { /* year as integer */ mcObj1 = XClockMCGet(tls, opts, int32(MCLIT_LOCALE_NUMERALS)) if mcObj1 == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if XTcl_ListObjIndex(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, mcObj1, int64(*(*int32)(unsafe.Pointer(val))), bp+16) != TCL_OK { return int32(TCL_ERROR) } } else { /* year as integer */ if _FrmResultAllocate(tls, dateFmt, int32(11)) != TCL_OK { return int32(TCL_ERROR) } (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, *(*int32)(unsafe.Pointer(val)), uint8('0'), uint16(2)) return TCL_OK } } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength v4 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes } else { v4 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), bp+24) } s = v4 if _FrmResultAllocate(tls, dateFmt, int32(*(*TTcl_Size)(unsafe.Pointer(bp + 24)))) != TCL_OK { return int32(TCL_ERROR) } libc.Xmemcpy(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, s, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 24))+int64(1))) *(*uintptr)(unsafe.Pointer(dateFmt + 16)) += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 24))) } return TCL_OK } /* * Descriptors for the various fields in [clock format]. */ var _FmtSTokenMapIndex = __ccgo_ts + 14796 var _FmtSTokenMap = [31]TClockFormatTokenMap{ 0: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 52)), }, 1: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14830, Fwidth: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 52)), }, 2: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 48)), }, 3: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14830, Fwidth: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 48)), }, 4: { Ftype1: uint16(CTOKT_INT), Fflags: libc.Uint16FromInt32(int32(CLFMT_LOCALE_INDX) | int32(CLFMT_DECR)), Fdivmod: uint16(12), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 48)), Fdata: uintptr(MCLIT_MONTHS_ABBREV), }, 5: { Ftype1: uint16(CTOKT_INT), Fflags: libc.Uint16FromInt32(int32(CLFMT_LOCALE_INDX) | int32(CLFMT_DECR)), Fdivmod: uint16(12), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 48)), Fdata: uintptr(MCLIT_MONTHS_FULL), }, 6: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Fdivmod: uint16(100), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 40)), }, 7: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(4), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 40)), }, 8: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Fdivider: uint16(100), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 40)), }, 9: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Fdivider: uint16(3600), Fdivmod: uint16(24), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), }, 10: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Fdivider: uint16(60), Fdivmod: uint16(60), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), }, 11: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Fdivmod: uint16(60), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), }, 12: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Fflags: uint16(CLFMT_CALC), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), }, 13: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14830, Fwidth: uint16(2), Fdivider: uint16(3600), Fdivmod: uint16(24), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), }, 14: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14830, Fwidth: uint16(2), Fflags: uint16(CLFMT_CALC), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), }, 15: { Ftype1: uint16(CTOKT_INT), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), }, 16: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivmod: uint16(7), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 64)), Fdata: uintptr(MCLIT_DAYS_OF_WEEK_ABBREV), }, 17: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivmod: uint16(7), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 64)), Fdata: uintptr(MCLIT_DAYS_OF_WEEK_FULL), }, 18: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14830, Fwidth: uint16(1), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 64)), }, 19: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14830, Fwidth: uint16(1), Fdivmod: uint16(7), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 64)), }, 20: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Fflags: uint16(CLFMT_CALC), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 44)), }, 21: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 60)), }, 22: { Ftype1: uint16(CFMTT_PROC), }, 23: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(2), Fdivmod: uint16(100), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 56)), }, 24: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(4), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 56)), }, 25: { Ftype1: uint16(CTOKT_INT), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(3), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 44)), }, 26: { Ftype1: uint16(CTOKT_WIDE), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(7), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 24)), }, 27: { Ftype1: uint16(CTOKT_WIDE), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(1), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24)), }, 28: { Ftype1: uint16(CTOKT_CHAR), Ftostr: __ccgo_ts + 286, }, 29: { Ftype1: uint16(CTOKT_CHAR), Ftostr: __ccgo_ts + 14671, }, 30: { Ftype1: uint16(CFMTT_PROC), }, } func init() { p := unsafe.Pointer(&_FmtSTokenMap) *(*uintptr)(unsafe.Add(p, 608)) = __ccgo_fp(_ClockFmtToken_HourAMPM_Proc) *(*uintptr)(unsafe.Add(p, 704)) = __ccgo_fp(_ClockFmtToken_HourAMPM_Proc) *(*uintptr)(unsafe.Add(p, 752)) = __ccgo_fp(_ClockFmtToken_AMPM_Proc) *(*uintptr)(unsafe.Add(p, 992)) = __ccgo_fp(_ClockFmtToken_WeekOfYear_Proc) *(*uintptr)(unsafe.Add(p, 1088)) = __ccgo_fp(_ClockFmtToken_TimeZone_Proc) *(*uintptr)(unsafe.Add(p, 1472)) = __ccgo_fp(_ClockFmtToken_StarDate_Proc) } var _FmtSTokenMapAliasIndex = [2]uintptr{ 0: __ccgo_ts + 14832, 1: __ccgo_ts + 14837, } var _FmtETokenMapIndex = __ccgo_ts + 14701 var _FmtETokenMap = [5]TClockFormatTokenMap{ 0: { Ftype1: uint16(CFMTT_PROC), }, 1: { Ftype1: uint16(CFMTT_PROC), }, 2: { Ftype1: uint16(CFMTT_PROC), Foffs: libc.Uint16FromInt32(libc.Int32FromInt32(SECONDS_PER_DAY) / libc.Int32FromInt32(2)), }, 3: { Ftype1: uint16(CTOKT_INT), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 40)), }, 4: { Ftype1: uint16(CTOKT_WIDE), Ftostr: __ccgo_ts + 14828, Fwidth: uint16(1), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 8)), }, } func init() { p := unsafe.Pointer(&_FmtETokenMap) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_ClockFmtToken_LocaleERA_Proc) *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_ClockFmtToken_JDN_Proc) *(*uintptr)(unsafe.Add(p, 128)) = __ccgo_fp(_ClockFmtToken_JDN_Proc) *(*uintptr)(unsafe.Add(p, 176)) = __ccgo_fp(_ClockFmtToken_LocaleERAYear_Proc) } var _FmtETokenMapAliasIndex = [2]uintptr{ 0: __ccgo_ts + 11678, 1: __ccgo_ts + 14842, } var _FmtOTokenMapIndex = __ccgo_ts + 14844 var _FmtOTokenMap = [9]TClockFormatTokenMap{ 0: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivmod: uint16(100), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 52)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 1: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivmod: uint16(100), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 48)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 2: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivmod: uint16(100), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 40)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 3: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivider: uint16(3600), Fdivmod: uint16(24), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 4: { Ftype1: uint16(CTOKT_INT), Fflags: libc.Uint16FromInt32(int32(CLFMT_CALC) | int32(CLFMT_LOCALE_INDX)), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 5: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivider: uint16(60), Fdivmod: uint16(60), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 6: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivmod: uint16(60), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 88)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 7: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivmod: uint16(100), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 64)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, 8: { Ftype1: uint16(CTOKT_INT), Fflags: uint16(CLFMT_LOCALE_INDX), Fdivmod: uint16(7), Foffs: uint16(uint64(libc.UintptrFromInt32(0) + 24 + 64)), Fdata: uintptr(MCLIT_LOCALE_NUMERALS), }, } func init() { p := unsafe.Pointer(&_FmtOTokenMap) *(*uintptr)(unsafe.Add(p, 224)) = __ccgo_fp(_ClockFmtToken_HourAMPM_Proc) } var _FmtOTokenMapAliasIndex = [2]uintptr{ 0: __ccgo_ts + 14854, 1: __ccgo_ts + 14858, } var _FmtWordTokenMap = TClockFormatTokenMap{ Ftype1: uint16(CTOKT_WORD), } // C documentation // // /* // *---------------------------------------------------------------------- // */ func XClockGetOrParseFmtFormat(tls *libc.TLS, interp uintptr, formatObj uintptr) (r uintptr) { /* Format container */ var aliasIndex, cp, e, fmtMap, fmtTok, fss, mapIndex, p, tok, wordTok, v1, v2, v6, v7, v8, v9 uintptr var tokCnt uint32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aliasIndex, cp, e, fmtMap, fmtTok, fss, mapIndex, p, tok, tokCnt, wordTok, v1, v2, v6, v7, v8, v9 fss = XTcl_GetClockFrmScnFromObj(tls, interp, formatObj) if fss == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } /* if format (fmtTok) already tokenized */ if (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTok != libc.UintptrFromInt32(0) { return fss } XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) /* first time formatting - tokenize format */ if (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTok == libc.UintptrFromInt32(0) { v1 = _HashEntry4FmtScn(tls, fss) + 32 p = v1 e = v1 e += uintptr(libc.Xstrlen(tls, p)) /* estimate token count by % char and format length */ (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC = _EstimateTokenCount(tls, p, e) v2 = XTcl_Alloc(tls, uint64(24)*uint64((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC)) tok = v2 fmtTok = v2 libc.Xmemset(tls, tok, 0, uint64(24)) tokCnt = uint32(1) for p < e { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) { case int32('%'): goto _3 default: goto _4 } goto _5 _3: ; fmtMap = uintptr(unsafe.Pointer(&_FmtSTokenMap)) mapIndex = _FmtSTokenMapIndex aliasIndex = uintptr(unsafe.Pointer(&_FmtSTokenMapAliasIndex)) if p+uintptr(1) >= e { goto word_tok } p++ /* try to find modifier: */ switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) { case int32('%'): /* begin new word token - don't join with previous word token, * because current mapping should be "...%%..." -> "...%..." */ (*TClockFormatToken)(unsafe.Pointer(tok)).Fmap1 = uintptr(unsafe.Pointer(&_FmtWordTokenMap)) (*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart = p (*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fend = p + uintptr(1) tok += 24 v6 = tok if v6 >= fmtTok+uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC)*24 { fmtTok = XTcl_Realloc(tls, fmtTok, uint64((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC+libc.Uint32FromInt32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE))*uint64(24)) tok = fmtTok + uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC)*24 *(*uint32)(unsafe.Pointer(fss + 32)) += uint32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE) } libc.Xmemset(tls, tok, 0, uint64(24)) tokCnt++ p++ continue case int32('E'): fmtMap = uintptr(unsafe.Pointer(&_FmtETokenMap)) mapIndex = _FmtETokenMapIndex aliasIndex = uintptr(unsafe.Pointer(&_FmtETokenMapAliasIndex)) p++ case int32('O'): fmtMap = uintptr(unsafe.Pointer(&_FmtOTokenMap)) mapIndex = _FmtOTokenMapIndex aliasIndex = uintptr(unsafe.Pointer(&_FmtOTokenMapAliasIndex)) p++ break } /* search direct index */ cp = libc.Xstrchr(tls, mapIndex, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))) if !(cp != 0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cp))) == int32('\000') { /* search wrapper index (multiple chars for same token) */ cp = libc.Xstrchr(tls, *(*uintptr)(unsafe.Pointer(aliasIndex)), libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))) if !(cp != 0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cp))) == int32('\000') { p-- if fmtMap != uintptr(unsafe.Pointer(&_FmtSTokenMap)) { p-- } goto word_tok } cp = libc.Xstrchr(tls, mapIndex, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(aliasIndex + 1*8)) + uintptr(int64(cp)-int64(*(*uintptr)(unsafe.Pointer(aliasIndex)))))))) if !(cp != 0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cp))) == int32('\000') { /* unexpected, but ... */ p-- if fmtMap != uintptr(unsafe.Pointer(&_FmtSTokenMap)) { p-- } goto word_tok } } (*TClockFormatToken)(unsafe.Pointer(tok)).Fmap1 = fmtMap + uintptr(int64(cp)-int64(mapIndex))*48 (*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart = p /* next token */ tok += 24 v7 = tok if v7 >= fmtTok+uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC)*24 { fmtTok = XTcl_Realloc(tls, fmtTok, uint64((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC+libc.Uint32FromInt32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE))*uint64(24)) tok = fmtTok + uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC)*24 *(*uint32)(unsafe.Pointer(fss + 32)) += uint32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE) } libc.Xmemset(tls, tok, 0, uint64(24)) tokCnt++ p++ continue _4: ; goto word_tok word_tok: ; /* try continue with previous word token */ wordTok = tok - uintptr(1)*24 if wordTok < fmtTok || (*TClockFormatToken)(unsafe.Pointer(wordTok)).Fmap1 != uintptr(unsafe.Pointer(&_FmtWordTokenMap)) { /* start with new word token */ wordTok = tok (*TClockFormatToken)(unsafe.Pointer(wordTok)).FtokWord.Fstart = p (*TClockFormatToken)(unsafe.Pointer(wordTok)).Fmap1 = uintptr(unsafe.Pointer(&_FmtWordTokenMap)) } for cond := true; cond; cond = p < e && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) != int32('%') { p = XTcl_UtfNext(tls, p) } (*TClockFormatToken)(unsafe.Pointer(wordTok)).FtokWord.Fend = p if wordTok == tok { tok += 24 v8 = tok if v8 >= fmtTok+uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC)*24 { fmtTok = XTcl_Realloc(tls, fmtTok, uint64((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC+libc.Uint32FromInt32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE))*uint64(24)) tok = fmtTok + uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC)*24 *(*uint32)(unsafe.Pointer(fss + 32)) += uint32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE) } libc.Xmemset(tls, tok, 0, uint64(24)) tokCnt++ } goto _5 _5: } /* correct count of real used tokens and free mem if desired * (1 is acceptable delta to prevent memory fragmentation) */ if (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC > tokCnt+libc.Uint32FromInt32(libc.Int32FromInt32(CLOCK_MIN_TOK_CHAIN_BLOCK_SIZE)/libc.Int32FromInt32(2)) { v9 = XTclpRealloc(tls, fmtTok, uint64(tokCnt)*uint64(24)) tok = v9 if v9 != libc.UintptrFromInt32(0) { fmtTok = tok } } /* now we're ready - assign now to storage (note the threaded race condition) */ (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTok = fmtTok (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTokC = tokCnt } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) return fss } // C documentation // // /* // *---------------------------------------------------------------------- // */ func XClockFormat(tls *libc.TLS, dateFmt uintptr, opts uintptr) (r int32) { bp := tls.Alloc(112) defer tls.Free(112) /* Command options */ var cachePtr, fss, map1, result, s, tok, v1, v2, v5, v6, v7, v8, v9 uintptr var len1 TTcl_Size var size Tsize_t var val1 TTcl_WideInt var v10, v3 bool var _ /* mcObj at bp+88 */ uintptr var _ /* resMem at bp+0 */ [80]uint8 var _ /* val at bp+80 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, fss, len1, map1, result, s, size, tok, val1, v1, v10, v2, v3, v5, v6, v7, v8, v9 /* get localized format */ if XClockLocalizeFormat(tls, opts) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } v1 = XClockGetOrParseFmtFormat(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).FformatObj) fss = v1 if v3 = !(v1 != 0); !v3 { v2 = (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtTok tok = v2 } if v3 || !(v2 != 0) { return int32(TCL_ERROR) } /* result container object */ (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem = bp (*TDateFormat)(unsafe.Pointer(dateFmt)).FresEnd = (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem + uintptr(80) if (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtMinAlloc > uint64(80) { (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem = XTclpAlloc(tls, (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtMinAlloc) if (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } (*TDateFormat)(unsafe.Pointer(dateFmt)).FresEnd = (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem + uintptr((*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtMinAlloc) } (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem *(*uint8)(unsafe.Pointer((*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput)) = uint8('\000') /* do format each token */ for { if !((*TClockFormatToken)(unsafe.Pointer(tok)).Fmap1 != libc.UintptrFromInt32(0)) { break } map1 = (*TClockFormatToken)(unsafe.Pointer(tok)).Fmap1 switch libc.Int32FromUint16((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Ftype1) { case int32(CTOKT_INT): *(*int32)(unsafe.Pointer(bp + 80)) = *(*int32)(unsafe.Pointer(dateFmt + uintptr((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Foffs))) if (*TClockFormatTokenMap)(unsafe.Pointer(map1)).Ffmtproc == libc.UintptrFromInt32(0) { if libc.Int32FromUint16((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fflags)&int32(CLFMT_DECR) != 0 { *(*int32)(unsafe.Pointer(bp + 80))-- } if libc.Int32FromUint16((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fflags)&int32(CLFMT_INCR) != 0 { *(*int32)(unsafe.Pointer(bp + 80))++ } if (*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fdivider != 0 { *(*int32)(unsafe.Pointer(bp + 80)) /= libc.Int32FromUint16((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fdivider) } if (*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fdivmod != 0 { *(*int32)(unsafe.Pointer(bp + 80)) %= libc.Int32FromUint16((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fdivmod) } } else { if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TClockFormatTokenMap)(unsafe.Pointer(map1)).Ffmtproc})))(tls, opts, dateFmt, tok, bp+80) != TCL_OK { goto done } /* if not calculate only (output inside fmtproc) */ if !(libc.Int32FromUint16((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fflags)&int32(CLFMT_CALC) != 0) { goto _4 } } if !(libc.Int32FromUint16((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fflags)&int32(CLFMT_LOCALE_INDX) != 0) { if _FrmResultAllocate(tls, dateFmt, int32(11)) != TCL_OK { goto error } if (*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fwidth != 0 { (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_itoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, *(*int32)(unsafe.Pointer(bp + 80)), *(*uint8)(unsafe.Pointer((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Ftostr)), (*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fwidth) } else { *(*uintptr)(unsafe.Pointer(dateFmt + 16)) += uintptr(libc.Xsprintf(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, (*TClockFormatTokenMap)(unsafe.Pointer(map1)).Ftostr, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(bp + 80))))) } } else { *(*uintptr)(unsafe.Pointer(bp + 88)) = XClockMCGet(tls, opts, int32(int64((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fdata))) if *(*uintptr)(unsafe.Pointer(bp + 88)) == libc.UintptrFromInt32(0) { goto error } if XTcl_ListObjIndex(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, *(*uintptr)(unsafe.Pointer(bp + 88)), int64(*(*int32)(unsafe.Pointer(bp + 80))), bp+88) != TCL_OK || *(*uintptr)(unsafe.Pointer(bp + 88)) == libc.UintptrFromInt32(0) { goto error } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes != 0 { v5 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes } else { v5 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 88)), libc.UintptrFromInt32(0)) } s = v5 if _FrmResultAllocate(tls, dateFmt, int32((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Flength)) != TCL_OK { goto error } libc.Xmemcpy(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, s, libc.Uint64FromInt64((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Flength+int64(1))) *(*uintptr)(unsafe.Pointer(dateFmt + 16)) += uintptr((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Flength) } case int32(CTOKT_WIDE): val1 = *(*TTcl_WideInt)(unsafe.Pointer(dateFmt + uintptr((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Foffs))) if _FrmResultAllocate(tls, dateFmt, int32(21)) != TCL_OK { goto error } if (*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fwidth != 0 { (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput = _Clock_witoaw(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, val1, *(*uint8)(unsafe.Pointer((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Ftostr)), (*TClockFormatTokenMap)(unsafe.Pointer(map1)).Fwidth) } else { *(*uintptr)(unsafe.Pointer(dateFmt + 16)) += uintptr(libc.Xsprintf(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, (*TClockFormatTokenMap)(unsafe.Pointer(map1)).Ftostr, libc.VaList(bp+104, val1))) } case int32(CTOKT_CHAR): if _FrmResultAllocate(tls, dateFmt, int32(1)) != TCL_OK { goto error } v7 = dateFmt + 16 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = *(*uint8)(unsafe.Pointer((*TClockFormatTokenMap)(unsafe.Pointer(map1)).Ftostr)) case int32(CFMTT_PROC): if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TClockFormatTokenMap)(unsafe.Pointer(map1)).Ffmtproc})))(tls, opts, dateFmt, tok, libc.UintptrFromInt32(0)) != TCL_OK { goto error } case int32(CTOKT_WORD): len1 = int64((*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fend) - int64((*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart) if _FrmResultAllocate(tls, dateFmt, int32(len1)) != TCL_OK { goto error } if len1 == int64(1) { v9 = dateFmt + 16 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = *(*uint8)(unsafe.Pointer((*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart)) } else { libc.Xmemcpy(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput, (*TClockFormatToken)(unsafe.Pointer(tok)).FtokWord.Fstart, libc.Uint64FromInt64(len1)) *(*uintptr)(unsafe.Pointer(dateFmt + 16)) += uintptr(len1) } break } goto _4 _4: ; tok += 24 } goto done goto error error: ; if (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem != bp { XTclpFree(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem) } (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem = libc.UintptrFromInt32(0) goto done done: ; if (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem != 0 { if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { result = XTclThreadAllocObj(tls) } else { result = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(result + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(result)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(result)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(result)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(result)).Flength = int64((*TDateFormat)(unsafe.Pointer(dateFmt)).Foutput) - int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem) size = libc.Uint64FromInt64((*TTcl_Obj)(unsafe.Pointer(result)).Flength + int64(1)) if (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem == bp { (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes = XTclpAlloc(tls, size) if (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes, (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem, size) } else { if libc.Uint64FromInt64(int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresEnd)-int64((*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem))/size > uint64(MAX_FMT_RESULT_THRESHOLD) { (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes = XTclpRealloc(tls, (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem, size) if (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes == libc.UintptrFromInt32(0) { (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes = (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem } } else { (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes = (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem } } /* save last used buffer length */ if (*TDateFormat)(unsafe.Pointer(dateFmt)).FresMem != bp && (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtMinAlloc < size+uint64(MIN_FMT_RESULT_BLOCK_DELTA) { (*TClockFmtScnStorage)(unsafe.Pointer(fss)).FfmtMinAlloc = size + uint64(MIN_FMT_RESULT_BLOCK_DELTA) } *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(result)).Fbytes + uintptr((*TTcl_Obj)(unsafe.Pointer(result)).Flength))) = uint8('\000') XTcl_SetObjResult(tls, (*TClockFmtScnCmdArgs)(unsafe.Pointer(opts)).Finterp, result) return TCL_OK } return int32(TCL_ERROR) } func XClockFrmScnClearCaches(tls *libc.TLS) { XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) /* clear caches ... */ XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) } func XClockFrmScnFinalize(tls *libc.TLS) { if !(_initialized1 != 0) { return } XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) /* clear GC */ _ClockFmtScnStorage_GC.FstackPtr = libc.UintptrFromInt32(0) _ClockFmtScnStorage_GC.FstackBound = libc.UintptrFromInt32(0) _ClockFmtScnStorage_GC.Fcount = uint32(0) if _initialized1 != 0 { _initialized1 = 0 XTcl_DeleteHashTable(tls, uintptr(unsafe.Pointer(&_FmtScnHashTable))) } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) XTcl_MutexFinalize(tls, uintptr(unsafe.Pointer(&_ClockFmtMutex))) } const BG_FLUSH_SCHEDULED = 128 const BUFFER_PADDING = 16 const CHANNELBUFFER_DEFAULT_SIZE = 4096 const CHANNEL_BLOCKED = 2048 const CHANNEL_CLOSED = 256 const CHANNEL_CLOSEDWRITE = 2097152 const CHANNEL_DEAD = 8192 const CHANNEL_ENCODING_ERROR = 32768 const CHANNEL_EOF = 512 const CHANNEL_INCLOSE = 524288 const CHANNEL_LINEBUFFERED = 131072 const CHANNEL_NEED_MORE_DATA = 16384 const CHANNEL_NONBLOCKING = 64 const CHANNEL_RAW_MODE = 65536 const CHANNEL_STICKY_EOF = 1024 const CHANNEL_UNBUFFERED = 262144 const INPUT_SAW_CR = 4096 const SYNTHETIC_EVENT_TIME = 0 type TChannelBuffer = struct { FrefCount TTcl_Size FnextAdded TTcl_Size FnextRemoved TTcl_Size FbufLength TTcl_Size FnextPtr uintptr } type TEventScriptRecord = struct { FchanPtr uintptr FscriptPtr uintptr Finterp uintptr Fmask int32 FnextPtr uintptr } type TChannel = struct { Fstate uintptr FinstanceData uintptr FtypePtr uintptr FdownChanPtr uintptr FupChanPtr uintptr FinQueueHead uintptr FinQueueTail uintptr FrefCount TTcl_Size } type TChannelState = struct { FchannelName uintptr Fflags int32 Fencoding TTcl_Encoding FinputEncodingState TTcl_EncodingState FinputEncodingFlags int32 FoutputEncodingState TTcl_EncodingState FoutputEncodingFlags int32 FinputTranslation TTclEolTranslation FoutputTranslation TTclEolTranslation FinEofChar int32 FunreportedError int32 FrefCount TTcl_Size FcloseCbPtr uintptr FoutputStage uintptr FcurOutPtr uintptr FoutQueueHead uintptr FoutQueueTail uintptr FsaveInBufPtr uintptr FinQueueHead uintptr FinQueueTail uintptr FchPtr uintptr FinterestMask int32 FscriptRecordPtr uintptr FbufSize TTcl_Size Ftimer TTcl_TimerToken FtimerChanPtr uintptr FcsPtrR uintptr FcsPtrW uintptr FtopChanPtr uintptr FbottomChanPtr uintptr FnextCSPtr uintptr FmanagingThread TTcl_ThreadId FchanMsg uintptr FunreportedMsg uintptr Fepoch TTcl_Size FmaxPerms int32 } /* !END!: Do not edit above this line. */ /* * The state structure used by [foreach]. Note that the actual structure has * all its working arrays appended afterwards so they can be allocated and * freed in a single step. */ type TForeachState = struct { FbodyPtr uintptr FbodyIdx TTcl_Size Fj TTcl_Size Fmaxj TTcl_Size FnumLists TTcl_Size Findex uintptr FvarcList uintptr FvarvList uintptr FvCopyList uintptr FargcList uintptr FargvList uintptr FaCopyList uintptr FresultList uintptr } /* *---------------------------------------------------------------------- * * Tcl_BreakObjCmd -- * * This procedure is invoked to process the "break" Tcl command. See the * user documentation for details on what it does. * * With the bytecode compiler, this procedure is only called when a * command name is computed at runtime, and is "break" or the name to * which "break" was renamed: e.g., "set z break; $z" * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_BreakObjCmd(tls *libc.TLS, dummy125 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } return int32(TCL_BREAK) } /* *---------------------------------------------------------------------- * * Tcl_CatchObjCmd -- * * This object-based procedure is invoked to process the "catch" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_CatchObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRCatchObjCmd), clientData, int64(objc), objv) } func XTclNRCatchObjCmd(tls *libc.TLS, dummy166 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var _objPtr, cachePtr, iPtr, optionVarNamePtr, varNamePtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _, _ = _objPtr, cachePtr, iPtr, optionVarNamePtr, varNamePtr, v1 varNamePtr = libc.UintptrFromInt32(0) optionVarNamePtr = libc.UintptrFromInt32(0) iPtr = interp if objc < int32(2) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+14862) return int32(TCL_ERROR) } if objc >= int32(3) { varNamePtr = *(*uintptr)(unsafe.Pointer(objv + 2*8)) } if objc == int32(4) { optionVarNamePtr = *(*uintptr)(unsafe.Pointer(objv + 3*8)) } if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_CatchObjCmdCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = uintptr(int64(objc)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = varNamePtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = optionVarNamePtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) /* * TIP #280. Make invoking context available to caught script. */ return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, int32(1)) } func _CatchObjCmdCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iPtr, optionVarNamePtr, options, varNamePtr uintptr var objc, rewind int32 _, _, _, _, _, _ = iPtr, objc, optionVarNamePtr, options, rewind, varNamePtr iPtr = interp objc = int32(int64(*(*uintptr)(unsafe.Pointer(data)))) varNamePtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) optionVarNamePtr = *(*uintptr)(unsafe.Pointer(data + 2*8)) rewind = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).Frewind /* * We disable catch in interpreters where the limit has been exceeded. */ if rewind != 0 || XTcl_LimitExceeded(tls, interp) != 0 { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+14901, libc.VaList(bp+8, XTcl_GetErrorLine(tls, interp)))) return int32(TCL_ERROR) } if objc >= int32(3) { if libc.UintptrFromInt32(0) == XTcl_ObjSetVar2(tls, interp, varNamePtr, libc.UintptrFromInt32(0), XTcl_GetObjResult(tls, interp), int32(TCL_LEAVE_ERR_MSG)) { return int32(TCL_ERROR) } } if objc == int32(4) { options = XTcl_GetReturnOptions(tls, interp, result) if libc.UintptrFromInt32(0) == XTcl_ObjSetVar2(tls, interp, optionVarNamePtr, libc.UintptrFromInt32(0), options, int32(TCL_LEAVE_ERR_MSG)) { /* Do not decrRefCount 'options', it was already done by * Tcl_ObjSetVar2 */ return int32(TCL_ERROR) } } XTcl_ResetResult(tls, interp) XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64(result))) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_CdObjCmd -- * * This procedure is invoked to process the "cd" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_CdObjCmd(tls *libc.TLS, dummy261 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(256) defer tls.Free(256) /* Argument objects. */ var _objPtr, dir, v1, v2, v4 uintptr var result int32 var v3 TTcl_Size var _ /* ds at bp+0 */ TTcl_DString _, _, _, _, _, _, _ = _objPtr, dir, result, v1, v2, v3, v4 if objc > int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+14929) return int32(TCL_ERROR) } if objc == int32(2) { dir = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } else { dir = XTclGetHomeDirObj(tls, interp, libc.UintptrFromInt32(0)) if dir == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } (*TTcl_Obj)(unsafe.Pointer(dir)).FrefCount++ } if XTcl_FSConvertToPathType(tls, interp, dir) != TCL_OK { result = int32(TCL_ERROR) } else { if (*TTcl_Obj)(unsafe.Pointer(dir)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(dir)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, dir, libc.UintptrFromInt32(0)) } result = XTcl_UtfToExternalDStringEx(tls, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), v1, int64(-int32(1)), 0, bp, libc.UintptrFromInt32(0)) XTcl_DStringFree(tls, bp) if result == TCL_OK { result = XTcl_FSChdir(tls, dir) } if result != TCL_OK { if (*TTcl_Obj)(unsafe.Pointer(dir)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(dir)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, dir, libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+14939, libc.VaList(bp+232, v2, XTcl_PosixError(tls, interp)))) result = int32(TCL_ERROR) } } if objc != int32(2) { _objPtr = dir v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return result } /* *---------------------------------------------------------------------- * * Tcl_ConcatObjCmd -- * * This object-based procedure is invoked to process the "concat" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_ConcatObjCmd(tls *libc.TLS, dummy324 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ if objc >= int32(2) { XTcl_SetObjResult(tls, interp, XTcl_ConcatObj(tls, int64(objc-int32(1)), objv+uintptr(1)*8)) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_ContinueObjCmd -- * * This procedure is invoked to process the "continue" Tcl command. See * the user documentation for details on what it does. * * With the bytecode compiler, this procedure is only called when a * command name is computed at runtime, and is "continue" or the name to * which "continue" was renamed: e.g., "set z continue; $z" * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_ContinueObjCmd(tls *libc.TLS, dummy358 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } return int32(TCL_CONTINUE) } /* *----------------------------------------------------------------------------- * * TclInitEncodingCmd -- * * This function creates the 'encoding' ensemble. * * Results: * Returns the Tcl_Command so created. * * Side effects: * The ensemble is initialized. * * This command is hidden in a safe interpreter. */ func XTclInitEncodingCmd(tls *libc.TLS, interp uintptr) (r TTcl_Command) { return XTclMakeEnsemble(tls, interp, __ccgo_ts+5615, uintptr(unsafe.Pointer(&_encodingImplMap))) } /* Tcl interpreter */ var _encodingImplMap = [7]TEnsembleImplMap{ 0: { Fname: __ccgo_ts + 14985, }, 1: { Fname: __ccgo_ts + 14997, }, 2: { Fname: __ccgo_ts + 5624, Funsafe: int32(1), }, 3: { Fname: __ccgo_ts + 15007, }, 4: { Fname: __ccgo_ts + 15013, }, 5: { Fname: __ccgo_ts + 5629, Funsafe: int32(1), }, 6: {}, } func init() { p := unsafe.Pointer(&_encodingImplMap) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_EncodingConvertfromObjCmd) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileBasic1To3ArgCmd) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_EncodingConverttoObjCmd) *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(XTclCompileBasic1To3ArgCmd) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_EncodingDirsObjCmd) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 152)) = __ccgo_fp(_EncodingNamesObjCmd) *(*uintptr)(unsafe.Add(p, 160)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 200)) = __ccgo_fp(_EncodingProfilesObjCmd) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 248)) = __ccgo_fp(_EncodingSystemObjCmd) *(*uintptr)(unsafe.Add(p, 256)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) } // C documentation // // /* // *------------------------------------------------------------------------ // * // * EncodingConvertParseOptions -- // * // * Common routine for parsing arguments passed to encoding convertfrom // * and encoding convertto. // * // * Results: // * TCL_OK or TCL_ERROR. // * // * Side effects: // * On success, // * - *encPtr is set to the encoding. Must be freed with Tcl_FreeEncoding // * if non-NULL // * - *dataObjPtr is set to the Tcl_Obj containing the data to encode or // * decode // * - *profilePtr is set to encoding error handling profile // * - *failVarPtr is set to -failindex option value or NULL // * On error, all of the above are uninitialized. // * // *------------------------------------------------------------------------ // */ func _EncodingConvertParseOptions(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, encPtr uintptr, dataObjPtr uintptr, profilePtr uintptr, failVarPtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Where to store -failindex option value */ var argIndex, v3 int32 var dataObj, failVarObj uintptr var _ /* encoding at bp+8 */ TTcl_Encoding var _ /* optIndex at bp+0 */ int32 var _ /* profile at bp+16 */ int32 _, _, _, _ = argIndex, dataObj, failVarObj, v3 *(*int32)(unsafe.Pointer(bp + 16)) = TCL_ENCODING_STOPONERROR /* * Possible combinations: * 1) data -> objc = 2 * 2) ?options? encoding data -> objc >= 3 * It is intentional that specifying option forces encoding to be * specified. Less prone to user error. This should have always been * the case even in 8.6 imho where there were no options (ie (1) * should never have been allowed) */ if !(objc == int32(1)) { goto _1 } goto numArgsError numArgsError: ; /* ONLY jump here if nothing needs to be freed!!! */ XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15042) *(*int32)(unsafe.Pointer(interp + 368)) |= int32(INTERP_ALTERNATE_WRONG_ARGS) XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+11029) return int32(TCL_ERROR) _1: ; failVarObj = libc.UintptrFromInt32(0) if objc == int32(2) { *(*TTcl_Encoding)(unsafe.Pointer(bp + 8)) = XTcl_GetEncoding(tls, interp, libc.UintptrFromInt32(0)) dataObj = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } else { argIndex = int32(1) for { if !(argIndex < objc-int32(2)) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(argIndex)*8)), uintptr(unsafe.Pointer(&_options2)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15092) return int32(TCL_ERROR) } if objc == int32(1) { XTcl_SetObjResult(tls, interp, XTcl_GetEncodingSearchPath(tls)) return TCL_OK } dirListObj = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if XTcl_SetEncodingSearchPath(tls, dirListObj) == int32(TCL_ERROR) { if (*TTcl_Obj)(unsafe.Pointer(dirListObj)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(dirListObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, dirListObj, libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15102, libc.VaList(bp+8, v1))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+15139, __ccgo_ts+15148, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, dirListObj) return TCL_OK } /* *----------------------------------------------------------------------------- * * EncodingNamesObjCmd -- * * This command returns a list of the available encoding names * * Results: * Returns a standard Tcl result * *----------------------------------------------------------------------------- */ func _EncodingNamesObjCmd(tls *libc.TLS, dummy754 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Vector of command line args */ if objc > int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } XTcl_GetEncodingNames(tls, interp) return TCL_OK } /* *----------------------------------------------------------------------------- * * EncodingProfilesObjCmd -- * * This command returns a list of the available encoding profiles * * Results: * Returns a standard Tcl result * *----------------------------------------------------------------------------- */ func _EncodingProfilesObjCmd(tls *libc.TLS, dummy782 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Vector of command line args */ if objc > int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } XTclGetEncodingProfiles(tls, interp) return TCL_OK } /* *----------------------------------------------------------------------------- * * EncodingSystemObjCmd -- * * This command retrieves or changes the system encoding * * Results: * Returns a standard Tcl result * * Side effects: * May change the system encoding. * *----------------------------------------------------------------------------- */ func _EncodingSystemObjCmd(tls *libc.TLS, dummy813 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Vector of command line args */ var v1 uintptr _ = v1 if objc > int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15156) return int32(TCL_ERROR) } if objc == int32(1) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, XTcl_GetEncodingName(tls, libc.UintptrFromInt32(0)), int64(-int32(1)))) } else { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } return XTcl_SetSystemEncoding(tls, interp, v1) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_ErrorObjCmd -- * * This procedure is invoked to process the "error" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_ErrorObjCmd(tls *libc.TLS, dummy850 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var cachePtr, cachePtr1, cachePtr2, optName, options uintptr var v1, v2, v3 bool _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, optName, options, v1, v2, v3 if objc < int32(2) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15167) return int32(TCL_ERROR) } if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { options = XTclThreadAllocObj(tls) } else { options = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(options + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(options)).FrefCount = 0 if libc.Uint64FromInt64(21)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(options)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(options)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(options)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(21)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(options)).Fbytes, __ccgo_ts+15199, libc.Uint64FromInt64(21)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(options)).Fbytes + uintptr(libc.Uint64FromInt64(21)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(options)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(21) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(options)).FtypePtr = libc.UintptrFromInt32(0) if objc >= int32(3) { /* Process the optional info argument */ if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { optName = XTclThreadAllocObj(tls) } else { optName = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(optName + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(optName)).FrefCount = 0 if libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(optName)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(optName)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(optName)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(optName)).Fbytes, __ccgo_ts+15220, libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(optName)).Fbytes + uintptr(libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(optName)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(11) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(optName)).FtypePtr = libc.UintptrFromInt32(0) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), options, optName) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), options, *(*uintptr)(unsafe.Pointer(objv + 2*8))) } if objc >= int32(4) { /* Process the optional code argument */ if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { optName = XTclThreadAllocObj(tls) } else { optName = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(optName + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(optName)).FrefCount = 0 if libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(optName)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(optName)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(optName)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(optName)).Fbytes, __ccgo_ts+15231, libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(optName)).Fbytes + uintptr(libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(optName)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(11) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(optName)).FtypePtr = libc.UintptrFromInt32(0) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), options, optName) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), options, *(*uintptr)(unsafe.Pointer(objv + 3*8))) } XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) return XTcl_SetReturnOptions(tls, interp, options) } /* *---------------------------------------------------------------------- * * Tcl_EvalObjCmd -- * * This object-based procedure is invoked to process the "eval" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _EvalCmdErrMsg(tls *libc.TLS, dummy899 uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15242, libc.VaList(bp+8, XTcl_GetErrorLine(tls, interp)))) } return result } func XTcl_EvalObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNREvalObjCmd), clientData, int64(objc), objv) } func XTclNREvalObjCmd(tls *libc.TLS, dummy922 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument objects. */ var _objPtr, cachePtr, iPtr, objPtr uintptr var v1 bool var _ /* _callbackPtr at bp+16 */ uintptr var _ /* invoker at bp+0 */ uintptr var _ /* word at bp+8 */ int32 _, _, _, _, _ = _objPtr, cachePtr, iPtr, objPtr, v1 iPtr = interp *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) *(*int32)(unsafe.Pointer(bp + 8)) = 0 if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15269) return int32(TCL_ERROR) } if objc == int32(2) { /* * TIP #280. Make argument location available to eval'd script. */ *(*uintptr)(unsafe.Pointer(bp)) = (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr *(*int32)(unsafe.Pointer(bp + 8)) = int32(1) objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) XTclArgumentGet(tls, interp, objPtr, bp, bp+8) } else { /* * More than one argument: concatenate them together with spaces * between, then evaluate the result. Tcl_EvalObjEx will delete the * object when it decrements its refcount after eval'ing it. * * TIP #280. Make invoking context available to eval'd script, done * with the default values. */ objPtr = XTcl_ConcatObj(tls, int64(objc-int32(1)), objv+uintptr(1)*8) } if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 16)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FprocPtr = __ccgo_fp(_EvalCmdErrMsg) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) return XTclNREvalObjEx(tls, interp, objPtr, 0, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8))) } /* *---------------------------------------------------------------------- * * Tcl_ExitObjCmd -- * * This procedure is invoked to process the "exit" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_ExitObjCmd(tls *libc.TLS, dummy981 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var _ /* value at bp+0 */ TTcl_WideInt if objc != int32(1) && objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15283) return int32(TCL_ERROR) } if objc == int32(1) { *(*TTcl_WideInt)(unsafe.Pointer(bp)) = 0 } else { if XTclGetWideBitsFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) != TCL_OK { return int32(TCL_ERROR) } } XTcl_Exit(tls, int32(*(*TTcl_WideInt)(unsafe.Pointer(bp)))) return TCL_OK /* Better not ever reach this! */ } /* *---------------------------------------------------------------------- * * Tcl_ExprObjCmd -- * * This object-based procedure is invoked to process the "expr" Tcl * command. See the user documentation for details on what it does. * * With the bytecode compiler, this procedure is called in two * circumstances: 1) to execute expr commands that are too complicated or * too unsafe to try compiling directly into an inline sequence of * instructions, and 2) to execute commands where the command name is * computed at runtime and is "expr" or the name to which "expr" was * renamed (e.g., "set z expr; $z 2+3") * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_ExprObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRExprObjCmd), clientData, int64(objc), objv) } func XTclNRExprObjCmd(tls *libc.TLS, dummy1038 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr2, objPtr, resultPtr uintptr var v1, v2, v3 bool var _ /* _callbackPtr at bp+0 */ uintptr var _ /* _callbackPtr at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr2, objPtr, resultPtr, v1, v2, v3 if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15269) return int32(TCL_ERROR) } if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { resultPtr = XTclThreadAllocObj(tls) } else { resultPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++ if objc == int32(2) { objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_ExprCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = resultPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) } else { objPtr = XTcl_ConcatObj(tls, int64(objc-int32(1)), objv+uintptr(1)*8) if v3 = interp == libc.UintptrFromInt32(0); !v3 { cachePtr2 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(_ExprCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = resultPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = objPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) } return XTcl_NRExprObj(tls, interp, objPtr, resultPtr) } func _ExprCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { var _objPtr, _objPtr1, objPtr, resultPtr, v2, v4 uintptr var v1, v3 TTcl_Size _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, objPtr, resultPtr, v1, v2, v3, v4 resultPtr = *(*uintptr)(unsafe.Pointer(data)) objPtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) if objPtr != libc.UintptrFromInt32(0) { _objPtr = objPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } if result == TCL_OK { XTcl_SetObjResult(tls, interp, resultPtr) } _objPtr1 = resultPtr v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return result } /* *---------------------------------------------------------------------- * * TclInitFileCmd -- * * This function builds the "file" Tcl command ensemble. See the user * documentation for details on what that ensemble does. * * PLEASE NOTE THAT THIS FAILS WITH FILENAMES AND PATHS WITH EMBEDDED * NULLS. With the object-based Tcl_FS APIs, the above NOTE may no longer * be true. In any case this assertion should be tested. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTclInitFileCmd(tls *libc.TLS, interp uintptr) (r TTcl_Command) { return XTclMakeEnsemble(tls, interp, __ccgo_ts+5636, uintptr(unsafe.Pointer(&_initMap))) } /* * Note that most subcommands are unsafe because either they manipulate * the native filesystem or because they reveal information about the * native filesystem. */ var _initMap = [38]TEnsembleImplMap{ 0: { Fname: __ccgo_ts + 5641, Funsafe: int32(1), }, 1: { Fname: __ccgo_ts + 5647, Funsafe: int32(1), }, 2: { Fname: __ccgo_ts + 15296, }, 3: { Fname: __ccgo_ts + 5658, Funsafe: int32(1), }, 4: { Fname: __ccgo_ts + 5663, Funsafe: int32(1), }, 5: { Fname: __ccgo_ts + 5670, Funsafe: int32(1), }, 6: { Fname: __ccgo_ts + 5678, Funsafe: int32(1), }, 7: { Fname: __ccgo_ts + 5689, Funsafe: int32(1), }, 8: { Fname: __ccgo_ts + 5696, Funsafe: int32(1), }, 9: { Fname: __ccgo_ts + 5706, Funsafe: int32(1), }, 10: { Fname: __ccgo_ts + 5711, Funsafe: int32(1), }, 11: { Fname: __ccgo_ts + 5723, Funsafe: int32(1), }, 12: { Fname: __ccgo_ts + 5227, }, 13: { Fname: __ccgo_ts + 5730, Funsafe: int32(1), }, 14: { Fname: __ccgo_ts + 5735, Funsafe: int32(1), }, 15: { Fname: __ccgo_ts + 5741, Funsafe: int32(1), }, 16: { Fname: __ccgo_ts + 5747, Funsafe: int32(1), }, 17: { Fname: __ccgo_ts + 5753, Funsafe: int32(1), }, 18: { Fname: __ccgo_ts + 5764, Funsafe: int32(1), }, 19: { Fname: __ccgo_ts + 5774, Funsafe: int32(1), }, 20: { Fname: __ccgo_ts + 15305, }, 21: { Fname: __ccgo_ts + 5780, Funsafe: int32(1), }, 22: { Fname: __ccgo_ts + 5789, Funsafe: int32(1), }, 23: { Fname: __ccgo_ts + 5364, Funsafe: int32(1), }, 24: { Fname: __ccgo_ts + 5798, Funsafe: int32(1), }, 25: { Fname: __ccgo_ts + 15314, }, 26: { Fname: __ccgo_ts + 5807, Funsafe: int32(1), }, 27: { Fname: __ccgo_ts + 5387, }, 28: { Fname: __ccgo_ts + 5812, Funsafe: int32(1), }, 29: { Fname: __ccgo_ts + 5629, }, 30: { Fname: __ccgo_ts + 5817, Funsafe: int32(1), }, 31: { Fname: __ccgo_ts + 5822, Funsafe: int32(1), }, 32: { Fname: __ccgo_ts + 5830, Funsafe: int32(1), }, 33: { Fname: __ccgo_ts + 5839, Funsafe: int32(1), }, 34: { Fname: __ccgo_ts + 5851, Funsafe: int32(1), }, 35: { Fname: __ccgo_ts + 5856, Funsafe: int32(1), }, 36: { Fname: __ccgo_ts + 5864, Funsafe: int32(1), }, 37: {}, } func init() { p := unsafe.Pointer(&_initMap) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_FileAttrAccessTimeCmd) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileBasic1Or2ArgCmd) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(XTclFileAttrsCmd) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(XTclChannelNamesCmd) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 152)) = __ccgo_fp(XTclFileCopyCmd) *(*uintptr)(unsafe.Add(p, 200)) = __ccgo_fp(XTclFileDeleteCmd) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(XTclCompileBasicMin0ArgCmd) *(*uintptr)(unsafe.Add(p, 248)) = __ccgo_fp(_PathDirNameCmd) *(*uintptr)(unsafe.Add(p, 256)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 296)) = __ccgo_fp(_FileAttrIsExecutableCmd) *(*uintptr)(unsafe.Add(p, 304)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 344)) = __ccgo_fp(_FileAttrIsExistingCmd) *(*uintptr)(unsafe.Add(p, 352)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_PathExtensionCmd) *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(XTclFileHomeCmd) *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 488)) = __ccgo_fp(_FileAttrIsDirectoryCmd) *(*uintptr)(unsafe.Add(p, 496)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 536)) = __ccgo_fp(_FileAttrIsFileCmd) *(*uintptr)(unsafe.Add(p, 544)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 584)) = __ccgo_fp(_PathJoinCmd) *(*uintptr)(unsafe.Add(p, 592)) = __ccgo_fp(XTclCompileBasicMin1ArgCmd) *(*uintptr)(unsafe.Add(p, 632)) = __ccgo_fp(XTclFileLinkCmd) *(*uintptr)(unsafe.Add(p, 640)) = __ccgo_fp(XTclCompileBasic1To3ArgCmd) *(*uintptr)(unsafe.Add(p, 680)) = __ccgo_fp(_FileAttrLinkStatCmd) *(*uintptr)(unsafe.Add(p, 688)) = __ccgo_fp(XTclCompileBasic2ArgCmd) *(*uintptr)(unsafe.Add(p, 728)) = __ccgo_fp(_FileAttrModifyTimeCmd) *(*uintptr)(unsafe.Add(p, 736)) = __ccgo_fp(XTclCompileBasic1Or2ArgCmd) *(*uintptr)(unsafe.Add(p, 776)) = __ccgo_fp(XTclFileMakeDirsCmd) *(*uintptr)(unsafe.Add(p, 784)) = __ccgo_fp(XTclCompileBasicMin0ArgCmd) *(*uintptr)(unsafe.Add(p, 824)) = __ccgo_fp(_PathNativeNameCmd) *(*uintptr)(unsafe.Add(p, 832)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 872)) = __ccgo_fp(_PathNormalizeCmd) *(*uintptr)(unsafe.Add(p, 880)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 920)) = __ccgo_fp(_FileAttrIsOwnedCmd) *(*uintptr)(unsafe.Add(p, 928)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 968)) = __ccgo_fp(_PathTypeCmd) *(*uintptr)(unsafe.Add(p, 976)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 1016)) = __ccgo_fp(_FileAttrIsReadableCmd) *(*uintptr)(unsafe.Add(p, 1024)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 1064)) = __ccgo_fp(XTclFileReadLinkCmd) *(*uintptr)(unsafe.Add(p, 1072)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 1112)) = __ccgo_fp(XTclFileRenameCmd) *(*uintptr)(unsafe.Add(p, 1160)) = __ccgo_fp(_PathRootNameCmd) *(*uintptr)(unsafe.Add(p, 1168)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 1208)) = __ccgo_fp(_FilesystemSeparatorCmd) *(*uintptr)(unsafe.Add(p, 1216)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 1256)) = __ccgo_fp(_FileAttrSizeCmd) *(*uintptr)(unsafe.Add(p, 1264)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 1304)) = __ccgo_fp(_PathSplitCmd) *(*uintptr)(unsafe.Add(p, 1312)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 1352)) = __ccgo_fp(_FileAttrStatCmd) *(*uintptr)(unsafe.Add(p, 1360)) = __ccgo_fp(XTclCompileBasic2ArgCmd) *(*uintptr)(unsafe.Add(p, 1400)) = __ccgo_fp(_PathFilesystemCmd) *(*uintptr)(unsafe.Add(p, 1408)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 1448)) = __ccgo_fp(_PathTailCmd) *(*uintptr)(unsafe.Add(p, 1456)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 1496)) = __ccgo_fp(XTclFileTempDirCmd) *(*uintptr)(unsafe.Add(p, 1504)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 1544)) = __ccgo_fp(XTclFileTemporaryCmd) *(*uintptr)(unsafe.Add(p, 1552)) = __ccgo_fp(XTclCompileBasic0To2ArgCmd) *(*uintptr)(unsafe.Add(p, 1592)) = __ccgo_fp(XTclFileTildeExpandCmd) *(*uintptr)(unsafe.Add(p, 1600)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 1640)) = __ccgo_fp(_FileAttrTypeCmd) *(*uintptr)(unsafe.Add(p, 1648)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 1688)) = __ccgo_fp(_FilesystemVolumesCmd) *(*uintptr)(unsafe.Add(p, 1696)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 1736)) = __ccgo_fp(_FileAttrIsWritableCmd) *(*uintptr)(unsafe.Add(p, 1744)) = __ccgo_fp(XTclCompileBasic1ArgCmd) } /* *---------------------------------------------------------------------- * * FileAttrAccessTimeCmd -- * * This function is invoked to process the "file atime" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * May update the access time on the file, if requested by the user. * *---------------------------------------------------------------------- */ func _FileAttrAccessTimeCmd(tls *libc.TLS, dummy1176 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(192) defer tls.Free(192) var v1 int32 var v2 uintptr var _ /* buf at bp+0 */ TTcl_StatBuf var _ /* newTime at bp+160 */ TTcl_WideInt var _ /* tval at bp+144 */ Tutimbuf _, _ = v1, v2 if objc < int32(2) || objc > int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15324) return int32(TCL_ERROR) } if _GetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSStat), bp) != TCL_OK { return int32(TCL_ERROR) } if objc == int32(3) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 160)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+160) } if v1 != TCL_OK { return int32(TCL_ERROR) } (*(*Tutimbuf)(unsafe.Pointer(bp + 144))).Factime = *(*TTcl_WideInt)(unsafe.Pointer(bp + 160)) (*(*Tutimbuf)(unsafe.Pointer(bp + 144))).Fmodtime = XTcl_GetModificationTimeFromStat(tls, bp) if XTcl_FSUtime(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+144) != 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15336, libc.VaList(bp+176, v2, XTcl_PosixError(tls, interp)))) return int32(TCL_ERROR) } /* * Do another stat to ensure that the we return the new recognized * atime - hopefully the same as the one we sent in. However, fs's * like FAT don't even know what atime is. */ if _GetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSStat), bp) != TCL_OK { return int32(TCL_ERROR) } } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, XTcl_GetAccessTimeFromStat(tls, bp))) return TCL_OK } /* *---------------------------------------------------------------------- * * FileAttrModifyTimeCmd -- * * This function is invoked to process the "file mtime" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * May update the modification time on the file, if requested by the * user. * *---------------------------------------------------------------------- */ func _FileAttrModifyTimeCmd(tls *libc.TLS, dummy1258 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(192) defer tls.Free(192) var v1 int32 var v2 uintptr var _ /* buf at bp+0 */ TTcl_StatBuf var _ /* newTime at bp+160 */ TTcl_WideInt var _ /* tval at bp+144 */ Tutimbuf _, _ = v1, v2 if objc < int32(2) || objc > int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15324) return int32(TCL_ERROR) } if _GetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSStat), bp) != TCL_OK { return int32(TCL_ERROR) } if objc == int32(3) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 160)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+160) } if v1 != TCL_OK { return int32(TCL_ERROR) } (*(*Tutimbuf)(unsafe.Pointer(bp + 144))).Factime = XTcl_GetAccessTimeFromStat(tls, bp) (*(*Tutimbuf)(unsafe.Pointer(bp + 144))).Fmodtime = *(*TTcl_WideInt)(unsafe.Pointer(bp + 160)) if XTcl_FSUtime(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+144) != 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15380, libc.VaList(bp+176, v2, XTcl_PosixError(tls, interp)))) return int32(TCL_ERROR) } /* * Do another stat to ensure that the we return the new recognized * mtime - hopefully the same as the one we sent in. */ if _GetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSStat), bp) != TCL_OK { return int32(TCL_ERROR) } } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, XTcl_GetModificationTimeFromStat(tls, bp))) return TCL_OK } /* *---------------------------------------------------------------------- * * FileAttrLinkStatCmd -- * * This function is invoked to process the "file lstat" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * Writes to an array named by the user. * *---------------------------------------------------------------------- */ func _FileAttrLinkStatCmd(tls *libc.TLS, dummy1337 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) var _ /* buf at bp+0 */ TTcl_StatBuf if objc < int32(2) || objc > int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15430) return int32(TCL_ERROR) } if _GetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSLstat), bp) != TCL_OK { return int32(TCL_ERROR) } if objc == int32(2) { return _StoreStatData(tls, interp, libc.UintptrFromInt32(0), bp) } else { return _StoreStatData(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) } return r } /* *---------------------------------------------------------------------- * * FileAttrStatCmd -- * * This function is invoked to process the "file stat" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * Writes to an array named by the user. * *---------------------------------------------------------------------- */ func _FileAttrStatCmd(tls *libc.TLS, dummy1377 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) var _ /* buf at bp+0 */ TTcl_StatBuf if objc < int32(2) || objc > int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15430) return int32(TCL_ERROR) } if _GetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSStat), bp) != TCL_OK { return int32(TCL_ERROR) } if objc == int32(2) { return _StoreStatData(tls, interp, libc.UintptrFromInt32(0), bp) } else { return _StoreStatData(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) } return r } /* *---------------------------------------------------------------------- * * FileAttrTypeCmd -- * * This function is invoked to process the "file type" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FileAttrTypeCmd(tls *libc.TLS, dummy1417 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) var _ /* buf at bp+0 */ TTcl_StatBuf if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } if _GetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSLstat), bp) != TCL_OK { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, _GetTypeFromMode(tls, libc.Int32FromUint16(uint16((*(*TTcl_StatBuf)(unsafe.Pointer(bp))).Fst_mode))), int64(-int32(1)))) return TCL_OK } /* *---------------------------------------------------------------------- * * FileAttrSizeCmd -- * * This function is invoked to process the "file size" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FileAttrSizeCmd(tls *libc.TLS, dummy1455 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) var _ /* buf at bp+0 */ TTcl_StatBuf if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } if _GetStatBuf(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSStat), bp) != TCL_OK { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, (*(*TTcl_StatBuf)(unsafe.Pointer(bp))).Fst_size)) return TCL_OK } /* *---------------------------------------------------------------------- * * FileAttrIsDirectoryCmd -- * * This function is invoked to process the "file isdirectory" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FileAttrIsDirectoryCmd(tls *libc.TLS, dummy1492 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) var value int32 var _ /* buf at bp+0 */ TTcl_StatBuf _ = value value = 0 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } if _GetStatBuf(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSStat), bp) == TCL_OK { value = libc.BoolInt32((*(*TTcl_StatBuf)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFDIR)) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(value != 0))) return TCL_OK } /* *---------------------------------------------------------------------- * * FileAttrIsExecutableCmd -- * * This function is invoked to process the "file executable" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FileAttrIsExecutableCmd(tls *libc.TLS, dummy1530 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } return _CheckAccess(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), int32(X_OK)) } /* *---------------------------------------------------------------------- * * FileAttrIsExistingCmd -- * * This function is invoked to process the "file exists" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FileAttrIsExistingCmd(tls *libc.TLS, dummy1561 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } return _CheckAccess(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), F_OK) } /* *---------------------------------------------------------------------- * * FileAttrIsFileCmd -- * * This function is invoked to process the "file isfile" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FileAttrIsFileCmd(tls *libc.TLS, dummy1592 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) var value int32 var _ /* buf at bp+0 */ TTcl_StatBuf _ = value value = 0 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } if _GetStatBuf(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSStat), bp) == TCL_OK { value = libc.BoolInt32((*(*TTcl_StatBuf)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFREG)) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(value != 0))) return TCL_OK } /* *---------------------------------------------------------------------- * * FileAttrIsOwnedCmd -- * * This function is invoked to process the "file owned" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FileAttrIsOwnedCmd(tls *libc.TLS, dummy1630 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) var normPathPtr, v1 uintptr var value int32 var _ /* buf at bp+0 */ TTcl_StatBuf _, _, _ = normPathPtr, value, v1 value = 0 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } normPathPtr = XTcl_FSGetNormalizedPath(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) /* Note normPathPtr owned by Tcl, no need to free it */ if normPathPtr != 0 { if (*TTcl_Obj)(unsafe.Pointer(normPathPtr)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(normPathPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, normPathPtr, libc.UintptrFromInt32(0)) } if XTclIsZipfsPath(tls, v1) != 0 { return _CheckAccess(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), F_OK) } /* Not zipfs, try native. */ } /* * Note use objv[1] below, NOT normPathPtr even if not NULL because * for native paths we may not want links to be resolved. */ if _GetStatBuf(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), __ccgo_fp(XTcl_FSStat), bp) == TCL_OK { value = libc.BoolInt32(libc.Xgeteuid(tls) == (*(*TTcl_StatBuf)(unsafe.Pointer(bp))).Fst_uid) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(value != 0))) return TCL_OK } /* *---------------------------------------------------------------------- * * FileAttrIsReadableCmd -- * * This function is invoked to process the "file readable" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FileAttrIsReadableCmd(tls *libc.TLS, dummy1692 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } return _CheckAccess(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), int32(R_OK)) } /* *---------------------------------------------------------------------- * * FileAttrIsWritableCmd -- * * This function is invoked to process the "file writable" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FileAttrIsWritableCmd(tls *libc.TLS, dummy1723 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } return _CheckAccess(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), int32(W_OK)) } /* *---------------------------------------------------------------------- * * PathDirNameCmd -- * * This function is invoked to process the "file dirname" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathDirNameCmd(tls *libc.TLS, dummy1754 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var _objPtr, dirPtr, v2 uintptr var v1 TTcl_Size _, _, _, _ = _objPtr, dirPtr, v1, v2 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } dirPtr = XTclPathPart(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), int32(TCL_PATH_DIRNAME)) if dirPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, dirPtr) _objPtr = dirPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return TCL_OK } /* *---------------------------------------------------------------------- * * PathExtensionCmd -- * * This function is invoked to process the "file extension" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathExtensionCmd(tls *libc.TLS, dummy1793 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var _objPtr, dirPtr, v2 uintptr var v1 TTcl_Size _, _, _, _ = _objPtr, dirPtr, v1, v2 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } dirPtr = XTclPathPart(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), int32(TCL_PATH_EXTENSION)) if dirPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, dirPtr) _objPtr = dirPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return TCL_OK } /* *---------------------------------------------------------------------- * * PathRootNameCmd -- * * This function is invoked to process the "file root" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathRootNameCmd(tls *libc.TLS, dummy1832 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var _objPtr, dirPtr, v2 uintptr var v1 TTcl_Size _, _, _, _ = _objPtr, dirPtr, v1, v2 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } dirPtr = XTclPathPart(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), int32(TCL_PATH_ROOT)) if dirPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, dirPtr) _objPtr = dirPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return TCL_OK } /* *---------------------------------------------------------------------- * * PathTailCmd -- * * This function is invoked to process the "file tail" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathTailCmd(tls *libc.TLS, dummy1871 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var _objPtr, dirPtr, v2 uintptr var v1 TTcl_Size _, _, _, _ = _objPtr, dirPtr, v1, v2 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } dirPtr = XTclPathPart(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), int32(TCL_PATH_TAIL)) if dirPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, dirPtr) _objPtr = dirPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return TCL_OK } /* *---------------------------------------------------------------------- * * PathFilesystemCmd -- * * This function is invoked to process the "file system" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathFilesystemCmd(tls *libc.TLS, dummy1910 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var fsInfo, v1 uintptr _, _ = fsInfo, v1 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } fsInfo = XTcl_FSFileSystemInfo(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) if fsInfo == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+15445, int64(-int32(1)))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+15463, v1, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, fsInfo) return TCL_OK } /* *---------------------------------------------------------------------- * * PathJoinCmd -- * * This function is invoked to process the "file join" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathJoinCmd(tls *libc.TLS, dummy1951 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15474) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTclJoinPath(tls, int64(objc-int32(1)), objv+uintptr(1)*8, 0)) return TCL_OK } /* *---------------------------------------------------------------------- * * PathNativeNameCmd -- * * This function is invoked to process the "file nativename" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathNativeNameCmd(tls *libc.TLS, dummy1983 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(224) defer tls.Free(224) var v1 uintptr var _ /* ds at bp+0 */ TTcl_DString _ = v1 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } if XTcl_TranslateFileName(tls, interp, v1, bp) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_DStringToObj(tls, bp)) return TCL_OK } /* *---------------------------------------------------------------------- * * PathNormalizeCmd -- * * This function is invoked to process the "file normalize" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathNormalizeCmd(tls *libc.TLS, dummy2020 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var fileName uintptr _ = fileName if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } fileName = XTcl_FSGetNormalizedPath(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) if fileName == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, fileName) return TCL_OK } /* *---------------------------------------------------------------------- * * PathSplitCmd -- * * This function is invoked to process the "file split" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathSplitCmd(tls *libc.TLS, dummy2058 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var res, v1 uintptr _, _ = res, v1 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } res = XTcl_FSSplitPath(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) if res == libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15490, libc.VaList(bp+8, v1))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+15537, __ccgo_ts+15547, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, res) return TCL_OK } /* *---------------------------------------------------------------------- * * PathTypeCmd -- * * This function is invoked to process the "file pathtype" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PathTypeCmd(tls *libc.TLS, dummy2101 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var cachePtr, cachePtr1, cachePtr2, typeName uintptr var v10, v11, v9 bool _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, typeName, v10, v11, v9 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+3726) return int32(TCL_ERROR) } switch XTcl_FSGetPathType(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) { case int32(TCL_PATH_ABSOLUTE): goto _1 case int32(TCL_PATH_RELATIVE): goto _2 case int32(TCL_PATH_VOLUME_RELATIVE): goto _3 default: goto _4 } goto _5 _1: ; _8: ; if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { typeName = XTclThreadAllocObj(tls) } else { typeName = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(typeName + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(typeName)).FrefCount = 0 if libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(typeName)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes, __ccgo_ts+15556, libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes + uintptr(libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(typeName)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(9) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(typeName)).FtypePtr = libc.UintptrFromInt32(0) goto _7 _7: ; if 0 != 0 { goto _8 } goto _6 _6: ; goto _5 _2: ; if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { typeName = XTclThreadAllocObj(tls) } else { typeName = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(typeName + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(typeName)).FrefCount = 0 if libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(typeName)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes, __ccgo_ts+15565, libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes + uintptr(libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(typeName)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(9) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(typeName)).FtypePtr = libc.UintptrFromInt32(0) goto _5 _3: ; if v11 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v11 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v11 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { typeName = XTclThreadAllocObj(tls) } else { typeName = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(typeName + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(typeName)).FrefCount = 0 if libc.Uint64FromInt64(15)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(typeName)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(15)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes, __ccgo_ts+15574, libc.Uint64FromInt64(15)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(typeName)).Fbytes + uintptr(libc.Uint64FromInt64(15)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(typeName)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(15) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(typeName)).FtypePtr = libc.UintptrFromInt32(0) goto _5 _4: ; /* Should be unreachable */ return TCL_OK _5: ; XTcl_SetObjResult(tls, interp, typeName) return TCL_OK } /* *---------------------------------------------------------------------- * * FilesystemSeparatorCmd -- * * This function is invoked to process the "file separator" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FilesystemSeparatorCmd(tls *libc.TLS, dummy2149 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var separator, separatorObj, v1 uintptr _, _, _ = separator, separatorObj, v1 if objc < int32(1) || objc > int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15589) return int32(TCL_ERROR) } if objc == int32(1) { separator = libc.UintptrFromInt32(0) switch XtclPlatform { case int32(TCL_PLATFORM_UNIX): separator = __ccgo_ts + 6339 case int32(TCL_PLATFORM_WINDOWS): separator = __ccgo_ts + 15596 break } XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, separator, int64(1))) } else { separatorObj = XTcl_FSPathSeparator(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) if separatorObj == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+15445, int64(-int32(1)))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+15463, v1, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, separatorObj) } return TCL_OK } /* *---------------------------------------------------------------------- * * FilesystemVolumesCmd -- * * This function is invoked to process the "file volumes" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _FilesystemVolumesCmd(tls *libc.TLS, dummy2204 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_FSListVolumes(tls)) return TCL_OK } /* *--------------------------------------------------------------------------- * * CheckAccess -- * * Utility procedure used by Tcl_FileObjCmd() to query file attributes * available through the access() system call. * * Results: * Always returns TCL_OK. Sets interp's result to boolean true or false * depending on whether the file has the specified attribute. * * Side effects: * None. * *--------------------------------------------------------------------------- */ func _CheckAccess(tls *libc.TLS, interp uintptr, pathPtr uintptr, mode int32) (r int32) { bp := tls.Alloc(224) defer tls.Free(224) /* Attribute to check; passed as argument to * access(). */ var value int32 var v1 uintptr var _ /* ds at bp+0 */ TTcl_DString _, _ = value, v1 if XTcl_FSConvertToPathType(tls, interp, pathPtr) != TCL_OK { value = 0 } else { if (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, pathPtr, libc.UintptrFromInt32(0)) } if XTcl_UtfToExternalDStringEx(tls, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), v1, int64(-libc.Int32FromInt32(1)), 0, bp, libc.UintptrFromInt32(0)) != TCL_OK { value = 0 XTcl_DStringFree(tls, bp) } else { XTcl_DStringFree(tls, bp) value = libc.BoolInt32(XTcl_FSAccess(tls, pathPtr, mode) == 0) } } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(value != 0))) return TCL_OK } /* *--------------------------------------------------------------------------- * * GetStatBuf -- * * Utility procedure used by Tcl_FileObjCmd() to query file attributes * available through the stat() or lstat() system call. * * Results: * The return value is TCL_OK if the specified file exists and can be * stat'ed, TCL_ERROR otherwise. If TCL_ERROR is returned, an error * message is left in interp's result. If TCL_OK is returned, *statPtr is * filled with information about the specified file. * * Side effects: * None. * *--------------------------------------------------------------------------- */ func _GetStatBuf(tls *libc.TLS, interp uintptr, pathPtr uintptr, statProc uintptr, statPtr uintptr) (r int32) { bp := tls.Alloc(256) defer tls.Free(256) /* Filled with info about file obtained by * calling (*statProc)(). */ var status int32 var v1, v2 uintptr var _ /* ds at bp+0 */ TTcl_DString _, _, _ = status, v1, v2 if XTcl_FSConvertToPathType(tls, interp, pathPtr) != TCL_OK { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, pathPtr, libc.UintptrFromInt32(0)) } if XTcl_UtfToExternalDStringEx(tls, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), v1, int64(-libc.Int32FromInt32(1)), 0, bp, libc.UintptrFromInt32(0)) != TCL_OK { status = -int32(1) } else { status = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{statProc})))(tls, pathPtr, statPtr) } XTcl_DStringFree(tls, bp) if status < 0 { if interp != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, pathPtr, libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15598, libc.VaList(bp+232, v2, XTcl_PosixError(tls, interp)))) } return int32(TCL_ERROR) } return TCL_OK } /* *---------------------------------------------------------------------- * * StoreStatData -- * * This is a utility procedure that breaks out the fields of a "stat" * structure and stores them in textual form into the elements of an * associative array (if given) or returns a dictionary. * * Results: * Returns a standard Tcl return value. If an error occurs then a message * is left in interp's result. * * Side effects: * Elements of the associative array given by "varName" are modified. * *---------------------------------------------------------------------- */ func _StoreStatData(tls *libc.TLS, interp uintptr, varName uintptr, statPtr uintptr) (r int32) { /* Pointer to buffer containing stat data to * store in varName. */ var _objPtr, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr13, cachePtr14, cachePtr15, cachePtr16, cachePtr17, cachePtr18, cachePtr19, cachePtr2, cachePtr20, cachePtr21, cachePtr22, cachePtr23, cachePtr24, cachePtr25, cachePtr26, cachePtr27, cachePtr28, cachePtr29, cachePtr3, cachePtr30, cachePtr31, cachePtr32, cachePtr33, cachePtr34, cachePtr35, cachePtr36, cachePtr37, cachePtr38, cachePtr39, cachePtr4, cachePtr40, cachePtr41, cachePtr42, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, field, result, value, v100, v13, v16, v20, v23, v27, v3, v30, v34, v37, v41, v44, v48, v51, v55, v58, v6, v62, v65, v69, v72, v76, v79, v83, v86, v9, v90, v93, v97 uintptr var mode uint16 var v1, v10, v101, v11, v14, v17, v18, v21, v24, v25, v28, v31, v32, v35, v38, v39, v4, v42, v45, v46, v49, v52, v53, v56, v59, v60, v63, v66, v67, v7, v70, v73, v74, v77, v80, v81, v84, v87, v88, v91, v94, v95, v98 bool var v12, v15, v19, v2, v22, v26, v29, v33, v36, v40, v43, v47, v5, v50, v54, v57, v61, v64, v68, v71, v75, v78, v8, v82, v85, v89, v92, v96, v99 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr13, cachePtr14, cachePtr15, cachePtr16, cachePtr17, cachePtr18, cachePtr19, cachePtr2, cachePtr20, cachePtr21, cachePtr22, cachePtr23, cachePtr24, cachePtr25, cachePtr26, cachePtr27, cachePtr28, cachePtr29, cachePtr3, cachePtr30, cachePtr31, cachePtr32, cachePtr33, cachePtr34, cachePtr35, cachePtr36, cachePtr37, cachePtr38, cachePtr39, cachePtr4, cachePtr40, cachePtr41, cachePtr42, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, field, mode, result, value, v1, v10, v100, v101, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 if varName == libc.UintptrFromInt32(0) { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { result = XTclThreadAllocObj(tls) } else { result = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(result + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(result)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(result)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(result)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(result)).FrefCount++ XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+15622, int64(-int32(1))), XTcl_NewWideIntObj(tls, int64(libc.Int64FromUint64((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_dev)))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+15626, int64(-int32(1))), XTcl_NewWideIntObj(tls, libc.Int64FromUint64((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_ino))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+15630, int64(-int32(1))), XTcl_NewWideIntObj(tls, int64(libc.Int64FromUint64((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_nlink)))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+15636, int64(-int32(1))), XTcl_NewWideIntObj(tls, int64(libc.Int64FromUint32((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_uid)))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+15640, int64(-int32(1))), XTcl_NewWideIntObj(tls, int64(libc.Int64FromUint32((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_gid)))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+5807, int64(-int32(1))), XTcl_NewWideIntObj(tls, (*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_size)) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+15644, int64(-int32(1))), XTcl_NewWideIntObj(tls, (*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_blocks)) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+15651, int64(-int32(1))), XTcl_NewWideIntObj(tls, (*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_blksize)) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+5641, int64(-int32(1))), XTcl_NewWideIntObj(tls, XTcl_GetAccessTimeFromStat(tls, statPtr))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+5741, int64(-int32(1))), XTcl_NewWideIntObj(tls, XTcl_GetModificationTimeFromStat(tls, statPtr))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+15659, int64(-int32(1))), XTcl_NewWideIntObj(tls, XTcl_GetChangeTimeFromStat(tls, statPtr))) mode = uint16((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_mode) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+15665, int64(-int32(1))), XTcl_NewWideIntObj(tls, libc.Int64FromUint16(mode))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), result, XTcl_NewStringObj(tls, __ccgo_ts+5851, int64(-int32(1))), XTcl_NewStringObj(tls, _GetTypeFromMode(tls, libc.Int32FromUint16(mode)), int64(-int32(1)))) XTcl_SetObjResult(tls, interp, result) _objPtr = result v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } return TCL_OK } /* * Might be a better idea to call Tcl_SetVar2Ex() instead, except we want * to have an object (i.e. possibly cached) array variable name but a * string element name, so no API exists. Messy. */ /* * Watch out porters; the inode is meant to be an *unsigned* value, so the * cast might fail when there isn't a real arithmetic 'long long' type... */ if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15622, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, int64(libc.Int64FromUint64((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_dev))) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v6 = field v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if !(v5 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v7 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v7 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v7 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v9 = field v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if !(v8 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v11 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v11 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v11 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15626, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, libc.Int64FromUint64((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_ino)) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v13 = field v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if !(v12 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v14 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v14 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v14 || ((*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v16 = field v15 = *(*TTcl_Size)(unsafe.Pointer(v16)) *(*TTcl_Size)(unsafe.Pointer(v16))-- if !(v15 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v17 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v17 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v17 || ((*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v18 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v18 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v18 || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15630, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(6) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, int64(libc.Int64FromUint64((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_nlink))) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v20 = field v19 = *(*TTcl_Size)(unsafe.Pointer(v20)) *(*TTcl_Size)(unsafe.Pointer(v20))-- if !(v19 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v21 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v21 { cachePtr8 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v21 || ((*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v23 = field v22 = *(*TTcl_Size)(unsafe.Pointer(v23)) *(*TTcl_Size)(unsafe.Pointer(v23))-- if !(v22 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v24 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v24 { cachePtr9 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v24 || ((*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v25 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v25 { cachePtr10 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v25 || (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15636, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, int64(libc.Int64FromUint32((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_uid))) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v27 = field v26 = *(*TTcl_Size)(unsafe.Pointer(v27)) *(*TTcl_Size)(unsafe.Pointer(v27))-- if !(v26 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v28 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v28 { cachePtr11 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v28 || ((*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v30 = field v29 = *(*TTcl_Size)(unsafe.Pointer(v30)) *(*TTcl_Size)(unsafe.Pointer(v30))-- if !(v29 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v31 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v31 { cachePtr12 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v31 || ((*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v32 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v32 { cachePtr13 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v32 || (*TAllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15640, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, int64(libc.Int64FromUint32((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_gid))) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v34 = field v33 = *(*TTcl_Size)(unsafe.Pointer(v34)) *(*TTcl_Size)(unsafe.Pointer(v34))-- if !(v33 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v35 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v35 { cachePtr14 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v35 || ((*TAllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v37 = field v36 = *(*TTcl_Size)(unsafe.Pointer(v37)) *(*TTcl_Size)(unsafe.Pointer(v37))-- if !(v36 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v38 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v38 { cachePtr15 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v38 || ((*TAllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v39 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v39 { cachePtr16 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v39 || (*TAllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr16)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr16)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+5807, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, (*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_size) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v41 = field v40 = *(*TTcl_Size)(unsafe.Pointer(v41)) *(*TTcl_Size)(unsafe.Pointer(v41))-- if !(v40 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v42 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v42 { cachePtr17 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v42 || ((*TAllocCache)(unsafe.Pointer(cachePtr17)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr17)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr17)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr17)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr17)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v44 = field v43 = *(*TTcl_Size)(unsafe.Pointer(v44)) *(*TTcl_Size)(unsafe.Pointer(v44))-- if !(v43 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v45 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v45 { cachePtr18 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v45 || ((*TAllocCache)(unsafe.Pointer(cachePtr18)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr18)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr18)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr18)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr18)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v46 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v46 { cachePtr19 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v46 || (*TAllocCache)(unsafe.Pointer(cachePtr19)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr19)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr19)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr19)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15644, libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(7) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, (*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_blocks) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v48 = field v47 = *(*TTcl_Size)(unsafe.Pointer(v48)) *(*TTcl_Size)(unsafe.Pointer(v48))-- if !(v47 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v49 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v49 { cachePtr20 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v49 || ((*TAllocCache)(unsafe.Pointer(cachePtr20)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr20)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr20)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr20)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr20)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v51 = field v50 = *(*TTcl_Size)(unsafe.Pointer(v51)) *(*TTcl_Size)(unsafe.Pointer(v51))-- if !(v50 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v52 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v52 { cachePtr21 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v52 || ((*TAllocCache)(unsafe.Pointer(cachePtr21)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr21)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr21)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr21)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr21)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v53 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v53 { cachePtr22 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v53 || (*TAllocCache)(unsafe.Pointer(cachePtr22)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr22)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr22)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr22)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(8)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(8)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15651, libc.Uint64FromInt64(8)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(8)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(8) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, (*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_blksize) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v55 = field v54 = *(*TTcl_Size)(unsafe.Pointer(v55)) *(*TTcl_Size)(unsafe.Pointer(v55))-- if !(v54 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v56 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v56 { cachePtr23 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v56 || ((*TAllocCache)(unsafe.Pointer(cachePtr23)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr23)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr23)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr23)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr23)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v58 = field v57 = *(*TTcl_Size)(unsafe.Pointer(v58)) *(*TTcl_Size)(unsafe.Pointer(v58))-- if !(v57 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v59 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v59 { cachePtr24 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v59 || ((*TAllocCache)(unsafe.Pointer(cachePtr24)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr24)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr24)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr24)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr24)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if (*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_mode&uint32(S_IFMT) == uint32(S_IFCHR) || (*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_mode&uint32(S_IFMT) == uint32(S_IFBLK) { if v60 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v60 { cachePtr25 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v60 || (*TAllocCache)(unsafe.Pointer(cachePtr25)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr25)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr25)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr25)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15670, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, int64(libc.Int64FromUint64((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_rdev))) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v62 = field v61 = *(*TTcl_Size)(unsafe.Pointer(v62)) *(*TTcl_Size)(unsafe.Pointer(v62))-- if !(v61 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v63 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v63 { cachePtr26 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v63 || ((*TAllocCache)(unsafe.Pointer(cachePtr26)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr26)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr26)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr26)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr26)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v65 = field v64 = *(*TTcl_Size)(unsafe.Pointer(v65)) *(*TTcl_Size)(unsafe.Pointer(v65))-- if !(v64 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v66 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v66 { cachePtr27 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v66 || ((*TAllocCache)(unsafe.Pointer(cachePtr27)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr27)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr27)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr27)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr27)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } } if v67 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v67 { cachePtr28 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v67 || (*TAllocCache)(unsafe.Pointer(cachePtr28)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr28)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr28)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr28)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+5641, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(6) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, XTcl_GetAccessTimeFromStat(tls, statPtr)) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v69 = field v68 = *(*TTcl_Size)(unsafe.Pointer(v69)) *(*TTcl_Size)(unsafe.Pointer(v69))-- if !(v68 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v70 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v70 { cachePtr29 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v70 || ((*TAllocCache)(unsafe.Pointer(cachePtr29)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr29)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr29)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr29)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr29)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v72 = field v71 = *(*TTcl_Size)(unsafe.Pointer(v72)) *(*TTcl_Size)(unsafe.Pointer(v72))-- if !(v71 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v73 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v73 { cachePtr30 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v73 || ((*TAllocCache)(unsafe.Pointer(cachePtr30)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr30)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr30)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr30)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr30)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v74 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v74 { cachePtr31 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v74 || (*TAllocCache)(unsafe.Pointer(cachePtr31)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr31)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr31)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr31)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+5741, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(6) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, XTcl_GetModificationTimeFromStat(tls, statPtr)) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v76 = field v75 = *(*TTcl_Size)(unsafe.Pointer(v76)) *(*TTcl_Size)(unsafe.Pointer(v76))-- if !(v75 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v77 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v77 { cachePtr32 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v77 || ((*TAllocCache)(unsafe.Pointer(cachePtr32)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr32)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr32)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr32)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr32)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v79 = field v78 = *(*TTcl_Size)(unsafe.Pointer(v79)) *(*TTcl_Size)(unsafe.Pointer(v79))-- if !(v78 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v80 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v80 { cachePtr33 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v80 || ((*TAllocCache)(unsafe.Pointer(cachePtr33)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr33)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr33)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr33)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr33)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v81 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v81 { cachePtr34 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v81 || (*TAllocCache)(unsafe.Pointer(cachePtr34)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr34)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr34)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr34)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15659, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(6) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, XTcl_GetChangeTimeFromStat(tls, statPtr)) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v83 = field v82 = *(*TTcl_Size)(unsafe.Pointer(v83)) *(*TTcl_Size)(unsafe.Pointer(v83))-- if !(v82 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v84 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v84 { cachePtr35 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v84 || ((*TAllocCache)(unsafe.Pointer(cachePtr35)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr35)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr35)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr35)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr35)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v86 = field v85 = *(*TTcl_Size)(unsafe.Pointer(v86)) *(*TTcl_Size)(unsafe.Pointer(v86))-- if !(v85 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v87 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v87 { cachePtr36 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v87 || ((*TAllocCache)(unsafe.Pointer(cachePtr36)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr36)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr36)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr36)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr36)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } mode = uint16((*TTcl_StatBuf)(unsafe.Pointer(statPtr)).Fst_mode) if v88 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v88 { cachePtr37 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v88 || (*TAllocCache)(unsafe.Pointer(cachePtr37)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr37)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr37)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr37)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+15665, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewWideIntObj(tls, libc.Int64FromUint16(mode)) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v90 = field v89 = *(*TTcl_Size)(unsafe.Pointer(v90)) *(*TTcl_Size)(unsafe.Pointer(v90))-- if !(v89 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v91 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v91 { cachePtr38 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v91 || ((*TAllocCache)(unsafe.Pointer(cachePtr38)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr38)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr38)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr38)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr38)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v93 = field v92 = *(*TTcl_Size)(unsafe.Pointer(v93)) *(*TTcl_Size)(unsafe.Pointer(v93))-- if !(v92 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v94 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v94 { cachePtr39 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v94 || ((*TAllocCache)(unsafe.Pointer(cachePtr39)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr39)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr39)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr39)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr39)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } if v95 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v95 { cachePtr40 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v95 || (*TAllocCache)(unsafe.Pointer(cachePtr40)).FnumObjects == libc.Uint64FromInt32(0) { field = XTclThreadAllocObj(tls) } else { field = (*TAllocCache)(unsafe.Pointer(cachePtr40)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr40)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr40)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes, __ccgo_ts+5851, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(field)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(field)).FrefCount++ value = XTcl_NewStringObj(tls, _GetTypeFromMode(tls, libc.Int32FromUint16(mode)), int64(-int32(1))) if XTcl_ObjSetVar2(tls, interp, varName, field, value, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v97 = field v96 = *(*TTcl_Size)(unsafe.Pointer(v97)) *(*TTcl_Size)(unsafe.Pointer(v97))-- if !(v96 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v98 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v98 { cachePtr41 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v98 || ((*TAllocCache)(unsafe.Pointer(cachePtr41)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr41)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr41)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr41)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr41)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return int32(TCL_ERROR) } v100 = field v99 = *(*TTcl_Size)(unsafe.Pointer(v100)) *(*TTcl_Size)(unsafe.Pointer(v100))-- if !(v99 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(field)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(field)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(field)).Flength = int64(-libc.Int32FromInt32(1)) if v101 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v101 { cachePtr42 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v101 || ((*TAllocCache)(unsafe.Pointer(cachePtr42)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr42)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, field) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(field + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr42)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr42)).FfirstObjPtr = field (*TAllocCache)(unsafe.Pointer(cachePtr42)).FnumObjects++ } } else { XTclFreeObj(tls, field) } } return TCL_OK } /* *---------------------------------------------------------------------- * * GetTypeFromMode -- * * Given a mode word, returns a string identifying the type of a file. * * Results: * A static text string giving the file type from mode. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _GetTypeFromMode(tls *libc.TLS, mode int32) (r uintptr) { if mode&int32(S_IFMT) == int32(S_IFREG) { return __ccgo_ts + 5636 } else { if mode&int32(S_IFMT) == int32(S_IFDIR) { return __ccgo_ts + 15675 } else { if mode&int32(S_IFMT) == int32(S_IFCHR) { return __ccgo_ts + 15685 } else { if mode&int32(S_IFMT) == int32(S_IFBLK) { return __ccgo_ts + 15702 } else { if mode&int32(S_IFMT) == int32(S_IFIFO) { return __ccgo_ts + 15715 } else { if mode&int32(S_IFMT) == int32(S_IFLNK) { return __ccgo_ts + 5730 } else { if mode&int32(S_IFMT) == int32(S_IFSOCK) { return __ccgo_ts + 5562 } } } } } } } return __ccgo_ts + 15720 } /* *---------------------------------------------------------------------- * * Tcl_ForObjCmd -- * * This procedure is invoked to process the "for" Tcl command. See the * user documentation for details on what it does. * * With the bytecode compiler, this procedure is only called when a * command name is computed at runtime, and is "for" or the name to which * "for" was renamed: e.g., * "set z for; $z {set i 0} {$i<100} {incr i} {puts $i}" * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * * Notes: * This command is split into a lot of pieces so that it can avoid doing * reentrant TEBC calls. This makes things rather hard to follow, but * here's the plan: * * NR: ---------------_ * Direct: Tcl_ForObjCmd -> TclNRForObjCmd * | * ForSetupCallback * | * [while] ------------> TclNRForIterCallback <---------. * | | * ForCondCallback | * | | * ForNextCallback ------------| * | | * ForPostNextCallback | * |____________________| * *---------------------------------------------------------------------- */ func XTcl_ForObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRForObjCmd), clientData, int64(objc), objv) } func XTclNRForObjCmd(tls *libc.TLS, dummy2522 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr uintptr var v1, v2 bool var _ /* _callbackPtr at bp+8 */ uintptr var _ /* iterPtr at bp+0 */ uintptr _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr, v1, v2 iPtr = interp if objc != int32(5) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15728) return int32(TCL_ERROR) } if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fcond = *(*uintptr)(unsafe.Pointer(objv + 2*8)) (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbody = *(*uintptr)(unsafe.Pointer(objv + 4*8)) (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fnext = *(*uintptr)(unsafe.Pointer(objv + 3*8)) (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fmsg = __ccgo_ts + 15752 (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fword = int64(4) if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(_ForSetupCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) /* * TIP #280. Make invoking context available to initial script. */ return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, int32(1)) } func _ForSetupCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, cachePtr1, iterPtr uintptr var v1, v2 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, iterPtr, v1, v2 iterPtr = *(*uintptr)(unsafe.Pointer(data)) if result != TCL_OK { if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+15778, int64(-int32(1)))) } if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, iterPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(iterPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = iterPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } return result } if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(XTclNRForIterCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = iterPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return TCL_OK } func XTclNRForIterCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, boolObj, cachePtr, cachePtr1, cachePtr2, iterPtr uintptr var v1, v2, v3 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _ = _objPtr, boolObj, cachePtr, cachePtr1, cachePtr2, iterPtr, v1, v2, v3 iterPtr = *(*uintptr)(unsafe.Pointer(data)) switch result { case TCL_OK: fallthrough case int32(TCL_CONTINUE): /* * We need to reset the result before evaluating the expression. * Otherwise, any error message will be appended to the result of the * last evaluation. */ XTcl_ResetResult(tls, interp) if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { boolObj = XTclThreadAllocObj(tls) } else { boolObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(boolObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr = libc.UintptrFromInt32(0) if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_ForCondCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = iterPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = boolObj *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return XTcl_NRExprObj(tls, interp, (*TForIterData)(unsafe.Pointer(iterPtr)).Fcond, boolObj) case int32(TCL_BREAK): result = TCL_OK XTcl_ResetResult(tls, interp) case int32(TCL_ERROR): XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, (*TForIterData)(unsafe.Pointer(iterPtr)).Fmsg, libc.VaList(bp+16, XTcl_GetErrorLine(tls, interp)))) } if v3 = interp == libc.UintptrFromInt32(0); !v3 { cachePtr2 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, iterPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(iterPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = iterPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } return result } func _ForCondCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, boolObj, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, iPtr, iterPtr, v2, v5, v8 uintptr var v1, v4, v7 TTcl_Size var v10, v11, v3, v6, v9 bool var _ /* _callbackPtr at bp+16 */ uintptr var _ /* _callbackPtr at bp+8 */ uintptr var _ /* value at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, boolObj, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, iPtr, iterPtr, v1, v10, v11, v2, v3, v4, v5, v6, v7, v8, v9 iPtr = interp iterPtr = *(*uintptr)(unsafe.Pointer(data)) boolObj = *(*uintptr)(unsafe.Pointer(data + 1*8)) if result != TCL_OK { _objPtr = boolObj v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } if v3 = interp == libc.UintptrFromInt32(0); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, iterPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(iterPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = iterPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } return result } else { if XTcl_GetBoolFromObj(tls, interp, boolObj, (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp) != TCL_OK { _objPtr1 = boolObj v5 = _objPtr1 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr1) } if v6 = interp == libc.UintptrFromInt32(0); !v6 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v6 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, iterPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(iterPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = iterPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } return int32(TCL_ERROR) } } _objPtr2 = boolObj v8 = _objPtr2 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr2) } if *(*int32)(unsafe.Pointer(bp)) != 0 { /* TIP #280. */ if (*TForIterData)(unsafe.Pointer(iterPtr)).Fnext != 0 { if v9 = interp == libc.UintptrFromInt32(0); !v9 { cachePtr2 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v9 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr3 = XTclThreadAllocObj(tls) } else { _objPtr3 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr3 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr3 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(_ForNextCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = iterPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { if v10 = interp == libc.UintptrFromInt32(0); !v10 { cachePtr3 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v10 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr4 = XTclThreadAllocObj(tls) } else { _objPtr4 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr4 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 16)) = _objPtr4 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FprocPtr = __ccgo_fp(XTclNRForIterCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)) = iterPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) } return XTclNREvalObjEx(tls, interp, (*TForIterData)(unsafe.Pointer(iterPtr)).Fbody, 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, int32((*TForIterData)(unsafe.Pointer(iterPtr)).Fword)) } if v11 = interp == libc.UintptrFromInt32(0); !v11 { cachePtr4 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v11 || ((*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, iterPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(iterPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = iterPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++ } return result } func _ForNextCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr, iterPtr, next uintptr var v1, v2 bool var _ /* _callbackPtr at bp+0 */ uintptr var _ /* _callbackPtr at bp+8 */ uintptr _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr, iterPtr, next, v1, v2 iPtr = interp iterPtr = *(*uintptr)(unsafe.Pointer(data)) next = (*TForIterData)(unsafe.Pointer(iterPtr)).Fnext if result == TCL_OK || result == int32(TCL_CONTINUE) { if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_ForPostNextCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = iterPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) /* * TIP #280. Make invoking context available to next script. */ return XTclNREvalObjEx(tls, interp, next, 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, int32(3)) } if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(XTclNRForIterCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = iterPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) return result } func _ForPostNextCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, cachePtr1, iterPtr uintptr var v1, v2 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, iterPtr, v1, v2 iterPtr = *(*uintptr)(unsafe.Pointer(data)) if result != int32(TCL_BREAK) && result != TCL_OK { if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+15807, int64(-int32(1)))) if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, iterPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(iterPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = iterPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } return result } if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(XTclNRForIterCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = iterPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return result } /* *---------------------------------------------------------------------- * * Tcl_ForeachObjCmd, TclNRForeachCmd, EachloopCmd -- * * This object-based procedure is invoked to process the "foreach" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_ForeachObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRForeachCmd), clientData, int64(objc), objv) } func XTclNRForeachCmd(tls *libc.TLS, dummy2716 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { return _EachloopCmd(tls, interp, TCL_EACH_KEEP_NONE, objc, objv) } func XTcl_LmapObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRLmapCmd), clientData, int64(objc), objv) } func XTclNRLmapCmd(tls *libc.TLS, dummy2736 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { return _EachloopCmd(tls, interp, int32(TCL_EACH_COLLECT), objc, objv) } func _EachloopCmd(tls *libc.TLS, interp uintptr, collect int32, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var _objPtr, cachePtr, proc, statePtr, v10, v11, v4, v5, v9 uintptr var i, numLists, result, v14, v2 int32 var j, v12 TTcl_Size var v15, v16, v3, v7, v8 int64 var v17 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, i, j, numLists, proc, result, statePtr, v10, v11, v12, v14, v15, v16, v17, v2, v3, v4, v5, v7, v8, v9 numLists = (objc - int32(2)) / int32(2) if objc < int32(4) || objc%int32(2) != 0 { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+15837) return int32(TCL_ERROR) } /* * Manage numList parallel value lists. * statePtr->argvList[i] is a value list counted by statePtr->argcList[i]; * statePtr->varvList[i] is the list of variables associated with the * value list; * statePtr->varcList[i] is the number of variables associated with the * value list; * statePtr->index[i] is the current pointer into the value list * statePtr->argvList[i]. * * The setting up of all of these pointers is moderately messy, but allows * the rest of this code to be simple and for us to use a single memory * allocation for better performance. */ statePtr = XTclStackAlloc(tls, interp, uint64(104)+libc.Uint64FromInt32(int32(3)*numLists)*uint64(8)+libc.Uint64FromInt32(int32(2)*numLists)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(8))) libc.Xmemset(tls, statePtr, 0, uint64(104)+libc.Uint64FromInt32(int32(3)*numLists)*uint64(8)+libc.Uint64FromInt32(int32(2)*numLists)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(8))) (*TForeachState)(unsafe.Pointer(statePtr)).FvarvList = statePtr + libc.UintptrFromInt32(1)*104 (*TForeachState)(unsafe.Pointer(statePtr)).FargvList = (*TForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(numLists)*8 (*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList = (*TForeachState)(unsafe.Pointer(statePtr)).FargvList + uintptr(numLists)*8 (*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList = (*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(numLists)*8 (*TForeachState)(unsafe.Pointer(statePtr)).Findex = (*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(numLists)*8 (*TForeachState)(unsafe.Pointer(statePtr)).FvarcList = (*TForeachState)(unsafe.Pointer(statePtr)).Findex + uintptr(numLists)*8 (*TForeachState)(unsafe.Pointer(statePtr)).FargcList = (*TForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(numLists)*8 (*TForeachState)(unsafe.Pointer(statePtr)).FnumLists = int64(numLists) (*TForeachState)(unsafe.Pointer(statePtr)).FbodyPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)) (*TForeachState)(unsafe.Pointer(statePtr)).FbodyIdx = int64(objc - int32(1)) if collect == int32(TCL_EACH_COLLECT) { (*TForeachState)(unsafe.Pointer(statePtr)).FresultList = XTcl_NewListObj(tls, 0, libc.UintptrFromInt32(0)) } else { (*TForeachState)(unsafe.Pointer(statePtr)).FresultList = libc.UintptrFromInt32(0) } /* * Break up the value lists and variable lists into elements. */ i = 0 for { if !(i < numLists) { break } /* List */ /* Variables */ *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) = XTclListObjCopy(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(int32(1)+i*int32(2))*8))) if *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) == libc.UintptrFromInt32(0) { result = int32(TCL_ERROR) goto done } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*8)) = v3 v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)), (*TForeachState)(unsafe.Pointer(statePtr)).FvarcList+uintptr(i)*8) } result = v2 if result != TCL_OK { result = int32(TCL_ERROR) goto done } if *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*8)) < int64(1) { if (*TForeachState)(unsafe.Pointer(statePtr)).FresultList != libc.UintptrFromInt32(0) { v4 = __ccgo_ts + 5269 } else { v4 = __ccgo_ts + 5191 } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15877, libc.VaList(bp+16, v4))) if (*TForeachState)(unsafe.Pointer(statePtr)).FresultList != libc.UintptrFromInt32(0) { v5 = __ccgo_ts + 15897 } else { v5 = __ccgo_ts + 15902 } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+8210, v5, __ccgo_ts+15910, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr2 != 0 { v7 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr2)).FspanStart } else { v7 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr1 + 40 + uintptr(v7)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr2 != 0 { v8 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr2)).FspanLength } else { v8 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*8)) = v8 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)), (*TForeachState)(unsafe.Pointer(statePtr)).FvarcList+uintptr(i)*8, (*TForeachState)(unsafe.Pointer(statePtr)).FvarvList+uintptr(i)*8) } /* Values */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(int32(2)+i*int32(2))*8)))).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+56) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+56) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(int32(2)+i*int32(2))*8)))).FtypePtr)).Fversion) { v9 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(int32(2)+i*int32(2))*8)))).FtypePtr)).FindexProc } else { v9 = libc.UintptrFromInt32(0) } if v9 != 0 { /* Special case for AbstractList */ *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(int32(2)+i*int32(2))*8))) if *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) == libc.UintptrFromInt32(0) { result = int32(TCL_ERROR) goto done } /* Don't compute values here, wait until the last moment */ v10 = *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) if (*TTcl_Obj)(unsafe.Pointer(v10)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+48) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+48) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v10)).FtypePtr)).Fversion) { v11 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v10)).FtypePtr)).FlengthProc } else { v11 = libc.UintptrFromInt32(0) } proc = v11 v12 = (*(*func(*libc.TLS, uintptr) TTcl_Size)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, v10) goto _13 _13: *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FargcList + uintptr(i)*8)) = v12 } else { /* List values */ *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) = XTclListObjCopy(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(int32(2)+i*int32(2))*8))) if *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) == libc.UintptrFromInt32(0) { result = int32(TCL_ERROR) goto done } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32))).Fptr2 != 0 { v15 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32))).Fptr2)).FspanStart } else { v15 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FargvList + uintptr(i)*8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32))).Fptr1 + 40 + uintptr(v15)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32))).Fptr2 != 0 { v16 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32))).Fptr2)).FspanLength } else { v16 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FargcList + uintptr(i)*8)) = v16 v14 = libc.Int32FromInt32(TCL_OK) } else { v14 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)), (*TForeachState)(unsafe.Pointer(statePtr)).FargcList+uintptr(i)*8, (*TForeachState)(unsafe.Pointer(statePtr)).FargvList+uintptr(i)*8) } result = v14 if result != TCL_OK { goto done } } /* account for variable <> value mismatch */ j = *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FargcList + uintptr(i)*8)) / *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*8)) if *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FargcList + uintptr(i)*8))%*(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*8)) != 0 { j++ } if j > (*TForeachState)(unsafe.Pointer(statePtr)).Fmaxj { (*TForeachState)(unsafe.Pointer(statePtr)).Fmaxj = j } goto _1 _1: ; i++ } /* * If there is any work to do, assign the variables and set things going * non-recursively. */ if (*TForeachState)(unsafe.Pointer(statePtr)).Fmaxj > 0 { result = _ForeachAssignments(tls, interp, statePtr) if result == int32(TCL_ERROR) { goto done } if v17 = interp == libc.UintptrFromInt32(0); !v17 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v17 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_ForeachLoopStep) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = statePtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), 0, (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr, objc-int32(1)) } /* * This cleanup stage is only used when an error occurs during setup or if * there is no work to do. */ result = TCL_OK goto done done: ; _ForeachCleanup(tls, interp, statePtr) return result } /* * Post-body processing handler. */ func _ForeachLoopStep(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, cachePtr, statePtr, v1, v3 uintptr var v2 TTcl_Size var v4 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _, _, _ = _objPtr, cachePtr, statePtr, v1, v2, v3, v4 statePtr = *(*uintptr)(unsafe.Pointer(data)) /* * Process the result code from this run of the [foreach] body. Note that * this switch uses fallthroughs in several places. Maintainer aware! */ switch result { case int32(TCL_CONTINUE): result = TCL_OK case TCL_OK: if (*TForeachState)(unsafe.Pointer(statePtr)).FresultList != libc.UintptrFromInt32(0) { result = XTcl_ListObjAppendElement(tls, interp, (*TForeachState)(unsafe.Pointer(statePtr)).FresultList, XTcl_GetObjResult(tls, interp)) if result != TCL_OK { /* e.g. memory alloc failure on big data tests */ goto done } } case int32(TCL_BREAK): result = TCL_OK goto finish case int32(TCL_ERROR): if (*TForeachState)(unsafe.Pointer(statePtr)).FresultList != libc.UintptrFromInt32(0) { v1 = __ccgo_ts + 5269 } else { v1 = __ccgo_ts + 5191 } XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15919, libc.VaList(bp+16, v1, XTcl_GetErrorLine(tls, interp)))) fallthrough default: goto done } /* * Test if there is work still to be done. If so, do the next round of * variable assignments, reschedule ourselves and run the body again. */ v3 = statePtr + 16 *(*TTcl_Size)(unsafe.Pointer(v3))++ v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) if (*TForeachState)(unsafe.Pointer(statePtr)).Fmaxj > v2 { result = _ForeachAssignments(tls, interp, statePtr) if result == int32(TCL_ERROR) { goto done } if v4 = interp == libc.UintptrFromInt32(0); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_ForeachLoopStep) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = statePtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return XTclNREvalObjEx(tls, interp, (*TForeachState)(unsafe.Pointer(statePtr)).FbodyPtr, 0, (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr, int32((*TForeachState)(unsafe.Pointer(statePtr)).FbodyIdx)) } /* * We're done. Tidy up our work space and finish off. */ goto finish finish: ; if (*TForeachState)(unsafe.Pointer(statePtr)).FresultList == libc.UintptrFromInt32(0) { XTcl_ResetResult(tls, interp) } else { XTcl_SetObjResult(tls, interp, (*TForeachState)(unsafe.Pointer(statePtr)).FresultList) (*TForeachState)(unsafe.Pointer(statePtr)).FresultList = libc.UintptrFromInt32(0) /* Don't clean it up */ } goto done done: ; _ForeachCleanup(tls, interp, statePtr) return result } /* * Factored out code to do the assignments in [foreach]. */ func _ForeachAssignments(tls *libc.TLS, interp1 uintptr, statePtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var cachePtr, proc, varValuePtr, v10, v11, v13, v14, v2, v5, v6, v7 uintptr var i, isAbstractList, v8 int32 var k, v, v4 TTcl_Size var v12 bool var _ /* valuePtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, i, isAbstractList, k, proc, v, varValuePtr, v10, v11, v12, v13, v14, v2, v4, v5, v6, v7, v8 i = 0 for { if !(int64(i) < (*TForeachState)(unsafe.Pointer(statePtr)).FnumLists) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+56) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+56) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FtypePtr)).Fversion) { v2 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FtypePtr)).FindexProc } else { v2 = libc.UintptrFromInt32(0) } isAbstractList = libc.BoolInt32(v2 != libc.UintptrFromInt32(0)) v = 0 for { if !(v < *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarcList + uintptr(i)*8))) { break } v5 = (*TForeachState)(unsafe.Pointer(statePtr)).Findex + uintptr(i)*8 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))++ k = v4 if k < *(*TTcl_Size)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FargcList + uintptr(i)*8)) { if isAbstractList != 0 { v6 = *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) if (*TTcl_Obj)(unsafe.Pointer(v6)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+56) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+56) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v6)).FtypePtr)).Fversion) { v7 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v6)).FtypePtr)).FindexProc } else { v7 = libc.UintptrFromInt32(0) } proc = v7 v8 = (*(*func(*libc.TLS, uintptr, uintptr, TTcl_Size, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, interp1, v6, k, bp) goto _9 _9: if v8 != TCL_OK { if (*TForeachState)(unsafe.Pointer(statePtr)).FresultList != libc.UintptrFromInt32(0) { v10 = __ccgo_ts + 5269 } else { v10 = __ccgo_ts + 5191 } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)))).Fbytes != 0 { v11 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)))).Fbytes } else { v11 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)), libc.UintptrFromInt32(0)) } XTcl_AppendObjToErrorInfo(tls, interp1, XTcl_ObjPrintf(tls, __ccgo_ts+15944, libc.VaList(bp+16, v10, v11))) return int32(TCL_ERROR) } } else { *(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FargvList + uintptr(i)*8)) + uintptr(k)*8)) } } else { if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(bp)) = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr = libc.UintptrFromInt32(0) /* Empty string */ } varValuePtr = XTcl_ObjSetVar2(tls, interp1, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)), libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), int32(TCL_LEAVE_ERR_MSG)) if varValuePtr == libc.UintptrFromInt32(0) { if (*TForeachState)(unsafe.Pointer(statePtr)).FresultList != libc.UintptrFromInt32(0) { v13 = __ccgo_ts + 5269 } else { v13 = __ccgo_ts + 5191 } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)))).Fbytes != 0 { v14 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)))).Fbytes } else { v14 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvarvList + uintptr(i)*8)) + uintptr(v)*8)), libc.UintptrFromInt32(0)) } XTcl_AppendObjToErrorInfo(tls, interp1, XTcl_ObjPrintf(tls, __ccgo_ts+15944, libc.VaList(bp+16, v13, v14))) return int32(TCL_ERROR) } goto _3 _3: ; v++ } goto _1 _1: ; i++ } return TCL_OK } /* * Factored out code for cleaning up the state of the foreach. */ func _ForeachCleanup(tls *libc.TLS, interp uintptr, statePtr uintptr) { var cachePtr, cachePtr1, cachePtr2, v3, v6, v9 uintptr var i int32 var v10, v4, v7 bool var v2, v5, v8 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, i, v10, v2, v3, v4, v5, v6, v7, v8, v9 i = 0 for { if !(int64(i) < (*TForeachState)(unsafe.Pointer(statePtr)).FnumLists) { break } if *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) != 0 { v3 = *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if !(v2 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)))).Flength = int64(-libc.Int32FromInt32(1)) if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8)) (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FvCopyList + uintptr(i)*8))) } } } if *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) != 0 { v6 = *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if !(v5 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)))).Flength = int64(-libc.Int32FromInt32(1)) if v7 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v7 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v7 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8)) (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FaCopyList + uintptr(i)*8))) } } } goto _1 _1: ; i++ } if (*TForeachState)(unsafe.Pointer(statePtr)).FresultList != libc.UintptrFromInt32(0) { v9 = (*TForeachState)(unsafe.Pointer(statePtr)).FresultList v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if !(v8 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FresultList)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FresultList)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FresultList)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FresultList)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FresultList)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FresultList)).Flength = int64(-libc.Int32FromInt32(1)) if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*TForeachState)(unsafe.Pointer(statePtr)).FresultList) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TForeachState)(unsafe.Pointer(statePtr)).FresultList + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*TForeachState)(unsafe.Pointer(statePtr)).FresultList (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, (*TForeachState)(unsafe.Pointer(statePtr)).FresultList) } } } XTclStackFree(tls, interp, statePtr) } /* *---------------------------------------------------------------------- * * Tcl_FormatObjCmd -- * * This procedure is invoked to process the "format" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_FormatObjCmd(tls *libc.TLS, dummy3065 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var resultPtr, v1 uintptr _, _ = resultPtr, v1 /* Where result is stored finally. */ if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+10699) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } resultPtr = XTcl_Format(tls, interp, v1, int64(objc-int32(2)), objv+uintptr(2)*8) if resultPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, resultPtr) return TCL_OK } const MAXCALLOC = 1024000 const NUM_LISTS = 30 const SORTMODE_ASCII = 0 const SORTMODE_ASCII_NC = 8 const SORTMODE_COMMAND = 3 const SORTMODE_DICTIONARY = 4 const SORTMODE_INTEGER = 1 const SORTMODE_REAL = 2 const __REG_WIDE_COMPILE = 0 const __REG_WIDE_EXEC = 0 const __REG_WIDE_T = 0 type TTclRegexp = struct { Fflags int32 Fre Tregex_t Fstring1 uintptr FobjPtr uintptr FglobObjPtr uintptr Fmatches uintptr Fdetails Trm_detail_t FrefCount TTcl_Size } /* * During execution of the "lsort" command, structures of the following type * are used to arrange the objects being sorted into a collection of linked * lists. */ type TSortElement = struct { FcollationKey struct { FwideValue [0]TTcl_WideInt FdoubleValue [0]float64 FobjValuePtr [0]uintptr FstrValuePtr uintptr } Fpayload struct { Findex [0]Tsize_t FobjPtr uintptr } FnextPtr uintptr } /* * These function pointer types are used with the "lsearch" and "lsort" * commands to facilitate the "-nocase" option. */ type TSortStrCmpFn_t = uintptr type TSortMemCmpFn_t = uintptr /* * The "lsort" command needs to pass certain information down to the function * that compares two list elements, and the comparison function needs to pass * success or failure information back up to the top-level "lsort" command. * The following structure is used to pass this information. */ type TSortInfo = struct { FisIncreasing int32 FsortMode int32 FcompareCmdPtr uintptr Findexv uintptr Findexc TTcl_Size FsingleIndex int32 Funique int32 FnumElements int32 Finterp uintptr FresultCode int32 } /* * The "sortMode" field of the SortInfo structure can take on any of the * following values. */ // C documentation // // /* // * Definitions for [lseq] command // */ var _seq_operations = [5]uintptr{ 0: __ccgo_ts + 15981, 1: __ccgo_ts + 15984, 2: __ccgo_ts + 3682, 3: __ccgo_ts + 15987, 4: libc.UintptrFromInt32(0), } type TSequenceOperators = int32 const LSEQ_DOTS = 0 const LSEQ_TO = 1 const LSEQ_COUNT = 2 const LSEQ_BY = 3 type TSequenceDecoded = int32 const NoneArg = 0 const NumericArg = 1 const RangeKeywordArg = 2 const ErrArg = 3 const LastArg = 8 /* * Array of values describing how to implement each standard subcommand of the * "info" command. */ var _defaultInfoMap = [28]TEnsembleImplMap{ 0: { Fname: __ccgo_ts + 15990, }, 1: { Fname: __ccgo_ts + 15995, }, 2: { Fname: __ccgo_ts + 16000, }, 3: { Fname: __ccgo_ts + 5878, Funsafe: int32(1), }, 4: { Fname: __ccgo_ts + 16009, }, 5: { Fname: __ccgo_ts + 16018, }, 6: { Fname: __ccgo_ts + 16027, }, 7: { Fname: __ccgo_ts + 16036, }, 8: { Fname: __ccgo_ts + 5171, }, 9: { Fname: __ccgo_ts + 16043, }, 10: { Fname: __ccgo_ts + 16051, }, 11: { Fname: __ccgo_ts + 5689, }, 12: { Fname: __ccgo_ts + 16062, }, 13: { Fname: __ccgo_ts + 16068, }, 14: { Fname: __ccgo_ts + 16078, }, 15: { Fname: __ccgo_ts + 16086, }, 16: { Fname: __ccgo_ts + 16095, }, 17: { Fname: __ccgo_ts + 16101, }, 18: { Fname: __ccgo_ts + 16109, }, 19: { Fname: __ccgo_ts + 16116, }, 20: { Fname: __ccgo_ts + 5886, Funsafe: int32(1), }, 21: { Fname: __ccgo_ts + 6370, }, 22: { Fname: __ccgo_ts + 16123, }, 23: { Fname: __ccgo_ts + 3702, }, 24: { Fname: __ccgo_ts + 16129, }, 25: { Fname: __ccgo_ts + 16148, }, 26: { Fname: __ccgo_ts + 16159, }, 27: {}, } func init() { p := unsafe.Pointer(&_defaultInfoMap) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_InfoArgsCmd) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_InfoBodyCmd) *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_InfoCmdCountCmd) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 152)) = __ccgo_fp(_InfoCmdTypeCmd) *(*uintptr)(unsafe.Add(p, 160)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 200)) = __ccgo_fp(_InfoCommandsCmd) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(XTclCompileInfoCommandsCmd) *(*uintptr)(unsafe.Add(p, 248)) = __ccgo_fp(_InfoCompleteCmd) *(*uintptr)(unsafe.Add(p, 256)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 296)) = __ccgo_fp(XTclInfoConstantCmd) *(*uintptr)(unsafe.Add(p, 304)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 344)) = __ccgo_fp(XTclInfoConstsCmd) *(*uintptr)(unsafe.Add(p, 352)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(XTclInfoCoroutineCmd) *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(XTclCompileInfoCoroutineCmd) *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_InfoDefaultCmd) *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(XTclCompileBasic3ArgCmd) *(*uintptr)(unsafe.Add(p, 488)) = __ccgo_fp(_InfoErrorStackCmd) *(*uintptr)(unsafe.Add(p, 496)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 536)) = __ccgo_fp(XTclInfoExistsCmd) *(*uintptr)(unsafe.Add(p, 544)) = __ccgo_fp(XTclCompileInfoExistsCmd) *(*uintptr)(unsafe.Add(p, 584)) = __ccgo_fp(_InfoFrameCmd) *(*uintptr)(unsafe.Add(p, 592)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 632)) = __ccgo_fp(_InfoFunctionsCmd) *(*uintptr)(unsafe.Add(p, 640)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 680)) = __ccgo_fp(XTclInfoGlobalsCmd) *(*uintptr)(unsafe.Add(p, 688)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 728)) = __ccgo_fp(_InfoHostnameCmd) *(*uintptr)(unsafe.Add(p, 736)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 776)) = __ccgo_fp(_InfoLevelCmd) *(*uintptr)(unsafe.Add(p, 784)) = __ccgo_fp(XTclCompileInfoLevelCmd) *(*uintptr)(unsafe.Add(p, 824)) = __ccgo_fp(_InfoLibraryCmd) *(*uintptr)(unsafe.Add(p, 832)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 872)) = __ccgo_fp(_InfoLoadedCmd) *(*uintptr)(unsafe.Add(p, 880)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 920)) = __ccgo_fp(XTclInfoLocalsCmd) *(*uintptr)(unsafe.Add(p, 928)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 968)) = __ccgo_fp(_InfoNameOfExecutableCmd) *(*uintptr)(unsafe.Add(p, 976)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 1016)) = __ccgo_fp(_InfoPatchLevelCmd) *(*uintptr)(unsafe.Add(p, 1024)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 1064)) = __ccgo_fp(_InfoProcsCmd) *(*uintptr)(unsafe.Add(p, 1072)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 1112)) = __ccgo_fp(_InfoScriptCmd) *(*uintptr)(unsafe.Add(p, 1120)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) *(*uintptr)(unsafe.Add(p, 1160)) = __ccgo_fp(_InfoSharedlibCmd) *(*uintptr)(unsafe.Add(p, 1168)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 1208)) = __ccgo_fp(_InfoTclVersionCmd) *(*uintptr)(unsafe.Add(p, 1216)) = __ccgo_fp(XTclCompileBasic0ArgCmd) *(*uintptr)(unsafe.Add(p, 1256)) = __ccgo_fp(XTclInfoVarsCmd) *(*uintptr)(unsafe.Add(p, 1264)) = __ccgo_fp(XTclCompileBasic0Or1ArgCmd) } /* *---------------------------------------------------------------------- * * Tcl_IfObjCmd -- * * This procedure is invoked to process the "if" Tcl command. See the * user documentation for details on what it does. * * With the bytecode compiler, this procedure is only called when a * command name is computed at runtime, and is "if" or the name to which * "if" was renamed: e.g., "set z if; $z 1 {puts foo}" * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_IfObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRIfObjCmd), clientData, int64(objc), objv) } func XTclNRIfObjCmd(tls *libc.TLS, dummy216 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument objects. */ var boolObj, cachePtr, v1 uintptr var v2 bool _, _, _, _ = boolObj, cachePtr, v1, v2 if objc <= int32(1) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+16164, libc.VaList(bp+8, v1))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+9101, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * At this point, objv[1] refers to the main expression to test. The * arguments after the expression must be "then" (optional) and a script * to execute if the expression is true. */ if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { boolObj = XTclThreadAllocObj(tls) } else { boolObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(boolObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr = libc.UintptrFromInt32(0) XTcl_NRAddCallback(tls, interp, __ccgo_fp(_IfConditionCallback), uintptr(int64(objc)), objv, uintptr(int64(libc.Int32FromInt32(1))), boolObj) return XTcl_NRExprObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), boolObj) } func _IfConditionCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var boolObj, cachePtr, cachePtr1, cachePtr2, cachePtr3, clause, iPtr, objv, v10, v11, v13, v2, v5, v8 uintptr var i, objc, thenScriptIndex int32 var v1, v4, v7 TTcl_Size var v12, v3, v6, v9 bool var _ /* value at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = boolObj, cachePtr, cachePtr1, cachePtr2, cachePtr3, clause, i, iPtr, objc, objv, thenScriptIndex, v1, v10, v11, v12, v13, v2, v3, v4, v5, v6, v7, v8, v9 iPtr = interp objc = int32(int64(*(*uintptr)(unsafe.Pointer(data)))) objv = *(*uintptr)(unsafe.Pointer(data + 1*8)) i = int32(int64(*(*uintptr)(unsafe.Pointer(data + 2*8)))) boolObj = *(*uintptr)(unsafe.Pointer(data + 3*8)) thenScriptIndex = 0 if result != TCL_OK { v2 = boolObj v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, boolObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = boolObj (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, boolObj) } } return result } if XTcl_GetBoolFromObj(tls, interp, boolObj, (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp) != TCL_OK { v5 = boolObj v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if !(v4 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = int64(-libc.Int32FromInt32(1)) if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, boolObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = boolObj (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, boolObj) } } return int32(TCL_ERROR) } v8 = boolObj v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if !(v7 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = int64(-libc.Int32FromInt32(1)) if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, boolObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = boolObj (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, boolObj) } } for int32(1) != 0 { i++ if i >= objc { goto missingScript } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { v10 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v10 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), libc.UintptrFromInt32(0)) } clause = v10 if i < objc && libc.Xstrcmp(tls, clause, __ccgo_ts+16212) == 0 { i++ } if i >= objc { goto missingScript } if *(*int32)(unsafe.Pointer(bp)) != 0 { thenScriptIndex = i *(*int32)(unsafe.Pointer(bp)) = 0 } /* * The expression evaluated to false. Skip the command, then see if * there is an "else" or "elseif" clause. */ i++ if i >= objc { if thenScriptIndex != 0 { /* * TIP #280. Make invoking context available to branch. */ return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(thenScriptIndex)*8)), 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, thenScriptIndex) } return TCL_OK } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { v11 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v11 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), libc.UintptrFromInt32(0)) } clause = v11 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(clause))) != int32('e') || libc.Xstrcmp(tls, clause, __ccgo_ts+16217) != 0 { break } i++ /* * At this point in the loop, objv and objc refer to an expression to * test, either for the main expression or an expression following an * "elseif". The arguments after the expression must be "then" * (optional) and a script to execute if the expression is true. */ if i >= objc { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+16164, libc.VaList(bp+16, clause))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+9101, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } if !(thenScriptIndex != 0) { if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { boolObj = XTclThreadAllocObj(tls) } else { boolObj = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(boolObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr = libc.UintptrFromInt32(0) XTcl_NRAddCallback(tls, interp, __ccgo_fp(_IfConditionCallback), *(*uintptr)(unsafe.Pointer(data)), *(*uintptr)(unsafe.Pointer(data + 1*8)), uintptr(int64(i)), boolObj) return XTcl_NRExprObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), boolObj) } } /* * Couldn't find a "then" or "elseif" clause to execute. Check now for an * "else" clause. We know that there's at least one more argument when we * get here. */ if libc.Xstrcmp(tls, clause, __ccgo_ts+16224) == 0 { i++ if i >= objc { goto missingScript } } if i < objc-int32(1) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+16229, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+9101, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } if thenScriptIndex != 0 { /* * TIP #280. Make invoking context available to branch/else. */ return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(thenScriptIndex)*8)), 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, thenScriptIndex) } return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, i) goto missingScript missingScript: ; if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i-int32(1))*8)))).Fbytes != 0 { v13 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i-int32(1))*8)))).Fbytes } else { v13 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i-int32(1))*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+16291, libc.VaList(bp+16, v13))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+9101, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * Tcl_IncrObjCmd -- * * This procedure is invoked to process the "incr" Tcl command. See the * user documentation for details on what it does. * * With the bytecode compiler, this procedure is only called when a * command name is computed at runtime, and is "incr" or the name to * which "incr" was renamed: e.g., "set z incr; $z i -1" * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_IncrObjCmd(tls *libc.TLS, dummy389 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var _objPtr, cachePtr, incrPtr, newValuePtr, v3 uintptr var v1 bool var v2 TTcl_Size _, _, _, _, _, _, _ = _objPtr, cachePtr, incrPtr, newValuePtr, v1, v2, v3 if objc != int32(2) && objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16339) return int32(TCL_ERROR) } if objc == int32(3) { incrPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8)) } else { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { incrPtr = XTclThreadAllocObj(tls) } else { incrPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(incrPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(incrPtr)).FinternalRep)) = int64(libc.Int32FromInt32(1)) (*TTcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } (*TTcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount++ newValuePtr = XTclIncrObjVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), incrPtr, int32(TCL_LEAVE_ERR_MSG)) _objPtr = incrPtr v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } if newValuePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * Set the interpreter's object result to refer to the variable's new * value object. */ XTcl_SetObjResult(tls, interp, newValuePtr) return TCL_OK } /* *---------------------------------------------------------------------- * * TclInitInfoCmd -- * * This function is called to create the "info" Tcl command. See the user * documentation for details on what it does. * * Results: * Handle for the info command, or NULL on failure. * * Side effects: * none * *---------------------------------------------------------------------- */ func XTclInitInfoCmd(tls *libc.TLS, interp uintptr) (r TTcl_Command) { /* Current interpreter. */ return XTclMakeEnsemble(tls, interp, __ccgo_ts+5873, uintptr(unsafe.Pointer(&_defaultInfoMap))) } /* *---------------------------------------------------------------------- * * InfoArgsCmd -- * * Called to implement the "info args" command that returns the argument * list for a procedure. Handles the following syntax: * * info args procName * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoArgsCmd(tls *libc.TLS, dummy470 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Argument objects. */ var iPtr, listObjPtr, localPtr, name, procPtr, v1 uintptr _, _, _, _, _, _ = iPtr, listObjPtr, localPtr, name, procPtr, v1 iPtr = interp if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16359) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } name = v1 procPtr = XTclFindProc(tls, iPtr, name) if procPtr == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+16368, libc.VaList(bp+8, name))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+16391, name, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Build a return list containing the arguments. */ listObjPtr = XTcl_NewListObj(tls, 0, libc.UintptrFromInt32(0)) localPtr = (*TProc)(unsafe.Pointer(procPtr)).FfirstLocalPtr for { if !(localPtr != libc.UintptrFromInt32(0)) { break } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_ARGUMENT) != 0 { XTcl_ListObjAppendElement(tls, interp, listObjPtr, XTcl_NewStringObj(tls, localPtr+44, int64(-int32(1)))) } goto _2 _2: ; localPtr = (*TCompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr } XTcl_SetObjResult(tls, interp, listObjPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * InfoBodyCmd -- * * Called to implement the "info body" command that returns the body for * a procedure. Handles the following syntax: * * info body procName * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoBodyCmd(tls *libc.TLS, dummy533 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Argument objects. */ var bytes, iPtr, name, procPtr, v1, v2 uintptr var _ /* numBytes at bp+0 */ TTcl_Size _, _, _, _, _, _ = bytes, iPtr, name, procPtr, v1, v2 iPtr = interp if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16359) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } name = v1 procPtr = XTclFindProc(tls, iPtr, name) if procPtr == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+16368, libc.VaList(bp+16, name))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+16391, name, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Here we used to return procPtr->bodyPtr, except when the body was * bytecompiled - in that case, the return was a copy of the body's string * rep. In order to better isolate the implementation details of the * compiler/engine subsystem, we now always return a copy of the string * rep. It is important to return a copy so that later manipulations of * the object do not invalidate the internal rep. */ if (*TTcl_Obj)(unsafe.Pointer((*TProc)(unsafe.Pointer(procPtr)).FbodyPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer((*TProc)(unsafe.Pointer(procPtr)).FbodyPtr)).Flength v2 = (*TTcl_Obj)(unsafe.Pointer((*TProc)(unsafe.Pointer(procPtr)).FbodyPtr)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, (*TProc)(unsafe.Pointer(procPtr)).FbodyPtr, bp) } bytes = v2 XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, bytes, *(*TTcl_Size)(unsafe.Pointer(bp)))) return TCL_OK } /* *---------------------------------------------------------------------- * * InfoCmdCountCmd -- * * Called to implement the "info cmdcount" command that returns the * number of commands that have been executed. Handles the following * syntax: * * info cmdcount * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoCmdCountCmd(tls *libc.TLS, dummy594 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var iPtr uintptr _ = iPtr iPtr = interp if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, (*TInterp)(unsafe.Pointer(iPtr)).FcmdCount)) return TCL_OK } /* *---------------------------------------------------------------------- * * InfoCommandsCmd -- * * Called to implement the "info commands" command that returns the list * of commands in the interpreter that match an optional pattern. The * pattern, if any, consists of an optional sequence of namespace names * separated by "::" qualifiers, which is followed by a glob-style * pattern that restricts which commands are returned. Handles the * following syntax: * * info commands ?pattern? * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoCommandsCmd(tls *libc.TLS, dummy636 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(176) defer tls.Free(176) /* Argument objects. */ var cachePtr, cachePtr1, cachePtr2, cachePtr3, cmdName, currNsPtr, elemObjPtr, entryPtr, globalNsPtr, listPtr, pathNsPtr, pathNsPtr1, pattern, tablePtr, v1, v11, v13, v15, v17, v3, v5, v6, v8, v9 uintptr var cmd TTcl_Command var foundGlobal, specificNsInPattern int32 var i, v12, v16 TTcl_Size var v14, v18, v2, v7 bool var _ /* addedCommandsTable at bp+56 */ TTcl_HashTable var _ /* dummy1NsPtr at bp+40 */ uintptr var _ /* dummy2NsPtr at bp+48 */ uintptr var _ /* isNew at bp+160 */ int32 var _ /* nsPtr at bp+32 */ uintptr var _ /* search at bp+8 */ TTcl_HashSearch var _ /* simplePattern at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, cachePtr3, cmd, cmdName, currNsPtr, elemObjPtr, entryPtr, foundGlobal, globalNsPtr, i, listPtr, pathNsPtr, pathNsPtr1, pattern, specificNsInPattern, tablePtr, v1, v11, v12, v13, v14, v15, v16, v17, v18, v2, v3, v5, v6, v7, v8, v9 globalNsPtr = XTcl_GetGlobalNamespace(tls, interp) currNsPtr = XTcl_GetCurrentNamespace(tls, interp) specificNsInPattern = 0 /* * Get the pattern and find the "effective namespace" in which to list * commands. */ if objc == int32(1) { *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(bp + 32)) = currNsPtr specificNsInPattern = 0 } else { if objc == int32(2) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } pattern = v1 XTclGetNamespaceForQualName(tls, interp, pattern, libc.UintptrFromInt32(0), 0, bp+32, bp+40, bp+48, bp) if *(*uintptr)(unsafe.Pointer(bp + 32)) != libc.UintptrFromInt32(0) { /* We successfully found the pattern's ns. */ specificNsInPattern = libc.BoolInt32(libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(bp)), pattern) != 0) } } else { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16401) return int32(TCL_ERROR) } } /* * Exit as quickly as possible if we couldn't find the namespace. */ if *(*uintptr)(unsafe.Pointer(bp + 32)) == libc.UintptrFromInt32(0) { return TCL_OK } /* * Scan through the effective namespace's command table and create a list * with all commands that match the pattern. If a specific namespace was * requested in the pattern, qualify the command names with the namespace * name. */ listPtr = XTcl_NewListObj(tls, 0, libc.UintptrFromInt32(0)) if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) && libc.Xstrpbrk(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16411) == libc.UintptrFromInt32(0) { /* * Special case for when the pattern doesn't include any of glob's * special characters. This lets us avoid scans of any hash tables. */ entryPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + 184)).FfindProc})))(tls, *(*uintptr)(unsafe.Pointer(bp + 32))+184, *(*uintptr)(unsafe.Pointer(bp))) if entryPtr != libc.UintptrFromInt32(0) { if specificNsInPattern != 0 { cmd = (*TTcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { elemObjPtr = XTclThreadAllocObj(tls) } else { elemObjPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(elemObjPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_GetCommandFullName(tls, interp, cmd, elemObjPtr) } else { if (*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))+184)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))+184)).FkeyType == -int32(1) { v3 = *(*uintptr)(unsafe.Pointer(entryPtr + 32)) } else { v3 = entryPtr + 32 } cmdName = v3 elemObjPtr = XTcl_NewStringObj(tls, cmdName, int64(-int32(1))) } XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr) XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } if *(*uintptr)(unsafe.Pointer(bp + 32)) != globalNsPtr && !(specificNsInPattern != 0) { tablePtr = libc.UintptrFromInt32(0) /* Quell warning. */ i = 0 for { if !(i < (*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FcommandPathLength) { break } pathNsPtr = (*(*TNamespacePathEntry)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FcommandPathArray + uintptr(i)*32))).FnsPtr if pathNsPtr == libc.UintptrFromInt32(0) { goto _4 } tablePtr = pathNsPtr + 184 entryPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(tablePtr)).FfindProc})))(tls, tablePtr, *(*uintptr)(unsafe.Pointer(bp))) if entryPtr != libc.UintptrFromInt32(0) { break } goto _4 _4: ; i++ } if entryPtr == libc.UintptrFromInt32(0) { tablePtr = globalNsPtr + 184 entryPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(tablePtr)).FfindProc})))(tls, tablePtr, *(*uintptr)(unsafe.Pointer(bp))) } if entryPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(tablePtr)).FkeyType == -int32(1) { v5 = *(*uintptr)(unsafe.Pointer(entryPtr + 32)) } else { v5 = entryPtr + 32 } cmdName = v5 XTcl_ListObjAppendElement(tls, interp, listPtr, XTcl_NewStringObj(tls, cmdName, int64(-int32(1)))) XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } } } else { if (*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FcommandPathLength == 0 || specificNsInPattern != 0 { /* * The pattern is non-trivial, but either there is no explicit path or * there is an explicit namespace in the pattern. In both cases, the * old matching scheme is perfect. */ entryPtr = XTcl_FirstHashEntry(tls, *(*uintptr)(unsafe.Pointer(bp + 32))+184, bp+8) for entryPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))+184)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))+184)).FkeyType == -int32(1) { v6 = *(*uintptr)(unsafe.Pointer(entryPtr + 32)) } else { v6 = entryPtr + 32 } cmdName = v6 if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) || XTcl_StringCaseMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp)), 0) != 0 { if specificNsInPattern != 0 { cmd = (*TTcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData if v7 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v7 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v7 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { elemObjPtr = XTclThreadAllocObj(tls) } else { elemObjPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(elemObjPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_GetCommandFullName(tls, interp, cmd, elemObjPtr) } else { elemObjPtr = XTcl_NewStringObj(tls, cmdName, int64(-int32(1))) } XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr) } entryPtr = XTcl_NextHashEntry(tls, bp+8) } /* * If the effective namespace isn't the global :: namespace, and a * specific namespace wasn't requested in the pattern, then add in all * global :: commands that match the simple pattern. Of course, we add * in only those commands that aren't hidden by a command in the * effective namespace. */ if *(*uintptr)(unsafe.Pointer(bp + 32)) != globalNsPtr && !(specificNsInPattern != 0) { entryPtr = XTcl_FirstHashEntry(tls, globalNsPtr+184, bp+8) for entryPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer(globalNsPtr+184)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(globalNsPtr+184)).FkeyType == -int32(1) { v8 = *(*uintptr)(unsafe.Pointer(entryPtr + 32)) } else { v8 = entryPtr + 32 } cmdName = v8 if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) || XTcl_StringCaseMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp)), 0) != 0 { if (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + 184)).FfindProc})))(tls, *(*uintptr)(unsafe.Pointer(bp + 32))+184, cmdName) == libc.UintptrFromInt32(0) { XTcl_ListObjAppendElement(tls, interp, listPtr, XTcl_NewStringObj(tls, cmdName, int64(-int32(1)))) } } entryPtr = XTcl_NextHashEntry(tls, bp+8) } } } else { foundGlobal = libc.BoolInt32(*(*uintptr)(unsafe.Pointer(bp + 32)) == globalNsPtr) /* * We keep a hash of the objects already added to the result list. */ XTcl_InitObjHashTable(tls, bp+56) entryPtr = XTcl_FirstHashEntry(tls, *(*uintptr)(unsafe.Pointer(bp + 32))+184, bp+8) for entryPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))+184)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))+184)).FkeyType == -int32(1) { v9 = *(*uintptr)(unsafe.Pointer(entryPtr + 32)) } else { v9 = entryPtr + 32 } cmdName = v9 if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) || XTcl_StringCaseMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp)), 0) != 0 { elemObjPtr = XTcl_NewStringObj(tls, cmdName, int64(-int32(1))) XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr) (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(bp + 56)).FcreateProc})))(tls, bp+56, elemObjPtr, bp+160) } entryPtr = XTcl_NextHashEntry(tls, bp+8) } /* * Search the path next. */ i = 0 for { if !(i < (*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FcommandPathLength) { break } pathNsPtr1 = (*(*TNamespacePathEntry)(unsafe.Pointer((*TNamespace)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).FcommandPathArray + uintptr(i)*32))).FnsPtr if pathNsPtr1 == libc.UintptrFromInt32(0) { goto _10 } if pathNsPtr1 == globalNsPtr { foundGlobal = int32(1) } entryPtr = XTcl_FirstHashEntry(tls, pathNsPtr1+184, bp+8) for entryPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer(pathNsPtr1+184)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(pathNsPtr1+184)).FkeyType == -int32(1) { v11 = *(*uintptr)(unsafe.Pointer(entryPtr + 32)) } else { v11 = entryPtr + 32 } cmdName = v11 if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) || XTcl_StringCaseMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp)), 0) != 0 { elemObjPtr = XTcl_NewStringObj(tls, cmdName, int64(-int32(1))) (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(bp + 56)).FcreateProc})))(tls, bp+56, elemObjPtr, bp+160) if *(*int32)(unsafe.Pointer(bp + 160)) != 0 { XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr) } else { v13 = elemObjPtr v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if !(v12 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v14 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v14 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v14 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, elemObjPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(elemObjPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = elemObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, elemObjPtr) } } } } entryPtr = XTcl_NextHashEntry(tls, bp+8) } goto _10 _10: ; i++ } /* * If the effective namespace isn't the global :: namespace, and a * specific namespace wasn't requested in the pattern, then add in all * global :: commands that match the simple pattern. Of course, we add * in only those commands that aren't hidden by a command in the * effective namespace. */ if !(foundGlobal != 0) { entryPtr = XTcl_FirstHashEntry(tls, globalNsPtr+184, bp+8) for entryPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer(globalNsPtr+184)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(globalNsPtr+184)).FkeyType == -int32(1) { v15 = *(*uintptr)(unsafe.Pointer(entryPtr + 32)) } else { v15 = entryPtr + 32 } cmdName = v15 if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) || XTcl_StringCaseMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp)), 0) != 0 { elemObjPtr = XTcl_NewStringObj(tls, cmdName, int64(-int32(1))) if (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(bp + 56)).FfindProc})))(tls, bp+56, elemObjPtr) == libc.UintptrFromInt32(0) { XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr) } else { v17 = elemObjPtr v16 = *(*TTcl_Size)(unsafe.Pointer(v17)) *(*TTcl_Size)(unsafe.Pointer(v17))-- if !(v16 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v18 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v18 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v18 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, elemObjPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(elemObjPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = elemObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, elemObjPtr) } } } } entryPtr = XTcl_NextHashEntry(tls, bp+8) } } XTcl_DeleteHashTable(tls, bp+56) } } XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * InfoCompleteCmd -- * * Called to implement the "info complete" command that determines * whether a string is a complete Tcl command. Handles the following * syntax: * * info complete command * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoCompleteCmd(tls *libc.TLS, dummy913 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16416) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(XTclObjCommandComplete(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) != 0))) return TCL_OK } /* *---------------------------------------------------------------------- * * InfoDefaultCmd -- * * Called to implement the "info default" command that returns the * default value for a procedure argument. Handles the following syntax: * * info default procName arg varName * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoDefaultCmd(tls *libc.TLS, dummy950 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Argument objects. */ var argName, cachePtr, iPtr, localPtr, nullObjPtr, procName, procPtr, valueObjPtr, v1, v2 uintptr var v4 bool _, _, _, _, _, _, _, _, _, _, _ = argName, cachePtr, iPtr, localPtr, nullObjPtr, procName, procPtr, valueObjPtr, v1, v2, v4 iPtr = interp if objc != int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16424) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } procName = v1 if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), libc.UintptrFromInt32(0)) } argName = v2 procPtr = XTclFindProc(tls, iPtr, procName) if procPtr == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+16368, libc.VaList(bp+8, procName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+16391, procName, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } localPtr = (*TProc)(unsafe.Pointer(procPtr)).FfirstLocalPtr for { if !(localPtr != libc.UintptrFromInt32(0)) { break } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_ARGUMENT) != 0 && libc.Xstrcmp(tls, argName, localPtr+44) == 0 { if (*TCompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr != libc.UintptrFromInt32(0) { valueObjPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), libc.UintptrFromInt32(0), (*TCompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr, int32(TCL_LEAVE_ERR_MSG)) if valueObjPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(int32(1) != 0))) } else { if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { nullObjPtr = XTclThreadAllocObj(tls) } else { nullObjPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(nullObjPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(nullObjPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(nullObjPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(nullObjPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(nullObjPtr)).FtypePtr = libc.UintptrFromInt32(0) valueObjPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), libc.UintptrFromInt32(0), nullObjPtr, int32(TCL_LEAVE_ERR_MSG)) if valueObjPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(0 != 0))) } return TCL_OK } goto _3 _3: ; localPtr = (*TCompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+16445, libc.VaList(bp+8, procName, argName))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+16490, argName, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * InfoErrorStackCmd -- * * Called to implement the "info errorstack" command that returns information * about the last error's call stack. Handles the following syntax: * * info errorstack ?interp? * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoErrorStackCmd(tls *libc.TLS, dummy1033 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var iPtr, target, v1 uintptr _, _, _ = iPtr, target, v1 if objc != int32(1) && objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16499) return int32(TCL_ERROR) } target = interp if objc == int32(2) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } target = XTcl_GetChild(tls, interp, v1) if target == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } iPtr = target XTcl_SetObjResult(tls, interp, (*TInterp)(unsafe.Pointer(iPtr)).FerrorStack) return TCL_OK } /* *---------------------------------------------------------------------- * * TclInfoExistsCmd -- * * Called to implement the "info exists" command that determines whether * a variable exists. Handles the following syntax: * * info exists varName * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func XTclInfoExistsCmd(tls *libc.TLS, dummy1082 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var varName, varPtr, v1 uintptr _, _, _ = varName, varPtr, v1 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16508) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } varName = v1 varPtr = XTclVarTraceExists(tls, interp, varName) XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(libc.BoolInt32(varPtr != 0 && *(*uintptr)(unsafe.Pointer(varPtr + 8)) != 0) != 0))) return TCL_OK } /* *---------------------------------------------------------------------- * * InfoFrameCmd -- * TIP #280 * * Called to implement the "info frame" command that returns the location * of either the currently executing command, or its caller. Handles the * following syntax: * * info frame ?number? * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoFrameCmd(tls *libc.TLS, dummy1127 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Argument objects. */ var cmdFramePtrPtr, corPtr, endPtr, framePtr, iPtr, runPtr, v5, v6 uintptr var code, topLevel, v1, v2, v3, v7 int32 var _ /* level at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cmdFramePtrPtr, code, corPtr, endPtr, framePtr, iPtr, runPtr, topLevel, v1, v2, v3, v5, v6, v7 iPtr = interp code = TCL_OK cmdFramePtrPtr = iPtr + 720 corPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).FcorPtr topLevel = 0 if objc > int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16516) return int32(TCL_ERROR) } for corPtr != 0 { for *(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) != 0 { topLevel++ cmdFramePtrPtr = *(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) + 32 } if (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr != 0 { *(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr } corPtr = (*TExecEnv1)(unsafe.Pointer((*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr)).FcorPtr } if *(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) != 0 { v1 = (*TCmdFrame)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)))).Flevel } else { v1 = int32(1) } topLevel += v1 if (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr != 0 && topLevel != (*TCmdFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).Flevel { framePtr = (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr for framePtr != 0 { v2 = topLevel topLevel-- (*TCmdFrame)(unsafe.Pointer(framePtr)).Flevel = v2 framePtr = (*TCmdFrame)(unsafe.Pointer(framePtr)).FnextPtr } if topLevel != 0 { XTcl_Panic(tls, __ccgo_ts+16525, 0) } topLevel = (*TCmdFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr)).Flevel } if objc == int32(1) { /* * Just "info frame". */ XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64(topLevel))) goto done } /* * We've got "info frame level" and must parse the level first. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FinternalRep))) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } if v3 != TCL_OK { code = int32(TCL_ERROR) goto done } if !(*(*int32)(unsafe.Pointer(bp)) > topLevel || *(*int32)(unsafe.Pointer(bp)) <= -topLevel) { goto _4 } goto levelError levelError: ; if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v5 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v5 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+16556, libc.VaList(bp+16, v5))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v6 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+16571, v6, libc.UintptrFromInt32(0))) code = int32(TCL_ERROR) goto done _4: ; /* * Let us convert to relative so that we know how many levels to go back */ if *(*int32)(unsafe.Pointer(bp)) > 0 { *(*int32)(unsafe.Pointer(bp)) -= topLevel } framePtr = (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr for { *(*int32)(unsafe.Pointer(bp))++ v7 = *(*int32)(unsafe.Pointer(bp)) if !(v7 <= 0) { break } framePtr = (*TCmdFrame)(unsafe.Pointer(framePtr)).FnextPtr if !(framePtr != 0) { goto levelError } } XTcl_SetObjResult(tls, interp, XTclInfoFrame(tls, interp, framePtr)) goto done done: ; cmdFramePtrPtr = iPtr + 720 corPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FexecEnvPtr)).FcorPtr for corPtr != 0 { endPtr = (*TCoroutineData)(unsafe.Pointer(corPtr)).Fcaller.FcmdFramePtr if endPtr != 0 { if *(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) == endPtr { *(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) = libc.UintptrFromInt32(0) } else { runPtr = *(*uintptr)(unsafe.Pointer(cmdFramePtrPtr)) for (*TCmdFrame)(unsafe.Pointer(runPtr)).FnextPtr != endPtr { *(*int32)(unsafe.Pointer(runPtr + 4)) -= (*TCmdFrame)(unsafe.Pointer(endPtr)).Flevel runPtr = (*TCmdFrame)(unsafe.Pointer(runPtr)).FnextPtr } (*TCmdFrame)(unsafe.Pointer(runPtr)).Flevel = int32(1) (*TCmdFrame)(unsafe.Pointer(runPtr)).FnextPtr = libc.UintptrFromInt32(0) } cmdFramePtrPtr = corPtr + 24 + 16 } corPtr = (*TExecEnv1)(unsafe.Pointer((*TCoroutineData)(unsafe.Pointer(corPtr)).FcallerEEPtr)).FcorPtr } return code } /* *---------------------------------------------------------------------- * * TclInfoFrame -- * * Core of InfoFrameCmd, returns TIP280 dict for a given frame. * * Results: * Returns TIP280 dict. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclInfoFrame(tls *libc.TLS, interp uintptr, framePtr uintptr) (r uintptr) { bp := tls.Alloc(160) defer tls.Free(160) /* Frame to get info for. */ var _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr13, cachePtr14, cachePtr15, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, current, efiPtr, fPtr, iPtr, idx, namePtr, procNameObj, procPtr, tmpObj, top, v1, v33, v62 uintptr var c, lc, needsFree, t, v10, v12, v13, v15, v16, v18, v19, v21, v22, v24, v25, v27, v28, v30, v31, v35, v36, v38, v39, v41, v42, v44, v45, v47, v48, v51, v52, v54, v55, v56, v59, v60, v9 int32 var i, v32, v61 TTcl_Size var v11, v14, v17, v20, v23, v26, v29, v34, v37, v40, v43, v46, v49, v50, v58, v8 bool var _ /* lv at bp+0 */ [20]uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, c, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr13, cachePtr14, cachePtr15, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, current, efiPtr, fPtr, i, iPtr, idx, lc, namePtr, needsFree, procNameObj, procPtr, t, tmpObj, top, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v54, v55, v56, v58, v59, v60, v61, v62, v8, v9 iPtr = interp *(*[20]uintptr)(unsafe.Pointer(bp)) = [20]uintptr{} /* Keep uptodate when more keys are added to * the dict. */ lc = 0 procPtr = libc.UintptrFromInt32(0) needsFree = -int32(1) if !(framePtr != 0) { goto precompiled } if (*TCmdFrame)(unsafe.Pointer(framePtr)).FframePtr != 0 { v1 = (*TCallFrame)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(framePtr)).FframePtr)).FprocPtr } else { v1 = libc.UintptrFromInt32(0) } procPtr = v1 /* * Pull the information and construct the dictionary to return, as list. * Regarding use of the CmdFrame fields see tclInt.h, and its definition. */ switch (*TCmdFrame)(unsafe.Pointer(framePtr)).Ftype1 { case TCL_LOCATION_EVAL: goto _2 case int32(TCL_LOCATION_PREBC): goto _3 case int32(TCL_LOCATION_BC): goto _4 case int32(TCL_LOCATION_SOURCE): goto _5 case int32(TCL_LOCATION_PROC): goto _6 } goto _7 _2: ; /* * Evaluation, dynamic script. Type, line, cmd, the latter through * str. */ if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+5851, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v9 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v9] = tmpObj v10 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v10] = XTcl_NewStringObj(tls, _typeString[(*TCmdFrame)(unsafe.Pointer(framePtr)).Ftype1], int64(-int32(1))) if (*TCmdFrame)(unsafe.Pointer(framePtr)).Fline != 0 { if v11 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v11 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v11 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+16589, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v12 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v12] = tmpObj v13 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v13] = XTcl_NewWideIntObj(tls, *(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(framePtr)).Fline))) } else { if v14 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v14 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v14 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+16589, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v15 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v15] = tmpObj v16 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v16] = XTcl_NewWideIntObj(tls, int64(1)) } if v17 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v17 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v17 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+16594, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v18 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v18] = tmpObj v19 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v19] = XTclGetSourceFromFrame(tls, framePtr, 0, libc.UintptrFromInt32(0)) goto _7 _3: ; goto precompiled precompiled: ; /* * Precompiled. Result contains the type as signal, nothing else. */ if v20 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v20 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v20 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+5851, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v21 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v21] = tmpObj v22 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v22] = XTcl_NewStringObj(tls, _typeString[int32(TCL_LOCATION_PREBC)], int64(-int32(1))) goto _7 _4: ; /* * Execution of bytecode. Talk to the BC engine to fill out the frame. */ fPtr = XTclStackAlloc(tls, interp, uint64(88)) *(*TCmdFrame)(unsafe.Pointer(fPtr)) = *(*TCmdFrame)(unsafe.Pointer(framePtr)) /* * Note: * Type BC => f.data.eval.path is not used. * f.data.tebc.codePtr is used instead. */ XTclGetSrcInfoForPc(tls, fPtr) /* * Now filled: cmd.str.(cmd,len), line * Possibly modified: type, path! */ if v23 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v23 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v23 || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+5851, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v24 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v24] = tmpObj v25 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v25] = XTcl_NewStringObj(tls, _typeString[(*TCmdFrame)(unsafe.Pointer(fPtr)).Ftype1], int64(-int32(1))) if (*TCmdFrame)(unsafe.Pointer(fPtr)).Fline != 0 { if v26 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v26 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v26 || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+16589, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v27 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v27] = tmpObj v28 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v28] = XTcl_NewWideIntObj(tls, *(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(fPtr)).Fline))) } if (*TCmdFrame)(unsafe.Pointer(fPtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { if v29 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v29 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v29 || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+5636, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v30 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v30] = tmpObj v31 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v31] = (*TCmdFrame)(unsafe.Pointer(fPtr)).Fdata.Feval.Fpath /* * Death of reference by TclGetSrcInfoForPc. */ _objPtr = (*TCmdFrame)(unsafe.Pointer(fPtr)).Fdata.Feval.Fpath v33 = _objPtr v32 = *(*TTcl_Size)(unsafe.Pointer(v33)) *(*TTcl_Size)(unsafe.Pointer(v33))-- if v32 <= int64(1) { XTclFreeObj(tls, _objPtr) } } if v34 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v34 { cachePtr8 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v34 || (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+16594, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v35 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v35] = tmpObj v36 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v36] = XTclGetSourceFromFrame(tls, fPtr, 0, libc.UintptrFromInt32(0)) if (*TCmdFrame)(unsafe.Pointer(fPtr)).FcmdObj != 0 && (*TCmdFrame)(unsafe.Pointer(framePtr)).FcmdObj == libc.UintptrFromInt32(0) { needsFree = lc - int32(1) } XTclStackFree(tls, interp, fPtr) goto _7 _5: ; /* * Evaluation of a script file. */ if v37 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v37 { cachePtr9 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v37 || (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+5851, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v38 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v38] = tmpObj v39 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v39] = XTcl_NewStringObj(tls, _typeString[(*TCmdFrame)(unsafe.Pointer(framePtr)).Ftype1], int64(-int32(1))) if v40 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v40 { cachePtr10 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v40 || (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+16589, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v41 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v41] = tmpObj v42 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v42] = XTcl_NewWideIntObj(tls, *(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(framePtr)).Fline))) if v43 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v43 { cachePtr11 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v43 || (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+5636, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v44 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v44] = tmpObj v45 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v45] = (*TCmdFrame)(unsafe.Pointer(framePtr)).Fdata.Feval.Fpath /* * Refcount framePtr->data.eval.path goes up when lv is converted into * the result list object. */ if v46 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v46 { cachePtr12 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v46 || (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+16594, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v47 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v47] = tmpObj v48 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v48] = XTclGetSourceFromFrame(tls, framePtr, 0, libc.UintptrFromInt32(0)) goto _7 _6: ; XTcl_Panic(tls, __ccgo_ts+16598, 0) goto _7 _7: ; /* * 'proc'. Common to all frame types. Conditional on having an associated * Procedure CallFrame. */ if procPtr != libc.UintptrFromInt32(0) { namePtr = (*TCommand1)(unsafe.Pointer((*TProc)(unsafe.Pointer(procPtr)).FcmdPtr)).FhPtr if namePtr != 0 { /* * This is a regular command. */ if v49 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v49 { cachePtr13 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v49 || (*TAllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects == libc.Uint64FromInt32(0) { procNameObj = XTclThreadAllocObj(tls) } else { procNameObj = (*TAllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(procNameObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(procNameObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(procNameObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(procNameObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(procNameObj)).FtypePtr = libc.UintptrFromInt32(0) XTcl_GetCommandFullName(tls, interp, (*TProc)(unsafe.Pointer(procPtr)).FcmdPtr, procNameObj) if v50 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v50 { cachePtr14 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v50 || (*TAllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+5352, libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v51 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v51] = tmpObj v52 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v52] = procNameObj } else { if (*TCommand1)(unsafe.Pointer((*TProc)(unsafe.Pointer(procPtr)).FcmdPtr)).FclientData != 0 { efiPtr = (*TCommand1)(unsafe.Pointer((*TProc)(unsafe.Pointer(procPtr)).FcmdPtr)).FclientData /* * This is a non-standard command. Luckily, it's told us how to * render extra information about its frame. */ i = 0 for { if !(i < (*TExtraFrameInfo)(unsafe.Pointer(efiPtr)).Flength) { break } v54 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v54] = XTcl_NewStringObj(tls, (*(*TExtraFrameInfoField)(unsafe.Pointer(efiPtr + 8 + uintptr(i)*24))).Fname, int64(-int32(1))) if (*(*TExtraFrameInfoField)(unsafe.Pointer(efiPtr + 8 + uintptr(i)*24))).Fproc != 0 { v55 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v55] = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*(*TExtraFrameInfoField)(unsafe.Pointer(efiPtr + 8 + uintptr(i)*24))).Fproc})))(tls, (*(*TExtraFrameInfoField)(unsafe.Pointer(efiPtr + 8 + uintptr(i)*24))).FclientData) } else { v56 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v56] = (*(*TExtraFrameInfoField)(unsafe.Pointer(efiPtr + 8 + uintptr(i)*24))).FclientData } goto _53 _53: ; i++ } } } } /* * 'level'. Common to all frame types. Conditional on having an associated * _visible_ CallFrame. */ if framePtr != 0 && (*TCmdFrame)(unsafe.Pointer(framePtr)).FframePtr != libc.UintptrFromInt32(0) && (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr != libc.UintptrFromInt32(0) { current = (*TCmdFrame)(unsafe.Pointer(framePtr)).FframePtr top = (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr idx = top for { if !(idx != libc.UintptrFromInt32(0)) { break } if idx == current { c = int32((*TCallFrame)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(framePtr)).FframePtr)).Flevel) t = int32((*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel) if v58 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v58 { cachePtr15 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v58 || (*TAllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 if libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes, __ccgo_ts+16095, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes + uintptr(libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(6) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) v59 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v59] = tmpObj v60 = lc lc++ (*(*[20]uintptr)(unsafe.Pointer(bp)))[v60] = XTcl_NewWideIntObj(tls, int64(t-c)) break } goto _57 _57: ; idx = (*TCallFrame)(unsafe.Pointer(idx)).FcallerVarPtr } } tmpObj = XTcl_NewListObj(tls, int64(lc), bp) if needsFree >= 0 { _objPtr1 = (*(*[20]uintptr)(unsafe.Pointer(bp)))[needsFree] v62 = _objPtr1 v61 = *(*TTcl_Size)(unsafe.Pointer(v62)) *(*TTcl_Size)(unsafe.Pointer(v62))-- if v61 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } return tmpObj } /* * This array is indexed by the TCL_LOCATION_... values, except * for _LAST. */ var _typeString = [6]uintptr{ 0: __ccgo_ts + 2464, 1: __ccgo_ts + 2464, 2: __ccgo_ts + 2464, 3: __ccgo_ts + 16577, 4: __ccgo_ts + 5569, 5: __ccgo_ts + 5352, } /* *---------------------------------------------------------------------- * * InfoFunctionsCmd -- * * Called to implement the "info functions" command that returns the list * of math functions matching an optional pattern. Handles the following * syntax: * * info functions ?pattern? * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoFunctionsCmd(tls *libc.TLS, dummy1472 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var _objPtr, _objPtr1, arg, script, v2, v4 uintptr var code int32 var v1, v3 TTcl_Size _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, arg, code, script, v1, v2, v3, v4 if objc > int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16401) return int32(TCL_ERROR) } script = XTcl_NewStringObj(tls, __ccgo_ts+16640, int64(-int32(1))) if objc == int32(2) { arg = XTcl_NewListObj(tls, int64(1), objv+1*8) XTcl_AppendObjToObj(tls, script, arg) _objPtr = arg v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } (*TTcl_Obj)(unsafe.Pointer(script)).FrefCount++ code = XTcl_EvalObjEx(tls, interp, script, 0) _objPtr1 = script v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return code } /* *---------------------------------------------------------------------- * * InfoHostnameCmd -- * * Called to implement the "info hostname" command that returns the host * name. Handles the following syntax: * * info hostname * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoHostnameCmd(tls *libc.TLS, dummy1537 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Argument objects. */ var name uintptr _ = name if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } name = XTcl_GetHostName(tls) if name != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, name, int64(-int32(1)))) return TCL_OK } XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17016, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+17049, __ccgo_ts+2095, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * InfoLevelCmd -- * * Called to implement the "info level" command that returns information * about the call stack. Handles the following syntax: * * info level ?number? * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoLevelCmd(tls *libc.TLS, dummy1583 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Argument objects. */ var framePtr, iPtr, rootFramePtr, v3, v4 uintptr var v1 int32 var _ /* level at bp+0 */ int32 _, _, _, _, _, _ = framePtr, iPtr, rootFramePtr, v1, v3, v4 iPtr = interp if objc == int32(1) { /* Just "info level" */ XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64(int32((*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel)))) return TCL_OK } if objc == int32(2) { rootFramePtr = (*TInterp)(unsafe.Pointer(iPtr)).FrootFramePtr if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FinternalRep))) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp)) <= 0 { if (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr == rootFramePtr { goto levelError } *(*int32)(unsafe.Pointer(bp)) = int32(int64(*(*int32)(unsafe.Pointer(bp))) + (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).Flevel) } framePtr = (*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr for { if !(framePtr != rootFramePtr) { break } if int32((*TCallFrame)(unsafe.Pointer(framePtr)).Flevel) == *(*int32)(unsafe.Pointer(bp)) { break } goto _2 _2: ; framePtr = (*TCallFrame)(unsafe.Pointer(framePtr)).FcallerVarPtr } if framePtr == rootFramePtr { goto levelError } XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, (*TCallFrame)(unsafe.Pointer(framePtr)).Fobjc, (*TCallFrame)(unsafe.Pointer(framePtr)).Fobjv)) return TCL_OK } XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16516) return int32(TCL_ERROR) goto levelError levelError: ; if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+16556, libc.VaList(bp+16, v3))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v4 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v4 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+16571, v4, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * InfoLibraryCmd -- * * Called to implement the "info library" command that returns the * library directory for the Tcl installation. Handles the following * syntax: * * info library * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoLibraryCmd(tls *libc.TLS, dummy1657 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Argument objects. */ var libDirName uintptr _ = libDirName if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } libDirName = XTcl_GetVar2(tls, interp, __ccgo_ts+17058, libc.UintptrFromInt32(0), int32(TCL_GLOBAL_ONLY)) if libDirName != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, libDirName, int64(-int32(1)))) return TCL_OK } XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17070, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+17108, __ccgo_ts+17058, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * InfoLoadedCmd -- * * Called to implement the "info loaded" command that returns the * packages that have been loaded into an interpreter. Handles the * following syntax: * * info loaded ?interp? * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoLoadedCmd(tls *libc.TLS, dummy1704 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var interpName, prefix, v1, v2 uintptr _, _, _, _ = interpName, prefix, v1, v2 if objc > int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17117) return int32(TCL_ERROR) } if objc < int32(2) { /* Get loaded pkgs in all interpreters. */ interpName = libc.UintptrFromInt32(0) } else { /* Get pkgs just in specified interp. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } interpName = v1 } if objc < int32(3) { /* Get loaded files in all packages. */ prefix = libc.UintptrFromInt32(0) } else { /* Get pkgs just in specified interp. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), libc.UintptrFromInt32(0)) } prefix = v2 } return XTclGetLoadedLibraries(tls, interp, interpName, prefix) } /* *---------------------------------------------------------------------- * * InfoNameOfExecutableCmd -- * * Called to implement the "info nameofexecutable" command that returns * the name of the binary file running this application. Handles the * following syntax: * * info nameofexecutable * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoNameOfExecutableCmd(tls *libc.TLS, dummy1752 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTclGetObjNameOfExecutable(tls)) return TCL_OK } /* *---------------------------------------------------------------------- * * InfoPatchLevelCmd -- * * Called to implement the "info patchlevel" command that returns the * default value for an argument to a procedure. Handles the following * syntax: * * info patchlevel * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoPatchLevelCmd(tls *libc.TLS, dummy1788 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var patchlevel uintptr _ = patchlevel if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } patchlevel = XTcl_GetVar2(tls, interp, __ccgo_ts+7204, libc.UintptrFromInt32(0), libc.Int32FromInt32(TCL_GLOBAL_ONLY)|libc.Int32FromInt32(TCL_LEAVE_ERR_MSG)) if patchlevel != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, patchlevel, int64(-int32(1)))) return TCL_OK } return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * InfoProcsCmd -- * * Called to implement the "info procs" command that returns the list of * procedures in the interpreter that match an optional pattern. The * pattern, if any, consists of an optional sequence of namespace names * separated by "::" qualifiers, which is followed by a glob-style * pattern that restricts which commands are returned. Handles the * following syntax: * * info procs ?pattern? * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoProcsCmd(tls *libc.TLS, dummy1835 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Argument objects. */ var cachePtr, cachePtr1, cmdName, cmdPtr, currNsPtr, elemObjPtr, entryPtr, listPtr, pattern, realCmdPtr, v1, v5 uintptr var specificNsInPattern int32 var v4, v8 bool var _ /* dummy1NsPtr at bp+40 */ uintptr var _ /* dummy2NsPtr at bp+48 */ uintptr var _ /* nsPtr at bp+8 */ uintptr var _ /* search at bp+16 */ TTcl_HashSearch var _ /* simplePattern at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cmdName, cmdPtr, currNsPtr, elemObjPtr, entryPtr, listPtr, pattern, realCmdPtr, specificNsInPattern, v1, v4, v5, v8 currNsPtr = XTcl_GetCurrentNamespace(tls, interp) specificNsInPattern = 0 /* * Get the pattern and find the "effective namespace" in which to list * procs. */ if objc == int32(1) { *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = currNsPtr specificNsInPattern = 0 } else { if objc == int32(2) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } pattern = v1 XTclGetNamespaceForQualName(tls, interp, pattern, libc.UintptrFromInt32(0), 0, bp+8, bp+40, bp+48, bp) if *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { /* We successfully found the pattern's ns. */ specificNsInPattern = libc.BoolInt32(libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(bp)), pattern) != 0) } } else { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+16401) return int32(TCL_ERROR) } } if *(*uintptr)(unsafe.Pointer(bp + 8)) == libc.UintptrFromInt32(0) { return TCL_OK } /* * Scan through the effective namespace's command table and create a list * with all procs that match the pattern. If a specific namespace was * requested in the pattern, qualify the command names with the namespace * name. */ listPtr = XTcl_NewListObj(tls, 0, libc.UintptrFromInt32(0)) if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) && libc.Xstrpbrk(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16411) == libc.UintptrFromInt32(0) { entryPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 184)).FfindProc})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8))+184, *(*uintptr)(unsafe.Pointer(bp))) if entryPtr != libc.UintptrFromInt32(0) { cmdPtr = (*TTcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData if !!(XTclIsProc(tls, cmdPtr) != 0) { goto _2 } realCmdPtr = XTclGetOriginalCommand(tls, cmdPtr) if realCmdPtr != libc.UintptrFromInt32(0) && XTclIsProc(tls, realCmdPtr) != 0 { goto simpleProcOK } goto _3 _2: ; goto simpleProcOK simpleProcOK: ; if specificNsInPattern != 0 { if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { elemObjPtr = XTclThreadAllocObj(tls) } else { elemObjPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(elemObjPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_GetCommandFullName(tls, interp, cmdPtr, elemObjPtr) } else { elemObjPtr = XTcl_NewStringObj(tls, *(*uintptr)(unsafe.Pointer(bp)), int64(-int32(1))) } XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr) _3: } } else { entryPtr = XTcl_FirstHashEntry(tls, *(*uintptr)(unsafe.Pointer(bp + 8))+184, bp+16) for entryPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))+184)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))+184)).FkeyType == -int32(1) { v5 = *(*uintptr)(unsafe.Pointer(entryPtr + 32)) } else { v5 = entryPtr + 32 } cmdName = v5 if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) || XTcl_StringCaseMatch(tls, cmdName, *(*uintptr)(unsafe.Pointer(bp)), 0) != 0 { cmdPtr = (*TTcl_HashEntry)(unsafe.Pointer(entryPtr)).FclientData if !!(XTclIsProc(tls, cmdPtr) != 0) { goto _6 } realCmdPtr = XTclGetOriginalCommand(tls, cmdPtr) if realCmdPtr != libc.UintptrFromInt32(0) && XTclIsProc(tls, realCmdPtr) != 0 { goto procOK } goto _7 _6: ; goto procOK procOK: ; if specificNsInPattern != 0 { if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { elemObjPtr = XTclThreadAllocObj(tls) } else { elemObjPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(elemObjPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(elemObjPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_GetCommandFullName(tls, interp, cmdPtr, elemObjPtr) } else { elemObjPtr = XTcl_NewStringObj(tls, cmdName, int64(-int32(1))) } XTcl_ListObjAppendElement(tls, interp, listPtr, elemObjPtr) _7: } entryPtr = XTcl_NextHashEntry(tls, bp+16) } } XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * InfoScriptCmd -- * * Called to implement the "info script" command that returns the script * file that is currently being evaluated. Handles the following syntax: * * info script ?newName? * * If newName is specified, it will set that as the internal name. * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. It may change the internal * script filename. * *---------------------------------------------------------------------- */ func _InfoScriptCmd(tls *libc.TLS, dummy1976 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var _objPtr, iPtr, v2 uintptr var v1 TTcl_Size _, _, _, _ = _objPtr, iPtr, v1, v2 iPtr = interp if objc != int32(1) && objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17135) return int32(TCL_ERROR) } if objc == int32(2) { if (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile != libc.UintptrFromInt32(0) { _objPtr = (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile = *(*uintptr)(unsafe.Pointer(objv + 1*8)) (*TTcl_Obj)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FscriptFile)).FrefCount++ } if (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile) } return TCL_OK } /* *---------------------------------------------------------------------- * * InfoSharedlibCmd -- * * Called to implement the "info sharedlibextension" command that returns * the file extension used for shared libraries. Handles the following * syntax: * * info sharedlibextension * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoSharedlibCmd(tls *libc.TLS, dummy2024 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+1945, int64(-int32(1)))) return TCL_OK } /* *---------------------------------------------------------------------- * * InfoTclVersionCmd -- * * Called to implement the "info tclversion" command that returns the * version number for this Tcl library. Handles the following syntax: * * info tclversion * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a result in the interpreter's result object. If there is an * error, the result is an error message. * *---------------------------------------------------------------------- */ func _InfoTclVersionCmd(tls *libc.TLS, dummy2062 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var version uintptr _ = version if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } version = XTcl_GetVar2Ex(tls, interp, __ccgo_ts+7225, libc.UintptrFromInt32(0), libc.Int32FromInt32(TCL_GLOBAL_ONLY)|libc.Int32FromInt32(TCL_LEAVE_ERR_MSG)) if version != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, version) return TCL_OK } return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * InfoCmdTypeCmd -- * * Called to implement the "info cmdtype" command that returns the type * of a given command. Handles the following syntax: * * info cmdtype cmdName * * Results: * Returns TCL_OK if successful and TCL_ERROR if there is an error. * * Side effects: * Returns a type name. If there is an error, the result is an error * message. * *---------------------------------------------------------------------- */ func _InfoCmdTypeCmd(tls *libc.TLS, dummy2105 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument objects. */ var command TTcl_Command var v1 uintptr _, _ = command, v1 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17146) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } command = XTcl_FindCommand(tls, interp, v1, libc.UintptrFromInt32(0), int32(TCL_LEAVE_ERR_MSG)) if command == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * There's one special case: safe child interpreters can't see aliases as * aliases as they're part of the security mechanisms. */ if XTcl_IsSafe(tls, interp) != 0 && (*TCommand)(unsafe.Pointer(command)).FobjProc == __ccgo_fp(XTclAliasObjCmd) { XTcl_AppendResult(tls, interp, libc.VaList(bp+8, __ccgo_ts+7266, libc.UintptrFromInt32(0))) } else { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, XTclGetCommandTypeName(tls, command), int64(-int32(1)))) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_JoinObjCmd -- * * This procedure is invoked to process the "join" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_JoinObjCmd(tls *libc.TLS, dummy2156 uintptr, interp2 uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* The argument objects. */ var _objPtr, cachePtr, joinObjPtr, proc, proc1, proc2, resObjPtr, v1, v15, v16, v19, v2, v24, v3, v7, v8 uintptr var i, v23, v4 TTcl_Size var isAbstractList, v12, v17, v6, v9 int32 var v11, v21 bool var v13, v14 int64 var _ /* elemObj at bp+24 */ uintptr var _ /* elemPtrs at bp+16 */ uintptr var _ /* length at bp+0 */ TTcl_Size var _ /* listLen at bp+8 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, i, isAbstractList, joinObjPtr, proc, proc1, proc2, resObjPtr, v1, v11, v12, v13, v14, v15, v16, v17, v19, v2, v21, v23, v24, v3, v4, v6, v7, v8, v9 isAbstractList = 0 resObjPtr = libc.UintptrFromInt32(0) if objc < int32(2) || objc > int32(3) { XTcl_WrongNumArgs(tls, interp2, int64(1), objv, __ccgo_ts+17158) return int32(TCL_ERROR) } /* * Make sure the list argument is a list object and get its length and a * pointer to its array of element pointers. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+80) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+80) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr)).Fversion) { v1 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr)).FgetElementsProc } else { v1 = libc.UintptrFromInt32(0) } if v1 != 0 { v2 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(v2)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+48) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+48) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v2)).FtypePtr)).Fversion) { v3 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v2)).FtypePtr)).FlengthProc } else { v3 = libc.UintptrFromInt32(0) } proc = v3 v4 = (*(*func(*libc.TLS, uintptr) TTcl_Size)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, v2) goto _5 _5: *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v4 if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) != 0 { v6 = int32(1) } else { v6 = 0 } isAbstractList = v6 if v11 = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > int64(1); v11 { v7 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(v7)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+80) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+80) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v7)).FtypePtr)).Fversion) { v8 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v7)).FtypePtr)).FgetElementsProc } else { v8 = libc.UintptrFromInt32(0) } proc2 = v8 v9 = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{proc2})))(tls, interp2, v7, bp+8, bp+16) goto _10 _10: } if v11 && v9 != TCL_OK { return int32(TCL_ERROR) } } else { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v13 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanStart } else { v13 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1 + 40 + uintptr(v13)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v14 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v14 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v14 v12 = libc.Int32FromInt32(TCL_OK) } else { v12 = XTcl_ListObjGetElements(tls, interp2, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+16) } if v12 != TCL_OK { return int32(TCL_ERROR) } } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 { /* No elements to join; default empty result is correct. */ return TCL_OK } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(1) { /* One element; return it */ if !(isAbstractList != 0) { XTcl_SetObjResult(tls, interp2, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16))))) } else { v15 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(v15)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+56) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+56) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v15)).FtypePtr)).Fversion) { v16 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v15)).FtypePtr)).FindexProc } else { v16 = libc.UintptrFromInt32(0) } proc1 = v16 v17 = (*(*func(*libc.TLS, uintptr, uintptr, TTcl_Size, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{proc1})))(tls, interp2, v15, 0, bp+24) goto _18 _18: if v17 != TCL_OK { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp2, *(*uintptr)(unsafe.Pointer(bp + 24))) } return TCL_OK } if objc == int32(2) { v19 = XTcl_NewStringObj(tls, __ccgo_ts+14830, int64(1)) } else { v19 = *(*uintptr)(unsafe.Pointer(objv + 2*8)) } joinObjPtr = v19 (*TTcl_Obj)(unsafe.Pointer(joinObjPtr)).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(joinObjPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(joinObjPtr)).Flength _ = (*TTcl_Obj)(unsafe.Pointer(joinObjPtr)).Fbytes } else { XTcl_GetStringFromObj(tls, joinObjPtr, bp) } if *(*TTcl_Size)(unsafe.Pointer(bp)) == 0 { resObjPtr = XTclStringCat(tls, interp2, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)), 0) } else { if v21 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v21 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v21 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { resObjPtr = XTclThreadAllocObj(tls) } else { resObjPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resObjPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(resObjPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(resObjPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(resObjPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(resObjPtr)).FtypePtr = libc.UintptrFromInt32(0) i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } if i > 0 { /* * NOTE: This code is relying on Tcl_AppendObjToObj() **NOT** * to shimmer joinObjPtr. If it did, then the case where * objv[1] and objv[2] are the same value would not be safe. * Accessing elemPtrs would crash. */ XTcl_AppendObjToObj(tls, resObjPtr, joinObjPtr) } XTcl_AppendObjToObj(tls, resObjPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8))) goto _22 _22: ; i++ } } _objPtr = joinObjPtr v24 = _objPtr v23 = *(*TTcl_Size)(unsafe.Pointer(v24)) *(*TTcl_Size)(unsafe.Pointer(v24))-- if v23 <= int64(1) { XTclFreeObj(tls, _objPtr) } if resObjPtr != 0 { XTcl_SetObjResult(tls, interp2, resObjPtr) return TCL_OK } return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * Tcl_LassignObjCmd -- * * This object-based procedure is invoked to process the "lassign" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LassignObjCmd(tls *libc.TLS, dummy2258 uintptr, interp1 uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument objects. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, cachePtr, emptyObj, listPtr, proc, v11, v13, v15, v16, v17, v18, v4, v6, v8 uintptr var fromIdx1, origListObjc, toIdx1, v12, v14, v5, v7 TTcl_Size var i, v1, v10, v19 int32 var v2 int64 var v9 bool var _ /* elemObj at bp+8 */ uintptr var _ /* listObjc at bp+0 */ TTcl_Size var _ /* resultObjPtr at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, cachePtr, emptyObj, fromIdx1, i, listPtr, origListObjc, proc, toIdx1, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v4, v5, v6, v7, v8, v9 if objc < int32(2) { XTcl_WrongNumArgs(tls, interp1, int64(1), objv, __ccgo_ts+17176) return int32(TCL_ERROR) } /* * Note: no need to Dup the list to avoid shimmering. That is only * needed when Tcl_ListObjGetElements is used since that returns * pointers to internal structures. Using Tcl_ListObjIndex does not * have that problem. However, we now have to IncrRef each elemObj * (see below). I see that as preferable as duping lists is potentially * expensive for abstract lists when they have a string representation. */ listPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp1, listPtr, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } origListObjc = *(*TTcl_Size)(unsafe.Pointer(bp)) objc -= int32(2) objv += uintptr(2) * 8 i = 0 for { if !(i < objc && int64(i) < *(*TTcl_Size)(unsafe.Pointer(bp))) { break } if XTcl_ListObjIndex(tls, interp1, listPtr, int64(i), bp+8) != TCL_OK { return int32(TCL_ERROR) } /* * Must incrref elemObj. If the var name being set is same as the * list value, ObjSetVar2 will shimmer the list to a VAR freeing * the elements in the list (in case list refCount was 1) BEFORE * the elemObj is stored in the var. See tests 6.{25,26} */ (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++ v4 = objv objv += 8 if XTcl_ObjSetVar2(tls, interp1, *(*uintptr)(unsafe.Pointer(v4)), libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { _objPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } return int32(TCL_ERROR) } _objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 8)) v8 = _objPtr1 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr1) } goto _3 _3: ; i++ } objc -= i *(*TTcl_Size)(unsafe.Pointer(bp)) -= int64(i) if objc > 0 { if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { emptyObj = XTclThreadAllocObj(tls) } else { emptyObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(emptyObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(emptyObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(emptyObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(emptyObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(emptyObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(emptyObj)).FrefCount++ for { v10 = objc objc-- if !(v10 > 0) { break } v11 = objv objv += 8 if XTcl_ObjSetVar2(tls, interp1, *(*uintptr)(unsafe.Pointer(v11)), libc.UintptrFromInt32(0), emptyObj, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { _objPtr2 = emptyObj v13 = _objPtr2 v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if v12 <= int64(1) { XTclFreeObj(tls, _objPtr2) } return int32(TCL_ERROR) } } _objPtr3 = emptyObj v15 = _objPtr3 v14 = *(*TTcl_Size)(unsafe.Pointer(v15)) *(*TTcl_Size)(unsafe.Pointer(v15))-- if v14 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } if *(*TTcl_Size)(unsafe.Pointer(bp)) > 0 { *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0) fromIdx1 = origListObjc - *(*TTcl_Size)(unsafe.Pointer(bp)) toIdx1 = origListObjc - int64(1) if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+64) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+64) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr)).Fversion) { v16 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr)).FsliceProc } else { v16 = libc.UintptrFromInt32(0) } if v16 != 0 { v17 = listPtr if (*TTcl_Obj)(unsafe.Pointer(v17)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+64) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+64) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v17)).FtypePtr)).Fversion) { v18 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v17)).FtypePtr)).FsliceProc } else { v18 = libc.UintptrFromInt32(0) } proc = v18 v19 = (*(*func(*libc.TLS, uintptr, uintptr, TTcl_Size, TTcl_Size, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, interp1, v17, fromIdx1, toIdx1, bp+16) goto _20 _20: if v19 != TCL_OK { return int32(TCL_ERROR) } } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = XTclListObjRange(tls, interp1, listPtr, origListObjc-*(*TTcl_Size)(unsafe.Pointer(bp)), origListObjc-int64(1)) if *(*uintptr)(unsafe.Pointer(bp + 16)) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } XTcl_SetObjResult(tls, interp1, *(*uintptr)(unsafe.Pointer(bp + 16))) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LindexObjCmd -- * * This object-based procedure is invoked to process the "lindex" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LindexObjCmd(tls *libc.TLS, dummy2370 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var _objPtr, elemPtr, v2 uintptr var v1 TTcl_Size _, _, _, _ = _objPtr, elemPtr, v1, v2 /* Pointer to the element being extracted. */ if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17195) return int32(TCL_ERROR) } /* * If objc==3, then objv[2] may be either a single index or a list of * indices: go to TclLindexList to determine which. If objc>=4, or * objc==2, then objv[2 .. objc-2] are all single indices and processed as * such in TclLindexFlat. */ if objc == int32(3) { elemPtr = XTclLindexList(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(objv + 2*8))) } else { elemPtr = XTclLindexFlat(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), int64(objc-int32(2)), objv+uintptr(2)*8) } /* * Set the interpreter's object result to the last element extracted. */ if elemPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, elemPtr) _objPtr = elemPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LinsertObjCmd -- * * This object-based procedure is invoked to process the "linsert" Tcl * command. See the user documentation for details on what it does. * * Results: * A new Tcl list object formed by inserting zero or more elements into a * list. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LinsertObjCmd(tls *libc.TLS, dummy2428 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var _objPtr, _objPtr1, listPtr, v5, v7 uintptr var copied, result, v1, v3 int32 var v2 int64 var v4, v6 TTcl_Size var _ /* index at bp+8 */ TTcl_Size var _ /* len at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, copied, listPtr, result, v1, v2, v3, v4, v5, v6, v7 copied = 0 if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17212) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } result = v1 if result != TCL_OK { return result } /* * Get the index. "end" is interpreted to be the index after the last * element, such that using it will cause any inserted elements to be * appended to the list. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), bp+8) } result = v3 if result != TCL_OK { return result } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp)) } /* * If the list object is unshared we can modify it directly. Otherwise we * create a copy to modify: this is "copy on write". */ listPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > int64(1) { listPtr = XTclListObjCopy(tls, libc.UintptrFromInt32(0), listPtr) copied = int32(1) } if objc == int32(4) && *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == *(*TTcl_Size)(unsafe.Pointer(bp)) { /* * Special case: insert one element at the end of the list. */ result = XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, *(*uintptr)(unsafe.Pointer(objv + 3*8))) if result != TCL_OK { if copied != 0 { _objPtr = listPtr v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return result } } else { if TCL_OK != XTcl_ListObjReplace(tls, interp, listPtr, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), 0, int64(objc-libc.Int32FromInt32(3)), objv+3*8) { if copied != 0 { _objPtr1 = listPtr v7 = _objPtr1 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } return int32(TCL_ERROR) } } /* * Set the interpreter's object result. */ XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_ListObjCmd -- * * This procedure is invoked to process the "list" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_ListObjCmd(tls *libc.TLS, dummy2521 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* The argument objects. */ /* * If there are no list elements, the result is an empty object. * Otherwise set the interpreter's result object to be a list object. */ if objc > int32(1) { XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, int64(objc-int32(1)), objv+1*8)) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LlengthObjCmd -- * * This object-based procedure is invoked to process the "llength" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LlengthObjCmd(tls *libc.TLS, dummy2557 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Argument objects. */ var cachePtr, objPtr uintptr var result, v1 int32 var uw_ TTcl_WideUInt var v2 int64 var v3 bool var _ /* bignumValue_ at bp+8 */ Tmp_int var _ /* listLen at bp+0 */ TTcl_Size _, _, _, _, _, _, _ = cachePtr, objPtr, result, uw_, v1, v2, v3 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+2860) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } result = v1 if result != TCL_OK { return result } /* * Set the interpreter's object result to an integer object holding the * length. */ if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = libc.UintptrFromInt32(0) uw_ = libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp))) if uw_ > libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) { if XTclBN_mp_init_u64(tls, bp+8, uw_) != MP_OKAY { XTcl_Panic(tls, __ccgo_ts+13273, libc.VaList(bp+40, __ccgo_ts+13293)) } XTclSetBignumInternalRep(tls, objPtr, bp+8) } else { *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep)) = libc.Int64FromUint64(uw_) (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } XTcl_SetObjResult(tls, interp, objPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LpopObjCmd -- * * This procedure is invoked to process the "lpop" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LpopObjCmd(tls *libc.TLS, dummy2606 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Argument objects. */ var _objPtr, _objPtr1, _objPtr2, listPtr, newListPtr, proc, stored, v4, v6, v7, v9 uintptr var copied, result, v1 int32 var v2 int64 var v3, v5, v8 TTcl_Size var _ /* elemPtr at bp+8 */ uintptr var _ /* listLen at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, copied, listPtr, newListPtr, proc, result, stored, v1, v2, v3, v4, v5, v6, v7, v8, v9 copied = 0 if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17237) return int32(TCL_ERROR) } listPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), int32(TCL_LEAVE_ERR_MSG)) if listPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, listPtr, bp) } result = v1 if result != TCL_OK { return result } /* * First, extract the element to be returned. * TclLindexFlat adds a ref count which is handled. */ if objc == int32(2) { if !(*(*TTcl_Size)(unsafe.Pointer(bp)) != 0) { /* empty list, throw the same error as with index "end" */ XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17253, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+17278, __ccgo_ts+17284, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } result = XTcl_ListObjIndex(tls, interp, listPtr, *(*TTcl_Size)(unsafe.Pointer(bp))-libc.Int64FromInt32(1), bp+8) if result != TCL_OK { return result } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++ } else { *(*uintptr)(unsafe.Pointer(bp + 8)) = XTclLindexFlat(tls, interp, listPtr, int64(objc-int32(2)), objv+uintptr(2)*8) if *(*uintptr)(unsafe.Pointer(bp + 8)) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 8))) _objPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } /* * Second, remove the element. * TclLsetFlat adds a ref count which is handled. */ if objc == int32(2) { if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > int64(1) { listPtr = XTclListObjCopy(tls, libc.UintptrFromInt32(0), listPtr) copied = int32(1) } result = XTcl_ListObjReplace(tls, interp, listPtr, *(*TTcl_Size)(unsafe.Pointer(bp))-int64(1), int64(1), 0, libc.UintptrFromInt32(0)) if result != TCL_OK { if copied != 0 { _objPtr1 = listPtr v6 = _objPtr1 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } return result } } else { if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+88) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+88) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr)).Fversion) { v7 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr)).FsetElementProc } else { v7 = libc.UintptrFromInt32(0) } proc = v7 if proc != 0 { newListPtr = (*(*func(*libc.TLS, uintptr, uintptr, TTcl_Size, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, interp, listPtr, int64(objc-int32(2)), objv+uintptr(2)*8, libc.UintptrFromInt32(0)) } else { newListPtr = XTclLsetFlat(tls, interp, listPtr, int64(objc-int32(2)), objv+uintptr(2)*8, libc.UintptrFromInt32(0)) } if newListPtr == libc.UintptrFromInt32(0) { if copied != 0 { _objPtr2 = listPtr v9 = _objPtr2 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } return int32(TCL_ERROR) } else { listPtr = newListPtr XTclUndoRefCount(tls, listPtr) } } stored = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), listPtr, int32(TCL_LEAVE_ERR_MSG)) if stored == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LrangeObjCmd -- * * This procedure is invoked to process the "lrange" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LrangeObjCmd(tls *libc.TLS, dummy2725 uintptr, interp1 uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument objects. */ var proc, resultObj1, v5, v6, v7 uintptr var result, status, v1, v3, v4, v8 int32 var v2 int64 var _ /* first at bp+8 */ TTcl_Size var _ /* last at bp+16 */ TTcl_Size var _ /* listLen at bp+0 */ TTcl_Size var _ /* resultObj at bp+24 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = proc, result, resultObj1, status, v1, v2, v3, v4, v5, v6, v7, v8 if objc != int32(4) { XTcl_WrongNumArgs(tls, interp1, int64(1), objv, __ccgo_ts+17295) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } result = v1 if result != TCL_OK { return result } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetIntForIndex(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp))-libc.Int64FromInt32(1), bp+8) } result = v3 if result != TCL_OK { return result } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetIntForIndex(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*TTcl_Size)(unsafe.Pointer(bp))-libc.Int64FromInt32(1), bp+16) } result = v4 if result != TCL_OK { return result } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+64) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+64) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr)).Fversion) { v5 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr)).FsliceProc } else { v5 = libc.UintptrFromInt32(0) } if v5 != 0 { v6 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(v6)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+64) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+64) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v6)).FtypePtr)).Fversion) { v7 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v6)).FtypePtr)).FsliceProc } else { v7 = libc.UintptrFromInt32(0) } proc = v7 v8 = (*(*func(*libc.TLS, uintptr, uintptr, TTcl_Size, TTcl_Size, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, interp1, v6, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), *(*TTcl_Size)(unsafe.Pointer(bp + 16)), bp+24) goto _9 _9: status = v8 if status == TCL_OK { XTcl_SetObjResult(tls, interp1, *(*uintptr)(unsafe.Pointer(bp + 24))) } else { return int32(TCL_ERROR) } } else { resultObj1 = XTclListObjRange(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*TTcl_Size)(unsafe.Pointer(bp + 8)), *(*TTcl_Size)(unsafe.Pointer(bp + 16))) if resultObj1 == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp1, resultObj1) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LremoveObjCmd -- * * This procedure is invoked to process the "lremove" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _LremoveIndexCompare(tls *libc.TLS, el1Ptr uintptr, el2Ptr uintptr) (r int32) { var idx1, idx2 TTcl_Size var v1, v2 int32 _, _, _, _ = idx1, idx2, v1, v2 idx1 = *(*TTcl_Size)(unsafe.Pointer(el1Ptr)) idx2 = *(*TTcl_Size)(unsafe.Pointer(el2Ptr)) /* * This will put the larger element first. */ if idx1 < idx2 { v1 = int32(1) } else { if idx1 > idx2 { v2 = -int32(1) } else { v2 = 0 } v1 = v2 } return v1 } func XTcl_LremoveObjCmd(tls *libc.TLS, dummy2807 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var _objPtr, idxv, listObj, v7 uintptr var copied, status, v1, v4 int32 var first, i, idx, idxc, num, prevIdx, v6 TTcl_Size var v2 int64 var _ /* listLen at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, copied, first, i, idx, idxc, idxv, listObj, num, prevIdx, status, v1, v2, v4, v6, v7 copied = 0 status = TCL_OK /* * Parse the arguments. */ if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17195) return int32(TCL_ERROR) } listObj = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(listObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, listObj, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } idxc = int64(objc - int32(2)) if idxc == 0 { XTcl_SetObjResult(tls, interp, listObj) return TCL_OK } idxv = XTcl_Alloc(tls, libc.Uint64FromInt32(objc-libc.Int32FromInt32(2))*uint64(8)) i = int64(2) for { if !(i < int64(objc)) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(idxv + uintptr(i-int64(2))*8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), *(*TTcl_Size)(unsafe.Pointer(bp))-libc.Int64FromInt32(1), idxv+uintptr(i-int64(2))*8) } status = libc.BoolInt32(v4 != TCL_OK) if status != TCL_OK { goto done } goto _3 _3: ; i++ } /* * Sort the indices, large to small so that when we remove an index we * don't change the indices still to be processed. */ if idxc > int64(1) { libc.Xqsort(tls, idxv, libc.Uint64FromInt64(idxc), uint64(8), __ccgo_fp(_LremoveIndexCompare)) } /* * Make our working copy, then do the actual removes piecemeal. */ if (*TTcl_Obj)(unsafe.Pointer(listObj)).FrefCount > int64(1) { listObj = XTclListObjCopy(tls, libc.UintptrFromInt32(0), listObj) copied = int32(1) } num = 0 first = *(*TTcl_Size)(unsafe.Pointer(bp)) i = 0 prevIdx = int64(-libc.Int32FromInt32(1)) for { if !(i < idxc) { break } idx = *(*TTcl_Size)(unsafe.Pointer(idxv + uintptr(i)*8)) /* * Repeated index and sanity check. */ if idx == prevIdx { goto _5 } prevIdx = idx if idx < 0 || idx >= *(*TTcl_Size)(unsafe.Pointer(bp)) { goto _5 } /* * Coalesce adjacent removes to reduce the number of copies. */ if num == 0 { num = int64(1) first = idx } else { if idx+int64(1) == first { num++ first = idx } else { /* * Note that this operation can't fail now; we know we have a list * and we're only ever contracting that list. */ status = XTcl_ListObjReplace(tls, interp, listObj, first, num, 0, libc.UintptrFromInt32(0)) if status != TCL_OK { goto done } *(*TTcl_Size)(unsafe.Pointer(bp)) -= num num = int64(1) first = idx } } goto _5 _5: ; i++ } if num != 0 { status = XTcl_ListObjReplace(tls, interp, listObj, first, num, 0, libc.UintptrFromInt32(0)) if status != TCL_OK { if copied != 0 { _objPtr = listObj v7 = _objPtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr) } } goto done } } XTcl_SetObjResult(tls, interp, listObj) goto done done: ; XTclpFree(tls, idxv) return status } /* *---------------------------------------------------------------------- * * Tcl_LrepeatObjCmd -- * * This procedure is invoked to process the "lrepeat" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LrepeatObjCmd(tls *libc.TLS, dummy2938 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) /* The argument objects. */ var dataArray, listPtr, tmpPtr, p3 uintptr var i TTcl_WideInt var j, k, totalElems, v7 TTcl_Size var v1 int32 var v2 int64 var _ /* elementCount at bp+0 */ TTcl_WideInt var _ /* listRep at bp+8 */ TListRep _, _, _, _, _, _, _, _, _, _, _ = dataArray, i, j, k, listPtr, tmpPtr, totalElems, v1, v2, v7, p3 dataArray = libc.UintptrFromInt32(0) /* * Check arguments for legality: * lrepeat count ?value ...? */ if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17311) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } if TCL_OK != v1 { return int32(TCL_ERROR) } if *(*TTcl_WideInt)(unsafe.Pointer(bp)) < 0 { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+17329, libc.VaList(bp+32, *(*TTcl_WideInt)(unsafe.Pointer(bp))))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+17368, __ccgo_ts+17376, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } /* * Skip forward to the interesting arguments now we've finished parsing. */ objc -= int32(2) objv += uintptr(2) * 8 /* Final sanity check. Do not exceed limits on max list length. */ if *(*TTcl_WideInt)(unsafe.Pointer(bp)) != 0 && int64(objc) > int64(libc.Int64FromUint64((libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))-uint64(libc.UintptrFromInt32(0)+40))/libc.Uint64FromInt64(8))) / *(*TTcl_WideInt)(unsafe.Pointer(bp)) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+17383, libc.VaList(bp+32, libc.Int64FromUint64((libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))-uint64(libc.UintptrFromInt32(0)+40))/libc.Uint64FromInt64(8))))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+2008, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } totalElems = int64(objc) * *(*TTcl_WideInt)(unsafe.Pointer(bp)) /* * Get an empty list object that is allocated large enough to hold each * init value elementCount times. */ listPtr = XTcl_NewListObj(tls, totalElems, libc.UintptrFromInt32(0)) if totalElems != 0 { (*TListRep)(unsafe.Pointer(bp + 8)).FstorePtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1 (*TListRep)(unsafe.Pointer(bp + 8)).FspanPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 if (*TListRep)(unsafe.Pointer(bp+8)).FspanPtr != 0 { v2 = (*TListSpan)(unsafe.Pointer((*TListRep)(unsafe.Pointer(bp + 8)).FspanPtr)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*TListRep)(unsafe.Pointer(bp + 8)).FstorePtr)).FfirstUsed } dataArray = (*TListRep)(unsafe.Pointer(bp+8)).FstorePtr + 40 + uintptr(v2)*8 (*TListStore)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 8))).FstorePtr)).FnumUsed = totalElems if (*(*TListRep)(unsafe.Pointer(bp + 8))).FspanPtr != 0 { /* Future proofing in case Tcl_NewListObj returns a span */ (*TListSpan)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 8))).FspanPtr)).FspanStart = (*TListStore)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 8))).FstorePtr)).FfirstUsed (*TListSpan)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 8))).FspanPtr)).FspanLength = (*TListStore)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 8))).FstorePtr)).FnumUsed } } /* * Set the elements. Note that we handle the common degenerate case of a * single value being repeated separately to permit the compiler as much * room as possible to optimize a loop that might be run a very large * number of times. */ if objc == int32(1) { tmpPtr = *(*uintptr)(unsafe.Pointer(objv)) p3 = tmpPtr *(*TTcl_Size)(unsafe.Pointer(p3)) = *(*TTcl_Size)(unsafe.Pointer(p3)) + *(*TTcl_WideInt)(unsafe.Pointer(bp)) i = 0 for { if !(i < *(*TTcl_WideInt)(unsafe.Pointer(bp))) { break } *(*uintptr)(unsafe.Pointer(dataArray + uintptr(i)*8)) = tmpPtr goto _4 _4: ; i++ } } else { k = 0 i = 0 for { if !(i < *(*TTcl_WideInt)(unsafe.Pointer(bp))) { break } j = 0 for { if !(j < int64(objc)) { break } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)))).FrefCount++ v7 = k k++ *(*uintptr)(unsafe.Pointer(dataArray + uintptr(v7)*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)) goto _6 _6: ; j++ } goto _5 _5: ; i++ } } XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LreplaceObjCmd -- * * This object-based procedure is invoked to process the "lreplace" Tcl * command. See the user documentation for details on what it does. * * Results: * A new Tcl list object formed by replacing zero or more elements of a * list. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LreplaceObjCmd(tls *libc.TLS, dummy3053 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument objects. */ var _objPtr, listPtr, v6 uintptr var numToDelete, v5 TTcl_Size var result, v1, v3, v4 int32 var v2 int64 var _ /* first at bp+8 */ TTcl_Size var _ /* last at bp+16 */ TTcl_Size var _ /* listLen at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _ = _objPtr, listPtr, numToDelete, result, v1, v2, v3, v4, v5, v6 if objc < int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17432) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } result = v1 if result != TCL_OK { return result } /* * Get the first and last indexes. "end" is interpreted to be the index * for the last element, such that using it will cause that element to be * included for deletion. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp))-libc.Int64FromInt32(1), bp+8) } result = v3 if result != TCL_OK { return result } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*TTcl_Size)(unsafe.Pointer(bp))-libc.Int64FromInt32(1), bp+16) } result = v4 if result != TCL_OK { return result } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp)) } } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) >= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_Size)(unsafe.Pointer(bp)) - int64(1) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) <= *(*TTcl_Size)(unsafe.Pointer(bp + 16)) { numToDelete = libc.Int64FromUint64(libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 16))) - libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) + uint64(1)) /* See [3d3124d01d] */ } else { numToDelete = 0 } /* * If the list object is unshared we can modify it directly, otherwise we * create a copy to modify: this is "copy on write". */ listPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > int64(1) { listPtr = XTclListObjCopy(tls, libc.UintptrFromInt32(0), listPtr) } /* * Note that we call Tcl_ListObjReplace even when numToDelete == 0 and * objc == 4. In this case, the list value of listPtr is not changed (no * elements are removed or added), but by making the call we are assured * we end up with a list in canonical form. Resist any temptation to * optimize this case away. */ if TCL_OK != XTcl_ListObjReplace(tls, interp, listPtr, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), numToDelete, int64(objc-int32(4)), objv+uintptr(4)*8) { _objPtr = listPtr v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } return int32(TCL_ERROR) } /* * Set the interpreter's object result. */ XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LreverseObjCmd -- * * This procedure is invoked to process the "lreverse" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LreverseObjCmd(tls *libc.TLS, dummy3155 uintptr, interp1 uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Argument values. */ var _isobjPtr, dataArray, proc, resultObj1, tmp, v1, v2, v3 uintptr var i, j TTcl_Size var v10, v11, v7, v9 int64 var v4, v6, v8 int32 var _ /* elemc at bp+8 */ TTcl_Size var _ /* elemv at bp+0 */ uintptr var _ /* listRep at bp+24 */ TListRep var _ /* resultObj at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _isobjPtr, dataArray, i, j, proc, resultObj1, tmp, v1, v10, v11, v2, v3, v4, v6, v7, v8, v9 if objc != int32(2) { XTcl_WrongNumArgs(tls, interp1, int64(1), objv, __ccgo_ts+2860) return int32(TCL_ERROR) } /* * Handle AbstractList special case - do not shimmer into a list, if it * supports a private Reverse function, just to reverse it. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+72) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+72) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr)).Fversion) { v1 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr)).FreverseProc } else { v1 = libc.UintptrFromInt32(0) } if v1 != 0 { v2 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(v2)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+72) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+72) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v2)).FtypePtr)).Fversion) { v3 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v2)).FtypePtr)).FreverseProc } else { v3 = libc.UintptrFromInt32(0) } proc = v3 v4 = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, interp1, v2, bp+16) goto _5 _5: if v4 == TCL_OK { XTcl_SetObjResult(tls, interp1, *(*uintptr)(unsafe.Pointer(bp + 16))) return TCL_OK } } /* end Abstract List */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v7 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v7 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v7 v6 = libc.Int32FromInt32(TCL_OK) } else { v6 = XTcl_ListObjLength(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) } if v6 != TCL_OK { return int32(TCL_ERROR) } /* * If the list is empty, just return it. [Bug 1876793] */ if !(*(*TTcl_Size)(unsafe.Pointer(bp + 8)) != 0) { XTcl_SetObjResult(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 1*8))) return TCL_OK } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v9 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanStart } else { v9 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1 + 40 + uintptr(v9)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v10 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v10 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v10 v8 = libc.Int32FromInt32(TCL_OK) } else { v8 = XTcl_ListObjGetElements(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp) } if v8 != TCL_OK { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FrefCount > int64(1) || (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FrefCount > uint64(1) { resultObj1 = XTcl_NewListObj(tls, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), libc.UintptrFromInt32(0)) /* Modify the internal rep in-place */ (*TListRep)(unsafe.Pointer(bp + 24)).FstorePtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObj1 + 32))).Fptr1 (*TListRep)(unsafe.Pointer(bp + 24)).FspanPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObj1 + 32))).Fptr2 (*TListStore)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 24))).FstorePtr)).FnumUsed = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) if (*TListRep)(unsafe.Pointer(bp+24)).FspanPtr != 0 { v11 = (*TListSpan)(unsafe.Pointer((*TListRep)(unsafe.Pointer(bp + 24)).FspanPtr)).FspanStart } else { v11 = (*TListStore)(unsafe.Pointer((*TListRep)(unsafe.Pointer(bp + 24)).FstorePtr)).FfirstUsed } dataArray = (*TListRep)(unsafe.Pointer(bp+24)).FstorePtr + 40 + uintptr(v11)*8 if (*(*TListRep)(unsafe.Pointer(bp + 24))).FspanPtr != 0 { /* Future proofing */ (*TListSpan)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 24))).FspanPtr)).FspanStart = (*TListStore)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 24))).FstorePtr)).FfirstUsed (*TListSpan)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 24))).FspanPtr)).FspanLength = (*TListStore)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 24))).FstorePtr)).FnumUsed } i = 0 j = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) - libc.Int64FromInt32(1) for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } *(*uintptr)(unsafe.Pointer(dataArray + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i)*8)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i)*8)))).FrefCount++ goto _12 _12: ; i++ j-- } XTcl_SetObjResult(tls, interp1, resultObj1) } else { /* * Not shared, so swap "in place". This relies on Tcl_LOGE above * returning a pointer to the live array of Tcl_Obj values. */ i = 0 j = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) - libc.Int64FromInt32(1) for { if !(i < j) { break } tmp = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i)*8)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(j)*8)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(j)*8)) = tmp goto _13 _13: ; i++ j-- } _isobjPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } XTcl_SetObjResult(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 1*8))) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LsearchObjCmd -- * * This procedure is invoked to process the "lsearch" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LsearchObjCmd(tls *libc.TLS, dummy3258 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(224) defer tls.Free(224) /* Argument values. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, bytes, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, elObj, elObj1, elObj2, itemPtr, listPtr, patObj, patternBytes, startPtr, v18, v26, v27, v29, v3, v30, v31, v34, v36, v38, v39, v40, v43, v45, v46, v48, v50, v51, v53, v54, v56, v57, v59, v63, v65, v70, v72, v74, v9 uintptr var allMatches, allocatedIndexVector, bisect, dataType, inlineReturn, isIncreasing, match, mode, negatedMatch, noCase, result, returnSubindices, v10, v11, v12, v16, v19, v32, v4, v41, v5 int32 var elValue, elValue1 Tsize_t var groupOffset, i, index, j, j1, j2, lower, upper, v2, v28, v35, v37, v42, v44, v47, v49, v52, v55, v58, v64, v71, v73 TTcl_Size var groupSize TTcl_WideInt var regexp TTcl_RegExp var strCmpFn TSortStrCmpFn_t var v13, v14, v21, v22, v24, v25, v6, v7 int64 var v17, v60, v62, v66, v68, v69 bool var _ /* elemLen at bp+16 */ TTcl_Size var _ /* encoded at bp+160 */ int32 var _ /* idx at bp+144 */ int32 var _ /* indices at bp+152 */ uintptr var _ /* length at bp+0 */ TTcl_Size var _ /* listc at bp+8 */ TTcl_Size var _ /* listv at bp+136 */ uintptr var _ /* objDouble at bp+64 */ float64 var _ /* objWide at bp+40 */ TTcl_WideInt var _ /* patDouble at bp+56 */ float64 var _ /* patWide at bp+32 */ TTcl_WideInt var _ /* sortInfo at bp+72 */ TSortInfo var _ /* start at bp+24 */ TTcl_Size var _ /* wide at bp+48 */ TTcl_WideInt _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, allMatches, allocatedIndexVector, bisect, bytes, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, dataType, elObj, elObj1, elObj2, elValue, elValue1, groupOffset, groupSize, i, index, inlineReturn, isIncreasing, itemPtr, j, j1, j2, listPtr, lower, match, mode, negatedMatch, noCase, patObj, patternBytes, regexp, result, returnSubindices, startPtr, strCmpFn, upper, v10, v11, v12, v13, v14, v16, v17, v18, v19, v2, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v62, v63, v64, v65, v66, v68, v69, v7, v70, v71, v72, v73, v74, v9 result = TCL_OK *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 allocatedIndexVector = 0 itemPtr = libc.UintptrFromInt32(0) strCmpFn = __ccgo_fp(XTclUtfCmp) regexp = libc.UintptrFromInt32(0) mode = 1 dataType = 0 isIncreasing = int32(1) allMatches = 0 inlineReturn = 0 returnSubindices = 0 negatedMatch = 0 bisect = 0 listPtr = libc.UintptrFromInt32(0) startPtr = libc.UintptrFromInt32(0) groupSize = int64(1) groupOffset = 0 *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = 0 noCase = 0 (*(*TSortInfo)(unsafe.Pointer(bp + 72))).FcompareCmdPtr = libc.UintptrFromInt32(0) (*(*TSortInfo)(unsafe.Pointer(bp + 72))).FisIncreasing = int32(1) (*(*TSortInfo)(unsafe.Pointer(bp + 72))).FsortMode = 0 (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Finterp = interp (*(*TSortInfo)(unsafe.Pointer(bp + 72))).FresultCode = TCL_OK (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv = libc.UintptrFromInt32(0) (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc = 0 if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+17617) return int32(TCL_ERROR) } i = int64(1) for { if !(i < int64(objc-int32(2))) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_options3)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int64(objc-int32(4)) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17650, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, __ccgo_ts+2004, __ccgo_ts+16490, __ccgo_ts+17673, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } i++ if *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) == *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) { /* * Take copy to prevent shimmering problems. Note that it does * not matter if the index obj is also a component of the list * being searched. We only need to copy where the list and the * index are one-and-the-same. */ startPtr = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) } else { startPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) } (*TTcl_Obj)(unsafe.Pointer(startPtr)).FrefCount++ case 17: /* -stride */ if i > int64(objc-int32(4)) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17681, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, __ccgo_ts+2004, __ccgo_ts+16490, __ccgo_ts+17673, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int64(1))*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 48)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int64(1))*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int64(1))*8)), bp+48) } if v4 != TCL_OK { result = int32(TCL_ERROR) goto done } if *(*TTcl_WideInt)(unsafe.Pointer(bp + 48)) < int64(1) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17732, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+17765, __ccgo_ts+17773, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } groupSize = *(*TTcl_WideInt)(unsafe.Pointer(bp + 48)) i++ case 8: if allocatedIndexVector != 0 { XTclStackFree(tls, interp, (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv) allocatedIndexVector = 0 } if i > int64(objc-int32(4)) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17783, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, __ccgo_ts+2004, __ccgo_ts+16490, __ccgo_ts+17673, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } /* * Store the extracted indices for processing by sublist * extraction. Note that we don't do this using objects because * that has shimmering problems. */ i++ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32))).Fptr2 != 0 { v6 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32))).Fptr2)).FspanStart } else { v6 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 152)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32))).Fptr1 + 40 + uintptr(v6)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32))).Fptr2 != 0 { v7 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32))).Fptr2)).FspanLength } else { v7 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 72 + 24)) = v7 v5 = libc.Int32FromInt32(TCL_OK) } else { v5 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+72+24, bp+152) } if v5 != TCL_OK { result = int32(TCL_ERROR) goto done } switch (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc { case 0: (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv = libc.UintptrFromInt32(0) case int64(1): (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv = bp + 72 + 32 default: (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt64((*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc)) allocatedIndexVector = int32(1) /* Cannot use indexc field, as it * might be decreased by 1 later. */ } /* * Fill the array by parsing each index. We don't know whether * their scale is sensible yet, but we at least perform the * syntactic check here. */ j = 0 for { if !(j < (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc) { break } *(*int32)(unsafe.Pointer(bp + 160)) = 0 if XTclIndexEncode(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(j)*8)), int32(int64(-libc.Int32FromInt32(1))), int32(int64(-libc.Int32FromInt32(1))), bp+160) != TCL_OK { result = int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 160)) == int32(int64(-libc.Int32FromInt32(1))) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(j)*8)))).Fbytes != 0 { v9 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(j)*8)))).Fbytes } else { v9 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(j)*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+17830, libc.VaList(bp+176, v9))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+17278, __ccgo_ts+17284, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) } if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+17854, libc.VaList(bp+176, j))) goto done } *(*int32)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv + uintptr(j)*4)) = *(*int32)(unsafe.Pointer(bp + 160)) goto _8 _8: ; j++ } break } goto _1 _1: ; i++ } /* * Subindices only make sense if asked for with -index option set. */ if returnSubindices != 0 && (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc == 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17891, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+17765, __ccgo_ts+17940, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } if bisect != 0 && (allMatches != 0 || negatedMatch != 0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17955, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+17765, __ccgo_ts+17940, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } if mode == 2 { /* * We can shimmer regexp/list if listv[i] == pattern, so get the * regexp rep before the list rep. First time round, omit the interp * and hope that the compilation will succeed. If it fails, we'll * recompile in "expensive" mode with a place to put error messages. */ if noCase != 0 { v10 = int32(TCL_REG_NOCASE) } else { v10 = 0 } regexp = XTcl_GetRegExpFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), libc.Int32FromInt32(TCL_REG_ADVANCED)|libc.Int32FromInt32(TCL_REG_NOSUB)|v10) if regexp == libc.UintptrFromInt32(0) { /* * Failed to compile the RE. Try again without the TCL_REG_NOSUB * flag in case the RE had sub-expressions in it [Bug 1366683]. If * this fails, an error message will be left in the interpreter. */ if noCase != 0 { v11 = int32(TCL_REG_NOCASE) } else { v11 = 0 } regexp = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), int32(TCL_REG_ADVANCED)|v11) } if regexp == libc.UintptrFromInt32(0) { result = int32(TCL_ERROR) goto done } } /* * Make sure the list argument is a list object and get its length and a * pointer to its array of element pointers. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2 != 0 { v13 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2)).FspanStart } else { v13 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 136)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1 + 40 + uintptr(v13)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2 != 0 { v14 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2)).FspanLength } else { v14 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v14 v12 = libc.Int32FromInt32(TCL_OK) } else { v12 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)), bp+8, bp+136) } result = v12 if result != TCL_OK { goto done } /* * Check for sanity when grouping elements of the overall list together * because of the -stride option. [TIP #351] */ if groupSize > int64(1) { if *(*TTcl_Size)(unsafe.Pointer(bp + 8))%groupSize != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+17999, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+17765, __ccgo_ts+17773, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } if (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc > 0 { /* * Use the first value in the list supplied to -index as the * offset of the element within each group by which to sort. */ groupOffset = XTclIndexDecode(tls, *(*int32)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv)), groupSize-int64(1)) if groupOffset < 0 || groupOffset >= groupSize { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+18049, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+176, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+17765, __ccgo_ts+18127, libc.UintptrFromInt32(0))) result = int32(TCL_ERROR) goto done } if (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc == int64(1) { (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc = 0 (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv = libc.UintptrFromInt32(0) } else { (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc-- i = 0 for { if !(i < (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc) { break } *(*int32)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv + uintptr(i)*4)) = *(*int32)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv + uintptr(i+int64(1))*4)) goto _15 _15: ; i++ } } } } /* * Get the user-specified start offset. */ if startPtr != 0 { if (*TTcl_Obj)(unsafe.Pointer(startPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(startPtr)).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(startPtr)).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp + 8))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(startPtr)).FinternalRep)) v16 = libc.Int32FromInt32(TCL_OK) } else { v16 = XTcl_GetIntForIndex(tls, interp, startPtr, *(*TTcl_Size)(unsafe.Pointer(bp + 8))-libc.Int64FromInt32(1), bp+24) } result = v16 if result != TCL_OK { goto done } if *(*TTcl_Size)(unsafe.Pointer(bp + 24)) == int64(-libc.Int32FromInt32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = libc.Int64FromInt32(0) } /* * If the search started past the end of the list, we just return a * "did not match anything at all" result straight away. [Bug 1374778] */ if *(*TTcl_Size)(unsafe.Pointer(bp + 24)) >= *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { if allMatches != 0 || inlineReturn != 0 { XTcl_ResetResult(tls, interp) } else { if v17 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v17 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v17 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { itemPtr = XTclThreadAllocObj(tls) } else { itemPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(itemPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(itemPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(itemPtr)).FinternalRep)) = int64(-libc.Int32FromInt32(1)) (*TTcl_Obj)(unsafe.Pointer(itemPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) XTcl_SetObjResult(tls, interp, itemPtr) } goto done } /* * If start points within a group, it points to the start of the group. */ if groupSize > int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = *(*TTcl_Size)(unsafe.Pointer(bp + 24)) - *(*TTcl_Size)(unsafe.Pointer(bp + 24))%groupSize } } patObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)) patternBytes = libc.UintptrFromInt32(0) if mode == 0 || mode == 3 { switch dataType { case 0: fallthrough case 1: if (*TTcl_Obj)(unsafe.Pointer(patObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(patObj)).Flength v18 = (*TTcl_Obj)(unsafe.Pointer(patObj)).Fbytes } else { v18 = XTcl_GetStringFromObj(tls, patObj, bp) } patternBytes = v18 case 2: if (*TTcl_Obj)(unsafe.Pointer(patObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 32)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(patObj)).FinternalRep)) v19 = libc.Int32FromInt32(TCL_OK) } else { v19 = XTcl_GetWideIntFromObj(tls, interp, patObj, bp+32) } result = v19 if result != TCL_OK { goto done } /* * List representation might have been shimmered; restore it. [Bug * 1844789] */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2 != 0 { v21 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2)).FspanStart } else { v21 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 136)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1 + 40 + uintptr(v21)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2 != 0 { v22 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2)).FspanLength } else { v22 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v22 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)), bp+8, bp+136) } case 3: result = XTcl_GetDoubleFromObj(tls, interp, patObj, bp+56) if result != TCL_OK { goto done } /* * List representation might have been shimmered; restore it. [Bug * 1844789] */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2 != 0 { v24 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2)).FspanStart } else { v24 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 136)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1 + 40 + uintptr(v24)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2 != 0 { v25 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2)).FspanLength } else { v25 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v25 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)), bp+8, bp+136) } break } } else { if (*TTcl_Obj)(unsafe.Pointer(patObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(patObj)).Flength v26 = (*TTcl_Obj)(unsafe.Pointer(patObj)).Fbytes } else { v26 = XTcl_GetStringFromObj(tls, patObj, bp) } patternBytes = v26 } /* * Set default index value to -1, indicating failure; if we find the item * in the course of our search, index will be set to the correct value. */ index = int64(-int32(1)) match = 0 if mode == 3 && !(allMatches != 0) && !(negatedMatch != 0) { /* * If the data is sorted, we can do a more intelligent search. Note * that there is no point in being smart when -all was specified; in * that case, we have to look at all items anyway, and there is no * sense in doing this when the match sense is inverted. */ /* * With -stride, lower, upper and i are kept as multiples of groupSize. */ lower = *(*TTcl_Size)(unsafe.Pointer(bp + 24)) - groupSize upper = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) itemPtr = libc.UintptrFromInt32(0) for lower+groupSize != upper && (*(*TSortInfo)(unsafe.Pointer(bp + 72))).FresultCode == TCL_OK { i = (lower + upper) / int64(2) i = i - i%groupSize v27 = itemPtr if v27 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v27)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v27 v29 = _objPtr v28 = *(*TTcl_Size)(unsafe.Pointer(v29)) *(*TTcl_Size)(unsafe.Pointer(v29))-- if v28 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } itemPtr = libc.UintptrFromInt32(0) if (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc != 0 { itemPtr = _SelectObjFromSublist(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i+groupOffset)*8)), bp+72) if (*(*TSortInfo)(unsafe.Pointer(bp + 72))).FresultCode != TCL_OK { result = (*(*TSortInfo)(unsafe.Pointer(bp + 72))).FresultCode goto done } } else { itemPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i+groupOffset)*8)) } switch dataType { case 0: if (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 { v30 = (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes } else { v30 = XTcl_GetStringFromObj(tls, itemPtr, libc.UintptrFromInt32(0)) } bytes = v30 match = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{strCmpFn})))(tls, patternBytes, bytes) case 1: if (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 { v31 = (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes } else { v31 = XTcl_GetStringFromObj(tls, itemPtr, libc.UintptrFromInt32(0)) } bytes = v31 match = _DictionaryCompare(tls, patternBytes, bytes) case 2: if (*TTcl_Obj)(unsafe.Pointer(itemPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(itemPtr)).FinternalRep)) v32 = libc.Int32FromInt32(TCL_OK) } else { v32 = XTcl_GetWideIntFromObj(tls, interp, itemPtr, bp+40) } result = v32 if result != TCL_OK { goto done } if *(*TTcl_WideInt)(unsafe.Pointer(bp + 32)) == *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) { match = 0 } else { if *(*TTcl_WideInt)(unsafe.Pointer(bp + 32)) < *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) { match = -int32(1) } else { match = int32(1) } } case 3: result = XTcl_GetDoubleFromObj(tls, interp, itemPtr, bp+64) if result != TCL_OK { goto done } if *(*float64)(unsafe.Pointer(bp + 56)) == *(*float64)(unsafe.Pointer(bp + 64)) { match = 0 } else { if *(*float64)(unsafe.Pointer(bp + 56)) < *(*float64)(unsafe.Pointer(bp + 64)) { match = -int32(1) } else { match = int32(1) } } break } if match == 0 { /* * Normally, binary search is written to stop when it finds a * match. If there are duplicates of an element in the list, * our first match might not be the first occurrence. * Consider: 0 0 0 1 1 1 2 2 2 * * To maintain consistency with standard lsearch semantics, we * must find the leftmost occurrence of the pattern in the * list. Thus we don't just stop searching here. This * variation means that a search always makes log n * comparisons (normal binary search might "get lucky" with an * early comparison). * * In bisect mode though, we want the last of equals. */ index = i if bisect != 0 { lower = i } else { upper = i } } else { if match > 0 { if isIncreasing != 0 { lower = i } else { upper = i } } else { if isIncreasing != 0 { upper = i } else { lower = i } } } } if bisect != 0 && index < 0 { index = lower } } else { /* * We need to do a linear search, because (at least one) of: * - our matcher can only tell equal vs. not equal * - our matching sense is negated * - we're building a list of all matched items */ if allMatches != 0 { listPtr = XTcl_NewListObj(tls, 0, libc.UintptrFromInt32(0)) } i = *(*TTcl_Size)(unsafe.Pointer(bp + 24)) for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } match = 0 v34 = itemPtr if v34 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v34)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v34 v36 = _objPtr v35 = *(*TTcl_Size)(unsafe.Pointer(v36)) *(*TTcl_Size)(unsafe.Pointer(v36))-- if v35 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } itemPtr = libc.UintptrFromInt32(0) if (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc != 0 { itemPtr = _SelectObjFromSublist(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i+groupOffset)*8)), bp+72) if (*(*TSortInfo)(unsafe.Pointer(bp + 72))).FresultCode != TCL_OK { if listPtr != libc.UintptrFromInt32(0) { _objPtr2 = listPtr v38 = _objPtr2 v37 = *(*TTcl_Size)(unsafe.Pointer(v38)) *(*TTcl_Size)(unsafe.Pointer(v38))-- if v37 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } result = (*(*TSortInfo)(unsafe.Pointer(bp + 72))).FresultCode goto done } } else { itemPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i+groupOffset)*8)) } switch mode { case 3: fallthrough case 0: switch dataType { case 0: if (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Flength v39 = (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes } else { v39 = XTcl_GetStringFromObj(tls, itemPtr, bp+16) } bytes = v39 if *(*TTcl_Size)(unsafe.Pointer(bp)) == *(*TTcl_Size)(unsafe.Pointer(bp + 16)) { /* * This split allows for more optimal compilation of * memcmp/strcasecmp. */ if noCase != 0 { match = libc.BoolInt32(XTclUtfCasecmp(tls, bytes, patternBytes) == 0) } else { match = libc.BoolInt32(libc.Xmemcmp(tls, bytes, patternBytes, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))) == 0) } } case 1: if (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 { v40 = (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes } else { v40 = XTcl_GetStringFromObj(tls, itemPtr, libc.UintptrFromInt32(0)) } bytes = v40 match = libc.BoolInt32(_DictionaryCompare(tls, bytes, patternBytes) == 0) case 2: if (*TTcl_Obj)(unsafe.Pointer(itemPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(itemPtr)).FinternalRep)) v41 = libc.Int32FromInt32(TCL_OK) } else { v41 = XTcl_GetWideIntFromObj(tls, interp, itemPtr, bp+40) } result = v41 if result != TCL_OK { if listPtr != libc.UintptrFromInt32(0) { _objPtr3 = listPtr v43 = _objPtr3 v42 = *(*TTcl_Size)(unsafe.Pointer(v43)) *(*TTcl_Size)(unsafe.Pointer(v43))-- if v42 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } goto done } match = libc.BoolInt32(*(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) == *(*TTcl_WideInt)(unsafe.Pointer(bp + 32))) case 3: result = XTcl_GetDoubleFromObj(tls, interp, itemPtr, bp+64) if result != TCL_OK { if listPtr != 0 { _objPtr4 = listPtr v45 = _objPtr4 v44 = *(*TTcl_Size)(unsafe.Pointer(v45)) *(*TTcl_Size)(unsafe.Pointer(v45))-- if v44 <= int64(1) { XTclFreeObj(tls, _objPtr4) } } goto done } match = libc.BoolInt32(*(*float64)(unsafe.Pointer(bp + 64)) == *(*float64)(unsafe.Pointer(bp + 56))) break } case 1: if (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes != 0 { v46 = (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes } else { v46 = XTcl_GetStringFromObj(tls, itemPtr, libc.UintptrFromInt32(0)) } match = XTcl_StringCaseMatch(tls, v46, patternBytes, noCase) case 2: match = XTcl_RegExpExecObj(tls, interp, regexp, itemPtr, 0, 0, 0) if match < 0 { _objPtr5 = patObj v48 = _objPtr5 v47 = *(*TTcl_Size)(unsafe.Pointer(v48)) *(*TTcl_Size)(unsafe.Pointer(v48))-- if v47 <= int64(1) { XTclFreeObj(tls, _objPtr5) } if listPtr != libc.UintptrFromInt32(0) { _objPtr6 = listPtr v50 = _objPtr6 v49 = *(*TTcl_Size)(unsafe.Pointer(v50)) *(*TTcl_Size)(unsafe.Pointer(v50))-- if v49 <= int64(1) { XTclFreeObj(tls, _objPtr6) } } result = int32(TCL_ERROR) goto done } break } /* * Invert match condition for -not. */ if negatedMatch != 0 { match = libc.BoolInt32(!(match != 0)) } if !(match != 0) { goto _33 } if !(allMatches != 0) { index = i break } else { if inlineReturn != 0 { /* * Note that these appends are not expected to fail. */ if returnSubindices != 0 && (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc != 0 { v51 = itemPtr if v51 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v51)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v51 v53 = _objPtr v52 = *(*TTcl_Size)(unsafe.Pointer(v53)) *(*TTcl_Size)(unsafe.Pointer(v53))-- if v52 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } itemPtr = _SelectObjFromSublist(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i+groupOffset)*8)), bp+72) XTcl_ListObjAppendElement(tls, interp, listPtr, itemPtr) } else { if returnSubindices != 0 && (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc == 0 && groupSize > int64(1) { v54 = itemPtr if v54 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v54)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v54 v56 = _objPtr v55 = *(*TTcl_Size)(unsafe.Pointer(v56)) *(*TTcl_Size)(unsafe.Pointer(v56))-- if v55 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } itemPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i+groupOffset)*8)) XTcl_ListObjAppendElement(tls, interp, listPtr, itemPtr) } else { if groupSize > int64(1) { XTcl_ListObjReplace(tls, interp, listPtr, libc.Int64FromUint64((libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))-uint64(libc.UintptrFromInt32(0)+40))/libc.Uint64FromInt64(8)), 0, groupSize, *(*uintptr)(unsafe.Pointer(bp + 136))+uintptr(i)*8) } else { v57 = itemPtr if v57 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v57)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v57 v59 = _objPtr v58 = *(*TTcl_Size)(unsafe.Pointer(v59)) *(*TTcl_Size)(unsafe.Pointer(v59))-- if v58 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } itemPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i)*8)) XTcl_ListObjAppendElement(tls, interp, listPtr, itemPtr) } } } } else { if returnSubindices != 0 { if v60 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v60 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v60 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { itemPtr = XTclThreadAllocObj(tls) } else { itemPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(itemPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(itemPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(itemPtr)).FinternalRep)) = i + groupOffset (*TTcl_Obj)(unsafe.Pointer(itemPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) j1 = 0 for { if !(j1 < (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc) { break } elValue = libc.Uint64FromInt64(XTclIndexDecode(tls, *(*int32)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv + uintptr(j1)*4)), *(*TTcl_Size)(unsafe.Pointer(bp + 8)))) if v62 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v62 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v62 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { elObj = XTclThreadAllocObj(tls) } else { elObj = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(elObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(elObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(elObj)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(elObj)).FinternalRep)) = libc.Int64FromUint64(elValue) (*TTcl_Obj)(unsafe.Pointer(elObj)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) XTcl_ListObjAppendElement(tls, interp, itemPtr, elObj) goto _61 _61: ; j1++ } XTcl_ListObjAppendElement(tls, interp, listPtr, itemPtr) } else { XTcl_ListObjAppendElement(tls, interp, listPtr, XTcl_NewWideIntObj(tls, i)) } } } goto _33 _33: ; i = i + groupSize } } v63 = itemPtr if v63 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v63)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v63 v65 = _objPtr v64 = *(*TTcl_Size)(unsafe.Pointer(v65)) *(*TTcl_Size)(unsafe.Pointer(v65))-- if v64 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } itemPtr = libc.UintptrFromInt32(0) /* * Return everything or a single value. */ if allMatches != 0 { XTcl_SetObjResult(tls, interp, listPtr) } else { if !(inlineReturn != 0) { if returnSubindices != 0 { if v66 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v66 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v66 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { itemPtr = XTclThreadAllocObj(tls) } else { itemPtr = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(itemPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(itemPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(itemPtr)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(itemPtr)).FinternalRep)) = index + groupOffset (*TTcl_Obj)(unsafe.Pointer(itemPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) j2 = 0 for { if !(j2 < (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexc) { break } elValue1 = libc.Uint64FromInt64(XTclIndexDecode(tls, *(*int32)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv + uintptr(j2)*4)), *(*TTcl_Size)(unsafe.Pointer(bp + 8)))) if v68 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v68 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v68 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { elObj1 = XTclThreadAllocObj(tls) } else { elObj1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(elObj1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(elObj1)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(elObj1)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(elObj1)).FinternalRep)) = libc.Int64FromUint64(elValue1) (*TTcl_Obj)(unsafe.Pointer(elObj1)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) XTcl_ListObjAppendElement(tls, interp, itemPtr, elObj1) goto _67 _67: ; j2++ } XTcl_SetObjResult(tls, interp, itemPtr) } else { if v69 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v69 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v69 || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == libc.Uint64FromInt32(0) { elObj2 = XTclThreadAllocObj(tls) } else { elObj2 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(elObj2 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(elObj2)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(elObj2)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(elObj2)).FinternalRep)) = index (*TTcl_Obj)(unsafe.Pointer(elObj2)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) XTcl_SetObjResult(tls, interp, elObj2) } } else { if index < 0 { /* * Is this superfluous? The result should be a blank object by * default... */ XTcl_SetObjResult(tls, interp, XTcl_NewObj(tls)) } else { if returnSubindices != 0 { XTcl_SetObjResult(tls, interp, _SelectObjFromSublist(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(i+groupOffset)*8)), bp+72)) } else { if groupSize > int64(1) { XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, groupSize, *(*uintptr)(unsafe.Pointer(bp + 136))+uintptr(index)*8)) } else { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)) + uintptr(index)*8))) } } } } } result = TCL_OK /* * Cleanup the index list array. */ goto done done: ; /* potential lingering abstract list element */ v70 = itemPtr if v70 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v70)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v70 v72 = _objPtr v71 = *(*TTcl_Size)(unsafe.Pointer(v72)) *(*TTcl_Size)(unsafe.Pointer(v72))-- if v71 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } if startPtr != libc.UintptrFromInt32(0) { _objPtr7 = startPtr v74 = _objPtr7 v73 = *(*TTcl_Size)(unsafe.Pointer(v74)) *(*TTcl_Size)(unsafe.Pointer(v74))-- if v73 <= int64(1) { XTclFreeObj(tls, _objPtr7) } } if allocatedIndexVector != 0 { XTclStackFree(tls, interp, (*(*TSortInfo)(unsafe.Pointer(bp + 72))).Findexv) } return result } var _options3 = [20]uintptr{ 0: __ccgo_ts + 17462, 1: __ccgo_ts + 17467, 2: __ccgo_ts + 17474, 3: __ccgo_ts + 17482, 4: __ccgo_ts + 17494, 5: __ccgo_ts + 17506, 6: __ccgo_ts + 17513, 7: __ccgo_ts + 17519, 8: __ccgo_ts + 17531, 9: __ccgo_ts + 17538, 10: __ccgo_ts + 17546, 11: __ccgo_ts + 17555, 12: __ccgo_ts + 17563, 13: __ccgo_ts + 17568, 14: __ccgo_ts + 17574, 15: __ccgo_ts + 17582, 16: __ccgo_ts + 17590, 17: __ccgo_ts + 17597, 18: __ccgo_ts + 17605, 19: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * SequenceIdentifyArgument -- * (for [lseq] command) * * Given a Tcl_Obj, identify if it is a keyword or a number * * Return Value * 0 - failure, unexpected value * 1 - value is a number * 2 - value is an operand keyword * 3 - value is a by keyword * * The decoded value will be assigned to the appropriate * pointer, numValuePtr reference count is incremented. */ func _SequenceIdentifyArgument(tls *libc.TLS, interp uintptr, argPtr uintptr, allowedArgs int32, numValuePtr uintptr, keywordIndexPtr uintptr) (r TSequenceDecoded) { bp := tls.Alloc(48) defer tls.Free(48) /* Return keyword enum */ var result int32 var v3 uintptr var _ /* exprValueObj at bp+16 */ uintptr var _ /* internalPtr at bp+8 */ uintptr var _ /* keyword at bp+24 */ int32 var _ /* opmode at bp+0 */ TSequenceOperators _, _ = result, v3 result = int32(TCL_ERROR) if allowedArgs&int32(NumericArg) != 0 { /* speed-up a bit (and avoid shimmer for compiled expressions) */ if (*TTcl_Obj)(unsafe.Pointer(argPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclExprCodeType)) { goto doExpr } result = XTcl_GetNumberFromObj(tls, libc.UintptrFromInt32(0), argPtr, bp+8, keywordIndexPtr) if result == TCL_OK { *(*uintptr)(unsafe.Pointer(numValuePtr)) = argPtr (*TTcl_Obj)(unsafe.Pointer(argPtr)).FrefCount++ return int32(NumericArg) } } if allowedArgs&int32(RangeKeywordArg) != 0 { result = XTcl_GetIndexFromObjStruct(tls, libc.UintptrFromInt32(0), argPtr, uintptr(unsafe.Pointer(&_seq_operations)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+18136, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int32(6) { /* Too many arguments */ goto syntax } i = int32(1) for { if !(i < objc) { break } arg_key = arg_key * int32(10) numValues[value_i] = libc.UintptrFromInt32(0) if i == objc-int32(1) { v2 = int32(LastArg) } else { v2 = 0 } decoded = _SequenceIdentifyArgument(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), allowedArgs|v2, bp, bp+8) switch decoded { case int32(NoneArg): /* * Unrecognizable argument * Reproduce operation error message */ status = XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_seq_operations)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+18172, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< 0 { v13 = int32(1) } else { v13 = 0 } useDoubles -= v13 XTcl_GetDoubleFromObj(tls, libc.UintptrFromInt32(0), elementCount, bp+16) if libc.Xfloor(tls, *(*float64)(unsafe.Pointer(bp + 16))) == *(*float64)(unsafe.Pointer(bp + 16)) { if *(*float64)(unsafe.Pointer(bp + 16)) >= float64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) || *(*float64)(unsafe.Pointer(bp + 16)) <= float64(libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))+libc.Uint64FromInt32(1))) { if XTcl_InitBignumFromDouble(tls, libc.UintptrFromInt32(0), *(*float64)(unsafe.Pointer(bp + 16)), bp+24) == TCL_OK { elementCount = XTcl_NewBignumObj(tls, bp+24) *(*int32)(unsafe.Pointer(bp + 8)) = int32(TCL_NUMBER_INT) } /* Infinity, don't convert, let fail later */ } else { elementCount = XTcl_NewWideIntObj(tls, int64(*(*float64)(unsafe.Pointer(bp + 16)))) *(*int32)(unsafe.Pointer(bp + 8)) = int32(TCL_NUMBER_INT) } } } /* * Success! Now lets create the series object. */ arithSeriesPtr = XTclNewArithSeriesObj(tls, interp, useDoubles, start, end, step, elementCount) status = int32(TCL_ERROR) if arithSeriesPtr != 0 { status = TCL_OK XTcl_SetObjResult(tls, interp, arithSeriesPtr) } goto done done: ; // Free number arguments. for { value_i-- v14 = value_i if !(v14 >= 0) { break } if numValues[value_i] != 0 { if elementCount == numValues[value_i] { elementCount = libc.UintptrFromInt32(0) } _objPtr = numValues[value_i] v16 = _objPtr v15 = *(*TTcl_Size)(unsafe.Pointer(v16)) *(*TTcl_Size)(unsafe.Pointer(v16))-- if v15 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } if elementCount != 0 { _objPtr1 = elementCount v18 = _objPtr1 v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if v17 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } /* Undef constants */ return status } /* *---------------------------------------------------------------------- * * Tcl_LsetObjCmd -- * * This procedure is invoked to process the "lset" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LsetObjCmd(tls *libc.TLS, dummy4423 uintptr, interp1 uintptr, objc int32, objv uintptr) (r int32) { /* Argument values. */ var _objPtr, finalValuePtr, listPtr, proc, v1, v2, v3, v4, v7 uintptr var v6 TTcl_Size _, _, _, _, _, _, _, _, _, _ = _objPtr, finalValuePtr, listPtr, proc, v1, v2, v3, v4, v6, v7 /* Value finally assigned to the variable. */ /* * Check parameter count. */ if objc < int32(3) { XTcl_WrongNumArgs(tls, interp1, int64(1), objv, __ccgo_ts+18202) return int32(TCL_ERROR) } /* * Look up the list variable's value. */ listPtr = XTcl_ObjGetVar2(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), int32(TCL_LEAVE_ERR_MSG)) if listPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * Substitute the value in the value. Return either the value or else an * unshared copy of it. */ if objc == int32(4) { finalValuePtr = XTclLsetList(tls, interp1, listPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(objv + 3*8))) } else { if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+88) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+88) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr)).Fversion) { v1 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr)).FsetElementProc } else { v1 = libc.UintptrFromInt32(0) } if v1 != 0 { v2 = listPtr if (*TTcl_Obj)(unsafe.Pointer(v2)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+88) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+88) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v2)).FtypePtr)).Fversion) { v3 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v2)).FtypePtr)).FsetElementProc } else { v3 = libc.UintptrFromInt32(0) } proc = v3 v4 = (*(*func(*libc.TLS, uintptr, uintptr, TTcl_Size, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, interp1, v2, int64(objc-int32(3)), objv+uintptr(2)*8, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8))) goto _5 _5: finalValuePtr = v4 if finalValuePtr != 0 { (*TTcl_Obj)(unsafe.Pointer(finalValuePtr)).FrefCount++ } } else { finalValuePtr = XTclLsetFlat(tls, interp1, listPtr, int64(objc-int32(3)), objv+uintptr(2)*8, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8))) } } /* * If substitution has failed, bail out. */ if finalValuePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * Finally, update the variable so that traces fire. */ listPtr = XTcl_ObjSetVar2(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), finalValuePtr, int32(TCL_LEAVE_ERR_MSG)) _objPtr = finalValuePtr v7 = _objPtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr) } if listPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * Return the new value of the variable as the interpreter result. */ XTcl_SetObjResult(tls, interp1, listPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_LsortObjCmd -- * * This procedure is invoked to process the "lsort" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LsortObjCmd(tls *libc.TLS, dummy4516 uintptr, interp1 uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) /* Argument values. */ var allocatedIndexVector, group, indexc, indices, nocase, result, sortMode, v2, v22, v24, v31, v7 int32 var cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cmdPtr, elementArray, elementPtr, indexPtr, listObj, newArray, newCommandPtr, newObjPtr, objPtr1, proc, resultPtr, v14, v17, v19, v20, v21, v30, v46, v49, v6 uintptr var elmArrSize, groupOffset, i, idx, j, v13, v16, v38, v39, v42, v44, v45, v48 TTcl_Size var groupSize TTcl_WideInt var subList [31]uintptr var v10, v25, v26, v3, v34, v4, v9 int64 var v12, v15, v18, v37, v41, v47, v50 bool var _ /* a at bp+128 */ TTcl_WideInt var _ /* a at bp+136 */ float64 var _ /* encoded at bp+112 */ int32 var _ /* index at bp+88 */ int32 var _ /* indexv at bp+104 */ uintptr var _ /* indexv at bp+120 */ uintptr var _ /* length at bp+0 */ TTcl_Size var _ /* listObjPtrs at bp+16 */ uintptr var _ /* listRep at bp+144 */ TListRep var _ /* sortInfo at bp+24 */ TSortInfo var _ /* sortindex at bp+96 */ TTcl_Size var _ /* wide at bp+8 */ TTcl_WideInt _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = allocatedIndexVector, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cmdPtr, elementArray, elementPtr, elmArrSize, group, groupOffset, groupSize, i, idx, indexPtr, indexc, indices, j, listObj, newArray, newCommandPtr, newObjPtr, nocase, objPtr1, proc, result, resultPtr, sortMode, subList, v10, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v24, v25, v26, v3, v30, v31, v34, v37, v38, v39, v4, v41, v42, v44, v45, v46, v47, v48, v49, v50, v6, v7, v9 nocase = 0 sortMode = SORTMODE_ASCII allocatedIndexVector = 0 elementArray = libc.UintptrFromInt32(0) if objc < int32(2) { XTcl_WrongNumArgs(tls, interp1, int64(1), objv, __ccgo_ts+18262) return int32(TCL_ERROR) } /* * Parse arguments to set up the mode for the sort. */ (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FisIncreasing = int32(1) (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FsortMode = SORTMODE_ASCII (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexv = libc.UintptrFromInt32(0) (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexc = 0 (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Funique = 0 (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Finterp = interp1 (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode = TCL_OK cmdPtr = libc.UintptrFromInt32(0) indices = 0 group = 0 groupSize = int64(1) groupOffset = 0 indexPtr = libc.UintptrFromInt32(0) i = int64(1) for { if !(i < int64(objc-int32(1))) { break } if XTcl_GetIndexFromObjStruct(tls, interp1, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_switches)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(newCommandPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(newCommandPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(newCommandPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(newCommandPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(newCommandPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(newCommandPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v15 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v15 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v15 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, newCommandPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(newCommandPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = newCommandPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, newCommandPtr) } } v17 = newObjPtr v16 = *(*TTcl_Size)(unsafe.Pointer(v17)) *(*TTcl_Size)(unsafe.Pointer(v17))-- if !(v16 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(newObjPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(newObjPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(newObjPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(newObjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(newObjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(newObjPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v18 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v18 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v18 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, newObjPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(newObjPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = newObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, newObjPtr) } } (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode = int32(TCL_ERROR) goto done } XTcl_ListObjAppendElement(tls, interp1, newCommandPtr, XTcl_NewObj(tls)) (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr = newCommandPtr } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+80) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+80) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr)).Fversion) { v19 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr)).FgetElementsProc } else { v19 = libc.UintptrFromInt32(0) } if v19 != 0 { v20 = listObj if (*TTcl_Obj)(unsafe.Pointer(v20)).FtypePtr != 0 && (libc.Bool(uint64(libc.UintptrFromInt32(0)+80) < uint64(libc.UintptrFromInt32(0)+40)) || uint64(libc.UintptrFromInt32(0)+80) < (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v20)).FtypePtr)).Fversion) { v21 = (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(v20)).FtypePtr)).FgetElementsProc } else { v21 = libc.UintptrFromInt32(0) } proc = v21 v22 = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{proc})))(tls, interp1, v20, bp, bp+16) goto _23 _23: (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode = v22 } else { if (*TTcl_Obj)(unsafe.Pointer(listObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2 != 0 { v25 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2)).FspanStart } else { v25 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1 + 40 + uintptr(v25)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2 != 0 { v26 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2)).FspanLength } else { v26 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v26 v24 = libc.Int32FromInt32(TCL_OK) } else { v24 = XTcl_ListObjGetElements(tls, interp1, listObj, bp, bp+16) } (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode = v24 } if (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode != TCL_OK || *(*TTcl_Size)(unsafe.Pointer(bp)) <= 0 { goto done } /* * Check for sanity when grouping elements of the overall list together * because of the -stride option. [TIP #326] */ if group != 0 { if *(*TTcl_Size)(unsafe.Pointer(bp))%groupSize != 0 { XTcl_SetObjResult(tls, interp1, XTcl_NewStringObj(tls, __ccgo_ts+17999, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp1, libc.VaList(bp+168, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+18377, __ccgo_ts+17773, libc.UintptrFromInt32(0))) (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode = int32(TCL_ERROR) goto done } *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_Size)(unsafe.Pointer(bp)) / groupSize if (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexc > 0 { /* * Use the first value in the list supplied to -index as the * offset of the element within each group by which to sort. */ groupOffset = XTclIndexDecode(tls, *(*int32)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexv)), groupSize-int64(1)) if groupOffset < 0 || groupOffset >= groupSize { XTcl_SetObjResult(tls, interp1, XTcl_NewStringObj(tls, __ccgo_ts+18049, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp1, libc.VaList(bp+168, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+18377, __ccgo_ts+18127, libc.UintptrFromInt32(0))) (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode = int32(TCL_ERROR) goto done } if (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexc == int64(1) { (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexc = 0 (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexv = libc.UintptrFromInt32(0) } else { (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexc-- /* * Do not shrink the actual memory block used; that doesn't * work with TclStackAlloc-allocated memory. [Bug 2918962] * * TODO: Consider a pointer increment to replace this * array shift. */ i = 0 for { if !(i < (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexc) { break } *(*int32)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexv + uintptr(i)*4)) = *(*int32)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexv + uintptr(i+int64(1))*4)) goto _27 _27: ; i++ } } } } (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FnumElements = int32(*(*TTcl_Size)(unsafe.Pointer(bp))) indexc = int32((*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexc) sortMode = (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FsortMode if sortMode == int32(SORTMODE_ASCII_NC) || sortMode == int32(SORTMODE_DICTIONARY) { /* * For this function's purpose all string-based modes are equivalent */ sortMode = SORTMODE_ASCII } /* * Initialize the sublists. After the following loop, subList[i] will * contain a sorted sublist of length 2**i. Use one extra subList at the * end, always at NULL, to indicate the end of the lists. */ j = 0 for { if !(j <= int64(NUM_LISTS)) { break } subList[j] = libc.UintptrFromInt32(0) goto _28 _28: ; j++ } /* * The following loop creates a SortElement for each list element and * begins sorting it into the sublists as it appears. */ elmArrSize = libc.Int64FromUint64(libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp))) * uint64(24)) if elmArrSize <= int64(MAXCALLOC) { elementArray = XTcl_Alloc(tls, libc.Uint64FromInt64(elmArrSize)) } else { elementArray = libc.Xmalloc(tls, libc.Uint64FromInt64(elmArrSize)) } if !(elementArray != 0) { XTcl_SetObjResult(tls, interp1, XTcl_ObjPrintf(tls, __ccgo_ts+18383, libc.VaList(bp+168, *(*TTcl_Size)(unsafe.Pointer(bp))))) XTcl_SetErrorCode(tls, interp1, libc.VaList(bp+168, __ccgo_ts+2004, __ccgo_ts+2008, libc.UintptrFromInt32(0))) (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode = int32(TCL_ERROR) goto done } i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp))) { break } idx = groupSize*i + groupOffset if indexc != 0 { /* * If this is an indexed sort, retrieve the corresponding element */ indexPtr = _SelectObjFromSublist(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(idx)*8)), bp+24) if (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode != TCL_OK { goto done } } else { indexPtr = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(idx)*8)) } /* * Determine the "value" of this object for sorting purposes */ if sortMode == SORTMODE_ASCII { if (*TTcl_Obj)(unsafe.Pointer(indexPtr)).Fbytes != 0 { v30 = (*TTcl_Obj)(unsafe.Pointer(indexPtr)).Fbytes } else { v30 = XTcl_GetStringFromObj(tls, indexPtr, libc.UintptrFromInt32(0)) } *(*uintptr)(unsafe.Pointer(elementArray + uintptr(i)*24)) = v30 } else { if sortMode == int32(SORTMODE_INTEGER) { if (*TTcl_Obj)(unsafe.Pointer(indexPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 128)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(indexPtr)).FinternalRep)) v31 = libc.Int32FromInt32(TCL_OK) } else { v31 = XTcl_GetWideIntFromObj(tls, (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Finterp, indexPtr, bp+128) } if v31 != TCL_OK { (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode = int32(TCL_ERROR) goto done } *(*TTcl_WideInt)(unsafe.Pointer(elementArray + uintptr(i)*24)) = *(*TTcl_WideInt)(unsafe.Pointer(bp + 128)) } else { if sortMode == int32(SORTMODE_REAL) { if XTcl_GetDoubleFromObj(tls, (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Finterp, indexPtr, bp+136) != TCL_OK { (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode = int32(TCL_ERROR) goto done } *(*float64)(unsafe.Pointer(elementArray + uintptr(i)*24)) = *(*float64)(unsafe.Pointer(bp + 136)) } else { *(*uintptr)(unsafe.Pointer(elementArray + uintptr(i)*24)) = indexPtr } } } /* * Determine the representation of this element in the result: either * the objPtr itself, or its index in the original list. */ if indices != 0 || group != 0 { *(*Tsize_t)(unsafe.Pointer(elementArray + uintptr(i)*24 + 8)) = libc.Uint64FromInt64(idx) } else { *(*uintptr)(unsafe.Pointer(elementArray + uintptr(i)*24 + 8)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(idx)*8)) } /* * Merge this element in the preexisting sublists (and merge together * sublists when we have two of the same size). */ (*(*TSortElement)(unsafe.Pointer(elementArray + uintptr(i)*24))).FnextPtr = libc.UintptrFromInt32(0) elementPtr = elementArray + uintptr(i)*24 j = 0 for { if !(subList[j] != 0) { break } elementPtr = _MergeLists(tls, subList[j], elementPtr, bp+24) subList[j] = libc.UintptrFromInt32(0) goto _32 _32: ; j++ } if j >= int64(NUM_LISTS) { j = int64(libc.Int32FromInt32(NUM_LISTS) - libc.Int32FromInt32(1)) } subList[j] = elementPtr goto _29 _29: ; i++ } /* * Merge all sublists */ elementPtr = subList[0] j = int64(1) for { if !(j < int64(NUM_LISTS)) { break } elementPtr = _MergeLists(tls, subList[j], elementPtr, bp+24) goto _33 _33: ; j++ } /* * Now store the sorted elements in the result list. */ if (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode == TCL_OK { resultPtr = XTcl_NewListObj(tls, int64((*(*TSortInfo)(unsafe.Pointer(bp + 24))).FnumElements)*groupSize, libc.UintptrFromInt32(0)) (*TListRep)(unsafe.Pointer(bp + 144)).FstorePtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultPtr + 32))).Fptr1 (*TListRep)(unsafe.Pointer(bp + 144)).FspanPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultPtr + 32))).Fptr2 if (*TListRep)(unsafe.Pointer(bp+144)).FspanPtr != 0 { v34 = (*TListSpan)(unsafe.Pointer((*TListRep)(unsafe.Pointer(bp + 144)).FspanPtr)).FspanStart } else { v34 = (*TListStore)(unsafe.Pointer((*TListRep)(unsafe.Pointer(bp + 144)).FstorePtr)).FfirstUsed } newArray = (*TListRep)(unsafe.Pointer(bp+144)).FstorePtr + 40 + uintptr(v34)*8 if group != 0 { i = 0 for { if !(elementPtr != libc.UintptrFromInt32(0)) { break } idx = libc.Int64FromUint64(*(*Tsize_t)(unsafe.Pointer(elementPtr + 8))) j = 0 for { if !(j < groupSize) { break } if indices != 0 { if v37 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v37 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v37 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { objPtr1 = XTclThreadAllocObj(tls) } else { objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(objPtr1)).FinternalRep)) = idx + j - groupOffset (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) v38 = i i++ *(*uintptr)(unsafe.Pointer(newArray + uintptr(v38)*8)) = objPtr1 (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FrefCount++ } else { objPtr1 = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(idx+j-groupOffset)*8)) v39 = i i++ *(*uintptr)(unsafe.Pointer(newArray + uintptr(v39)*8)) = objPtr1 (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FrefCount++ } goto _36 _36: ; j++ } goto _35 _35: ; elementPtr = (*TSortElement)(unsafe.Pointer(elementPtr)).FnextPtr } } else { if indices != 0 { i = 0 for { if !(elementPtr != libc.UintptrFromInt32(0)) { break } if v41 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v41 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v41 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { objPtr1 = XTclThreadAllocObj(tls) } else { objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(objPtr1)).FinternalRep)) = libc.Int64FromUint64(*(*Tsize_t)(unsafe.Pointer(elementPtr + 8))) (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) v42 = i i++ *(*uintptr)(unsafe.Pointer(newArray + uintptr(v42)*8)) = objPtr1 (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FrefCount++ goto _40 _40: ; elementPtr = (*TSortElement)(unsafe.Pointer(elementPtr)).FnextPtr } } else { i = 0 for { if !(elementPtr != libc.UintptrFromInt32(0)) { break } objPtr1 = *(*uintptr)(unsafe.Pointer(elementPtr + 8)) v44 = i i++ *(*uintptr)(unsafe.Pointer(newArray + uintptr(v44)*8)) = objPtr1 (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FrefCount++ goto _43 _43: ; elementPtr = (*TSortElement)(unsafe.Pointer(elementPtr)).FnextPtr } } } (*TListStore)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 144))).FstorePtr)).FnumUsed = i if (*(*TListRep)(unsafe.Pointer(bp + 144))).FspanPtr != 0 { (*TListSpan)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 144))).FspanPtr)).FspanStart = (*TListStore)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 144))).FstorePtr)).FfirstUsed (*TListSpan)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 144))).FspanPtr)).FspanLength = (*TListStore)(unsafe.Pointer((*(*TListRep)(unsafe.Pointer(bp + 144))).FstorePtr)).FnumUsed } XTcl_SetObjResult(tls, interp1, resultPtr) } goto done done: ; if sortMode == int32(SORTMODE_COMMAND) { v46 = (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr v45 = *(*TTcl_Size)(unsafe.Pointer(v46)) *(*TTcl_Size)(unsafe.Pointer(v46))-- if !(v45 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v47 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v47 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v47 || ((*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++ } } else { XTclFreeObj(tls, (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr) } } v49 = listObj v48 = *(*TTcl_Size)(unsafe.Pointer(v49)) *(*TTcl_Size)(unsafe.Pointer(v49))-- if !(v48 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(listObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(listObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(listObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(listObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(listObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(listObj)).Flength = int64(-libc.Int32FromInt32(1)) if v50 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v50 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v50 || ((*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, listObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = listObj (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++ } } else { XTclFreeObj(tls, listObj) } } (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FcompareCmdPtr = libc.UintptrFromInt32(0) } if allocatedIndexVector != 0 { XTclStackFree(tls, interp1, (*(*TSortInfo)(unsafe.Pointer(bp + 24))).Findexv) } if elementArray != 0 { if elmArrSize <= int64(MAXCALLOC) { XTclpFree(tls, elementArray) } else { libc.Xfree(tls, elementArray) } } return (*(*TSortInfo)(unsafe.Pointer(bp + 24))).FresultCode } /* This array holds pointers to temporary * lists built during the merge sort. Element * i of the array holds a list of length * 2**i. */ var _switches = [13]uintptr{ 0: __ccgo_ts + 17467, 1: __ccgo_ts + 18236, 2: __ccgo_ts + 17482, 3: __ccgo_ts + 17494, 4: __ccgo_ts + 17519, 5: __ccgo_ts + 17531, 6: __ccgo_ts + 18245, 7: __ccgo_ts + 17546, 8: __ccgo_ts + 17555, 9: __ccgo_ts + 17568, 10: __ccgo_ts + 17597, 11: __ccgo_ts + 18254, 12: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * Tcl_LeditObjCmd -- * * This procedure is invoked to process the "ledit" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_LeditObjCmd(tls *libc.TLS, dummy5033 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument values. */ var _objPtr, finalValuePtr, listPtr, v6 uintptr var createdNewObj, result, v1, v3, v4 int32 var numToDelete, v5 TTcl_Size var v2 int64 var _ /* first at bp+0 */ TTcl_Size var _ /* last at bp+8 */ TTcl_Size var _ /* listLen at bp+16 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, createdNewObj, finalValuePtr, listPtr, numToDelete, result, v1, v2, v3, v4, v5, v6 if objc < int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+18430) return int32(TCL_ERROR) } listPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), int32(TCL_LEAVE_ERR_MSG)) if listPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * TODO - refactor the index extraction into a common function shared * by Tcl_{Lrange,Lreplace,Ledit}ObjCmd */ if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, listPtr, bp+16) } result = v1 if result != TCL_OK { return result } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp + 16))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp + 16))-libc.Int64FromInt32(1), bp) } result = v3 if result != TCL_OK { return result } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp + 16))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*TTcl_Size)(unsafe.Pointer(bp + 16))-libc.Int64FromInt32(1), bp+8) } result = v4 if result != TCL_OK { return result } if *(*TTcl_Size)(unsafe.Pointer(bp)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 } else { if *(*TTcl_Size)(unsafe.Pointer(bp)) > *(*TTcl_Size)(unsafe.Pointer(bp + 16)) { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_Size)(unsafe.Pointer(bp + 16)) } } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) >= *(*TTcl_Size)(unsafe.Pointer(bp + 16)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 16)) - int64(1) } if *(*TTcl_Size)(unsafe.Pointer(bp)) <= *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { numToDelete = libc.Int64FromUint64(libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) - libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp))) + uint64(1)) /* See [3d3124d01d] */ } else { numToDelete = 0 } if (*TTcl_Obj)(unsafe.Pointer(listPtr)).FrefCount > int64(1) { listPtr = XTclListObjCopy(tls, libc.UintptrFromInt32(0), listPtr) createdNewObj = int32(1) } else { createdNewObj = 0 } result = XTcl_ListObjReplace(tls, interp, listPtr, *(*TTcl_Size)(unsafe.Pointer(bp)), numToDelete, int64(objc-int32(4)), objv+uintptr(4)*8) if result != TCL_OK { if createdNewObj != 0 { _objPtr = listPtr v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return result } /* * Tcl_ObjSetVar2 may return a value different from listPtr in the * presence of traces etc. */ finalValuePtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), listPtr, int32(TCL_LEAVE_ERR_MSG)) if finalValuePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, finalValuePtr) return TCL_OK } /* *---------------------------------------------------------------------- * * MergeLists - * * This procedure combines two sorted lists of SortElement structures * into a single sorted list. * * Results: * The unified list of SortElement structures. * * Side effects: * If infoPtr->unique is set then infoPtr->numElements may be updated. * Possibly others, if a user-defined comparison command does something * weird. * * Note: * If infoPtr->unique is set, the merge assumes that there are no * "repeated" elements in each of the left and right lists. In that case, * if any element of the left list is equivalent to one in the right list * it is omitted from the merged list. * * This simplified mechanism works because of the special way our * MergeSort creates the sublists to be merged and will fail to eliminate * all repeats in the general case where they are already present in * either the left or right list. A general code would need to skip * adjacent initial repeats in the left and right lists before comparing * their initial elements, at each step. * *---------------------------------------------------------------------- */ func _MergeLists(tls *libc.TLS, leftPtr uintptr, rightPtr uintptr, infoPtr uintptr) (r uintptr) { /* Information needed by the comparison * operator. */ var cmp int32 var headPtr, tailPtr uintptr _, _, _ = cmp, headPtr, tailPtr if leftPtr == libc.UintptrFromInt32(0) { return rightPtr } if rightPtr == libc.UintptrFromInt32(0) { return leftPtr } cmp = _SortCompare(tls, leftPtr, rightPtr, infoPtr) if cmp > 0 || cmp == 0 && (*TSortInfo)(unsafe.Pointer(infoPtr)).Funique != 0 { if cmp == 0 { (*TSortInfo)(unsafe.Pointer(infoPtr)).FnumElements-- leftPtr = (*TSortElement)(unsafe.Pointer(leftPtr)).FnextPtr } tailPtr = rightPtr rightPtr = (*TSortElement)(unsafe.Pointer(rightPtr)).FnextPtr } else { tailPtr = leftPtr leftPtr = (*TSortElement)(unsafe.Pointer(leftPtr)).FnextPtr } headPtr = tailPtr if !((*TSortInfo)(unsafe.Pointer(infoPtr)).Funique != 0) { for leftPtr != libc.UintptrFromInt32(0) && rightPtr != libc.UintptrFromInt32(0) { cmp = _SortCompare(tls, leftPtr, rightPtr, infoPtr) if cmp > 0 { (*TSortElement)(unsafe.Pointer(tailPtr)).FnextPtr = rightPtr tailPtr = rightPtr rightPtr = (*TSortElement)(unsafe.Pointer(rightPtr)).FnextPtr } else { (*TSortElement)(unsafe.Pointer(tailPtr)).FnextPtr = leftPtr tailPtr = leftPtr leftPtr = (*TSortElement)(unsafe.Pointer(leftPtr)).FnextPtr } } } else { for leftPtr != libc.UintptrFromInt32(0) && rightPtr != libc.UintptrFromInt32(0) { cmp = _SortCompare(tls, leftPtr, rightPtr, infoPtr) if cmp >= 0 { if cmp == 0 { (*TSortInfo)(unsafe.Pointer(infoPtr)).FnumElements-- leftPtr = (*TSortElement)(unsafe.Pointer(leftPtr)).FnextPtr } (*TSortElement)(unsafe.Pointer(tailPtr)).FnextPtr = rightPtr tailPtr = rightPtr rightPtr = (*TSortElement)(unsafe.Pointer(rightPtr)).FnextPtr } else { (*TSortElement)(unsafe.Pointer(tailPtr)).FnextPtr = leftPtr tailPtr = leftPtr leftPtr = (*TSortElement)(unsafe.Pointer(leftPtr)).FnextPtr } } } if leftPtr != libc.UintptrFromInt32(0) { (*TSortElement)(unsafe.Pointer(tailPtr)).FnextPtr = leftPtr } else { (*TSortElement)(unsafe.Pointer(tailPtr)).FnextPtr = rightPtr } return headPtr } /* *---------------------------------------------------------------------- * * SortCompare -- * * This procedure is invoked by MergeLists to determine the proper * ordering between two elements. * * Results: * A negative results means the first element comes before the * second, and a positive results means that the second element should * come first. A result of zero means the two elements are equal and it * doesn't matter which comes first. * * Side effects: * None, unless a user-defined comparison command does something weird. * *---------------------------------------------------------------------- */ func _SortCompare(tls *libc.TLS, elemPtr1 uintptr, elemPtr2 uintptr, infoPtr uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) /* Information passed from the top-level * "lsort" command. */ var a, b TTcl_WideInt var a1, b1 float64 var objPtr1, objPtr2 uintptr var v2, v4, v5 int64 var v6 int32 var _ /* objc at bp+32 */ TTcl_Size var _ /* objv at bp+8 */ uintptr var _ /* order at bp+0 */ int32 var _ /* paramObjv at bp+16 */ [2]uintptr _, _, _, _, _, _, _, _, _, _ = a, a1, b, b1, objPtr1, objPtr2, v2, v4, v5, v6 *(*int32)(unsafe.Pointer(bp)) = 0 if (*TSortInfo)(unsafe.Pointer(infoPtr)).FsortMode == SORTMODE_ASCII { *(*int32)(unsafe.Pointer(bp)) = XTclUtfCmp(tls, *(*uintptr)(unsafe.Pointer(elemPtr1)), *(*uintptr)(unsafe.Pointer(elemPtr2))) } else { if (*TSortInfo)(unsafe.Pointer(infoPtr)).FsortMode == int32(SORTMODE_ASCII_NC) { *(*int32)(unsafe.Pointer(bp)) = XTclUtfCasecmp(tls, *(*uintptr)(unsafe.Pointer(elemPtr1)), *(*uintptr)(unsafe.Pointer(elemPtr2))) } else { if (*TSortInfo)(unsafe.Pointer(infoPtr)).FsortMode == int32(SORTMODE_DICTIONARY) { *(*int32)(unsafe.Pointer(bp)) = _DictionaryCompare(tls, *(*uintptr)(unsafe.Pointer(elemPtr1)), *(*uintptr)(unsafe.Pointer(elemPtr2))) } else { if (*TSortInfo)(unsafe.Pointer(infoPtr)).FsortMode == int32(SORTMODE_INTEGER) { a = *(*TTcl_WideInt)(unsafe.Pointer(elemPtr1)) b = *(*TTcl_WideInt)(unsafe.Pointer(elemPtr2)) *(*int32)(unsafe.Pointer(bp)) = libc.BoolInt32(a >= b) - libc.BoolInt32(a <= b) } else { if (*TSortInfo)(unsafe.Pointer(infoPtr)).FsortMode == int32(SORTMODE_REAL) { a1 = *(*float64)(unsafe.Pointer(elemPtr1)) b1 = *(*float64)(unsafe.Pointer(elemPtr2)) *(*int32)(unsafe.Pointer(bp)) = libc.BoolInt32(a1 >= b1) - libc.BoolInt32(a1 <= b1) } else { if (*TSortInfo)(unsafe.Pointer(infoPtr)).FresultCode != TCL_OK { /* * Once an error has occurred, skip any future comparisons so as * to preserve the error message in sortInterp->result. */ return 0 } objPtr1 = *(*uintptr)(unsafe.Pointer(elemPtr1)) objPtr2 = *(*uintptr)(unsafe.Pointer(elemPtr2)) (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0] = objPtr1 (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[int32(1)] = objPtr2 /* * We made space in the command list for the two things to compare. * Replace them and evaluate the result. */ if (*TTcl_Obj)(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = v2 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjLength(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, (*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr, bp+32) } XTcl_ListObjReplace(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, (*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr, *(*TTcl_Size)(unsafe.Pointer(bp + 32))-int64(2), int64(2), int64(2), bp+16) if (*TTcl_Obj)(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr2)).FspanStart } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr1 + 40 + uintptr(v4)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr2)).FspanLength } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = v5 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, (*TSortInfo)(unsafe.Pointer(infoPtr)).FcompareCmdPtr, bp+32, bp+8) } (*TSortInfo)(unsafe.Pointer(infoPtr)).FresultCode = XTcl_EvalObjv(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, *(*TTcl_Size)(unsafe.Pointer(bp + 32)), *(*uintptr)(unsafe.Pointer(bp + 8)), 0) if (*TSortInfo)(unsafe.Pointer(infoPtr)).FresultCode != TCL_OK { XTcl_AppendObjToErrorInfo(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, XTcl_NewStringObj(tls, __ccgo_ts+18463, int64(-int32(1)))) return 0 } /* * Parse the result of the command. */ if (*TTcl_Obj)(unsafe.Pointer(XTcl_GetObjResult(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(XTcl_GetObjResult(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(XTcl_GetObjResult(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(XTcl_GetObjResult(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp))).FinternalRep))) v6 = libc.Int32FromInt32(TCL_OK) } else { v6 = XTcl_GetIntFromObj(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, XTcl_GetObjResult(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp), bp) } if v6 != TCL_OK { XTcl_SetObjResult(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, XTcl_NewStringObj(tls, __ccgo_ts+18487, int64(-int32(1)))) XTcl_SetErrorCode(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, libc.VaList(bp+48, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+18377, __ccgo_ts+18532, libc.UintptrFromInt32(0))) (*TSortInfo)(unsafe.Pointer(infoPtr)).FresultCode = int32(TCL_ERROR) return 0 } } } } } } if !((*TSortInfo)(unsafe.Pointer(infoPtr)).FisIncreasing != 0) { *(*int32)(unsafe.Pointer(bp)) = -*(*int32)(unsafe.Pointer(bp)) } return *(*int32)(unsafe.Pointer(bp)) } /* *---------------------------------------------------------------------- * * DictionaryCompare * * This function compares two strings as if they were being used in an * index or card catalog. The case of alphabetic characters is ignored, * except to break ties. Thus "B" comes before "b" but after "a". Also, * integers embedded in the strings compare in numerical order. In other * words, "x10y" comes after "x9y", not * before it as it would when * using strcmp(). * * Results: * A negative result means that the first element comes before the * second, and a positive result means that the second element should * come first. A result of zero means the two elements are equal and it * doesn't matter which comes first. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _DictionaryCompare(tls *libc.TLS, left uintptr, right uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* The strings to compare. */ var diff, secondaryDiff, uniLeftLower, uniRightLower, zeros int32 var v1, v2 int64 var _ /* uniLeft at bp+0 */ int32 var _ /* uniRight at bp+4 */ int32 _, _, _, _, _, _, _ = diff, secondaryDiff, uniLeftLower, uniRightLower, zeros, v1, v2 *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 secondaryDiff = 0 for int32(1) != 0 { if libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(right)))-uint32('0') < uint32(10)) != 0 && libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(left)))-uint32('0') < uint32(10)) != 0 { /* INTL: digit */ /* * There are decimal numbers embedded in the two strings. Compare * them as numbers, rather than strings. If one number has more * leading zeros than the other, the number with more leading * zeros sorts later, but only as a secondary choice. */ zeros = 0 for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(right))) == int32('0') && libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(right + 1)))-uint32('0') < uint32(10)) != 0 { right++ zeros-- } for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(left))) == int32('0') && libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(left + 1)))-uint32('0') < uint32(10)) != 0 { left++ zeros++ } if secondaryDiff == 0 { secondaryDiff = zeros } /* * The code below compares the numbers in the two strings without * ever converting them to integers. It does this by first * comparing the lengths of the numbers and then comparing the * digit values. */ diff = 0 for int32(1) != 0 { if diff == 0 { diff = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(left))) - libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(right))) } right++ left++ if !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(right)))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) { /* INTL: digit */ if libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(left)))-uint32('0') < uint32(10)) != 0 { /* INTL: digit */ return int32(1) } else { /* * The two numbers have the same length. See if their * values are different. */ if diff != 0 { return diff } break } } else { if !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(left)))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) { /* INTL: digit */ return -int32(1) } } } continue } /* * Convert character to Unicode for comparison purposes. If either * string is at the terminating null, do a byte-wise comparison and * bail out immediately. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(left))) != int32('\000') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(right))) != int32('\000') { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(left))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(left))) v1 = int64(libc.Int32FromInt32(1)) } else { v1 = XTcl_UtfToUniChar(tls, left, bp) } left += uintptr(v1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(right))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp + 4)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(right))) v2 = int64(libc.Int32FromInt32(1)) } else { v2 = XTcl_UtfToUniChar(tls, right, bp+4) } right += uintptr(v2) /* * Convert both chars to lower for the comparison, because * dictionary sorts are case-insensitive. Covert to lower, not * upper, so chars between Z and a will sort before A (where most * other interesting punctuations occur). */ uniLeftLower = XTcl_UniCharToLower(tls, *(*int32)(unsafe.Pointer(bp))) uniRightLower = XTcl_UniCharToLower(tls, *(*int32)(unsafe.Pointer(bp + 4))) } else { diff = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(left))) - libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(right))) break } diff = uniLeftLower - uniRightLower if diff != 0 { return diff } if secondaryDiff == 0 { if XTcl_UniCharIsUpper(tls, *(*int32)(unsafe.Pointer(bp))) != 0 && XTcl_UniCharIsLower(tls, *(*int32)(unsafe.Pointer(bp + 4))) != 0 { secondaryDiff = -int32(1) } else { if XTcl_UniCharIsUpper(tls, *(*int32)(unsafe.Pointer(bp + 4))) != 0 && XTcl_UniCharIsLower(tls, *(*int32)(unsafe.Pointer(bp))) != 0 { secondaryDiff = int32(1) } } } } if diff == 0 { diff = secondaryDiff } return diff } /* *---------------------------------------------------------------------- * * SelectObjFromSublist -- * * This procedure is invoked from lsearch and SortCompare. It is used for * implementing the -index option, for the lsort and lsearch commands. * * Results: * Returns NULL if a failure occurs, and sets the result in the infoPtr. * Otherwise returns the Tcl_Obj* to the item. * * Side effects: * None. * * Note: * No reference counting is done, as the result is only used internally * and never passed directly to user code. * *---------------------------------------------------------------------- */ func _SelectObjFromSublist(tls *libc.TLS, objPtr1 uintptr, infoPtr uintptr) (r uintptr) { bp := tls.Alloc(64) defer tls.Free(64) /* Information passed from the top-level * "lsearch" or "lsort" command. */ var _objPtr, lastObj, v4, v5, v6, v8 uintptr var i, v7 TTcl_Size var index, v2 int32 var v3 int64 var _ /* currentObj at bp+8 */ uintptr var _ /* listLen at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _ = _objPtr, i, index, lastObj, v2, v3, v4, v5, v6, v7, v8 /* * Quick check for case when no "-index" option is there. */ if (*TSortInfo)(unsafe.Pointer(infoPtr)).Findexc == 0 { return objPtr1 } /* * Iterate over the indices, traversing through the nested sublists as we * go. */ i = 0 for { if !(i < (*TSortInfo)(unsafe.Pointer(infoPtr)).Findexc) { break } lastObj = libc.UintptrFromInt32(0) if (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr1 + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr1 + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr1 + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v3 v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_ListObjLength(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, objPtr1, bp) } if v2 != TCL_OK { (*TSortInfo)(unsafe.Pointer(infoPtr)).FresultCode = int32(TCL_ERROR) return libc.UintptrFromInt32(0) } index = int32(XTclIndexDecode(tls, *(*int32)(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).Findexv + uintptr(i)*4)), *(*TTcl_Size)(unsafe.Pointer(bp))-int64(1))) if XTcl_ListObjIndex(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, objPtr1, int64(index), bp+8) != TCL_OK { (*TSortInfo)(unsafe.Pointer(infoPtr)).FresultCode = int32(TCL_ERROR) return libc.UintptrFromInt32(0) } if *(*uintptr)(unsafe.Pointer(bp + 8)) == libc.UintptrFromInt32(0) { if int64(index) == int64(-libc.Int32FromInt32(1)) { index = int32(int64(-libc.Int32FromInt32(2)) - int64(*(*int32)(unsafe.Pointer((*TSortInfo)(unsafe.Pointer(infoPtr)).Findexv + uintptr(i)*4)))) if (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes != 0 { v4 = (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes } else { v4 = XTcl_GetStringFromObj(tls, objPtr1, libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, XTcl_ObjPrintf(tls, __ccgo_ts+18549, libc.VaList(bp+24, index, v4))) } else { if (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes != 0 { v5 = (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes } else { v5 = XTcl_GetStringFromObj(tls, objPtr1, libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, XTcl_ObjPrintf(tls, __ccgo_ts+18590, libc.VaList(bp+24, index, v5))) } XTcl_SetErrorCode(tls, (*TSortInfo)(unsafe.Pointer(infoPtr)).Finterp, libc.VaList(bp+24, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+18377, __ccgo_ts+18627, libc.UintptrFromInt32(0))) (*TSortInfo)(unsafe.Pointer(infoPtr)).FresultCode = int32(TCL_ERROR) return libc.UintptrFromInt32(0) } objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 8)) v6 = lastObj if v6 != 0 { if (*TTcl_Obj)(unsafe.Pointer(v6)).FrefCount == libc.Int64FromInt32(0) { _objPtr = v6 v8 = _objPtr v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= libc.Int64FromInt32(1) { XTclFreeObj(tls, _objPtr) } } } lastObj = *(*uintptr)(unsafe.Pointer(bp + 8)) goto _1 _1: ; i++ } return objPtr1 } const CONCAT_TRIM_SET = " \\f\\v\\r\\t\\n" /* *---------------------------------------------------------------------- * * Tcl_PwdObjCmd -- * * This procedure is invoked to process the "pwd" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_PwdObjCmd(tls *libc.TLS, dummy89 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var _objPtr, retVal, v2 uintptr var v1 TTcl_Size _, _, _, _ = _objPtr, retVal, v1, v2 if objc != int32(1) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, libc.UintptrFromInt32(0)) return int32(TCL_ERROR) } retVal = XTcl_FSGetCwd(tls, interp) if retVal == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, retVal) _objPtr = retVal v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_RegexpObjCmd -- * * This procedure is invoked to process the "regexp" Tcl command. See * the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_RegexpObjCmd(tls *libc.TLS, dummy129 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(112) defer tls.Free(112) /* Argument objects. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, cachePtr, cachePtr1, cachePtr2, cachePtr3, name, newPtr, objPtr, resultPtr, startIndex, v10, v13, v2, v21, v23, v6 uintptr var about, all, doinline, i, indices, match, numMatchesSaved, v14, v24, v3, v4 int32 var cflags, eflags, end, matchLength, start, stringLength, v12, v20, v22, v5, v9 TTcl_Size var regExpr TTcl_RegExp var v15, v17, v18, v19 bool var _ /* index at bp+32 */ int32 var _ /* info at bp+8 */ TTcl_RegExpInfo var _ /* objs at bp+48 */ [2]uintptr var _ /* offset at bp+0 */ TTcl_Size var _ /* temp at bp+40 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, about, all, cachePtr, cachePtr1, cachePtr2, cachePtr3, cflags, doinline, eflags, end, i, indices, match, matchLength, name, newPtr, numMatchesSaved, objPtr, regExpr, resultPtr, start, startIndex, stringLength, v10, v12, v13, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v5, v6, v9 startIndex = libc.UintptrFromInt32(0) resultPtr = libc.UintptrFromInt32(0) indices = 0 about = 0 cflags = int64(TCL_REG_ADVANCED) *(*TTcl_Size)(unsafe.Pointer(bp)) = libc.Int64FromInt32(0) all = 0 doinline = 0 i = int32(1) for { if !(i < objc) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), libc.UintptrFromInt32(0)) } name = v2 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(name))) != int32('-') { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_options4)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<= objc { goto endOfForLoop } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) <= int64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))-libc.Int64FromInt32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 40)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))-libc.Int64FromInt32(1), bp+40) } if v4 != TCL_OK { goto optionError } if startIndex != 0 { _objPtr = startIndex v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } } startIndex = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) (*TTcl_Obj)(unsafe.Pointer(startIndex)).FrefCount++ case 10: i++ goto endOfForLoop } goto _1 _1: ; i++ } goto endOfForLoop endOfForLoop: ; if objc-i < int32(2)-about { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+18687) goto optionError } objc -= i objv += uintptr(i) * 8 /* * Check if the user requested -inline, but specified match variables; a * no-no. */ if doinline != 0 && objc-int32(2) != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+18741, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+18795, __ccgo_ts+18802, libc.UintptrFromInt32(0))) goto optionError } /* * Handle the odd about case separately. */ if !(about != 0) { goto _7 } regExpr = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), int32(cflags)) if !(regExpr == libc.UintptrFromInt32(0) || XTclRegAbout(tls, interp, regExpr) < 0) { goto _8 } goto optionError optionError: ; if startIndex != 0 { _objPtr1 = startIndex v10 = _objPtr1 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } return int32(TCL_ERROR) _8: ; return TCL_OK _7: ; /* * Get the length of the string that we are matching against so we can do * the termination test for -all matches. Do this before getting the * regexp to avoid shimmering problems. */ objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) stringLength = XTcl_GetCharLength(tls, objPtr) if startIndex != 0 { if (*TTcl_Obj)(unsafe.Pointer(startIndex)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(startIndex)).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(startIndex)).FinternalRep)) <= stringLength { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(startIndex)).FinternalRep)) _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_GetIntForIndex(tls, interp, startIndex, stringLength, bp) } _objPtr2 = startIndex v13 = _objPtr2 v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if v12 <= int64(1) { XTclFreeObj(tls, _objPtr2) } if *(*TTcl_Size)(unsafe.Pointer(bp)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = libc.Int64FromInt32(0) } } regExpr = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), int32(cflags)) if regExpr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } objc -= int32(2) objv += uintptr(2) * 8 if doinline != 0 { /* * Save all the subexpressions, as we will return them as a list */ numMatchesSaved = -int32(1) } else { /* * Save only enough subexpressions for matches we want to keep, expect * in the case of -all, where we need to keep at least one to know * where to move the offset. */ if objc == 0 { v14 = all } else { v14 = objc } numMatchesSaved = v14 } /* * The following loop is to handle multiple matches within the same source * string; each iteration handles one match. If "-all" hasn't been * specified then the loop body only gets executed once. We terminate the * loop when the starting offset is past the end of the string. */ for int32(1) != 0 { /* * Pass either 0 or TCL_REG_NOTBOL in the eflags. Passing * TCL_REG_NOTBOL indicates that the character at offset should not be * considered the start of the line. If for example the pattern {^} is * passed and -start is positive, then the pattern will not match the * start of the string unless the previous character is a newline. */ if *(*TTcl_Size)(unsafe.Pointer(bp)) == libc.Int64FromInt32(0) { eflags = 0 } else { if *(*TTcl_Size)(unsafe.Pointer(bp)) > stringLength { eflags = int64(TCL_REG_NOTBOL) } else { if XTcl_GetUniChar(tls, objPtr, *(*TTcl_Size)(unsafe.Pointer(bp))-int64(1)) == int32('\n') { eflags = 0 } else { eflags = int64(TCL_REG_NOTBOL) } } } match = XTcl_RegExpExecObj(tls, interp, regExpr, objPtr, *(*TTcl_Size)(unsafe.Pointer(bp)), int64(numMatchesSaved), int32(eflags)) if match < 0 { return int32(TCL_ERROR) } if match == 0 { /* * We want to set the value of the interpreter result only when * this is the first time through the loop. */ if all <= int32(1) { /* * If inlining, the interpreter's object result remains an * empty list, otherwise set it to an integer object w/ value * 0. */ if !(doinline != 0) { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, 0)) } return TCL_OK } break } /* * If additional variable names have been specified, return index * information in those variables. */ XTcl_RegExpGetInfo(tls, regExpr, bp+8) if doinline != 0 { /* * It's the number of substitutions, plus one for the matchVar at * index 0 */ objc = int32((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fnsubs + int64(1)) if all <= int32(1) { if v15 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v15 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v15 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { resultPtr = XTclThreadAllocObj(tls) } else { resultPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FtypePtr = libc.UintptrFromInt32(0) } } i = 0 for { if !(i < objc) { break } if indices != 0 { /* * Only adjust the match area if there was a match for that * area. (Scriptics Bug 4391/SF Bug #219232) */ if i <= int32((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fnsubs) && (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fmatches + uintptr(i)*16))).Fstart >= 0 { start = *(*TTcl_Size)(unsafe.Pointer(bp)) + (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fmatches + uintptr(i)*16))).Fstart end = *(*TTcl_Size)(unsafe.Pointer(bp)) + (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fmatches + uintptr(i)*16))).Fend /* * Adjust index so it refers to the last character in the * match instead of the first character after the match. */ if end >= *(*TTcl_Size)(unsafe.Pointer(bp)) { end-- } } else { start = int64(-libc.Int32FromInt32(1)) end = int64(-libc.Int32FromInt32(1)) } if v17 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v17 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v17 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[0] = XTclThreadAllocObj(tls) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[0] = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[0] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[0])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[0])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[0])).FinternalRep)) = start (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[0])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) if v18 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v18 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v18 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[int32(1)] = XTclThreadAllocObj(tls) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[int32(1)] = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[int32(1)] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[int32(1)])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[int32(1)])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[int32(1)])).FinternalRep)) = end (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 48)))[int32(1)])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) newPtr = XTcl_NewListObj(tls, int64(2), bp+48) } else { if i <= int32((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fnsubs) && (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fmatches + uintptr(i)*16))).Fend > 0 { newPtr = XTcl_GetRange(tls, objPtr, *(*TTcl_Size)(unsafe.Pointer(bp))+(*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fmatches + uintptr(i)*16))).Fstart, *(*TTcl_Size)(unsafe.Pointer(bp))+(*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fmatches + uintptr(i)*16))).Fend-int64(1)) } else { if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { newPtr = XTclThreadAllocObj(tls) } else { newPtr = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(newPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(newPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(newPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(newPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(newPtr)).FtypePtr = libc.UintptrFromInt32(0) } } if doinline != 0 { if XTcl_ListObjAppendElement(tls, interp, resultPtr, newPtr) != TCL_OK { _objPtr3 = newPtr v21 = _objPtr3 v20 = *(*TTcl_Size)(unsafe.Pointer(v21)) *(*TTcl_Size)(unsafe.Pointer(v21))-- if v20 <= int64(1) { XTclFreeObj(tls, _objPtr3) } _objPtr4 = resultPtr v23 = _objPtr4 v22 = *(*TTcl_Size)(unsafe.Pointer(v23)) *(*TTcl_Size)(unsafe.Pointer(v23))-- if v22 <= int64(1) { XTclFreeObj(tls, _objPtr4) } return int32(TCL_ERROR) } } else { if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), libc.UintptrFromInt32(0), newPtr, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } goto _16 _16: ; i++ } if all == 0 { break } /* * Adjust the offset to the character just after the last one in the * matchVar and increment all to count how many times we are making a * match. We always increment the offset by at least one to prevent * endless looping (as in the case: regexp -all {a*} a). Otherwise, * when we match the NULL string at the end of the input string, we * will loop indefinitely (because the length of the match is 0, so * offset never changes). */ matchLength = (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fmatches))).Fend - (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fmatches))).Fstart *(*TTcl_Size)(unsafe.Pointer(bp)) += (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 8))).Fmatches))).Fend /* * A match of length zero could happen for {^} {$} or {.*} and in * these cases we always want to bump the index up one. */ if matchLength == 0 { *(*TTcl_Size)(unsafe.Pointer(bp))++ } all++ if *(*TTcl_Size)(unsafe.Pointer(bp)) >= stringLength { break } } /* * Set the interpreter's object result to an integer object with value 1 * if -all wasn't specified, otherwise it's all-1 (the number of times * through the while - 1). */ if doinline != 0 { XTcl_SetObjResult(tls, interp, resultPtr) } else { if all != 0 { v24 = all - int32(1) } else { v24 = int32(1) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64(v24))) } return TCL_OK } var _options4 = [12]uintptr{ 0: __ccgo_ts + 17462, 1: __ccgo_ts + 18639, 2: __ccgo_ts + 18245, 3: __ccgo_ts + 17538, 4: __ccgo_ts + 18646, 5: __ccgo_ts + 18656, 6: __ccgo_ts + 18662, 7: __ccgo_ts + 18672, 8: __ccgo_ts + 17555, 9: __ccgo_ts + 17590, 10: __ccgo_ts + 18684, 11: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * Tcl_RegsubObjCmd -- * * This procedure is invoked to process the "regsub" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_RegsubObjCmd(tls *libc.TLS, dummy488 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) /* Argument objects. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, args, cachePtr, name, objPtr, p, resultPtr, startIndex, strCmpFn, subPtr, wend, wfirstChar, wsrc, wstring, wsubspec, v12, v13, v15, v17, v2, v21, v32, v34, v37, v39, v41, v6, v9 uintptr var all, cflags, command, match, nocase, result, wsrclc, v22, v25, v4 int32 var ch TTcl_UniChar var end, idx, numArgs, numMatches, start, stringLength, subEnd, subStart, v11, v3, v31, v36, v38, v40, v5, v8 TTcl_Size var regExpr TTcl_RegExp var v14, v16, v33 bool var v18, v23, v27, v28 int64 var _ /* index at bp+56 */ int32 var _ /* info at bp+32 */ TTcl_RegExpInfo var _ /* numParts at bp+24 */ TTcl_Size var _ /* offset at bp+16 */ TTcl_Size var _ /* parts at bp+80 */ uintptr var _ /* slen at bp+72 */ TTcl_Size var _ /* temp at bp+64 */ TTcl_Size var _ /* wlen at bp+0 */ TTcl_Size var _ /* wsublen at bp+8 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, all, args, cachePtr, cflags, ch, command, end, idx, match, name, nocase, numArgs, numMatches, objPtr, p, regExpr, result, resultPtr, start, startIndex, strCmpFn, stringLength, subEnd, subPtr, subStart, wend, wfirstChar, wsrc, wsrclc, wstring, wsubspec, v11, v12, v13, v14, v15, v16, v17, v18, v2, v21, v22, v23, v25, v27, v28, v3, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v41, v5, v6, v8, v9 *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 startIndex = libc.UintptrFromInt32(0) wsubspec = uintptr(0) cflags = int32(TCL_REG_ADVANCED) all = 0 *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = libc.Int64FromInt32(0) command = 0 resultPtr = libc.UintptrFromInt32(0) idx = int64(1) for { if !(idx < int64(objc)) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)), libc.UintptrFromInt32(0)) } name = v2 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(name))) != int32('-') { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)), uintptr(unsafe.Pointer(&_options5)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<= int64(objc) { goto endOfForLoop } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))).FinternalRep)) <= int64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))-libc.Int64FromInt32(1)) { *(*TTcl_Size)(unsafe.Pointer(bp + 64)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)), libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))-libc.Int64FromInt32(1), bp+64) } if v4 != TCL_OK { goto optionError } if startIndex != 0 { _objPtr = startIndex v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } } startIndex = *(*uintptr)(unsafe.Pointer(objv + uintptr(idx)*8)) (*TTcl_Obj)(unsafe.Pointer(startIndex)).FrefCount++ case 8: idx++ goto endOfForLoop } goto _1 _1: ; idx++ } goto endOfForLoop endOfForLoop: ; if !(int64(objc) < idx+int64(3) || int64(objc) > idx+int64(4)) { goto _7 } XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+18817) goto optionError optionError: ; if startIndex != 0 { _objPtr1 = startIndex v9 = _objPtr1 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } return int32(TCL_ERROR) _7: ; objc = int32(int64(objc) - idx) objv += uintptr(idx) * 8 if startIndex != 0 { stringLength = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) if (*TTcl_Obj)(unsafe.Pointer(startIndex)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(startIndex)).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(startIndex)).FinternalRep)) <= stringLength { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(startIndex)).FinternalRep)) _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_GetIntForIndex(tls, interp, startIndex, stringLength, bp+16) } _objPtr2 = startIndex v12 = _objPtr2 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr2) } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = 0 } } if v14 = all != 0 && *(*TTcl_Size)(unsafe.Pointer(bp + 16)) == 0 && command == 0; v14 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { v13 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v13 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), libc.UintptrFromInt32(0)) } } if v16 = v14 && libc.Xstrpbrk(tls, v13, __ccgo_ts+18860) == libc.UintptrFromInt32(0); v16 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes != 0 { v15 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).Fbytes } else { v15 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), libc.UintptrFromInt32(0)) } } if v16 && libc.Xstrpbrk(tls, v15, __ccgo_ts+18863) == libc.UintptrFromInt32(0) { numMatches = 0 nocase = cflags & int32(TCL_REG_NOCASE) if nocase != 0 { v17 = __ccgo_fp(XTclUniCharNcasecmp) } else { v17 = __ccgo_fp(XTclUniCharNcmp) } strCmpFn = v17 wsrc = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv)), bp+72) wstring = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) wsubspec = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+8) if *(*TTcl_Size)(unsafe.Pointer(bp + 72)) != 0 { v18 = *(*TTcl_Size)(unsafe.Pointer(bp + 72)) - int64(1) } else { v18 = 0 } wend = wstring + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*4 - uintptr(v18)*4 result = TCL_OK if *(*TTcl_Size)(unsafe.Pointer(bp + 72)) == 0 { /* * regsub behavior for "" matches between each character. 'string * map' skips the "" case. */ if wstring < wend { resultPtr = XTcl_NewUnicodeObj(tls, wstring, 0) (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++ for { if !(wstring < wend) { break } XTcl_AppendUnicodeToObj(tls, resultPtr, wsubspec, *(*TTcl_Size)(unsafe.Pointer(bp + 8))) XTcl_AppendUnicodeToObj(tls, resultPtr, wstring, int64(1)) numMatches++ goto _19 _19: ; wstring += 4 } *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 } } else { wsrclc = XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(wsrc))) v21 = wstring wfirstChar = v21 p = v21 for { if !(wstring < wend) { break } if (*(*TTcl_UniChar)(unsafe.Pointer(wstring)) == *(*TTcl_UniChar)(unsafe.Pointer(wsrc)) || nocase != 0 && XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(wstring))) == wsrclc) && (*(*TTcl_Size)(unsafe.Pointer(bp + 72)) == int64(1) || (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{strCmpFn})))(tls, wstring, wsrc, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 72)))) == 0) { if numMatches == 0 { resultPtr = XTcl_NewUnicodeObj(tls, wstring, 0) (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++ } if p != wstring { XTcl_AppendUnicodeToObj(tls, resultPtr, p, (int64(wstring)-int64(p))/4) p = wstring + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 72)))*4 } else { p += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 72))) * 4 } wstring = p - uintptr(1)*4 XTcl_AppendUnicodeToObj(tls, resultPtr, wsubspec, *(*TTcl_Size)(unsafe.Pointer(bp + 8))) numMatches++ } goto _20 _20: ; wstring += 4 } if numMatches != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (int64(wfirstChar+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*4) - int64(p)) / 4 wstring = p } } objPtr = libc.UintptrFromInt32(0) subPtr = libc.UintptrFromInt32(0) goto regsubDone } regExpr = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), cflags) if regExpr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if command != 0 { /* * In command-prefix mode, we require that the third non-option * argument be a list, so we enforce that here. Afterwards, we fetch * the RE compilation again in case objv[0] and objv[2] are the same * object. (If they aren't, that's cheap to do.) */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32))).Fptr2 != 0 { v23 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32))).Fptr2)).FspanLength } else { v23 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = v23 v22 = libc.Int32FromInt32(TCL_OK) } else { v22 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+24) } if v22 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 24)) < int64(1) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+18878, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+96, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+18932, __ccgo_ts+18939, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } regExpr = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), cflags) } /* * Make sure to avoid problems where the objects are shared. This can * cause RegExpObj <> UnicodeObj shimmering that causes data corruption. * [Bug #461322] */ if *(*uintptr)(unsafe.Pointer(objv + 1*8)) == *(*uintptr)(unsafe.Pointer(objv)) { objPtr = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) } else { objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } wstring = XTcl_GetUnicodeFromObj(tls, objPtr, bp) if *(*uintptr)(unsafe.Pointer(objv + 2*8)) == *(*uintptr)(unsafe.Pointer(objv)) { subPtr = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) } else { subPtr = *(*uintptr)(unsafe.Pointer(objv + 2*8)) } if !(command != 0) { wsubspec = XTcl_GetUnicodeFromObj(tls, subPtr, bp+8) } result = TCL_OK /* * The following loop is to handle multiple matches within the same source * string; each iteration handles one match and its corresponding * substitution. If "-all" hasn't been specified then the loop body only * gets executed once. We must use 'offset <= wlen' in particular for the * case where the regexp pattern can match the empty string - this is * useful when doing, say, 'regsub -- ^ $str ...' when $str might be * empty. */ numMatches = 0 for { if !(*(*TTcl_Size)(unsafe.Pointer(bp + 16)) <= *(*TTcl_Size)(unsafe.Pointer(bp))) { break } /* * The flags argument is set if string is part of a larger string, so * that "^" won't match. */ if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) > 0 && *(*TTcl_UniChar)(unsafe.Pointer(wstring + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 16))-int64(1))*4)) != libc.Int32FromUint8('\n') { v25 = int32(TCL_REG_NOTBOL) } else { v25 = 0 } match = XTcl_RegExpExecObj(tls, interp, regExpr, objPtr, *(*TTcl_Size)(unsafe.Pointer(bp + 16)), int64(10), v25) if match < 0 { result = int32(TCL_ERROR) goto done } if match == 0 { break } if numMatches == 0 { resultPtr = XTcl_NewUnicodeObj(tls, wstring, 0) (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++ if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) > libc.Int64FromInt32(0) { /* * Copy the initial portion of the string in if an offset was * specified. */ XTcl_AppendUnicodeToObj(tls, resultPtr, wstring, *(*TTcl_Size)(unsafe.Pointer(bp + 16))) } } numMatches++ /* * Copy the portion of the source string before the match to the * result variable. */ XTcl_RegExpGetInfo(tls, regExpr, bp+32) start = (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches))).Fstart end = (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches))).Fend XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 16)))*4, start) /* * In command-prefix mode, the substitutions are added as quoted * arguments to the subSpec to form a command, that is then executed * and the result used as the string to substitute in. Actually, * everything is passed through Tcl_EvalObjv, as that's much faster. */ if command != 0 { args = libc.UintptrFromInt32(0) if (*TTcl_Obj)(unsafe.Pointer(subPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subPtr + 32))).Fptr2 != 0 { v27 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subPtr + 32))).Fptr2)).FspanStart } else { v27 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 80)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subPtr + 32))).Fptr1 + 40 + uintptr(v27)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subPtr + 32))).Fptr2 != 0 { v28 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subPtr + 32))).Fptr2)).FspanLength } else { v28 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = v28 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, interp, subPtr, bp+24, bp+80) } numArgs = *(*TTcl_Size)(unsafe.Pointer(bp + 24)) + (*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fnsubs + int64(1) args = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt64(numArgs)) libc.Xmemcpy(tls, args, *(*uintptr)(unsafe.Pointer(bp + 80)), uint64(8)*libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 24)))) idx = 0 for { if !(idx <= (*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fnsubs) { break } subStart = (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(idx)*16))).Fstart subEnd = (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(idx)*16))).Fend if subStart >= 0 && subEnd >= 0 { *(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)) = XTcl_NewUnicodeObj(tls, wstring+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 16)))*4+uintptr(subStart)*4, subEnd-subStart) } else { *(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)) = XTcl_NewObj(tls) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)))).FrefCount++ goto _29 _29: ; idx++ } /* * At this point, we're locally holding the references to the * argument words we added for this time round the loop, and the * subPtr is holding the references to the words that the user * supplied directly. None are zero-refcount, which is important * because Tcl_EvalObjv is "hairy monster" in terms of refcount * handling, being able to optionally add references to any of its * argument words. We'll drop the local refs immediately * afterwards; subPtr is handled in the main exit stanza. */ result = XTcl_EvalObjv(tls, interp, numArgs, args, 0) idx = 0 for { if !(idx <= (*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fnsubs) { break } v32 = *(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)) v31 = *(*TTcl_Size)(unsafe.Pointer(v32)) *(*TTcl_Size)(unsafe.Pointer(v32))-- if !(v31 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)))).Flength = int64(-libc.Int32FromInt32(1)) if v33 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v33 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v33 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8)) (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(args + uintptr(idx+*(*TTcl_Size)(unsafe.Pointer(bp + 24)))*8))) } } goto _30 _30: ; idx++ } XTclpFree(tls, args) if result != TCL_OK { if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+18948, libc.VaList(bp+96, _options5[1]))) } goto done } XTcl_AppendObjToObj(tls, resultPtr, XTcl_GetObjResult(tls, interp)) XTcl_ResetResult(tls, interp) /* * Refetch the unicode, in case the representation was smashed by * the user code. */ wstring = XTcl_GetUnicodeFromObj(tls, objPtr, bp) *(*TTcl_Size)(unsafe.Pointer(bp + 16)) += end if end == 0 || start == end { /* * Always consume at least one character of the input string * in order to prevent infinite loops, even when we * technically matched the empty string; we must not match * again at the same spot. */ if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) < *(*TTcl_Size)(unsafe.Pointer(bp)) { XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 16)))*4, int64(1)) } *(*TTcl_Size)(unsafe.Pointer(bp + 16))++ } if all != 0 { goto _24 } else { break } } /* * Append the subSpec argument to the variable, making appropriate * substitutions. This code is a bit hairy because of the backslash * conventions and because the code saves up ranges of characters in * subSpec to reduce the number of calls to Tcl_SetVar. */ v34 = wsubspec wfirstChar = v34 wsrc = v34 wend = wsubspec + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))*4 ch = *(*TTcl_UniChar)(unsafe.Pointer(wsrc)) for { if !(wsrc != wend) { break } if ch == int32('&') { idx = 0 } else { if ch == int32('\\') { ch = *(*TTcl_UniChar)(unsafe.Pointer(wsrc + 1*4)) if ch >= int32('0') && ch <= int32('9') { idx = int64(ch - int32('0')) } else { if ch == int32('\\') || ch == int32('&') { *(*TTcl_UniChar)(unsafe.Pointer(wsrc)) = ch XTcl_AppendUnicodeToObj(tls, resultPtr, wfirstChar, (int64(wsrc)-int64(wfirstChar))/4+int64(1)) *(*TTcl_UniChar)(unsafe.Pointer(wsrc)) = int32('\\') wfirstChar = wsrc + uintptr(2)*4 wsrc += 4 goto _35 } else { goto _35 } } } else { goto _35 } } if wfirstChar != wsrc { XTcl_AppendUnicodeToObj(tls, resultPtr, wfirstChar, (int64(wsrc)-int64(wfirstChar))/4) } if idx <= (*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fnsubs { subStart = (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(idx)*16))).Fstart subEnd = (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(idx)*16))).Fend if subStart >= 0 && subEnd >= 0 { XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 16)))*4+uintptr(subStart)*4, subEnd-subStart) } } if *(*TTcl_UniChar)(unsafe.Pointer(wsrc)) == int32('\\') { wsrc += 4 } wfirstChar = wsrc + uintptr(1)*4 goto _35 _35: ; wsrc += 4 ch = *(*TTcl_UniChar)(unsafe.Pointer(wsrc)) } if wfirstChar != wsrc { XTcl_AppendUnicodeToObj(tls, resultPtr, wfirstChar, (int64(wsrc)-int64(wfirstChar))/4) } if end == 0 { /* * Always consume at least one character of the input string in * order to prevent infinite loops. */ if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) < *(*TTcl_Size)(unsafe.Pointer(bp)) { XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 16)))*4, int64(1)) } *(*TTcl_Size)(unsafe.Pointer(bp + 16))++ } else { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) += end if start == end { /* * We matched an empty string, which means we must go forward * one more step so we don't match again at the same spot. */ if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) < *(*TTcl_Size)(unsafe.Pointer(bp)) { XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 16)))*4, int64(1)) } *(*TTcl_Size)(unsafe.Pointer(bp + 16))++ } } if !(all != 0) { break } goto _24 _24: } /* * Copy the portion of the source string after the last match to the * result variable. */ goto regsubDone regsubDone: ; if numMatches == 0 { /* * On zero matches, just ignore the offset, since it shouldn't matter * to us in this case, and the user may have skewed it. */ resultPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) (*TTcl_Obj)(unsafe.Pointer(resultPtr)).FrefCount++ } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) < *(*TTcl_Size)(unsafe.Pointer(bp)) { XTcl_AppendUnicodeToObj(tls, resultPtr, wstring+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 16)))*4, *(*TTcl_Size)(unsafe.Pointer(bp))-*(*TTcl_Size)(unsafe.Pointer(bp + 16))) } } if objc == int32(4) { if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), libc.UintptrFromInt32(0), resultPtr, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { result = int32(TCL_ERROR) } else { /* * Set the interpreter's object result to an integer object * holding the number of matches. */ XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, numMatches)) } } else { /* * No varname supplied, so just return the modified string. */ XTcl_SetObjResult(tls, interp, resultPtr) } goto done done: ; if objPtr != 0 && *(*uintptr)(unsafe.Pointer(objv + 1*8)) == *(*uintptr)(unsafe.Pointer(objv)) { _objPtr3 = objPtr v37 = _objPtr3 v36 = *(*TTcl_Size)(unsafe.Pointer(v37)) *(*TTcl_Size)(unsafe.Pointer(v37))-- if v36 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } if subPtr != 0 && *(*uintptr)(unsafe.Pointer(objv + 2*8)) == *(*uintptr)(unsafe.Pointer(objv)) { _objPtr4 = subPtr v39 = _objPtr4 v38 = *(*TTcl_Size)(unsafe.Pointer(v39)) *(*TTcl_Size)(unsafe.Pointer(v39))-- if v38 <= int64(1) { XTclFreeObj(tls, _objPtr4) } } if resultPtr != 0 { _objPtr5 = resultPtr v41 = _objPtr5 v40 = *(*TTcl_Size)(unsafe.Pointer(v41)) *(*TTcl_Size)(unsafe.Pointer(v41))-- if v40 <= int64(1) { XTclFreeObj(tls, _objPtr5) } } return result } var _options5 = [10]uintptr{ 0: __ccgo_ts + 17462, 1: __ccgo_ts + 18236, 2: __ccgo_ts + 18646, 3: __ccgo_ts + 18656, 4: __ccgo_ts + 18662, 5: __ccgo_ts + 18672, 6: __ccgo_ts + 17555, 7: __ccgo_ts + 17590, 8: __ccgo_ts + 18684, 9: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * Tcl_RenameObjCmd -- * * This procedure is invoked to process the "rename" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_RenameObjCmd(tls *libc.TLS, dummy1008 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var newName, oldName, v1, v2 uintptr _, _, _, _ = newName, oldName, v1, v2 if objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+18990) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0)) } oldName = v1 if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), libc.UintptrFromInt32(0)) } newName = v2 return XTclRenameCommand(tls, interp, oldName, newName) } /* *---------------------------------------------------------------------- * * Tcl_ReturnObjCmd -- * * This object-based procedure is invoked to process the "return" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_ReturnObjCmd(tls *libc.TLS, dummy1044 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var explicitResult, numOptionWords int32 var _ /* code at bp+0 */ int32 var _ /* level at bp+4 */ int32 var _ /* returnOpts at bp+8 */ uintptr _, _ = explicitResult, numOptionWords /* * General syntax: [return ?-option value ...? ?result?] * An even number of words means an explicit result argument is present. */ explicitResult = libc.BoolInt32(0 == objc%int32(2)) numOptionWords = objc - int32(1) - explicitResult if int32(TCL_ERROR) == XTclMergeReturnOptions(tls, interp, numOptionWords, objv+uintptr(1)*8, bp+8, bp, bp+4) { return int32(TCL_ERROR) } *(*int32)(unsafe.Pointer(bp)) = XTclProcessReturn(tls, interp, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4)), *(*uintptr)(unsafe.Pointer(bp + 8))) if explicitResult != 0 { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8))) } return *(*int32)(unsafe.Pointer(bp)) } /* *---------------------------------------------------------------------- * * Tcl_SourceObjCmd -- * * This procedure is invoked to process the "source" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_SourceObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRSourceObjCmd), clientData, int64(objc), objv) } func XTclNRSourceObjCmd(tls *libc.TLS, dummy1101 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var encodingName, fileName, names, pkgFiles, v1 uintptr var result int32 var _ /* index at bp+0 */ int32 var _ /* index at bp+4 */ int32 _, _, _, _, _, _ = encodingName, fileName, names, pkgFiles, result, v1 encodingName = libc.UintptrFromInt32(0) pkgFiles = libc.UintptrFromInt32(0) names = libc.UintptrFromInt32(0) if objc < int32(2) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19006) return int32(TCL_ERROR) } fileName = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)) if objc == int32(4) { if int32(TCL_ERROR) == XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&_options6)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< 1 * byte in length. */ for { if v9 = *(*uint8)(unsafe.Pointer(stringPtr)) != 0; v9 { v8 = libc.Xstrchr(tls, stringPtr, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(splitChars)))) p = v8 } if !(v9 && v8 != libc.UintptrFromInt32(0)) { break } objPtr = XTcl_NewStringObj(tls, stringPtr, int64(p)-int64(stringPtr)) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, objPtr) stringPtr = p + uintptr(1) } if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 if int64(end)-int64(stringPtr) == 0 { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(int64(end)-int64(stringPtr)+libc.Int64FromUint32(1))) if stringPtr != 0 { v11 = stringPtr } else { v11 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, v11, libc.Uint64FromInt64(int64(end)-int64(stringPtr))) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(int64(end)-int64(stringPtr)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(end) - int64(stringPtr) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, objPtr) } else { /* * Normal case: split on any of a given set of characters. Discard * instances of the split characters. */ splitEnd = splitChars + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) element = stringPtr for { if !(stringPtr < end) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(stringPtr))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(stringPtr))) v13 = int64(libc.Int32FromInt32(1)) } else { v13 = XTcl_UtfToUniChar(tls, stringPtr, bp) } len1 = int32(v13) p1 = splitChars for { if !(p1 < splitEnd) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p1))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp + 132)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p1))) v15 = int64(libc.Int32FromInt32(1)) } else { v15 = XTcl_UtfToUniChar(tls, p1, bp+132) } splitLen = v15 if *(*int32)(unsafe.Pointer(bp)) == *(*int32)(unsafe.Pointer(bp + 132)) { if v16 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v16 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v16 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 if int64(stringPtr)-int64(element) == 0 { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(int64(stringPtr)-int64(element)+libc.Int64FromUint32(1))) if element != 0 { v17 = element } else { v17 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, v17, libc.Uint64FromInt64(int64(stringPtr)-int64(element))) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(int64(stringPtr)-int64(element)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(stringPtr) - int64(element) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, objPtr) element = stringPtr + uintptr(len1) break } goto _14 _14: ; p1 += uintptr(splitLen) } goto _12 _12: ; stringPtr += uintptr(len1) } if v18 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v18 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v18 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 if int64(stringPtr)-int64(element) == 0 { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(int64(stringPtr)-int64(element)+libc.Int64FromUint32(1))) if element != 0 { v19 = element } else { v19 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes, v19, libc.Uint64FromInt64(int64(stringPtr)-int64(element))) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes + uintptr(int64(stringPtr)-int64(element)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(stringPtr) - int64(element) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, objPtr) } } } XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * StringFirstCmd -- * * This procedure is invoked to process the "string first" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringFirstCmd(tls *libc.TLS, dummy1308 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var end TTcl_Size var v1 int32 var _ /* start at bp+0 */ TTcl_Size _, _ = end, v1 *(*TTcl_Size)(unsafe.Pointer(bp)) = libc.Int64FromInt32(0) if objc < int32(3) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19090) return int32(TCL_ERROR) } if objc == int32(4) { end = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) - int64(1) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= end { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), end, bp) } if TCL_OK != v1 { return int32(TCL_ERROR) } } XTcl_SetObjResult(tls, interp, XTclStringFirst(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp)))) return TCL_OK } /* *---------------------------------------------------------------------- * * StringLastCmd -- * * This procedure is invoked to process the "string last" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringLastCmd(tls *libc.TLS, dummy1352 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var end TTcl_Size var v1 int32 var _ /* last at bp+0 */ TTcl_Size _, _ = end, v1 *(*TTcl_Size)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(1)) if objc < int32(3) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19131) return int32(TCL_ERROR) } if objc == int32(4) { end = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8))) - int64(1) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= end { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), end, bp) } if TCL_OK != v1 { return int32(TCL_ERROR) } } XTcl_SetObjResult(tls, interp, XTclStringLast(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp)))) return TCL_OK } /* *---------------------------------------------------------------------- * * StringIndexCmd -- * * This procedure is invoked to process the "string index" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringIndexCmd(tls *libc.TLS, dummy1396 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var ch, v1 int32 var end TTcl_Size var _ /* buf at bp+12 */ [4]uint8 var _ /* index at bp+0 */ TTcl_Size var _ /* uch at bp+8 */ uint8 _, _, _ = ch, end, v1 if objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19171) return int32(TCL_ERROR) } /* * Get the char length to calculate what 'end' means. */ end = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) - int64(1) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= end { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), end, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp)) >= 0 && *(*TTcl_Size)(unsafe.Pointer(bp)) <= end { ch = XTcl_GetUniChar(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*TTcl_Size)(unsafe.Pointer(bp))) if ch == -int32(1) { return TCL_OK } /* * If we have a ByteArray object, we're careful to generate a new * bytearray for a result. */ if XTclIsPureByteArray(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) != 0 { *(*uint8)(unsafe.Pointer(bp + 8)) = libc.Uint8FromInt32(ch) XTcl_SetObjResult(tls, interp, XTcl_NewByteArrayObj(tls, bp+8, int64(1))) } else { *(*[4]uint8)(unsafe.Pointer(bp + 12)) = [4]uint8{} end = XTcl_UniCharToUtf(tls, ch, bp+12) XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, bp+12, end)) } } return TCL_OK } /* *---------------------------------------------------------------------- * * StringInsertCmd -- * * This procedure is invoked to process the "string insert" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringInsertCmd(tls *libc.TLS, dummy1463 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects */ var length TTcl_Size var outObj uintptr var v1 int32 var _ /* index at bp+0 */ TTcl_Size _, _, _ = length, outObj, v1 /* Output object */ if objc != int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19188) return int32(TCL_ERROR) } length = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= length { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), length, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = libc.Int64FromInt32(0) } if *(*TTcl_Size)(unsafe.Pointer(bp)) > length { *(*TTcl_Size)(unsafe.Pointer(bp)) = length } outObj = XTclStringReplace(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), 0, *(*uintptr)(unsafe.Pointer(objv + 3*8)), libc.Int32FromInt32(1)< int32(6) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19259) return int32(TCL_ERROR) } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&_isClasses)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+19296, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<= objc-int32(1) { XTcl_WrongNumArgs(tls, interp, int64(2), objv, __ccgo_ts+19302) return int32(TCL_ERROR) } i++ v2 = i failVarObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(v2)*8)) break } goto _1 _1: ; i++ } } /* * We get the objPtr so that we can short-cut for some classes by checking * the object type (int and double), but we need the string otherwise, * because we don't want any conversion of type occurring (as, for example, * Tcl_Get*FromObj would do). */ objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)) /* * When entering here, result == 1 and failat == 0. */ switch *(*int32)(unsafe.Pointer(bp + 32)) { case 0: chcomp = __ccgo_fp(XTcl_UniCharIsAlnum) case 1: chcomp = __ccgo_fp(XTcl_UniCharIsAlpha) case 2: chcomp = __ccgo_fp(_UniCharIsAscii) case 4: fallthrough case 17: fallthrough case 9: if !((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBooleanType))) && TCL_OK != XTclSetBooleanFromAny(tls, libc.UintptrFromInt32(0), objPtr) { if strict != 0 { result = 0 } else { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v3 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, objPtr, bp+8) } string1 = v3 result = libc.BoolInt32(*(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0) } } else { if *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep)) != 0 { v4 = libc.BoolInt32(*(*int32)(unsafe.Pointer(bp + 32)) == 9) } else { v4 = libc.BoolInt32(*(*int32)(unsafe.Pointer(bp + 32)) == 17) } if v4 != 0 { result = 0 } } case 3: chcomp = __ccgo_fp(XTcl_UniCharIsControl) case 5: dresult = XTcl_DictObjSize(tls, interp, objPtr, bp+40) XTcl_ResetResult(tls, interp) if dresult == TCL_OK { v5 = int32(1) } else { v5 = 0 } result = v5 if dresult != TCL_OK && failVarObj != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v6 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, objPtr, bp+8) } string1 = v6 end = string1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) failat = int64(-int32(1)) p = string1 lenRemain = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) for { if !(lenRemain > 0) { break } if int32(TCL_ERROR) == XTclFindElement(tls, libc.UintptrFromInt32(0), p, lenRemain, bp+48, bp+56, bp+64, libc.UintptrFromInt32(0)) { /* * This is the simplest way of getting the number of * characters parsed. Note that this is not the same as * the number of bytes when parsing strings with non-ASCII * characters in them. * * Skip leading spaces first. This is only really an issue * if it is the first "element" that has the failure. */ for XTclIsSpaceProc(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))) != 0 { p++ } if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { tmpStr = XTclThreadAllocObj(tls) } else { tmpStr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpStr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpStr)).FrefCount = 0 if int64(p)-int64(string1) == 0 { (*TTcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpStr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(int64(p)-int64(string1)+libc.Int64FromUint32(1))) if string1 != 0 { v9 = string1 } else { v9 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes, v9, libc.Uint64FromInt64(int64(p)-int64(string1))) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes + uintptr(int64(p)-int64(string1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpStr)).Flength = int64(p) - int64(string1) } (*TTcl_Obj)(unsafe.Pointer(tmpStr)).FtypePtr = libc.UintptrFromInt32(0) failat = XTcl_GetCharLength(tls, tmpStr) v11 = tmpStr v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if !(v10 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpStr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpStr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpStr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpStr)).Flength = int64(-libc.Int32FromInt32(1)) if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpStr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpStr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = tmpStr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, tmpStr) } } break } goto _7 _7: ; p = *(*uintptr)(unsafe.Pointer(bp + 56)) lenRemain = int64(end) - int64(*(*uintptr)(unsafe.Pointer(bp + 56))) } } case 6: chcomp = __ccgo_fp(XTcl_UniCharIsDigit) case 7: if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) || (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) || (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) { break } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v13 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v13 = XTcl_GetStringFromObj(tls, objPtr, bp+8) } string1 = v13 if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 { if strict != 0 { result = 0 } goto str_is_done } end = string1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) if XTclParseNumber(tls, libc.UintptrFromInt32(0), objPtr, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), int64(-libc.Int32FromInt32(1)), bp, 0) != TCL_OK { result = 0 failat = 0 } else { failat = int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(string1) if *(*uintptr)(unsafe.Pointer(bp)) < end { result = 0 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != libc.UintptrFromInt32(0) { if (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})))(tls, objPtr) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) } } } case 10: chcomp = __ccgo_fp(XTcl_UniCharIsGraph) case 11: fallthrough case 8: if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) || (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclBignumType)) { break } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v14 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v14 = XTcl_GetStringFromObj(tls, objPtr, bp+8) } string1 = v14 if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 { if strict != 0 { result = 0 } goto str_is_done } end = string1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) if XTclParseNumber(tls, libc.UintptrFromInt32(0), objPtr, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), int64(-libc.Int32FromInt32(1)), bp, int32(TCL_PARSE_INTEGER_ONLY)) == TCL_OK { if *(*uintptr)(unsafe.Pointer(bp)) == end { /* * Entire string parses as an integer. */ break } else { /* * Some prefix parsed as an integer, but not the whole string, * so return failure index as the point where parsing stopped. * Clear out the internal rep, since keeping it would leave * *objPtr in an inconsistent state. */ result = 0 failat = int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(string1) if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != libc.UintptrFromInt32(0) { if (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})))(tls, objPtr) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) } } } else { /* * No prefix is a valid integer. Fail at beginning. */ result = 0 failat = 0 } case 19: if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 24)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep)) v15 = libc.Int32FromInt32(TCL_OK) } else { v15 = XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), objPtr, bp+24) } if TCL_OK == v15 { break } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v16 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v16 = XTcl_GetStringFromObj(tls, objPtr, bp+8) } string1 = v16 if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 { if strict != 0 { result = 0 } goto str_is_done } result = 0 if failVarObj == libc.UintptrFromInt32(0) { /* * Don't bother computing the failure point if we're not going to * return it. */ break } end = string1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) if XTclParseNumber(tls, libc.UintptrFromInt32(0), objPtr, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), int64(-libc.Int32FromInt32(1)), bp, int32(TCL_PARSE_INTEGER_ONLY)) == TCL_OK { if *(*uintptr)(unsafe.Pointer(bp)) == end { /* * Entire string parses as an integer, but rejected by * Tcl_Get(Wide)IntFromObj() so we must have overflowed the * target type, and our convention is to return failure at * index -1 in that situation. */ failat = int64(-int32(1)) } else { /* * Some prefix parsed as an integer, but not the whole string, * so return failure index as the point where parsing stopped. * Clear out the internal rep, since keeping it would leave * *objPtr in an inconsistent state. */ failat = int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(string1) if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != libc.UintptrFromInt32(0) { if (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc})))(tls, objPtr) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) } } } else { /* * No prefix is a valid integer. Fail at beginning. */ failat = 0 } case 12: /* * We ignore the strictness here, since empty strings are always * well-formed lists. */ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2 != 0 { v18 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2)).FspanLength } else { v18 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = v18 v17 = libc.Int32FromInt32(TCL_OK) } else { v17 = XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), objPtr, bp+16) } if TCL_OK == v17 { break } if failVarObj != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v19 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v19 = XTcl_GetStringFromObj(tls, objPtr, bp+8) } string1 = v19 end = string1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) failat = int64(-int32(1)) p1 = string1 lenRemain1 = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) for { if !(lenRemain1 > 0) { break } if int32(TCL_ERROR) == XTclFindElement(tls, libc.UintptrFromInt32(0), p1, lenRemain1, bp+72, bp+80, bp+88, libc.UintptrFromInt32(0)) { /* * This is the simplest way of getting the number of * characters parsed. Note that this is not the same as * the number of bytes when parsing strings with non-ASCII * characters in them. * * Skip leading spaces first. This is only really an issue * if it is the first "element" that has the failure. */ for { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p1))) > int32(0x20) { v21 = 0 } else { v21 = XTclIsSpaceProc(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p1)))) } if !(v21 != 0) { break } p1++ } if v22 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v22 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v22 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { tmpStr1 = XTclThreadAllocObj(tls) } else { tmpStr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpStr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).FrefCount = 0 if int64(p1)-int64(string1) == 0 { (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(int64(p1)-int64(string1)+libc.Int64FromUint32(1))) if string1 != 0 { v23 = string1 } else { v23 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Fbytes, v23, libc.Uint64FromInt64(int64(p1)-int64(string1))) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Fbytes + uintptr(int64(p1)-int64(string1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Flength = int64(p1) - int64(string1) } (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).FtypePtr = libc.UintptrFromInt32(0) failat = XTcl_GetCharLength(tls, tmpStr1) v25 = tmpStr1 v24 = *(*TTcl_Size)(unsafe.Pointer(v25)) *(*TTcl_Size)(unsafe.Pointer(v25))-- if !(v24 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpStr1)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpStr1)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpStr1)).Flength = int64(-libc.Int32FromInt32(1)) if v26 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v26 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v26 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpStr1) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpStr1 + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = tmpStr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, tmpStr1) } } break } goto _20 _20: ; p1 = *(*uintptr)(unsafe.Pointer(bp + 80)) lenRemain1 = int64(end) - int64(*(*uintptr)(unsafe.Pointer(bp + 80))) } } result = 0 case 13: chcomp = __ccgo_fp(XTcl_UniCharIsLower) case 14: chcomp = __ccgo_fp(XTcl_UniCharIsPrint) case 15: chcomp = __ccgo_fp(XTcl_UniCharIsPunct) case 16: chcomp = __ccgo_fp(XTcl_UniCharIsSpace) case 18: chcomp = __ccgo_fp(XTcl_UniCharIsUpper) case 20: chcomp = __ccgo_fp(XTcl_UniCharIsWordChar) case 21: chcomp = __ccgo_fp(_UniCharIsHexDigit) break } if chcomp != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v27 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v27 = XTcl_GetStringFromObj(tls, objPtr, bp+8) } string1 = v27 if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 { if strict != 0 { result = 0 } goto str_is_done } end = string1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) for { if !(string1 < end) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(string1))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp + 96)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(string1))) v29 = int64(libc.Int32FromInt32(1)) } else { v29 = XTcl_UtfToUniChar(tls, string1, bp+96) } length2 = v29 if !((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{chcomp})))(tls, *(*int32)(unsafe.Pointer(bp + 96))) != 0) { result = 0 break } goto _28 _28: ; string1 += uintptr(length2) failat++ } } /* * Only set the failVarObj when we will return 0 and we have indicated a * valid fail index (>= 0). */ goto str_is_done str_is_done: ; if result == 0 && failVarObj != libc.UintptrFromInt32(0) { if v30 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v30 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v30 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep)) = failat (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) if XTcl_ObjSetVar2(tls, interp, failVarObj, libc.UintptrFromInt32(0), objPtr, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(result != 0))) return TCL_OK } var _isClasses = [23]uintptr{ 0: __ccgo_ts + 1119, 1: __ccgo_ts + 1125, 2: __ccgo_ts + 1131, 3: __ccgo_ts + 19214, 4: __ccgo_ts + 3611, 5: __ccgo_ts + 19222, 6: __ccgo_ts + 1149, 7: __ccgo_ts + 6055, 8: __ccgo_ts + 6062, 9: __ccgo_ts + 19227, 10: __ccgo_ts + 1155, 11: __ccgo_ts + 6223, 12: __ccgo_ts + 2860, 13: __ccgo_ts + 1161, 14: __ccgo_ts + 1167, 15: __ccgo_ts + 1173, 16: __ccgo_ts + 558, 17: __ccgo_ts + 19233, 18: __ccgo_ts + 1179, 19: __ccgo_ts + 19238, 20: __ccgo_ts + 19250, 21: __ccgo_ts + 1185, 22: libc.UintptrFromInt32(0), } var _isOptions = [3]uintptr{ 0: __ccgo_ts + 11034, 1: __ccgo_ts + 15031, 2: libc.UintptrFromInt32(0), } func _UniCharIsAscii(tls *libc.TLS, character int32) (r int32) { return libc.BoolInt32(character >= 0 && character < int32(0x80)) } func _UniCharIsHexDigit(tls *libc.TLS, character int32) (r int32) { return libc.BoolInt32(character >= 0 && character < int32(0x80) && libc.Xisxdigit(tls, libc.Int32FromUint8(libc.Uint8FromInt32(character))) != 0) } /* *---------------------------------------------------------------------- * * StringMapCmd -- * * This procedure is invoked to process the "string map" Tcl command. See * the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringMapCmd(tls *libc.TLS, dummy1952 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) /* Argument objects. */ var _objPtr, end, mapLens, mapString, mapStrings, p, resultPtr, sourceObj, strCmpFn, string1, u2lc1, ustring1, ustring2, v1, v13, v6 uintptr var copySource, mapWithDict, nocase, u2lc, v3, v7 int32 var index, mapElemc, v12 TTcl_Size var v4, v5 int64 var _ /* done at bp+32 */ int32 var _ /* i at bp+24 */ TTcl_Size var _ /* i at bp+64 */ TTcl_Size var _ /* length1 at bp+0 */ TTcl_Size var _ /* length2 at bp+8 */ TTcl_Size var _ /* mapElemv at bp+16 */ uintptr var _ /* mapLen at bp+72 */ TTcl_Size var _ /* search at bp+40 */ TTcl_DictSearch _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, copySource, end, index, mapElemc, mapLens, mapString, mapStrings, mapWithDict, nocase, p, resultPtr, sourceObj, strCmpFn, string1, u2lc, u2lc1, ustring1, ustring2, v1, v12, v13, v3, v4, v5, v6, v7 nocase = 0 mapWithDict = 0 copySource = 0 if objc < int32(3) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19333) return int32(TCL_ERROR) } if objc == int32(4) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) } string1 = v1 if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > int64(1) && libc.Xstrncmp(tls, string1, __ccgo_ts+17555, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) == 0 { nocase = int32(1) } else { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+19358, libc.VaList(bp+88, string1))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+17278, __ccgo_ts+11057, string1, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } } /* * This test is tricky, but has to be that way or you get other strange * inconsistencies (see test string-10.20.1 for illustration why!) */ if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)))).Fbytes != libc.UintptrFromInt32(0)) && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { /* * We know the type exactly, so all dict operations will succeed for * sure. This shortens this code quite a bit. */ XTcl_DictObjSize(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)), bp+24) if *(*TTcl_Size)(unsafe.Pointer(bp + 24)) == 0 { /* * Empty charMap, just return whatever string was given. */ XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8))) return TCL_OK } mapElemc = int64(2) * *(*TTcl_Size)(unsafe.Pointer(bp + 24)) mapWithDict = int32(1) /* * Copy the dictionary out into an array; that's the easiest way to * adapt this code... */ *(*uintptr)(unsafe.Pointer(bp + 16)) = XTclStackAlloc(tls, interp, uint64(8)*libc.Uint64FromInt64(mapElemc)) XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)), bp+40, *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(0)*8, *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(1)*8, bp+32) index = int64(2) for { if !(index < mapElemc) { break } XTcl_DictObjNext(tls, bp+40, *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(index)*8, *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(index)*8+uintptr(1)*8, bp+32) goto _2 _2: ; index += int64(2) } XTcl_DictObjDone(tls, bp+40) } else { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2)).FspanStart } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1 + 40 + uintptr(v4)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr2)).FspanLength } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 64)) = v5 v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)), bp+64, bp+16) } if v3 != TCL_OK { return int32(TCL_ERROR) } mapElemc = *(*TTcl_Size)(unsafe.Pointer(bp + 64)) if mapElemc == 0 { /* * empty charMap, just return whatever string was given. */ XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8))) return TCL_OK } else { if mapElemc&int64(1) != 0 { /* * The charMap must be an even number of key/value items. */ XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+19391, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+19416, __ccgo_ts+19420, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } } } /* * Take a copy of the source string object if it is the same as the map * string to cut out nasty sharing crashes. [Bug 1018562] */ if *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) == *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)) { sourceObj = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8))) copySource = int32(1) } else { sourceObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)) } ustring1 = XTcl_GetUnicodeFromObj(tls, sourceObj, bp) if *(*TTcl_Size)(unsafe.Pointer(bp)) == 0 { /* * Empty input string, just stop now. */ goto done } end = ustring1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*4 if nocase != 0 { v6 = __ccgo_fp(XTclUniCharNcasecmp) } else { v6 = __ccgo_fp(XTclUniCharNcmp) } strCmpFn = v6 /* * Force result to be Unicode */ resultPtr = XTcl_NewUnicodeObj(tls, ustring1, 0) if mapElemc == int64(2) { ustring2 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))), bp+8) p = ustring1 if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > *(*TTcl_Size)(unsafe.Pointer(bp)) || *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 { /* * Match string is either longer than input or empty. */ ustring1 = end } else { mapString = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 1*8)), bp+72) if nocase != 0 { v7 = XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(ustring2))) } else { v7 = 0 } u2lc = v7 for { if !(ustring1 < end) { break } if (*(*TTcl_UniChar)(unsafe.Pointer(ustring1)) == *(*TTcl_UniChar)(unsafe.Pointer(ustring2)) || nocase != 0 && XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(ustring1))) == u2lc) && (*(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(1) || (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{strCmpFn})))(tls, ustring1, ustring2, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) == 0) { if p != ustring1 { XTcl_AppendUnicodeToObj(tls, resultPtr, p, (int64(ustring1)-int64(p))/4) p = ustring1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))*4 } else { p += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) * 4 } ustring1 = p - uintptr(1)*4 XTcl_AppendUnicodeToObj(tls, resultPtr, mapString, *(*TTcl_Size)(unsafe.Pointer(bp + 72))) } goto _8 _8: ; ustring1 += 4 } } } else { u2lc1 = uintptr(0) /* * Precompute pointers to the Unicode string and length. This saves us * repeated function calls later, significantly speeding up the * algorithm. We only need the lowercase first char in the nocase * case. */ mapStrings = XTclStackAlloc(tls, interp, libc.Uint64FromInt64(mapElemc)*uint64(8)*uint64(2)) mapLens = XTclStackAlloc(tls, interp, libc.Uint64FromInt64(mapElemc)*uint64(8)*uint64(2)) if nocase != 0 { u2lc1 = XTclStackAlloc(tls, interp, libc.Uint64FromInt64(mapElemc)*uint64(4)) } index = 0 for { if !(index < mapElemc) { break } *(*uintptr)(unsafe.Pointer(mapStrings + uintptr(index)*8)) = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(index)*8)), mapLens+uintptr(index)*8) if nocase != 0 && index%int64(2) == 0 { *(*int32)(unsafe.Pointer(u2lc1 + uintptr(index/int64(2))*4)) = XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(mapStrings + uintptr(index)*8))))) } goto _9 _9: ; index++ } p = ustring1 for { if !(ustring1 < end) { break } index = 0 for { if !(index < mapElemc) { break } /* * Get the key string to match on. */ ustring2 = *(*uintptr)(unsafe.Pointer(mapStrings + uintptr(index)*8)) *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_Size)(unsafe.Pointer(mapLens + uintptr(index)*8)) if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > 0 && (*(*TTcl_UniChar)(unsafe.Pointer(ustring1)) == *(*TTcl_UniChar)(unsafe.Pointer(ustring2)) || nocase != 0 && XTcl_UniCharToLower(tls, *(*TTcl_UniChar)(unsafe.Pointer(ustring1))) == *(*int32)(unsafe.Pointer(u2lc1 + uintptr(index/int64(2))*4))) && (int64(end)-int64(ustring1))/4 >= *(*TTcl_Size)(unsafe.Pointer(bp + 8)) && (*(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(1) || !((*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{strCmpFn})))(tls, ustring2, ustring1, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))) != 0)) { if p != ustring1 { /* * Put the skipped chars onto the result first. */ XTcl_AppendUnicodeToObj(tls, resultPtr, p, (int64(ustring1)-int64(p))/4) p = ustring1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))*4 } else { p += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) * 4 } /* * Adjust len to be full length of matched string. */ ustring1 = p - uintptr(1)*4 /* * Append the map value to the Unicode string. */ XTcl_AppendUnicodeToObj(tls, resultPtr, *(*uintptr)(unsafe.Pointer(mapStrings + uintptr(index+int64(1))*8)), *(*TTcl_Size)(unsafe.Pointer(mapLens + uintptr(index+int64(1))*8))) break } goto _11 _11: ; index += int64(2) } goto _10 _10: ; ustring1 += 4 } if nocase != 0 { XTclStackFree(tls, interp, u2lc1) } XTclStackFree(tls, interp, mapLens) XTclStackFree(tls, interp, mapStrings) } if p != ustring1 { /* * Put the rest of the unmapped chars onto result. */ XTcl_AppendUnicodeToObj(tls, resultPtr, p, (int64(ustring1)-int64(p))/4) } XTcl_SetObjResult(tls, interp, resultPtr) goto done done: ; if mapWithDict != 0 { XTclStackFree(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 16))) } if copySource != 0 { _objPtr = sourceObj v13 = _objPtr v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if v12 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return TCL_OK } /* *---------------------------------------------------------------------- * * StringMatchCmd -- * * This procedure is invoked to process the "string match" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringMatchCmd(tls *libc.TLS, dummy2228 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Argument objects. */ var nocase int32 var string1, v1 uintptr var _ /* length at bp+0 */ TTcl_Size _, _, _ = nocase, string1, v1 nocase = 0 if objc < int32(3) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19431) return int32(TCL_ERROR) } if objc == int32(4) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } string1 = v1 if *(*TTcl_Size)(unsafe.Pointer(bp)) > int64(1) && libc.Xstrncmp(tls, string1, __ccgo_ts+17555, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))) == 0 { nocase = libc.Int32FromInt32(1) << libc.Int32FromInt32(0) } else { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+19358, libc.VaList(bp+16, string1))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+17278, __ccgo_ts+11057, string1, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(XTclStringMatchObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)), nocase) != 0))) return TCL_OK } /* *---------------------------------------------------------------------- * * StringRangeCmd -- * * This procedure is invoked to process the "string range" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringRangeCmd(tls *libc.TLS, dummy2279 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var end TTcl_Size var v1, v2 int32 var v3 bool var _ /* first at bp+0 */ TTcl_Size var _ /* last at bp+8 */ TTcl_Size _, _, _, _ = end, v1, v2, v3 if objc != int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19456) return int32(TCL_ERROR) } /* * Get the length in actual characters; Then reduce it by one because * 'end' refers to the last character, not one past it. */ end = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) - int64(1) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= end { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), end, bp) } if v3 = v1 != TCL_OK; !v3 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= end { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), end, bp+8) } } if v3 || v2 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) >= 0 { XTcl_SetObjResult(tls, interp, XTcl_GetRange(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), *(*TTcl_Size)(unsafe.Pointer(bp + 8)))) } return TCL_OK } /* *---------------------------------------------------------------------- * * StringReptCmd -- * * This procedure is invoked to process the "string repeat" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringReptCmd(tls *libc.TLS, dummy2329 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var resultPtr uintptr var v1 int32 var _ /* count at bp+0 */ TTcl_WideInt _, _ = resultPtr, v1 if objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19474) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } /* * Check for cases that allow us to skip copying stuff. */ if *(*TTcl_WideInt)(unsafe.Pointer(bp)) == int64(1) { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) return TCL_OK } else { if *(*TTcl_WideInt)(unsafe.Pointer(bp)) < int64(1) { return TCL_OK } } resultPtr = XTclStringRepeat(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*TTcl_WideInt)(unsafe.Pointer(bp)), libc.Int32FromInt32(1)< int32(5) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19487) return int32(TCL_ERROR) } end = XTcl_GetCharLength(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) - int64(1) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= end { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), end, bp) } if v3 = v1 != TCL_OK; !v3 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= end { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), end, bp+8) } } if v3 || v2 != TCL_OK { return int32(TCL_ERROR) } /* * The following test screens out most empty substrings as candidates for * replacement. When they are detected, no replacement is done, and the * result is the original string. */ if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) < 0 || *(*TTcl_Size)(unsafe.Pointer(bp)) > end || *(*TTcl_Size)(unsafe.Pointer(bp + 8)) < *(*TTcl_Size)(unsafe.Pointer(bp)) { /* Range begins after it starts */ /* * BUT!!! when (end < 0) -- an empty original string -- we can * have (first <= end < 0 <= last) and an empty string is permitted * to be replaced. */ XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) } else { if *(*TTcl_Size)(unsafe.Pointer(bp)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = libc.Int64FromInt32(0) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > end { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = end } if objc == int32(5) { v4 = *(*uintptr)(unsafe.Pointer(objv + 4*8)) } else { v4 = libc.UintptrFromInt32(0) } resultPtr = XTclStringReplace(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), *(*TTcl_Size)(unsafe.Pointer(bp + 8))+int64(1)-*(*TTcl_Size)(unsafe.Pointer(bp)), v4, libc.Int32FromInt32(1)<= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp + 8))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp + 8))-libc.Int64FromInt32(1), bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp)) >= *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) - int64(1) } cur = 0 if *(*TTcl_Size)(unsafe.Pointer(bp)) > 0 { p = string1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*4 ch = *(*TTcl_UniChar)(unsafe.Pointer(p)) cur = *(*TTcl_Size)(unsafe.Pointer(bp)) for { if !(cur != int64(-libc.Int32FromInt32(1))) { break } delta = 0 if !(XTcl_UniCharIsWordChar(tls, ch) != 0) { break } if p > string1 { v3 = p - uintptr(1)*4 } else { v3 = p } next = v3 for cond := true; cond; cond = next+uintptr(delta)*4 < p { next += uintptr(delta) * 4 ch = *(*TTcl_UniChar)(unsafe.Pointer(next)) delta = int32(1) } p = next goto _2 _2: ; cur-- } if cur != *(*TTcl_Size)(unsafe.Pointer(bp)) { cur += int64(1) } } if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { obj = XTclThreadAllocObj(tls) } else { obj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(obj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(obj)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(obj)).FinternalRep)) = cur (*TTcl_Obj)(unsafe.Pointer(obj)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) XTcl_SetObjResult(tls, interp, obj) return TCL_OK } /* *---------------------------------------------------------------------- * * StringEndCmd -- * * This procedure is invoked to process the "string wordend" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringEndCmd(tls *libc.TLS, dummy2566 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var cachePtr, end, obj, p, string1, v3 uintptr var ch, v1 int32 var cur TTcl_Size var v4 bool var _ /* index at bp+0 */ TTcl_Size var _ /* length at bp+8 */ TTcl_Size _, _, _, _, _, _, _, _, _, _ = cachePtr, ch, cur, end, obj, p, string1, v1, v3, v4 if objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19521) return int32(TCL_ERROR) } string1 = XTcl_GetUnicodeFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp + 8))-int64(1) { *(*TTcl_Size)(unsafe.Pointer(bp)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp + 8))-libc.Int64FromInt32(1), bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 } if *(*TTcl_Size)(unsafe.Pointer(bp)) < *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { p = string1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*4 end = string1 + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 8)))*4 cur = *(*TTcl_Size)(unsafe.Pointer(bp)) for { if !(p < end) { break } v3 = p p += 4 ch = *(*TTcl_UniChar)(unsafe.Pointer(v3)) if !(XTcl_UniCharIsWordChar(tls, ch) != 0) { break } goto _2 _2: ; cur++ } if cur == *(*TTcl_Size)(unsafe.Pointer(bp)) { cur++ } } else { cur = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) } if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { obj = XTclThreadAllocObj(tls) } else { obj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(obj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(obj)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(obj)).FinternalRep)) = cur (*TTcl_Obj)(unsafe.Pointer(obj)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) XTcl_SetObjResult(tls, interp, obj) return TCL_OK } /* *---------------------------------------------------------------------- * * StringEqualCmd -- * * This procedure is invoked to process the "string equal" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringEqualCmd(tls *libc.TLS, dummy2628 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) /* Argument objects. */ var i, match, nocase, v4, v5 int32 var string2, v3 uintptr var _ /* length at bp+0 */ TTcl_Size var _ /* reqlength at bp+8 */ TTcl_WideInt _, _, _, _, _, _, _ = i, match, nocase, string2, v3, v4, v5 nocase = 0 *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = int64(-int32(1)) if !(objc < int32(3) || objc > int32(6)) { goto _1 } goto str_cmp_args str_cmp_args: ; XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19534) return int32(TCL_ERROR) _1: ; i = int32(1) for { if !(i < objc-int32(2)) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Flength v3 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp) } string2 = v3 if *(*TTcl_Size)(unsafe.Pointer(bp)) > int64(1) && !(libc.Xstrncmp(tls, string2, __ccgo_ts+17555, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))) != 0) { nocase = int32(1) } else { if *(*TTcl_Size)(unsafe.Pointer(bp)) > int64(1) && !(libc.Xstrncmp(tls, string2, __ccgo_ts+19574, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))) != 0) { if i+int32(1) >= objc-int32(2) { goto str_cmp_args } i++ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+8) } if v4 != TCL_OK { return int32(TCL_ERROR) } if libc.Uint64FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) > libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = int64(-int32(1)) } } else { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+19582, libc.VaList(bp+24, string2))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+17278, __ccgo_ts+11057, string2, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } } goto _2 _2: ; i++ } /* * From now on, we only access the two objects at the end of the argument * array. */ objv += uintptr(objc-int32(2)) * 8 match = XTclStringCmp(tls, *(*uintptr)(unsafe.Pointer(objv)), *(*uintptr)(unsafe.Pointer(objv + 1*8)), int32(1), nocase, *(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) if match != 0 { v5 = 0 } else { v5 = int32(1) } XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(v5 != 0))) return TCL_OK } /* *---------------------------------------------------------------------- * * StringCmpCmd -- * * This procedure is invoked to process the "string compare" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringCmpCmd(tls *libc.TLS, dummy2708 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var match, status int32 var _ /* nocase at bp+0 */ int32 var _ /* reqlength at bp+8 */ TTcl_Size _, _ = match, status *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = int64(-int32(1)) status = _StringCmpOpts(tls, interp, objc, objv, bp, bp+8) if status != TCL_OK { return status } objv += uintptr(objc-int32(2)) * 8 match = XTclStringCmp(tls, *(*uintptr)(unsafe.Pointer(objv)), *(*uintptr)(unsafe.Pointer(objv + 1*8)), 0, *(*int32)(unsafe.Pointer(bp)), *(*TTcl_Size)(unsafe.Pointer(bp + 8))) XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64(match))) return TCL_OK } func _StringCmpOpts(tls *libc.TLS, interp uintptr, objc int32, objv uintptr, nocase uintptr, reqlength uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var i, v4 int32 var string1, v3 uintptr var _ /* length at bp+0 */ TTcl_Size var _ /* wreqlength at bp+8 */ TTcl_WideInt _, _, _, _ = i, string1, v3, v4 *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = int64(-int32(1)) *(*int32)(unsafe.Pointer(nocase)) = 0 if !(objc < int32(3) || objc > int32(6)) { goto _1 } goto str_cmp_args str_cmp_args: ; XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19534) return int32(TCL_ERROR) _1: ; i = int32(1) for { if !(i < objc-int32(2)) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Flength v3 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp) } string1 = v3 if *(*TTcl_Size)(unsafe.Pointer(bp)) > int64(1) && !(libc.Xstrncmp(tls, string1, __ccgo_ts+17555, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))) != 0) { *(*int32)(unsafe.Pointer(nocase)) = int32(1) } else { if *(*TTcl_Size)(unsafe.Pointer(bp)) > int64(1) && !(libc.Xstrncmp(tls, string1, __ccgo_ts+19574, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))) != 0) { if i+int32(1) >= objc-int32(2) { goto str_cmp_args } i++ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+8) } if v4 != TCL_OK { return int32(TCL_ERROR) } if libc.Uint64FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) > libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) { *(*TTcl_Size)(unsafe.Pointer(reqlength)) = int64(-int32(1)) } else { *(*TTcl_Size)(unsafe.Pointer(reqlength)) = *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) } } else { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+19582, libc.VaList(bp+24, string1))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+24, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+17278, __ccgo_ts+11057, string1, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } } goto _2 _2: ; i++ } return TCL_OK } /* *---------------------------------------------------------------------- * * StringCatCmd -- * * This procedure is invoked to process the "string cat" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringCatCmd(tls *libc.TLS, dummy2803 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ var objResultPtr uintptr _ = objResultPtr if objc < int32(2) { /* * If there are no args, the result is an empty object. * Just leave the preset empty interp result. */ return TCL_OK } objResultPtr = XTclStringCat(tls, interp, int64(objc-int32(1)), objv+uintptr(1)*8, libc.Int32FromInt32(1)< int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19626) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } string1 = v1 if objc == int32(2) { resultPtr = XTcl_NewStringObj(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp))) if (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, resultPtr, libc.UintptrFromInt32(0)) } *(*TTcl_Size)(unsafe.Pointer(bp)) = XTcl_UtfToLower(tls, v2) XTcl_SetObjLength(tls, resultPtr, *(*TTcl_Size)(unsafe.Pointer(bp))) XTcl_SetObjResult(tls, interp, resultPtr) } else { *(*TTcl_Size)(unsafe.Pointer(bp)) = XTcl_NumUtfChars(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp))) - int64(1) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), bp+8) } if v3 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 } *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) if v5 = objc == int32(4); v5 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), bp+16) } } if v5 && v4 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) >= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_Size)(unsafe.Pointer(bp)) } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) < *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) return TCL_OK } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v6 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } string1 = v6 start = XTcl_UtfAtIndex(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp + 8))) end = XTcl_UtfAtIndex(tls, start, *(*TTcl_Size)(unsafe.Pointer(bp + 16))-*(*TTcl_Size)(unsafe.Pointer(bp + 8))+int64(1)) resultPtr1 = XTcl_NewStringObj(tls, string1, int64(end)-int64(string1)) if (*TTcl_Obj)(unsafe.Pointer(resultPtr1)).Fbytes != 0 { v7 = (*TTcl_Obj)(unsafe.Pointer(resultPtr1)).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, resultPtr1, libc.UintptrFromInt32(0)) } string2 = v7 + uintptr(int64(start)-int64(string1)) length2 = XTcl_UtfToLower(tls, string2) XTcl_SetObjLength(tls, resultPtr1, length2+(int64(start)-int64(string1))) XTcl_AppendToObj(tls, resultPtr1, end, int64(-int32(1))) XTcl_SetObjResult(tls, interp, resultPtr1) } return TCL_OK } /* *---------------------------------------------------------------------- * * StringUpperCmd -- * * This procedure is invoked to process the "string toupper" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringUpperCmd(tls *libc.TLS, dummy2967 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument objects. */ var end, resultPtr, resultPtr1, start, string1, string2, v1, v2, v6, v7 uintptr var length2 TTcl_Size var v3, v4 int32 var v5 bool var _ /* first at bp+8 */ TTcl_Size var _ /* last at bp+16 */ TTcl_Size var _ /* length1 at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _ = end, length2, resultPtr, resultPtr1, start, string1, string2, v1, v2, v3, v4, v5, v6, v7 if objc < int32(2) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19626) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } string1 = v1 if objc == int32(2) { resultPtr = XTcl_NewStringObj(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp))) if (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, resultPtr, libc.UintptrFromInt32(0)) } *(*TTcl_Size)(unsafe.Pointer(bp)) = XTcl_UtfToUpper(tls, v2) XTcl_SetObjLength(tls, resultPtr, *(*TTcl_Size)(unsafe.Pointer(bp))) XTcl_SetObjResult(tls, interp, resultPtr) } else { *(*TTcl_Size)(unsafe.Pointer(bp)) = XTcl_NumUtfChars(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp))) - int64(1) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), bp+8) } if v3 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 } *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) if v5 = objc == int32(4); v5 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), bp+16) } } if v5 && v4 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) >= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_Size)(unsafe.Pointer(bp)) } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) < *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) return TCL_OK } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v6 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } string1 = v6 start = XTcl_UtfAtIndex(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp + 8))) end = XTcl_UtfAtIndex(tls, start, *(*TTcl_Size)(unsafe.Pointer(bp + 16))-*(*TTcl_Size)(unsafe.Pointer(bp + 8))+int64(1)) resultPtr1 = XTcl_NewStringObj(tls, string1, int64(end)-int64(string1)) if (*TTcl_Obj)(unsafe.Pointer(resultPtr1)).Fbytes != 0 { v7 = (*TTcl_Obj)(unsafe.Pointer(resultPtr1)).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, resultPtr1, libc.UintptrFromInt32(0)) } string2 = v7 + uintptr(int64(start)-int64(string1)) length2 = XTcl_UtfToUpper(tls, string2) XTcl_SetObjLength(tls, resultPtr1, length2+(int64(start)-int64(string1))) XTcl_AppendToObj(tls, resultPtr1, end, int64(-int32(1))) XTcl_SetObjResult(tls, interp, resultPtr1) } return TCL_OK } /* *---------------------------------------------------------------------- * * StringTitleCmd -- * * This procedure is invoked to process the "string totitle" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringTitleCmd(tls *libc.TLS, dummy3052 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument objects. */ var end, resultPtr, resultPtr1, start, string1, string2, v1, v2, v6, v7 uintptr var length2 TTcl_Size var v3, v4 int32 var v5 bool var _ /* first at bp+8 */ TTcl_Size var _ /* last at bp+16 */ TTcl_Size var _ /* length1 at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _ = end, length2, resultPtr, resultPtr1, start, string1, string2, v1, v2, v3, v4, v5, v6, v7 if objc < int32(2) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19626) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } string1 = v1 if objc == int32(2) { resultPtr = XTcl_NewStringObj(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp))) if (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(resultPtr)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, resultPtr, libc.UintptrFromInt32(0)) } *(*TTcl_Size)(unsafe.Pointer(bp)) = XTcl_UtfToTitle(tls, v2) XTcl_SetObjLength(tls, resultPtr, *(*TTcl_Size)(unsafe.Pointer(bp))) XTcl_SetObjResult(tls, interp, resultPtr) } else { *(*TTcl_Size)(unsafe.Pointer(bp)) = XTcl_NumUtfChars(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp))) - int64(1) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), bp+8) } if v3 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) < 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 } *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_Size)(unsafe.Pointer(bp + 8)) if v5 = objc == int32(4); v5 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) >= 0 && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) <= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 3*8)))).FinternalRep)) v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_GetIntForIndex(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), *(*TTcl_Size)(unsafe.Pointer(bp)), bp+16) } } if v5 && v4 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) >= *(*TTcl_Size)(unsafe.Pointer(bp)) { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_Size)(unsafe.Pointer(bp)) } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) < *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) return TCL_OK } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v6 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } string1 = v6 start = XTcl_UtfAtIndex(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp + 8))) end = XTcl_UtfAtIndex(tls, start, *(*TTcl_Size)(unsafe.Pointer(bp + 16))-*(*TTcl_Size)(unsafe.Pointer(bp + 8))+int64(1)) resultPtr1 = XTcl_NewStringObj(tls, string1, int64(end)-int64(string1)) if (*TTcl_Obj)(unsafe.Pointer(resultPtr1)).Fbytes != 0 { v7 = (*TTcl_Obj)(unsafe.Pointer(resultPtr1)).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, resultPtr1, libc.UintptrFromInt32(0)) } string2 = v7 + uintptr(int64(start)-int64(string1)) length2 = XTcl_UtfToTitle(tls, string2) XTcl_SetObjLength(tls, resultPtr1, length2+(int64(start)-int64(string1))) XTcl_AppendToObj(tls, resultPtr1, end, int64(-int32(1))) XTcl_SetObjResult(tls, interp, resultPtr1) } return TCL_OK } /* *---------------------------------------------------------------------- * * StringTrimCmd -- * * This procedure is invoked to process the "string trim" Tcl command. * See the user documentation for details on what it does. Note that this * command only functions correctly on properly formed Tcl UTF strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringTrimCmd(tls *libc.TLS, dummy3137 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Argument objects. */ var string1, string2, v1, v2 uintptr var triml TTcl_Size var _ /* length1 at bp+8 */ TTcl_Size var _ /* length2 at bp+16 */ TTcl_Size var _ /* trimr at bp+0 */ TTcl_Size _, _, _, _, _ = string1, string2, triml, v1, v2 if objc == int32(3) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+16) } string2 = v1 } else { if objc == int32(2) { string2 = uintptr(unsafe.Pointer(&XtclDefaultTrimSet)) *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = libc.Int64FromUint64(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)))) } else { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19648) return int32(TCL_ERROR) } } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8) } string1 = v2 triml = XTclTrim(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), string2, *(*TTcl_Size)(unsafe.Pointer(bp + 16)), bp) XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, string1+uintptr(triml), *(*TTcl_Size)(unsafe.Pointer(bp + 8))-triml-*(*TTcl_Size)(unsafe.Pointer(bp)))) return TCL_OK } /* *---------------------------------------------------------------------- * * StringTrimLCmd -- * * This procedure is invoked to process the "string trimleft" Tcl * command. See the user documentation for details on what it does. Note * that this command only functions correctly on properly formed Tcl UTF * strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringTrimLCmd(tls *libc.TLS, dummy3184 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var string1, string2, v1, v2 uintptr var trim int32 var _ /* length1 at bp+0 */ TTcl_Size var _ /* length2 at bp+8 */ TTcl_Size _, _, _, _, _ = string1, string2, trim, v1, v2 if objc == int32(3) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+8) } string2 = v1 } else { if objc == int32(2) { string2 = uintptr(unsafe.Pointer(&XtclDefaultTrimSet)) *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = libc.Int64FromUint64(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)))) } else { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19648) return int32(TCL_ERROR) } } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } string1 = v2 trim = int32(XTclTrimLeft(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp)), string2, *(*TTcl_Size)(unsafe.Pointer(bp + 8)))) XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, string1+uintptr(trim), *(*TTcl_Size)(unsafe.Pointer(bp))-int64(trim))) return TCL_OK } /* *---------------------------------------------------------------------- * * StringTrimRCmd -- * * This procedure is invoked to process the "string trimright" Tcl * command. See the user documentation for details on what it does. Note * that this command only functions correctly on properly formed Tcl UTF * strings. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _StringTrimRCmd(tls *libc.TLS, dummy3231 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var string1, string2, v1, v2 uintptr var trim int32 var _ /* length1 at bp+0 */ TTcl_Size var _ /* length2 at bp+8 */ TTcl_Size _, _, _, _, _ = string1, string2, trim, v1, v2 if objc == int32(3) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+8) } string2 = v1 } else { if objc == int32(2) { string2 = uintptr(unsafe.Pointer(&XtclDefaultTrimSet)) *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = libc.Int64FromUint64(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)))) } else { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+19648) return int32(TCL_ERROR) } } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Flength v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } string1 = v2 trim = int32(XTclTrimRight(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp)), string2, *(*TTcl_Size)(unsafe.Pointer(bp + 8)))) XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, string1, *(*TTcl_Size)(unsafe.Pointer(bp))-int64(trim))) return TCL_OK } /* *---------------------------------------------------------------------- * * TclInitStringCmd -- * * This procedure creates the "string" Tcl command. See the user * documentation for details on what it does. Note that this command only * functions correctly on properly formed Tcl UTF strings. * * Also note that the primary methods here (equal, compare, match, ...) * have bytecode equivalents. You will find the code for those in * tclExecute.c. The code here will only be used in the non-bc case (like * in an 'eval'). * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTclInitStringCmd(tls *libc.TLS, interp uintptr) (r TTcl_Command) { return XTclMakeEnsemble(tls, interp, __ccgo_ts+19514, uintptr(unsafe.Pointer(&_stringImplMap))) } /* Current interpreter. */ var _stringImplMap = [24]TEnsembleImplMap{ 0: { Fname: __ccgo_ts + 19663, }, 1: { Fname: __ccgo_ts + 19667, }, 2: { Fname: __ccgo_ts + 19675, }, 3: { Fname: __ccgo_ts + 19681, }, 4: { Fname: __ccgo_ts + 19687, }, 5: { Fname: __ccgo_ts + 19693, }, 6: { Fname: __ccgo_ts + 19700, }, 7: { Fname: __ccgo_ts + 19703, }, 8: { Fname: __ccgo_ts + 19708, }, 9: { Fname: __ccgo_ts + 19715, }, 10: { Fname: __ccgo_ts + 19719, }, 11: { Fname: __ccgo_ts + 19725, }, 12: { Fname: __ccgo_ts + 19731, }, 13: { Fname: __ccgo_ts + 19738, }, 14: { Fname: __ccgo_ts + 3110, }, 15: { Fname: __ccgo_ts + 19746, }, 16: { Fname: __ccgo_ts + 19754, }, 17: { Fname: __ccgo_ts + 19762, }, 18: { Fname: __ccgo_ts + 19770, }, 19: { Fname: __ccgo_ts + 19775, }, 20: { Fname: __ccgo_ts + 19784, }, 21: { Fname: __ccgo_ts + 19794, }, 22: { Fname: __ccgo_ts + 19802, }, 23: {}, } func init() { p := unsafe.Pointer(&_stringImplMap) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_StringCatCmd) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileStringCatCmd) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_StringCmpCmd) *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(XTclCompileStringCmpCmd) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_StringEqualCmd) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(XTclCompileStringEqualCmd) *(*uintptr)(unsafe.Add(p, 152)) = __ccgo_fp(_StringFirstCmd) *(*uintptr)(unsafe.Add(p, 160)) = __ccgo_fp(XTclCompileStringFirstCmd) *(*uintptr)(unsafe.Add(p, 200)) = __ccgo_fp(_StringIndexCmd) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(XTclCompileStringIndexCmd) *(*uintptr)(unsafe.Add(p, 248)) = __ccgo_fp(_StringInsertCmd) *(*uintptr)(unsafe.Add(p, 256)) = __ccgo_fp(XTclCompileStringInsertCmd) *(*uintptr)(unsafe.Add(p, 296)) = __ccgo_fp(_StringIsCmd) *(*uintptr)(unsafe.Add(p, 304)) = __ccgo_fp(XTclCompileStringIsCmd) *(*uintptr)(unsafe.Add(p, 344)) = __ccgo_fp(_StringLastCmd) *(*uintptr)(unsafe.Add(p, 352)) = __ccgo_fp(XTclCompileStringLastCmd) *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_StringLenCmd) *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(XTclCompileStringLenCmd) *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_StringMapCmd) *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(XTclCompileStringMapCmd) *(*uintptr)(unsafe.Add(p, 488)) = __ccgo_fp(_StringMatchCmd) *(*uintptr)(unsafe.Add(p, 496)) = __ccgo_fp(XTclCompileStringMatchCmd) *(*uintptr)(unsafe.Add(p, 536)) = __ccgo_fp(_StringRangeCmd) *(*uintptr)(unsafe.Add(p, 544)) = __ccgo_fp(XTclCompileStringRangeCmd) *(*uintptr)(unsafe.Add(p, 584)) = __ccgo_fp(_StringReptCmd) *(*uintptr)(unsafe.Add(p, 592)) = __ccgo_fp(XTclCompileBasic2ArgCmd) *(*uintptr)(unsafe.Add(p, 632)) = __ccgo_fp(_StringRplcCmd) *(*uintptr)(unsafe.Add(p, 640)) = __ccgo_fp(XTclCompileStringReplaceCmd) *(*uintptr)(unsafe.Add(p, 680)) = __ccgo_fp(_StringRevCmd) *(*uintptr)(unsafe.Add(p, 688)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 728)) = __ccgo_fp(_StringLowerCmd) *(*uintptr)(unsafe.Add(p, 736)) = __ccgo_fp(XTclCompileStringToLowerCmd) *(*uintptr)(unsafe.Add(p, 776)) = __ccgo_fp(_StringUpperCmd) *(*uintptr)(unsafe.Add(p, 784)) = __ccgo_fp(XTclCompileStringToUpperCmd) *(*uintptr)(unsafe.Add(p, 824)) = __ccgo_fp(_StringTitleCmd) *(*uintptr)(unsafe.Add(p, 832)) = __ccgo_fp(XTclCompileStringToTitleCmd) *(*uintptr)(unsafe.Add(p, 872)) = __ccgo_fp(_StringTrimCmd) *(*uintptr)(unsafe.Add(p, 880)) = __ccgo_fp(XTclCompileStringTrimCmd) *(*uintptr)(unsafe.Add(p, 920)) = __ccgo_fp(_StringTrimLCmd) *(*uintptr)(unsafe.Add(p, 928)) = __ccgo_fp(XTclCompileStringTrimLCmd) *(*uintptr)(unsafe.Add(p, 968)) = __ccgo_fp(_StringTrimRCmd) *(*uintptr)(unsafe.Add(p, 976)) = __ccgo_fp(XTclCompileStringTrimRCmd) *(*uintptr)(unsafe.Add(p, 1016)) = __ccgo_fp(_StringEndCmd) *(*uintptr)(unsafe.Add(p, 1024)) = __ccgo_fp(XTclCompileBasic2ArgCmd) *(*uintptr)(unsafe.Add(p, 1064)) = __ccgo_fp(_StringStartCmd) *(*uintptr)(unsafe.Add(p, 1072)) = __ccgo_fp(XTclCompileBasic2ArgCmd) } /* *---------------------------------------------------------------------- * * Tcl_SubstObjCmd -- * * This procedure is invoked to process the "subst" Tcl command. See the * user documentation for details on what it does. This command relies on * Tcl_SubstObj() for its implementation. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTclSubstOptions(tls *libc.TLS, interp uintptr, numOpts TTcl_Size, opts uintptr, flagPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, i int32 var _ /* optionIndex at bp+0 */ int32 _, _ = flags, i flags = int32(TCL_SUBST_ALL) i = 0 for { if !(int64(i) < numOpts) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(opts + uintptr(i)*8)), uintptr(unsafe.Pointer(&_substOptions)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<= objc-int32(2) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+20033, libc.VaList(bp+80, __ccgo_ts+19955))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20016, __ccgo_ts+20077, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } indexVarObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) numMatchesSaved = -int32(1) case 3: i++ if i >= objc-int32(2) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+20033, libc.VaList(bp+80, __ccgo_ts+19965))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20016, __ccgo_ts+20077, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } matchVarObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) numMatchesSaved = -int32(1) break } goto _1 _1: ; i++ } goto finishedOptions finishedOptions: ; if objc-i < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+20083) return int32(TCL_ERROR) } if indexVarObj != libc.UintptrFromInt32(0) && mode != 5 { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+20138, libc.VaList(bp+80, __ccgo_ts+19955))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20016, __ccgo_ts+20172, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } if matchVarObj != libc.UintptrFromInt32(0) && mode != 5 { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+20138, libc.VaList(bp+80, __ccgo_ts+19965))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20016, __ccgo_ts+20172, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } stringObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) objc -= i + int32(1) objv += uintptr(i+int32(1)) * 8 bidx = i + int32(1) /* First after the match string. */ /* * If all of the pattern/command pairs are lumped into a single argument, * split them out again. * * TIP #280: Determine the lines the words in the list start at, based on * the same data for the list word itself. The cmdFramePtr line * information is manipulated directly. */ splitObjs = 0 if objc == int32(1) { blist = *(*uintptr)(unsafe.Pointer(objv)) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr2)).FspanLength } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = v5 v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+24) } if v4 != TCL_OK { return int32(TCL_ERROR) } /* * Ensure that the list is non-empty. */ if *(*TTcl_Size)(unsafe.Pointer(bp + 24)) < int64(1) || *(*TTcl_Size)(unsafe.Pointer(bp + 24)) > int64(INT_MAX) { XTcl_WrongNumArgs(tls, interp, int64(1), savedObjv, __ccgo_ts+20188) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr2 != 0 { v7 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr2)).FspanStart } else { v7 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr1 + 40 + uintptr(v7)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr2 != 0 { v8 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr2)).FspanLength } else { v8 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = v8 v6 = libc.Int32FromInt32(TCL_OK) } else { v6 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), bp+24, bp+16) } if v6 != TCL_OK { return int32(TCL_ERROR) } objc = int32(*(*TTcl_Size)(unsafe.Pointer(bp + 24))) objv = *(*uintptr)(unsafe.Pointer(bp + 16)) splitObjs = int32(1) } /* * Complain if there is an odd number of words in the list of patterns and * bodies. */ if objc%int32(2) != 0 { XTcl_ResetResult(tls, interp) XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+20245, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20016, __ccgo_ts+20279, libc.UintptrFromInt32(0))) /* * Check if this can be due to a badly placed comment in the switch * block. * * The following is an heuristic to detect the infamous "comment in * switch" error: just check if a pattern begins with '#'. */ if splitObjs != 0 { i = 0 for { if !(i < objc) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { v10 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v10 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), libc.UintptrFromInt32(0)) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v10))) == int32('#') { XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, interp), __ccgo_ts+20286, int64(-int32(1))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20016, __ccgo_ts+20279, __ccgo_ts+20394, libc.UintptrFromInt32(0))) break } goto _9 _9: ; i += int32(2) } } return int32(TCL_ERROR) } /* * Complain if the last body is a continuation. Note that this check * assumes that the list is non-empty! */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)))).Fbytes != 0 { v11 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)))).Fbytes } else { v11 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), libc.UintptrFromInt32(0)) } if libc.Xstrcmp(tls, v11, __ccgo_ts+6319) == 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)))).Fbytes != 0 { v12 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)))).Fbytes } else { v12 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+20403, libc.VaList(bp+80, v12))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+80, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20016, __ccgo_ts+20279, __ccgo_ts+20438, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } i = 0 for { if !(i < objc) { break } /* * See if the pattern matches the string. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Flength v14 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).Fbytes } else { v14 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp) } pattern = v14 if i == objc-int32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(pattern))) == int32('d') && libc.Xstrcmp(tls, pattern, __ccgo_ts+16043) == 0 { emptyObj = libc.UintptrFromInt32(0) /* * If either indexVarObj or matchVarObj are non-NULL, we're in * REGEXP mode but have reached the default clause anyway. TIP#75 * specifies that we set the variables to empty lists (== empty * objects) in that case. */ if indexVarObj != libc.UintptrFromInt32(0) { if v15 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v15 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v15 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { emptyObj = XTclThreadAllocObj(tls) } else { emptyObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(emptyObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(emptyObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(emptyObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(emptyObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(emptyObj)).FtypePtr = libc.UintptrFromInt32(0) if XTcl_ObjSetVar2(tls, interp, indexVarObj, libc.UintptrFromInt32(0), emptyObj, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } if matchVarObj != libc.UintptrFromInt32(0) { if emptyObj == libc.UintptrFromInt32(0) { if v16 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v16 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v16 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { emptyObj = XTclThreadAllocObj(tls) } else { emptyObj = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(emptyObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(emptyObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(emptyObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(emptyObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(emptyObj)).FtypePtr = libc.UintptrFromInt32(0) } if XTcl_ObjSetVar2(tls, interp, matchVarObj, libc.UintptrFromInt32(0), emptyObj, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } goto matchFound } switch mode { case 0: if (*TTcl_Obj)(unsafe.Pointer(stringObj)).Fbytes != 0 { v17 = (*TTcl_Obj)(unsafe.Pointer(stringObj)).Fbytes } else { v17 = XTcl_GetStringFromObj(tls, stringObj, libc.UintptrFromInt32(0)) } if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{strCmpFn})))(tls, v17, pattern) == 0 { goto matchFound } case 1: if (*TTcl_Obj)(unsafe.Pointer(stringObj)).Fbytes != 0 { v18 = (*TTcl_Obj)(unsafe.Pointer(stringObj)).Fbytes } else { v18 = XTcl_GetStringFromObj(tls, stringObj, libc.UintptrFromInt32(0)) } if XTcl_StringCaseMatch(tls, v18, pattern, noCase) != 0 { goto matchFound } case 5: if noCase != 0 { v19 = int32(TCL_REG_NOCASE) } else { v19 = 0 } regExpr = XTcl_GetRegExpFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), int32(TCL_REG_ADVANCED)|v19) if regExpr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } else { matched = XTcl_RegExpExecObj(tls, interp, regExpr, stringObj, 0, int64(numMatchesSaved), 0) if matched < 0 { return int32(TCL_ERROR) } else { if matched != 0 { goto matchFoundRegexp } } } break } goto _13 _13: ; i += int32(2) } return TCL_OK goto matchFoundRegexp matchFoundRegexp: ; /* * We are operating in REGEXP mode and we need to store information about * what we matched in some user-nominated arrays. So build the lists of * values and indices to write here. [TIP#75] */ if numMatchesSaved != 0 { indicesObj = libc.UintptrFromInt32(0) XTcl_RegExpGetInfo(tls, regExpr, bp+32) if matchVarObj != libc.UintptrFromInt32(0) { if v20 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v20 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v20 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { matchesObj = XTclThreadAllocObj(tls) } else { matchesObj = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(matchesObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(matchesObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(matchesObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(matchesObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(matchesObj)).FtypePtr = libc.UintptrFromInt32(0) } else { matchesObj = libc.UintptrFromInt32(0) } if indexVarObj != libc.UintptrFromInt32(0) { if v21 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v21 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v21 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { indicesObj = XTclThreadAllocObj(tls) } else { indicesObj = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(indicesObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(indicesObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(indicesObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(indicesObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(indicesObj)).FtypePtr = libc.UintptrFromInt32(0) } j = 0 for { if !(j <= (*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fnsubs) { break } if indexVarObj != libc.UintptrFromInt32(0) { if (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(j)*16))).Fend > 0 { if v23 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v23 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v23 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[0] = XTclThreadAllocObj(tls) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[0] = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[0] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[0])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[0])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[0])).FinternalRep)) = (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(j)*16))).Fstart (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[0])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) if v24 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v24 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v24 || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)] = XTclThreadAllocObj(tls) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)] = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)])).FinternalRep)) = int64((*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(j)*16))).Fend - libc.Int64FromInt32(1)) (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } else { if v25 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v25 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v25 || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)] = XTclThreadAllocObj(tls) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)] = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)])).FinternalRep)) = int64(-libc.Int32FromInt32(1)) (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) (*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[0] = (*(*[2]uintptr)(unsafe.Pointer(bp + 56)))[int32(1)] } /* * Never fails; the object is always clean at this point. */ XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), indicesObj, XTcl_NewListObj(tls, int64(2), bp+56)) } if matchVarObj != libc.UintptrFromInt32(0) { if (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(j)*16))).Fend > 0 { substringObj = XTcl_GetRange(tls, stringObj, (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(j)*16))).Fstart, (*(*TTcl_RegExpIndices)(unsafe.Pointer((*(*TTcl_RegExpInfo)(unsafe.Pointer(bp + 32))).Fmatches + uintptr(j)*16))).Fend-int64(1)) } else { if v26 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v26 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v26 || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == libc.Uint64FromInt32(0) { substringObj = XTclThreadAllocObj(tls) } else { substringObj = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(substringObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(substringObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(substringObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(substringObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(substringObj)).FtypePtr = libc.UintptrFromInt32(0) } /* * Never fails; the object is always clean at this point. */ XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), matchesObj, substringObj) } goto _22 _22: ; j++ } if indexVarObj != libc.UintptrFromInt32(0) { if XTcl_ObjSetVar2(tls, interp, indexVarObj, libc.UintptrFromInt32(0), indicesObj, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { /* * Careful! Check to see if we have allocated the list of * matched strings; if so (but there was an error assigning * the indices list) we have a potential memory leak because * the match list has not been written to a variable. Except * that we'll clean that up right now. */ if matchesObj != libc.UintptrFromInt32(0) { _objPtr = matchesObj v28 = _objPtr v27 = *(*TTcl_Size)(unsafe.Pointer(v28)) *(*TTcl_Size)(unsafe.Pointer(v28))-- if v27 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return int32(TCL_ERROR) } } if matchVarObj != libc.UintptrFromInt32(0) { if XTcl_ObjSetVar2(tls, interp, matchVarObj, libc.UintptrFromInt32(0), matchesObj, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { /* * Unlike above, if indicesObj is non-NULL at this point, it * will have been written to a variable already and will hence * not be leaked. */ return int32(TCL_ERROR) } } } /* * We've got a match. Find a body to execute, skipping bodies that are * "-". */ goto matchFound matchFound: ; ctxPtr = XTclStackAlloc(tls, interp, uint64(88)) *(*TCmdFrame)(unsafe.Pointer(ctxPtr)) = *(*TCmdFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr)) if splitObjs != 0 { /* * We have to perform the GetSrc and other type dependent handling of * the frame here because we are munging with the line numbers, * something the other commands like if, etc. are not doing. Them are * fine with simply passing the CmdFrame through and having the * special handling done in 'info frame', or the bc compiler */ if (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Ftype1 == int32(TCL_LOCATION_BC) { /* * Type BC => ctxPtr->data.eval.path is not used. * ctxPtr->data.tebc.codePtr is used instead. */ XTclGetSrcInfoForPc(tls, ctxPtr) pc = int32(1) /* * The line information in the cmdFrame is now a copy we do not * own. */ } if (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) && *(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(bidx)*8)) >= 0 { bline = int32(*(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(bidx)*8))) (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fline = XTcl_Alloc(tls, libc.Uint64FromInt32(objc)*uint64(8)) (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fnline = int64(objc) XTclListLines(tls, blist, int64(bline), int64(objc), (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fline, objv) } else { (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fline = XTcl_Alloc(tls, libc.Uint64FromInt32(objc)*uint64(8)) (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fnline = int64(objc) k = 0 for { if !(k < objc) { break } *(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(k)*8)) = int64(-int32(1)) goto _29 _29: ; k++ } } } j = int64(i + int32(1)) for { if j >= int64(objc) { /* * This shouldn't happen since we've checked that the last body is * not a continuation... */ XTcl_Panic(tls, __ccgo_ts+20450, 0) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)))).Fbytes != 0 { v31 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)))).Fbytes } else { v31 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)), libc.UintptrFromInt32(0)) } if libc.Xstrcmp(tls, v31, __ccgo_ts+6319) != 0 { break } goto _30 _30: ; j += int64(2) } /* * TIP #280: Make invoking context available to switch branch. */ XTcl_NRAddCallback(tls, interp, __ccgo_fp(_SwitchPostProc), uintptr(int64(splitObjs)), ctxPtr, uintptr(int64(pc)), pattern) if splitObjs != 0 { v32 = j } else { v32 = int64(bidx) + j } return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(j)*8)), 0, ctxPtr, int32(v32)) } /* * If you add options that make -e and -g not unique prefixes of -exact or * -glob, you *must* fix TclCompileSwitchCmd's option parser as well. */ var _options7 = [8]uintptr{ 0: __ccgo_ts + 17506, 1: __ccgo_ts + 17513, 2: __ccgo_ts + 19955, 3: __ccgo_ts + 19965, 4: __ccgo_ts + 17555, 5: __ccgo_ts + 17574, 6: __ccgo_ts + 18684, 7: libc.UintptrFromInt32(0), } func _SwitchPostProc(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Result to return*/ var _objPtr, ctxPtr, pattern, v2, v4 uintptr var limit, overflow, pc, splitObjs int32 var patternLength, v1 TTcl_Size var v3 int64 _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, ctxPtr, limit, overflow, pattern, patternLength, pc, splitObjs, v1, v2, v3, v4 /* Unpack the preserved data */ splitObjs = int32(int64(*(*uintptr)(unsafe.Pointer(data)))) ctxPtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) pc = int32(int64(*(*uintptr)(unsafe.Pointer(data + 2*8)))) pattern = *(*uintptr)(unsafe.Pointer(data + 3*8)) patternLength = libc.Int64FromUint64(libc.Xstrlen(tls, pattern)) /* * Clean up TIP 280 context information */ if splitObjs != 0 { XTclpFree(tls, (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fline) if pc != 0 && (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { /* * Death of SrcInfo reference. */ _objPtr = (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fdata.Feval.Fpath v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } /* * Generate an error message if necessary. */ if result == int32(TCL_ERROR) { limit = int32(50) overflow = libc.BoolInt32(patternLength > int64(limit)) if overflow != 0 { v3 = int64(limit) } else { v3 = patternLength } if overflow != 0 { v4 = __ccgo_ts + 8560 } else { v4 = __ccgo_ts + 1945 } XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+20500, libc.VaList(bp+8, int32(v3), pattern, v4, XTcl_GetErrorLine(tls, interp)))) } XTclStackFree(tls, interp, ctxPtr) return result } /* *---------------------------------------------------------------------- * * Tcl_ThrowObjCmd -- * * This procedure is invoked to process the "throw" Tcl command. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_ThrowObjCmd(tls *libc.TLS, dummy3965 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Argument objects. */ var cachePtr, options uintptr var v1 int32 var v2 int64 var v3 bool var _ /* len at bp+0 */ TTcl_Size _, _, _, _, _ = cachePtr, options, v1, v2, v3 if objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+20528) return int32(TCL_ERROR) } /* * The type must be a list of at least length 1. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } else { if *(*TTcl_Size)(unsafe.Pointer(bp)) < int64(1) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+20541, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20569, __ccgo_ts+20575, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } } /* * Now prepare the result options dictionary. We use the list API as it is * slightly more convenient. */ if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { options = XTclThreadAllocObj(tls) } else { options = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(options + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(options)).FrefCount = 0 if libc.Uint64FromInt64(32)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(options)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(options)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(options)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(32)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(options)).Fbytes, __ccgo_ts+20588, libc.Uint64FromInt64(32)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(options)).Fbytes + uintptr(libc.Uint64FromInt64(32)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(options)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(32) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(options)).FtypePtr = libc.UintptrFromInt32(0) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), options, *(*uintptr)(unsafe.Pointer(objv + 1*8))) /* * We're ready to go. Fire things into the low-level result machinery. */ XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8))) return XTcl_SetReturnOptions(tls, interp, options) } /* *---------------------------------------------------------------------- * * Tcl_TimeObjCmd -- * * This object-based procedure is invoked to process the "time" Tcl * command. See the user documentation for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_TimeObjCmd(tls *libc.TLS, dummy4027 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) /* Argument objects. */ var cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, objPtr uintptr var i, result, v1, v2 int32 var totalMicroSec float64 var v3, v5, v6, v7, v8 bool var v4 int64 var _ /* count at bp+32 */ int32 var _ /* objs at bp+0 */ [4]uintptr var _ /* start at bp+40 */ TTcl_Time var _ /* stop at bp+56 */ TTcl_Time _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, i, objPtr, result, totalMicroSec, v1, v2, v3, v4, v5, v6, v7, v8 if objc == int32(2) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) } else { if objc == int32(3) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).FinternalRep))) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp+32) } result = v1 if result != TCL_OK { return result } } else { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+20620) return int32(TCL_ERROR) } } objPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) i = *(*int32)(unsafe.Pointer(bp + 32)) XTcl_GetTime(tls, bp+40) for { v2 = i i-- if !(v2 > 0) { break } result = XTclEvalObjEx(tls, interp, objPtr, 0, libc.UintptrFromInt32(0), 0) if result != TCL_OK { return result } } XTcl_GetTime(tls, bp+56) totalMicroSec = float64(float64((*(*TTcl_Time)(unsafe.Pointer(bp + 56))).Fsec-(*(*TTcl_Time)(unsafe.Pointer(bp + 40))).Fsec)*float64(1e+06)) + float64((*(*TTcl_Time)(unsafe.Pointer(bp + 56))).Fusec-(*(*TTcl_Time)(unsafe.Pointer(bp + 40))).Fusec) if *(*int32)(unsafe.Pointer(bp + 32)) <= int32(1) { /* * Use int obj since we know time is not fractional. [Bug 1202178] */ if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[4]uintptr)(unsafe.Pointer(bp)))[0] = XTclThreadAllocObj(tls) } else { (*(*[4]uintptr)(unsafe.Pointer(bp)))[0] = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0])).Fbytes = libc.UintptrFromInt32(0) if *(*int32)(unsafe.Pointer(bp + 32)) <= 0 { v4 = 0 } else { v4 = int64(totalMicroSec) } *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0])).FinternalRep)) = v4 (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } else { if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[4]uintptr)(unsafe.Pointer(bp)))[0] = XTclThreadAllocObj(tls) } else { (*(*[4]uintptr)(unsafe.Pointer(bp)))[0] = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0])).Fbytes = libc.UintptrFromInt32(0) *(*float64)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0])).FinternalRep)) = totalMicroSec / float64(*(*int32)(unsafe.Pointer(bp + 32))) (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[0])).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType)) } /* * Construct the result as a list because many programs have always parsed * as such (extracting the first element, typically). */ if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)] = XTclThreadAllocObj(tls) } else { (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)] = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)])).FrefCount = 0 if libc.Uint64FromInt64(13)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)])).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)])).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)])).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(13)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)])).Fbytes, __ccgo_ts+12446, libc.Uint64FromInt64(13)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)])).Fbytes + uintptr(libc.Uint64FromInt64(13)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)])).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(13) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)])).FtypePtr = libc.UintptrFromInt32(0) if v7 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v7 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v7 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)] = XTclThreadAllocObj(tls) } else { (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)])).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)])).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)])).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)])).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)])).Fbytes, __ccgo_ts+20636, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)])).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)])).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)])).FtypePtr = libc.UintptrFromInt32(0) if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)] = XTclThreadAllocObj(tls) } else { (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)] = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)])).FrefCount = 0 if libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)])).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)])).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)])).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)])).Fbytes, __ccgo_ts+20640, libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)])).Fbytes + uintptr(libc.Uint64FromInt64(10)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)])).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(10) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer((*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)])).FtypePtr = libc.UintptrFromInt32(0) XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, int64(4), bp)) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_TimeRateObjCmd -- * * This object-based procedure is invoked to process the "timerate" Tcl * command. * * This is similar to command "time", except the execution limited by * given time (in milliseconds) instead of repetition count. * * Example: * timerate {after 5} 1000; # equivalent to: time {after 5} [expr 1000/5] * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_TimeRateObjCmd(tls *libc.TLS, dummy4125 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(192) defer tls.Free(192) /* Argument objects. */ var _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, calibrate, codePtr, direct, objPtr, objs, rootPtr, v12, v17, v20 uintptr var count, curOverhead, maxIterTm, maxcnt, threshold, usec, val, v18 TTcl_WideUInt var digits, i, result, v13, v14, v2, v4, v5, v6, v8, v9 int32 var factor uint16 var lastMeasureOverhead float64 var maxCalTime, middle, start, stop TTcl_WideInt var v10, v15, v19, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30 bool var v11, v16 TTcl_Size var v7 int64 var _ /* clobjv at bp+48 */ [6]uintptr var _ /* index at bp+32 */ int32 var _ /* maxms at bp+8 */ TTcl_WideInt var _ /* now at bp+16 */ TTcl_Time var _ /* objarr at bp+96 */ [8]uintptr var _ /* overhead at bp+0 */ float64 var _ /* v at bp+40 */ TTcl_WideInt _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, calibrate, codePtr, count, curOverhead, digits, direct, factor, i, lastMeasureOverhead, maxCalTime, maxIterTm, maxcnt, middle, objPtr, objs, result, rootPtr, start, stop, threshold, usec, val, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v4, v5, v6, v7, v8, v9 /* global measure-overhead */ *(*float64)(unsafe.Pointer(bp)) = float64(-libc.Int32FromInt32(1)) calibrate = libc.UintptrFromInt32(0) direct = libc.UintptrFromInt32(0) count = uint64(0) /* Holds repetition count */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))) + libc.Uint64FromInt32(1)) /* Maximal running time (in milliseconds) */ maxcnt = libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(1))) /* Maximal count of iterations. */ threshold = uint64(1) /* Current threshold for check time (faster * repeat count without time check) */ maxIterTm = uint64(1) /* Max time of some iteration as max * threshold, additionally avoiding divide to * zero (i.e., never < 1) */ factor = uint16(50) codePtr = libc.UintptrFromInt32(0) i = int32(1) for { if !(i < objc-int32(1)) { break } if XTcl_GetIndexFromObjStruct(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_options8)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(TCL_EXACT)|libc.Int32FromUint64(libc.Uint64FromInt64(4)<= objc-int32(1) { goto usage } if XTcl_GetDoubleFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp) != TCL_OK { return int32(TCL_ERROR) } case 2: calibrate = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) case 3: break } goto _1 _1: ; i++ } if !(i >= objc || i < objc-int32(3)) { goto _3 } goto usage usage: ; XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+20679) return int32(TCL_ERROR) _3: ; v4 = i i++ objPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(v4)*8)) if i < objc { /* max-time */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) v5 = libc.Int32FromInt32(TCL_OK) } else { v5 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+8) } result = v5 i++ // Keep this separate from TclGetWideIntFromObj macro above! if result != TCL_OK { return result } if i < objc { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)))).FinternalRep)) v6 = libc.Int32FromInt32(TCL_OK) } else { v6 = XTcl_GetWideIntFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+40) } result = v6 if result != TCL_OK { return result } if *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) > 0 { v7 = *(*TTcl_WideInt)(unsafe.Pointer(bp + 40)) } else { v7 = 0 } maxcnt = libc.Uint64FromInt64(v7) } } /* * If we are doing calibration. */ if calibrate != 0 { /* * If no time specified for the calibration. */ if *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) == libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))+libc.Uint64FromInt32(1)) { maxCalTime = int64(5000) lastMeasureOverhead = _measureOverhead (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[0] = *(*uintptr)(unsafe.Pointer(objv)) i = int32(1) if direct != 0 { v8 = i i++ (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[v8] = direct } v9 = i i++ (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[v9] = objPtr /* * Reset last measurement overhead. */ _measureOverhead = libc.Float64FromInt32(0) /* * Self-call with 100 milliseconds to warm-up, before entering the * calibration cycle. */ if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i] = XTclThreadAllocObj(tls) } else { (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i] = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).FinternalRep)) = int64(libc.Int32FromInt32(100)) (*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) (*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).FrefCount++ result = XTcl_TimeRateObjCmd(tls, libc.UintptrFromInt32(0), interp, i+int32(1), bp+48) _objPtr = (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i] v12 = _objPtr v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr) } if result != TCL_OK { return result } i-- v13 = i i++ (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[v13] = calibrate v14 = i i++ (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[v14] = objPtr /* * Set last measurement overhead to max. */ _measureOverhead = float64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))) /* * Run the calibration cycle until it is more precise. */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = int64(-int32(1000)) for cond := true; cond; cond = (_measureOverhead >= lastMeasureOverhead || _measureOverhead/lastMeasureOverhead <= float64(0.9995)) && maxCalTime > 0 { lastMeasureOverhead = _measureOverhead if v15 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v15 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v15 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i] = XTclThreadAllocObj(tls) } else { (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i] = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).FinternalRep)) = int64(int32(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)))) (*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) (*TTcl_Obj)(unsafe.Pointer((*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i])).FrefCount++ result = XTcl_TimeRateObjCmd(tls, libc.UintptrFromInt32(0), interp, i+int32(1), bp+48) _objPtr1 = (*(*[6]uintptr)(unsafe.Pointer(bp + 48)))[i] v17 = _objPtr1 v16 = *(*TTcl_Size)(unsafe.Pointer(v17)) *(*TTcl_Size)(unsafe.Pointer(v17))-- if v16 <= int64(1) { XTclFreeObj(tls, _objPtr1) } if result != TCL_OK { return result } maxCalTime += *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) /* * Increase maxms for more precise calibration. */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) -= -*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) / int64(4) /* * As long as new value more as 0.05% better */ } return result } if *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) == 0 { /* * Reset last measurement overhead */ _measureOverhead = libc.Float64FromInt32(0) XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, 0)) return TCL_OK } /* * If time is negative, make current overhead more precise. */ if *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) > 0 { /* * Set last measurement overhead to max. */ _measureOverhead = float64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))) } else { *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = -*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) } } if *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) == libc.Int64FromUint64(libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))+libc.Uint64FromInt32(1)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = int64(1000) } if *(*float64)(unsafe.Pointer(bp)) == float64(-libc.Int32FromInt32(1)) { *(*float64)(unsafe.Pointer(bp)) = _measureOverhead } /* * Ensure that resetting of result will not smudge the further * measurement. */ XTcl_ResetResult(tls, interp) /* * Compile object if needed. */ if !(direct != 0) { if XTclInterpReady(tls, interp) != TCL_OK { return int32(TCL_ERROR) } codePtr = XTclCompileObj(tls, interp, objPtr, libc.UintptrFromInt32(0), 0) XTclPreserveByteCode(tls, codePtr) } /* * Get start and stop time. */ XTcl_GetTime(tls, bp+16) start = (*(*TTcl_Time)(unsafe.Pointer(bp + 16))).Fsec start *= int64(1000000) start += (*(*TTcl_Time)(unsafe.Pointer(bp + 16))).Fusec middle = start /* * Time to stop execution (in microsecs). */ stop = start + *(*TTcl_WideInt)(unsafe.Pointer(bp + 8))*int64(1000) /* * Start measurement. */ if maxcnt > uint64(0) { for int32(1) != 0 { /* * Evaluate a single iteration. */ count++ if !(direct != 0) { /* precompiled */ rootPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr /* * Use loop optimized TEBC call (TCL_EVAL_DISCARD_RESULT): it's a part of * iteration, this way evaluation will be more similar to a cycle (also * avoids extra overhead to set result to interp, etc.) */ *(*int32)(unsafe.Pointer(interp + 256)) |= int32(TCL_EVAL_DISCARD_RESULT) result = XTclNRExecuteByteCode(tls, interp, codePtr) result = XTclNRRunCallbacks(tls, interp, result, rootPtr) } else { /* eval */ result = XTclEvalObjEx(tls, interp, objPtr, 0, libc.UintptrFromInt32(0), 0) } /* * Allow break and continue from measurement cycle (used for * conditional stop and flow control of iterations). */ switch result { case TCL_OK: case int32(TCL_BREAK): /* * Force stop immediately. */ threshold = uint64(1) maxcnt = uint64(0) /* FALLTHRU */ fallthrough case int32(TCL_CONTINUE): result = TCL_OK default: goto done } /* * Don't check time up to threshold. */ threshold-- v18 = threshold if v18 > uint64(0) { continue } /* * Check stop time reached, estimate new threshold. */ XTcl_GetTime(tls, bp+16) middle = (*(*TTcl_Time)(unsafe.Pointer(bp + 16))).Fsec middle *= int64(1000000) middle += (*(*TTcl_Time)(unsafe.Pointer(bp + 16))).Fusec if middle >= stop || count >= maxcnt { break } /* * Don't calculate threshold by few iterations, because sometimes * first iteration(s) can be too fast or slow (cached, delayed * clean up, etc). */ if count < uint64(10) { threshold = uint64(1) continue } /* * Average iteration time in microsecs. */ threshold = libc.Uint64FromInt64(middle-start) / count if threshold > maxIterTm { maxIterTm = threshold /* * Iterations seem to be longer. */ if threshold > maxIterTm*uint64(2) { factor = uint16(int32(factor) * libc.Int32FromInt32(2)) if libc.Int32FromUint16(factor) > int32(50) { factor = uint16(50) } } else { if libc.Int32FromUint16(factor) < int32(50) { factor++ } } } else { if libc.Int32FromUint16(factor) > int32(4) { /* * Iterations seem to be shorter. */ if threshold < maxIterTm/uint64(2) { factor = uint16(int32(factor) / libc.Int32FromInt32(2)) if libc.Int32FromUint16(factor) < int32(4) { factor = uint16(4) } } else { factor-- } } } /* * As relation between remaining time and time since last check, * maximal some % of time (by factor), so avoid growing of the * execution time if iterations are not consistent, e.g. was * continuously on time). */ threshold = libc.Uint64FromInt64(stop-middle)/maxIterTm/uint64(factor) + uint64(1) if threshold > uint64(100000) { /* fix for too large threshold */ threshold = uint64(100000) } /* * Consider max-count */ if threshold > maxcnt-count { threshold = maxcnt - count } } } objs = bp + 96 /* * Absolute execution time in microseconds or in wide clicks. */ usec = libc.Uint64FromInt64(middle - start) if !(count != 0) { /* no iterations - avoid divide by zero */ if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs + 4*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs + 4*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)))).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)))).FinternalRep)) = int64(libc.Int32FromInt32(0)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) v20 = *(*uintptr)(unsafe.Pointer(objs + 4*8)) *(*uintptr)(unsafe.Pointer(objs + 2*8)) = v20 *(*uintptr)(unsafe.Pointer(objs)) = v20 goto retRes } /* * If not calibrating... */ if !(calibrate != 0) { /* * Minimize influence of measurement overhead. */ if *(*float64)(unsafe.Pointer(bp)) > libc.Float64FromInt32(0) { /* * Estimate the time of overhead (microsecs). */ curOverhead = uint64(*(*float64)(unsafe.Pointer(bp)) * float64(count)) if usec > curOverhead { usec -= curOverhead } else { usec = uint64(0) } } } else { /* * Calibration: obtaining new measurement overhead. */ if _measureOverhead > float64(usec)/float64(count) { _measureOverhead = float64(usec) / float64(count) } if v21 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v21 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v21 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs)) = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)))).Fbytes = libc.UintptrFromInt32(0) *(*float64)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)))).FinternalRep)) = _measureOverhead (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)))).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType)) if v22 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v22 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v22 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs + 1*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs + 1*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).FrefCount = 0 if libc.Uint64FromInt64(15)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(15)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes, __ccgo_ts+20748, libc.Uint64FromInt64(15)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes + uintptr(libc.Uint64FromInt64(15)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(15) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).FtypePtr = libc.UintptrFromInt32(0) /* mics */ objs += uintptr(2) * 8 } val = usec / count /* microsecs per iteration */ if val >= uint64(1000000) { if v23 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v23 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v23 || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs)) = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)))).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)))).FinternalRep)) = libc.Int64FromUint64(val) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } else { if val < uint64(10) { digits = int32(6) } else { if val < uint64(100) { digits = int32(4) } else { if val < uint64(1000) { digits = int32(3) } else { if val < uint64(10000) { digits = int32(2) } else { digits = int32(1) } } } } *(*uintptr)(unsafe.Pointer(objs)) = XTcl_ObjPrintf(tls, __ccgo_ts+20763, libc.VaList(bp+168, digits, float64(usec)/float64(count))) } if v24 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v24 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v24 || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs + 2*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs + 2*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 2*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 2*8)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 2*8)))).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 2*8)))).FinternalRep)) = libc.Int64FromUint64(count) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 2*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) /* iterations */ /* * Calculate speed as rate (count) per sec */ if !(usec != 0) { usec++ /* Avoid divide by zero. */ } if count < libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1))/libc.Int64FromInt32(1000000)) { val = count * uint64(1000000) / usec if val < uint64(100000) { if val < uint64(100) { digits = int32(3) } else { if val < uint64(1000) { digits = int32(2) } else { digits = int32(1) } } *(*uintptr)(unsafe.Pointer(objs + 4*8)) = XTcl_ObjPrintf(tls, __ccgo_ts+20763, libc.VaList(bp+168, digits, float64(count*libc.Uint64FromInt32(1000000))/float64(usec))) } else { if v25 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v25 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v25 || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs + 4*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs + 4*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)))).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)))).FinternalRep)) = libc.Int64FromUint64(val) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 4*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } } else { *(*uintptr)(unsafe.Pointer(objs + 4*8)) = XTcl_NewWideIntObj(tls, libc.Int64FromUint64(count/usec*uint64(1000000))) } goto retRes retRes: ; /* * Estimated net execution time (in millisecs). */ if !(calibrate != 0) { if usec >= uint64(1) { *(*uintptr)(unsafe.Pointer(objs + 6*8)) = XTcl_ObjPrintf(tls, __ccgo_ts+20768, libc.VaList(bp+168, float64(usec)/libc.Float64FromInt32(1000))) } else { if v26 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v26 { cachePtr8 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v26 || (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs + 6*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs + 6*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 6*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 6*8)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 6*8)))).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 6*8)))).FinternalRep)) = int64(libc.Int32FromInt32(0)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 6*8)))).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } if v27 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v27 { cachePtr9 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v27 || (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs + 7*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs + 7*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).FrefCount = 0 if libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Fbytes, __ccgo_ts+20773, libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Fbytes + uintptr(libc.Uint64FromInt64(7)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(7) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 7*8)))).FtypePtr = libc.UintptrFromInt32(0) } /* * Construct the result as a list because many programs have always * parsed as such (extracting the first element, typically). */ if v28 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v28 { cachePtr10 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v28 || (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs + 1*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs + 1*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).FrefCount = 0 if libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes, __ccgo_ts+20780, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Fbytes + uintptr(libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(6) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 1*8)))).FtypePtr = libc.UintptrFromInt32(0) /* mics/# */ if v29 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v29 { cachePtr11 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v29 || (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs + 3*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs + 3*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).FrefCount = 0 if libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Fbytes, __ccgo_ts+20786, libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Fbytes + uintptr(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(2) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 3*8)))).FtypePtr = libc.UintptrFromInt32(0) if v30 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v30 { cachePtr12 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v30 || (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objs + 5*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objs + 5*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).FrefCount = 0 if libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Fbytes, __ccgo_ts+20788, libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Fbytes + uintptr(libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(6) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objs + 5*8)))).FtypePtr = libc.UintptrFromInt32(0) XTcl_SetObjResult(tls, interp, XTcl_NewListObj(tls, int64(8), bp+96)) goto done done: ; if codePtr != libc.UintptrFromInt32(0) { XTclReleaseByteCode(tls, codePtr) } return result } var _measureOverhead = libc.Float64FromInt32(0) var _options8 = [5]uintptr{ 0: __ccgo_ts + 20650, 1: __ccgo_ts + 20658, 2: __ccgo_ts + 20668, 3: __ccgo_ts + 18684, 4: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * Tcl_TryObjCmd, TclNRTryObjCmd -- * * This procedure is invoked to process the "try" Tcl command. See the * user documentation (or TIP #329) for details on what it does. * * Results: * A standard Tcl object result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_TryObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRTryObjCmd), clientData, int64(objc), objv) } func XTclNRTryObjCmd(tls *libc.TLS, dummy4682 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) /* Argument objects. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, _objPtr8, _objPtr9, bodyObj, cachePtr, cachePtr1, cachePtr2, finallyObj, handlersObj, v10, v12, v15, v17, v19, v22, v24, v28, v31, v33, v35, v4 uintptr var bodyShared, haveHandlers, i, v13, v20, v25 int32 var v1, v29, v30 bool var v11, v14, v16, v18, v23, v27, v3, v32, v34, v9 TTcl_Size var v21, v26 int64 var _ /* code at bp+0 */ int32 var _ /* dummy at bp+8 */ TTcl_Size var _ /* info at bp+24 */ [5]uintptr var _ /* type at bp+16 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, _objPtr8, _objPtr9, bodyObj, bodyShared, cachePtr, cachePtr1, cachePtr2, finallyObj, handlersObj, haveHandlers, i, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v4, v9 finallyObj = libc.UintptrFromInt32(0) /* * Parse the arguments. The handlers are passed to subsequent callbacks as * a Tcl_Obj list of the 5-tuples like (type, returnCode, errorCodePrefix, * bindVariables, script), and the finally script is just passed as it is. */ if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+20810) return int32(TCL_ERROR) } bodyObj = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { handlersObj = XTclThreadAllocObj(tls) } else { handlersObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(handlersObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(handlersObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(handlersObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(handlersObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(handlersObj)).FtypePtr = libc.UintptrFromInt32(0) bodyShared = 0 haveHandlers = 0 i = int32(2) for { if !(i < objc) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), uintptr(unsafe.Pointer(&_handlerNames)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+20846, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< objc-int32(4) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+20972, int64(-int32(1)))) _objPtr3 = handlersObj v15 = _objPtr3 v14 = *(*TTcl_Size)(unsafe.Pointer(v15)) *(*TTcl_Size)(unsafe.Pointer(v15))-- if v14 <= int64(1) { XTclFreeObj(tls, _objPtr3) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20887, __ccgo_ts+21041, __ccgo_ts+16490, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } if XTclGetCompletionCodeFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)), bp) != TCL_OK { _objPtr4 = handlersObj v17 = _objPtr4 v16 = *(*TTcl_Size)(unsafe.Pointer(v17)) *(*TTcl_Size)(unsafe.Pointer(v17))-- if v16 <= int64(1) { XTclFreeObj(tls, _objPtr4) } return int32(TCL_ERROR) } (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)] = libc.UintptrFromInt32(0) goto commonHandler _7: ; /* trap pattern variableList script */ if i > objc-int32(4) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+21044, int64(-int32(1)))) _objPtr5 = handlersObj v19 = _objPtr5 v18 = *(*TTcl_Size)(unsafe.Pointer(v19)) *(*TTcl_Size)(unsafe.Pointer(v19))-- if v18 <= int64(1) { XTclFreeObj(tls, _objPtr5) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20887, __ccgo_ts+21120, __ccgo_ts+16490, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } *(*int32)(unsafe.Pointer(bp)) = int32(1) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)) + 32))).Fptr2 != 0 { v21 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)) + 32))).Fptr2)).FspanLength } else { v21 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v21 v20 = libc.Int32FromInt32(TCL_OK) } else { v20 = XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)), bp+8) } if v20 != TCL_OK { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)))).Fbytes != 0 { v22 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)))).Fbytes } else { v22 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+21125, libc.VaList(bp+72, v22))) _objPtr6 = handlersObj v24 = _objPtr6 v23 = *(*TTcl_Size)(unsafe.Pointer(v24)) *(*TTcl_Size)(unsafe.Pointer(v24))-- if v23 <= int64(1) { XTclFreeObj(tls, _objPtr6) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20887, __ccgo_ts+21120, __ccgo_ts+21157, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)] = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)) goto commonHandler commonHandler: ; if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(2))*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(2))*8)) + 32))).Fptr2 != 0 { v26 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(2))*8)) + 32))).Fptr2)).FspanLength } else { v26 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(2))*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v26 v25 = libc.Int32FromInt32(TCL_OK) } else { v25 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(2))*8)), bp+8) } if v25 != TCL_OK { _objPtr7 = handlersObj v28 = _objPtr7 v27 = *(*TTcl_Size)(unsafe.Pointer(v28)) *(*TTcl_Size)(unsafe.Pointer(v28))-- if v27 <= int64(1) { XTclFreeObj(tls, _objPtr7) } return int32(TCL_ERROR) } (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[0] = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) /* type */ if v29 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v29 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v29 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(1)] = XTclThreadAllocObj(tls) } else { (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(1)] = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(1)] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(1)])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(1)])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(1)])).FinternalRep)) = int64(*(*int32)(unsafe.Pointer(bp))) (*TTcl_Obj)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(1)])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) /* returnCode */ if (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)] == libc.UintptrFromInt32(0) { /* errorCodePrefix */ if v30 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v30 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v30 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)] = XTclThreadAllocObj(tls) } else { (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)] = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)])).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)])).Flength = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(2)])).FtypePtr = libc.UintptrFromInt32(0) } (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(3)] = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(2))*8)) /* bindVariables */ (*(*[5]uintptr)(unsafe.Pointer(bp + 24)))[int32(4)] = *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(3))*8)) /* script */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(3))*8)))).Fbytes != 0 { v31 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(3))*8)))).Fbytes } else { v31 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(3))*8)), libc.UintptrFromInt32(0)) } bodyShared = libc.BoolInt32(!(libc.Xstrcmp(tls, v31, __ccgo_ts+6319) != 0)) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), handlersObj, XTcl_NewListObj(tls, int64(5), bp+24)) haveHandlers = int32(1) i += int32(3) goto _8 _8: ; goto _2 _2: ; i++ } if bodyShared != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+21167, int64(-int32(1)))) _objPtr8 = handlersObj v33 = _objPtr8 v32 = *(*TTcl_Size)(unsafe.Pointer(v33)) *(*TTcl_Size)(unsafe.Pointer(v33))-- if v32 <= int64(1) { XTclFreeObj(tls, _objPtr8) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+72, __ccgo_ts+2004, __ccgo_ts+8210, __ccgo_ts+20887, __ccgo_ts+21219, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } if !(haveHandlers != 0) { _objPtr9 = handlersObj v35 = _objPtr9 v34 = *(*TTcl_Size)(unsafe.Pointer(v35)) *(*TTcl_Size)(unsafe.Pointer(v35))-- if v34 <= int64(1) { XTclFreeObj(tls, _objPtr9) } handlersObj = libc.UintptrFromInt32(0) } /* * Execute the body. */ XTcl_NRAddCallback(tls, interp, __ccgo_fp(_TryPostBody), handlersObj, finallyObj, objv, uintptr(int64(objc))) return XTclNREvalObjEx(tls, interp, bodyObj, 0, (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr, int32(1)) } var _handlerNames = [4]uintptr{ 0: __ccgo_ts + 20794, 1: __ccgo_ts + 20802, 2: __ccgo_ts + 20805, 3: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * During -- * * This helper function patches together the updates to the interpreter's * return options that are needed when things fail during the processing * of a handler or finally script for the [try] command. * * Returns: * The new option dictionary. * *---------------------------------------------------------------------- */ func _During(tls *libc.TLS, interp uintptr, resultCode int32, oldOptions uintptr, errorInfo uintptr) (r uintptr) { /* An object to append to the errorinfo and * release, or NULL if nothing is to be added. * Designed to be used with Tcl_ObjPrintf. */ var _objPtr, options, v2 uintptr var v1 TTcl_Size _, _, _, _ = _objPtr, options, v1, v2 if errorInfo != libc.UintptrFromInt32(0) { XTcl_AppendObjToErrorInfo(tls, interp, errorInfo) } options = XTcl_GetReturnOptions(tls, interp, resultCode) XTclDictPut(tls, interp, options, __ccgo_ts+21234, oldOptions) (*TTcl_Obj)(unsafe.Pointer(options)).FrefCount++ _objPtr = oldOptions v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return options } /* *---------------------------------------------------------------------- * * TryPostBody -- * * Callback to handle the outcome of the execution of the body of a 'try' * command. * *---------------------------------------------------------------------- */ func _TryPostBody(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(112) defer tls.Free(112) var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, cmdObj, finallyObj, handlerBodyObj, handlersObj, objv, options, resultObj, v1, v19, v23, v25, v27, v3, v30, v32, v34, v36, v4 uintptr var found, objc, v15, v28 int32 var i, j, v2, v22, v24, v26, v29, v31, v33, v35 TTcl_Size var v10, v11, v13, v14, v16, v17, v21, v6, v7 int64 var _ /* bits1 at bp+48 */ uintptr var _ /* bits2 at bp+56 */ uintptr var _ /* code at bp+0 */ int32 var _ /* errcode at bp+40 */ uintptr var _ /* handlers at bp+16 */ uintptr var _ /* info at bp+24 */ uintptr var _ /* len1 at bp+64 */ TTcl_Size var _ /* len2 at bp+72 */ TTcl_Size var _ /* numElems at bp+32 */ TTcl_Size var _ /* numHandlers at bp+8 */ TTcl_Size var _ /* varName at bp+80 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, cmdObj, finallyObj, found, handlerBodyObj, handlersObj, i, j, objc, objv, options, resultObj, v1, v10, v11, v13, v14, v15, v16, v17, v19, v2, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v4, v6, v7 *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 handlersObj = *(*uintptr)(unsafe.Pointer(data)) finallyObj = *(*uintptr)(unsafe.Pointer(data + 1*8)) objv = *(*uintptr)(unsafe.Pointer(data + 2*8)) objc = int32(int64(*(*uintptr)(unsafe.Pointer(data + 3*8)))) cmdObj = *(*uintptr)(unsafe.Pointer(objv)) /* * Check for limits/rewinding, which override normal trapping behaviour. */ if (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).Frewind != 0 || XTcl_LimitExceeded(tls, interp) != 0 { if (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, cmdObj, libc.UintptrFromInt32(0)) } XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15919, libc.VaList(bp+96, v1, XTcl_GetErrorLine(tls, interp)))) if handlersObj != libc.UintptrFromInt32(0) { _objPtr = handlersObj v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return int32(TCL_ERROR) } /* * Basic processing of the outcome of the script, including adding of * errorinfo trace. */ if result == int32(TCL_ERROR) { if (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 { v4 = (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes } else { v4 = XTcl_GetStringFromObj(tls, cmdObj, libc.UintptrFromInt32(0)) } XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+15919, libc.VaList(bp+96, v4, XTcl_GetErrorLine(tls, interp)))) } resultObj = XTcl_GetObjResult(tls, interp) (*TTcl_Obj)(unsafe.Pointer(resultObj)).FrefCount++ options = XTcl_GetReturnOptions(tls, interp, result) (*TTcl_Obj)(unsafe.Pointer(options)).FrefCount++ XTcl_ResetResult(tls, interp) /* * Handle the results. */ if handlersObj != libc.UintptrFromInt32(0) { found = 0 if (*TTcl_Obj)(unsafe.Pointer(handlersObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(handlersObj + 32))).Fptr2 != 0 { v6 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(handlersObj + 32))).Fptr2)).FspanStart } else { v6 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(handlersObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(handlersObj + 32))).Fptr1 + 40 + uintptr(v6)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(handlersObj + 32))).Fptr2 != 0 { v7 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(handlersObj + 32))).Fptr2)).FspanLength } else { v7 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(handlersObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v7 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), handlersObj, bp+8, bp+16) } i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = 0 if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)) + 32))).Fptr2 != 0 { v10 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)) + 32))).Fptr2)).FspanStart } else { v10 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 24)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)) + 32))).Fptr1 + 40 + uintptr(v10)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)) + 32))).Fptr2 != 0 { v11 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)) + 32))).Fptr2)).FspanLength } else { v11 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = v11 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)), bp+32, bp+24) } if !(found != 0) { XTcl_GetIntFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 1*8)), bp) if *(*int32)(unsafe.Pointer(bp)) != result { goto _8 } /* * When processing an error, we must also perform list-prefix * matching of the errorcode list. However, if this was an * 'on' handler, the list that we are matching against will be * empty. */ if *(*int32)(unsafe.Pointer(bp)) == int32(TCL_ERROR) { XTclDictGet(tls, libc.UintptrFromInt32(0), options, __ccgo_ts+15231, bp+40) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 2*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 2*8)) + 32))).Fptr2 != 0 { v13 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 2*8)) + 32))).Fptr2)).FspanStart } else { v13 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 2*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 48)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 2*8)) + 32))).Fptr1 + 40 + uintptr(v13)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 2*8)) + 32))).Fptr2 != 0 { v14 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 2*8)) + 32))).Fptr2)).FspanLength } else { v14 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 2*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 64)) = v14 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 2*8)), bp+64, bp+48) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2 != 0 { v16 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2)).FspanStart } else { v16 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 56)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr1 + 40 + uintptr(v16)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2 != 0 { v17 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2)).FspanLength } else { v17 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 72)) = v17 v15 = libc.Int32FromInt32(TCL_OK) } else { v15 = XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 40)), bp+72, bp+56) } if v15 != TCL_OK { goto _8 } if *(*TTcl_Size)(unsafe.Pointer(bp + 72)) < *(*TTcl_Size)(unsafe.Pointer(bp + 64)) { goto _8 } j = 0 for { if !(j < *(*TTcl_Size)(unsafe.Pointer(bp + 64))) { break } if XTclStringCmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)) + uintptr(j)*8)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 56)) + uintptr(j)*8)), int32(1), 0, int64(-libc.Int32FromInt32(1))) != 0 { /* * Really want 'continue outerloop;', but C does * not give us that. */ goto didNotMatch } goto _18 _18: ; j++ } } found = int32(1) } /* * Now we need to scan forward over "-" bodies. Note that we've * already checked that the last body is not a "-", so this search * will terminate successfully. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 4*8)))).Fbytes != 0 { v19 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 4*8)))).Fbytes } else { v19 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 4*8)), libc.UintptrFromInt32(0)) } if !(libc.Xstrcmp(tls, v19, __ccgo_ts+6319) != 0) { goto _8 } /* * Bind the variables. We already know this is a list of variable * names, but it might be empty. */ XTcl_ResetResult(tls, interp) result = int32(TCL_ERROR) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 3*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 3*8)) + 32))).Fptr2 != 0 { v21 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 3*8)) + 32))).Fptr2)).FspanLength } else { v21 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 3*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = v21 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 3*8)), bp+32) } if *(*TTcl_Size)(unsafe.Pointer(bp + 32)) > 0 { XTcl_ListObjIndex(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 3*8)), 0, bp+80) if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 80)), libc.UintptrFromInt32(0), resultObj, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { _objPtr1 = resultObj v23 = _objPtr1 v22 = *(*TTcl_Size)(unsafe.Pointer(v23)) *(*TTcl_Size)(unsafe.Pointer(v23))-- if v22 <= int64(1) { XTclFreeObj(tls, _objPtr1) } goto handlerFailed } _objPtr2 = resultObj v25 = _objPtr2 v24 = *(*TTcl_Size)(unsafe.Pointer(v25)) *(*TTcl_Size)(unsafe.Pointer(v25))-- if v24 <= int64(1) { XTclFreeObj(tls, _objPtr2) } if *(*TTcl_Size)(unsafe.Pointer(bp + 32)) > int64(1) { XTcl_ListObjIndex(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 3*8)), int64(1), bp+80) if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 80)), libc.UintptrFromInt32(0), options, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { goto handlerFailed } } } else { /* * Dispose of the result to prevent a memleak. [Bug 2910044] */ _objPtr3 = resultObj v27 = _objPtr3 v26 = *(*TTcl_Size)(unsafe.Pointer(v27)) *(*TTcl_Size)(unsafe.Pointer(v27))-- if v26 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } /* * Evaluate the handler body and process the outcome. Note that we * need to keep the kind of handler for debugging purposes, and in * any case anything we want from info[] must be extracted right * now because the info[] array is about to become invalid. There * is very little refcount handling here however, since we know * that the objects that we still want to refer to now were input * arguments to [try] and so are still on the Tcl value stack. */ handlerBodyObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 4*8)) if finallyObj == libc.UintptrFromInt32(0) { v28 = 0 } else { v28 = objc - int32(1) } XTcl_NRAddCallback(tls, interp, __ccgo_fp(_TryPostHandler), objv, options, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))), uintptr(int64(v28))) _objPtr4 = handlersObj v30 = _objPtr4 v29 = *(*TTcl_Size)(unsafe.Pointer(v30)) *(*TTcl_Size)(unsafe.Pointer(v30))-- if v29 <= int64(1) { XTclFreeObj(tls, _objPtr4) } return XTclNREvalObjEx(tls, interp, handlerBodyObj, 0, (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr, int32(int64(4)*i+int64(5))) goto handlerFailed handlerFailed: ; resultObj = XTcl_GetObjResult(tls, interp) (*TTcl_Obj)(unsafe.Pointer(resultObj)).FrefCount++ options = _During(tls, interp, result, options, libc.UintptrFromInt32(0)) break goto didNotMatch didNotMatch: ; goto _8 goto _8 _8: ; i++ } /* * No handler matched; get rid of the list of handlers. */ _objPtr5 = handlersObj v32 = _objPtr5 v31 = *(*TTcl_Size)(unsafe.Pointer(v32)) *(*TTcl_Size)(unsafe.Pointer(v32))-- if v31 <= int64(1) { XTclFreeObj(tls, _objPtr5) } } /* * Process the finally clause. */ if finallyObj != libc.UintptrFromInt32(0) { XTcl_NRAddCallback(tls, interp, __ccgo_fp(_TryPostFinal), resultObj, options, cmdObj, libc.UintptrFromInt32(0)) return XTclNREvalObjEx(tls, interp, finallyObj, 0, (*TInterp)(unsafe.Pointer(interp)).FcmdFramePtr, objc-int32(1)) } /* * Install the correct result/options into the interpreter and clean up * any temporary storage. */ result = XTcl_SetReturnOptions(tls, interp, options) _objPtr6 = options v34 = _objPtr6 v33 = *(*TTcl_Size)(unsafe.Pointer(v34)) *(*TTcl_Size)(unsafe.Pointer(v34))-- if v33 <= int64(1) { XTclFreeObj(tls, _objPtr6) } XTcl_SetObjResult(tls, interp, resultObj) _objPtr7 = resultObj v36 = _objPtr7 v35 = *(*TTcl_Size)(unsafe.Pointer(v36)) *(*TTcl_Size)(unsafe.Pointer(v36))-- if v35 <= int64(1) { XTclFreeObj(tls, _objPtr7) } return result } /* *---------------------------------------------------------------------- * * TryPostHandler -- * * Callback to handle the outcome of the execution of a handler of a * 'try' command. * *---------------------------------------------------------------------- */ func _TryPostHandler(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, _objPtr1, _objPtr2, _objPtr3, cmdObj, finallyObj, handlerKindObj, iPtr, objv, options, resultObj, v1, v11, v13, v2, v3, v5, v6, v7, v9 uintptr var finallyIndex int32 var v10, v12, v4, v8 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, cmdObj, finallyIndex, finallyObj, handlerKindObj, iPtr, objv, options, resultObj, v1, v10, v11, v12, v13, v2, v3, v4, v5, v6, v7, v8, v9 objv = *(*uintptr)(unsafe.Pointer(data)) options = *(*uintptr)(unsafe.Pointer(data + 1*8)) handlerKindObj = *(*uintptr)(unsafe.Pointer(data + 2*8)) finallyIndex = int32(int64(*(*uintptr)(unsafe.Pointer(data + 3*8)))) cmdObj = *(*uintptr)(unsafe.Pointer(objv)) if finallyIndex != 0 { v1 = *(*uintptr)(unsafe.Pointer(objv + uintptr(finallyIndex)*8)) } else { v1 = uintptr(0) } finallyObj = v1 /* * Check for limits/rewinding, which override normal trapping behaviour. */ if (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).Frewind != 0 || XTcl_LimitExceeded(tls, interp) != 0 { if (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, cmdObj, libc.UintptrFromInt32(0)) } if (*TTcl_Obj)(unsafe.Pointer(handlerKindObj)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(handlerKindObj)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, handlerKindObj, libc.UintptrFromInt32(0)) } options = _During(tls, interp, result, options, XTcl_ObjPrintf(tls, __ccgo_ts+21242, libc.VaList(bp+8, v2, v3, XTcl_GetErrorLine(tls, interp)))) _objPtr = options v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } return int32(TCL_ERROR) } /* * The handler result completely substitutes for the result of the body. */ resultObj = XTcl_GetObjResult(tls, interp) (*TTcl_Obj)(unsafe.Pointer(resultObj)).FrefCount++ if result == int32(TCL_ERROR) { if (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 { v6 = (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, cmdObj, libc.UintptrFromInt32(0)) } if (*TTcl_Obj)(unsafe.Pointer(handlerKindObj)).Fbytes != 0 { v7 = (*TTcl_Obj)(unsafe.Pointer(handlerKindObj)).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, handlerKindObj, libc.UintptrFromInt32(0)) } options = _During(tls, interp, result, options, XTcl_ObjPrintf(tls, __ccgo_ts+21242, libc.VaList(bp+8, v6, v7, XTcl_GetErrorLine(tls, interp)))) } else { _objPtr1 = options v9 = _objPtr1 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr1) } options = XTcl_GetReturnOptions(tls, interp, result) (*TTcl_Obj)(unsafe.Pointer(options)).FrefCount++ } /* * Process the finally clause if it is present. */ if finallyObj != libc.UintptrFromInt32(0) { iPtr = interp XTcl_NRAddCallback(tls, interp, __ccgo_fp(_TryPostFinal), resultObj, options, cmdObj, libc.UintptrFromInt32(0)) /* The 'finally' script is always the last argument word. */ return XTclNREvalObjEx(tls, interp, finallyObj, 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, finallyIndex) } /* * Install the correct result/options into the interpreter and clean up * any temporary storage. */ result = XTcl_SetReturnOptions(tls, interp, options) _objPtr2 = options v11 = _objPtr2 v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if v10 <= int64(1) { XTclFreeObj(tls, _objPtr2) } XTcl_SetObjResult(tls, interp, resultObj) _objPtr3 = resultObj v13 = _objPtr3 v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if v12 <= int64(1) { XTclFreeObj(tls, _objPtr3) } return result } /* *---------------------------------------------------------------------- * * TryPostFinal -- * * Callback to handle the outcome of the execution of the finally script * of a 'try' command. * *---------------------------------------------------------------------- */ func _TryPostFinal(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, _objPtr1, _objPtr2, _objPtr3, cmdObj, options, origOptions, resultObj, v2, v3, v5, v7, v9 uintptr var v1, v4, v6, v8 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, cmdObj, options, origOptions, resultObj, v1, v2, v3, v4, v5, v6, v7, v8, v9 resultObj = *(*uintptr)(unsafe.Pointer(data)) options = *(*uintptr)(unsafe.Pointer(data + 1*8)) cmdObj = *(*uintptr)(unsafe.Pointer(data + 2*8)) /* * If the result wasn't OK, we need to adjust the result options. */ if result != TCL_OK { _objPtr = resultObj v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } resultObj = libc.UintptrFromInt32(0) if result == int32(TCL_ERROR) { if (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, cmdObj, libc.UintptrFromInt32(0)) } options = _During(tls, interp, result, options, XTcl_ObjPrintf(tls, __ccgo_ts+21277, libc.VaList(bp+8, v3, XTcl_GetErrorLine(tls, interp)))) } else { origOptions = options options = XTcl_GetReturnOptions(tls, interp, result) (*TTcl_Obj)(unsafe.Pointer(options)).FrefCount++ _objPtr1 = origOptions v5 = _objPtr1 v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } } /* * Install the correct result/options into the interpreter and clean up * any temporary storage. */ result = XTcl_SetReturnOptions(tls, interp, options) _objPtr2 = options v7 = _objPtr2 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr2) } if resultObj != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, resultObj) _objPtr3 = resultObj v9 = _objPtr3 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } return result } /* *---------------------------------------------------------------------- * * Tcl_WhileObjCmd -- * * This procedure is invoked to process the "while" Tcl command. See the * user documentation for details on what it does. * * With the bytecode compiler, this procedure is only called when a * command name is computed at runtime, and is "while" or the name to * which "while" was renamed: e.g., "set z while; $z {$i<100} {}" * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_WhileObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { /* Argument objects. */ return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(XTclNRWhileObjCmd), clientData, int64(objc), objv) } func XTclNRWhileObjCmd(tls *libc.TLS, dummy5255 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Argument objects. */ var _objPtr, _objPtr1, cachePtr, cachePtr1 uintptr var v1, v2 bool var _ /* _callbackPtr at bp+8 */ uintptr var _ /* iterPtr at bp+0 */ uintptr _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, v1, v2 if objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+21314) return int32(TCL_ERROR) } /* * We reuse [for]'s callback, passing a NULL for the 'next' script. */ if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fcond = *(*uintptr)(unsafe.Pointer(objv + 1*8)) (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbody = *(*uintptr)(unsafe.Pointer(objv + 2*8)) (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fnext = libc.UintptrFromInt32(0) (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fmsg = __ccgo_ts + 21327 (*TForIterData)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fword = int64(2) if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(XTclNRForIterCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) return TCL_OK } /* *---------------------------------------------------------------------- * * TclListLines -- * * ??? * * Results: * Filled in array of line numbers? * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclListLines(tls *libc.TLS, listObj uintptr, _line TTcl_Size, n TTcl_Size, lines uintptr, elems uintptr) { bp := tls.Alloc(32) defer tls.Free(32) *(*TTcl_Size)(unsafe.Pointer(bp)) = _line /* The list elems as Tcl_Obj*, in need of * derived continuation data */ var clLocPtr, listHead, listStr, v1, v2 uintptr var i, length TTcl_Size var _ /* clNext at bp+24 */ uintptr var _ /* element at bp+8 */ uintptr var _ /* next at bp+16 */ uintptr _, _, _, _, _, _, _ = clLocPtr, i, length, listHead, listStr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(listObj)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(listObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, listObj, libc.UintptrFromInt32(0)) } listStr = v1 listHead = listStr length = libc.Int64FromUint64(libc.Xstrlen(tls, listStr)) *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0) clLocPtr = XTclContinuationsGet(tls, listObj) if clLocPtr != 0 { v2 = clLocPtr + 8 } else { v2 = libc.UintptrFromInt32(0) } *(*uintptr)(unsafe.Pointer(bp + 24)) = v2 i = 0 for { if !(i < n) { break } XTclFindElement(tls, libc.UintptrFromInt32(0), listStr, length, bp+8, bp+16, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0)) XTclAdvanceLines(tls, bp, listStr, *(*uintptr)(unsafe.Pointer(bp + 8))) /* Leading whitespace */ XTclAdvanceContinuations(tls, bp, bp+24, int32(int64(*(*uintptr)(unsafe.Pointer(bp + 8)))-int64(listHead))) if elems != 0 && *(*uintptr)(unsafe.Pointer(bp + 24)) != 0 { XTclContinuationsEnterDerived(tls, *(*uintptr)(unsafe.Pointer(elems + uintptr(i)*8)), int64(*(*uintptr)(unsafe.Pointer(bp + 8)))-int64(listHead), *(*uintptr)(unsafe.Pointer(bp + 24))) } *(*TTcl_Size)(unsafe.Pointer(lines + uintptr(i)*8)) = *(*TTcl_Size)(unsafe.Pointer(bp)) length -= int64(*(*uintptr)(unsafe.Pointer(bp + 16))) - int64(listStr) XTclAdvanceLines(tls, bp, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16))) /* Element */ listStr = *(*uintptr)(unsafe.Pointer(bp + 16)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == 0 { /* ASSERT i == n */ break } goto _3 _3: ; i++ } } /* * The structures below define the AuxData types defined in this file. */ var _foreachInfoType = TAuxDataType{ Fname: __ccgo_ts + 21355, } func init() { p := unsafe.Pointer(&_foreachInfoType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_DupForeachInfo) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_FreeForeachInfo) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_PrintForeachInfo) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_DisassembleForeachInfo) } var _newForeachInfoType = TAuxDataType{ Fname: __ccgo_ts + 21367, } func init() { p := unsafe.Pointer(&_newForeachInfoType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_DupForeachInfo) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_FreeForeachInfo) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_PrintNewForeachInfo) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_DisassembleNewForeachInfo) } var _dictUpdateInfoType = TAuxDataType{ Fname: __ccgo_ts + 21382, } func init() { p := unsafe.Pointer(&_dictUpdateInfoType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_DupDictUpdateInfo) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_FreeDictUpdateInfo) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_PrintDictUpdateInfo) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_DisassembleDictUpdateInfo) } /* *---------------------------------------------------------------------- * * TclGetAuxDataType -- * * This procedure looks up an Auxdata type by name. * * Results: * If an AuxData type with name matching "typeName" is found, a pointer * to its AuxDataType structure is returned; otherwise, NULL is returned. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclGetAuxDataType(tls *libc.TLS, typeName uintptr) (r uintptr) { /* Name of AuxData type to look up. */ if !(libc.Xstrcmp(tls, typeName, _foreachInfoType.Fname) != 0) { return uintptr(unsafe.Pointer(&_foreachInfoType)) } else { if !(libc.Xstrcmp(tls, typeName, _newForeachInfoType.Fname) != 0) { return uintptr(unsafe.Pointer(&_newForeachInfoType)) } else { if !(libc.Xstrcmp(tls, typeName, _dictUpdateInfoType.Fname) != 0) { return uintptr(unsafe.Pointer(&_dictUpdateInfoType)) } else { if !(libc.Xstrcmp(tls, typeName, XtclJumptableInfoType.Fname) != 0) { return uintptr(unsafe.Pointer(&XtclJumptableInfoType)) } } } } return libc.UintptrFromInt32(0) } /* *---------------------------------------------------------------------- * * TclCompileAppendCmd -- * * Procedure called to compile the "append" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "append" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileAppendCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, i1, numWords, v111, v113, v116, v17, v21, v27, v39, v43, v49, v5, v61, v68, v80, v92, v99 int32 var eclIndex TTcl_Size var mapPtr, valueTokenPtr, varTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v112, v114, v115, v117, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v23, v24, v25, v26, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v41, v42, v44, v45, v46, v47, v48, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v62, v64, v65, v66, v67, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v93, v95, v96, v97, v98 uintptr var _ /* isScalar at bp+0 */ int32 var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, i1, mapPtr, numWords, valueTokenPtr, varTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TODO: Consider support for compiling expanded args. */ numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) if numWords == int32(1) { return int32(TCL_ERROR) } else { if numWords == int32(2) { /* * append varName == set varName */ return XTclCompileSetCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } else { if numWords > int32(3) { /* * APPEND instructions currently only handle one value, but we can * handle some multi-value cases by stringing them together. */ goto appendMultiple } } } /* * Decide if we can use a frame slot for the var/array name or if we need * to emit code to compute and push the name at runtime. We use a frame * slot (entry in the array of local vars) if we are compiling a procedure * body and if the name is simple text that does not include namespace * qualifiers. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, varTokenPtr, envPtr2, 0, bp+4, bp) /* * We are doing an assignment, otherwise TclCompileSetCmd was called, so * push the new value. This will need to be extended to push a value for * each argument. */ valueTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } /* * Emit instructions to set/get the variable. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_APPEND_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_APPEND_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } } else { if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(INST_APPEND_SCALAR1)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_APPEND_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v27 = delta1 v28 = envPtr2 if v27 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v28 + 64)) += int64(v27) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = libc.Uint8FromInt32(int32(INST_APPEND_SCALAR4)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_APPEND_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } } } } else { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_APPEND_ARRAY_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_APPEND_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v43 = delta1 v44 = envPtr2 if v43 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v44 + 64)) += int64(v43) } } else { if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = libc.Uint8FromInt32(int32(INST_APPEND_ARRAY1)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_APPEND_ARRAY1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v49 = delta1 v50 = envPtr2 if v49 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v50 + 64)) += int64(v49) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = libc.Uint8FromInt32(int32(INST_APPEND_ARRAY4)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_APPEND_ARRAY4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v61 = delta1 v62 = envPtr2 if v61 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v62 + 64)) += int64(v61) } } } } return TCL_OK goto appendMultiple appendMultiple: ; /* * Can only handle the case where we are appending to a local scalar when * there are multiple values to append. Fortunately, this is common. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 *(*int32)(unsafe.Pointer(bp + 4)) = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, varTokenPtr, envPtr2)) if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { return int32(TCL_ERROR) } /* * Definitely appending to a local scalar; generate the words and append * them. */ valueTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(2) for { if !(i1 < numWords) { break } if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v68 = delta1 v69 = envPtr2 if v68 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v69 + 64)) += int64(v68) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v80 = delta1 v81 = envPtr2 if v80 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v81)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v81)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v81)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v81)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v81 + 64)) += int64(v80) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } valueTokenPtr = valueTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _63 _63: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v83 = envPtr2 + 152 v82 = *(*uintptr)(unsafe.Pointer(v83)) *(*uintptr)(unsafe.Pointer(v83))++ *(*uint8)(unsafe.Pointer(v82)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v85 = envPtr2 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = uint8(libc.Uint32FromInt32(numWords-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = uint8(libc.Uint32FromInt32(numWords-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = uint8(libc.Uint32FromInt32(numWords-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(numWords - libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (numWords - int32(2)) } v92 = delta1 v93 = envPtr2 if v92 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v93 + 64)) += int64(v92) } i1 = int32(2) for { if !(i1 < numWords) { break } if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = libc.Uint8FromInt32(int32(INST_APPEND_SCALAR1)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_APPEND_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v99 = delta1 v100 = envPtr2 if v99 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v100 + 64)) += int64(v99) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = libc.Uint8FromInt32(int32(INST_APPEND_SCALAR4)) v104 = envPtr2 + 152 v103 = *(*uintptr)(unsafe.Pointer(v104)) *(*uintptr)(unsafe.Pointer(v104))++ *(*uint8)(unsafe.Pointer(v103)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_APPEND_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v111 = delta1 v112 = envPtr2 if v111 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v112 + 64)) += int64(v111) } } i1++ v113 = i1 if v113 < numWords { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v116 = delta1 v117 = envPtr2 if v116 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v117)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v117)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v117)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v117)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v117 + 64)) += int64(v116) } } goto _94 _94: } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileArray*Cmd -- * * Functions called to compile "array" subcommands. * * Results: * All return TCL_OK for a successful compile, and TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "array" subcommand at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileArrayExistsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy251 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var delta1, v11, v15 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v12, v13, v14, v16, v2, v3, v4, v5, v6, v7, v8, v9 uintptr var _ /* isScalar at bp+0 */ int32 var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v2, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, tokenPtr, envPtr2, int32(TCL_NO_ELEMENT), bp+4, bp) if !(*(*int32)(unsafe.Pointer(bp)) != 0) { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 4)) >= 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_ARRAY_EXISTS_IMM)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_EXISTS_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v11 = delta1 v12 = envPtr2 if v11 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v12 + 64)) += int64(v11) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32(int32(INST_ARRAY_EXISTS_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_EXISTS_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v15 = delta1 v16 = envPtr2 if v15 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v16 + 64)) += int64(v15) } } return TCL_OK } func XTclCompileArraySetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, code, delta1, fwd, infoIndex, isDataEven, isDataLiteral, isDataValid, keyVar, offsetBack, offsetFwd, valVar, v111, v123, v127, v139, v145, v15, v157, v163, v175, v179, v183, v189, v2, v201, v205, v21, v211, v217, v229, v235, v247, v259, v269, v281, v287, v299, v305, v317, v323, v33, v335, v339, v343, v347, v349, v355, v367, v37, v41, v47, v51, v57, v59, v63, v69, v81, v87, v99 int32 var _objPtr, cachePtr, dataTokenPtr, infoPtr, literalObj, mapPtr, varTokenPtr, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v124, v125, v126, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v14, v140, v141, v142, v143, v144, v146, v147, v148, v149, v150, v151, v152, v153, v154, v155, v156, v158, v159, v16, v160, v161, v162, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v176, v177, v178, v18, v180, v181, v182, v184, v185, v186, v187, v188, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v20, v200, v202, v203, v204, v206, v207, v208, v209, v210, v212, v213, v214, v215, v216, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v23, v230, v231, v232, v233, v234, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v26, v260, v261, v262, v263, v264, v265, v266, v267, v268, v27, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v28, v280, v282, v283, v284, v285, v286, v288, v289, v29, v290, v291, v292, v293, v294, v295, v296, v297, v298, v30, v300, v301, v302, v303, v304, v306, v307, v308, v309, v31, v310, v311, v312, v313, v314, v315, v316, v318, v319, v32, v320, v321, v322, v324, v325, v326, v327, v328, v329, v330, v331, v332, v333, v334, v336, v337, v338, v34, v340, v341, v342, v344, v345, v346, v348, v35, v350, v351, v352, v353, v354, v356, v357, v358, v359, v36, v360, v361, v362, v363, v364, v365, v366, v368, v370, v38, v39, v40, v42, v43, v44, v45, v46, v48, v49, v5, v50, v52, v53, v54, v55, v56, v58, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v82, v83, v84, v85, v86, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98 uintptr var eclIndex, v369 TTcl_Size var v1, v4 bool var v3 int64 var _ /* isScalar at bp+0 */ int32 var _ /* len at bp+8 */ TTcl_Size var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objPtr, cachePtr, code, dataTokenPtr, delta1, eclIndex, fwd, infoIndex, infoPtr, isDataEven, isDataLiteral, isDataValid, keyVar, literalObj, mapPtr, offsetBack, offsetFwd, valVar, varTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v28, v280, v281, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v292, v293, v294, v295, v296, v297, v298, v299, v3, v30, v300, v301, v302, v303, v304, v305, v306, v307, v308, v309, v31, v310, v311, v312, v313, v314, v315, v316, v317, v318, v319, v32, v320, v321, v322, v323, v324, v325, v326, v327, v328, v329, v33, v330, v331, v332, v333, v334, v335, v336, v337, v338, v339, v34, v340, v341, v342, v343, v344, v345, v346, v347, v348, v349, v35, v350, v351, v352, v353, v354, v355, v356, v357, v358, v359, v36, v360, v361, v362, v363, v364, v365, v366, v367, v368, v369, v37, v370, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) code = TCL_OK if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 dataTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { literalObj = XTclThreadAllocObj(tls) } else { literalObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(literalObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(literalObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(literalObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(literalObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(literalObj)).FtypePtr = libc.UintptrFromInt32(0) isDataLiteral = XTclWordKnownAtCompileTime(tls, dataTokenPtr, literalObj) if v4 = isDataLiteral != 0; v4 { if (*TTcl_Obj)(unsafe.Pointer(literalObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(literalObj + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(literalObj + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(literalObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v3 v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), literalObj, bp+8) } } isDataValid = libc.BoolInt32(v4 && v2 == TCL_OK) isDataEven = libc.BoolInt32(isDataValid != 0 && *(*TTcl_Size)(unsafe.Pointer(bp + 8))&int64(1) == 0) /* * Special case: literal odd-length argument is always an error. */ if isDataValid != 0 && !(isDataEven != 0) { /* Abandon custom compile and let invocation raise the error */ code = XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) goto done /* * We used to compile to the bytecode that would throw the error, * but that was wrong because it would not invoke the array trace * on the variable. * PushStringLiteral(envPtr, "list must have an even number of elements"); PushStringLiteral(envPtr, "-errorcode {TCL ARGUMENT FORMAT}"); TclEmitInstInt4(INST_RETURN_IMM, TCL_ERROR, envPtr); TclEmitInt4( 0, envPtr); goto done; * */ } /* * Except for the special "ensure array" case below, when we're not in * a proc, we cannot do a better compile than generic. */ if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr == libc.UintptrFromInt32(0) && !(isDataEven != 0 && *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0) { code = XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) goto done } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, varTokenPtr, envPtr2, int32(TCL_NO_ELEMENT), bp+4, bp) if !(*(*int32)(unsafe.Pointer(bp)) != 0) { code = int32(TCL_ERROR) goto done } /* * Special case: literal empty value argument is just an "ensure array" * operation. */ if isDataEven != 0 && *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 { if *(*int32)(unsafe.Pointer(bp + 4)) >= 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32(INST_ARRAY_EXISTS_IMM)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_EXISTS_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v15 = delta1 v16 = envPtr2 if v15 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v16 + 64)) += int64(v15) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(7))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(7) } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(INST_ARRAY_MAKE_IMM)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_MAKE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v33 = delta1 v34 = envPtr2 if v33 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v34 + 64)) += int64(v33) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v37 = delta1 v38 = envPtr2 if v37 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v38)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v38)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v38)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v38)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v38 + 64)) += int64(v37) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = libc.Uint8FromInt32(int32(INST_ARRAY_EXISTS_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_EXISTS_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(5))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(5) } v47 = delta1 v48 = envPtr2 if v47 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v48 + 64)) += int64(v47) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = libc.Uint8FromInt32(int32(INST_ARRAY_MAKE_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_MAKE_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } /* Each branch decrements stack depth, but we only take one. */ v59 = int32(1) v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v63 = delta1 v64 = envPtr2 if v63 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v64 + 64)) += int64(v63) } } _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v81 = delta1 v82 = envPtr2 if v81 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v82 + 64)) += int64(v81) } } goto done } if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { /* * a non-local variable: upvar from a local one! This consumes the * variable name that was left at stacktop. */ *(*int32)(unsafe.Pointer(bp + 4)) = int32(XTclFindCompiledLocal(tls, (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Fsize, int32(1), envPtr2)) _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v87 = delta1 v88 = envPtr2 if v87 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v88 + 64)) += int64(v87) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v99 = delta1 v100 = envPtr2 if v99 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v100 + 64)) += int64(v99) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v104 = envPtr2 + 152 v103 = *(*uintptr)(unsafe.Pointer(v104)) *(*uintptr)(unsafe.Pointer(v104))++ *(*uint8)(unsafe.Pointer(v103)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v111 = delta1 v112 = envPtr2 if v111 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v112 + 64)) += int64(v111) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = libc.Uint8FromInt32(int32(INST_UPVAR)) v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UPVAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v123 = delta1 v124 = envPtr2 if v123 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v124)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v124)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v124)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v124)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v124 + 64)) += int64(v123) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v126 = envPtr2 + 152 v125 = *(*uintptr)(unsafe.Pointer(v126)) *(*uintptr)(unsafe.Pointer(v126))++ *(*uint8)(unsafe.Pointer(v125)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v127 = delta1 v128 = envPtr2 if v127 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v128)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v128)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v128)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v128)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v128 + 64)) += int64(v127) } } /* * Prepare for the internal foreach. */ keyVar = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) valVar = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) infoPtr = XTcl_Alloc(tls, uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt64(8)) (*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists = int64(1) *(*uintptr)(unsafe.Pointer(infoPtr + 24)) = XTcl_Alloc(tls, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(8)) (*TForeachVarList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(infoPtr + 24)))).FnumVars = int64(2) *(*TTcl_Size)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(infoPtr + 24)) + 8)) = int64(keyVar) *(*TTcl_Size)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(infoPtr + 24)) + 8 + 1*8)) = int64(valVar) infoIndex = int32(XTclCreateAuxData(tls, infoPtr, uintptr(unsafe.Pointer(&_newForeachInfoType)), envPtr2)) /* * Start issuing instructions to write to the array. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v130 = envPtr2 + 152 v129 = *(*uintptr)(unsafe.Pointer(v130)) *(*uintptr)(unsafe.Pointer(v130))++ *(*uint8)(unsafe.Pointer(v129)) = libc.Uint8FromInt32(int32(INST_ARRAY_EXISTS_IMM)) v132 = envPtr2 + 152 v131 = *(*uintptr)(unsafe.Pointer(v132)) *(*uintptr)(unsafe.Pointer(v132))++ *(*uint8)(unsafe.Pointer(v131)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v134 = envPtr2 + 152 v133 = *(*uintptr)(unsafe.Pointer(v134)) *(*uintptr)(unsafe.Pointer(v134))++ *(*uint8)(unsafe.Pointer(v133)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v136 = envPtr2 + 152 v135 = *(*uintptr)(unsafe.Pointer(v136)) *(*uintptr)(unsafe.Pointer(v136))++ *(*uint8)(unsafe.Pointer(v135)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v138 = envPtr2 + 152 v137 = *(*uintptr)(unsafe.Pointer(v138)) *(*uintptr)(unsafe.Pointer(v138))++ *(*uint8)(unsafe.Pointer(v137)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_EXISTS_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v139 = delta1 v140 = envPtr2 if v139 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v140)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v140)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v140)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v140)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v140 + 64)) += int64(v139) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v142 = envPtr2 + 152 v141 = *(*uintptr)(unsafe.Pointer(v142)) *(*uintptr)(unsafe.Pointer(v142))++ *(*uint8)(unsafe.Pointer(v141)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v144 = envPtr2 + 152 v143 = *(*uintptr)(unsafe.Pointer(v144)) *(*uintptr)(unsafe.Pointer(v144))++ *(*uint8)(unsafe.Pointer(v143)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(7))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(7) } v145 = delta1 v146 = envPtr2 if v145 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v146 + 64)) += int64(v145) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v148 = envPtr2 + 152 v147 = *(*uintptr)(unsafe.Pointer(v148)) *(*uintptr)(unsafe.Pointer(v148))++ *(*uint8)(unsafe.Pointer(v147)) = libc.Uint8FromInt32(int32(INST_ARRAY_MAKE_IMM)) v150 = envPtr2 + 152 v149 = *(*uintptr)(unsafe.Pointer(v150)) *(*uintptr)(unsafe.Pointer(v150))++ *(*uint8)(unsafe.Pointer(v149)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v152 = envPtr2 + 152 v151 = *(*uintptr)(unsafe.Pointer(v152)) *(*uintptr)(unsafe.Pointer(v152))++ *(*uint8)(unsafe.Pointer(v151)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v154 = envPtr2 + 152 v153 = *(*uintptr)(unsafe.Pointer(v154)) *(*uintptr)(unsafe.Pointer(v154))++ *(*uint8)(unsafe.Pointer(v153)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v156 = envPtr2 + 152 v155 = *(*uintptr)(unsafe.Pointer(v156)) *(*uintptr)(unsafe.Pointer(v156))++ *(*uint8)(unsafe.Pointer(v155)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_MAKE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v157 = delta1 v158 = envPtr2 if v157 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v158)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v158)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v158)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v158)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v158 + 64)) += int64(v157) } if (*TTcl_Token)(unsafe.Pointer(dataTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(dataTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(dataTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v160 = envPtr2 + 152 v159 = *(*uintptr)(unsafe.Pointer(v160)) *(*uintptr)(unsafe.Pointer(v160))++ *(*uint8)(unsafe.Pointer(v159)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v162 = envPtr2 + 152 v161 = *(*uintptr)(unsafe.Pointer(v162)) *(*uintptr)(unsafe.Pointer(v162))++ *(*uint8)(unsafe.Pointer(v161)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v163 = delta1 v164 = envPtr2 if v163 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v164)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v164)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v164)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v164)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v164 + 64)) += int64(v163) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v166 = envPtr2 + 152 v165 = *(*uintptr)(unsafe.Pointer(v166)) *(*uintptr)(unsafe.Pointer(v166))++ *(*uint8)(unsafe.Pointer(v165)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v168 = envPtr2 + 152 v167 = *(*uintptr)(unsafe.Pointer(v168)) *(*uintptr)(unsafe.Pointer(v168))++ *(*uint8)(unsafe.Pointer(v167)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v170 = envPtr2 + 152 v169 = *(*uintptr)(unsafe.Pointer(v170)) *(*uintptr)(unsafe.Pointer(v170))++ *(*uint8)(unsafe.Pointer(v169)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v172 = envPtr2 + 152 v171 = *(*uintptr)(unsafe.Pointer(v172)) *(*uintptr)(unsafe.Pointer(v172))++ *(*uint8)(unsafe.Pointer(v171)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v174 = envPtr2 + 152 v173 = *(*uintptr)(unsafe.Pointer(v174)) *(*uintptr)(unsafe.Pointer(v174))++ *(*uint8)(unsafe.Pointer(v173)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v175 = delta1 v176 = envPtr2 if v175 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v176)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v176)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v176)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v176)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v176 + 64)) += int64(v175) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, dataTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(dataTokenPtr)).FnumComponents), envPtr2) } if !(isDataLiteral != 0) || !(isDataValid != 0) { /* * Only need this safety check if we're handling a non-literal or list * containing an invalid literal; with valid list literals, we've * already checked (worth it because literals are a very common * use-case with [array set]). */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v178 = envPtr2 + 152 v177 = *(*uintptr)(unsafe.Pointer(v178)) *(*uintptr)(unsafe.Pointer(v178))++ *(*uint8)(unsafe.Pointer(v177)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v179 = delta1 v180 = envPtr2 if v179 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v180)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v180)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v180)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v180)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v180 + 64)) += int64(v179) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v182 = envPtr2 + 152 v181 = *(*uintptr)(unsafe.Pointer(v182)) *(*uintptr)(unsafe.Pointer(v182))++ *(*uint8)(unsafe.Pointer(v181)) = libc.Uint8FromInt32(int32(INST_LIST_LENGTH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_LENGTH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v183 = delta1 v184 = envPtr2 if v183 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v184)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v184)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v184)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v184)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v184 + 64)) += int64(v183) } _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v186 = envPtr2 + 152 v185 = *(*uintptr)(unsafe.Pointer(v186)) *(*uintptr)(unsafe.Pointer(v186))++ *(*uint8)(unsafe.Pointer(v185)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v188 = envPtr2 + 152 v187 = *(*uintptr)(unsafe.Pointer(v188)) *(*uintptr)(unsafe.Pointer(v188))++ *(*uint8)(unsafe.Pointer(v187)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v189 = delta1 v190 = envPtr2 if v189 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v190)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v190)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v190)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v190)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v190 + 64)) += int64(v189) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v192 = envPtr2 + 152 v191 = *(*uintptr)(unsafe.Pointer(v192)) *(*uintptr)(unsafe.Pointer(v192))++ *(*uint8)(unsafe.Pointer(v191)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v194 = envPtr2 + 152 v193 = *(*uintptr)(unsafe.Pointer(v194)) *(*uintptr)(unsafe.Pointer(v194))++ *(*uint8)(unsafe.Pointer(v193)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v196 = envPtr2 + 152 v195 = *(*uintptr)(unsafe.Pointer(v196)) *(*uintptr)(unsafe.Pointer(v196))++ *(*uint8)(unsafe.Pointer(v195)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v198 = envPtr2 + 152 v197 = *(*uintptr)(unsafe.Pointer(v198)) *(*uintptr)(unsafe.Pointer(v198))++ *(*uint8)(unsafe.Pointer(v197)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v200 = envPtr2 + 152 v199 = *(*uintptr)(unsafe.Pointer(v200)) *(*uintptr)(unsafe.Pointer(v200))++ *(*uint8)(unsafe.Pointer(v199)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v201 = delta1 v202 = envPtr2 if v201 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v202)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v202)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v202)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v202)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v202 + 64)) += int64(v201) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v204 = envPtr2 + 152 v203 = *(*uintptr)(unsafe.Pointer(v204)) *(*uintptr)(unsafe.Pointer(v204))++ *(*uint8)(unsafe.Pointer(v203)) = libc.Uint8FromInt32(int32(INST_BITAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BITAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v205 = delta1 v206 = envPtr2 if v205 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v206)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v206)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v206)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v206)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v206 + 64)) += int64(v205) } offsetFwd = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v208 = envPtr2 + 152 v207 = *(*uintptr)(unsafe.Pointer(v208)) *(*uintptr)(unsafe.Pointer(v208))++ *(*uint8)(unsafe.Pointer(v207)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v210 = envPtr2 + 152 v209 = *(*uintptr)(unsafe.Pointer(v210)) *(*uintptr)(unsafe.Pointer(v210))++ *(*uint8)(unsafe.Pointer(v209)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v211 = delta1 v212 = envPtr2 if v211 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v212)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v212)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v212)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v212)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v212 + 64)) += int64(v211) } _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21399, libc.Int64FromUint64(libc.Uint64FromInt64(42)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v214 = envPtr2 + 152 v213 = *(*uintptr)(unsafe.Pointer(v214)) *(*uintptr)(unsafe.Pointer(v214))++ *(*uint8)(unsafe.Pointer(v213)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v216 = envPtr2 + 152 v215 = *(*uintptr)(unsafe.Pointer(v216)) *(*uintptr)(unsafe.Pointer(v216))++ *(*uint8)(unsafe.Pointer(v215)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v217 = delta1 v218 = envPtr2 if v217 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v218)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v218)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v218)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v218)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v218 + 64)) += int64(v217) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v220 = envPtr2 + 152 v219 = *(*uintptr)(unsafe.Pointer(v220)) *(*uintptr)(unsafe.Pointer(v220))++ *(*uint8)(unsafe.Pointer(v219)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v222 = envPtr2 + 152 v221 = *(*uintptr)(unsafe.Pointer(v222)) *(*uintptr)(unsafe.Pointer(v222))++ *(*uint8)(unsafe.Pointer(v221)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v224 = envPtr2 + 152 v223 = *(*uintptr)(unsafe.Pointer(v224)) *(*uintptr)(unsafe.Pointer(v224))++ *(*uint8)(unsafe.Pointer(v223)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v226 = envPtr2 + 152 v225 = *(*uintptr)(unsafe.Pointer(v226)) *(*uintptr)(unsafe.Pointer(v226))++ *(*uint8)(unsafe.Pointer(v225)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v228 = envPtr2 + 152 v227 = *(*uintptr)(unsafe.Pointer(v228)) *(*uintptr)(unsafe.Pointer(v228))++ *(*uint8)(unsafe.Pointer(v227)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v229 = delta1 v230 = envPtr2 if v229 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v230)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v230)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v230)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v230)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v230 + 64)) += int64(v229) } } _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21441, libc.Int64FromUint64(libc.Uint64FromInt64(33)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v232 = envPtr2 + 152 v231 = *(*uintptr)(unsafe.Pointer(v232)) *(*uintptr)(unsafe.Pointer(v232))++ *(*uint8)(unsafe.Pointer(v231)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v234 = envPtr2 + 152 v233 = *(*uintptr)(unsafe.Pointer(v234)) *(*uintptr)(unsafe.Pointer(v234))++ *(*uint8)(unsafe.Pointer(v233)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v235 = delta1 v236 = envPtr2 if v235 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v236)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v236)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v236)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v236)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v236 + 64)) += int64(v235) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v238 = envPtr2 + 152 v237 = *(*uintptr)(unsafe.Pointer(v238)) *(*uintptr)(unsafe.Pointer(v238))++ *(*uint8)(unsafe.Pointer(v237)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v240 = envPtr2 + 152 v239 = *(*uintptr)(unsafe.Pointer(v240)) *(*uintptr)(unsafe.Pointer(v240))++ *(*uint8)(unsafe.Pointer(v239)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v242 = envPtr2 + 152 v241 = *(*uintptr)(unsafe.Pointer(v242)) *(*uintptr)(unsafe.Pointer(v242))++ *(*uint8)(unsafe.Pointer(v241)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v244 = envPtr2 + 152 v243 = *(*uintptr)(unsafe.Pointer(v244)) *(*uintptr)(unsafe.Pointer(v244))++ *(*uint8)(unsafe.Pointer(v243)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v246 = envPtr2 + 152 v245 = *(*uintptr)(unsafe.Pointer(v246)) *(*uintptr)(unsafe.Pointer(v246))++ *(*uint8)(unsafe.Pointer(v245)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v247 = delta1 v248 = envPtr2 if v247 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v248)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v248)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v248)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v248)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v248 + 64)) += int64(v247) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v250 = envPtr2 + 152 v249 = *(*uintptr)(unsafe.Pointer(v250)) *(*uintptr)(unsafe.Pointer(v250))++ *(*uint8)(unsafe.Pointer(v249)) = libc.Uint8FromInt32(int32(INST_RETURN_IMM)) v252 = envPtr2 + 152 v251 = *(*uintptr)(unsafe.Pointer(v252)) *(*uintptr)(unsafe.Pointer(v252))++ *(*uint8)(unsafe.Pointer(v251)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(24)) v254 = envPtr2 + 152 v253 = *(*uintptr)(unsafe.Pointer(v254)) *(*uintptr)(unsafe.Pointer(v254))++ *(*uint8)(unsafe.Pointer(v253)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(16)) v256 = envPtr2 + 152 v255 = *(*uintptr)(unsafe.Pointer(v256)) *(*uintptr)(unsafe.Pointer(v256))++ *(*uint8)(unsafe.Pointer(v255)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(8)) v258 = envPtr2 + 152 v257 = *(*uintptr)(unsafe.Pointer(v258)) *(*uintptr)(unsafe.Pointer(v258))++ *(*uint8)(unsafe.Pointer(v257)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RETURN_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(TCL_ERROR) } v259 = delta1 v260 = envPtr2 if v259 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v260)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v260)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v260)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v260)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v260 + 64)) += int64(v259) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v262 = envPtr2 + 152 v261 = *(*uintptr)(unsafe.Pointer(v262)) *(*uintptr)(unsafe.Pointer(v262))++ *(*uint8)(unsafe.Pointer(v261)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v264 = envPtr2 + 152 v263 = *(*uintptr)(unsafe.Pointer(v264)) *(*uintptr)(unsafe.Pointer(v264))++ *(*uint8)(unsafe.Pointer(v263)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v266 = envPtr2 + 152 v265 = *(*uintptr)(unsafe.Pointer(v266)) *(*uintptr)(unsafe.Pointer(v266))++ *(*uint8)(unsafe.Pointer(v265)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v268 = envPtr2 + 152 v267 = *(*uintptr)(unsafe.Pointer(v268)) *(*uintptr)(unsafe.Pointer(v268))++ *(*uint8)(unsafe.Pointer(v267)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) v269 = -int32(1) v270 = envPtr2 if v269 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v270)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v270)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v270)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v270)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v270 + 64)) += int64(v269) fwd = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(offsetFwd)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(offsetFwd) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(fwd)) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v272 = envPtr2 + 152 v271 = *(*uintptr)(unsafe.Pointer(v272)) *(*uintptr)(unsafe.Pointer(v272))++ *(*uint8)(unsafe.Pointer(v271)) = libc.Uint8FromInt32(int32(INST_FOREACH_START)) v274 = envPtr2 + 152 v273 = *(*uintptr)(unsafe.Pointer(v274)) *(*uintptr)(unsafe.Pointer(v274))++ *(*uint8)(unsafe.Pointer(v273)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v276 = envPtr2 + 152 v275 = *(*uintptr)(unsafe.Pointer(v276)) *(*uintptr)(unsafe.Pointer(v276))++ *(*uint8)(unsafe.Pointer(v275)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v278 = envPtr2 + 152 v277 = *(*uintptr)(unsafe.Pointer(v278)) *(*uintptr)(unsafe.Pointer(v278))++ *(*uint8)(unsafe.Pointer(v277)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v280 = envPtr2 + 152 v279 = *(*uintptr)(unsafe.Pointer(v280)) *(*uintptr)(unsafe.Pointer(v280))++ *(*uint8)(unsafe.Pointer(v279)) = uint8(libc.Uint32FromInt32(infoIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_FOREACH_START)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - infoIndex } v281 = delta1 v282 = envPtr2 if v281 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v282)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v282)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v282)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v282)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v282 + 64)) += int64(v281) } offsetBack = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if keyVar <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v284 = envPtr2 + 152 v283 = *(*uintptr)(unsafe.Pointer(v284)) *(*uintptr)(unsafe.Pointer(v284))++ *(*uint8)(unsafe.Pointer(v283)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v286 = envPtr2 + 152 v285 = *(*uintptr)(unsafe.Pointer(v286)) *(*uintptr)(unsafe.Pointer(v286))++ *(*uint8)(unsafe.Pointer(v285)) = uint8(libc.Uint32FromInt32(keyVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keyVar } v287 = delta1 v288 = envPtr2 if v287 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v288)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v288)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v288)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v288)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v288 + 64)) += int64(v287) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v290 = envPtr2 + 152 v289 = *(*uintptr)(unsafe.Pointer(v290)) *(*uintptr)(unsafe.Pointer(v290))++ *(*uint8)(unsafe.Pointer(v289)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v292 = envPtr2 + 152 v291 = *(*uintptr)(unsafe.Pointer(v292)) *(*uintptr)(unsafe.Pointer(v292))++ *(*uint8)(unsafe.Pointer(v291)) = uint8(libc.Uint32FromInt32(keyVar) >> libc.Int32FromInt32(24)) v294 = envPtr2 + 152 v293 = *(*uintptr)(unsafe.Pointer(v294)) *(*uintptr)(unsafe.Pointer(v294))++ *(*uint8)(unsafe.Pointer(v293)) = uint8(libc.Uint32FromInt32(keyVar) >> libc.Int32FromInt32(16)) v296 = envPtr2 + 152 v295 = *(*uintptr)(unsafe.Pointer(v296)) *(*uintptr)(unsafe.Pointer(v296))++ *(*uint8)(unsafe.Pointer(v295)) = uint8(libc.Uint32FromInt32(keyVar) >> libc.Int32FromInt32(8)) v298 = envPtr2 + 152 v297 = *(*uintptr)(unsafe.Pointer(v298)) *(*uintptr)(unsafe.Pointer(v298))++ *(*uint8)(unsafe.Pointer(v297)) = uint8(libc.Uint32FromInt32(keyVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keyVar } v299 = delta1 v300 = envPtr2 if v299 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v300)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v300)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v300)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v300)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v300 + 64)) += int64(v299) } } if valVar <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v302 = envPtr2 + 152 v301 = *(*uintptr)(unsafe.Pointer(v302)) *(*uintptr)(unsafe.Pointer(v302))++ *(*uint8)(unsafe.Pointer(v301)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v304 = envPtr2 + 152 v303 = *(*uintptr)(unsafe.Pointer(v304)) *(*uintptr)(unsafe.Pointer(v304))++ *(*uint8)(unsafe.Pointer(v303)) = uint8(libc.Uint32FromInt32(valVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - valVar } v305 = delta1 v306 = envPtr2 if v305 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v306)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v306)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v306)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v306)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v306 + 64)) += int64(v305) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v308 = envPtr2 + 152 v307 = *(*uintptr)(unsafe.Pointer(v308)) *(*uintptr)(unsafe.Pointer(v308))++ *(*uint8)(unsafe.Pointer(v307)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v310 = envPtr2 + 152 v309 = *(*uintptr)(unsafe.Pointer(v310)) *(*uintptr)(unsafe.Pointer(v310))++ *(*uint8)(unsafe.Pointer(v309)) = uint8(libc.Uint32FromInt32(valVar) >> libc.Int32FromInt32(24)) v312 = envPtr2 + 152 v311 = *(*uintptr)(unsafe.Pointer(v312)) *(*uintptr)(unsafe.Pointer(v312))++ *(*uint8)(unsafe.Pointer(v311)) = uint8(libc.Uint32FromInt32(valVar) >> libc.Int32FromInt32(16)) v314 = envPtr2 + 152 v313 = *(*uintptr)(unsafe.Pointer(v314)) *(*uintptr)(unsafe.Pointer(v314))++ *(*uint8)(unsafe.Pointer(v313)) = uint8(libc.Uint32FromInt32(valVar) >> libc.Int32FromInt32(8)) v316 = envPtr2 + 152 v315 = *(*uintptr)(unsafe.Pointer(v316)) *(*uintptr)(unsafe.Pointer(v316))++ *(*uint8)(unsafe.Pointer(v315)) = uint8(libc.Uint32FromInt32(valVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - valVar } v317 = delta1 v318 = envPtr2 if v317 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v318)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v318)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v318)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v318)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v318 + 64)) += int64(v317) } } if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v320 = envPtr2 + 152 v319 = *(*uintptr)(unsafe.Pointer(v320)) *(*uintptr)(unsafe.Pointer(v320))++ *(*uint8)(unsafe.Pointer(v319)) = libc.Uint8FromInt32(int32(INST_STORE_ARRAY1)) v322 = envPtr2 + 152 v321 = *(*uintptr)(unsafe.Pointer(v322)) *(*uintptr)(unsafe.Pointer(v322))++ *(*uint8)(unsafe.Pointer(v321)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_ARRAY1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v323 = delta1 v324 = envPtr2 if v323 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v324)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v324)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v324)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v324)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v324 + 64)) += int64(v323) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v326 = envPtr2 + 152 v325 = *(*uintptr)(unsafe.Pointer(v326)) *(*uintptr)(unsafe.Pointer(v326))++ *(*uint8)(unsafe.Pointer(v325)) = libc.Uint8FromInt32(int32(INST_STORE_ARRAY4)) v328 = envPtr2 + 152 v327 = *(*uintptr)(unsafe.Pointer(v328)) *(*uintptr)(unsafe.Pointer(v328))++ *(*uint8)(unsafe.Pointer(v327)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v330 = envPtr2 + 152 v329 = *(*uintptr)(unsafe.Pointer(v330)) *(*uintptr)(unsafe.Pointer(v330))++ *(*uint8)(unsafe.Pointer(v329)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v332 = envPtr2 + 152 v331 = *(*uintptr)(unsafe.Pointer(v332)) *(*uintptr)(unsafe.Pointer(v332))++ *(*uint8)(unsafe.Pointer(v331)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v334 = envPtr2 + 152 v333 = *(*uintptr)(unsafe.Pointer(v334)) *(*uintptr)(unsafe.Pointer(v334))++ *(*uint8)(unsafe.Pointer(v333)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_ARRAY4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v335 = delta1 v336 = envPtr2 if v335 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v336)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v336)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v336)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v336)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v336 + 64)) += int64(v335) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v338 = envPtr2 + 152 v337 = *(*uintptr)(unsafe.Pointer(v338)) *(*uintptr)(unsafe.Pointer(v338))++ *(*uint8)(unsafe.Pointer(v337)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v339 = delta1 v340 = envPtr2 if v339 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v340 + 64)) += int64(v339) } (*TForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp = int64(offsetBack) - (int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) /*misuse */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v342 = envPtr2 + 152 v341 = *(*uintptr)(unsafe.Pointer(v342)) *(*uintptr)(unsafe.Pointer(v342))++ *(*uint8)(unsafe.Pointer(v341)) = libc.Uint8FromInt32(int32(INST_FOREACH_STEP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_FOREACH_STEP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v343 = delta1 v344 = envPtr2 if v343 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v344)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v344)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v344)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v344)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v344 + 64)) += int64(v343) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v346 = envPtr2 + 152 v345 = *(*uintptr)(unsafe.Pointer(v346)) *(*uintptr)(unsafe.Pointer(v346))++ *(*uint8)(unsafe.Pointer(v345)) = libc.Uint8FromInt32(int32(INST_FOREACH_END)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_FOREACH_END)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v347 = delta1 v348 = envPtr2 if v347 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v348)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v348)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v348)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v348)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v348 + 64)) += int64(v347) } v349 = -int32(3) v350 = envPtr2 if v349 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v350)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v350)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v350)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v350)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v350 + 64)) += int64(v349) _objIndexCopy6 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy6 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v352 = envPtr2 + 152 v351 = *(*uintptr)(unsafe.Pointer(v352)) *(*uintptr)(unsafe.Pointer(v352))++ *(*uint8)(unsafe.Pointer(v351)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v354 = envPtr2 + 152 v353 = *(*uintptr)(unsafe.Pointer(v354)) *(*uintptr)(unsafe.Pointer(v354))++ *(*uint8)(unsafe.Pointer(v353)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v355 = delta1 v356 = envPtr2 if v355 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v356)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v356)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v356)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v356)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v356 + 64)) += int64(v355) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v358 = envPtr2 + 152 v357 = *(*uintptr)(unsafe.Pointer(v358)) *(*uintptr)(unsafe.Pointer(v358))++ *(*uint8)(unsafe.Pointer(v357)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v360 = envPtr2 + 152 v359 = *(*uintptr)(unsafe.Pointer(v360)) *(*uintptr)(unsafe.Pointer(v360))++ *(*uint8)(unsafe.Pointer(v359)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(24)) v362 = envPtr2 + 152 v361 = *(*uintptr)(unsafe.Pointer(v362)) *(*uintptr)(unsafe.Pointer(v362))++ *(*uint8)(unsafe.Pointer(v361)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(16)) v364 = envPtr2 + 152 v363 = *(*uintptr)(unsafe.Pointer(v364)) *(*uintptr)(unsafe.Pointer(v364))++ *(*uint8)(unsafe.Pointer(v363)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(8)) v366 = envPtr2 + 152 v365 = *(*uintptr)(unsafe.Pointer(v366)) *(*uintptr)(unsafe.Pointer(v366))++ *(*uint8)(unsafe.Pointer(v365)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v367 = delta1 v368 = envPtr2 if v367 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v368)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v368)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v368)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v368)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v368 + 64)) += int64(v367) } } goto done done: ; _objPtr = literalObj v370 = _objPtr v369 = *(*TTcl_Size)(unsafe.Pointer(v370)) *(*TTcl_Size)(unsafe.Pointer(v370))-- if v369 <= int64(1) { XTclFreeObj(tls, _objPtr) } return code } func XTclCompileArrayUnsetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, delta1, v11, v17, v23, v35, v39, v45, v51, v57, v59, v63, v69, v81 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v4, v40, v41, v42, v43, v44, v46, v47, v48, v49, v5, v50, v52, v53, v54, v55, v56, v58, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v82, v9 uintptr var _ /* isScalar at bp+0 */ int32 var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, tokenPtr, envPtr2, int32(TCL_NO_ELEMENT), bp+4, bp) if !(*(*int32)(unsafe.Pointer(bp)) != 0) { return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 4)) >= 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_ARRAY_EXISTS_IMM)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_EXISTS_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v11 = delta1 v12 = envPtr2 if v11 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v12 + 64)) += int64(v11) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(8))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(8) } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_ARRAY_EXISTS_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ARRAY_EXISTS_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(6))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(6) } v45 = delta1 v46 = envPtr2 if v45 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v46 + 64)) += int64(v45) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt32(int32(INST_UNSET_STK)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } /* Each branch decrements stack depth, but we only take one. */ v59 = int32(1) v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v63 = delta1 v64 = envPtr2 if v63 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v64 + 64)) += int64(v63) } } _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v81 = delta1 v82 = envPtr2 if v81 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v82 + 64)) += int64(v81) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileBreakCmd -- * * Procedure called to compile the "break" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "break" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileBreakCmd(tls *libc.TLS, dummy513 uintptr, parsePtr uintptr, dummy516 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var delta1, v3, v5 int32 var rangePtr, v1, v2, v4, v6 uintptr var _ /* auxPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _ = delta1, rangePtr, v1, v2, v3, v4, v5, v6 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(1) { return int32(TCL_ERROR) } /* * Find the innermost exception range that contains this command. */ rangePtr = XTclGetInnermostExceptionRange(tls, envPtr2, int32(TCL_BREAK), bp) if rangePtr != 0 && (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 == int32(LOOP_EXCEPTION_RANGE) { /* * Found the target! No need for a nasty INST_BREAK here. */ XTclCleanupStackForBreakContinue(tls, envPtr2, *(*uintptr)(unsafe.Pointer(bp))) XTclAddLoopBreakFixup(tls, envPtr2, *(*uintptr)(unsafe.Pointer(bp))) } else { /* * Emit a real break. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_BREAK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BREAK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } } v5 = int32(1) v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileCatchCmd -- * * Procedure called to compile the "catch" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "catch" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileCatchCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy573 uintptr, envPtr3 uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Holds resulting instructions. */ var _objIndexCopy, delta1, depth1, dropScript, optsIndex, range1, resultIndex, v1, v104, v108, v12, v120, v126, v138, v142, v25, v30, v42, v46, v54, v66, v70, v74, v78, v82, v86, v92 int32 var cmdTokenPtr, mapPtr, optsNameTokenPtr, resultNameTokenPtr, v10, v100, v101, v102, v103, v105, v106, v107, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v121, v122, v123, v124, v125, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v139, v140, v141, v143, v145, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v26, v28, v29, v3, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v43, v44, v45, v47, v49, v5, v50, v51, v52, v53, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v67, v68, v69, v7, v71, v72, v73, v75, v76, v77, v79, v8, v80, v81, v83, v84, v85, v87, v88, v89, v9, v90, v91, v93, v94, v95, v96, v97, v98, v99 uintptr var eclIndex TTcl_Size var v14, v27 int64 var v144, v48 Tsize_t var _ /* jumpFixup at bp+0 */ TJumpFixup _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, cmdTokenPtr, delta1, depth1, dropScript, eclIndex, mapPtr, optsIndex, optsNameTokenPtr, range1, resultIndex, resultNameTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) dropScript = 0 depth1 = int32((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) /* * If syntax does not match what we expect for [catch], do not compile. * Let runtime checks determine if syntax has changed. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(2) || int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(4) { return int32(TCL_ERROR) } /* * If variables were specified and the catch command is at global level * (not in a procedure), don't compile it inline: the payoff is too small. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) >= int32(3) && !((*TCompileEnv)(unsafe.Pointer(envPtr3)).FprocPtr != 0 || (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FiPtr)).FvarFramePtr)).FlocalCachePtr != 0) { return int32(TCL_ERROR) } /* * Make sure the variable names, if any, have no substitutions and just * refer to local scalars. */ v1 = -libc.Int32FromInt32(1) optsIndex = v1 resultIndex = v1 cmdTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) >= int32(3) { resultNameTokenPtr = cmdTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(cmdTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* DGP */ resultIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, resultNameTokenPtr, envPtr3)) if resultIndex < 0 { return int32(TCL_ERROR) } /* DKF */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(4) { optsNameTokenPtr = resultNameTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(resultNameTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 optsIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, optsNameTokenPtr, envPtr3)) if optsIndex < 0 { return int32(TCL_ERROR) } } } /* * We will compile the catch command. Declare the exception range that it * uses. * * If the body is a simple word, compile a BEGIN_CATCH instruction, * followed by the instructions to eval the body. * Otherwise, compile instructions to substitute the body text before * starting the catch, then BEGIN_CATCH, and then EVAL_STK to evaluate the * substituted body. * Care has to be taken to make sure that substitution happens outside the * catch range so that errors in the substitution are not caught. * [Bug 219184] * The reason for duplicating the script is that EVAL_STK would otherwise * begin by underflowing the stack below the mark set by BEGIN_CATCH4. */ range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr3)) if (*TTcl_Token)(unsafe.Pointer(cmdTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v3 = envPtr3 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v5 = envPtr3 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v7 = envPtr3 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v9 = envPtr3 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v11 = envPtr3 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v12 = delta1 v13 = envPtr3 if v12 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v13 + 64)) += int64(v12) } (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FmaxExceptDepth)+uint64(1) { v14 = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth } else { v14 = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr3)).FmaxExceptDepth = v14 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr3)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileCmdWord(tls, interp, cmdTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(cmdTokenPtr)).FnumComponents), envPtr3) } else { (*TCompileEnv)(unsafe.Pointer(envPtr3)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, cmdTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(cmdTokenPtr)).FnumComponents), envPtr3) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v16 = envPtr3 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v18 = envPtr3 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v20 = envPtr3 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v22 = envPtr3 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v24 = envPtr3 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v25 = delta1 v26 = envPtr3 if v25 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v26 + 64)) += int64(v25) } (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FmaxExceptDepth)+uint64(1) { v27 = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth } else { v27 = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr3)).FmaxExceptDepth = v27 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v29 = envPtr3 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v30 = delta1 v31 = envPtr3 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } XTclEmitInvoke(tls, envPtr3, int32(INST_EVAL_STK), 0) /* drop the script */ dropScript = int32(1) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v33 = envPtr3 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v35 = envPtr3 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v37 = envPtr3 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v39 = envPtr3 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v41 = envPtr3 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v42 = delta1 v43 = envPtr3 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v45 = envPtr3 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v46 = delta1 v47 = envPtr3 if v46 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v47)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v47)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v47)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v47)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v47 + 64)) += int64(v46) } } (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) /* * Emit the "no errors" epilogue: push "0" (TCL_OK) as the catch result, * and jump around the "error case" code. */ v48 = libc.Uint64FromInt32(depth1 + int32(1)) v49 = envPtr3 if v48 != libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth) { XTcl_Panic(tls, __ccgo_ts+21474, libc.VaList(bp+24, libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth), v48)) } _objIndexCopy = XTclRegisterLiteral(tls, envPtr3, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v51 = envPtr3 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v53 = envPtr3 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v54 = delta1 v55 = envPtr3 if v54 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v55 + 64)) += int64(v54) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v57 = envPtr3 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v59 = envPtr3 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v61 = envPtr3 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v63 = envPtr3 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v65 = envPtr3 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v66 = delta1 v67 = envPtr3 if v66 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v67 + 64)) += int64(v66) } } XTclEmitForwardJump(tls, envPtr3, int32(TCL_UNCONDITIONAL_JUMP), bp) /* * Emit the "error case" epilogue. Push the interpreter result and the * return code. */ (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth = int64(depth1 + dropScript) if dropScript != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v69 = envPtr3 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v70 = delta1 v71 = envPtr3 if v70 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v71 + 64)) += int64(v70) } } /* Stack at this point is empty */ if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v73 = envPtr3 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v74 = delta1 v75 = envPtr3 if v74 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v75)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v75)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v75)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v75)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v75 + 64)) += int64(v74) } if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v77 = envPtr3 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v78 = delta1 v79 = envPtr3 if v78 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v79)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v79)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v79)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v79)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v79 + 64)) += int64(v78) } /* Stack at this point on both branches: result returnCode */ if XTclFixupForwardJump(tls, envPtr3, bp, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+21526, libc.VaList(bp+24, int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp))).FcodeOffset))) } /* * Push the return options if the caller wants them. This needs to happen * before INST_END_CATCH */ if optsIndex != -int32(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v81 = envPtr3 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v82 = delta1 v83 = envPtr3 if v82 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v83 + 64)) += int64(v82) } } /* * End the catch */ if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v85 = envPtr3 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v86 = delta1 v87 = envPtr3 if v86 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v87)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v87)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v87)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v87)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v87 + 64)) += int64(v86) } /* * Save the result and return options if the caller wants them. This needs * to happen after INST_END_CATCH (compile-3.6/7). */ if optsIndex != -int32(1) { if optsIndex <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v89 = envPtr3 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v91 = envPtr3 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(optsIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optsIndex } v92 = delta1 v93 = envPtr3 if v92 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v93 + 64)) += int64(v92) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v95 = envPtr3 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v97 = envPtr3 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = uint8(libc.Uint32FromInt32(optsIndex) >> libc.Int32FromInt32(24)) v99 = envPtr3 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = uint8(libc.Uint32FromInt32(optsIndex) >> libc.Int32FromInt32(16)) v101 = envPtr3 + 152 v100 = *(*uintptr)(unsafe.Pointer(v101)) *(*uintptr)(unsafe.Pointer(v101))++ *(*uint8)(unsafe.Pointer(v100)) = uint8(libc.Uint32FromInt32(optsIndex) >> libc.Int32FromInt32(8)) v103 = envPtr3 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = uint8(libc.Uint32FromInt32(optsIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optsIndex } v104 = delta1 v105 = envPtr3 if v104 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v105)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v105)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v105)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v105)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v105 + 64)) += int64(v104) } } if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v107 = envPtr3 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v108 = delta1 v109 = envPtr3 if v108 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v109)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v109)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v109)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v109)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v109 + 64)) += int64(v108) } } /* * At this point, the top of the stack is inconveniently ordered: * result returnCode * Reverse the stack to store the result. */ if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v111 = envPtr3 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v113 = envPtr3 + 152 v112 = *(*uintptr)(unsafe.Pointer(v113)) *(*uintptr)(unsafe.Pointer(v113))++ *(*uint8)(unsafe.Pointer(v112)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v115 = envPtr3 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v117 = envPtr3 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v119 = envPtr3 + 152 v118 = *(*uintptr)(unsafe.Pointer(v119)) *(*uintptr)(unsafe.Pointer(v119))++ *(*uint8)(unsafe.Pointer(v118)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v120 = delta1 v121 = envPtr3 if v120 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v121)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v121)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v121)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v121)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v121 + 64)) += int64(v120) } if resultIndex != -int32(1) { if resultIndex <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v123 = envPtr3 + 152 v122 = *(*uintptr)(unsafe.Pointer(v123)) *(*uintptr)(unsafe.Pointer(v123))++ *(*uint8)(unsafe.Pointer(v122)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v125 = envPtr3 + 152 v124 = *(*uintptr)(unsafe.Pointer(v125)) *(*uintptr)(unsafe.Pointer(v125))++ *(*uint8)(unsafe.Pointer(v124)) = uint8(libc.Uint32FromInt32(resultIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultIndex } v126 = delta1 v127 = envPtr3 if v126 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v127)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v127)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v127)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v127)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v127 + 64)) += int64(v126) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v129 = envPtr3 + 152 v128 = *(*uintptr)(unsafe.Pointer(v129)) *(*uintptr)(unsafe.Pointer(v129))++ *(*uint8)(unsafe.Pointer(v128)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v131 = envPtr3 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = uint8(libc.Uint32FromInt32(resultIndex) >> libc.Int32FromInt32(24)) v133 = envPtr3 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = uint8(libc.Uint32FromInt32(resultIndex) >> libc.Int32FromInt32(16)) v135 = envPtr3 + 152 v134 = *(*uintptr)(unsafe.Pointer(v135)) *(*uintptr)(unsafe.Pointer(v135))++ *(*uint8)(unsafe.Pointer(v134)) = uint8(libc.Uint32FromInt32(resultIndex) >> libc.Int32FromInt32(8)) v137 = envPtr3 + 152 v136 = *(*uintptr)(unsafe.Pointer(v137)) *(*uintptr)(unsafe.Pointer(v137))++ *(*uint8)(unsafe.Pointer(v136)) = uint8(libc.Uint32FromInt32(resultIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultIndex } v138 = delta1 v139 = envPtr3 if v138 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v139)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v139)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v139)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v139)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v139 + 64)) += int64(v138) } } } if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v141 = envPtr3 + 152 v140 = *(*uintptr)(unsafe.Pointer(v141)) *(*uintptr)(unsafe.Pointer(v141))++ *(*uint8)(unsafe.Pointer(v140)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v142 = delta1 v143 = envPtr3 if v142 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v143)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v143)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v143)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v143)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v143 + 64)) += int64(v142) } v144 = libc.Uint64FromInt32(depth1 + int32(1)) v145 = envPtr3 if v144 != libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v145)).FcurrStackDepth) { XTcl_Panic(tls, __ccgo_ts+21474, libc.VaList(bp+24, libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v145)).FcurrStackDepth), v144)) } return TCL_OK } /*---------------------------------------------------------------------- * * TclCompileClockClicksCmd -- * * Procedure called to compile the "tcl::clock::clicks" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to run time. * * Side effects: * Instructions are added to envPtr to execute the "clock clicks" * command at runtime. * *---------------------------------------------------------------------- */ func XTclCompileClockClicksCmd(tls *libc.TLS, dummy752 uintptr, parsePtr uintptr, dummy755 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var delta1, v12, v18, v24 int32 var tokenPtr, v10, v11, v13, v14, v15, v16, v17, v19, v20, v21, v22, v23, v25, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = delta1, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v8, v9 switch (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords { case int64(1): goto _1 case int64(2): goto _2 default: goto _3 } goto _4 _1: ; /* * No args */ _7: ; if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_CLOCK_READ)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_CLOCK_READ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v12 = delta1 v13 = envPtr2 if v12 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v13 + 64)) += int64(v12) } goto _6 _6: ; if 0 != 0 { goto _7 } goto _5 _5: ; goto _4 _2: ; /* * -milliseconds or -microseconds */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize < int64(4) || (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize > int64(13) { return int32(TCL_ERROR) } else { if !(libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, __ccgo_ts+13217, libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize)) != 0) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(int32(INST_CLOCK_READ)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_CLOCK_READ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } goto _4 } else { if !(libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, __ccgo_ts+13203, libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize)) != 0) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_CLOCK_READ)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_CLOCK_READ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } goto _4 } else { return int32(TCL_ERROR) } } } _3: ; return int32(TCL_ERROR) _4: ; return TCL_OK } /*---------------------------------------------------------------------- * * TclCompileClockReadingCmd -- * * Procedure called to compile the "tcl::clock::microseconds", * "tcl::clock::milliseconds" and "tcl::clock::seconds" commands. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to run time. * * Side effects: * Instructions are added to envPtr to execute the "clock clicks" * command at runtime. * * Client data is 1 for microseconds, 2 for milliseconds, 3 for seconds. *---------------------------------------------------------------------- */ func XTclCompileClockReadingCmd(tls *libc.TLS, dummy814 uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var delta1, v5 int32 var v1, v2, v3, v4, v6 uintptr _, _, _, _, _, _, _ = delta1, v1, v2, v3, v4, v5, v6 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(1) { return int32(TCL_ERROR) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_CLOCK_READ)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt64(int64((*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_CLOCK_READ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(int64((*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData)) } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileConcatCmd -- * * Procedure called to compile the "concat" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "concat" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileConcatCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy853 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, i1, v17, v36, v48, v5, v57, v69, v81 int32 var _objPtr, _objPtr1, _objPtr2, _objPtr3, bytes, cachePtr, cachePtr1, listObj, mapPtr, objPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v2, v23, v25, v3, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v49, v51, v53, v54, v55, v56, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v82, v9 uintptr var eclIndex, v22, v24, v29, v50 TTcl_Size var v19, v21 bool var v27, v28 int64 var _ /* len at bp+8 */ TTcl_Size var _ /* objs at bp+0 */ uintptr var _ /* slen at bp+16 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objPtr, _objPtr1, _objPtr2, _objPtr3, bytes, cachePtr, cachePtr1, delta1, eclIndex, i1, listObj, mapPtr, objPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v21, v22, v23, v24, v25, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TODO: Consider compiling expansion case. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(1) { /* * [concat] without arguments just pushes an empty object. */ _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } return TCL_OK } /* * Test if all arguments are compile-time known. If they are, we can * implement with a simple push. */ if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { listObj = XTclThreadAllocObj(tls) } else { listObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(listObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(listObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(listObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(listObj)).FtypePtr = libc.UintptrFromInt32(0) i1 = int32(1) tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v21 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v21 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v21 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) if !(XTclWordKnownAtCompileTime(tls, tokenPtr, objPtr) != 0) { _objPtr = objPtr v23 = _objPtr v22 = *(*TTcl_Size)(unsafe.Pointer(v23)) *(*TTcl_Size)(unsafe.Pointer(v23))-- if v22 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = listObj v25 = _objPtr1 v24 = *(*TTcl_Size)(unsafe.Pointer(v25)) *(*TTcl_Size)(unsafe.Pointer(v25))-- if v24 <= int64(1) { XTclFreeObj(tls, _objPtr1) } listObj = libc.UintptrFromInt32(0) break } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listObj, objPtr) goto _20 _20: ; i1++ } if listObj != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(listObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2 != 0 { v27 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2)).FspanStart } else { v27 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1 + 40 + uintptr(v27)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2 != 0 { v28 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr2)).FspanLength } else { v28 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v28 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), listObj, bp+8, bp) } objPtr = XTcl_ConcatObj(tls, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp))) _objPtr2 = listObj v30 = _objPtr2 v29 = *(*TTcl_Size)(unsafe.Pointer(v30)) *(*TTcl_Size)(unsafe.Pointer(v30))-- if v29 <= int64(1) { XTclFreeObj(tls, _objPtr2) } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v31 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v31 = XTcl_GetStringFromObj(tls, objPtr, bp+16) } bytes = v31 _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 16)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v48 = delta1 v49 = envPtr2 if v48 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v49 + 64)) += int64(v48) } } _objPtr3 = objPtr v51 = _objPtr3 v50 = *(*TTcl_Size)(unsafe.Pointer(v51)) *(*TTcl_Size)(unsafe.Pointer(v51))-- if v50 <= int64(1) { XTclFreeObj(tls, _objPtr3) } return TCL_OK } /* * General case: runtime concat. */ i1 = int32(1) tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } goto _52 _52: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_CONCAT_STK)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(i1-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(i1-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(i1-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(i1 - libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_CONCAT_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (i1 - int32(1)) } v81 = delta1 v82 = envPtr2 if v81 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v82 + 64)) += int64(v81) } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileConstCmd -- * * Procedure called to compile the "const" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "const" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileConstCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy939 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, v17, v21, v33, v39, v5, v51 int32 var eclIndex TTcl_Size var mapPtr, valueTokenPtr, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v34, v35, v36, v37, v38, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v52, v6, v7, v8, v9 uintptr var _ /* isScalar at bp+0 */ int32 var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, valueTokenPtr, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * Need exactly two arguments. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } /* * Decide if we can use a frame slot for the var/array name or if we need * to emit code to compute and push the name at runtime. We use a frame * slot (entry in the array of local vars) if we are compiling a procedure * body and if the name is simple text that does not include namespace * qualifiers. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, varTokenPtr, envPtr2, 0, bp+4, bp) /* * If the user specified an array element, we don't bother handling * that. */ if !(*(*int32)(unsafe.Pointer(bp)) != 0) { return int32(TCL_ERROR) } /* * We are doing an assignment to set the value of the constant. This will * need to be extended to push a value for each argument. */ valueTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_CONST_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_CONST_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(INST_CONST_IMM)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_CONST_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v33 = delta1 v34 = envPtr2 if v33 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v34 + 64)) += int64(v33) } } /* * The const command's result is an empty string. */ _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileContinueCmd -- * * Procedure called to compile the "continue" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "continue" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileContinueCmd(tls *libc.TLS, dummy1014 uintptr, parsePtr uintptr, dummy1017 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var delta1, v3, v5 int32 var rangePtr, v1, v2, v4, v6 uintptr var _ /* auxPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _ = delta1, rangePtr, v1, v2, v3, v4, v5, v6 /* * There should be no argument after the "continue". */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(1) { return int32(TCL_ERROR) } /* * See if we can find a valid continueOffset (i.e., not -1) in the * innermost containing exception range. */ rangePtr = XTclGetInnermostExceptionRange(tls, envPtr2, int32(TCL_CONTINUE), bp) if rangePtr != 0 && (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 == int32(LOOP_EXCEPTION_RANGE) { /* * Found the target! No need for a nasty INST_CONTINUE here. */ XTclCleanupStackForBreakContinue(tls, envPtr2, *(*uintptr)(unsafe.Pointer(bp))) XTclAddLoopContinueFixup(tls, envPtr2, *(*uintptr)(unsafe.Pointer(bp))) } else { /* * Emit a real continue. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_CONTINUE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_CONTINUE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } } v5 = int32(1) v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileDict*Cmd -- * * Functions called to compile "dict" subcommands. * * Results: * All return TCL_OK for a successful compile, and TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "dict" subcommand at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileDictSetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1079 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, dictVarIndex, i1, v18, v30, v40, v6 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, varTokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, dictVarIndex, eclIndex, i1, mapPtr, tokenPtr, varTokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * There must be at least one argument after the command. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(4) { return int32(TCL_ERROR) } /* * The dictionary variable must be a local scalar that is knowable at * compile time; anything else exceeds the complexity of the opcode. So * discover what the index is. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 dictVarIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, varTokenPtr, envPtr2)) if dictVarIndex < 0 { return int32(TCL_ERROR) } /* * Remaining words (key path and value to set) can be handled normally. */ tokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(2) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } /* * Now emit the instruction to do the dict manipulation. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_DICT_SET)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_SET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - int32(3)) } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(24)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(16)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(8)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(dictVarIndex)) v40 = -int32(1) v41 = envPtr2 if v40 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v41 + 64)) += int64(v40) return TCL_OK } func XTclCompileDictIncrCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, code, delta1, dictVarIndex, v1, v21, v33, v9 int32 var cachePtr, incrTokenPtr, intObj, keyTokenPtr, mapPtr, varTokenPtr, word, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v34, v35, v36, v37, v38, v39, v40, v41, v42, v5, v6, v7, v8 uintptr var eclIndex, numBytes, v2 TTcl_Size var v4 bool var _ /* incrAmount at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, cachePtr, code, delta1, dictVarIndex, eclIndex, incrTokenPtr, intObj, keyTokenPtr, mapPtr, numBytes, varTokenPtr, word, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * There must be at least two arguments after the command. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) || int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(4) { return int32(TCL_ERROR) } varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 keyTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * Parse the increment amount, if present. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(4) { incrTokenPtr = keyTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(keyTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(incrTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return XTclCompileBasic2Or3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } word = (*(*TTcl_Token)(unsafe.Pointer(incrTokenPtr + 1*32))).Fstart numBytes = (*(*TTcl_Token)(unsafe.Pointer(incrTokenPtr + 1*32))).Fsize intObj = XTcl_NewStringObj(tls, word, numBytes) (*TTcl_Obj)(unsafe.Pointer(intObj)).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(intObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(intObj)).FinternalRep)) >= int64(-libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff)) && *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(intObj)).FinternalRep)) <= int64(libc.Int32FromInt32(INT_MAX)) { *(*int32)(unsafe.Pointer(bp)) = int32(*(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(intObj)).FinternalRep))) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetIntFromObj(tls, libc.UintptrFromInt32(0), intObj, bp) } code = v1 v3 = intObj v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if !(v2 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(intObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(intObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(intObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(intObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(intObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(intObj)).Flength = int64(-libc.Int32FromInt32(1)) if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, intObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(intObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = intObj (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, intObj) } } if code != TCL_OK { return XTclCompileBasic2Or3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } } else { *(*int32)(unsafe.Pointer(bp)) = int32(1) } /* * The dictionary variable must be a local scalar that is knowable at * compile time; anything else exceeds the complexity of the opcode. So * discover what the index is. */ dictVarIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, varTokenPtr, envPtr2)) if dictVarIndex < 0 { return XTclCompileBasic2Or3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } /* * Emit the key and the code to actually do the increment. */ if (*TTcl_Token)(unsafe.Pointer(keyTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(keyTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(keyTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v9 = delta1 v10 = envPtr2 if v9 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v10 + 64)) += int64(v9) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, keyTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(keyTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(INST_DICT_INCR_IMM)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(24)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(16)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(8)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_INCR_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v33 = delta1 v34 = envPtr2 if v33 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v34 + 64)) += int64(v33) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(24)) v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(16)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(8)) v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = uint8(libc.Uint32FromInt32(dictVarIndex)) return TCL_OK } func XTclCompileDictGetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1205 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, i1, v18, v30, v32, v6 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v31, v33, v4, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, i1, mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * There must be at least two arguments after the command (the single-arg * case is legal, but too special and magic for us to deal with here). */ /* TODO: Consider support for compiling expanded args. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * Only compile this because we need INST_DICT_GET anyway. */ i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_DICT_GET)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_GET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - int32(2)) } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } v32 = -int32(1) v33 = envPtr2 if v32 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v33 + 64)) += int64(v32) return TCL_OK } func XTclCompileDictGetWithDefaultCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1241 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, i1, v18, v30, v32, v6 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v31, v33, v4, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, i1, mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * There must be at least three arguments after the command. */ /* TODO: Consider support for compiling expanded args. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(4) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_DICT_GET_DEF)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_GET_DEF)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - int32(3)) } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } v32 = -int32(2) v33 = envPtr2 if v32 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v33 + 64)) += int64(v32) return TCL_OK } func XTclCompileDictExistsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1272 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, i1, v18, v30, v32, v6 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v31, v33, v4, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, i1, mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * There must be at least two arguments after the command (the single-arg * case is legal, but too special and magic for us to deal with here). */ /* TODO: Consider support for compiling expanded args. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * Now we do the code generation. */ i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_DICT_EXISTS)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_EXISTS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - int32(2)) } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } v32 = -int32(1) v33 = envPtr2 if v32 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v33 + 64)) += int64(v32) return TCL_OK } func XTclCompileDictUnsetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, dictVarIndex, i1, v18, v30, v6 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, dictVarIndex, eclIndex, i1, mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * There must be at least one argument after the variable name for us to * compile to bytecode. */ /* TODO: Consider support for compiling expanded args. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) { return int32(TCL_ERROR) } /* * The dictionary variable must be a local scalar that is knowable at * compile time; anything else exceeds the complexity of the opcode. So * discover what the index is. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 dictVarIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, tokenPtr, envPtr2)) if dictVarIndex < 0 { return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } /* * Remaining words (the key path) can be handled normally. */ i1 = int32(2) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } goto _1 _1: ; i1++ } /* * Now emit the instruction to do the dict manipulation. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_DICT_UNSET)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_UNSET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - int32(2)) } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(24)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(16)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(8)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(dictVarIndex)) return TCL_OK } func XTclCompileDictCreateCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, delta1, i1, worker, v105, v111, v123, v135, v145, v149, v155, v167, v173, v24, v36, v40, v44, v52, v64, v70, v82, v86, v93 int32 var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, bytes, cachePtr, cachePtr1, cachePtr2, dictObj, keyObj, mapPtr, tokenPtr, valueObj, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v110, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v124, v125, v126, v127, v128, v129, v130, v131, v132, v133, v134, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v146, v147, v148, v150, v151, v152, v153, v154, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v168, v169, v170, v171, v172, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v19, v20, v21, v22, v23, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v37, v38, v39, v41, v42, v43, v45, v47, v48, v49, v5, v50, v51, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v65, v66, v67, v68, v69, v7, v71, v72, v73, v74, v75, v76, v77, v78, v79, v80, v81, v83, v84, v85, v87, v89, v90, v91, v92, v94, v95, v96, v97, v98, v99 uintptr var eclIndex, v11, v13, v15, v17, v4, v46, v6, v9 TTcl_Size var v1, v3, v8 bool var _ /* len at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, bytes, cachePtr, cachePtr1, cachePtr2, delta1, dictObj, eclIndex, i1, keyObj, mapPtr, tokenPtr, valueObj, worker, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords&int64(1) == 0 { return int32(TCL_ERROR) } /* * See if we can build the value at compile time... */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { dictObj = XTclThreadAllocObj(tls) } else { dictObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(dictObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(dictObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(dictObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(dictObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(dictObj)).FrefCount++ i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { keyObj = XTclThreadAllocObj(tls) } else { keyObj = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(keyObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(keyObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(keyObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(keyObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(keyObj)).FrefCount++ if !(XTclWordKnownAtCompileTime(tls, tokenPtr, keyObj) != 0) { _objPtr = keyObj v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = dictObj v7 = _objPtr1 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr1) } goto nonConstant } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { valueObj = XTclThreadAllocObj(tls) } else { valueObj = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valueObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(valueObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(valueObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(valueObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(valueObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(valueObj)).FrefCount++ if !(XTclWordKnownAtCompileTime(tls, tokenPtr, valueObj) != 0) { _objPtr2 = keyObj v10 = _objPtr2 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr2) } _objPtr3 = valueObj v12 = _objPtr3 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr3) } _objPtr4 = dictObj v14 = _objPtr4 v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if v13 <= int64(1) { XTclFreeObj(tls, _objPtr4) } goto nonConstant } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictObj, keyObj, valueObj) _objPtr5 = keyObj v16 = _objPtr5 v15 = *(*TTcl_Size)(unsafe.Pointer(v16)) *(*TTcl_Size)(unsafe.Pointer(v16))-- if v15 <= int64(1) { XTclFreeObj(tls, _objPtr5) } _objPtr6 = valueObj v18 = _objPtr6 v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if v17 <= int64(1) { XTclFreeObj(tls, _objPtr6) } goto _2 _2: ; i1 += int32(2) } /* * We did! Excellent. The "verifyDict" is to do type forcing. */ if (*TTcl_Obj)(unsafe.Pointer(dictObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(dictObj)).Flength v19 = (*TTcl_Obj)(unsafe.Pointer(dictObj)).Fbytes } else { v19 = XTcl_GetStringFromObj(tls, dictObj, bp) } bytes = v19 _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v40 = delta1 v41 = envPtr2 if v40 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v41 + 64)) += int64(v40) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = libc.Uint8FromInt32(int32(INST_DICT_VERIFY)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_VERIFY)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v44 = delta1 v45 = envPtr2 if v44 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v45 + 64)) += int64(v44) } _objPtr7 = dictObj v47 = _objPtr7 v46 = *(*TTcl_Size)(unsafe.Pointer(v47)) *(*TTcl_Size)(unsafe.Pointer(v47))-- if v46 <= int64(1) { XTclFreeObj(tls, _objPtr7) } return TCL_OK /* * Otherwise, we've got to issue runtime code to do the building, which we * do by [dict set]ting into an unnamed local variable. This requires that * we are in a context with an LVT. */ goto nonConstant nonConstant: ; worker = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) if worker < 0 { return XTclCompileBasicMin0ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v52 = delta1 v53 = envPtr2 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v64 = delta1 v65 = envPtr2 if v64 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v65 + 64)) += int64(v64) } } if worker <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = uint8(libc.Uint32FromInt32(worker)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - worker } v70 = delta1 v71 = envPtr2 if v70 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v71 + 64)) += int64(v70) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(24)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(16)) v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(8)) v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = uint8(libc.Uint32FromInt32(worker)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - worker } v82 = delta1 v83 = envPtr2 if v82 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v83 + 64)) += int64(v82) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v85 = envPtr2 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v86 = delta1 v87 = envPtr2 if v86 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v87)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v87)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v87)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v87)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v87 + 64)) += int64(v86) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v93 = delta1 v94 = envPtr2 if v93 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v94)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v94)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v94)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v94)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v94 + 64)) += int64(v93) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v100 = envPtr2 + 152 v99 = *(*uintptr)(unsafe.Pointer(v100)) *(*uintptr)(unsafe.Pointer(v100))++ *(*uint8)(unsafe.Pointer(v99)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v104 = envPtr2 + 152 v103 = *(*uintptr)(unsafe.Pointer(v104)) *(*uintptr)(unsafe.Pointer(v104))++ *(*uint8)(unsafe.Pointer(v103)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v105 = delta1 v106 = envPtr2 if v105 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v106)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v106)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v106)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v106)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v106 + 64)) += int64(v105) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v111 = delta1 v112 = envPtr2 if v111 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v112 + 64)) += int64(v111) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v123 = delta1 v124 = envPtr2 if v123 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v124)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v124)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v124)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v124)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v124 + 64)) += int64(v123) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1+libc.Int32FromInt32(1))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1+libc.Int32FromInt32(1))*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v126 = envPtr2 + 152 v125 = *(*uintptr)(unsafe.Pointer(v126)) *(*uintptr)(unsafe.Pointer(v126))++ *(*uint8)(unsafe.Pointer(v125)) = libc.Uint8FromInt32(int32(INST_DICT_SET)) v128 = envPtr2 + 152 v127 = *(*uintptr)(unsafe.Pointer(v128)) *(*uintptr)(unsafe.Pointer(v128))++ *(*uint8)(unsafe.Pointer(v127)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v130 = envPtr2 + 152 v129 = *(*uintptr)(unsafe.Pointer(v130)) *(*uintptr)(unsafe.Pointer(v130))++ *(*uint8)(unsafe.Pointer(v129)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v132 = envPtr2 + 152 v131 = *(*uintptr)(unsafe.Pointer(v132)) *(*uintptr)(unsafe.Pointer(v132))++ *(*uint8)(unsafe.Pointer(v131)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v134 = envPtr2 + 152 v133 = *(*uintptr)(unsafe.Pointer(v134)) *(*uintptr)(unsafe.Pointer(v134))++ *(*uint8)(unsafe.Pointer(v133)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_SET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v135 = delta1 v136 = envPtr2 if v135 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v136)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v136)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v136)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v136)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v136 + 64)) += int64(v135) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v138 = envPtr2 + 152 v137 = *(*uintptr)(unsafe.Pointer(v138)) *(*uintptr)(unsafe.Pointer(v138))++ *(*uint8)(unsafe.Pointer(v137)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(24)) v140 = envPtr2 + 152 v139 = *(*uintptr)(unsafe.Pointer(v140)) *(*uintptr)(unsafe.Pointer(v140))++ *(*uint8)(unsafe.Pointer(v139)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(16)) v142 = envPtr2 + 152 v141 = *(*uintptr)(unsafe.Pointer(v142)) *(*uintptr)(unsafe.Pointer(v142))++ *(*uint8)(unsafe.Pointer(v141)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(8)) v144 = envPtr2 + 152 v143 = *(*uintptr)(unsafe.Pointer(v144)) *(*uintptr)(unsafe.Pointer(v144))++ *(*uint8)(unsafe.Pointer(v143)) = uint8(libc.Uint32FromInt32(worker)) v145 = -int32(1) v146 = envPtr2 if v145 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v146 + 64)) += int64(v145) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v148 = envPtr2 + 152 v147 = *(*uintptr)(unsafe.Pointer(v148)) *(*uintptr)(unsafe.Pointer(v148))++ *(*uint8)(unsafe.Pointer(v147)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v149 = delta1 v150 = envPtr2 if v149 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v150)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v150)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v150)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v150)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v150 + 64)) += int64(v149) } goto _88 _88: ; i1 += int32(2) } if worker <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v152 = envPtr2 + 152 v151 = *(*uintptr)(unsafe.Pointer(v152)) *(*uintptr)(unsafe.Pointer(v152))++ *(*uint8)(unsafe.Pointer(v151)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v154 = envPtr2 + 152 v153 = *(*uintptr)(unsafe.Pointer(v154)) *(*uintptr)(unsafe.Pointer(v154))++ *(*uint8)(unsafe.Pointer(v153)) = uint8(libc.Uint32FromInt32(worker)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - worker } v155 = delta1 v156 = envPtr2 if v155 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v156)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v156)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v156)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v156)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v156 + 64)) += int64(v155) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v158 = envPtr2 + 152 v157 = *(*uintptr)(unsafe.Pointer(v158)) *(*uintptr)(unsafe.Pointer(v158))++ *(*uint8)(unsafe.Pointer(v157)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v160 = envPtr2 + 152 v159 = *(*uintptr)(unsafe.Pointer(v160)) *(*uintptr)(unsafe.Pointer(v160))++ *(*uint8)(unsafe.Pointer(v159)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(24)) v162 = envPtr2 + 152 v161 = *(*uintptr)(unsafe.Pointer(v162)) *(*uintptr)(unsafe.Pointer(v162))++ *(*uint8)(unsafe.Pointer(v161)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(16)) v164 = envPtr2 + 152 v163 = *(*uintptr)(unsafe.Pointer(v164)) *(*uintptr)(unsafe.Pointer(v164))++ *(*uint8)(unsafe.Pointer(v163)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(8)) v166 = envPtr2 + 152 v165 = *(*uintptr)(unsafe.Pointer(v166)) *(*uintptr)(unsafe.Pointer(v166))++ *(*uint8)(unsafe.Pointer(v165)) = uint8(libc.Uint32FromInt32(worker)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - worker } v167 = delta1 v168 = envPtr2 if v167 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v168)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v168)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v168)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v168)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v168 + 64)) += int64(v167) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v170 = envPtr2 + 152 v169 = *(*uintptr)(unsafe.Pointer(v170)) *(*uintptr)(unsafe.Pointer(v170))++ *(*uint8)(unsafe.Pointer(v169)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v172 = envPtr2 + 152 v171 = *(*uintptr)(unsafe.Pointer(v172)) *(*uintptr)(unsafe.Pointer(v172))++ *(*uint8)(unsafe.Pointer(v171)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v173 = delta1 v174 = envPtr2 if v173 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v174)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v174)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v174)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v174)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v174 + 64)) += int64(v173) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v176 = envPtr2 + 152 v175 = *(*uintptr)(unsafe.Pointer(v176)) *(*uintptr)(unsafe.Pointer(v176))++ *(*uint8)(unsafe.Pointer(v175)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(24)) v178 = envPtr2 + 152 v177 = *(*uintptr)(unsafe.Pointer(v178)) *(*uintptr)(unsafe.Pointer(v178))++ *(*uint8)(unsafe.Pointer(v177)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(16)) v180 = envPtr2 + 152 v179 = *(*uintptr)(unsafe.Pointer(v180)) *(*uintptr)(unsafe.Pointer(v180))++ *(*uint8)(unsafe.Pointer(v179)) = uint8(libc.Uint32FromInt32(worker) >> libc.Int32FromInt32(8)) v182 = envPtr2 + 152 v181 = *(*uintptr)(unsafe.Pointer(v182)) *(*uintptr)(unsafe.Pointer(v182))++ *(*uint8)(unsafe.Pointer(v181)) = uint8(libc.Uint32FromInt32(worker)) return TCL_OK } func XTclCompileDictMergeCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, delta1, i1, infoIndex, outLoop, workerIndex, v103, v111, v123, v135, v141, v153, v165, v17, v175, v179, v191, v197, v201, v205, v211, v223, v229, v23, v241, v247, v261, v263, v267, v271, v275, v281, v295, v307, v35, v39, v43, v49, v5, v61, v65, v69, v75, v87, v91 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v100, v101, v102, v104, v107, v108, v109, v11, v110, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v136, v137, v138, v139, v14, v140, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v166, v167, v168, v169, v170, v171, v172, v173, v174, v176, v177, v178, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v192, v193, v194, v195, v196, v198, v199, v2, v20, v200, v202, v203, v204, v206, v207, v208, v209, v21, v210, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v224, v225, v226, v227, v228, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v242, v243, v244, v245, v246, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v262, v264, v265, v266, v268, v269, v27, v270, v272, v273, v274, v276, v277, v278, v279, v28, v280, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v292, v293, v294, v296, v297, v298, v299, v3, v30, v300, v301, v302, v303, v304, v305, v306, v308, v31, v32, v33, v34, v36, v37, v38, v4, v40, v41, v42, v44, v45, v46, v47, v48, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v62, v63, v64, v66, v67, v68, v7, v70, v71, v72, v73, v74, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v88, v89, v9, v90, v92, v93, v94, v95, v96, v97, v98, v99 uintptr var v105 int64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, delta1, eclIndex, i1, infoIndex, mapPtr, outLoop, tokenPtr, workerIndex, v1, v10, v100, v101, v102, v103, v104, v105, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v28, v280, v281, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v292, v293, v294, v295, v296, v297, v298, v299, v3, v30, v300, v301, v302, v303, v304, v305, v306, v307, v308, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * Deal with some special edge cases. Note that in the case with one * argument, the only thing to do is to verify the dict-ness. */ /* TODO: Consider support for compiling expanded args. (less likely) */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(2) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } return TCL_OK } else { if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(2) { tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_DICT_VERIFY)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_VERIFY)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v43 = delta1 v44 = envPtr2 if v43 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v44 + 64)) += int64(v43) } return TCL_OK } } /* * There's real merging work to do. * * Allocate some working space. This means we'll only ever compile this * command when there's an LVT present. */ workerIndex = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) if workerIndex < 0 { return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } infoIndex = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) /* * Get the first dictionary and verify that it is so. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v49 = delta1 v50 = envPtr2 if v49 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v50 + 64)) += int64(v49) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v61 = delta1 v62 = envPtr2 if v61 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v62 + 64)) += int64(v61) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v65 = delta1 v66 = envPtr2 if v65 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v66 + 64)) += int64(v65) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = libc.Uint8FromInt32(int32(INST_DICT_VERIFY)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_VERIFY)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } if workerIndex <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(workerIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - workerIndex } v75 = delta1 v76 = envPtr2 if v75 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v76 + 64)) += int64(v75) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(24)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(16)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(8)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(workerIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - workerIndex } v87 = delta1 v88 = envPtr2 if v87 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v88 + 64)) += int64(v87) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v91 = delta1 v92 = envPtr2 if v91 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v92 + 64)) += int64(v91) } /* * For each of the remaining dictionaries... */ outLoop = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = uint8(libc.Uint32FromInt32(outLoop) >> libc.Int32FromInt32(24)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(outLoop) >> libc.Int32FromInt32(16)) v100 = envPtr2 + 152 v99 = *(*uintptr)(unsafe.Pointer(v100)) *(*uintptr)(unsafe.Pointer(v100))++ *(*uint8)(unsafe.Pointer(v99)) = uint8(libc.Uint32FromInt32(outLoop) >> libc.Int32FromInt32(8)) v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = uint8(libc.Uint32FromInt32(outLoop)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - outLoop } v103 = delta1 v104 = envPtr2 if v103 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v104 + 64)) += int64(v103) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v105 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v105 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v105 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(outLoop)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) i1 = int32(2) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } /* * Get the dictionary, and merge its pairs into the first dict (using * a small loop). */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v111 = delta1 v112 = envPtr2 if v111 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v112 + 64)) += int64(v111) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v123 = delta1 v124 = envPtr2 if v123 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v124)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v124)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v124)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v124)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v124 + 64)) += int64(v123) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v126 = envPtr2 + 152 v125 = *(*uintptr)(unsafe.Pointer(v126)) *(*uintptr)(unsafe.Pointer(v126))++ *(*uint8)(unsafe.Pointer(v125)) = libc.Uint8FromInt32(int32(INST_DICT_FIRST)) v128 = envPtr2 + 152 v127 = *(*uintptr)(unsafe.Pointer(v128)) *(*uintptr)(unsafe.Pointer(v128))++ *(*uint8)(unsafe.Pointer(v127)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v130 = envPtr2 + 152 v129 = *(*uintptr)(unsafe.Pointer(v130)) *(*uintptr)(unsafe.Pointer(v130))++ *(*uint8)(unsafe.Pointer(v129)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v132 = envPtr2 + 152 v131 = *(*uintptr)(unsafe.Pointer(v132)) *(*uintptr)(unsafe.Pointer(v132))++ *(*uint8)(unsafe.Pointer(v131)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v134 = envPtr2 + 152 v133 = *(*uintptr)(unsafe.Pointer(v134)) *(*uintptr)(unsafe.Pointer(v134))++ *(*uint8)(unsafe.Pointer(v133)) = uint8(libc.Uint32FromInt32(infoIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_FIRST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - infoIndex } v135 = delta1 v136 = envPtr2 if v135 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v136)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v136)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v136)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v136)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v136 + 64)) += int64(v135) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v138 = envPtr2 + 152 v137 = *(*uintptr)(unsafe.Pointer(v138)) *(*uintptr)(unsafe.Pointer(v138))++ *(*uint8)(unsafe.Pointer(v137)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v140 = envPtr2 + 152 v139 = *(*uintptr)(unsafe.Pointer(v140)) *(*uintptr)(unsafe.Pointer(v140))++ *(*uint8)(unsafe.Pointer(v139)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(24))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(24) } v141 = delta1 v142 = envPtr2 if v141 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v142)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v142)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v142)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v142)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v142 + 64)) += int64(v141) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v144 = envPtr2 + 152 v143 = *(*uintptr)(unsafe.Pointer(v144)) *(*uintptr)(unsafe.Pointer(v144))++ *(*uint8)(unsafe.Pointer(v143)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v146 = envPtr2 + 152 v145 = *(*uintptr)(unsafe.Pointer(v146)) *(*uintptr)(unsafe.Pointer(v146))++ *(*uint8)(unsafe.Pointer(v145)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v148 = envPtr2 + 152 v147 = *(*uintptr)(unsafe.Pointer(v148)) *(*uintptr)(unsafe.Pointer(v148))++ *(*uint8)(unsafe.Pointer(v147)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v150 = envPtr2 + 152 v149 = *(*uintptr)(unsafe.Pointer(v150)) *(*uintptr)(unsafe.Pointer(v150))++ *(*uint8)(unsafe.Pointer(v149)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v152 = envPtr2 + 152 v151 = *(*uintptr)(unsafe.Pointer(v152)) *(*uintptr)(unsafe.Pointer(v152))++ *(*uint8)(unsafe.Pointer(v151)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v153 = delta1 v154 = envPtr2 if v153 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v154)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v154)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v154)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v154)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v154 + 64)) += int64(v153) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v156 = envPtr2 + 152 v155 = *(*uintptr)(unsafe.Pointer(v156)) *(*uintptr)(unsafe.Pointer(v156))++ *(*uint8)(unsafe.Pointer(v155)) = libc.Uint8FromInt32(int32(INST_DICT_SET)) v158 = envPtr2 + 152 v157 = *(*uintptr)(unsafe.Pointer(v158)) *(*uintptr)(unsafe.Pointer(v158))++ *(*uint8)(unsafe.Pointer(v157)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v160 = envPtr2 + 152 v159 = *(*uintptr)(unsafe.Pointer(v160)) *(*uintptr)(unsafe.Pointer(v160))++ *(*uint8)(unsafe.Pointer(v159)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v162 = envPtr2 + 152 v161 = *(*uintptr)(unsafe.Pointer(v162)) *(*uintptr)(unsafe.Pointer(v162))++ *(*uint8)(unsafe.Pointer(v161)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v164 = envPtr2 + 152 v163 = *(*uintptr)(unsafe.Pointer(v164)) *(*uintptr)(unsafe.Pointer(v164))++ *(*uint8)(unsafe.Pointer(v163)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_SET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v165 = delta1 v166 = envPtr2 if v165 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v166)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v166)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v166)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v166)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v166 + 64)) += int64(v165) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v168 = envPtr2 + 152 v167 = *(*uintptr)(unsafe.Pointer(v168)) *(*uintptr)(unsafe.Pointer(v168))++ *(*uint8)(unsafe.Pointer(v167)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(24)) v170 = envPtr2 + 152 v169 = *(*uintptr)(unsafe.Pointer(v170)) *(*uintptr)(unsafe.Pointer(v170))++ *(*uint8)(unsafe.Pointer(v169)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(16)) v172 = envPtr2 + 152 v171 = *(*uintptr)(unsafe.Pointer(v172)) *(*uintptr)(unsafe.Pointer(v172))++ *(*uint8)(unsafe.Pointer(v171)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(8)) v174 = envPtr2 + 152 v173 = *(*uintptr)(unsafe.Pointer(v174)) *(*uintptr)(unsafe.Pointer(v174))++ *(*uint8)(unsafe.Pointer(v173)) = uint8(libc.Uint32FromInt32(workerIndex)) v175 = -int32(1) v176 = envPtr2 if v175 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v176)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v176)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v176)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v176)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v176 + 64)) += int64(v175) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v178 = envPtr2 + 152 v177 = *(*uintptr)(unsafe.Pointer(v178)) *(*uintptr)(unsafe.Pointer(v178))++ *(*uint8)(unsafe.Pointer(v177)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v179 = delta1 v180 = envPtr2 if v179 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v180)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v180)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v180)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v180)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v180 + 64)) += int64(v179) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v182 = envPtr2 + 152 v181 = *(*uintptr)(unsafe.Pointer(v182)) *(*uintptr)(unsafe.Pointer(v182))++ *(*uint8)(unsafe.Pointer(v181)) = libc.Uint8FromInt32(int32(INST_DICT_NEXT)) v184 = envPtr2 + 152 v183 = *(*uintptr)(unsafe.Pointer(v184)) *(*uintptr)(unsafe.Pointer(v184))++ *(*uint8)(unsafe.Pointer(v183)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v186 = envPtr2 + 152 v185 = *(*uintptr)(unsafe.Pointer(v186)) *(*uintptr)(unsafe.Pointer(v186))++ *(*uint8)(unsafe.Pointer(v185)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v188 = envPtr2 + 152 v187 = *(*uintptr)(unsafe.Pointer(v188)) *(*uintptr)(unsafe.Pointer(v188))++ *(*uint8)(unsafe.Pointer(v187)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v190 = envPtr2 + 152 v189 = *(*uintptr)(unsafe.Pointer(v190)) *(*uintptr)(unsafe.Pointer(v190))++ *(*uint8)(unsafe.Pointer(v189)) = uint8(libc.Uint32FromInt32(infoIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_NEXT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - infoIndex } v191 = delta1 v192 = envPtr2 if v191 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v192)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v192)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v192)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v192)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v192 + 64)) += int64(v191) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v194 = envPtr2 + 152 v193 = *(*uintptr)(unsafe.Pointer(v194)) *(*uintptr)(unsafe.Pointer(v194))++ *(*uint8)(unsafe.Pointer(v193)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v196 = envPtr2 + 152 v195 = *(*uintptr)(unsafe.Pointer(v196)) *(*uintptr)(unsafe.Pointer(v196))++ *(*uint8)(unsafe.Pointer(v195)) = uint8(libc.Uint32FromInt32(-libc.Int32FromInt32(20))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - -int32(20) } v197 = delta1 v198 = envPtr2 if v197 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v198)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v198)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v198)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v198)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v198 + 64)) += int64(v197) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v200 = envPtr2 + 152 v199 = *(*uintptr)(unsafe.Pointer(v200)) *(*uintptr)(unsafe.Pointer(v200))++ *(*uint8)(unsafe.Pointer(v199)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v201 = delta1 v202 = envPtr2 if v201 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v202)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v202)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v202)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v202)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v202 + 64)) += int64(v201) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v204 = envPtr2 + 152 v203 = *(*uintptr)(unsafe.Pointer(v204)) *(*uintptr)(unsafe.Pointer(v204))++ *(*uint8)(unsafe.Pointer(v203)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v205 = delta1 v206 = envPtr2 if v205 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v206)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v206)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v206)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v206)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v206 + 64)) += int64(v205) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v208 = envPtr2 + 152 v207 = *(*uintptr)(unsafe.Pointer(v208)) *(*uintptr)(unsafe.Pointer(v208))++ *(*uint8)(unsafe.Pointer(v207)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v210 = envPtr2 + 152 v209 = *(*uintptr)(unsafe.Pointer(v210)) *(*uintptr)(unsafe.Pointer(v210))++ *(*uint8)(unsafe.Pointer(v209)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v211 = delta1 v212 = envPtr2 if v211 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v212)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v212)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v212)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v212)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v212 + 64)) += int64(v211) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v214 = envPtr2 + 152 v213 = *(*uintptr)(unsafe.Pointer(v214)) *(*uintptr)(unsafe.Pointer(v214))++ *(*uint8)(unsafe.Pointer(v213)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v216 = envPtr2 + 152 v215 = *(*uintptr)(unsafe.Pointer(v216)) *(*uintptr)(unsafe.Pointer(v216))++ *(*uint8)(unsafe.Pointer(v215)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v218 = envPtr2 + 152 v217 = *(*uintptr)(unsafe.Pointer(v218)) *(*uintptr)(unsafe.Pointer(v218))++ *(*uint8)(unsafe.Pointer(v217)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v220 = envPtr2 + 152 v219 = *(*uintptr)(unsafe.Pointer(v220)) *(*uintptr)(unsafe.Pointer(v220))++ *(*uint8)(unsafe.Pointer(v219)) = uint8(libc.Uint32FromInt32(infoIndex)) goto _106 _106: ; i1++ } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(outLoop)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(outLoop)*56))).FcodeOffset)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v222 = envPtr2 + 152 v221 = *(*uintptr)(unsafe.Pointer(v222)) *(*uintptr)(unsafe.Pointer(v222))++ *(*uint8)(unsafe.Pointer(v221)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v223 = delta1 v224 = envPtr2 if v223 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v224)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v224)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v224)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v224)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v224 + 64)) += int64(v223) } /* * Clean up any state left over. */ if workerIndex <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v226 = envPtr2 + 152 v225 = *(*uintptr)(unsafe.Pointer(v226)) *(*uintptr)(unsafe.Pointer(v226))++ *(*uint8)(unsafe.Pointer(v225)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v228 = envPtr2 + 152 v227 = *(*uintptr)(unsafe.Pointer(v228)) *(*uintptr)(unsafe.Pointer(v228))++ *(*uint8)(unsafe.Pointer(v227)) = uint8(libc.Uint32FromInt32(workerIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - workerIndex } v229 = delta1 v230 = envPtr2 if v229 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v230)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v230)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v230)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v230)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v230 + 64)) += int64(v229) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v232 = envPtr2 + 152 v231 = *(*uintptr)(unsafe.Pointer(v232)) *(*uintptr)(unsafe.Pointer(v232))++ *(*uint8)(unsafe.Pointer(v231)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v234 = envPtr2 + 152 v233 = *(*uintptr)(unsafe.Pointer(v234)) *(*uintptr)(unsafe.Pointer(v234))++ *(*uint8)(unsafe.Pointer(v233)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(24)) v236 = envPtr2 + 152 v235 = *(*uintptr)(unsafe.Pointer(v236)) *(*uintptr)(unsafe.Pointer(v236))++ *(*uint8)(unsafe.Pointer(v235)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(16)) v238 = envPtr2 + 152 v237 = *(*uintptr)(unsafe.Pointer(v238)) *(*uintptr)(unsafe.Pointer(v238))++ *(*uint8)(unsafe.Pointer(v237)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(8)) v240 = envPtr2 + 152 v239 = *(*uintptr)(unsafe.Pointer(v240)) *(*uintptr)(unsafe.Pointer(v240))++ *(*uint8)(unsafe.Pointer(v239)) = uint8(libc.Uint32FromInt32(workerIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - workerIndex } v241 = delta1 v242 = envPtr2 if v241 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v242)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v242)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v242)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v242)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v242 + 64)) += int64(v241) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v244 = envPtr2 + 152 v243 = *(*uintptr)(unsafe.Pointer(v244)) *(*uintptr)(unsafe.Pointer(v244))++ *(*uint8)(unsafe.Pointer(v243)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v246 = envPtr2 + 152 v245 = *(*uintptr)(unsafe.Pointer(v246)) *(*uintptr)(unsafe.Pointer(v246))++ *(*uint8)(unsafe.Pointer(v245)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v247 = delta1 v248 = envPtr2 if v247 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v248)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v248)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v248)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v248)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v248 + 64)) += int64(v247) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v250 = envPtr2 + 152 v249 = *(*uintptr)(unsafe.Pointer(v250)) *(*uintptr)(unsafe.Pointer(v250))++ *(*uint8)(unsafe.Pointer(v249)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(24)) v252 = envPtr2 + 152 v251 = *(*uintptr)(unsafe.Pointer(v252)) *(*uintptr)(unsafe.Pointer(v252))++ *(*uint8)(unsafe.Pointer(v251)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(16)) v254 = envPtr2 + 152 v253 = *(*uintptr)(unsafe.Pointer(v254)) *(*uintptr)(unsafe.Pointer(v254))++ *(*uint8)(unsafe.Pointer(v253)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(8)) v256 = envPtr2 + 152 v255 = *(*uintptr)(unsafe.Pointer(v256)) *(*uintptr)(unsafe.Pointer(v256))++ *(*uint8)(unsafe.Pointer(v255)) = uint8(libc.Uint32FromInt32(workerIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v258 = envPtr2 + 152 v257 = *(*uintptr)(unsafe.Pointer(v258)) *(*uintptr)(unsafe.Pointer(v258))++ *(*uint8)(unsafe.Pointer(v257)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v260 = envPtr2 + 152 v259 = *(*uintptr)(unsafe.Pointer(v260)) *(*uintptr)(unsafe.Pointer(v260))++ *(*uint8)(unsafe.Pointer(v259)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(18))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(18) } v261 = delta1 v262 = envPtr2 if v261 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v262)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v262)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v262)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v262)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v262 + 64)) += int64(v261) } /* * If an exception happens when starting to iterate over the second (and * subsequent) dicts. This is strictly not necessary, but it is nice. */ v263 = -int32(1) v264 = envPtr2 if v263 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v264)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v264)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v264)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v264)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v264 + 64)) += int64(v263) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(outLoop)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v266 = envPtr2 + 152 v265 = *(*uintptr)(unsafe.Pointer(v266)) *(*uintptr)(unsafe.Pointer(v266))++ *(*uint8)(unsafe.Pointer(v265)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v267 = delta1 v268 = envPtr2 if v267 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v268)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v268)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v268)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v268)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v268 + 64)) += int64(v267) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v270 = envPtr2 + 152 v269 = *(*uintptr)(unsafe.Pointer(v270)) *(*uintptr)(unsafe.Pointer(v270))++ *(*uint8)(unsafe.Pointer(v269)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v271 = delta1 v272 = envPtr2 if v271 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v272)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v272)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v272)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v272)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v272 + 64)) += int64(v271) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v274 = envPtr2 + 152 v273 = *(*uintptr)(unsafe.Pointer(v274)) *(*uintptr)(unsafe.Pointer(v274))++ *(*uint8)(unsafe.Pointer(v273)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v275 = delta1 v276 = envPtr2 if v275 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v276)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v276)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v276)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v276)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v276 + 64)) += int64(v275) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v278 = envPtr2 + 152 v277 = *(*uintptr)(unsafe.Pointer(v278)) *(*uintptr)(unsafe.Pointer(v278))++ *(*uint8)(unsafe.Pointer(v277)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v280 = envPtr2 + 152 v279 = *(*uintptr)(unsafe.Pointer(v280)) *(*uintptr)(unsafe.Pointer(v280))++ *(*uint8)(unsafe.Pointer(v279)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v281 = delta1 v282 = envPtr2 if v281 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v282)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v282)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v282)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v282)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v282 + 64)) += int64(v281) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v284 = envPtr2 + 152 v283 = *(*uintptr)(unsafe.Pointer(v284)) *(*uintptr)(unsafe.Pointer(v284))++ *(*uint8)(unsafe.Pointer(v283)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(24)) v286 = envPtr2 + 152 v285 = *(*uintptr)(unsafe.Pointer(v286)) *(*uintptr)(unsafe.Pointer(v286))++ *(*uint8)(unsafe.Pointer(v285)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(16)) v288 = envPtr2 + 152 v287 = *(*uintptr)(unsafe.Pointer(v288)) *(*uintptr)(unsafe.Pointer(v288))++ *(*uint8)(unsafe.Pointer(v287)) = uint8(libc.Uint32FromInt32(workerIndex) >> libc.Int32FromInt32(8)) v290 = envPtr2 + 152 v289 = *(*uintptr)(unsafe.Pointer(v290)) *(*uintptr)(unsafe.Pointer(v290))++ *(*uint8)(unsafe.Pointer(v289)) = uint8(libc.Uint32FromInt32(workerIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v292 = envPtr2 + 152 v291 = *(*uintptr)(unsafe.Pointer(v292)) *(*uintptr)(unsafe.Pointer(v292))++ *(*uint8)(unsafe.Pointer(v291)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v294 = envPtr2 + 152 v293 = *(*uintptr)(unsafe.Pointer(v294)) *(*uintptr)(unsafe.Pointer(v294))++ *(*uint8)(unsafe.Pointer(v293)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v295 = delta1 v296 = envPtr2 if v295 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v296)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v296)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v296)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v296)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v296 + 64)) += int64(v295) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v298 = envPtr2 + 152 v297 = *(*uintptr)(unsafe.Pointer(v298)) *(*uintptr)(unsafe.Pointer(v298))++ *(*uint8)(unsafe.Pointer(v297)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v300 = envPtr2 + 152 v299 = *(*uintptr)(unsafe.Pointer(v300)) *(*uintptr)(unsafe.Pointer(v300))++ *(*uint8)(unsafe.Pointer(v299)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v302 = envPtr2 + 152 v301 = *(*uintptr)(unsafe.Pointer(v302)) *(*uintptr)(unsafe.Pointer(v302))++ *(*uint8)(unsafe.Pointer(v301)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v304 = envPtr2 + 152 v303 = *(*uintptr)(unsafe.Pointer(v304)) *(*uintptr)(unsafe.Pointer(v304))++ *(*uint8)(unsafe.Pointer(v303)) = uint8(libc.Uint32FromInt32(infoIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v306 = envPtr2 + 152 v305 = *(*uintptr)(unsafe.Pointer(v306)) *(*uintptr)(unsafe.Pointer(v306))++ *(*uint8)(unsafe.Pointer(v305)) = libc.Uint8FromInt32(int32(INST_RETURN_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RETURN_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v307 = delta1 v308 = envPtr2 if v307 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v308)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v308)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v308)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v308)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v308 + 64)) += int64(v307) } return TCL_OK } func XTclCompileDictForCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ return _CompileDictEachCmd(tls, interp, parsePtr, cmdPtr, envPtr, TCL_EACH_KEEP_NONE) } func XTclCompileDictMapCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ return _CompileDictEachCmd(tls, interp, parsePtr, cmdPtr, envPtr, int32(TCL_EACH_COLLECT)) } func _CompileDictEachCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr, collect int32) (r int32) { bp := tls.Alloc(240) defer tls.Free(240) /* Flag == TCL_EACH_COLLECT to collect and * construct a new dictionary with the loop * body result. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, bodyTargetOffset, catchRange, collectVar, delta1, emptyTargetOffset, endTargetOffset, infoIndex, jumpDisplacement, keyVarIndex, loopRange, nameChars, valueVarIndex, v100, v112, v116, v122, v134, v138, v145, v157, v169, v17, v181, v191, v195, v199, v211, v223, v229, v23, v231, v235, v239, v243, v249, v263, v275, v279, v283, v287, v293, v307, v319, v325, v339, v35, v351, v39, v45, v5, v57, v69, v82, v94 int32 var bodyTokenPtr, dictTokenPtr, mapPtr, varsTokenPtr, v1, v10, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v113, v114, v115, v117, v118, v119, v12, v120, v121, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v135, v136, v137, v139, v14, v141, v142, v143, v144, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v192, v193, v194, v196, v197, v198, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v224, v225, v226, v227, v228, v230, v232, v233, v234, v236, v237, v238, v24, v240, v241, v242, v244, v245, v246, v247, v248, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v273, v274, v276, v277, v278, v28, v280, v281, v282, v284, v285, v286, v288, v289, v29, v290, v291, v292, v294, v295, v296, v297, v298, v299, v3, v30, v300, v301, v302, v303, v304, v305, v306, v308, v309, v31, v310, v311, v312, v313, v314, v315, v316, v317, v318, v32, v320, v321, v322, v323, v324, v326, v327, v328, v329, v33, v330, v331, v332, v333, v334, v335, v336, v337, v338, v34, v340, v341, v342, v343, v344, v345, v346, v347, v348, v349, v350, v352, v36, v37, v38, v4, v40, v41, v42, v43, v44, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v7, v70, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v95, v96, v97, v98, v99 uintptr var eclIndex TTcl_Size var v140, v71 int64 var _ /* argv at bp+8 */ uintptr var _ /* buffer at bp+16 */ TTcl_DString var _ /* numVars at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, bodyTargetOffset, bodyTokenPtr, catchRange, collectVar, delta1, dictTokenPtr, eclIndex, emptyTargetOffset, endTargetOffset, infoIndex, jumpDisplacement, keyVarIndex, loopRange, mapPtr, nameChars, valueVarIndex, varsTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v28, v280, v281, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v292, v293, v294, v295, v296, v297, v298, v299, v3, v30, v300, v301, v302, v303, v304, v305, v306, v307, v308, v309, v31, v310, v311, v312, v313, v314, v315, v316, v317, v318, v319, v32, v320, v321, v322, v323, v324, v325, v326, v327, v328, v329, v33, v330, v331, v332, v333, v334, v335, v336, v337, v338, v339, v34, v340, v341, v342, v343, v344, v345, v346, v347, v348, v349, v35, v350, v351, v352, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) collectVar = -int32(1) /* * There must be three arguments after the command. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(4) { return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } varsTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 dictTokenPtr = varsTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varsTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 bodyTokenPtr = dictTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(dictTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(varsTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*TTcl_Token)(unsafe.Pointer(bodyTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } /* * Create temporary variable to capture return values from loop body when * we're collecting results. */ if collect == int32(TCL_EACH_COLLECT) { collectVar = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) if collectVar < 0 { return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } } /* * Check we've got a pair of variables and that they are local variables. * Then extract their indices in the LVT. */ XTcl_DStringInit(tls, bp+16) XTcl_DStringAppend(tls, bp+16, (*TTcl_Token)(unsafe.Pointer(varsTokenPtr+1*32)).Fstart, (*TTcl_Token)(unsafe.Pointer(varsTokenPtr+1*32)).Fsize) if XTcl_SplitList(tls, libc.UintptrFromInt32(0), (*TTcl_DString)(unsafe.Pointer(bp+16)).Fstring1, bp, bp+8) != TCL_OK { XTcl_DStringFree(tls, bp+16) return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } XTcl_DStringFree(tls, bp+16) if *(*TTcl_Size)(unsafe.Pointer(bp)) != int64(2) { XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } nameChars = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))))) keyVarIndex = libc.Int32FromUint64(XTclLocalScalar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))), libc.Uint64FromInt32(nameChars), envPtr2)) nameChars = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)))) valueVarIndex = libc.Int32FromUint64(XTclLocalScalar(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 1*8)), libc.Uint64FromInt32(nameChars), envPtr2)) XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if keyVarIndex < 0 || valueVarIndex < 0 { return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } /* * Allocate a temporary variable to store the iterator reference. The * variable will contain a Tcl_DictSearch reference which will be * allocated by INST_DICT_FIRST and disposed when the variable is unset * (at which point it should also have been finished with). */ infoIndex = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) if infoIndex < 0 { return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } /* * Preparation complete; issue instructions. Note that this code issues * fixed-sized jumps. That simplifies things a lot! * * First up, initialize the accumulator dictionary if needed. */ if collect == int32(TCL_EACH_COLLECT) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } if collectVar <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(collectVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - collectVar } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(collectVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - collectVar } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } } /* * Get the dictionary and start the iteration. No catching of errors at * this point. */ if (*TTcl_Token)(unsafe.Pointer(dictTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(dictTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(dictTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v45 = delta1 v46 = envPtr2 if v45 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v46 + 64)) += int64(v45) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, dictTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(dictTokenPtr)).FnumComponents), envPtr2) } /* * Now we catch errors from here on so that we can finalize the search * started by Tcl_DictObjFirst above. */ catchRange = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(catchRange) >> libc.Int32FromInt32(24)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(catchRange) >> libc.Int32FromInt32(16)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(catchRange) >> libc.Int32FromInt32(8)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(catchRange)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - catchRange } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v71 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v71 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v71 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(catchRange)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = libc.Uint8FromInt32(int32(INST_DICT_FIRST)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = uint8(libc.Uint32FromInt32(infoIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_FIRST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - infoIndex } v82 = delta1 v83 = envPtr2 if v82 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v83 + 64)) += int64(v82) } emptyTargetOffset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v85 = envPtr2 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE4)) v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v93 = envPtr2 + 152 v92 = *(*uintptr)(unsafe.Pointer(v93)) *(*uintptr)(unsafe.Pointer(v93))++ *(*uint8)(unsafe.Pointer(v92)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v94 = delta1 v95 = envPtr2 if v94 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v95)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v95)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v95)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v95)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v95 + 64)) += int64(v94) } /* * Inside the iteration, write the loop variables. */ bodyTargetOffset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if keyVarIndex <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = uint8(libc.Uint32FromInt32(keyVarIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keyVarIndex } v100 = delta1 v101 = envPtr2 if v100 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v101 + 64)) += int64(v100) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = uint8(libc.Uint32FromInt32(keyVarIndex) >> libc.Int32FromInt32(24)) v107 = envPtr2 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = uint8(libc.Uint32FromInt32(keyVarIndex) >> libc.Int32FromInt32(16)) v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = uint8(libc.Uint32FromInt32(keyVarIndex) >> libc.Int32FromInt32(8)) v111 = envPtr2 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = uint8(libc.Uint32FromInt32(keyVarIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keyVarIndex } v112 = delta1 v113 = envPtr2 if v112 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v113 + 64)) += int64(v112) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v116 = delta1 v117 = envPtr2 if v116 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v117)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v117)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v117)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v117)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v117 + 64)) += int64(v116) } if valueVarIndex <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v119 = envPtr2 + 152 v118 = *(*uintptr)(unsafe.Pointer(v119)) *(*uintptr)(unsafe.Pointer(v119))++ *(*uint8)(unsafe.Pointer(v118)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = uint8(libc.Uint32FromInt32(valueVarIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - valueVarIndex } v122 = delta1 v123 = envPtr2 if v122 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v123)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v123)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v123)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v123)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v123 + 64)) += int64(v122) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v125 = envPtr2 + 152 v124 = *(*uintptr)(unsafe.Pointer(v125)) *(*uintptr)(unsafe.Pointer(v125))++ *(*uint8)(unsafe.Pointer(v124)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v127 = envPtr2 + 152 v126 = *(*uintptr)(unsafe.Pointer(v127)) *(*uintptr)(unsafe.Pointer(v127))++ *(*uint8)(unsafe.Pointer(v126)) = uint8(libc.Uint32FromInt32(valueVarIndex) >> libc.Int32FromInt32(24)) v129 = envPtr2 + 152 v128 = *(*uintptr)(unsafe.Pointer(v129)) *(*uintptr)(unsafe.Pointer(v129))++ *(*uint8)(unsafe.Pointer(v128)) = uint8(libc.Uint32FromInt32(valueVarIndex) >> libc.Int32FromInt32(16)) v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = uint8(libc.Uint32FromInt32(valueVarIndex) >> libc.Int32FromInt32(8)) v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = uint8(libc.Uint32FromInt32(valueVarIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - valueVarIndex } v134 = delta1 v135 = envPtr2 if v134 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v135 + 64)) += int64(v134) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v137 = envPtr2 + 152 v136 = *(*uintptr)(unsafe.Pointer(v137)) *(*uintptr)(unsafe.Pointer(v137))++ *(*uint8)(unsafe.Pointer(v136)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v138 = delta1 v139 = envPtr2 if v138 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v139)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v139)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v139)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v139)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v139 + 64)) += int64(v138) } /* * Set up the loop exception targets. */ loopRange = int32(XTclCreateExceptRange(tls, int32(LOOP_EXCEPTION_RANGE), envPtr2)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v140 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v140 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v140 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(loopRange)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) /* * Compile the loop body itself. It should be stack-neutral. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents), envPtr2) if collect == int32(TCL_EACH_COLLECT) { if keyVarIndex <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v142 = envPtr2 + 152 v141 = *(*uintptr)(unsafe.Pointer(v142)) *(*uintptr)(unsafe.Pointer(v142))++ *(*uint8)(unsafe.Pointer(v141)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v144 = envPtr2 + 152 v143 = *(*uintptr)(unsafe.Pointer(v144)) *(*uintptr)(unsafe.Pointer(v144))++ *(*uint8)(unsafe.Pointer(v143)) = uint8(libc.Uint32FromInt32(keyVarIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keyVarIndex } v145 = delta1 v146 = envPtr2 if v145 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v146 + 64)) += int64(v145) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v148 = envPtr2 + 152 v147 = *(*uintptr)(unsafe.Pointer(v148)) *(*uintptr)(unsafe.Pointer(v148))++ *(*uint8)(unsafe.Pointer(v147)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v150 = envPtr2 + 152 v149 = *(*uintptr)(unsafe.Pointer(v150)) *(*uintptr)(unsafe.Pointer(v150))++ *(*uint8)(unsafe.Pointer(v149)) = uint8(libc.Uint32FromInt32(keyVarIndex) >> libc.Int32FromInt32(24)) v152 = envPtr2 + 152 v151 = *(*uintptr)(unsafe.Pointer(v152)) *(*uintptr)(unsafe.Pointer(v152))++ *(*uint8)(unsafe.Pointer(v151)) = uint8(libc.Uint32FromInt32(keyVarIndex) >> libc.Int32FromInt32(16)) v154 = envPtr2 + 152 v153 = *(*uintptr)(unsafe.Pointer(v154)) *(*uintptr)(unsafe.Pointer(v154))++ *(*uint8)(unsafe.Pointer(v153)) = uint8(libc.Uint32FromInt32(keyVarIndex) >> libc.Int32FromInt32(8)) v156 = envPtr2 + 152 v155 = *(*uintptr)(unsafe.Pointer(v156)) *(*uintptr)(unsafe.Pointer(v156))++ *(*uint8)(unsafe.Pointer(v155)) = uint8(libc.Uint32FromInt32(keyVarIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keyVarIndex } v157 = delta1 v158 = envPtr2 if v157 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v158)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v158)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v158)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v158)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v158 + 64)) += int64(v157) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v160 = envPtr2 + 152 v159 = *(*uintptr)(unsafe.Pointer(v160)) *(*uintptr)(unsafe.Pointer(v160))++ *(*uint8)(unsafe.Pointer(v159)) = libc.Uint8FromInt32(int32(INST_OVER)) v162 = envPtr2 + 152 v161 = *(*uintptr)(unsafe.Pointer(v162)) *(*uintptr)(unsafe.Pointer(v162))++ *(*uint8)(unsafe.Pointer(v161)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v164 = envPtr2 + 152 v163 = *(*uintptr)(unsafe.Pointer(v164)) *(*uintptr)(unsafe.Pointer(v164))++ *(*uint8)(unsafe.Pointer(v163)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v166 = envPtr2 + 152 v165 = *(*uintptr)(unsafe.Pointer(v166)) *(*uintptr)(unsafe.Pointer(v166))++ *(*uint8)(unsafe.Pointer(v165)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v168 = envPtr2 + 152 v167 = *(*uintptr)(unsafe.Pointer(v168)) *(*uintptr)(unsafe.Pointer(v168))++ *(*uint8)(unsafe.Pointer(v167)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v169 = delta1 v170 = envPtr2 if v169 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v170)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v170)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v170)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v170)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v170 + 64)) += int64(v169) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v172 = envPtr2 + 152 v171 = *(*uintptr)(unsafe.Pointer(v172)) *(*uintptr)(unsafe.Pointer(v172))++ *(*uint8)(unsafe.Pointer(v171)) = libc.Uint8FromInt32(int32(INST_DICT_SET)) v174 = envPtr2 + 152 v173 = *(*uintptr)(unsafe.Pointer(v174)) *(*uintptr)(unsafe.Pointer(v174))++ *(*uint8)(unsafe.Pointer(v173)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v176 = envPtr2 + 152 v175 = *(*uintptr)(unsafe.Pointer(v176)) *(*uintptr)(unsafe.Pointer(v176))++ *(*uint8)(unsafe.Pointer(v175)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v178 = envPtr2 + 152 v177 = *(*uintptr)(unsafe.Pointer(v178)) *(*uintptr)(unsafe.Pointer(v178))++ *(*uint8)(unsafe.Pointer(v177)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v180 = envPtr2 + 152 v179 = *(*uintptr)(unsafe.Pointer(v180)) *(*uintptr)(unsafe.Pointer(v180))++ *(*uint8)(unsafe.Pointer(v179)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_SET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v181 = delta1 v182 = envPtr2 if v181 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v182)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v182)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v182)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v182)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v182 + 64)) += int64(v181) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v184 = envPtr2 + 152 v183 = *(*uintptr)(unsafe.Pointer(v184)) *(*uintptr)(unsafe.Pointer(v184))++ *(*uint8)(unsafe.Pointer(v183)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(24)) v186 = envPtr2 + 152 v185 = *(*uintptr)(unsafe.Pointer(v186)) *(*uintptr)(unsafe.Pointer(v186))++ *(*uint8)(unsafe.Pointer(v185)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(16)) v188 = envPtr2 + 152 v187 = *(*uintptr)(unsafe.Pointer(v188)) *(*uintptr)(unsafe.Pointer(v188))++ *(*uint8)(unsafe.Pointer(v187)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(8)) v190 = envPtr2 + 152 v189 = *(*uintptr)(unsafe.Pointer(v190)) *(*uintptr)(unsafe.Pointer(v190))++ *(*uint8)(unsafe.Pointer(v189)) = uint8(libc.Uint32FromInt32(collectVar)) v191 = -int32(1) v192 = envPtr2 if v191 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v192)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v192)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v192)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v192)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v192 + 64)) += int64(v191) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v194 = envPtr2 + 152 v193 = *(*uintptr)(unsafe.Pointer(v194)) *(*uintptr)(unsafe.Pointer(v194))++ *(*uint8)(unsafe.Pointer(v193)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v195 = delta1 v196 = envPtr2 if v195 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v196)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v196)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v196)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v196)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v196 + 64)) += int64(v195) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v198 = envPtr2 + 152 v197 = *(*uintptr)(unsafe.Pointer(v198)) *(*uintptr)(unsafe.Pointer(v198))++ *(*uint8)(unsafe.Pointer(v197)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v199 = delta1 v200 = envPtr2 if v199 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v200)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v200)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v200)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v200)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v200 + 64)) += int64(v199) } /* * Both exception target ranges (error and loop) end here. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(loopRange)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(loopRange)*56))).FcodeOffset)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(catchRange)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(catchRange)*56))).FcodeOffset)) /* * Continue (or just normally process) by getting the next pair of items * from the dictionary and jumping back to the code to write them into * variables if there is another pair. */ (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(loopRange)*56))).FcontinueOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v202 = envPtr2 + 152 v201 = *(*uintptr)(unsafe.Pointer(v202)) *(*uintptr)(unsafe.Pointer(v202))++ *(*uint8)(unsafe.Pointer(v201)) = libc.Uint8FromInt32(int32(INST_DICT_NEXT)) v204 = envPtr2 + 152 v203 = *(*uintptr)(unsafe.Pointer(v204)) *(*uintptr)(unsafe.Pointer(v204))++ *(*uint8)(unsafe.Pointer(v203)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v206 = envPtr2 + 152 v205 = *(*uintptr)(unsafe.Pointer(v206)) *(*uintptr)(unsafe.Pointer(v206))++ *(*uint8)(unsafe.Pointer(v205)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v208 = envPtr2 + 152 v207 = *(*uintptr)(unsafe.Pointer(v208)) *(*uintptr)(unsafe.Pointer(v208))++ *(*uint8)(unsafe.Pointer(v207)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v210 = envPtr2 + 152 v209 = *(*uintptr)(unsafe.Pointer(v210)) *(*uintptr)(unsafe.Pointer(v210))++ *(*uint8)(unsafe.Pointer(v209)) = uint8(libc.Uint32FromInt32(infoIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_NEXT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - infoIndex } v211 = delta1 v212 = envPtr2 if v211 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v212)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v212)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v212)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v212)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v212 + 64)) += int64(v211) } jumpDisplacement = int32(int64(bodyTargetOffset) - (int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v214 = envPtr2 + 152 v213 = *(*uintptr)(unsafe.Pointer(v214)) *(*uintptr)(unsafe.Pointer(v214))++ *(*uint8)(unsafe.Pointer(v213)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE4)) v216 = envPtr2 + 152 v215 = *(*uintptr)(unsafe.Pointer(v216)) *(*uintptr)(unsafe.Pointer(v216))++ *(*uint8)(unsafe.Pointer(v215)) = uint8(libc.Uint32FromInt32(jumpDisplacement) >> libc.Int32FromInt32(24)) v218 = envPtr2 + 152 v217 = *(*uintptr)(unsafe.Pointer(v218)) *(*uintptr)(unsafe.Pointer(v218))++ *(*uint8)(unsafe.Pointer(v217)) = uint8(libc.Uint32FromInt32(jumpDisplacement) >> libc.Int32FromInt32(16)) v220 = envPtr2 + 152 v219 = *(*uintptr)(unsafe.Pointer(v220)) *(*uintptr)(unsafe.Pointer(v220))++ *(*uint8)(unsafe.Pointer(v219)) = uint8(libc.Uint32FromInt32(jumpDisplacement) >> libc.Int32FromInt32(8)) v222 = envPtr2 + 152 v221 = *(*uintptr)(unsafe.Pointer(v222)) *(*uintptr)(unsafe.Pointer(v222))++ *(*uint8)(unsafe.Pointer(v221)) = uint8(libc.Uint32FromInt32(jumpDisplacement)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - jumpDisplacement } v223 = delta1 v224 = envPtr2 if v223 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v224)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v224)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v224)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v224)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v224 + 64)) += int64(v223) } endTargetOffset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v226 = envPtr2 + 152 v225 = *(*uintptr)(unsafe.Pointer(v226)) *(*uintptr)(unsafe.Pointer(v226))++ *(*uint8)(unsafe.Pointer(v225)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v228 = envPtr2 + 152 v227 = *(*uintptr)(unsafe.Pointer(v228)) *(*uintptr)(unsafe.Pointer(v228))++ *(*uint8)(unsafe.Pointer(v227)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v229 = delta1 v230 = envPtr2 if v229 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v230)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v230)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v230)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v230)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v230 + 64)) += int64(v229) } /* * Error handler "finally" clause, which force-terminates the iteration * and re-throws the error. */ v231 = -int32(1) v232 = envPtr2 if v231 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v232)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v232)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v232)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v232)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v232 + 64)) += int64(v231) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(catchRange)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v234 = envPtr2 + 152 v233 = *(*uintptr)(unsafe.Pointer(v234)) *(*uintptr)(unsafe.Pointer(v234))++ *(*uint8)(unsafe.Pointer(v233)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v235 = delta1 v236 = envPtr2 if v235 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v236)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v236)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v236)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v236)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v236 + 64)) += int64(v235) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v238 = envPtr2 + 152 v237 = *(*uintptr)(unsafe.Pointer(v238)) *(*uintptr)(unsafe.Pointer(v238))++ *(*uint8)(unsafe.Pointer(v237)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v239 = delta1 v240 = envPtr2 if v239 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v240)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v240)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v240)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v240)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v240 + 64)) += int64(v239) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v242 = envPtr2 + 152 v241 = *(*uintptr)(unsafe.Pointer(v242)) *(*uintptr)(unsafe.Pointer(v242))++ *(*uint8)(unsafe.Pointer(v241)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v243 = delta1 v244 = envPtr2 if v243 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v244)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v244)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v244)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v244)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v244 + 64)) += int64(v243) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v246 = envPtr2 + 152 v245 = *(*uintptr)(unsafe.Pointer(v246)) *(*uintptr)(unsafe.Pointer(v246))++ *(*uint8)(unsafe.Pointer(v245)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v248 = envPtr2 + 152 v247 = *(*uintptr)(unsafe.Pointer(v248)) *(*uintptr)(unsafe.Pointer(v248))++ *(*uint8)(unsafe.Pointer(v247)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v249 = delta1 v250 = envPtr2 if v249 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v250)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v250)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v250)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v250)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v250 + 64)) += int64(v249) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v252 = envPtr2 + 152 v251 = *(*uintptr)(unsafe.Pointer(v252)) *(*uintptr)(unsafe.Pointer(v252))++ *(*uint8)(unsafe.Pointer(v251)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v254 = envPtr2 + 152 v253 = *(*uintptr)(unsafe.Pointer(v254)) *(*uintptr)(unsafe.Pointer(v254))++ *(*uint8)(unsafe.Pointer(v253)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v256 = envPtr2 + 152 v255 = *(*uintptr)(unsafe.Pointer(v256)) *(*uintptr)(unsafe.Pointer(v256))++ *(*uint8)(unsafe.Pointer(v255)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v258 = envPtr2 + 152 v257 = *(*uintptr)(unsafe.Pointer(v258)) *(*uintptr)(unsafe.Pointer(v258))++ *(*uint8)(unsafe.Pointer(v257)) = uint8(libc.Uint32FromInt32(infoIndex)) if collect == int32(TCL_EACH_COLLECT) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v260 = envPtr2 + 152 v259 = *(*uintptr)(unsafe.Pointer(v260)) *(*uintptr)(unsafe.Pointer(v260))++ *(*uint8)(unsafe.Pointer(v259)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v262 = envPtr2 + 152 v261 = *(*uintptr)(unsafe.Pointer(v262)) *(*uintptr)(unsafe.Pointer(v262))++ *(*uint8)(unsafe.Pointer(v261)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v263 = delta1 v264 = envPtr2 if v263 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v264)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v264)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v264)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v264)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v264 + 64)) += int64(v263) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v266 = envPtr2 + 152 v265 = *(*uintptr)(unsafe.Pointer(v266)) *(*uintptr)(unsafe.Pointer(v266))++ *(*uint8)(unsafe.Pointer(v265)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(24)) v268 = envPtr2 + 152 v267 = *(*uintptr)(unsafe.Pointer(v268)) *(*uintptr)(unsafe.Pointer(v268))++ *(*uint8)(unsafe.Pointer(v267)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(16)) v270 = envPtr2 + 152 v269 = *(*uintptr)(unsafe.Pointer(v270)) *(*uintptr)(unsafe.Pointer(v270))++ *(*uint8)(unsafe.Pointer(v269)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(8)) v272 = envPtr2 + 152 v271 = *(*uintptr)(unsafe.Pointer(v272)) *(*uintptr)(unsafe.Pointer(v272))++ *(*uint8)(unsafe.Pointer(v271)) = uint8(libc.Uint32FromInt32(collectVar)) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v274 = envPtr2 + 152 v273 = *(*uintptr)(unsafe.Pointer(v274)) *(*uintptr)(unsafe.Pointer(v274))++ *(*uint8)(unsafe.Pointer(v273)) = libc.Uint8FromInt32(int32(INST_RETURN_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RETURN_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v275 = delta1 v276 = envPtr2 if v275 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v276)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v276)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v276)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v276)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v276 + 64)) += int64(v275) } /* * Otherwise we're done (the jump after the DICT_FIRST points here) and we * need to pop the bogus key/value pair (pushed to keep stack calculations * easy!) Note that we skip the END_CATCH. [Bug 1382528] */ jumpDisplacement = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(emptyTargetOffset)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(emptyTargetOffset))) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE4)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(emptyTargetOffset) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDisplacement) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(emptyTargetOffset) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDisplacement) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(emptyTargetOffset) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(jumpDisplacement) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(emptyTargetOffset) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(jumpDisplacement)) jumpDisplacement = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(endTargetOffset)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(endTargetOffset))) = libc.Uint8FromInt32(int32(INST_JUMP1)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(endTargetOffset) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDisplacement)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v278 = envPtr2 + 152 v277 = *(*uintptr)(unsafe.Pointer(v278)) *(*uintptr)(unsafe.Pointer(v278))++ *(*uint8)(unsafe.Pointer(v277)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v279 = delta1 v280 = envPtr2 if v279 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v280)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v280)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v280)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v280)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v280 + 64)) += int64(v279) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v282 = envPtr2 + 152 v281 = *(*uintptr)(unsafe.Pointer(v282)) *(*uintptr)(unsafe.Pointer(v282))++ *(*uint8)(unsafe.Pointer(v281)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v283 = delta1 v284 = envPtr2 if v283 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v284)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v284)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v284)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v284)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v284 + 64)) += int64(v283) } (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(loopRange)*56))).FbreakOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) XTclFinalizeLoopExceptionRange(tls, envPtr2, loopRange) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v286 = envPtr2 + 152 v285 = *(*uintptr)(unsafe.Pointer(v286)) *(*uintptr)(unsafe.Pointer(v286))++ *(*uint8)(unsafe.Pointer(v285)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v287 = delta1 v288 = envPtr2 if v287 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v288)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v288)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v288)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v288)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v288 + 64)) += int64(v287) } /* * Final stage of the command (normal case) is that we push an empty * object (or push the accumulator as the result object). This is done * last to promote peephole optimization when it's dropped immediately. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v290 = envPtr2 + 152 v289 = *(*uintptr)(unsafe.Pointer(v290)) *(*uintptr)(unsafe.Pointer(v290))++ *(*uint8)(unsafe.Pointer(v289)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v292 = envPtr2 + 152 v291 = *(*uintptr)(unsafe.Pointer(v292)) *(*uintptr)(unsafe.Pointer(v292))++ *(*uint8)(unsafe.Pointer(v291)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v293 = delta1 v294 = envPtr2 if v293 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v294)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v294)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v294)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v294)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v294 + 64)) += int64(v293) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v296 = envPtr2 + 152 v295 = *(*uintptr)(unsafe.Pointer(v296)) *(*uintptr)(unsafe.Pointer(v296))++ *(*uint8)(unsafe.Pointer(v295)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v298 = envPtr2 + 152 v297 = *(*uintptr)(unsafe.Pointer(v298)) *(*uintptr)(unsafe.Pointer(v298))++ *(*uint8)(unsafe.Pointer(v297)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v300 = envPtr2 + 152 v299 = *(*uintptr)(unsafe.Pointer(v300)) *(*uintptr)(unsafe.Pointer(v300))++ *(*uint8)(unsafe.Pointer(v299)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v302 = envPtr2 + 152 v301 = *(*uintptr)(unsafe.Pointer(v302)) *(*uintptr)(unsafe.Pointer(v302))++ *(*uint8)(unsafe.Pointer(v301)) = uint8(libc.Uint32FromInt32(infoIndex)) if collect == int32(TCL_EACH_COLLECT) { if collectVar <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v304 = envPtr2 + 152 v303 = *(*uintptr)(unsafe.Pointer(v304)) *(*uintptr)(unsafe.Pointer(v304))++ *(*uint8)(unsafe.Pointer(v303)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v306 = envPtr2 + 152 v305 = *(*uintptr)(unsafe.Pointer(v306)) *(*uintptr)(unsafe.Pointer(v306))++ *(*uint8)(unsafe.Pointer(v305)) = uint8(libc.Uint32FromInt32(collectVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - collectVar } v307 = delta1 v308 = envPtr2 if v307 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v308)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v308)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v308)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v308)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v308 + 64)) += int64(v307) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v310 = envPtr2 + 152 v309 = *(*uintptr)(unsafe.Pointer(v310)) *(*uintptr)(unsafe.Pointer(v310))++ *(*uint8)(unsafe.Pointer(v309)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v312 = envPtr2 + 152 v311 = *(*uintptr)(unsafe.Pointer(v312)) *(*uintptr)(unsafe.Pointer(v312))++ *(*uint8)(unsafe.Pointer(v311)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(24)) v314 = envPtr2 + 152 v313 = *(*uintptr)(unsafe.Pointer(v314)) *(*uintptr)(unsafe.Pointer(v314))++ *(*uint8)(unsafe.Pointer(v313)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(16)) v316 = envPtr2 + 152 v315 = *(*uintptr)(unsafe.Pointer(v316)) *(*uintptr)(unsafe.Pointer(v316))++ *(*uint8)(unsafe.Pointer(v315)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(8)) v318 = envPtr2 + 152 v317 = *(*uintptr)(unsafe.Pointer(v318)) *(*uintptr)(unsafe.Pointer(v318))++ *(*uint8)(unsafe.Pointer(v317)) = uint8(libc.Uint32FromInt32(collectVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - collectVar } v319 = delta1 v320 = envPtr2 if v319 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v320)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v320)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v320)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v320)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v320 + 64)) += int64(v319) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v322 = envPtr2 + 152 v321 = *(*uintptr)(unsafe.Pointer(v322)) *(*uintptr)(unsafe.Pointer(v322))++ *(*uint8)(unsafe.Pointer(v321)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v324 = envPtr2 + 152 v323 = *(*uintptr)(unsafe.Pointer(v324)) *(*uintptr)(unsafe.Pointer(v324))++ *(*uint8)(unsafe.Pointer(v323)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v325 = delta1 v326 = envPtr2 if v325 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v326)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v326)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v326)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v326)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v326 + 64)) += int64(v325) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v328 = envPtr2 + 152 v327 = *(*uintptr)(unsafe.Pointer(v328)) *(*uintptr)(unsafe.Pointer(v328))++ *(*uint8)(unsafe.Pointer(v327)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(24)) v330 = envPtr2 + 152 v329 = *(*uintptr)(unsafe.Pointer(v330)) *(*uintptr)(unsafe.Pointer(v330))++ *(*uint8)(unsafe.Pointer(v329)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(16)) v332 = envPtr2 + 152 v331 = *(*uintptr)(unsafe.Pointer(v332)) *(*uintptr)(unsafe.Pointer(v332))++ *(*uint8)(unsafe.Pointer(v331)) = uint8(libc.Uint32FromInt32(collectVar) >> libc.Int32FromInt32(8)) v334 = envPtr2 + 152 v333 = *(*uintptr)(unsafe.Pointer(v334)) *(*uintptr)(unsafe.Pointer(v334))++ *(*uint8)(unsafe.Pointer(v333)) = uint8(libc.Uint32FromInt32(collectVar)) } else { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v336 = envPtr2 + 152 v335 = *(*uintptr)(unsafe.Pointer(v336)) *(*uintptr)(unsafe.Pointer(v336))++ *(*uint8)(unsafe.Pointer(v335)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v338 = envPtr2 + 152 v337 = *(*uintptr)(unsafe.Pointer(v338)) *(*uintptr)(unsafe.Pointer(v338))++ *(*uint8)(unsafe.Pointer(v337)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v339 = delta1 v340 = envPtr2 if v339 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v340 + 64)) += int64(v339) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v342 = envPtr2 + 152 v341 = *(*uintptr)(unsafe.Pointer(v342)) *(*uintptr)(unsafe.Pointer(v342))++ *(*uint8)(unsafe.Pointer(v341)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v344 = envPtr2 + 152 v343 = *(*uintptr)(unsafe.Pointer(v344)) *(*uintptr)(unsafe.Pointer(v344))++ *(*uint8)(unsafe.Pointer(v343)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v346 = envPtr2 + 152 v345 = *(*uintptr)(unsafe.Pointer(v346)) *(*uintptr)(unsafe.Pointer(v346))++ *(*uint8)(unsafe.Pointer(v345)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v348 = envPtr2 + 152 v347 = *(*uintptr)(unsafe.Pointer(v348)) *(*uintptr)(unsafe.Pointer(v348))++ *(*uint8)(unsafe.Pointer(v347)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v350 = envPtr2 + 152 v349 = *(*uintptr)(unsafe.Pointer(v350)) *(*uintptr)(unsafe.Pointer(v350))++ *(*uint8)(unsafe.Pointer(v349)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v351 = delta1 v352 = envPtr2 if v351 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v352)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v352)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v352)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v352)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v352 + 64)) += int64(v351) } } } return TCL_OK } func XTclCompileDictUpdateCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Holds resulting instructions. */ var _objIndexCopy, delta1, dictIndex, i1, infoIndex, numVars, range1, v104, v108, v112, v124, v136, v19, v31, v43, v63, v68, v7, v80, v92 int32 var bodyTokenPtr, dictVarTokenPtr, duiPtr, keyTokenPtrs, mapPtr, tokenPtr, v10, v100, v101, v102, v103, v105, v106, v107, v109, v11, v110, v111, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v15, v16, v17, v18, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v66, v67, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v95, v96, v97, v98, v99 uintptr var eclIndex TTcl_Size var v65 int64 var _ /* jumpFixup at bp+0 */ TJumpFixup _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, bodyTokenPtr, delta1, dictIndex, dictVarTokenPtr, duiPtr, eclIndex, i1, infoIndex, keyTokenPtrs, mapPtr, numVars, range1, tokenPtr, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * There must be at least one argument after the command. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(5) { return int32(TCL_ERROR) } /* * Parse the command. Expect the following: * dict update ? ...? */ if (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-int32(1))&int32(1) != 0 { return int32(TCL_ERROR) } numVars = int32(((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - int64(3)) / int64(2)) /* * The dictionary variable must be a local scalar that is knowable at * compile time; anything else exceeds the complexity of the opcode. So * discover what the index is. */ dictVarTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 dictIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, dictVarTokenPtr, envPtr2)) if dictIndex < 0 { goto issueFallback } /* * Assemble the instruction metadata. This is complex enough that it is * represented as auxData; it holds an ordered list of variable indices * that are to be used. */ duiPtr = XTcl_Alloc(tls, uint64(libc.UintptrFromInt32(0)+8)+uint64(8)*libc.Uint64FromInt32(numVars)) (*TDictUpdateInfo)(unsafe.Pointer(duiPtr)).Flength = int64(numVars) keyTokenPtrs = XTclStackAlloc(tls, interp, uint64(8)*libc.Uint64FromInt32(numVars)) tokenPtr = dictVarTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(dictVarTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = 0 for { if !(i1 < numVars) { break } /* * Put keys to one side for later compilation to bytecode. */ *(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i1)*8)) = tokenPtr tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * Stash the index in the auxiliary data (if it is indeed a local * scalar that is resolvable at compile-time). */ *(*TTcl_Size)(unsafe.Pointer(duiPtr + 8 + uintptr(i1)*8)) = libc.Int64FromUint64(XTclLocalScalarFromToken(tls, tokenPtr, envPtr2)) if *(*TTcl_Size)(unsafe.Pointer(duiPtr + 8 + uintptr(i1)*8)) == int64(-libc.Int32FromInt32(1)) { goto failedUpdateInfoAssembly } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { goto failedUpdateInfoAssembly } bodyTokenPtr = tokenPtr /* * The list of variables to bind is stored in auxiliary data so that it * can't be snagged by literal sharing and forced to shimmer dangerously. */ infoIndex = int32(XTclCreateAuxData(tls, duiPtr, uintptr(unsafe.Pointer(&_dictUpdateInfoType)), envPtr2)) i1 = 0 for { if !(i1 < numVars) { break } if (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i1)*8)))).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i1)*8)) + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i1)*8)) + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v7 = delta1 v8 = envPtr2 if v7 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v8)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v8)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v8)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v8)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v8 + 64)) += int64(v7) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v19 = delta1 v20 = envPtr2 if v19 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v20 + 64)) += int64(v19) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(libc.Int32FromInt32(2)*i1+libc.Int32FromInt32(2))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(libc.Int32FromInt32(2)*i1+libc.Int32FromInt32(2))*8)) XTclCompileTokens(tls, interp, *(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i1)*8))+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyTokenPtrs + uintptr(i1)*8)))).FnumComponents), envPtr2) } goto _2 _2: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = libc.Uint8FromInt32(int32(INST_LIST)) v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = uint8(libc.Uint32FromInt32(numVars) >> libc.Int32FromInt32(24)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(numVars) >> libc.Int32FromInt32(16)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(numVars) >> libc.Int32FromInt32(8)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(numVars)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - numVars } v31 = delta1 v32 = envPtr2 if v31 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v32)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v32)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v32)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v32)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v32 + 64)) += int64(v31) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = libc.Uint8FromInt32(int32(INST_DICT_UPDATE_START)) v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = uint8(libc.Uint32FromInt32(dictIndex) >> libc.Int32FromInt32(24)) v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = uint8(libc.Uint32FromInt32(dictIndex) >> libc.Int32FromInt32(16)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(dictIndex) >> libc.Int32FromInt32(8)) v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = uint8(libc.Uint32FromInt32(dictIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_UPDATE_START)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictIndex } v43 = delta1 v44 = envPtr2 if v43 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v44 + 64)) += int64(v43) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(infoIndex)) range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v63 = delta1 v64 = envPtr2 if v63 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v64 + 64)) += int64(v63) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v65 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v65 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v65 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1))*8)) XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) /* * Normal termination code: the stack has the key list below the result of * the body evaluation: swap them and finish the update code. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v68 = delta1 v69 = envPtr2 if v68 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v69 + 64)) += int64(v68) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v80 = delta1 v81 = envPtr2 if v80 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v81)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v81)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v81)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v81)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v81 + 64)) += int64(v80) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v83 = envPtr2 + 152 v82 = *(*uintptr)(unsafe.Pointer(v83)) *(*uintptr)(unsafe.Pointer(v83))++ *(*uint8)(unsafe.Pointer(v82)) = libc.Uint8FromInt32(int32(INST_DICT_UPDATE_END)) v85 = envPtr2 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = uint8(libc.Uint32FromInt32(dictIndex) >> libc.Int32FromInt32(24)) v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = uint8(libc.Uint32FromInt32(dictIndex) >> libc.Int32FromInt32(16)) v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = uint8(libc.Uint32FromInt32(dictIndex) >> libc.Int32FromInt32(8)) v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(dictIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_UPDATE_END)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictIndex } v92 = delta1 v93 = envPtr2 if v92 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v93 + 64)) += int64(v92) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v95 = envPtr2 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v101 = envPtr2 + 152 v100 = *(*uintptr)(unsafe.Pointer(v101)) *(*uintptr)(unsafe.Pointer(v101))++ *(*uint8)(unsafe.Pointer(v100)) = uint8(libc.Uint32FromInt32(infoIndex)) /* * Jump around the exceptional termination code. */ XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp) /* * Termination code for non-ok returns: stash the result and return * options in the stack, bring up the key list, finish the update code, * and finally return with the caught return data */ (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v104 = delta1 v105 = envPtr2 if v104 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v105)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v105)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v105)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v105)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v105 + 64)) += int64(v104) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v107 = envPtr2 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v108 = delta1 v109 = envPtr2 if v108 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v109)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v109)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v109)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v109)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v109 + 64)) += int64(v108) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v111 = envPtr2 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v112 = delta1 v113 = envPtr2 if v112 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v113 + 64)) += int64(v112) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v119 = envPtr2 + 152 v118 = *(*uintptr)(unsafe.Pointer(v119)) *(*uintptr)(unsafe.Pointer(v119))++ *(*uint8)(unsafe.Pointer(v118)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v123 = envPtr2 + 152 v122 = *(*uintptr)(unsafe.Pointer(v123)) *(*uintptr)(unsafe.Pointer(v123))++ *(*uint8)(unsafe.Pointer(v122)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v124 = delta1 v125 = envPtr2 if v124 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v125 + 64)) += int64(v124) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v127 = envPtr2 + 152 v126 = *(*uintptr)(unsafe.Pointer(v127)) *(*uintptr)(unsafe.Pointer(v127))++ *(*uint8)(unsafe.Pointer(v126)) = libc.Uint8FromInt32(int32(INST_DICT_UPDATE_END)) v129 = envPtr2 + 152 v128 = *(*uintptr)(unsafe.Pointer(v129)) *(*uintptr)(unsafe.Pointer(v129))++ *(*uint8)(unsafe.Pointer(v128)) = uint8(libc.Uint32FromInt32(dictIndex) >> libc.Int32FromInt32(24)) v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = uint8(libc.Uint32FromInt32(dictIndex) >> libc.Int32FromInt32(16)) v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = uint8(libc.Uint32FromInt32(dictIndex) >> libc.Int32FromInt32(8)) v135 = envPtr2 + 152 v134 = *(*uintptr)(unsafe.Pointer(v135)) *(*uintptr)(unsafe.Pointer(v135))++ *(*uint8)(unsafe.Pointer(v134)) = uint8(libc.Uint32FromInt32(dictIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_UPDATE_END)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictIndex } v136 = delta1 v137 = envPtr2 if v136 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v137 + 64)) += int64(v136) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v141 = envPtr2 + 152 v140 = *(*uintptr)(unsafe.Pointer(v141)) *(*uintptr)(unsafe.Pointer(v141))++ *(*uint8)(unsafe.Pointer(v140)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v143 = envPtr2 + 152 v142 = *(*uintptr)(unsafe.Pointer(v143)) *(*uintptr)(unsafe.Pointer(v143))++ *(*uint8)(unsafe.Pointer(v142)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v145 = envPtr2 + 152 v144 = *(*uintptr)(unsafe.Pointer(v145)) *(*uintptr)(unsafe.Pointer(v145))++ *(*uint8)(unsafe.Pointer(v144)) = uint8(libc.Uint32FromInt32(infoIndex)) XTclEmitInvoke(tls, envPtr2, int32(INST_RETURN_STK), 0) if XTclFixupForwardJump(tls, envPtr2, bp, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+21568, libc.VaList(bp+24, int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp))).FcodeOffset))) } XTclStackFree(tls, interp, keyTokenPtrs) return TCL_OK /* * Clean up after a failure to create the DictUpdateInfo structure. */ goto failedUpdateInfoAssembly failedUpdateInfoAssembly: ; XTclpFree(tls, duiPtr) XTclStackFree(tls, interp, keyTokenPtrs) goto issueFallback issueFallback: ; return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) return r } func XTclCompileDictAppendCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, dictVarIndex, i1, v18, v24, v36, v6 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v4, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, dictVarIndex, eclIndex, i1, mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * There must be at least two argument after the command. And we impose an * (arbitrary) safe limit; anyone exceeding it should stop worrying about * speed quite so much. ;-) */ /* TODO: Consider support for compiling expanded args. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(4) || int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(100) { return int32(TCL_ERROR) } /* * Get the index of the local variable that we will be working with. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 dictVarIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, tokenPtr, envPtr2)) if dictVarIndex < 0 { return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } /* * Produce the string to concatenate onto the dictionary entry. */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(2) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(4) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - int32(3)) } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } /* * Do the concatenation. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_DICT_APPEND)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(dictVarIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_APPEND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVarIndex } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } return TCL_OK } func XTclCompileDictLappendCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, dictVarIndex, v17, v23, v35, v47, v5 int32 var eclIndex TTcl_Size var keyTokenPtr, mapPtr, valueTokenPtr, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v48, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, dictVarIndex, eclIndex, keyTokenPtr, mapPtr, valueTokenPtr, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * There must be three arguments after the command. */ /* TODO: Consider support for compiling expanded args. */ /* Probably not. Why is INST_DICT_LAPPEND limited to one value? */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(4) { return int32(TCL_ERROR) } /* * Parse the arguments. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 keyTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 valueTokenPtr = keyTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(keyTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 dictVarIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, varTokenPtr, envPtr2)) if dictVarIndex < 0 { return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } /* * Issue the implementation. */ if (*TTcl_Token)(unsafe.Pointer(keyTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(keyTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(keyTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, keyTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(keyTokenPtr)).FnumComponents), envPtr2) } if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_DICT_LAPPEND)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(24)) v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(16)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(dictVarIndex) >> libc.Int32FromInt32(8)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(dictVarIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_LAPPEND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVarIndex } v47 = delta1 v48 = envPtr2 if v47 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v48 + 64)) += int64(v47) } return TCL_OK } func XTclCompileDictWithCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy10, _objIndexCopy11, _objIndexCopy12, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objIndexCopy7, _objIndexCopy8, _objIndexCopy9, bodyIsEmpty, delta1, dictVar, gotPath, i1, keysTmp, pathTmp, range1, varNameTmp, v102, v114, v120, v132, v136, v148, v155, v167, v179, v191, v195, v20, v207, v211, v215, v221, v233, v237, v241, v247, v259, v263, v269, v281, v293, v297, v303, v315, v32, v321, v333, v339, v351, v358, v370, v38, v382, v388, v400, v404, v408, v414, v426, v432, v444, v450, v462, v466, v472, v484, v488, v50, v500, v505, v511, v523, v529, v541, v547, v559, v565, v577, v581, v593, v595, v599, v603, v607, v613, v62, v625, v631, v643, v649, v66, v661, v667, v679, v683, v695, v78, v8, v84, v96 int32 var eclIndex TTcl_Size var end, mapPtr, ptr, tokenPtr, varTokenPtr, v10, v100, v101, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v115, v116, v117, v118, v119, v12, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v133, v134, v135, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v149, v15, v151, v152, v153, v154, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v192, v193, v194, v196, v197, v198, v199, v200, v201, v202, v203, v204, v205, v206, v208, v209, v21, v210, v212, v213, v214, v216, v217, v218, v219, v22, v220, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v232, v234, v235, v236, v238, v239, v24, v240, v242, v243, v244, v245, v246, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v26, v260, v261, v262, v264, v265, v266, v267, v268, v27, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v28, v280, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v292, v294, v295, v296, v298, v299, v30, v300, v301, v302, v304, v305, v306, v307, v308, v309, v31, v310, v311, v312, v313, v314, v316, v317, v318, v319, v320, v322, v323, v324, v325, v326, v327, v328, v329, v33, v330, v331, v332, v334, v335, v336, v337, v338, v34, v340, v341, v342, v343, v344, v345, v346, v347, v348, v349, v35, v350, v352, v354, v355, v356, v357, v359, v36, v360, v361, v362, v363, v364, v365, v366, v367, v368, v369, v37, v371, v372, v373, v374, v375, v376, v377, v378, v379, v380, v381, v383, v384, v385, v386, v387, v389, v39, v390, v391, v392, v393, v394, v395, v396, v397, v398, v399, v4, v40, v401, v402, v403, v405, v406, v407, v409, v41, v410, v411, v412, v413, v415, v416, v417, v418, v419, v42, v420, v421, v422, v423, v424, v425, v427, v428, v429, v43, v430, v431, v433, v434, v435, v436, v437, v438, v439, v44, v440, v441, v442, v443, v445, v446, v447, v448, v449, v45, v451, v452, v453, v454, v455, v456, v457, v458, v459, v46, v460, v461, v463, v464, v465, v467, v468, v469, v47, v470, v471, v473, v474, v475, v476, v477, v478, v479, v48, v480, v481, v482, v483, v485, v486, v487, v489, v49, v490, v491, v492, v493, v494, v495, v496, v497, v498, v499, v5, v501, v503, v504, v506, v507, v508, v509, v51, v510, v512, v513, v514, v515, v516, v517, v518, v519, v52, v520, v521, v522, v524, v525, v526, v527, v528, v53, v530, v531, v532, v533, v534, v535, v536, v537, v538, v539, v54, v540, v542, v543, v544, v545, v546, v548, v549, v55, v550, v551, v552, v553, v554, v555, v556, v557, v558, v56, v560, v561, v562, v563, v564, v566, v567, v568, v569, v57, v570, v571, v572, v573, v574, v575, v576, v578, v579, v58, v580, v582, v583, v584, v585, v586, v587, v588, v589, v59, v590, v591, v592, v594, v596, v597, v598, v6, v60, v600, v601, v602, v604, v605, v606, v608, v609, v61, v610, v611, v612, v614, v615, v616, v617, v618, v619, v620, v621, v622, v623, v624, v626, v627, v628, v629, v63, v630, v632, v633, v634, v635, v636, v637, v638, v639, v64, v640, v641, v642, v644, v645, v646, v647, v648, v65, v650, v651, v652, v653, v654, v655, v656, v657, v658, v659, v660, v662, v663, v664, v665, v666, v668, v669, v67, v670, v671, v672, v673, v674, v675, v676, v677, v678, v68, v680, v681, v682, v684, v685, v686, v687, v688, v689, v69, v690, v691, v692, v693, v694, v696, v7, v70, v71, v72, v73, v74, v75, v76, v77, v79, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v97, v98, v99 uintptr var v502 int64 var _ /* jumpFixup at bp+0 */ TJumpFixup _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy10, _objIndexCopy11, _objIndexCopy12, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objIndexCopy7, _objIndexCopy8, _objIndexCopy9, bodyIsEmpty, delta1, dictVar, eclIndex, end, gotPath, i1, keysTmp, mapPtr, pathTmp, ptr, range1, tokenPtr, varNameTmp, varTokenPtr, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v28, v280, v281, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v292, v293, v294, v295, v296, v297, v298, v299, v30, v300, v301, v302, v303, v304, v305, v306, v307, v308, v309, v31, v310, v311, v312, v313, v314, v315, v316, v317, v318, v319, v32, v320, v321, v322, v323, v324, v325, v326, v327, v328, v329, v33, v330, v331, v332, v333, v334, v335, v336, v337, v338, v339, v34, v340, v341, v342, v343, v344, v345, v346, v347, v348, v349, v35, v350, v351, v352, v354, v355, v356, v357, v358, v359, v36, v360, v361, v362, v363, v364, v365, v366, v367, v368, v369, v37, v370, v371, v372, v373, v374, v375, v376, v377, v378, v379, v38, v380, v381, v382, v383, v384, v385, v386, v387, v388, v389, v39, v390, v391, v392, v393, v394, v395, v396, v397, v398, v399, v4, v40, v400, v401, v402, v403, v404, v405, v406, v407, v408, v409, v41, v410, v411, v412, v413, v414, v415, v416, v417, v418, v419, v42, v420, v421, v422, v423, v424, v425, v426, v427, v428, v429, v43, v430, v431, v432, v433, v434, v435, v436, v437, v438, v439, v44, v440, v441, v442, v443, v444, v445, v446, v447, v448, v449, v45, v450, v451, v452, v453, v454, v455, v456, v457, v458, v459, v46, v460, v461, v462, v463, v464, v465, v466, v467, v468, v469, v47, v470, v471, v472, v473, v474, v475, v476, v477, v478, v479, v48, v480, v481, v482, v483, v484, v485, v486, v487, v488, v489, v49, v490, v491, v492, v493, v494, v495, v496, v497, v498, v499, v5, v50, v500, v501, v502, v503, v504, v505, v506, v507, v508, v509, v51, v510, v511, v512, v513, v514, v515, v516, v517, v518, v519, v52, v520, v521, v522, v523, v524, v525, v526, v527, v528, v529, v53, v530, v531, v532, v533, v534, v535, v536, v537, v538, v539, v54, v540, v541, v542, v543, v544, v545, v546, v547, v548, v549, v55, v550, v551, v552, v553, v554, v555, v556, v557, v558, v559, v56, v560, v561, v562, v563, v564, v565, v566, v567, v568, v569, v57, v570, v571, v572, v573, v574, v575, v576, v577, v578, v579, v58, v580, v581, v582, v583, v584, v585, v586, v587, v588, v589, v59, v590, v591, v592, v593, v594, v595, v596, v597, v598, v599, v6, v60, v600, v601, v602, v603, v604, v605, v606, v607, v608, v609, v61, v610, v611, v612, v613, v614, v615, v616, v617, v618, v619, v62, v620, v621, v622, v623, v624, v625, v626, v627, v628, v629, v63, v630, v631, v632, v633, v634, v635, v636, v637, v638, v639, v64, v640, v641, v642, v643, v644, v645, v646, v647, v648, v649, v65, v650, v651, v652, v653, v654, v655, v656, v657, v658, v659, v66, v660, v661, v662, v663, v664, v665, v666, v667, v668, v669, v67, v670, v671, v672, v673, v674, v675, v676, v677, v678, v679, v68, v680, v681, v682, v683, v684, v685, v686, v687, v688, v689, v69, v690, v691, v692, v693, v694, v695, v696, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) varNameTmp = -int32(1) pathTmp = -int32(1) bodyIsEmpty = int32(1) /* * There must be at least one argument after the command. */ /* TODO: Consider support for compiling expanded args. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) { return int32(TCL_ERROR) } /* * Parse the command (trivially). Expect the following: * dict with ? ...? */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 tokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(3) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } /* * Test if the last word is an empty script; if so, we can compile it in * all cases, but if it is non-empty we need local variable table entries * to hold the temporary variables (used to keep stack usage simple). */ ptr = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart end = ptr + uintptr((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize) for { if !(ptr != end) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ptr))) != int32(' ') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ptr))) != int32('\t') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ptr))) != int32('\n') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(ptr))) != int32('\r') { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr == libc.UintptrFromInt32(0) { return XTclCompileBasicMin2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } bodyIsEmpty = 0 break } goto _2 _2: ; ptr++ } /* * Determine if we're manipulating a dict in a simple local variable. */ gotPath = libc.BoolInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(3)) dictVar = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, varTokenPtr, envPtr2)) /* * Special case: an empty body means we definitely have no need to issue * try-finally style code or to allocate local variable table entries for * storing temporaries. Still need to do both INST_DICT_EXPAND and * INST_DICT_RECOMBINE_* though, because we can't determine if we're free * of traces. */ if bodyIsEmpty != 0 { if dictVar >= 0 { if gotPath != 0 { /* * Case: Path into dict in LVT with empty body. */ tokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(2) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-int32(1)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v8 = delta1 v9 = envPtr2 if v8 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v9 + 64)) += int64(v8) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v20 = delta1 v21 = envPtr2 if v20 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v21 + 64)) += int64(v20) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _3 _3: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = libc.Uint8FromInt32(int32(INST_LIST)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - int32(3)) } v32 = delta1 v33 = envPtr2 if v32 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v33 + 64)) += int64(v32) } if dictVar <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v38 = delta1 v39 = envPtr2 if v38 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v39 + 64)) += int64(v38) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(24)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(16)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(8)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v50 = delta1 v51 = envPtr2 if v50 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v51 + 64)) += int64(v50) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = libc.Uint8FromInt32(int32(INST_OVER)) v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v62 = delta1 v63 = envPtr2 if v62 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v63)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v63)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v63)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v63)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v63 + 64)) += int64(v62) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = libc.Uint8FromInt32(int32(INST_DICT_EXPAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_EXPAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v66 = delta1 v67 = envPtr2 if v66 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v67 + 64)) += int64(v66) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = libc.Uint8FromInt32(int32(INST_DICT_RECOMBINE_IMM)) v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(24)) v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(16)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(8)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_RECOMBINE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v78 = delta1 v79 = envPtr2 if v78 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v79)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v79)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v79)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v79)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v79 + 64)) += int64(v78) } } else { /* * Case: Direct dict in LVT with empty body. */ _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v83 = envPtr2 + 152 v82 = *(*uintptr)(unsafe.Pointer(v83)) *(*uintptr)(unsafe.Pointer(v83))++ *(*uint8)(unsafe.Pointer(v82)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v84 = delta1 v85 = envPtr2 if v84 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v85)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v85)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v85)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v85)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v85 + 64)) += int64(v84) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v93 = envPtr2 + 152 v92 = *(*uintptr)(unsafe.Pointer(v93)) *(*uintptr)(unsafe.Pointer(v93))++ *(*uint8)(unsafe.Pointer(v92)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v95 = envPtr2 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v96 = delta1 v97 = envPtr2 if v96 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v97)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v97)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v97)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v97)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v97 + 64)) += int64(v96) } } if dictVar <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v101 = envPtr2 + 152 v100 = *(*uintptr)(unsafe.Pointer(v101)) *(*uintptr)(unsafe.Pointer(v101))++ *(*uint8)(unsafe.Pointer(v100)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v102 = delta1 v103 = envPtr2 if v102 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v103)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v103)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v103)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v103)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v103 + 64)) += int64(v102) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v107 = envPtr2 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(24)) v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(16)) v111 = envPtr2 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(8)) v113 = envPtr2 + 152 v112 = *(*uintptr)(unsafe.Pointer(v113)) *(*uintptr)(unsafe.Pointer(v113))++ *(*uint8)(unsafe.Pointer(v112)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v114 = delta1 v115 = envPtr2 if v114 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v115)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v115)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v115)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v115)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v115 + 64)) += int64(v114) } } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v119 = envPtr2 + 152 v118 = *(*uintptr)(unsafe.Pointer(v119)) *(*uintptr)(unsafe.Pointer(v119))++ *(*uint8)(unsafe.Pointer(v118)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v120 = delta1 v121 = envPtr2 if v120 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v121)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v121)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v121)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v121)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v121 + 64)) += int64(v120) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v123 = envPtr2 + 152 v122 = *(*uintptr)(unsafe.Pointer(v123)) *(*uintptr)(unsafe.Pointer(v123))++ *(*uint8)(unsafe.Pointer(v122)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v125 = envPtr2 + 152 v124 = *(*uintptr)(unsafe.Pointer(v125)) *(*uintptr)(unsafe.Pointer(v125))++ *(*uint8)(unsafe.Pointer(v124)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v127 = envPtr2 + 152 v126 = *(*uintptr)(unsafe.Pointer(v127)) *(*uintptr)(unsafe.Pointer(v127))++ *(*uint8)(unsafe.Pointer(v126)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v129 = envPtr2 + 152 v128 = *(*uintptr)(unsafe.Pointer(v129)) *(*uintptr)(unsafe.Pointer(v129))++ *(*uint8)(unsafe.Pointer(v128)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v132 = delta1 v133 = envPtr2 if v132 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v133)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v133)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v133)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v133)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v133 + 64)) += int64(v132) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v135 = envPtr2 + 152 v134 = *(*uintptr)(unsafe.Pointer(v135)) *(*uintptr)(unsafe.Pointer(v135))++ *(*uint8)(unsafe.Pointer(v134)) = libc.Uint8FromInt32(int32(INST_DICT_EXPAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_EXPAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v136 = delta1 v137 = envPtr2 if v136 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v137 + 64)) += int64(v136) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = libc.Uint8FromInt32(int32(INST_DICT_RECOMBINE_IMM)) v141 = envPtr2 + 152 v140 = *(*uintptr)(unsafe.Pointer(v141)) *(*uintptr)(unsafe.Pointer(v141))++ *(*uint8)(unsafe.Pointer(v140)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(24)) v143 = envPtr2 + 152 v142 = *(*uintptr)(unsafe.Pointer(v143)) *(*uintptr)(unsafe.Pointer(v143))++ *(*uint8)(unsafe.Pointer(v142)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(16)) v145 = envPtr2 + 152 v144 = *(*uintptr)(unsafe.Pointer(v145)) *(*uintptr)(unsafe.Pointer(v145))++ *(*uint8)(unsafe.Pointer(v144)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(8)) v147 = envPtr2 + 152 v146 = *(*uintptr)(unsafe.Pointer(v147)) *(*uintptr)(unsafe.Pointer(v147))++ *(*uint8)(unsafe.Pointer(v146)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_RECOMBINE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v148 = delta1 v149 = envPtr2 if v148 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v149)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v149)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v149)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v149)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v149 + 64)) += int64(v148) } } } else { if gotPath != 0 { /* * Case: Path into dict in non-simple var with empty body. */ tokenPtr = varTokenPtr i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-int32(1)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v152 = envPtr2 + 152 v151 = *(*uintptr)(unsafe.Pointer(v152)) *(*uintptr)(unsafe.Pointer(v152))++ *(*uint8)(unsafe.Pointer(v151)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v154 = envPtr2 + 152 v153 = *(*uintptr)(unsafe.Pointer(v154)) *(*uintptr)(unsafe.Pointer(v154))++ *(*uint8)(unsafe.Pointer(v153)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v155 = delta1 v156 = envPtr2 if v155 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v156)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v156)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v156)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v156)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v156 + 64)) += int64(v155) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v158 = envPtr2 + 152 v157 = *(*uintptr)(unsafe.Pointer(v158)) *(*uintptr)(unsafe.Pointer(v158))++ *(*uint8)(unsafe.Pointer(v157)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v160 = envPtr2 + 152 v159 = *(*uintptr)(unsafe.Pointer(v160)) *(*uintptr)(unsafe.Pointer(v160))++ *(*uint8)(unsafe.Pointer(v159)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v162 = envPtr2 + 152 v161 = *(*uintptr)(unsafe.Pointer(v162)) *(*uintptr)(unsafe.Pointer(v162))++ *(*uint8)(unsafe.Pointer(v161)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v164 = envPtr2 + 152 v163 = *(*uintptr)(unsafe.Pointer(v164)) *(*uintptr)(unsafe.Pointer(v164))++ *(*uint8)(unsafe.Pointer(v163)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v166 = envPtr2 + 152 v165 = *(*uintptr)(unsafe.Pointer(v166)) *(*uintptr)(unsafe.Pointer(v166))++ *(*uint8)(unsafe.Pointer(v165)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v167 = delta1 v168 = envPtr2 if v167 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v168)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v168)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v168)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v168)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v168 + 64)) += int64(v167) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _150 _150: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v170 = envPtr2 + 152 v169 = *(*uintptr)(unsafe.Pointer(v170)) *(*uintptr)(unsafe.Pointer(v170))++ *(*uint8)(unsafe.Pointer(v169)) = libc.Uint8FromInt32(int32(INST_LIST)) v172 = envPtr2 + 152 v171 = *(*uintptr)(unsafe.Pointer(v172)) *(*uintptr)(unsafe.Pointer(v172))++ *(*uint8)(unsafe.Pointer(v171)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v174 = envPtr2 + 152 v173 = *(*uintptr)(unsafe.Pointer(v174)) *(*uintptr)(unsafe.Pointer(v174))++ *(*uint8)(unsafe.Pointer(v173)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v176 = envPtr2 + 152 v175 = *(*uintptr)(unsafe.Pointer(v176)) *(*uintptr)(unsafe.Pointer(v176))++ *(*uint8)(unsafe.Pointer(v175)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v178 = envPtr2 + 152 v177 = *(*uintptr)(unsafe.Pointer(v178)) *(*uintptr)(unsafe.Pointer(v178))++ *(*uint8)(unsafe.Pointer(v177)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - int32(3)) } v179 = delta1 v180 = envPtr2 if v179 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v180)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v180)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v180)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v180)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v180 + 64)) += int64(v179) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v182 = envPtr2 + 152 v181 = *(*uintptr)(unsafe.Pointer(v182)) *(*uintptr)(unsafe.Pointer(v182))++ *(*uint8)(unsafe.Pointer(v181)) = libc.Uint8FromInt32(int32(INST_OVER)) v184 = envPtr2 + 152 v183 = *(*uintptr)(unsafe.Pointer(v184)) *(*uintptr)(unsafe.Pointer(v184))++ *(*uint8)(unsafe.Pointer(v183)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v186 = envPtr2 + 152 v185 = *(*uintptr)(unsafe.Pointer(v186)) *(*uintptr)(unsafe.Pointer(v186))++ *(*uint8)(unsafe.Pointer(v185)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v188 = envPtr2 + 152 v187 = *(*uintptr)(unsafe.Pointer(v188)) *(*uintptr)(unsafe.Pointer(v188))++ *(*uint8)(unsafe.Pointer(v187)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v190 = envPtr2 + 152 v189 = *(*uintptr)(unsafe.Pointer(v190)) *(*uintptr)(unsafe.Pointer(v190))++ *(*uint8)(unsafe.Pointer(v189)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v191 = delta1 v192 = envPtr2 if v191 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v192)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v192)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v192)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v192)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v192 + 64)) += int64(v191) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v194 = envPtr2 + 152 v193 = *(*uintptr)(unsafe.Pointer(v194)) *(*uintptr)(unsafe.Pointer(v194))++ *(*uint8)(unsafe.Pointer(v193)) = libc.Uint8FromInt32(int32(INST_LOAD_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v195 = delta1 v196 = envPtr2 if v195 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v196)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v196)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v196)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v196)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v196 + 64)) += int64(v195) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v198 = envPtr2 + 152 v197 = *(*uintptr)(unsafe.Pointer(v198)) *(*uintptr)(unsafe.Pointer(v198))++ *(*uint8)(unsafe.Pointer(v197)) = libc.Uint8FromInt32(int32(INST_OVER)) v200 = envPtr2 + 152 v199 = *(*uintptr)(unsafe.Pointer(v200)) *(*uintptr)(unsafe.Pointer(v200))++ *(*uint8)(unsafe.Pointer(v199)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v202 = envPtr2 + 152 v201 = *(*uintptr)(unsafe.Pointer(v202)) *(*uintptr)(unsafe.Pointer(v202))++ *(*uint8)(unsafe.Pointer(v201)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v204 = envPtr2 + 152 v203 = *(*uintptr)(unsafe.Pointer(v204)) *(*uintptr)(unsafe.Pointer(v204))++ *(*uint8)(unsafe.Pointer(v203)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v206 = envPtr2 + 152 v205 = *(*uintptr)(unsafe.Pointer(v206)) *(*uintptr)(unsafe.Pointer(v206))++ *(*uint8)(unsafe.Pointer(v205)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v207 = delta1 v208 = envPtr2 if v207 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v208)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v208)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v208)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v208)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v208 + 64)) += int64(v207) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v210 = envPtr2 + 152 v209 = *(*uintptr)(unsafe.Pointer(v210)) *(*uintptr)(unsafe.Pointer(v210))++ *(*uint8)(unsafe.Pointer(v209)) = libc.Uint8FromInt32(int32(INST_DICT_EXPAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_EXPAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v211 = delta1 v212 = envPtr2 if v211 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v212)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v212)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v212)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v212)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v212 + 64)) += int64(v211) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v214 = envPtr2 + 152 v213 = *(*uintptr)(unsafe.Pointer(v214)) *(*uintptr)(unsafe.Pointer(v214))++ *(*uint8)(unsafe.Pointer(v213)) = libc.Uint8FromInt32(int32(INST_DICT_RECOMBINE_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_RECOMBINE_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v215 = delta1 v216 = envPtr2 if v215 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v216)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v216)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v216)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v216)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v216 + 64)) += int64(v215) } } else { /* * Case: Direct dict in non-simple var with empty body. */ if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v218 = envPtr2 + 152 v217 = *(*uintptr)(unsafe.Pointer(v218)) *(*uintptr)(unsafe.Pointer(v218))++ *(*uint8)(unsafe.Pointer(v217)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v220 = envPtr2 + 152 v219 = *(*uintptr)(unsafe.Pointer(v220)) *(*uintptr)(unsafe.Pointer(v220))++ *(*uint8)(unsafe.Pointer(v219)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v221 = delta1 v222 = envPtr2 if v221 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v222)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v222)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v222)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v222)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v222 + 64)) += int64(v221) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v224 = envPtr2 + 152 v223 = *(*uintptr)(unsafe.Pointer(v224)) *(*uintptr)(unsafe.Pointer(v224))++ *(*uint8)(unsafe.Pointer(v223)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v226 = envPtr2 + 152 v225 = *(*uintptr)(unsafe.Pointer(v226)) *(*uintptr)(unsafe.Pointer(v226))++ *(*uint8)(unsafe.Pointer(v225)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v228 = envPtr2 + 152 v227 = *(*uintptr)(unsafe.Pointer(v228)) *(*uintptr)(unsafe.Pointer(v228))++ *(*uint8)(unsafe.Pointer(v227)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v230 = envPtr2 + 152 v229 = *(*uintptr)(unsafe.Pointer(v230)) *(*uintptr)(unsafe.Pointer(v230))++ *(*uint8)(unsafe.Pointer(v229)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v232 = envPtr2 + 152 v231 = *(*uintptr)(unsafe.Pointer(v232)) *(*uintptr)(unsafe.Pointer(v232))++ *(*uint8)(unsafe.Pointer(v231)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v233 = delta1 v234 = envPtr2 if v233 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v234)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v234)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v234)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v234)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v234 + 64)) += int64(v233) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v236 = envPtr2 + 152 v235 = *(*uintptr)(unsafe.Pointer(v236)) *(*uintptr)(unsafe.Pointer(v236))++ *(*uint8)(unsafe.Pointer(v235)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v237 = delta1 v238 = envPtr2 if v237 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v238)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v238)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v238)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v238)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v238 + 64)) += int64(v237) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v240 = envPtr2 + 152 v239 = *(*uintptr)(unsafe.Pointer(v240)) *(*uintptr)(unsafe.Pointer(v240))++ *(*uint8)(unsafe.Pointer(v239)) = libc.Uint8FromInt32(int32(INST_LOAD_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v241 = delta1 v242 = envPtr2 if v241 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v242)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v242)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v242)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v242)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v242 + 64)) += int64(v241) } _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v244 = envPtr2 + 152 v243 = *(*uintptr)(unsafe.Pointer(v244)) *(*uintptr)(unsafe.Pointer(v244))++ *(*uint8)(unsafe.Pointer(v243)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v246 = envPtr2 + 152 v245 = *(*uintptr)(unsafe.Pointer(v246)) *(*uintptr)(unsafe.Pointer(v246))++ *(*uint8)(unsafe.Pointer(v245)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v247 = delta1 v248 = envPtr2 if v247 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v248)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v248)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v248)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v248)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v248 + 64)) += int64(v247) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v250 = envPtr2 + 152 v249 = *(*uintptr)(unsafe.Pointer(v250)) *(*uintptr)(unsafe.Pointer(v250))++ *(*uint8)(unsafe.Pointer(v249)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v252 = envPtr2 + 152 v251 = *(*uintptr)(unsafe.Pointer(v252)) *(*uintptr)(unsafe.Pointer(v252))++ *(*uint8)(unsafe.Pointer(v251)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v254 = envPtr2 + 152 v253 = *(*uintptr)(unsafe.Pointer(v254)) *(*uintptr)(unsafe.Pointer(v254))++ *(*uint8)(unsafe.Pointer(v253)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v256 = envPtr2 + 152 v255 = *(*uintptr)(unsafe.Pointer(v256)) *(*uintptr)(unsafe.Pointer(v256))++ *(*uint8)(unsafe.Pointer(v255)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v258 = envPtr2 + 152 v257 = *(*uintptr)(unsafe.Pointer(v258)) *(*uintptr)(unsafe.Pointer(v258))++ *(*uint8)(unsafe.Pointer(v257)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v259 = delta1 v260 = envPtr2 if v259 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v260)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v260)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v260)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v260)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v260 + 64)) += int64(v259) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v262 = envPtr2 + 152 v261 = *(*uintptr)(unsafe.Pointer(v262)) *(*uintptr)(unsafe.Pointer(v262))++ *(*uint8)(unsafe.Pointer(v261)) = libc.Uint8FromInt32(int32(INST_DICT_EXPAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_EXPAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v263 = delta1 v264 = envPtr2 if v263 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v264)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v264)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v264)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v264)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v264 + 64)) += int64(v263) } _objIndexCopy6 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy6 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v266 = envPtr2 + 152 v265 = *(*uintptr)(unsafe.Pointer(v266)) *(*uintptr)(unsafe.Pointer(v266))++ *(*uint8)(unsafe.Pointer(v265)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v268 = envPtr2 + 152 v267 = *(*uintptr)(unsafe.Pointer(v268)) *(*uintptr)(unsafe.Pointer(v268))++ *(*uint8)(unsafe.Pointer(v267)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v269 = delta1 v270 = envPtr2 if v269 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v270)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v270)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v270)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v270)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v270 + 64)) += int64(v269) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v272 = envPtr2 + 152 v271 = *(*uintptr)(unsafe.Pointer(v272)) *(*uintptr)(unsafe.Pointer(v272))++ *(*uint8)(unsafe.Pointer(v271)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v274 = envPtr2 + 152 v273 = *(*uintptr)(unsafe.Pointer(v274)) *(*uintptr)(unsafe.Pointer(v274))++ *(*uint8)(unsafe.Pointer(v273)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(24)) v276 = envPtr2 + 152 v275 = *(*uintptr)(unsafe.Pointer(v276)) *(*uintptr)(unsafe.Pointer(v276))++ *(*uint8)(unsafe.Pointer(v275)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(16)) v278 = envPtr2 + 152 v277 = *(*uintptr)(unsafe.Pointer(v278)) *(*uintptr)(unsafe.Pointer(v278))++ *(*uint8)(unsafe.Pointer(v277)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(8)) v280 = envPtr2 + 152 v279 = *(*uintptr)(unsafe.Pointer(v280)) *(*uintptr)(unsafe.Pointer(v280))++ *(*uint8)(unsafe.Pointer(v279)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v281 = delta1 v282 = envPtr2 if v281 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v282)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v282)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v282)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v282)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v282 + 64)) += int64(v281) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v284 = envPtr2 + 152 v283 = *(*uintptr)(unsafe.Pointer(v284)) *(*uintptr)(unsafe.Pointer(v284))++ *(*uint8)(unsafe.Pointer(v283)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v286 = envPtr2 + 152 v285 = *(*uintptr)(unsafe.Pointer(v286)) *(*uintptr)(unsafe.Pointer(v286))++ *(*uint8)(unsafe.Pointer(v285)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v288 = envPtr2 + 152 v287 = *(*uintptr)(unsafe.Pointer(v288)) *(*uintptr)(unsafe.Pointer(v288))++ *(*uint8)(unsafe.Pointer(v287)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v290 = envPtr2 + 152 v289 = *(*uintptr)(unsafe.Pointer(v290)) *(*uintptr)(unsafe.Pointer(v290))++ *(*uint8)(unsafe.Pointer(v289)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v292 = envPtr2 + 152 v291 = *(*uintptr)(unsafe.Pointer(v292)) *(*uintptr)(unsafe.Pointer(v292))++ *(*uint8)(unsafe.Pointer(v291)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v293 = delta1 v294 = envPtr2 if v293 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v294)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v294)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v294)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v294)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v294 + 64)) += int64(v293) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v296 = envPtr2 + 152 v295 = *(*uintptr)(unsafe.Pointer(v296)) *(*uintptr)(unsafe.Pointer(v296))++ *(*uint8)(unsafe.Pointer(v295)) = libc.Uint8FromInt32(int32(INST_DICT_RECOMBINE_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_RECOMBINE_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v297 = delta1 v298 = envPtr2 if v297 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v298)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v298)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v298)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v298)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v298 + 64)) += int64(v297) } } } _objIndexCopy7 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy7 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v300 = envPtr2 + 152 v299 = *(*uintptr)(unsafe.Pointer(v300)) *(*uintptr)(unsafe.Pointer(v300))++ *(*uint8)(unsafe.Pointer(v299)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v302 = envPtr2 + 152 v301 = *(*uintptr)(unsafe.Pointer(v302)) *(*uintptr)(unsafe.Pointer(v302))++ *(*uint8)(unsafe.Pointer(v301)) = uint8(libc.Uint32FromInt32(_objIndexCopy7)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy7 } v303 = delta1 v304 = envPtr2 if v303 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v304)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v304)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v304)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v304)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v304 + 64)) += int64(v303) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v306 = envPtr2 + 152 v305 = *(*uintptr)(unsafe.Pointer(v306)) *(*uintptr)(unsafe.Pointer(v306))++ *(*uint8)(unsafe.Pointer(v305)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v308 = envPtr2 + 152 v307 = *(*uintptr)(unsafe.Pointer(v308)) *(*uintptr)(unsafe.Pointer(v308))++ *(*uint8)(unsafe.Pointer(v307)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(24)) v310 = envPtr2 + 152 v309 = *(*uintptr)(unsafe.Pointer(v310)) *(*uintptr)(unsafe.Pointer(v310))++ *(*uint8)(unsafe.Pointer(v309)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(16)) v312 = envPtr2 + 152 v311 = *(*uintptr)(unsafe.Pointer(v312)) *(*uintptr)(unsafe.Pointer(v312))++ *(*uint8)(unsafe.Pointer(v311)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(8)) v314 = envPtr2 + 152 v313 = *(*uintptr)(unsafe.Pointer(v314)) *(*uintptr)(unsafe.Pointer(v314))++ *(*uint8)(unsafe.Pointer(v313)) = uint8(libc.Uint32FromInt32(_objIndexCopy7)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy7 } v315 = delta1 v316 = envPtr2 if v315 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v316)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v316)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v316)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v316)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v316 + 64)) += int64(v315) } } return TCL_OK } /* * OK, we have a non-trivial body. This means that the focus is on * generating a try-finally structure where the INST_DICT_RECOMBINE_* goes * in the 'finally' clause. * * Start by allocating local (unnamed, untraced) working variables. */ if dictVar == -int32(1) { varNameTmp = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) } if gotPath != 0 { pathTmp = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) } keysTmp = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) /* * Issue instructions. First, the part to expand the dictionary. */ if dictVar == -int32(1) { if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy8 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy8 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v318 = envPtr2 + 152 v317 = *(*uintptr)(unsafe.Pointer(v318)) *(*uintptr)(unsafe.Pointer(v318))++ *(*uint8)(unsafe.Pointer(v317)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v320 = envPtr2 + 152 v319 = *(*uintptr)(unsafe.Pointer(v320)) *(*uintptr)(unsafe.Pointer(v320))++ *(*uint8)(unsafe.Pointer(v319)) = uint8(libc.Uint32FromInt32(_objIndexCopy8)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy8 } v321 = delta1 v322 = envPtr2 if v321 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v322)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v322)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v322)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v322)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v322 + 64)) += int64(v321) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v324 = envPtr2 + 152 v323 = *(*uintptr)(unsafe.Pointer(v324)) *(*uintptr)(unsafe.Pointer(v324))++ *(*uint8)(unsafe.Pointer(v323)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v326 = envPtr2 + 152 v325 = *(*uintptr)(unsafe.Pointer(v326)) *(*uintptr)(unsafe.Pointer(v326))++ *(*uint8)(unsafe.Pointer(v325)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(24)) v328 = envPtr2 + 152 v327 = *(*uintptr)(unsafe.Pointer(v328)) *(*uintptr)(unsafe.Pointer(v328))++ *(*uint8)(unsafe.Pointer(v327)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(16)) v330 = envPtr2 + 152 v329 = *(*uintptr)(unsafe.Pointer(v330)) *(*uintptr)(unsafe.Pointer(v330))++ *(*uint8)(unsafe.Pointer(v329)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(8)) v332 = envPtr2 + 152 v331 = *(*uintptr)(unsafe.Pointer(v332)) *(*uintptr)(unsafe.Pointer(v332))++ *(*uint8)(unsafe.Pointer(v331)) = uint8(libc.Uint32FromInt32(_objIndexCopy8)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy8 } v333 = delta1 v334 = envPtr2 if v333 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v334)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v334)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v334)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v334)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v334 + 64)) += int64(v333) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents), envPtr2) } if varNameTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v336 = envPtr2 + 152 v335 = *(*uintptr)(unsafe.Pointer(v336)) *(*uintptr)(unsafe.Pointer(v336))++ *(*uint8)(unsafe.Pointer(v335)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v338 = envPtr2 + 152 v337 = *(*uintptr)(unsafe.Pointer(v338)) *(*uintptr)(unsafe.Pointer(v338))++ *(*uint8)(unsafe.Pointer(v337)) = uint8(libc.Uint32FromInt32(varNameTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - varNameTmp } v339 = delta1 v340 = envPtr2 if v339 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v340 + 64)) += int64(v339) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v342 = envPtr2 + 152 v341 = *(*uintptr)(unsafe.Pointer(v342)) *(*uintptr)(unsafe.Pointer(v342))++ *(*uint8)(unsafe.Pointer(v341)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v344 = envPtr2 + 152 v343 = *(*uintptr)(unsafe.Pointer(v344)) *(*uintptr)(unsafe.Pointer(v344))++ *(*uint8)(unsafe.Pointer(v343)) = uint8(libc.Uint32FromInt32(varNameTmp) >> libc.Int32FromInt32(24)) v346 = envPtr2 + 152 v345 = *(*uintptr)(unsafe.Pointer(v346)) *(*uintptr)(unsafe.Pointer(v346))++ *(*uint8)(unsafe.Pointer(v345)) = uint8(libc.Uint32FromInt32(varNameTmp) >> libc.Int32FromInt32(16)) v348 = envPtr2 + 152 v347 = *(*uintptr)(unsafe.Pointer(v348)) *(*uintptr)(unsafe.Pointer(v348))++ *(*uint8)(unsafe.Pointer(v347)) = uint8(libc.Uint32FromInt32(varNameTmp) >> libc.Int32FromInt32(8)) v350 = envPtr2 + 152 v349 = *(*uintptr)(unsafe.Pointer(v350)) *(*uintptr)(unsafe.Pointer(v350))++ *(*uint8)(unsafe.Pointer(v349)) = uint8(libc.Uint32FromInt32(varNameTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - varNameTmp } v351 = delta1 v352 = envPtr2 if v351 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v352)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v352)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v352)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v352)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v352 + 64)) += int64(v351) } } } tokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if gotPath != 0 { i1 = int32(2) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-int32(1)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy9 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy9 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v355 = envPtr2 + 152 v354 = *(*uintptr)(unsafe.Pointer(v355)) *(*uintptr)(unsafe.Pointer(v355))++ *(*uint8)(unsafe.Pointer(v354)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v357 = envPtr2 + 152 v356 = *(*uintptr)(unsafe.Pointer(v357)) *(*uintptr)(unsafe.Pointer(v357))++ *(*uint8)(unsafe.Pointer(v356)) = uint8(libc.Uint32FromInt32(_objIndexCopy9)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy9 } v358 = delta1 v359 = envPtr2 if v358 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v359)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v359)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v359)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v359)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v359 + 64)) += int64(v358) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v361 = envPtr2 + 152 v360 = *(*uintptr)(unsafe.Pointer(v361)) *(*uintptr)(unsafe.Pointer(v361))++ *(*uint8)(unsafe.Pointer(v360)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v363 = envPtr2 + 152 v362 = *(*uintptr)(unsafe.Pointer(v363)) *(*uintptr)(unsafe.Pointer(v363))++ *(*uint8)(unsafe.Pointer(v362)) = uint8(libc.Uint32FromInt32(_objIndexCopy9) >> libc.Int32FromInt32(24)) v365 = envPtr2 + 152 v364 = *(*uintptr)(unsafe.Pointer(v365)) *(*uintptr)(unsafe.Pointer(v365))++ *(*uint8)(unsafe.Pointer(v364)) = uint8(libc.Uint32FromInt32(_objIndexCopy9) >> libc.Int32FromInt32(16)) v367 = envPtr2 + 152 v366 = *(*uintptr)(unsafe.Pointer(v367)) *(*uintptr)(unsafe.Pointer(v367))++ *(*uint8)(unsafe.Pointer(v366)) = uint8(libc.Uint32FromInt32(_objIndexCopy9) >> libc.Int32FromInt32(8)) v369 = envPtr2 + 152 v368 = *(*uintptr)(unsafe.Pointer(v369)) *(*uintptr)(unsafe.Pointer(v369))++ *(*uint8)(unsafe.Pointer(v368)) = uint8(libc.Uint32FromInt32(_objIndexCopy9)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy9 } v370 = delta1 v371 = envPtr2 if v370 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v371)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v371)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v371)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v371)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v371 + 64)) += int64(v370) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _353 _353: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v373 = envPtr2 + 152 v372 = *(*uintptr)(unsafe.Pointer(v373)) *(*uintptr)(unsafe.Pointer(v373))++ *(*uint8)(unsafe.Pointer(v372)) = libc.Uint8FromInt32(int32(INST_LIST)) v375 = envPtr2 + 152 v374 = *(*uintptr)(unsafe.Pointer(v375)) *(*uintptr)(unsafe.Pointer(v375))++ *(*uint8)(unsafe.Pointer(v374)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v377 = envPtr2 + 152 v376 = *(*uintptr)(unsafe.Pointer(v377)) *(*uintptr)(unsafe.Pointer(v377))++ *(*uint8)(unsafe.Pointer(v376)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v379 = envPtr2 + 152 v378 = *(*uintptr)(unsafe.Pointer(v379)) *(*uintptr)(unsafe.Pointer(v379))++ *(*uint8)(unsafe.Pointer(v378)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v381 = envPtr2 + 152 v380 = *(*uintptr)(unsafe.Pointer(v381)) *(*uintptr)(unsafe.Pointer(v381))++ *(*uint8)(unsafe.Pointer(v380)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) - int32(3)) } v382 = delta1 v383 = envPtr2 if v382 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v383)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v383)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v383)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v383)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v383 + 64)) += int64(v382) } if pathTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v385 = envPtr2 + 152 v384 = *(*uintptr)(unsafe.Pointer(v385)) *(*uintptr)(unsafe.Pointer(v385))++ *(*uint8)(unsafe.Pointer(v384)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v387 = envPtr2 + 152 v386 = *(*uintptr)(unsafe.Pointer(v387)) *(*uintptr)(unsafe.Pointer(v387))++ *(*uint8)(unsafe.Pointer(v386)) = uint8(libc.Uint32FromInt32(pathTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - pathTmp } v388 = delta1 v389 = envPtr2 if v388 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v389)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v389)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v389)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v389)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v389 + 64)) += int64(v388) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v391 = envPtr2 + 152 v390 = *(*uintptr)(unsafe.Pointer(v391)) *(*uintptr)(unsafe.Pointer(v391))++ *(*uint8)(unsafe.Pointer(v390)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v393 = envPtr2 + 152 v392 = *(*uintptr)(unsafe.Pointer(v393)) *(*uintptr)(unsafe.Pointer(v393))++ *(*uint8)(unsafe.Pointer(v392)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(24)) v395 = envPtr2 + 152 v394 = *(*uintptr)(unsafe.Pointer(v395)) *(*uintptr)(unsafe.Pointer(v395))++ *(*uint8)(unsafe.Pointer(v394)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(16)) v397 = envPtr2 + 152 v396 = *(*uintptr)(unsafe.Pointer(v397)) *(*uintptr)(unsafe.Pointer(v397))++ *(*uint8)(unsafe.Pointer(v396)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(8)) v399 = envPtr2 + 152 v398 = *(*uintptr)(unsafe.Pointer(v399)) *(*uintptr)(unsafe.Pointer(v399))++ *(*uint8)(unsafe.Pointer(v398)) = uint8(libc.Uint32FromInt32(pathTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - pathTmp } v400 = delta1 v401 = envPtr2 if v400 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v401)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v401)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v401)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v401)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v401 + 64)) += int64(v400) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v403 = envPtr2 + 152 v402 = *(*uintptr)(unsafe.Pointer(v403)) *(*uintptr)(unsafe.Pointer(v403))++ *(*uint8)(unsafe.Pointer(v402)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v404 = delta1 v405 = envPtr2 if v404 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v405)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v405)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v405)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v405)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v405 + 64)) += int64(v404) } } if dictVar == -int32(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v407 = envPtr2 + 152 v406 = *(*uintptr)(unsafe.Pointer(v407)) *(*uintptr)(unsafe.Pointer(v407))++ *(*uint8)(unsafe.Pointer(v406)) = libc.Uint8FromInt32(int32(INST_LOAD_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v408 = delta1 v409 = envPtr2 if v408 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v409)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v409)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v409)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v409)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v409 + 64)) += int64(v408) } } else { if dictVar <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v411 = envPtr2 + 152 v410 = *(*uintptr)(unsafe.Pointer(v411)) *(*uintptr)(unsafe.Pointer(v411))++ *(*uint8)(unsafe.Pointer(v410)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v413 = envPtr2 + 152 v412 = *(*uintptr)(unsafe.Pointer(v413)) *(*uintptr)(unsafe.Pointer(v413))++ *(*uint8)(unsafe.Pointer(v412)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v414 = delta1 v415 = envPtr2 if v414 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v415)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v415)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v415)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v415)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v415 + 64)) += int64(v414) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v417 = envPtr2 + 152 v416 = *(*uintptr)(unsafe.Pointer(v417)) *(*uintptr)(unsafe.Pointer(v417))++ *(*uint8)(unsafe.Pointer(v416)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v419 = envPtr2 + 152 v418 = *(*uintptr)(unsafe.Pointer(v419)) *(*uintptr)(unsafe.Pointer(v419))++ *(*uint8)(unsafe.Pointer(v418)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(24)) v421 = envPtr2 + 152 v420 = *(*uintptr)(unsafe.Pointer(v421)) *(*uintptr)(unsafe.Pointer(v421))++ *(*uint8)(unsafe.Pointer(v420)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(16)) v423 = envPtr2 + 152 v422 = *(*uintptr)(unsafe.Pointer(v423)) *(*uintptr)(unsafe.Pointer(v423))++ *(*uint8)(unsafe.Pointer(v422)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(8)) v425 = envPtr2 + 152 v424 = *(*uintptr)(unsafe.Pointer(v425)) *(*uintptr)(unsafe.Pointer(v425))++ *(*uint8)(unsafe.Pointer(v424)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v426 = delta1 v427 = envPtr2 if v426 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v427)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v427)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v427)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v427)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v427 + 64)) += int64(v426) } } } if gotPath != 0 { if pathTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v429 = envPtr2 + 152 v428 = *(*uintptr)(unsafe.Pointer(v429)) *(*uintptr)(unsafe.Pointer(v429))++ *(*uint8)(unsafe.Pointer(v428)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v431 = envPtr2 + 152 v430 = *(*uintptr)(unsafe.Pointer(v431)) *(*uintptr)(unsafe.Pointer(v431))++ *(*uint8)(unsafe.Pointer(v430)) = uint8(libc.Uint32FromInt32(pathTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - pathTmp } v432 = delta1 v433 = envPtr2 if v432 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v433)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v433)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v433)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v433)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v433 + 64)) += int64(v432) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v435 = envPtr2 + 152 v434 = *(*uintptr)(unsafe.Pointer(v435)) *(*uintptr)(unsafe.Pointer(v435))++ *(*uint8)(unsafe.Pointer(v434)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v437 = envPtr2 + 152 v436 = *(*uintptr)(unsafe.Pointer(v437)) *(*uintptr)(unsafe.Pointer(v437))++ *(*uint8)(unsafe.Pointer(v436)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(24)) v439 = envPtr2 + 152 v438 = *(*uintptr)(unsafe.Pointer(v439)) *(*uintptr)(unsafe.Pointer(v439))++ *(*uint8)(unsafe.Pointer(v438)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(16)) v441 = envPtr2 + 152 v440 = *(*uintptr)(unsafe.Pointer(v441)) *(*uintptr)(unsafe.Pointer(v441))++ *(*uint8)(unsafe.Pointer(v440)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(8)) v443 = envPtr2 + 152 v442 = *(*uintptr)(unsafe.Pointer(v443)) *(*uintptr)(unsafe.Pointer(v443))++ *(*uint8)(unsafe.Pointer(v442)) = uint8(libc.Uint32FromInt32(pathTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - pathTmp } v444 = delta1 v445 = envPtr2 if v444 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v445)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v445)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v445)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v445)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v445 + 64)) += int64(v444) } } } else { _objIndexCopy10 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy10 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v447 = envPtr2 + 152 v446 = *(*uintptr)(unsafe.Pointer(v447)) *(*uintptr)(unsafe.Pointer(v447))++ *(*uint8)(unsafe.Pointer(v446)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v449 = envPtr2 + 152 v448 = *(*uintptr)(unsafe.Pointer(v449)) *(*uintptr)(unsafe.Pointer(v449))++ *(*uint8)(unsafe.Pointer(v448)) = uint8(libc.Uint32FromInt32(_objIndexCopy10)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy10 } v450 = delta1 v451 = envPtr2 if v450 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v451)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v451)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v451)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v451)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v451 + 64)) += int64(v450) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v453 = envPtr2 + 152 v452 = *(*uintptr)(unsafe.Pointer(v453)) *(*uintptr)(unsafe.Pointer(v453))++ *(*uint8)(unsafe.Pointer(v452)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v455 = envPtr2 + 152 v454 = *(*uintptr)(unsafe.Pointer(v455)) *(*uintptr)(unsafe.Pointer(v455))++ *(*uint8)(unsafe.Pointer(v454)) = uint8(libc.Uint32FromInt32(_objIndexCopy10) >> libc.Int32FromInt32(24)) v457 = envPtr2 + 152 v456 = *(*uintptr)(unsafe.Pointer(v457)) *(*uintptr)(unsafe.Pointer(v457))++ *(*uint8)(unsafe.Pointer(v456)) = uint8(libc.Uint32FromInt32(_objIndexCopy10) >> libc.Int32FromInt32(16)) v459 = envPtr2 + 152 v458 = *(*uintptr)(unsafe.Pointer(v459)) *(*uintptr)(unsafe.Pointer(v459))++ *(*uint8)(unsafe.Pointer(v458)) = uint8(libc.Uint32FromInt32(_objIndexCopy10) >> libc.Int32FromInt32(8)) v461 = envPtr2 + 152 v460 = *(*uintptr)(unsafe.Pointer(v461)) *(*uintptr)(unsafe.Pointer(v461))++ *(*uint8)(unsafe.Pointer(v460)) = uint8(libc.Uint32FromInt32(_objIndexCopy10)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy10 } v462 = delta1 v463 = envPtr2 if v462 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v463)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v463)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v463)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v463)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v463 + 64)) += int64(v462) } } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v465 = envPtr2 + 152 v464 = *(*uintptr)(unsafe.Pointer(v465)) *(*uintptr)(unsafe.Pointer(v465))++ *(*uint8)(unsafe.Pointer(v464)) = libc.Uint8FromInt32(int32(INST_DICT_EXPAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_EXPAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v466 = delta1 v467 = envPtr2 if v466 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v467)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v467)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v467)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v467)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v467 + 64)) += int64(v466) } if keysTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v469 = envPtr2 + 152 v468 = *(*uintptr)(unsafe.Pointer(v469)) *(*uintptr)(unsafe.Pointer(v469))++ *(*uint8)(unsafe.Pointer(v468)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v471 = envPtr2 + 152 v470 = *(*uintptr)(unsafe.Pointer(v471)) *(*uintptr)(unsafe.Pointer(v471))++ *(*uint8)(unsafe.Pointer(v470)) = uint8(libc.Uint32FromInt32(keysTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keysTmp } v472 = delta1 v473 = envPtr2 if v472 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v473)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v473)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v473)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v473)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v473 + 64)) += int64(v472) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v475 = envPtr2 + 152 v474 = *(*uintptr)(unsafe.Pointer(v475)) *(*uintptr)(unsafe.Pointer(v475))++ *(*uint8)(unsafe.Pointer(v474)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v477 = envPtr2 + 152 v476 = *(*uintptr)(unsafe.Pointer(v477)) *(*uintptr)(unsafe.Pointer(v477))++ *(*uint8)(unsafe.Pointer(v476)) = uint8(libc.Uint32FromInt32(keysTmp) >> libc.Int32FromInt32(24)) v479 = envPtr2 + 152 v478 = *(*uintptr)(unsafe.Pointer(v479)) *(*uintptr)(unsafe.Pointer(v479))++ *(*uint8)(unsafe.Pointer(v478)) = uint8(libc.Uint32FromInt32(keysTmp) >> libc.Int32FromInt32(16)) v481 = envPtr2 + 152 v480 = *(*uintptr)(unsafe.Pointer(v481)) *(*uintptr)(unsafe.Pointer(v481))++ *(*uint8)(unsafe.Pointer(v480)) = uint8(libc.Uint32FromInt32(keysTmp) >> libc.Int32FromInt32(8)) v483 = envPtr2 + 152 v482 = *(*uintptr)(unsafe.Pointer(v483)) *(*uintptr)(unsafe.Pointer(v483))++ *(*uint8)(unsafe.Pointer(v482)) = uint8(libc.Uint32FromInt32(keysTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keysTmp } v484 = delta1 v485 = envPtr2 if v484 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v485)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v485)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v485)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v485)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v485 + 64)) += int64(v484) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v487 = envPtr2 + 152 v486 = *(*uintptr)(unsafe.Pointer(v487)) *(*uintptr)(unsafe.Pointer(v487))++ *(*uint8)(unsafe.Pointer(v486)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v488 = delta1 v489 = envPtr2 if v488 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v489)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v489)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v489)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v489)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v489 + 64)) += int64(v488) } /* * Now the body of the [dict with]. */ range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v491 = envPtr2 + 152 v490 = *(*uintptr)(unsafe.Pointer(v491)) *(*uintptr)(unsafe.Pointer(v491))++ *(*uint8)(unsafe.Pointer(v490)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v493 = envPtr2 + 152 v492 = *(*uintptr)(unsafe.Pointer(v493)) *(*uintptr)(unsafe.Pointer(v493))++ *(*uint8)(unsafe.Pointer(v492)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v495 = envPtr2 + 152 v494 = *(*uintptr)(unsafe.Pointer(v495)) *(*uintptr)(unsafe.Pointer(v495))++ *(*uint8)(unsafe.Pointer(v494)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v497 = envPtr2 + 152 v496 = *(*uintptr)(unsafe.Pointer(v497)) *(*uintptr)(unsafe.Pointer(v497))++ *(*uint8)(unsafe.Pointer(v496)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v499 = envPtr2 + 152 v498 = *(*uintptr)(unsafe.Pointer(v499)) *(*uintptr)(unsafe.Pointer(v499))++ *(*uint8)(unsafe.Pointer(v498)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v500 = delta1 v501 = envPtr2 if v500 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v501)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v501)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v501)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v501)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v501 + 64)) += int64(v500) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v502 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v502 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v502 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1))*8)) XTclCompileCmdWord(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) /* * Now fold the results back into the dictionary in the OK case. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v504 = envPtr2 + 152 v503 = *(*uintptr)(unsafe.Pointer(v504)) *(*uintptr)(unsafe.Pointer(v504))++ *(*uint8)(unsafe.Pointer(v503)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v505 = delta1 v506 = envPtr2 if v505 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v506)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v506)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v506)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v506)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v506 + 64)) += int64(v505) } if dictVar == -int32(1) { if varNameTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v508 = envPtr2 + 152 v507 = *(*uintptr)(unsafe.Pointer(v508)) *(*uintptr)(unsafe.Pointer(v508))++ *(*uint8)(unsafe.Pointer(v507)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v510 = envPtr2 + 152 v509 = *(*uintptr)(unsafe.Pointer(v510)) *(*uintptr)(unsafe.Pointer(v510))++ *(*uint8)(unsafe.Pointer(v509)) = uint8(libc.Uint32FromInt32(varNameTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - varNameTmp } v511 = delta1 v512 = envPtr2 if v511 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v512)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v512)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v512)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v512)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v512 + 64)) += int64(v511) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v514 = envPtr2 + 152 v513 = *(*uintptr)(unsafe.Pointer(v514)) *(*uintptr)(unsafe.Pointer(v514))++ *(*uint8)(unsafe.Pointer(v513)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v516 = envPtr2 + 152 v515 = *(*uintptr)(unsafe.Pointer(v516)) *(*uintptr)(unsafe.Pointer(v516))++ *(*uint8)(unsafe.Pointer(v515)) = uint8(libc.Uint32FromInt32(varNameTmp) >> libc.Int32FromInt32(24)) v518 = envPtr2 + 152 v517 = *(*uintptr)(unsafe.Pointer(v518)) *(*uintptr)(unsafe.Pointer(v518))++ *(*uint8)(unsafe.Pointer(v517)) = uint8(libc.Uint32FromInt32(varNameTmp) >> libc.Int32FromInt32(16)) v520 = envPtr2 + 152 v519 = *(*uintptr)(unsafe.Pointer(v520)) *(*uintptr)(unsafe.Pointer(v520))++ *(*uint8)(unsafe.Pointer(v519)) = uint8(libc.Uint32FromInt32(varNameTmp) >> libc.Int32FromInt32(8)) v522 = envPtr2 + 152 v521 = *(*uintptr)(unsafe.Pointer(v522)) *(*uintptr)(unsafe.Pointer(v522))++ *(*uint8)(unsafe.Pointer(v521)) = uint8(libc.Uint32FromInt32(varNameTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - varNameTmp } v523 = delta1 v524 = envPtr2 if v523 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v524)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v524)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v524)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v524)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v524 + 64)) += int64(v523) } } } if gotPath != 0 { if pathTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v526 = envPtr2 + 152 v525 = *(*uintptr)(unsafe.Pointer(v526)) *(*uintptr)(unsafe.Pointer(v526))++ *(*uint8)(unsafe.Pointer(v525)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v528 = envPtr2 + 152 v527 = *(*uintptr)(unsafe.Pointer(v528)) *(*uintptr)(unsafe.Pointer(v528))++ *(*uint8)(unsafe.Pointer(v527)) = uint8(libc.Uint32FromInt32(pathTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - pathTmp } v529 = delta1 v530 = envPtr2 if v529 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v530)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v530)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v530)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v530)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v530 + 64)) += int64(v529) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v532 = envPtr2 + 152 v531 = *(*uintptr)(unsafe.Pointer(v532)) *(*uintptr)(unsafe.Pointer(v532))++ *(*uint8)(unsafe.Pointer(v531)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v534 = envPtr2 + 152 v533 = *(*uintptr)(unsafe.Pointer(v534)) *(*uintptr)(unsafe.Pointer(v534))++ *(*uint8)(unsafe.Pointer(v533)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(24)) v536 = envPtr2 + 152 v535 = *(*uintptr)(unsafe.Pointer(v536)) *(*uintptr)(unsafe.Pointer(v536))++ *(*uint8)(unsafe.Pointer(v535)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(16)) v538 = envPtr2 + 152 v537 = *(*uintptr)(unsafe.Pointer(v538)) *(*uintptr)(unsafe.Pointer(v538))++ *(*uint8)(unsafe.Pointer(v537)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(8)) v540 = envPtr2 + 152 v539 = *(*uintptr)(unsafe.Pointer(v540)) *(*uintptr)(unsafe.Pointer(v540))++ *(*uint8)(unsafe.Pointer(v539)) = uint8(libc.Uint32FromInt32(pathTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - pathTmp } v541 = delta1 v542 = envPtr2 if v541 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v542)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v542)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v542)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v542)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v542 + 64)) += int64(v541) } } } else { _objIndexCopy11 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy11 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v544 = envPtr2 + 152 v543 = *(*uintptr)(unsafe.Pointer(v544)) *(*uintptr)(unsafe.Pointer(v544))++ *(*uint8)(unsafe.Pointer(v543)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v546 = envPtr2 + 152 v545 = *(*uintptr)(unsafe.Pointer(v546)) *(*uintptr)(unsafe.Pointer(v546))++ *(*uint8)(unsafe.Pointer(v545)) = uint8(libc.Uint32FromInt32(_objIndexCopy11)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy11 } v547 = delta1 v548 = envPtr2 if v547 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v548)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v548)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v548)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v548)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v548 + 64)) += int64(v547) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v550 = envPtr2 + 152 v549 = *(*uintptr)(unsafe.Pointer(v550)) *(*uintptr)(unsafe.Pointer(v550))++ *(*uint8)(unsafe.Pointer(v549)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v552 = envPtr2 + 152 v551 = *(*uintptr)(unsafe.Pointer(v552)) *(*uintptr)(unsafe.Pointer(v552))++ *(*uint8)(unsafe.Pointer(v551)) = uint8(libc.Uint32FromInt32(_objIndexCopy11) >> libc.Int32FromInt32(24)) v554 = envPtr2 + 152 v553 = *(*uintptr)(unsafe.Pointer(v554)) *(*uintptr)(unsafe.Pointer(v554))++ *(*uint8)(unsafe.Pointer(v553)) = uint8(libc.Uint32FromInt32(_objIndexCopy11) >> libc.Int32FromInt32(16)) v556 = envPtr2 + 152 v555 = *(*uintptr)(unsafe.Pointer(v556)) *(*uintptr)(unsafe.Pointer(v556))++ *(*uint8)(unsafe.Pointer(v555)) = uint8(libc.Uint32FromInt32(_objIndexCopy11) >> libc.Int32FromInt32(8)) v558 = envPtr2 + 152 v557 = *(*uintptr)(unsafe.Pointer(v558)) *(*uintptr)(unsafe.Pointer(v558))++ *(*uint8)(unsafe.Pointer(v557)) = uint8(libc.Uint32FromInt32(_objIndexCopy11)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy11 } v559 = delta1 v560 = envPtr2 if v559 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v560)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v560)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v560)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v560)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v560 + 64)) += int64(v559) } } } if keysTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v562 = envPtr2 + 152 v561 = *(*uintptr)(unsafe.Pointer(v562)) *(*uintptr)(unsafe.Pointer(v562))++ *(*uint8)(unsafe.Pointer(v561)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v564 = envPtr2 + 152 v563 = *(*uintptr)(unsafe.Pointer(v564)) *(*uintptr)(unsafe.Pointer(v564))++ *(*uint8)(unsafe.Pointer(v563)) = uint8(libc.Uint32FromInt32(keysTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keysTmp } v565 = delta1 v566 = envPtr2 if v565 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v566)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v566)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v566)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v566)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v566 + 64)) += int64(v565) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v568 = envPtr2 + 152 v567 = *(*uintptr)(unsafe.Pointer(v568)) *(*uintptr)(unsafe.Pointer(v568))++ *(*uint8)(unsafe.Pointer(v567)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v570 = envPtr2 + 152 v569 = *(*uintptr)(unsafe.Pointer(v570)) *(*uintptr)(unsafe.Pointer(v570))++ *(*uint8)(unsafe.Pointer(v569)) = uint8(libc.Uint32FromInt32(keysTmp) >> libc.Int32FromInt32(24)) v572 = envPtr2 + 152 v571 = *(*uintptr)(unsafe.Pointer(v572)) *(*uintptr)(unsafe.Pointer(v572))++ *(*uint8)(unsafe.Pointer(v571)) = uint8(libc.Uint32FromInt32(keysTmp) >> libc.Int32FromInt32(16)) v574 = envPtr2 + 152 v573 = *(*uintptr)(unsafe.Pointer(v574)) *(*uintptr)(unsafe.Pointer(v574))++ *(*uint8)(unsafe.Pointer(v573)) = uint8(libc.Uint32FromInt32(keysTmp) >> libc.Int32FromInt32(8)) v576 = envPtr2 + 152 v575 = *(*uintptr)(unsafe.Pointer(v576)) *(*uintptr)(unsafe.Pointer(v576))++ *(*uint8)(unsafe.Pointer(v575)) = uint8(libc.Uint32FromInt32(keysTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keysTmp } v577 = delta1 v578 = envPtr2 if v577 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v578)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v578)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v578)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v578)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v578 + 64)) += int64(v577) } } if dictVar == -int32(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v580 = envPtr2 + 152 v579 = *(*uintptr)(unsafe.Pointer(v580)) *(*uintptr)(unsafe.Pointer(v580))++ *(*uint8)(unsafe.Pointer(v579)) = libc.Uint8FromInt32(int32(INST_DICT_RECOMBINE_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_RECOMBINE_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v581 = delta1 v582 = envPtr2 if v581 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v582)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v582)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v582)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v582)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v582 + 64)) += int64(v581) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v584 = envPtr2 + 152 v583 = *(*uintptr)(unsafe.Pointer(v584)) *(*uintptr)(unsafe.Pointer(v584))++ *(*uint8)(unsafe.Pointer(v583)) = libc.Uint8FromInt32(int32(INST_DICT_RECOMBINE_IMM)) v586 = envPtr2 + 152 v585 = *(*uintptr)(unsafe.Pointer(v586)) *(*uintptr)(unsafe.Pointer(v586))++ *(*uint8)(unsafe.Pointer(v585)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(24)) v588 = envPtr2 + 152 v587 = *(*uintptr)(unsafe.Pointer(v588)) *(*uintptr)(unsafe.Pointer(v588))++ *(*uint8)(unsafe.Pointer(v587)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(16)) v590 = envPtr2 + 152 v589 = *(*uintptr)(unsafe.Pointer(v590)) *(*uintptr)(unsafe.Pointer(v590))++ *(*uint8)(unsafe.Pointer(v589)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(8)) v592 = envPtr2 + 152 v591 = *(*uintptr)(unsafe.Pointer(v592)) *(*uintptr)(unsafe.Pointer(v592))++ *(*uint8)(unsafe.Pointer(v591)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_RECOMBINE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v593 = delta1 v594 = envPtr2 if v593 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v594)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v594)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v594)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v594)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v594 + 64)) += int64(v593) } } XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp) /* * Now fold the results back into the dictionary in the exception case. */ v595 = -int32(1) v596 = envPtr2 if v595 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v596)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v596)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v596)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v596)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v596 + 64)) += int64(v595) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v598 = envPtr2 + 152 v597 = *(*uintptr)(unsafe.Pointer(v598)) *(*uintptr)(unsafe.Pointer(v598))++ *(*uint8)(unsafe.Pointer(v597)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v599 = delta1 v600 = envPtr2 if v599 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v600)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v600)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v600)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v600)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v600 + 64)) += int64(v599) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v602 = envPtr2 + 152 v601 = *(*uintptr)(unsafe.Pointer(v602)) *(*uintptr)(unsafe.Pointer(v602))++ *(*uint8)(unsafe.Pointer(v601)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v603 = delta1 v604 = envPtr2 if v603 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v604)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v604)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v604)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v604)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v604 + 64)) += int64(v603) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v606 = envPtr2 + 152 v605 = *(*uintptr)(unsafe.Pointer(v606)) *(*uintptr)(unsafe.Pointer(v606))++ *(*uint8)(unsafe.Pointer(v605)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v607 = delta1 v608 = envPtr2 if v607 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v608)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v608)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v608)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v608)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v608 + 64)) += int64(v607) } if dictVar == -int32(1) { if varNameTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v610 = envPtr2 + 152 v609 = *(*uintptr)(unsafe.Pointer(v610)) *(*uintptr)(unsafe.Pointer(v610))++ *(*uint8)(unsafe.Pointer(v609)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v612 = envPtr2 + 152 v611 = *(*uintptr)(unsafe.Pointer(v612)) *(*uintptr)(unsafe.Pointer(v612))++ *(*uint8)(unsafe.Pointer(v611)) = uint8(libc.Uint32FromInt32(varNameTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - varNameTmp } v613 = delta1 v614 = envPtr2 if v613 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v614)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v614)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v614)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v614)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v614 + 64)) += int64(v613) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v616 = envPtr2 + 152 v615 = *(*uintptr)(unsafe.Pointer(v616)) *(*uintptr)(unsafe.Pointer(v616))++ *(*uint8)(unsafe.Pointer(v615)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v618 = envPtr2 + 152 v617 = *(*uintptr)(unsafe.Pointer(v618)) *(*uintptr)(unsafe.Pointer(v618))++ *(*uint8)(unsafe.Pointer(v617)) = uint8(libc.Uint32FromInt32(varNameTmp) >> libc.Int32FromInt32(24)) v620 = envPtr2 + 152 v619 = *(*uintptr)(unsafe.Pointer(v620)) *(*uintptr)(unsafe.Pointer(v620))++ *(*uint8)(unsafe.Pointer(v619)) = uint8(libc.Uint32FromInt32(varNameTmp) >> libc.Int32FromInt32(16)) v622 = envPtr2 + 152 v621 = *(*uintptr)(unsafe.Pointer(v622)) *(*uintptr)(unsafe.Pointer(v622))++ *(*uint8)(unsafe.Pointer(v621)) = uint8(libc.Uint32FromInt32(varNameTmp) >> libc.Int32FromInt32(8)) v624 = envPtr2 + 152 v623 = *(*uintptr)(unsafe.Pointer(v624)) *(*uintptr)(unsafe.Pointer(v624))++ *(*uint8)(unsafe.Pointer(v623)) = uint8(libc.Uint32FromInt32(varNameTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - varNameTmp } v625 = delta1 v626 = envPtr2 if v625 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v626)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v626)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v626)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v626)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v626 + 64)) += int64(v625) } } } if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(3) { if pathTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v628 = envPtr2 + 152 v627 = *(*uintptr)(unsafe.Pointer(v628)) *(*uintptr)(unsafe.Pointer(v628))++ *(*uint8)(unsafe.Pointer(v627)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v630 = envPtr2 + 152 v629 = *(*uintptr)(unsafe.Pointer(v630)) *(*uintptr)(unsafe.Pointer(v630))++ *(*uint8)(unsafe.Pointer(v629)) = uint8(libc.Uint32FromInt32(pathTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - pathTmp } v631 = delta1 v632 = envPtr2 if v631 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v632)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v632)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v632)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v632)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v632 + 64)) += int64(v631) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v634 = envPtr2 + 152 v633 = *(*uintptr)(unsafe.Pointer(v634)) *(*uintptr)(unsafe.Pointer(v634))++ *(*uint8)(unsafe.Pointer(v633)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v636 = envPtr2 + 152 v635 = *(*uintptr)(unsafe.Pointer(v636)) *(*uintptr)(unsafe.Pointer(v636))++ *(*uint8)(unsafe.Pointer(v635)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(24)) v638 = envPtr2 + 152 v637 = *(*uintptr)(unsafe.Pointer(v638)) *(*uintptr)(unsafe.Pointer(v638))++ *(*uint8)(unsafe.Pointer(v637)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(16)) v640 = envPtr2 + 152 v639 = *(*uintptr)(unsafe.Pointer(v640)) *(*uintptr)(unsafe.Pointer(v640))++ *(*uint8)(unsafe.Pointer(v639)) = uint8(libc.Uint32FromInt32(pathTmp) >> libc.Int32FromInt32(8)) v642 = envPtr2 + 152 v641 = *(*uintptr)(unsafe.Pointer(v642)) *(*uintptr)(unsafe.Pointer(v642))++ *(*uint8)(unsafe.Pointer(v641)) = uint8(libc.Uint32FromInt32(pathTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - pathTmp } v643 = delta1 v644 = envPtr2 if v643 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v644)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v644)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v644)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v644)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v644 + 64)) += int64(v643) } } } else { _objIndexCopy12 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy12 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v646 = envPtr2 + 152 v645 = *(*uintptr)(unsafe.Pointer(v646)) *(*uintptr)(unsafe.Pointer(v646))++ *(*uint8)(unsafe.Pointer(v645)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v648 = envPtr2 + 152 v647 = *(*uintptr)(unsafe.Pointer(v648)) *(*uintptr)(unsafe.Pointer(v648))++ *(*uint8)(unsafe.Pointer(v647)) = uint8(libc.Uint32FromInt32(_objIndexCopy12)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy12 } v649 = delta1 v650 = envPtr2 if v649 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v650)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v650)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v650)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v650)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v650 + 64)) += int64(v649) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v652 = envPtr2 + 152 v651 = *(*uintptr)(unsafe.Pointer(v652)) *(*uintptr)(unsafe.Pointer(v652))++ *(*uint8)(unsafe.Pointer(v651)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v654 = envPtr2 + 152 v653 = *(*uintptr)(unsafe.Pointer(v654)) *(*uintptr)(unsafe.Pointer(v654))++ *(*uint8)(unsafe.Pointer(v653)) = uint8(libc.Uint32FromInt32(_objIndexCopy12) >> libc.Int32FromInt32(24)) v656 = envPtr2 + 152 v655 = *(*uintptr)(unsafe.Pointer(v656)) *(*uintptr)(unsafe.Pointer(v656))++ *(*uint8)(unsafe.Pointer(v655)) = uint8(libc.Uint32FromInt32(_objIndexCopy12) >> libc.Int32FromInt32(16)) v658 = envPtr2 + 152 v657 = *(*uintptr)(unsafe.Pointer(v658)) *(*uintptr)(unsafe.Pointer(v658))++ *(*uint8)(unsafe.Pointer(v657)) = uint8(libc.Uint32FromInt32(_objIndexCopy12) >> libc.Int32FromInt32(8)) v660 = envPtr2 + 152 v659 = *(*uintptr)(unsafe.Pointer(v660)) *(*uintptr)(unsafe.Pointer(v660))++ *(*uint8)(unsafe.Pointer(v659)) = uint8(libc.Uint32FromInt32(_objIndexCopy12)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy12 } v661 = delta1 v662 = envPtr2 if v661 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v662)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v662)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v662)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v662)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v662 + 64)) += int64(v661) } } } if keysTmp <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v664 = envPtr2 + 152 v663 = *(*uintptr)(unsafe.Pointer(v664)) *(*uintptr)(unsafe.Pointer(v664))++ *(*uint8)(unsafe.Pointer(v663)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v666 = envPtr2 + 152 v665 = *(*uintptr)(unsafe.Pointer(v666)) *(*uintptr)(unsafe.Pointer(v666))++ *(*uint8)(unsafe.Pointer(v665)) = uint8(libc.Uint32FromInt32(keysTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keysTmp } v667 = delta1 v668 = envPtr2 if v667 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v668)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v668)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v668)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v668)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v668 + 64)) += int64(v667) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v670 = envPtr2 + 152 v669 = *(*uintptr)(unsafe.Pointer(v670)) *(*uintptr)(unsafe.Pointer(v670))++ *(*uint8)(unsafe.Pointer(v669)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v672 = envPtr2 + 152 v671 = *(*uintptr)(unsafe.Pointer(v672)) *(*uintptr)(unsafe.Pointer(v672))++ *(*uint8)(unsafe.Pointer(v671)) = uint8(libc.Uint32FromInt32(keysTmp) >> libc.Int32FromInt32(24)) v674 = envPtr2 + 152 v673 = *(*uintptr)(unsafe.Pointer(v674)) *(*uintptr)(unsafe.Pointer(v674))++ *(*uint8)(unsafe.Pointer(v673)) = uint8(libc.Uint32FromInt32(keysTmp) >> libc.Int32FromInt32(16)) v676 = envPtr2 + 152 v675 = *(*uintptr)(unsafe.Pointer(v676)) *(*uintptr)(unsafe.Pointer(v676))++ *(*uint8)(unsafe.Pointer(v675)) = uint8(libc.Uint32FromInt32(keysTmp) >> libc.Int32FromInt32(8)) v678 = envPtr2 + 152 v677 = *(*uintptr)(unsafe.Pointer(v678)) *(*uintptr)(unsafe.Pointer(v678))++ *(*uint8)(unsafe.Pointer(v677)) = uint8(libc.Uint32FromInt32(keysTmp)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - keysTmp } v679 = delta1 v680 = envPtr2 if v679 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v680)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v680)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v680)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v680)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v680 + 64)) += int64(v679) } } if dictVar == -int32(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v682 = envPtr2 + 152 v681 = *(*uintptr)(unsafe.Pointer(v682)) *(*uintptr)(unsafe.Pointer(v682))++ *(*uint8)(unsafe.Pointer(v681)) = libc.Uint8FromInt32(int32(INST_DICT_RECOMBINE_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_RECOMBINE_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v683 = delta1 v684 = envPtr2 if v683 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v684)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v684)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v684)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v684)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v684 + 64)) += int64(v683) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v686 = envPtr2 + 152 v685 = *(*uintptr)(unsafe.Pointer(v686)) *(*uintptr)(unsafe.Pointer(v686))++ *(*uint8)(unsafe.Pointer(v685)) = libc.Uint8FromInt32(int32(INST_DICT_RECOMBINE_IMM)) v688 = envPtr2 + 152 v687 = *(*uintptr)(unsafe.Pointer(v688)) *(*uintptr)(unsafe.Pointer(v688))++ *(*uint8)(unsafe.Pointer(v687)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(24)) v690 = envPtr2 + 152 v689 = *(*uintptr)(unsafe.Pointer(v690)) *(*uintptr)(unsafe.Pointer(v690))++ *(*uint8)(unsafe.Pointer(v689)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(16)) v692 = envPtr2 + 152 v691 = *(*uintptr)(unsafe.Pointer(v692)) *(*uintptr)(unsafe.Pointer(v692))++ *(*uint8)(unsafe.Pointer(v691)) = uint8(libc.Uint32FromInt32(dictVar) >> libc.Int32FromInt32(8)) v694 = envPtr2 + 152 v693 = *(*uintptr)(unsafe.Pointer(v694)) *(*uintptr)(unsafe.Pointer(v694))++ *(*uint8)(unsafe.Pointer(v693)) = uint8(libc.Uint32FromInt32(dictVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_RECOMBINE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - dictVar } v695 = delta1 v696 = envPtr2 if v695 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v696)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v696)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v696)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v696)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v696 + 64)) += int64(v695) } } XTclEmitInvoke(tls, envPtr2, int32(INST_RETURN_STK), 0) /* * Prepare for the start of the next command. */ if XTclFixupForwardJump(tls, envPtr2, bp, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+21568, libc.VaList(bp+24, int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp))).FcodeOffset))) } return TCL_OK } /* *---------------------------------------------------------------------- * * DupDictUpdateInfo, FreeDictUpdateInfo -- * * Functions to duplicate, release and print the aux data created for use * with the INST_DICT_UPDATE_START and INST_DICT_UPDATE_END instructions. * * Results: * DupDictUpdateInfo: a copy of the auxiliary data * FreeDictUpdateInfo: none * PrintDictUpdateInfo: none * DisassembleDictUpdateInfo: none * * Side effects: * DupDictUpdateInfo: allocates memory * FreeDictUpdateInfo: releases memory * PrintDictUpdateInfo: none * DisassembleDictUpdateInfo: none * *---------------------------------------------------------------------- */ func _DupDictUpdateInfo(tls *libc.TLS, clientData uintptr) (r uintptr) { var dui1Ptr, dui2Ptr uintptr var len1 Tsize_t _, _, _ = dui1Ptr, dui2Ptr, len1 dui1Ptr = clientData len1 = uint64(libc.UintptrFromInt32(0)+8) + uint64(8)*libc.Uint64FromInt64((*TDictUpdateInfo)(unsafe.Pointer(dui1Ptr)).Flength) dui2Ptr = XTcl_Alloc(tls, len1) libc.Xmemcpy(tls, dui2Ptr, dui1Ptr, len1) return dui2Ptr } func _FreeDictUpdateInfo(tls *libc.TLS, clientData uintptr) { XTclpFree(tls, clientData) } func _PrintDictUpdateInfo(tls *libc.TLS, clientData uintptr, appendObj uintptr, dummy2370 uintptr, dummy2371 Tsize_t) { bp := tls.Alloc(16) defer tls.Free(16) var duiPtr uintptr var i TTcl_Size _, _ = duiPtr, i duiPtr = clientData i = 0 for { if !(i < (*TDictUpdateInfo)(unsafe.Pointer(duiPtr)).Flength) { break } if i != 0 { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21617, int64(-int32(1))) } XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+21620, libc.VaList(bp+8, *(*TTcl_Size)(unsafe.Pointer(duiPtr + 8 + uintptr(i)*8)))) goto _1 _1: ; i++ } } func _DisassembleDictUpdateInfo(tls *libc.TLS, clientData uintptr, dictObj uintptr, dummy2388 uintptr, dummy2389 Tsize_t) { var cachePtr, duiPtr, variables uintptr var i TTcl_Size var v1 bool _, _, _, _, _ = cachePtr, duiPtr, i, variables, v1 duiPtr = clientData if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { variables = XTclThreadAllocObj(tls) } else { variables = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(variables + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(variables)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(variables)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(variables)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(variables)).FtypePtr = libc.UintptrFromInt32(0) i = 0 for { if !(i < (*TDictUpdateInfo)(unsafe.Pointer(duiPtr)).Flength) { break } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), variables, XTcl_NewWideIntObj(tls, *(*TTcl_Size)(unsafe.Pointer(duiPtr + 8 + uintptr(i)*8)))) goto _2 _2: ; i++ } XTclDictPut(tls, libc.UintptrFromInt32(0), dictObj, __ccgo_ts+21627, variables) } /* *---------------------------------------------------------------------- * * TclCompileErrorCmd -- * * Procedure called to compile the "error" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "error" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileErrorCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2426 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, delta1, v101, v107, v119, v131, v143, v17, v23, v35, v41, v5, v53, v59, v71, v83, v89 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v100, v102, v103, v104, v105, v106, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v54, v55, v56, v57, v58, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v84, v85, v86, v87, v88, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * General syntax: [error message ?errorInfo? ?errorCode?] */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(2) || int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(4) { return int32(TCL_ERROR) } /* * Handle the message. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } /* * Construct the options. Note that -code and -level are not here. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(2) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+15220, libc.Int64FromUint64(libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v59 = delta1 v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v71 = delta1 v72 = envPtr2 if v71 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v72 + 64)) += int64(v71) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(3) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = libc.Uint8FromInt32(int32(INST_LIST)) v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v83 = delta1 v84 = envPtr2 if v83 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v84 + 64)) += int64(v83) } } else { _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+15231, libc.Int64FromUint64(libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v89 = delta1 v90 = envPtr2 if v89 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v90)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v90)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v90)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v90)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v90 + 64)) += int64(v89) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v100 = envPtr2 + 152 v99 = *(*uintptr)(unsafe.Pointer(v100)) *(*uintptr)(unsafe.Pointer(v100))++ *(*uint8)(unsafe.Pointer(v99)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v101 = delta1 v102 = envPtr2 if v101 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v102)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v102)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v102)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v102)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v102 + 64)) += int64(v101) } } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v104 = envPtr2 + 152 v103 = *(*uintptr)(unsafe.Pointer(v104)) *(*uintptr)(unsafe.Pointer(v104))++ *(*uint8)(unsafe.Pointer(v103)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v107 = delta1 v108 = envPtr2 if v107 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v108)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v108)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v108)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v108)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v108 + 64)) += int64(v107) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v119 = delta1 v120 = envPtr2 if v119 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v120)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v120)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v120)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v120)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v120 + 64)) += int64(v119) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = libc.Uint8FromInt32(int32(INST_LIST)) v124 = envPtr2 + 152 v123 = *(*uintptr)(unsafe.Pointer(v124)) *(*uintptr)(unsafe.Pointer(v124))++ *(*uint8)(unsafe.Pointer(v123)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4)) >> libc.Int32FromInt32(24)) v126 = envPtr2 + 152 v125 = *(*uintptr)(unsafe.Pointer(v126)) *(*uintptr)(unsafe.Pointer(v126))++ *(*uint8)(unsafe.Pointer(v125)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4)) >> libc.Int32FromInt32(16)) v128 = envPtr2 + 152 v127 = *(*uintptr)(unsafe.Pointer(v128)) *(*uintptr)(unsafe.Pointer(v128))++ *(*uint8)(unsafe.Pointer(v127)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4)) >> libc.Int32FromInt32(8)) v130 = envPtr2 + 152 v129 = *(*uintptr)(unsafe.Pointer(v130)) *(*uintptr)(unsafe.Pointer(v130))++ *(*uint8)(unsafe.Pointer(v129)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(4) } v131 = delta1 v132 = envPtr2 if v131 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v132)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v132)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v132)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v132)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v132 + 64)) += int64(v131) } } } /* * Issue the error via 'returnImm error 0'. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v134 = envPtr2 + 152 v133 = *(*uintptr)(unsafe.Pointer(v134)) *(*uintptr)(unsafe.Pointer(v134))++ *(*uint8)(unsafe.Pointer(v133)) = libc.Uint8FromInt32(int32(INST_RETURN_IMM)) v136 = envPtr2 + 152 v135 = *(*uintptr)(unsafe.Pointer(v136)) *(*uintptr)(unsafe.Pointer(v136))++ *(*uint8)(unsafe.Pointer(v135)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(24)) v138 = envPtr2 + 152 v137 = *(*uintptr)(unsafe.Pointer(v138)) *(*uintptr)(unsafe.Pointer(v138))++ *(*uint8)(unsafe.Pointer(v137)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(16)) v140 = envPtr2 + 152 v139 = *(*uintptr)(unsafe.Pointer(v140)) *(*uintptr)(unsafe.Pointer(v140))++ *(*uint8)(unsafe.Pointer(v139)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(8)) v142 = envPtr2 + 152 v141 = *(*uintptr)(unsafe.Pointer(v142)) *(*uintptr)(unsafe.Pointer(v142))++ *(*uint8)(unsafe.Pointer(v141)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RETURN_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(TCL_ERROR) } v143 = delta1 v144 = envPtr2 if v143 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v144)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v144)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v144)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v144)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v144 + 64)) += int64(v143) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v146 = envPtr2 + 152 v145 = *(*uintptr)(unsafe.Pointer(v146)) *(*uintptr)(unsafe.Pointer(v146))++ *(*uint8)(unsafe.Pointer(v145)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v148 = envPtr2 + 152 v147 = *(*uintptr)(unsafe.Pointer(v148)) *(*uintptr)(unsafe.Pointer(v148))++ *(*uint8)(unsafe.Pointer(v147)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v150 = envPtr2 + 152 v149 = *(*uintptr)(unsafe.Pointer(v150)) *(*uintptr)(unsafe.Pointer(v150))++ *(*uint8)(unsafe.Pointer(v149)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v152 = envPtr2 + 152 v151 = *(*uintptr)(unsafe.Pointer(v152)) *(*uintptr)(unsafe.Pointer(v152))++ *(*uint8)(unsafe.Pointer(v151)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileExprCmd -- * * Procedure called to compile the "expr" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "expr" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileExprCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2499 uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ var firstWordPtr uintptr _ = firstWordPtr if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(1) { return int32(TCL_ERROR) } /* * TIP #280: Use the per-word line information of the current command. */ (*TCompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Floc + uintptr((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fnuloc-int64(1))*32))).Fline + 1*8)) firstWordPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 XTclCompileExprWords(tls, interp, firstWordPtr, libc.Uint64FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-int32(1)), envPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileForCmd -- * * Procedure called to compile the "for" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "for" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileForCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2543 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, bodyCodeOffset, bodyRange, delta1, jumpDist, nextCodeOffset, nextRange, v15, v27, v3, v33, v39, v51, v9 int32 var bodyTokenPtr, mapPtr, nextTokenPtr, startTokenPtr, testTokenPtr, v1, v10, v13, v14, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v28, v29, v30, v31, v32, v34, v35, v36, v37, v38, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v52, v7, v8 uintptr var eclIndex, v12, v6 TTcl_Size var v11, v5 int64 var _ /* jumpEvalCondFixup at bp+0 */ TJumpFixup _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, bodyCodeOffset, bodyRange, bodyTokenPtr, delta1, eclIndex, jumpDist, mapPtr, nextCodeOffset, nextRange, nextTokenPtr, startTokenPtr, testTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(5) { return int32(TCL_ERROR) } /* * If the test expression requires substitutions, don't compile the for * command inline. E.g., the expression might cause the loop to never * execute or execute forever, as in "for {} "$x > 5" {incr x} {}". */ startTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 testTokenPtr = startTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(startTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(testTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return int32(TCL_ERROR) } /* * Bail out also if the body or the next expression require substitutions * in order to insure correct behaviour [Bug 219166] */ nextTokenPtr = testTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(testTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 bodyTokenPtr = nextTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(nextTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(nextTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*TTcl_Token)(unsafe.Pointer(bodyTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return int32(TCL_ERROR) } /* * Inline compile the initial command. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileCmdWord(tls, interp, startTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(startTokenPtr)).FnumComponents), envPtr2) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } /* * Jump to the evaluation of the condition. This code uses the "loop * rotation" optimisation (which eliminates one branch from the loop). * "for start cond next body" produces then: * start * goto A * B: body : bodyCodeOffset * next : nextCodeOffset, continueOffset * A: cond -> result : testCodeOffset * if (result) goto B */ XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp) /* * Compile the loop body. */ bodyRange = int32(XTclCreateExceptRange(tls, int32(LOOP_EXCEPTION_RANGE), envPtr2)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v5 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v5 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v5 v6 = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(bodyRange)*56))).FcodeOffset = v6 bodyCodeOffset = int32(v6) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 4*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 4*8)) XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(bodyRange)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(bodyRange)*56))).FcodeOffset)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v9 = delta1 v10 = envPtr2 if v9 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v10 + 64)) += int64(v9) } /* * Compile the "next" subcommand. Note that this exception range will not * have a continueOffset (other than -1) connected to it; it won't trap * TCL_CONTINUE but rather just TCL_BREAK. */ nextRange = int32(XTclCreateExceptRange(tls, int32(LOOP_EXCEPTION_RANGE), envPtr2)) (*(*TExceptionAux)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptAuxArrayPtr + uintptr(nextRange)*80))).FsupportsContinue = 0 (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v11 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v11 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v11 v12 = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(nextRange)*56))).FcodeOffset = v12 nextCodeOffset = int32(v12) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileCmdWord(tls, interp, nextTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(nextTokenPtr)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(nextRange)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(nextRange)*56))).FcodeOffset)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v15 = delta1 v16 = envPtr2 if v15 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v16 + 64)) += int64(v15) } /* * Compile the test expression then emit the conditional jump that * terminates the for. */ if XTclFixupForwardJump(tls, envPtr2, bp, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp)).FcodeOffset))), int32(127)) != 0 { bodyCodeOffset += int32(3) nextCodeOffset += int32(3) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileExprWords(tls, interp, testTokenPtr, uint64(1), envPtr2) jumpDist = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(bodyCodeOffset)) if jumpDist > int32(127) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE4)) v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(-jumpDist) >> libc.Int32FromInt32(24)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(-jumpDist) >> libc.Int32FromInt32(16)) v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = uint8(libc.Uint32FromInt32(-jumpDist) >> libc.Int32FromInt32(8)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(-jumpDist)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - -jumpDist } v27 = delta1 v28 = envPtr2 if v27 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v28 + 64)) += int64(v27) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(-jumpDist)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - -jumpDist } v33 = delta1 v34 = envPtr2 if v33 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v34 + 64)) += int64(v33) } } /* * Fix the starting points of the exception ranges (may have moved due to * jump type modification) and set where the exceptions target. */ (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(bodyRange)*56))).FcodeOffset = int64(bodyCodeOffset) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(bodyRange)*56))).FcontinueOffset = int64(nextCodeOffset) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(nextRange)*56))).FcodeOffset = int64(nextCodeOffset) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(bodyRange)*56))).FbreakOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(nextRange)*56))).FbreakOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) XTclFinalizeLoopExceptionRange(tls, envPtr2, bodyRange) XTclFinalizeLoopExceptionRange(tls, envPtr2, nextRange) /* * The for command's result is an empty string. */ _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileForeachCmd -- * * Procedure called to compile the "foreach" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "foreach" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileForeachCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ return _CompileEachloopCmd(tls, interp, parsePtr, cmdPtr, envPtr, TCL_EACH_KEEP_NONE) } /* *---------------------------------------------------------------------- * * TclCompileLmapCmd -- * * Procedure called to compile the "lmap" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "lmap" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileLmapCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ return _CompileEachloopCmd(tls, interp, parsePtr, cmdPtr, envPtr, int32(TCL_EACH_COLLECT)) } /* *---------------------------------------------------------------------- * * CompileEachloopCmd -- * * Procedure called to compile the "foreach" and "lmap" commands. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "foreach" command at * runtime. * *---------------------------------------------------------------------- */ func _CompileEachloopCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2753 uintptr, envPtr2 uintptr, collect int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Select collecting or accumulating mode * (TCL_EACH_*) */ var _objIndexCopy, _objIndexCopy1, code, delta1, i1, infoIndex, jumpBackOffset, numLists, numWords, range1, varIndex, v19, v26, v38, v4, v50, v55, v59, v63, v67, v69, v75, v87 int32 var _objPtr, bodyTokenPtr, bytes, cachePtr, infoPtr, mapPtr, procPtr, tokenPtr, varListObj, varListPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v20, v22, v23, v24, v25, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v51, v53, v54, v56, v57, v58, v60, v61, v62, v64, v65, v66, v68, v70, v71, v72, v73, v74, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v88, v9, v90 uintptr var eclIndex, j, v89 TTcl_Size var v2, v6 bool var v5, v52 int64 var _ /* length at bp+16 */ TTcl_Size var _ /* numVars at bp+0 */ TTcl_Size var _ /* varNameObj at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objPtr, bodyTokenPtr, bytes, cachePtr, code, delta1, eclIndex, i1, infoIndex, infoPtr, j, jumpBackOffset, mapPtr, numLists, numWords, procPtr, range1, tokenPtr, varIndex, varListObj, varListPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ procPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr infoPtr = libc.UintptrFromInt32(0) code = TCL_OK varListObj = libc.UintptrFromInt32(0) /* * If the foreach command isn't in a procedure, don't compile it inline: * the payoff is too small. */ if procPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) if numWords < int32(4) || numWords%int32(2) != 0 { return int32(TCL_ERROR) } /* * Bail out if the body requires substitutions in order to ensure correct * behaviour. [Bug 219166] */ i1 = 0 tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr for { if !(i1 < numWords-int32(1)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } bodyTokenPtr = tokenPtr if (*TTcl_Token)(unsafe.Pointer(bodyTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return int32(TCL_ERROR) } /* * Create and initialize the ForeachInfo and ForeachVarList data * structures describing this command. Then create a AuxData record * pointing to the ForeachInfo structure. */ numLists = (numWords - int32(2)) / int32(2) infoPtr = XTcl_Alloc(tls, uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(numLists)*uint64(8)) (*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists = 0 /* Count this up as we go */ /* * Parse each var list into sequence of var names. Don't * compile the foreach inline if any var name needs substitutions or isn't * a scalar, or if any var list needs substitutions. */ if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { varListObj = XTclThreadAllocObj(tls) } else { varListObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varListObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(varListObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(varListObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(varListObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(varListObj)).FtypePtr = libc.UintptrFromInt32(0) i1 = 0 tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr for { if !(i1 < numWords-int32(1)) { break } if i1%int32(2) != int32(1) { goto _3 } /* * If the variable list is empty, we can enter an infinite loop when * the interpreted version would not. Take care to ensure this does * not happen. [Bug 1671138] */ if v6 = !(XTclWordKnownAtCompileTime(tls, tokenPtr, varListObj) != 0); !v6 { if (*TTcl_Obj)(unsafe.Pointer(varListObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varListObj + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varListObj + 32))).Fptr2)).FspanLength } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varListObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v5 v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), varListObj, bp) } } if v6 || TCL_OK != v4 || *(*TTcl_Size)(unsafe.Pointer(bp)) == 0 { code = int32(TCL_ERROR) goto done } varListPtr = XTcl_Alloc(tls, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))*uint64(8)) (*TForeachVarList)(unsafe.Pointer(varListPtr)).FnumVars = *(*TTcl_Size)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(infoPtr + 24 + uintptr(i1/int32(2))*8)) = varListPtr (*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists++ j = 0 for { if !(j < *(*TTcl_Size)(unsafe.Pointer(bp))) { break } XTcl_ListObjIndex(tls, libc.UintptrFromInt32(0), varListObj, j, bp+8) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength v8 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes } else { v8 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp+16) } bytes = v8 varIndex = libc.Int32FromUint64(XTclLocalScalar(tls, bytes, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 16))), envPtr2)) if varIndex < 0 { code = int32(TCL_ERROR) goto done } *(*TTcl_Size)(unsafe.Pointer(varListPtr + 8 + uintptr(j)*8)) = int64(varIndex) goto _7 _7: ; j++ } XTcl_SetObjLength(tls, varListObj, 0) goto _3 _3: ; i1++ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } /* * We will compile the foreach command. */ infoIndex = int32(XTclCreateAuxData(tls, infoPtr, uintptr(unsafe.Pointer(&_newForeachInfoType)), envPtr2)) /* * Create the collecting object, unshared. */ if collect == int32(TCL_EACH_COLLECT) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(int32(INST_LIST)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v19 = delta1 v20 = envPtr2 if v19 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v20 + 64)) += int64(v19) } } /* * Evaluate each value list and leave it on stack. */ i1 = 0 tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr for { if !(i1 < numWords-int32(1)) { break } if i1%int32(2) == 0 && i1 > 0 { if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v26 = delta1 v27 = envPtr2 if v26 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v27 + 64)) += int64(v26) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v38 = delta1 v39 = envPtr2 if v38 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v39 + 64)) += int64(v38) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } } goto _21 _21: ; i1++ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = libc.Uint8FromInt32(int32(INST_FOREACH_START)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(infoIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_FOREACH_START)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - infoIndex } v50 = delta1 v51 = envPtr2 if v50 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v51 + 64)) += int64(v50) } /* * Inline compile the loop body. */ range1 = int32(XTclCreateExceptRange(tls, int32(LOOP_EXCEPTION_RANGE), envPtr2)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v52 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v52 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v52 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(numWords-libc.Int32FromInt32(1))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(numWords-libc.Int32FromInt32(1))*8)) XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) if collect == int32(TCL_EACH_COLLECT) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt32(int32(INST_LMAP_COLLECT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LMAP_COLLECT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v55 = delta1 v56 = envPtr2 if v55 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v56)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v56)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v56)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v56)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v56 + 64)) += int64(v55) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v59 = delta1 v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) } } /* * Bottom of loop code: assign each loop variable and check whether * to terminate the loop. Set the loop's break target. */ (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcontinueOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(int32(INST_FOREACH_STEP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_FOREACH_STEP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v63 = delta1 v64 = envPtr2 if v63 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v64 + 64)) += int64(v63) } (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FbreakOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) XTclFinalizeLoopExceptionRange(tls, envPtr2, range1) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = libc.Uint8FromInt32(int32(INST_FOREACH_END)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_FOREACH_END)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v67 = delta1 v68 = envPtr2 if v67 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v68 + 64)) += int64(v67) } v69 = -(numLists + int32(2)) v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) /* * Set the jumpback distance from INST_FOREACH_STEP to the start of the * body's code. Misuse loopCtTemp for storing the jump size. */ jumpBackOffset = int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcontinueOffset - (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset) (*TForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp = int64(-jumpBackOffset) /* * The command's result is an empty string if not collecting. If * collecting, it is automatically left on stack after FOREACH_END. */ if collect != int32(TCL_EACH_COLLECT) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v75 = delta1 v76 = envPtr2 if v75 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v76 + 64)) += int64(v75) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v87 = delta1 v88 = envPtr2 if v87 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v88 + 64)) += int64(v87) } } } goto done done: ; if code == int32(TCL_ERROR) { _FreeForeachInfo(tls, infoPtr) } _objPtr = varListObj v90 = _objPtr v89 = *(*TTcl_Size)(unsafe.Pointer(v90)) *(*TTcl_Size)(unsafe.Pointer(v90))-- if v89 <= int64(1) { XTclFreeObj(tls, _objPtr) } return code } /* *---------------------------------------------------------------------- * * DupForeachInfo -- * * This procedure duplicates a ForeachInfo structure created as auxiliary * data during the compilation of a foreach command. * * Results: * A pointer to a newly allocated copy of the existing ForeachInfo * structure is returned. * * Side effects: * Storage for the copied ForeachInfo record is allocated. If the * original ForeachInfo structure pointed to any ForeachVarList records, * these structures are also copied and pointers to them are stored in * the new ForeachInfo record. * *---------------------------------------------------------------------- */ func _DupForeachInfo(tls *libc.TLS, clientData uintptr) (r uintptr) { /* The foreach command's compilation auxiliary * data to duplicate. */ var dupListPtr, dupPtr, srcListPtr, srcPtr uintptr var i, j, numLists, numVars int32 _, _, _, _, _, _, _, _ = dupListPtr, dupPtr, i, j, numLists, numVars, srcListPtr, srcPtr srcPtr = clientData numLists = int32((*TForeachInfo)(unsafe.Pointer(srcPtr)).FnumLists) dupPtr = XTcl_Alloc(tls, uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(numLists)*uint64(8)) (*TForeachInfo)(unsafe.Pointer(dupPtr)).FnumLists = int64(numLists) (*TForeachInfo)(unsafe.Pointer(dupPtr)).FfirstValueTemp = (*TForeachInfo)(unsafe.Pointer(srcPtr)).FfirstValueTemp (*TForeachInfo)(unsafe.Pointer(dupPtr)).FloopCtTemp = (*TForeachInfo)(unsafe.Pointer(srcPtr)).FloopCtTemp i = 0 for { if !(i < numLists) { break } srcListPtr = *(*uintptr)(unsafe.Pointer(srcPtr + 24 + uintptr(i)*8)) numVars = int32((*TForeachVarList)(unsafe.Pointer(srcListPtr)).FnumVars) dupListPtr = XTcl_Alloc(tls, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(numVars)*uint64(8)) (*TForeachVarList)(unsafe.Pointer(dupListPtr)).FnumVars = int64(numVars) j = 0 for { if !(j < numVars) { break } *(*TTcl_Size)(unsafe.Pointer(dupListPtr + 8 + uintptr(j)*8)) = *(*TTcl_Size)(unsafe.Pointer(srcListPtr + 8 + uintptr(j)*8)) goto _2 _2: ; j++ } *(*uintptr)(unsafe.Pointer(dupPtr + 24 + uintptr(i)*8)) = dupListPtr goto _1 _1: ; i++ } return dupPtr } /* *---------------------------------------------------------------------- * * FreeForeachInfo -- * * Procedure to free a ForeachInfo structure created as auxiliary data * during the compilation of a foreach command. * * Results: * None. * * Side effects: * Storage for the ForeachInfo structure pointed to by the ClientData * argument is freed as is any ForeachVarList record pointed to by the * ForeachInfo structure. * *---------------------------------------------------------------------- */ func _FreeForeachInfo(tls *libc.TLS, clientData uintptr) { /* The foreach command's compilation auxiliary * data to free. */ var i, numLists Tsize_t var infoPtr, listPtr uintptr _, _, _, _ = i, infoPtr, listPtr, numLists infoPtr = clientData numLists = libc.Uint64FromInt64((*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists) i = uint64(0) for { if !(i < numLists) { break } listPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 24 + uintptr(i)*8)) XTclpFree(tls, listPtr) goto _1 _1: ; i++ } XTclpFree(tls, infoPtr) } /* *---------------------------------------------------------------------- * * PrintForeachInfo, DisassembleForeachInfo -- * * Functions to write a human-readable or script-readablerepresentation * of a ForeachInfo structure to a Tcl_Obj for debugging. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _PrintForeachInfo(tls *libc.TLS, clientData uintptr, appendObj uintptr, dummy3051 uintptr, dummy3052 Tsize_t) { bp := tls.Alloc(16) defer tls.Free(16) var i, j TTcl_Size var infoPtr, varsPtr uintptr _, _, _, _ = i, infoPtr, j, varsPtr infoPtr = clientData XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21637, int64(-int32(1))) i = 0 for { if !(i < (*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists) { break } if i != 0 { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21617, int64(-int32(1))) } XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+21620, libc.VaList(bp+8, (*TForeachInfo)(unsafe.Pointer(infoPtr)).FfirstValueTemp+i)) goto _1 _1: ; i++ } XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+21644, libc.VaList(bp+8, (*TForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp)) i = 0 for { if !(i < (*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists) { break } if i != 0 { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21659, int64(-int32(1))) } XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+21661, libc.VaList(bp+8, (*TForeachInfo)(unsafe.Pointer(infoPtr)).FfirstValueTemp+i)) varsPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 24 + uintptr(i)*8)) j = 0 for { if !(j < (*TForeachVarList)(unsafe.Pointer(varsPtr)).FnumVars) { break } if j != 0 { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21617, int64(-int32(1))) } XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+21620, libc.VaList(bp+8, *(*TTcl_Size)(unsafe.Pointer(varsPtr + 8 + uintptr(j)*8)))) goto _3 _3: ; j++ } XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21676, int64(-int32(1))) goto _2 _2: ; i++ } } func _PrintNewForeachInfo(tls *libc.TLS, clientData uintptr, appendObj uintptr, dummy3091 uintptr, dummy3092 Tsize_t) { bp := tls.Alloc(16) defer tls.Free(16) var i, j TTcl_Size var infoPtr, varsPtr uintptr _, _, _, _ = i, infoPtr, j, varsPtr infoPtr = clientData XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+21678, libc.VaList(bp+8, (*TForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp)) i = 0 for { if !(i < (*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists) { break } if i != 0 { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21659, int64(-int32(1))) } XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21701, int64(-int32(1))) varsPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 24 + uintptr(i)*8)) j = 0 for { if !(j < (*TForeachVarList)(unsafe.Pointer(varsPtr)).FnumVars) { break } if j != 0 { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21659, int64(-int32(1))) } XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+21620, libc.VaList(bp+8, *(*TTcl_Size)(unsafe.Pointer(varsPtr + 8 + uintptr(j)*8)))) goto _2 _2: ; j++ } XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21676, int64(-int32(1))) goto _1 _1: ; i++ } } func _DisassembleForeachInfo(tls *libc.TLS, clientData uintptr, dictObj uintptr, dummy3121 uintptr, dummy3122 Tsize_t) { var cachePtr, cachePtr1, cachePtr2, infoPtr, innerPtr, objPtr, varsPtr uintptr var i, j TTcl_Size var v1, v3, v5 bool _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, i, infoPtr, innerPtr, j, objPtr, varsPtr, v1, v3, v5 infoPtr = clientData /* * Data stores. */ if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) i = 0 for { if !(i < (*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists) { break } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), objPtr, XTcl_NewWideIntObj(tls, (*TForeachInfo)(unsafe.Pointer(infoPtr)).FfirstValueTemp+i)) goto _2 _2: ; i++ } XTclDictPut(tls, libc.UintptrFromInt32(0), dictObj, __ccgo_ts+11029, objPtr) /* * Loop counter. */ XTclDictPut(tls, libc.UintptrFromInt32(0), dictObj, __ccgo_ts+21703, XTcl_NewWideIntObj(tls, (*TForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp)) /* * Assignment targets. */ if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) i = 0 for { if !(i < (*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists) { break } if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { innerPtr = XTclThreadAllocObj(tls) } else { innerPtr = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(innerPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(innerPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(innerPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(innerPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(innerPtr)).FtypePtr = libc.UintptrFromInt32(0) varsPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 24 + uintptr(i)*8)) j = 0 for { if !(j < (*TForeachVarList)(unsafe.Pointer(varsPtr)).FnumVars) { break } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), innerPtr, XTcl_NewWideIntObj(tls, *(*TTcl_Size)(unsafe.Pointer(varsPtr + 8 + uintptr(j)*8)))) goto _6 _6: ; j++ } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), objPtr, innerPtr) goto _4 _4: ; i++ } XTclDictPut(tls, libc.UintptrFromInt32(0), dictObj, __ccgo_ts+21708, objPtr) } func _DisassembleNewForeachInfo(tls *libc.TLS, clientData uintptr, dictObj uintptr, dummy3167 uintptr, dummy3168 Tsize_t) { var cachePtr, cachePtr1, infoPtr, innerPtr, objPtr, varsPtr uintptr var i, j TTcl_Size var v1, v3 bool _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, i, infoPtr, innerPtr, j, objPtr, varsPtr, v1, v3 infoPtr = clientData /* * Jump offset. */ XTclDictPut(tls, libc.UintptrFromInt32(0), dictObj, __ccgo_ts+21715, XTcl_NewWideIntObj(tls, (*TForeachInfo)(unsafe.Pointer(infoPtr)).FloopCtTemp)) /* * Assignment targets. */ if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) i = 0 for { if !(i < (*TForeachInfo)(unsafe.Pointer(infoPtr)).FnumLists) { break } if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { innerPtr = XTclThreadAllocObj(tls) } else { innerPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(innerPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(innerPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(innerPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(innerPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(innerPtr)).FtypePtr = libc.UintptrFromInt32(0) varsPtr = *(*uintptr)(unsafe.Pointer(infoPtr + 24 + uintptr(i)*8)) j = 0 for { if !(j < (*TForeachVarList)(unsafe.Pointer(varsPtr)).FnumVars) { break } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), innerPtr, XTcl_NewWideIntObj(tls, *(*TTcl_Size)(unsafe.Pointer(varsPtr + 8 + uintptr(j)*8)))) goto _4 _4: ; j++ } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), objPtr, innerPtr) goto _2 _2: ; i++ } XTclDictPut(tls, libc.UintptrFromInt32(0), dictObj, __ccgo_ts+21708, objPtr) } /* *---------------------------------------------------------------------- * * TclCompileFormatCmd -- * * Procedure called to compile the "format" command. Handles cases that * can be done as constants or simple string concatenation only. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "format" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileFormatCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy3223 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, delta1, i1, j, v104, v114, v18, v30, v52, v64, v73, v8, v85, v92 int32 var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, _objPtr8, _objPtr9, b, bytes, cachePtr, cachePtr1, cachePtr2, cachePtr3, formatObj, mapPtr, objv, start, tmpObj, tokenPtr, v10, v100, v101, v102, v103, v105, v107, v109, v110, v111, v112, v113, v115, v12, v13, v14, v15, v16, v17, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v31, v33, v36, v38, v40, v42, v43, v46, v47, v48, v49, v50, v51, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v65, v67, v69, v70, v71, v72, v74, v75, v76, v77, v78, v79, v80, v81, v82, v83, v84, v86, v87, v88, v89, v90, v91, v93, v94, v95, v96, v97, v98, v99 uintptr var eclIndex, v106, v108, v11, v2, v32, v35, v39, v41, v66, v9 TTcl_Size var v1, v44, v5, v68 bool var _ /* len at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, _objPtr6, _objPtr7, _objPtr8, _objPtr9, b, bytes, cachePtr, cachePtr1, cachePtr2, cachePtr3, delta1, eclIndex, formatObj, i1, j, mapPtr, objv, start, tmpObj, tokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v35, v36, v38, v39, v40, v41, v42, v43, v44, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr /* * Don't handle any guaranteed-error cases. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(2) { return int32(TCL_ERROR) } /* * Check if the argument words are all compile-time-known literals; that's * a case we can handle by compiling to a constant. */ if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { formatObj = XTclThreadAllocObj(tls) } else { formatObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(formatObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(formatObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(formatObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(formatObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(formatObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(formatObj)).FrefCount++ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if !(XTclWordKnownAtCompileTime(tls, tokenPtr, formatObj) != 0) { _objPtr = formatObj v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } return int32(TCL_ERROR) } objv = XTcl_Alloc(tls, libc.Uint64FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2))*uint64(8)) i1 = 0 for { if !(i1+int32(2) < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)))).FrefCount++ if !(XTclWordKnownAtCompileTime(tls, tokenPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8))) != 0) { goto checkForStringConcatCase } goto _4 _4: ; i1++ } /* * Everything is a literal, so the result is constant too (or an error if * the format is broken). Do the format now. */ if (*TTcl_Obj)(unsafe.Pointer(formatObj)).Fbytes != 0 { v6 = (*TTcl_Obj)(unsafe.Pointer(formatObj)).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, formatObj, libc.UintptrFromInt32(0)) } tmpObj = XTcl_Format(tls, interp, v6, int64(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-int32(2)), objv) for { i1-- v8 = i1 if !(v8 >= 0) { break } _objPtr1 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)) v10 = _objPtr1 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr1) } goto _7 _7: } XTclpFree(tls, objv) _objPtr2 = formatObj v12 = _objPtr2 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr2) } if tmpObj == libc.UintptrFromInt32(0) { XTclCompileSyntaxError(tls, interp, envPtr2) return TCL_OK } /* * Not an error, always a constant result, so just push the result as a * literal. Job done. */ if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength v13 = (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes } else { v13 = XTcl_GetStringFromObj(tls, tmpObj, bp) } bytes = v13 _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } } _objPtr3 = tmpObj v33 = _objPtr3 v32 = *(*TTcl_Size)(unsafe.Pointer(v33)) *(*TTcl_Size)(unsafe.Pointer(v33))-- if v32 <= int64(1) { XTclFreeObj(tls, _objPtr3) } return TCL_OK goto checkForStringConcatCase checkForStringConcatCase: ; /* * See if we can generate a sequence of things to concatenate. This * requires that all the % sequences be %s or %%, as everything else is * sufficiently complex that we don't bother. * * First, get the state of the system relatively sensible (cleaning up * after our attempt to spot a literal). */ for { if !(i1 >= 0) { break } _objPtr4 = *(*uintptr)(unsafe.Pointer(objv + uintptr(i1)*8)) v36 = _objPtr4 v35 = *(*TTcl_Size)(unsafe.Pointer(v36)) *(*TTcl_Size)(unsafe.Pointer(v36))-- if v35 <= int64(1) { XTclFreeObj(tls, _objPtr4) } goto _34 _34: ; i1-- } XTclpFree(tls, objv) tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = 0 /* * Now scan through and check for non-%s and non-%% substitutions. */ if (*TTcl_Obj)(unsafe.Pointer(formatObj)).Fbytes != 0 { v38 = (*TTcl_Obj)(unsafe.Pointer(formatObj)).Fbytes } else { v38 = XTcl_GetStringFromObj(tls, formatObj, libc.UintptrFromInt32(0)) } bytes = v38 for { if !(*(*uint8)(unsafe.Pointer(bytes)) != 0) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes))) == int32('%') { bytes++ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes))) == int32('s') { i1++ goto _37 } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes))) == int32('%') { goto _37 } } _objPtr5 = formatObj v40 = _objPtr5 v39 = *(*TTcl_Size)(unsafe.Pointer(v40)) *(*TTcl_Size)(unsafe.Pointer(v40))-- if v39 <= int64(1) { XTclFreeObj(tls, _objPtr5) } return int32(TCL_ERROR) } goto _37 _37: ; bytes++ } /* * Check if the number of things to concatenate will fit in a byte. */ if i1+int32(2) != int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) || i1 > int32(125) { _objPtr6 = formatObj v42 = _objPtr6 v41 = *(*TTcl_Size)(unsafe.Pointer(v42)) *(*TTcl_Size)(unsafe.Pointer(v42))-- if v41 <= int64(1) { XTclFreeObj(tls, _objPtr6) } return int32(TCL_ERROR) } /* * Generate the pushes of the things to concatenate, a sequence of * literals and compiled tokens (of which at least one is non-literal or * we'd have the case in the first half of this function) which we will * concatenate. */ i1 = 0 /* The count of things to concat. */ j = int32(2) /* The index into the argument tokens, for * TIP#280 handling. */ if (*TTcl_Obj)(unsafe.Pointer(formatObj)).Fbytes != 0 { v43 = (*TTcl_Obj)(unsafe.Pointer(formatObj)).Fbytes } else { v43 = XTcl_GetStringFromObj(tls, formatObj, libc.UintptrFromInt32(0)) } start = v43 /* The start of the currently-scanned literal * in the format string. */ if v44 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v44 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v44 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) /* The buffer used to accumulate the literal * being built. */ bytes = start for { if !(*(*uint8)(unsafe.Pointer(bytes)) != 0) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes))) == int32('%') { XTcl_AppendToObj(tls, tmpObj, start, int64(bytes)-int64(start)) bytes++ v46 = bytes if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v46))) == int32('%') { XTcl_AppendToObj(tls, tmpObj, __ccgo_ts+6266, int64(1)) } else { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength v47 = (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes } else { v47 = XTcl_GetStringFromObj(tls, tmpObj, bp) } b = v47 /* * If there is a non-empty literal from the format string, * push it and reset. */ if *(*TTcl_Size)(unsafe.Pointer(bp)) > 0 { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, b, *(*TTcl_Size)(unsafe.Pointer(bp)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v52 = delta1 v53 = envPtr2 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v64 = delta1 v65 = envPtr2 if v64 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v65 + 64)) += int64(v64) } } _objPtr7 = tmpObj v67 = _objPtr7 v66 = *(*TTcl_Size)(unsafe.Pointer(v67)) *(*TTcl_Size)(unsafe.Pointer(v67))-- if v66 <= int64(1) { XTclFreeObj(tls, _objPtr7) } if v68 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v68 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v68 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) i1++ } /* * Push the code to produce the string that would be * substituted with %s, except we'll be concatenating * directly. */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v73 = delta1 v74 = envPtr2 if v73 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v74 + 64)) += int64(v73) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v85 = delta1 v86 = envPtr2 if v85 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v86 + 64)) += int64(v85) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(j)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(j)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 j++ i1++ } start = bytes + uintptr(1) } goto _45 _45: ; bytes++ } /* * Handle the case of a trailing literal. */ XTcl_AppendToObj(tls, tmpObj, start, int64(bytes)-int64(start)) if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength v87 = (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes } else { v87 = XTcl_GetStringFromObj(tls, tmpObj, bp) } bytes = v87 if *(*TTcl_Size)(unsafe.Pointer(bp)) > 0 { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v92 = delta1 v93 = envPtr2 if v92 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v93 + 64)) += int64(v92) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v95 = envPtr2 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v101 = envPtr2 + 152 v100 = *(*uintptr)(unsafe.Pointer(v101)) *(*uintptr)(unsafe.Pointer(v101))++ *(*uint8)(unsafe.Pointer(v100)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v104 = delta1 v105 = envPtr2 if v104 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v105)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v105)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v105)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v105)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v105 + 64)) += int64(v104) } } i1++ } _objPtr8 = tmpObj v107 = _objPtr8 v106 = *(*TTcl_Size)(unsafe.Pointer(v107)) *(*TTcl_Size)(unsafe.Pointer(v107))-- if v106 <= int64(1) { XTclFreeObj(tls, _objPtr8) } _objPtr9 = formatObj v109 = _objPtr9 v108 = *(*TTcl_Size)(unsafe.Pointer(v109)) *(*TTcl_Size)(unsafe.Pointer(v109))-- if v108 <= int64(1) { XTclFreeObj(tls, _objPtr9) } if i1 > int32(1) { /* * Do the concatenation, which produces the result. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v111 = envPtr2 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v113 = envPtr2 + 152 v112 = *(*uintptr)(unsafe.Pointer(v113)) *(*uintptr)(unsafe.Pointer(v113))++ *(*uint8)(unsafe.Pointer(v112)) = uint8(libc.Uint32FromInt32(i1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - i1 } v114 = delta1 v115 = envPtr2 if v114 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v115)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v115)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v115)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v115)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v115 + 64)) += int64(v114) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclLocalScalarFromToken -- * * Get the index into the table of compiled locals that corresponds * to a local scalar variable name. * * Results: * Returns the non-negative integer index value into the table of * compiled locals corresponding to a local scalar variable name. * If the arguments passed in do not identify a local scalar variable * then return TCL_INDEX_NONE. * * Side effects: * May add an entry into the table of compiled locals. * *---------------------------------------------------------------------- */ func XTclLocalScalarFromToken(tls *libc.TLS, tokenPtr uintptr, envPtr uintptr) (r Tsize_t) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* index at bp+4 */ int32 var _ /* isScalar at bp+0 */ int32 XTclPushVarName(tls, libc.UintptrFromInt32(0), tokenPtr, envPtr, int32(TCL_NO_ELEMENT), bp+4, bp) if !(*(*int32)(unsafe.Pointer(bp)) != 0) { *(*int32)(unsafe.Pointer(bp + 4)) = -int32(1) } return libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) } func XTclLocalScalar(tls *libc.TLS, bytes uintptr, numBytes Tsize_t, envPtr uintptr) (r Tsize_t) { bp := tls.Alloc(64) defer tls.Free(64) var _ /* token at bp+0 */ [2]TTcl_Token *(*[2]TTcl_Token)(unsafe.Pointer(bp)) = [2]TTcl_Token{ 0: { Ftype1: int32(TCL_TOKEN_SIMPLE_WORD), FnumComponents: int64(1), }, 1: { Ftype1: int32(TCL_TOKEN_TEXT), }, } (*(*[2]TTcl_Token)(unsafe.Pointer(bp)))[int32(1)].Fstart = bytes (*(*[2]TTcl_Token)(unsafe.Pointer(bp)))[int32(1)].Fsize = libc.Int64FromUint64(numBytes) return XTclLocalScalarFromToken(tls, bp, envPtr) } /* *---------------------------------------------------------------------- * * TclPushVarName -- * * Procedure used in the compiling where pushing a variable name is * necessary (append, lappend, set). * * Results: * The values written to *localIndexPtr and *isScalarPtr signal to * the caller what the instructions emitted by this routine will do: * * *isScalarPtr (*localIndexPtr < 0) * 1 1 Push the varname on the stack. (Stack +1) * 1 0 *localIndexPtr is the index of the compiled * local for this varname. No instructions * emitted. (Stack +0) * 0 1 Push part1 and part2 names of array element * on the stack. (Stack +2) * 0 0 *localIndexPtr is the index of the compiled * local for this array. Element name is pushed * on the stack. (Stack +1) * * Side effects: * Instructions are added to envPtr. * *---------------------------------------------------------------------- */ func XTclPushVarName(tls *libc.TLS, interp uintptr, varTokenPtr uintptr, envPtr2 uintptr, flags int32, localIndexPtr uintptr, isScalarPtr uintptr) { /* Must not be NULL. */ var _objIndexCopy, _objIndexCopy1, allocedTokens, delta1, elemTokenCount, hasNsQualifiers, localIndex, removedParen, simpleVarName, v12, v24, v30, v42 int32 var elName, elemTokenPtr, last, name, p, v1, v10, v11, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v25, v26, v27, v28, v29, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v43, v8, v9 uintptr var elNameLen, n, nameLen, remainingLen, v2, v4 Tsize_t var v5 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, allocedTokens, delta1, elName, elNameLen, elemTokenCount, elemTokenPtr, hasNsQualifiers, last, localIndex, n, name, nameLen, p, remainingLen, removedParen, simpleVarName, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v5, v8, v9 elemTokenPtr = libc.UintptrFromInt32(0) elemTokenCount = 0 allocedTokens = 0 removedParen = 0 /* * Decide if we can use a frame slot for the var/array name or if we need * to emit code to compute and push the name at runtime. We use a frame * slot (entry in the array of local vars) if we are compiling a procedure * body and if the name is simple text that does not include namespace * qualifiers. */ simpleVarName = 0 v1 = libc.UintptrFromInt32(0) elName = v1 name = v1 v2 = libc.Uint64FromInt32(0) elNameLen = v2 nameLen = v2 localIndex = -int32(1) if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { /* * A simple variable name. Divide it up into "name" and "elName" * strings. If it is not a local variable, look it up at runtime. */ simpleVarName = int32(1) name = (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart nameLen = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(name + uintptr(nameLen-uint64(1))))) == int32(')') { /* * last char is ')' => potential array reference. */ last = name + uintptr(nameLen-uint64(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(last))) == int32(')') { p = name for { if !(p < last) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('(') { elName = p + uintptr(1) elNameLen = libc.Uint64FromInt64(int64(last) - int64(elName)) nameLen = libc.Uint64FromInt64(int64(p) - int64(name)) break } goto _3 _3: ; p++ } } if !(flags&libc.Int32FromInt32(TCL_NO_ELEMENT) != 0) && elNameLen != 0 { /* * An array element, the element name is a simple string: * assemble the corresponding token. */ elemTokenPtr = XTclStackAlloc(tls, interp, uint64(32)) allocedTokens = int32(1) (*TTcl_Token)(unsafe.Pointer(elemTokenPtr)).Ftype1 = int32(TCL_TOKEN_TEXT) (*TTcl_Token)(unsafe.Pointer(elemTokenPtr)).Fstart = elName (*TTcl_Token)(unsafe.Pointer(elemTokenPtr)).Fsize = libc.Int64FromUint64(elNameLen) (*TTcl_Token)(unsafe.Pointer(elemTokenPtr)).FnumComponents = 0 elemTokenCount = int32(1) } } } else { if v5 = interp != 0; v5 { v4 = libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents) n = v4 } if v5 && v4 > uint64(1) && (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Ftype1 == int32(TCL_TOKEN_TEXT) && (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + uintptr(n)*32))).Ftype1 == int32(TCL_TOKEN_TEXT) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + uintptr(n)*32))).Fstart + uintptr((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + uintptr(n)*32))).Fsize) - libc.UintptrFromInt32(1)))) == int32(')') { /* * Check for parentheses inside first token. */ simpleVarName = 0 p = (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart last = p + uintptr((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize) for { if !(p < last) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('(') { simpleVarName = int32(1) break } goto _6 _6: ; p++ } if simpleVarName != 0 { /* * Check the last token: if it is just ')', do not count it. * Otherwise, remove the ')' and flag so that it is restored at * the end. */ if (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + uintptr(n)*32))).Fsize == int64(1) { n-- } else { (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + uintptr(n)*32))).Fsize-- removedParen = libc.Int32FromUint64(n) } name = (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart nameLen = libc.Uint64FromInt64(int64(p) - int64((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart)) elName = p + uintptr(1) remainingLen = libc.Uint64FromInt64(int64((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 2*32))).Fstart) - int64(p) - int64(1)) elNameLen = libc.Uint64FromInt64(int64((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + uintptr(n)*32))).Fstart) - int64(p) + (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + uintptr(n)*32))).Fsize - int64(1)) if !(flags&libc.Int32FromInt32(TCL_NO_ELEMENT) != 0) { if remainingLen != 0 { /* * Make a first token with the extra characters in the first * token. */ elemTokenPtr = XTclStackAlloc(tls, interp, n*uint64(32)) allocedTokens = int32(1) (*TTcl_Token)(unsafe.Pointer(elemTokenPtr)).Ftype1 = int32(TCL_TOKEN_TEXT) (*TTcl_Token)(unsafe.Pointer(elemTokenPtr)).Fstart = elName (*TTcl_Token)(unsafe.Pointer(elemTokenPtr)).Fsize = libc.Int64FromUint64(remainingLen) (*TTcl_Token)(unsafe.Pointer(elemTokenPtr)).FnumComponents = 0 elemTokenCount = libc.Int32FromUint64(n) /* * Copy the remaining tokens. */ libc.Xmemcpy(tls, elemTokenPtr+uintptr(1)*32, varTokenPtr+uintptr(2)*32, (n-uint64(1))*uint64(32)) } else { /* * Use the already available tokens. */ elemTokenPtr = varTokenPtr + 2*32 elemTokenCount = libc.Int32FromUint64(n - uint64(1)) } } } } } if simpleVarName != 0 { /* * See whether name has any namespace separators (::'s). */ hasNsQualifiers = 0 p = name last = p + uintptr(nameLen) - libc.UintptrFromInt32(1) for { if !(p < last) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(':') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) == int32(':') { hasNsQualifiers = int32(1) break } goto _7 _7: ; p++ } /* * Look up the var name's index in the array of local vars in the proc * frame. If retrieving the var's value and it doesn't already exist, * push its name and look it up at runtime. */ if !(hasNsQualifiers != 0) { localIndex = int32(XTclFindCompiledLocal(tls, name, libc.Int64FromUint64(nameLen), int32(1), envPtr2)) if flags&int32(TCL_NO_LARGE_INDEX) != 0 && localIndex > int32(255) { /* * We'll push the name. */ localIndex = -int32(1) } } if interp != 0 && localIndex < 0 { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, name, libc.Int64FromUint64(nameLen), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v12 = delta1 v13 = envPtr2 if v12 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v13 + 64)) += int64(v12) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } } /* * Compile the element script, if any, and only if not inhibited. [Bug * 3600328] */ if elName != libc.UintptrFromInt32(0) && !(flags&libc.Int32FromInt32(TCL_NO_ELEMENT) != 0) { if elNameLen != 0 { XTclCompileTokens(tls, interp, elemTokenPtr, libc.Uint64FromInt32(elemTokenCount), envPtr2) } else { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } } } } } else { if interp != 0 { /* * The var name isn't simple: compile and push it. */ XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents), envPtr2) } } if removedParen != 0 { (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + uintptr(removedParen)*32))).Fsize++ } if allocedTokens != 0 { XTclStackFree(tls, interp, elemTokenPtr) } *(*int32)(unsafe.Pointer(localIndexPtr)) = localIndex *(*int32)(unsafe.Pointer(isScalarPtr)) = libc.BoolInt32(elName == libc.UintptrFromInt32(0)) } /* *---------------------------------------------------------------------- * * TclGetIndexFromToken -- * * Parse a token to determine if an index value is known at * compile time. * * Returns: * TCL_OK if parsing succeeded, and TCL_ERROR if it failed. * * Side effects: * When TCL_OK is returned, the encoded index value is written * to *index. * *---------------------------------------------------------------------- */ func XTclGetIndexFromToken(tls *libc.TLS, tokenPtr uintptr, before Tsize_t, after Tsize_t, indexPtr uintptr) (r int32) { var _objPtr, cachePtr, tmpObj, v3 uintptr var result int32 var v1 bool var v2 TTcl_Size _, _, _, _, _, _, _ = _objPtr, cachePtr, result, tmpObj, v1, v2, v3 result = int32(TCL_ERROR) if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) if XTclWordKnownAtCompileTime(tls, tokenPtr, tmpObj) != 0 { result = XTclIndexEncode(tls, libc.UintptrFromInt32(0), tmpObj, libc.Int32FromUint64(before), libc.Int32FromUint64(after), indexPtr) } _objPtr = tmpObj v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } return result } /* *---------------------------------------------------------------------- * * TclCompileGlobalCmd -- * * Procedure called to compile the "global" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "global" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileGlobalCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy90 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, i1, localIndex, numWords, v17, v24, v36, v48, v5, v52, v58, v70 int32 var eclIndex TTcl_Size var mapPtr, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v2, v20, v21, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v49, v50, v51, v53, v54, v55, v56, v57, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v71, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, eclIndex, i1, localIndex, mapPtr, numWords, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TODO: Consider support for compiling expanded args. */ numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) if numWords < int32(2) { return int32(TCL_ERROR) } /* * 'global' has no effect outside of proc bodies; handle that at runtime */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * Push the namespace */ _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+7650, libc.Int64FromUint64(libc.Uint64FromInt64(3)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } /* * Loop over the variables. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(1) for { if !(i1 < numWords) { break } localIndex = _IndexTailVarIfKnown(tls, interp, varTokenPtr, envPtr2) if localIndex < 0 { return int32(TCL_ERROR) } /* * TODO: Consider what value can pass through the * IndexTailVarIfKnown() screen. Full CompileWord() likely does not * apply here. Push known value instead. */ if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_NSUPVAR)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(24)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(16)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(8)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(localIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NSUPVAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - localIndex } v48 = delta1 v49 = envPtr2 if v48 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v49 + 64)) += int64(v48) } goto _19 _19: ; varTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1++ } /* * Pop the namespace, and set the result to empty */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v52 = delta1 v53 = envPtr2 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v58 = delta1 v59 = envPtr2 if v58 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v59)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v59)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v59)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v59)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v59 + 64)) += int64(v58) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v70 = delta1 v71 = envPtr2 if v70 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v71 + 64)) += int64(v70) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileIfCmd -- * * Procedure called to compile the "if" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "if" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileIfCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy171 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(416) defer tls.Free(416) /* Holds resulting instructions. */ var _objIndexCopy, code, compileScripts, delta1, jumpFalseDist, jumpIndex, numWords, realCond, wordIdx, v11, v23, v5 int32 var boolObj, cachePtr, ifFalsePc, mapPtr, testTokenPtr, tokenPtr, word, v10, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v24, v3, v6, v7, v8, v9 uintptr var eclIndex, v2 TTcl_Size var j, numBytes Tsize_t var opCode uint8 var v4 bool var _ /* boolVal at bp+384 */ int32 var _ /* jumpEndFixupArray at bp+192 */ TJumpFixupArray var _ /* jumpFalseFixupArray at bp+0 */ TJumpFixupArray _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, boolObj, cachePtr, code, compileScripts, delta1, eclIndex, ifFalsePc, j, jumpFalseDist, jumpIndex, mapPtr, numBytes, numWords, opCode, realCond, testTokenPtr, tokenPtr, word, wordIdx, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) jumpIndex = 0 realCond = int32(1) /* Value of static condition. */ compileScripts = int32(1) /* * Only compile the "if" command if all arguments are simple words, in * order to insure correct substitution [Bug 219166] */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr wordIdx = 0 numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) wordIdx = 0 for { if !(wordIdx < numWords) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return int32(TCL_ERROR) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; wordIdx++ } XTclInitJumpFixupArray(tls, bp) XTclInitJumpFixupArray(tls, bp+192) code = TCL_OK /* * Each iteration of this loop compiles one "if expr ?then? body" or * "elseif expr ?then? body" clause. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr wordIdx = 0 for wordIdx < numWords { /* * Stop looping if the token isn't "if" or "elseif". */ word = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart numBytes = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize) if tokenPtr == (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr || numBytes == uint64(6) && libc.Xstrncmp(tls, word, __ccgo_ts+16217, uint64(6)) == 0 { tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 wordIdx++ } else { break } if wordIdx >= numWords { code = int32(TCL_ERROR) goto done } /* * Compile the test expression then emit the conditional jump around * the "then" part. */ testTokenPtr = tokenPtr if realCond != 0 { /* * Find out if the condition is a constant. */ boolObj = XTcl_NewStringObj(tls, (*(*TTcl_Token)(unsafe.Pointer(testTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(testTokenPtr + 1*32))).Fsize) (*TTcl_Obj)(unsafe.Pointer(boolObj)).FrefCount++ code = XTcl_GetBoolFromObj(tls, libc.UintptrFromInt32(0), boolObj, (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp+384) v3 = boolObj v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if !(v2 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = int64(-libc.Int32FromInt32(1)) if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, boolObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = boolObj (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, boolObj) } } if code == TCL_OK { /* * A static condition. */ realCond = 0 if !(*(*int32)(unsafe.Pointer(bp + 384)) != 0) { compileScripts = 0 } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(wordIdx)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(wordIdx)*8)) XTcl_ResetResult(tls, interp) XTclCompileExprWords(tls, interp, testTokenPtr, uint64(1), envPtr2) if (*(*TJumpFixupArray)(unsafe.Pointer(bp))).Fnext >= (*(*TJumpFixupArray)(unsafe.Pointer(bp))).Fend { XTclExpandJumpFixupArray(tls, bp) } jumpIndex = int32((*(*TJumpFixupArray)(unsafe.Pointer(bp))).Fnext) (*(*TJumpFixupArray)(unsafe.Pointer(bp))).Fnext++ XTclEmitForwardJump(tls, envPtr2, int32(TCL_FALSE_JUMP), (*(*TJumpFixupArray)(unsafe.Pointer(bp))).Ffixup+uintptr(jumpIndex)*16) } code = TCL_OK } /* * Skip over the optional "then" before the then clause. */ tokenPtr = testTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(testTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 wordIdx++ if wordIdx >= numWords { code = int32(TCL_ERROR) goto done } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { word = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart numBytes = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize) if numBytes == uint64(4) && libc.Xstrncmp(tls, word, __ccgo_ts+16212, uint64(4)) == 0 { tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 wordIdx++ if wordIdx >= numWords { code = int32(TCL_ERROR) goto done } } } /* * Compile the "then" command body. */ if compileScripts != 0 { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(wordIdx)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(wordIdx)*8)) XTclCompileCmdWord(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if realCond != 0 { /* * Jump to the end of the "if" command. Both jumpFalseFixupArray * and jumpEndFixupArray are indexed by "jumpIndex". */ if (*(*TJumpFixupArray)(unsafe.Pointer(bp + 192))).Fnext >= (*(*TJumpFixupArray)(unsafe.Pointer(bp + 192))).Fend { XTclExpandJumpFixupArray(tls, bp+192) } (*(*TJumpFixupArray)(unsafe.Pointer(bp + 192))).Fnext++ XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), (*(*TJumpFixupArray)(unsafe.Pointer(bp + 192))).Ffixup+uintptr(jumpIndex)*16) /* * Fix the target of the jumpFalse after the test. Generate a 4 * byte jump if the distance is > 120 bytes. This is conservative, * and ensures that we won't have to replace this jump if we later * also need to replace the proceeding jump to the end of the "if" * with a 4 byte jump. */ v5 = -int32(1) v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) if XTclFixupForwardJump(tls, envPtr2, (*(*TJumpFixupArray)(unsafe.Pointer(bp))).Ffixup+uintptr(jumpIndex)*16, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer((*(*TJumpFixupArray)(unsafe.Pointer(bp))).Ffixup+uintptr(jumpIndex)*16)).FcodeOffset))), int32(120)) != 0 { /* * Adjust the code offset for the proceeding jump to the end * of the "if" command. */ (*(*TJumpFixup)(unsafe.Pointer((*(*TJumpFixupArray)(unsafe.Pointer(bp + 192))).Ffixup + uintptr(jumpIndex)*16))).FcodeOffset += uint32(3) } } else { if *(*int32)(unsafe.Pointer(bp + 384)) != 0 { /* * We were processing an "if 1 {...}"; stop compiling scripts. */ compileScripts = 0 } else { /* * We were processing an "if 0 {...}"; reset so that the rest * (elseif, else) is compiled correctly. */ realCond = int32(1) compileScripts = int32(1) } } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 wordIdx++ } /* * Check for the optional else clause. Do not compile anything if this was * an "if 1 {...}" case. */ if wordIdx < numWords && (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { /* * There is an else clause. Skip over the optional "else" word. */ word = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart numBytes = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize) if numBytes == uint64(4) && libc.Xstrncmp(tls, word, __ccgo_ts+16224, uint64(4)) == 0 { tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 wordIdx++ if wordIdx >= numWords { code = int32(TCL_ERROR) goto done } } if compileScripts != 0 { /* * Compile the else command body. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(wordIdx)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(wordIdx)*8)) XTclCompileCmdWord(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } /* * Make sure there are no words after the else clause. */ wordIdx++ if wordIdx < numWords { code = int32(TCL_ERROR) goto done } } else { /* * No else clause: the "if" command's result is an empty string. */ if compileScripts != 0 { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v11 = delta1 v12 = envPtr2 if v11 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v12 + 64)) += int64(v11) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } } } /* * Fix the unconditional jumps to the end of the "if" command. */ j = libc.Uint64FromInt64((*(*TJumpFixupArray)(unsafe.Pointer(bp + 192))).Fnext) for { if !(j > uint64(0)) { break } jumpIndex = libc.Int32FromUint64(j - libc.Uint64FromInt32(1)) /* i.e. process the closest jump first. */ if XTclFixupForwardJump(tls, envPtr2, (*(*TJumpFixupArray)(unsafe.Pointer(bp + 192))).Ffixup+uintptr(jumpIndex)*16, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer((*(*TJumpFixupArray)(unsafe.Pointer(bp + 192))).Ffixup+uintptr(jumpIndex)*16)).FcodeOffset))), int32(127)) != 0 { /* * Adjust the immediately preceding "ifFalse" jump. We moved it's * target (just after this jump) down three bytes. */ ifFalsePc = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr((*(*TJumpFixup)(unsafe.Pointer((*(*TJumpFixupArray)(unsafe.Pointer(bp))).Ffixup + uintptr(jumpIndex)*16))).FcodeOffset) opCode = *(*uint8)(unsafe.Pointer(ifFalsePc)) if libc.Int32FromUint8(opCode) == int32(INST_JUMP_FALSE1) { jumpFalseDist = int32(*(*int8)(unsafe.Pointer(ifFalsePc + libc.UintptrFromInt32(1)))) jumpFalseDist += int32(3) *(*uint8)(unsafe.Pointer(ifFalsePc + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpFalseDist)) } else { if libc.Int32FromUint8(opCode) == int32(INST_JUMP_FALSE4) { jumpFalseDist = libc.Int32FromUint32(uint32(*(*uint8)(unsafe.Pointer(ifFalsePc + libc.UintptrFromInt32(1))))<> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(ifFalsePc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpFalseDist) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(ifFalsePc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(jumpFalseDist) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(ifFalsePc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(jumpFalseDist)) } else { XTcl_Panic(tls, __ccgo_ts+21726, libc.VaList(bp+400, libc.Int32FromUint8(opCode))) } } } goto _25 _25: ; j-- } /* * Free the jumpFixupArray array if malloc'ed storage was used. */ goto done done: ; XTclFreeJumpFixupArray(tls, bp) XTclFreeJumpFixupArray(tls, bp+192) return code } /* *---------------------------------------------------------------------- * * TclCompileIncrCmd -- * * Procedure called to compile the "incr" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "incr" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileIncrCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy474 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, code, delta1, haveImmValue, v1, v21, v27, v35, v41, v45, v51, v59, v65, v69, v9 int32 var cachePtr, incrTokenPtr, intObj, mapPtr, varTokenPtr, word, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v22, v23, v24, v25, v26, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v40, v42, v43, v44, v46, v47, v48, v49, v5, v50, v52, v53, v54, v55, v56, v57, v58, v6, v60, v61, v62, v63, v64, v66, v67, v68, v7, v70, v8 uintptr var eclIndex, v2 TTcl_Size var numBytes Tsize_t var v4 bool var _ /* immValue at bp+8 */ TTcl_WideInt var _ /* isScalar at bp+0 */ int32 var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, cachePtr, code, delta1, eclIndex, haveImmValue, incrTokenPtr, intObj, mapPtr, numBytes, varTokenPtr, word, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) && (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, varTokenPtr, envPtr2, int32(TCL_NO_LARGE_INDEX), bp+4, bp) /* * If an increment is given, push it, but see first if it's a small * integer. */ haveImmValue = 0 *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(3) { incrTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(incrTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { word = (*(*TTcl_Token)(unsafe.Pointer(incrTokenPtr + 1*32))).Fstart numBytes = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(incrTokenPtr + 1*32))).Fsize) intObj = XTcl_NewStringObj(tls, word, libc.Int64FromUint64(numBytes)) (*TTcl_Obj)(unsafe.Pointer(intObj)).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(intObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclIntType)) { *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) = *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(intObj)).FinternalRep)) v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_GetWideIntFromObj(tls, libc.UintptrFromInt32(0), intObj, bp+8) } code = v1 if code == TCL_OK && int64(-int32(127)) <= *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) && *(*TTcl_WideInt)(unsafe.Pointer(bp + 8)) <= int64(127) { haveImmValue = int32(1) } v3 = intObj v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if !(v2 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(intObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(intObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(intObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(intObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(intObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(intObj)).Flength = int64(-libc.Int32FromInt32(1)) if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, intObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(intObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = intObj (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, intObj) } } if !(haveImmValue != 0) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, word, libc.Int64FromUint64(numBytes), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v9 = delta1 v10 = envPtr2 if v9 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v10 + 64)) += int64(v9) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, incrTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(incrTokenPtr)).FnumComponents), envPtr2) } } else { /* No incr amount given so use 1. */ haveImmValue = int32(1) } /* * Emit the instruction to increment the variable. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { /* Simple scalar variable. */ if *(*int32)(unsafe.Pointer(bp + 4)) >= 0 { if haveImmValue != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(INST_INCR_SCALAR1_IMM)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INCR_SCALAR1_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v27 = delta1 v28 = envPtr2 if v27 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v28 + 64)) += int64(v27) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)))) } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = libc.Uint8FromInt32(int32(INST_INCR_SCALAR1)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INCR_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { if haveImmValue != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_INCR_STK_IMM)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INCR_STK_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_INCR_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INCR_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v45 = delta1 v46 = envPtr2 if v45 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v46 + 64)) += int64(v45) } } } } else { /* Simple array variable. */ if *(*int32)(unsafe.Pointer(bp + 4)) >= 0 { if haveImmValue != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt32(int32(INST_INCR_ARRAY1_IMM)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INCR_ARRAY1_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)))) } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_INCR_ARRAY1)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INCR_ARRAY1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v59 = delta1 v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) } } } else { if haveImmValue != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(int32(INST_INCR_ARRAY_STK_IMM)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INCR_ARRAY_STK_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(*(*TTcl_WideInt)(unsafe.Pointer(bp + 8))) } v65 = delta1 v66 = envPtr2 if v65 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v66 + 64)) += int64(v65) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = libc.Uint8FromInt32(int32(INST_INCR_ARRAY_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INCR_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } } } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileInfo*Cmd -- * * Procedures called to compile "info" subcommands. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "info" subcommand at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileInfoCommandsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { var _objIndexCopy, delta1, v21, v25, v29, v33, v39, v51, v9 int32 var _objPtr, _objPtr1, bytes, cachePtr, mapPtr, objPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v22, v23, v24, v26, v27, v28, v30, v31, v32, v34, v35, v36, v37, v38, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v52, v54, v6, v7, v8 uintptr var eclIndex, v3, v53 TTcl_Size var v1 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objPtr, _objPtr1, bytes, cachePtr, delta1, eclIndex, mapPtr, objPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * We require one compile-time known argument for the case we can compile. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(1) { return XTclCompileBasic0ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } else { if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ if !(XTclWordKnownAtCompileTime(tls, tokenPtr, objPtr) != 0) { goto notCompilable } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, objPtr, libc.UintptrFromInt32(0)) } bytes = v2 /* * We require that the argument start with "::" and not have any of "*\[?" * in it. (Theoretically, we should look in only the final component, but * the difference is so slight given current naming practices.) */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes))) != int32(':') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes + 1))) != int32(':') || !(libc.Xstrpbrk(tls, bytes, __ccgo_ts+16411) == libc.UintptrFromInt32(0)) { goto notCompilable } _objPtr = objPtr v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } /* * Confirmed as a literal that will not frighten the horses. Compile. * The result must be made into a list. */ /* TODO: Just push the known value */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v9 = delta1 v10 = envPtr2 if v9 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v10 + 64)) += int64(v9) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(INST_RESOLVE_COMMAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RESOLVE_COMMAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v25 = delta1 v26 = envPtr2 if v25 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v26 + 64)) += int64(v25) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v29 = delta1 v30 = envPtr2 if v29 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v30)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v30)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v30)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v30)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v30 + 64)) += int64(v29) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = libc.Uint8FromInt32(int32(INST_STR_LEN)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_LEN)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v33 = delta1 v34 = envPtr2 if v33 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v34)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v34)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v34 + 64)) += int64(v33) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(7))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(7) } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_LIST)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } return TCL_OK goto notCompilable notCompilable: ; _objPtr1 = objPtr v54 = _objPtr1 v53 = *(*TTcl_Size)(unsafe.Pointer(v54)) *(*TTcl_Size)(unsafe.Pointer(v54))-- if v53 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return XTclCompileBasic1ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } func XTclCompileInfoCoroutineCmd(tls *libc.TLS, dummy643 uintptr, parsePtr uintptr, dummy646 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var delta1, v3 int32 var v1, v2, v4 uintptr _, _, _, _, _ = delta1, v1, v2, v3, v4 /* * Only compile [info coroutine] without arguments. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(1) { return int32(TCL_ERROR) } /* * Not much to do; we compile to a single instruction... */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_COROUTINE_NAME)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_COROUTINE_NAME)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } return TCL_OK } func XTclCompileInfoExistsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy670 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var delta1, v15, v19, v3, v31 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v16, v17, v18, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v32, v4, v5, v6, v7, v8, v9 uintptr var _ /* isScalar at bp+0 */ int32 var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } /* * Decide if we can use a frame slot for the var/array name or if we need * to emit code to compute and push the name at runtime. We use a frame * slot (entry in the array of local vars) if we are compiling a procedure * body and if the name is simple text that does not include namespace * qualifiers. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, tokenPtr, envPtr2, 0, bp+4, bp) /* * Emit instruction to check the variable for existence. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_EXIST_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EXIST_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32(INST_EXIST_SCALAR)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EXIST_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v15 = delta1 v16 = envPtr2 if v15 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v16 + 64)) += int64(v15) } } } else { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = libc.Uint8FromInt32(int32(INST_EXIST_ARRAY_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EXIST_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v19 = delta1 v20 = envPtr2 if v19 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v20 + 64)) += int64(v19) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = libc.Uint8FromInt32(int32(INST_EXIST_ARRAY)) v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EXIST_ARRAY)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v31 = delta1 v32 = envPtr2 if v31 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v32)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v32)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v32)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v32)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v32 + 64)) += int64(v31) } } } return TCL_OK } func XTclCompileInfoLevelCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy718 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, v21, v25, v3, v9 int32 var eclIndex TTcl_Size var mapPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v22, v23, v24, v26, v4, v5, v6, v7, v8 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v3, v4, v5, v6, v7, v8, v9 /* * Only compile [info level] without arguments or with a single argument. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(1) { /* * Not much to do; we compile to a single instruction... */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_INFO_LEVEL_NUM)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INFO_LEVEL_NUM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } } else { if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } else { mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ /* * Compile the argument, then add the instruction to convert it into a * list of arguments. */ if (*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr+uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v9 = delta1 v10 = envPtr2 if v9 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v10)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v10)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v10 + 64)) += int64(v9) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr+uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr+uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(INST_INFO_LEVEL_ARGS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INFO_LEVEL_ARGS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v25 = delta1 v26 = envPtr2 if v25 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v26 + 64)) += int64(v25) } } } return TCL_OK } func XTclCompileInfoObjectClassCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy752 uintptr, envPtr2 uintptr) (r int32) { var _objIndexCopy, delta1, v17, v21, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_TCLOO_CLASS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TCLOO_CLASS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } return TCL_OK } func XTclCompileInfoObjectIsACmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy771 uintptr, envPtr2 uintptr) (r int32) { var _objIndexCopy, delta1, v17, v21, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * We only handle [info object isa object ]. The first three * words are compressed to a single token by the ensemble compilation * engine. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize < int64(1) || libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, __ccgo_ts+6499, libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize)) != 0 { return int32(TCL_ERROR) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * Issue the code. */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_TCLOO_IS_OBJECT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TCLOO_IS_OBJECT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } return TCL_OK } func XTclCompileInfoObjectNamespaceCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy806 uintptr, envPtr2 uintptr) (r int32) { var _objIndexCopy, delta1, v17, v21, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_TCLOO_NS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TCLOO_NS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileLappendCmd -- * * Procedure called to compile the "lappend" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "lappend" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileLappendCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy843 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, i1, numWords, v108, v112, v124, v17, v21, v27, v39, v43, v49, v5, v61, v68, v80, v92, v96 int32 var eclIndex TTcl_Size var mapPtr, valueTokenPtr, varTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v109, v11, v110, v111, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v125, v13, v14, v15, v16, v18, v19, v2, v20, v22, v23, v24, v25, v26, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v41, v42, v44, v45, v46, v47, v48, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v62, v64, v65, v66, v67, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v95, v97, v98, v99 uintptr var _ /* isScalar at bp+0 */ int32 var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, i1, mapPtr, numWords, valueTokenPtr, varTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TODO: Consider support for compiling expanded args. */ numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) if numWords < int32(3) { return int32(TCL_ERROR) } if numWords != int32(3) || (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr == libc.UintptrFromInt32(0) { goto lappendMultiple } /* * Decide if we can use a frame slot for the var/array name or if we * need to emit code to compute and push the name at runtime. We use a * frame slot (entry in the array of local vars) if we are compiling a * procedure body and if the name is simple text that does not include * namespace qualifiers. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, varTokenPtr, envPtr2, 0, bp+4, bp) /* * If we are doing an assignment, push the new value. In the no values * case, create an empty object. */ if numWords > int32(2) { valueTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } } /* * Emit instructions to set/get the variable. */ /* * The *_STK opcodes should be refactored to make better use of existing * LOAD/STORE instructions. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_LAPPEND_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } } else { if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(INST_LAPPEND_SCALAR1)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v27 = delta1 v28 = envPtr2 if v27 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v28 + 64)) += int64(v27) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = libc.Uint8FromInt32(int32(INST_LAPPEND_SCALAR4)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } } } } else { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_LAPPEND_ARRAY_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v43 = delta1 v44 = envPtr2 if v43 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v44 + 64)) += int64(v43) } } else { if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = libc.Uint8FromInt32(int32(INST_LAPPEND_ARRAY1)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_ARRAY1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v49 = delta1 v50 = envPtr2 if v49 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v50 + 64)) += int64(v49) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = libc.Uint8FromInt32(int32(INST_LAPPEND_ARRAY4)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_ARRAY4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v61 = delta1 v62 = envPtr2 if v61 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v62 + 64)) += int64(v61) } } } } return TCL_OK goto lappendMultiple lappendMultiple: ; varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, varTokenPtr, envPtr2, 0, bp+4, bp) valueTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(2) for { if !(i1 < numWords) { break } if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v68 = delta1 v69 = envPtr2 if v68 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v69 + 64)) += int64(v68) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v80 = delta1 v81 = envPtr2 if v80 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v81)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v81)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v81)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v81)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v81 + 64)) += int64(v80) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } valueTokenPtr = valueTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _63 _63: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v83 = envPtr2 + 152 v82 = *(*uintptr)(unsafe.Pointer(v83)) *(*uintptr)(unsafe.Pointer(v83))++ *(*uint8)(unsafe.Pointer(v82)) = libc.Uint8FromInt32(int32(INST_LIST)) v85 = envPtr2 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = uint8(libc.Uint32FromInt32(numWords-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = uint8(libc.Uint32FromInt32(numWords-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = uint8(libc.Uint32FromInt32(numWords-libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(numWords - libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (numWords - int32(2)) } v92 = delta1 v93 = envPtr2 if v92 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v93)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v93)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v93 + 64)) += int64(v92) } if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v95 = envPtr2 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = libc.Uint8FromInt32(int32(INST_LAPPEND_LIST_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_LIST_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v96 = delta1 v97 = envPtr2 if v96 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v97)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v97)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v97)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v97)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v97 + 64)) += int64(v96) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = libc.Uint8FromInt32(int32(INST_LAPPEND_LIST)) v101 = envPtr2 + 152 v100 = *(*uintptr)(unsafe.Pointer(v101)) *(*uintptr)(unsafe.Pointer(v101))++ *(*uint8)(unsafe.Pointer(v100)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v107 = envPtr2 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v108 = delta1 v109 = envPtr2 if v108 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v109)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v109)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v109)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v109)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v109 + 64)) += int64(v108) } } } else { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v111 = envPtr2 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = libc.Uint8FromInt32(int32(INST_LAPPEND_LIST_ARRAY_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_LIST_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v112 = delta1 v113 = envPtr2 if v112 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v113 + 64)) += int64(v112) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = libc.Uint8FromInt32(int32(INST_LAPPEND_LIST_ARRAY)) v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v119 = envPtr2 + 152 v118 = *(*uintptr)(unsafe.Pointer(v119)) *(*uintptr)(unsafe.Pointer(v119))++ *(*uint8)(unsafe.Pointer(v118)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v123 = envPtr2 + 152 v122 = *(*uintptr)(unsafe.Pointer(v123)) *(*uintptr)(unsafe.Pointer(v123))++ *(*uint8)(unsafe.Pointer(v122)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LAPPEND_LIST_ARRAY)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v124 = delta1 v125 = envPtr2 if v124 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v125 + 64)) += int64(v124) } } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileLassignCmd -- * * Procedure called to compile the "lassign" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "lassign" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileLassignCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy958 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, delta1, idx, numWords, v100, v112, v118, v130, v134, v146, v158, v162, v166, v17, v178, v22, v34, v40, v5, v52, v56, v68, v80, v84, v88 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v113, v114, v115, v116, v117, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v131, v132, v133, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v159, v16, v160, v161, v163, v164, v165, v167, v168, v169, v170, v171, v172, v173, v174, v175, v176, v177, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v2, v20, v21, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v35, v36, v37, v38, v39, v4, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v53, v54, v55, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v81, v82, v83, v85, v86, v87, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 uintptr var _ /* isScalar at bp+0 */ int32 var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, idx, mapPtr, numWords, tokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) /* * Check for command syntax error, but we'll punt that to runtime. */ if numWords < int32(3) { return int32(TCL_ERROR) } /* * Generate code to push list being taken apart by [lassign]. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } /* * Generate code to assign values from the list to variables. */ idx = 0 for { if !(idx < numWords-int32(2)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * Generate the next variable name. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(idx+libc.Int32FromInt32(2))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(idx+libc.Int32FromInt32(2))*8)) XTclPushVarName(tls, interp, tokenPtr, envPtr2, 0, bp+4, bp) /* * Emit instructions to get the idx'th item out of the list value on * the stack and assign it to the variable. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp + 4)) >= 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = libc.Uint8FromInt32(int32(INST_LIST_INDEX_IMM)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(24)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(16)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(8)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(idx)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_INDEX_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - idx } v34 = delta1 v35 = envPtr2 if v34 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v35 + 64)) += int64(v34) } if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v40 = delta1 v41 = envPtr2 if v40 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v41 + 64)) += int64(v40) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v52 = delta1 v53 = envPtr2 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v56 = delta1 v57 = envPtr2 if v56 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v57)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v57)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v57)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v57)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v57 + 64)) += int64(v56) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = libc.Uint8FromInt32(int32(INST_OVER)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v68 = delta1 v69 = envPtr2 if v68 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v69 + 64)) += int64(v68) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = libc.Uint8FromInt32(int32(INST_LIST_INDEX_IMM)) v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(24)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(16)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(8)) v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = uint8(libc.Uint32FromInt32(idx)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_INDEX_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - idx } v80 = delta1 v81 = envPtr2 if v80 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v81)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v81)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v81)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v81)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v81 + 64)) += int64(v80) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v83 = envPtr2 + 152 v82 = *(*uintptr)(unsafe.Pointer(v83)) *(*uintptr)(unsafe.Pointer(v83))++ *(*uint8)(unsafe.Pointer(v82)) = libc.Uint8FromInt32(int32(INST_STORE_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v84 = delta1 v85 = envPtr2 if v84 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v85)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v85)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v85)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v85)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v85 + 64)) += int64(v84) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v88 = delta1 v89 = envPtr2 if v88 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v89)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v89)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v89)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v89)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v89 + 64)) += int64(v88) } } } else { if *(*int32)(unsafe.Pointer(bp + 4)) >= 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = libc.Uint8FromInt32(int32(INST_OVER)) v93 = envPtr2 + 152 v92 = *(*uintptr)(unsafe.Pointer(v93)) *(*uintptr)(unsafe.Pointer(v93))++ *(*uint8)(unsafe.Pointer(v92)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v95 = envPtr2 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v100 = delta1 v101 = envPtr2 if v100 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v101 + 64)) += int64(v100) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = libc.Uint8FromInt32(int32(INST_LIST_INDEX_IMM)) v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(24)) v107 = envPtr2 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(16)) v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(8)) v111 = envPtr2 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = uint8(libc.Uint32FromInt32(idx)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_INDEX_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - idx } v112 = delta1 v113 = envPtr2 if v112 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v113 + 64)) += int64(v112) } if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = libc.Uint8FromInt32(int32(INST_STORE_ARRAY1)) v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_ARRAY1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v118 = delta1 v119 = envPtr2 if v118 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v119)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v119)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v119)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v119)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v119 + 64)) += int64(v118) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = libc.Uint8FromInt32(int32(INST_STORE_ARRAY4)) v123 = envPtr2 + 152 v122 = *(*uintptr)(unsafe.Pointer(v123)) *(*uintptr)(unsafe.Pointer(v123))++ *(*uint8)(unsafe.Pointer(v122)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v125 = envPtr2 + 152 v124 = *(*uintptr)(unsafe.Pointer(v125)) *(*uintptr)(unsafe.Pointer(v125))++ *(*uint8)(unsafe.Pointer(v124)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v127 = envPtr2 + 152 v126 = *(*uintptr)(unsafe.Pointer(v127)) *(*uintptr)(unsafe.Pointer(v127))++ *(*uint8)(unsafe.Pointer(v126)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v129 = envPtr2 + 152 v128 = *(*uintptr)(unsafe.Pointer(v129)) *(*uintptr)(unsafe.Pointer(v129))++ *(*uint8)(unsafe.Pointer(v128)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_ARRAY4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v130 = delta1 v131 = envPtr2 if v130 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v131)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v131)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v131)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v131)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v131 + 64)) += int64(v130) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v134 = delta1 v135 = envPtr2 if v134 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v135 + 64)) += int64(v134) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v137 = envPtr2 + 152 v136 = *(*uintptr)(unsafe.Pointer(v137)) *(*uintptr)(unsafe.Pointer(v137))++ *(*uint8)(unsafe.Pointer(v136)) = libc.Uint8FromInt32(int32(INST_OVER)) v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v141 = envPtr2 + 152 v140 = *(*uintptr)(unsafe.Pointer(v141)) *(*uintptr)(unsafe.Pointer(v141))++ *(*uint8)(unsafe.Pointer(v140)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v143 = envPtr2 + 152 v142 = *(*uintptr)(unsafe.Pointer(v143)) *(*uintptr)(unsafe.Pointer(v143))++ *(*uint8)(unsafe.Pointer(v142)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v145 = envPtr2 + 152 v144 = *(*uintptr)(unsafe.Pointer(v145)) *(*uintptr)(unsafe.Pointer(v145))++ *(*uint8)(unsafe.Pointer(v144)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v146 = delta1 v147 = envPtr2 if v146 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v147)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v147)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v147)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v147)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v147 + 64)) += int64(v146) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v149 = envPtr2 + 152 v148 = *(*uintptr)(unsafe.Pointer(v149)) *(*uintptr)(unsafe.Pointer(v149))++ *(*uint8)(unsafe.Pointer(v148)) = libc.Uint8FromInt32(int32(INST_LIST_INDEX_IMM)) v151 = envPtr2 + 152 v150 = *(*uintptr)(unsafe.Pointer(v151)) *(*uintptr)(unsafe.Pointer(v151))++ *(*uint8)(unsafe.Pointer(v150)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(24)) v153 = envPtr2 + 152 v152 = *(*uintptr)(unsafe.Pointer(v153)) *(*uintptr)(unsafe.Pointer(v153))++ *(*uint8)(unsafe.Pointer(v152)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(16)) v155 = envPtr2 + 152 v154 = *(*uintptr)(unsafe.Pointer(v155)) *(*uintptr)(unsafe.Pointer(v155))++ *(*uint8)(unsafe.Pointer(v154)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(8)) v157 = envPtr2 + 152 v156 = *(*uintptr)(unsafe.Pointer(v157)) *(*uintptr)(unsafe.Pointer(v157))++ *(*uint8)(unsafe.Pointer(v156)) = uint8(libc.Uint32FromInt32(idx)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_INDEX_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - idx } v158 = delta1 v159 = envPtr2 if v158 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v159)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v159)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v159)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v159)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v159 + 64)) += int64(v158) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v161 = envPtr2 + 152 v160 = *(*uintptr)(unsafe.Pointer(v161)) *(*uintptr)(unsafe.Pointer(v161))++ *(*uint8)(unsafe.Pointer(v160)) = libc.Uint8FromInt32(int32(INST_STORE_ARRAY_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v162 = delta1 v163 = envPtr2 if v162 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v163)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v163)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v163)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v163)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v163 + 64)) += int64(v162) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v165 = envPtr2 + 152 v164 = *(*uintptr)(unsafe.Pointer(v165)) *(*uintptr)(unsafe.Pointer(v165))++ *(*uint8)(unsafe.Pointer(v164)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v166 = delta1 v167 = envPtr2 if v166 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v167)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v167)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v167)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v167)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v167 + 64)) += int64(v166) } } } goto _19 _19: ; idx++ } /* * Generate code to leave the rest of the list on the stack. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v169 = envPtr2 + 152 v168 = *(*uintptr)(unsafe.Pointer(v169)) *(*uintptr)(unsafe.Pointer(v169))++ *(*uint8)(unsafe.Pointer(v168)) = libc.Uint8FromInt32(int32(INST_LIST_RANGE_IMM)) v171 = envPtr2 + 152 v170 = *(*uintptr)(unsafe.Pointer(v171)) *(*uintptr)(unsafe.Pointer(v171))++ *(*uint8)(unsafe.Pointer(v170)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(24)) v173 = envPtr2 + 152 v172 = *(*uintptr)(unsafe.Pointer(v173)) *(*uintptr)(unsafe.Pointer(v173))++ *(*uint8)(unsafe.Pointer(v172)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(16)) v175 = envPtr2 + 152 v174 = *(*uintptr)(unsafe.Pointer(v175)) *(*uintptr)(unsafe.Pointer(v175))++ *(*uint8)(unsafe.Pointer(v174)) = uint8(libc.Uint32FromInt32(idx) >> libc.Int32FromInt32(8)) v177 = envPtr2 + 152 v176 = *(*uintptr)(unsafe.Pointer(v177)) *(*uintptr)(unsafe.Pointer(v177))++ *(*uint8)(unsafe.Pointer(v176)) = uint8(libc.Uint32FromInt32(idx)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - idx } v178 = delta1 v179 = envPtr2 if v178 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v179)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v179)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v179)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v179)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v179 + 64)) += int64(v178) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v181 = envPtr2 + 152 v180 = *(*uintptr)(unsafe.Pointer(v181)) *(*uintptr)(unsafe.Pointer(v181))++ *(*uint8)(unsafe.Pointer(v180)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(24)) v183 = envPtr2 + 152 v182 = *(*uintptr)(unsafe.Pointer(v183)) *(*uintptr)(unsafe.Pointer(v183))++ *(*uint8)(unsafe.Pointer(v182)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(16)) v185 = envPtr2 + 152 v184 = *(*uintptr)(unsafe.Pointer(v185)) *(*uintptr)(unsafe.Pointer(v185))++ *(*uint8)(unsafe.Pointer(v184)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(8)) v187 = envPtr2 + 152 v186 = *(*uintptr)(unsafe.Pointer(v187)) *(*uintptr)(unsafe.Pointer(v187))++ *(*uint8)(unsafe.Pointer(v186)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2))))) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileLindexCmd -- * * Procedure called to compile the "lindex" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "lindex" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileLindexCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1061 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, i1, numWords, v17, v29, v36, v48, v5, v52, v64 int32 var eclIndex TTcl_Size var idxTokenPtr, mapPtr, valTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v3, v30, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v49, v50, v51, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v65, v7, v8, v9 uintptr var _ /* idx at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, i1, idxTokenPtr, mapPtr, numWords, valTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) /* * Quit if not enough args. */ /* TODO: Consider support for compiling expanded args. */ if numWords <= int32(1) { return int32(TCL_ERROR) } valTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if numWords != int32(3) { goto emitComplexLindex } idxTokenPtr = valTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(valTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if XTclGetIndexFromToken(tls, idxTokenPtr, libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))), libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))), bp) == TCL_OK { /* * The idxTokenPtr parsed as a valid index value and was * encoded as expected by INST_LIST_INDEX_IMM. * * NOTE: that we rely on indexing before a list producing the * same result as indexing after a list. */ if (*TTcl_Token)(unsafe.Pointer(valTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, valTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_LIST_INDEX_IMM)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(24)) v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(16)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(8)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_INDEX_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v29 = delta1 v30 = envPtr2 if v29 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v30)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v30)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v30)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v30)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v30 + 64)) += int64(v29) } return TCL_OK } /* * If the value was not known at compile time, the conversion failed or * the value was negative, we just keep on going with the more complex * compilation. */ /* * Push the operands onto the stack. */ goto emitComplexLindex emitComplexLindex: ; i1 = int32(1) for { if !(i1 < numWords) { break } if (*TTcl_Token)(unsafe.Pointer(valTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v48 = delta1 v49 = envPtr2 if v48 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v49 + 64)) += int64(v48) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, valTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valTokenPtr)).FnumComponents), envPtr2) } valTokenPtr = valTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(valTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _31 _31: ; i1++ } /* * Emit INST_LIST_INDEX if objc==3, or INST_LIST_INDEX_MULTI if there are * multiple index args. */ if numWords == int32(3) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = libc.Uint8FromInt32(int32(INST_LIST_INDEX)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_INDEX)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v52 = delta1 v53 = envPtr2 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = libc.Uint8FromInt32(int32(INST_LIST_INDEX_MULTI)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(numWords-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(numWords-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(numWords-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(numWords - libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_INDEX_MULTI)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (numWords - int32(1)) } v64 = delta1 v65 = envPtr2 if v64 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v65 + 64)) += int64(v64) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileListCmd -- * * Procedure called to compile the "list" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "list" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileListCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1151 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, build, concat, delta1, i1, numWords, v110, v17, v30, v42, v44, v5, v56, v60, v66, v78, v82, v94, v98 int32 var _objPtr, _objPtr1, cachePtr, cachePtr1, listObj, mapPtr, objPtr, valueTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v13, v14, v15, v16, v18, v2, v23, v25, v26, v27, v28, v29, v3, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v43, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v57, v58, v59, v6, v61, v62, v63, v64, v65, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v79, v8, v80, v81, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v95, v96, v97, v99 uintptr var eclIndex, v22, v24 TTcl_Size var v19, v21 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objPtr, _objPtr1, build, cachePtr, cachePtr1, concat, delta1, eclIndex, i1, listObj, mapPtr, numWords, objPtr, valueTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v13, v14, v15, v16, v17, v18, v19, v2, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(1) { /* * [list] without arguments just pushes an empty object. */ _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } return TCL_OK } /* * Test if all arguments are compile-time known. If they are, we can * implement with a simple push. */ numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) valueTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { listObj = XTclThreadAllocObj(tls) } else { listObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(listObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(listObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(listObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(listObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(listObj)).FtypePtr = libc.UintptrFromInt32(0) i1 = int32(1) for { if !(i1 < numWords && listObj != libc.UintptrFromInt32(0)) { break } if v21 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v21 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v21 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) if XTclWordKnownAtCompileTime(tls, valueTokenPtr, objPtr) != 0 { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listObj, objPtr) } else { _objPtr = objPtr v23 = _objPtr v22 = *(*TTcl_Size)(unsafe.Pointer(v23)) *(*TTcl_Size)(unsafe.Pointer(v23))-- if v22 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = listObj v25 = _objPtr1 v24 = *(*TTcl_Size)(unsafe.Pointer(v25)) *(*TTcl_Size)(unsafe.Pointer(v25))-- if v24 <= int64(1) { XTclFreeObj(tls, _objPtr1) } listObj = libc.UintptrFromInt32(0) } valueTokenPtr = valueTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _20 _20: ; i1++ } if listObj != libc.UintptrFromInt32(0) { _objIndexCopy1 = XTclAddLiteralObj(tls, envPtr2, listObj, libc.UintptrFromInt32(0)) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } } return TCL_OK } /* * Push the all values onto the stack. */ numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) valueTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 v44 = libc.Int32FromInt32(0) build = v44 concat = v44 i1 = int32(1) for { if !(i1 < numWords) { break } if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_EXPAND_WORD) && build > 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = libc.Uint8FromInt32(int32(INST_LIST)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(build) >> libc.Int32FromInt32(24)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(build) >> libc.Int32FromInt32(16)) v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = uint8(libc.Uint32FromInt32(build) >> libc.Int32FromInt32(8)) v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = uint8(libc.Uint32FromInt32(build)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - build } v56 = delta1 v57 = envPtr2 if v56 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v57)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v57)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v57)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v57)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v57 + 64)) += int64(v56) } if concat != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = libc.Uint8FromInt32(int32(INST_LIST_CONCAT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_CONCAT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v60 = delta1 v61 = envPtr2 if v60 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v61)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v61)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v61)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v61)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v61 + 64)) += int64(v60) } } build = 0 concat = int32(1) } if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v66 = delta1 v67 = envPtr2 if v66 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v67 + 64)) += int64(v66) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v78 = delta1 v79 = envPtr2 if v78 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v79)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v79)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v79)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v79)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v79 + 64)) += int64(v78) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_EXPAND_WORD) { if concat != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = libc.Uint8FromInt32(int32(INST_LIST_CONCAT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_CONCAT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v82 = delta1 v83 = envPtr2 if v82 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v83 + 64)) += int64(v82) } } else { concat = int32(1) } } else { build++ } valueTokenPtr = valueTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _45 _45: ; i1++ } if build > 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v85 = envPtr2 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = libc.Uint8FromInt32(int32(INST_LIST)) v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = uint8(libc.Uint32FromInt32(build) >> libc.Int32FromInt32(24)) v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = uint8(libc.Uint32FromInt32(build) >> libc.Int32FromInt32(16)) v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(build) >> libc.Int32FromInt32(8)) v93 = envPtr2 + 152 v92 = *(*uintptr)(unsafe.Pointer(v93)) *(*uintptr)(unsafe.Pointer(v93))++ *(*uint8)(unsafe.Pointer(v92)) = uint8(libc.Uint32FromInt32(build)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - build } v94 = delta1 v95 = envPtr2 if v94 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v95)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v95)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v95)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v95)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v95 + 64)) += int64(v94) } if concat != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = libc.Uint8FromInt32(int32(INST_LIST_CONCAT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_CONCAT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v98 = delta1 v99 = envPtr2 if v98 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v99)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v99)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v99)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v99)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v99 + 64)) += int64(v98) } } } /* * If there was just one expanded word, we must ensure that it is a list * at this point. We use an [lrange ... 0 end] for this (instead of * [llength], as with literals) as we must drop any string representation * that might be hanging around. */ if concat != 0 && numWords == int32(2) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v101 = envPtr2 + 152 v100 = *(*uintptr)(unsafe.Pointer(v101)) *(*uintptr)(unsafe.Pointer(v101))++ *(*uint8)(unsafe.Pointer(v100)) = libc.Uint8FromInt32(int32(INST_LIST_RANGE_IMM)) v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v107 = envPtr2 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v110 = delta1 v111 = envPtr2 if v110 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v111)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v111)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v111)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v111)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v111 + 64)) += int64(v110) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v113 = envPtr2 + 152 v112 = *(*uintptr)(unsafe.Pointer(v113)) *(*uintptr)(unsafe.Pointer(v113))++ *(*uint8)(unsafe.Pointer(v112)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(24)) v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(16)) v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(8)) v119 = envPtr2 + 152 v118 = *(*uintptr)(unsafe.Pointer(v119)) *(*uintptr)(unsafe.Pointer(v119))++ *(*uint8)(unsafe.Pointer(v118)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2))))) } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileLlengthCmd -- * * Procedure called to compile the "llength" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "llength" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileLlengthCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1264 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, v17, v21, v5 int32 var eclIndex TTcl_Size var mapPtr, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_LIST_LENGTH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_LENGTH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileLrangeCmd -- * * How to compile the "lrange" command. We only bother because we needed * the opcode anyway for "lassign". * *---------------------------------------------------------------------- */ func XTclCompileLrangeCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1296 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds the resulting instructions. */ var _objIndexCopy, delta1, v17, v29, v5 int32 var eclIndex TTcl_Size var listTokenPtr, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v6, v7, v8, v9 uintptr var _ /* idx1 at bp+0 */ int32 var _ /* idx2 at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, listTokenPtr, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(4) { return int32(TCL_ERROR) } listTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 tokenPtr = listTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(listTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if XTclGetIndexFromToken(tls, tokenPtr, libc.Uint64FromInt64(libc.Int64FromInt32(0)), libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))), bp) != TCL_OK || *(*int32)(unsafe.Pointer(bp)) == int32(int64(-libc.Int32FromInt32(1))) { return int32(TCL_ERROR) } /* * Token was an index value, and we treat all "first" indices * before the list same as the start of the list. */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if XTclGetIndexFromToken(tls, tokenPtr, libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))), libc.Uint64FromInt64(int64(-libc.Int32FromInt32(2))), bp+4) != TCL_OK { return int32(TCL_ERROR) } /* * Token was an index value, and we treat all "last" indices * after the list same as the end of the list. */ /* * Issue instructions. It's not safe to skip doing the LIST_RANGE, as * we've not proved that the 'list' argument is really a list. Not that it * is worth trying to do that given current knowledge. */ if (*TTcl_Token)(unsafe.Pointer(listTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(listTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(listTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, listTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(listTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_LIST_RANGE_IMM)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(24)) v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(16)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(8)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v29 = delta1 v30 = envPtr2 if v29 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v30)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v30)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v30)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v30)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v30 + 64)) += int64(v29) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileLinsertCmd -- * * How to compile the "linsert" command. We only bother with the case * where the index is constant. * *---------------------------------------------------------------------- */ func XTclCompileLinsertCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1356 uintptr, envPtr2 uintptr) (r int32) { /* Holds the resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, i1, v17, v23, v35, v42, v5, v54, v66 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v38, v39, v4, v40, v41, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v67, v68, v69, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, eclIndex, i1, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) { return int32(TCL_ERROR) } /* Push list, insertion index onto the stack */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } /* Push new elements to be inserted */ i1 = int32(3) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v54 = delta1 v55 = envPtr2 if v54 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v55 + 64)) += int64(v54) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } goto _37 _37: ; i1++ } /* First operand is count of arguments */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = libc.Uint8FromInt32(int32(INST_LREPLACE4)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(24)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(16)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(8)) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - libc.Int64FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LREPLACE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-int64(1)) } v66 = delta1 v67 = envPtr2 if v66 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v67 + 64)) += int64(v66) } /* * Second operand is bitmask * TCL_LREPLACE4_END_IS_LAST - end refers to last element * TCL_LREPLACE4_SINGLE_INDEX - second index is not present * indicating this is a pure insert */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_LREPLACE4_SINGLE_INDEX))) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileLreplaceCmd -- * * How to compile the "lreplace" command. We only bother with the case * where the indices are constant. * *---------------------------------------------------------------------- */ func XTclCompileLreplaceCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1408 uintptr, envPtr2 uintptr) (r int32) { /* Holds the resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, delta1, i1, v17, v23, v35, v41, v5, v53, v60, v72, v84 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v54, v56, v57, v58, v59, v6, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, delta1, eclIndex, i1, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < int64(4) { return int32(TCL_ERROR) } /* Push list, first, last onto the stack */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } /* Push new elements to be inserted */ i1 = int32(4) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v60 = delta1 v61 = envPtr2 if v60 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v61)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v61)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v61)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v61)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v61 + 64)) += int64(v60) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v72 = delta1 v73 = envPtr2 if v72 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v73)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v73)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v73)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v73)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v73 + 64)) += int64(v72) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } goto _55 _55: ; i1++ } /* First operand is count of arguments */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = libc.Uint8FromInt32(int32(INST_LREPLACE4)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(24)) v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(16)) v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(8)) v83 = envPtr2 + 152 v82 = *(*uintptr)(unsafe.Pointer(v83)) *(*uintptr)(unsafe.Pointer(v83))++ *(*uint8)(unsafe.Pointer(v82)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - libc.Int64FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LREPLACE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-int64(1)) } v84 = delta1 v85 = envPtr2 if v84 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v85)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v85)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v85)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v85)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v85 + 64)) += int64(v84) } /* * Second operand is bitmask * TCL_LREPLACE4_END_IS_LAST - end refers to last element */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_LREPLACE4_END_IS_LAST))) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileLsetCmd -- * * Procedure called to compile the "lset" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "lset" command at * runtime. * * The general template for execution of the "lset" command is: * (1) Instructions to push the variable name, unless the variable is * local to the stack frame. * (2) If the variable is an array element, instructions to push the * array element name. * (3) Instructions to push each of zero or more "index" arguments to the * stack, followed with the "newValue" element. * (4) Instructions to duplicate the variable name and/or array element * name onto the top of the stack, if either was pushed at steps (1) * and (2). * (5) The appropriate INST_LOAD_* instruction to place the original * value of the list variable at top of stack. * (6) At this point, the stack contains: * varName? arrayElementName? index1 index2 ... newValue oldList * The compiler emits one of INST_LSET_FLAT or INST_LSET_LIST * according as whether there is exactly one index element (LIST) or * either zero or else two or more (FLAT). This instruction removes * everything from the stack except for the two names and pushes the * new value of the variable. * (7) Finally, INST_STORE_* stores the new value in the variable and * cleans up the stack. * *---------------------------------------------------------------------- */ func XTclCompileLsetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1489 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds the resulting instructions. */ var _objIndexCopy, delta1, i1, tempDepth, v102, v106, v112, v124, v128, v134, v146, v18, v30, v42, v46, v52, v6, v64, v68, v74, v86, v90 int32 var eclIndex TTcl_Size var mapPtr, varTokenPtr, v10, v100, v101, v103, v104, v105, v107, v108, v109, v11, v110, v111, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v125, v126, v127, v129, v13, v130, v131, v132, v133, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v147, v15, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v43, v44, v45, v47, v48, v49, v5, v50, v51, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v65, v66, v67, v69, v7, v70, v71, v72, v73, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v87, v88, v89, v9, v91, v92, v93, v94, v95, v96, v97, v98, v99 uintptr var _ /* isScalar at bp+4 */ int32 var _ /* localIndex at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, i1, mapPtr, tempDepth, varTokenPtr, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * Check argument count. */ /* TODO: Consider support for compiling expanded args. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) { /* * Fail at run time, not in compilation. */ return int32(TCL_ERROR) } /* * Decide if we can use a frame slot for the var/array name or if we need * to emit code to compute and push the name at runtime. We use a frame * slot (entry in the array of local vars) if we are compiling a procedure * body and if the name is simple text that does not include namespace * qualifiers. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, varTokenPtr, envPtr2, 0, bp, bp+4) /* * Push the "index" args and the new element value. */ i1 = int32(2) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } varTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents), envPtr2) } goto _1 _1: ; i1++ } /* * Duplicate the variable name if it's been pushed. */ if *(*int32)(unsafe.Pointer(bp)) < 0 { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { tempDepth = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - int64(2)) } else { tempDepth = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - int64(1)) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_OVER)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(tempDepth) >> libc.Int32FromInt32(24)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(tempDepth) >> libc.Int32FromInt32(16)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(tempDepth) >> libc.Int32FromInt32(8)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(tempDepth)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - tempDepth } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } } /* * Duplicate an array index if one's been pushed. */ if !(*(*int32)(unsafe.Pointer(bp + 4)) != 0) { if *(*int32)(unsafe.Pointer(bp)) < 0 { tempDepth = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - int64(1)) } else { tempDepth = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - int64(2)) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_OVER)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(tempDepth) >> libc.Int32FromInt32(24)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(tempDepth) >> libc.Int32FromInt32(16)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(tempDepth) >> libc.Int32FromInt32(8)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(tempDepth)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - tempDepth } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } } /* * Emit code to load the variable's value. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { if *(*int32)(unsafe.Pointer(bp)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = libc.Uint8FromInt32(int32(INST_LOAD_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v46 = delta1 v47 = envPtr2 if v46 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v47)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v47)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v47)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v47)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v47 + 64)) += int64(v46) } } else { if *(*int32)(unsafe.Pointer(bp)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v52 = delta1 v53 = envPtr2 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(24)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(16)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(8)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v64 = delta1 v65 = envPtr2 if v64 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v65 + 64)) += int64(v64) } } } } else { if *(*int32)(unsafe.Pointer(bp)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = libc.Uint8FromInt32(int32(INST_LOAD_ARRAY_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v68 = delta1 v69 = envPtr2 if v68 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v69 + 64)) += int64(v68) } } else { if *(*int32)(unsafe.Pointer(bp)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = libc.Uint8FromInt32(int32(INST_LOAD_ARRAY1)) v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_ARRAY1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v74 = delta1 v75 = envPtr2 if v74 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v75)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v75)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v75)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v75)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v75 + 64)) += int64(v74) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = libc.Uint8FromInt32(int32(INST_LOAD_ARRAY4)) v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(24)) v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(16)) v83 = envPtr2 + 152 v82 = *(*uintptr)(unsafe.Pointer(v83)) *(*uintptr)(unsafe.Pointer(v83))++ *(*uint8)(unsafe.Pointer(v82)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(8)) v85 = envPtr2 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_ARRAY4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v86 = delta1 v87 = envPtr2 if v86 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v87)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v87)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v87)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v87)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v87 + 64)) += int64(v86) } } } } /* * Emit the correct variety of 'lset' instruction. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(4) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = libc.Uint8FromInt32(int32(INST_LSET_LIST)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LSET_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v90 = delta1 v91 = envPtr2 if v90 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v91)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v91)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v91)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v91)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v91 + 64)) += int64(v90) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v93 = envPtr2 + 152 v92 = *(*uintptr)(unsafe.Pointer(v93)) *(*uintptr)(unsafe.Pointer(v93))++ *(*uint8)(unsafe.Pointer(v92)) = libc.Uint8FromInt32(int32(INST_LSET_FLAT)) v95 = envPtr2 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(24)) v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(16)) v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(8)) v101 = envPtr2 + 152 v100 = *(*uintptr)(unsafe.Pointer(v101)) *(*uintptr)(unsafe.Pointer(v101))++ *(*uint8)(unsafe.Pointer(v100)) = uint8(libc.Uint32FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - libc.Int64FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LSET_FLAT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords-int64(1)) } v102 = delta1 v103 = envPtr2 if v102 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v103)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v103)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v103)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v103)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v103 + 64)) += int64(v102) } } /* * Emit code to put the value back in the variable. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { if *(*int32)(unsafe.Pointer(bp)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = libc.Uint8FromInt32(int32(INST_STORE_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v106 = delta1 v107 = envPtr2 if v106 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v107)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v107)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v107)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v107)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v107 + 64)) += int64(v106) } } else { if *(*int32)(unsafe.Pointer(bp)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v111 = envPtr2 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v112 = delta1 v113 = envPtr2 if v112 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v113 + 64)) += int64(v112) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(24)) v119 = envPtr2 + 152 v118 = *(*uintptr)(unsafe.Pointer(v119)) *(*uintptr)(unsafe.Pointer(v119))++ *(*uint8)(unsafe.Pointer(v118)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(16)) v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(8)) v123 = envPtr2 + 152 v122 = *(*uintptr)(unsafe.Pointer(v123)) *(*uintptr)(unsafe.Pointer(v123))++ *(*uint8)(unsafe.Pointer(v122)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v124 = delta1 v125 = envPtr2 if v124 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v125 + 64)) += int64(v124) } } } } else { if *(*int32)(unsafe.Pointer(bp)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v127 = envPtr2 + 152 v126 = *(*uintptr)(unsafe.Pointer(v127)) *(*uintptr)(unsafe.Pointer(v127))++ *(*uint8)(unsafe.Pointer(v126)) = libc.Uint8FromInt32(int32(INST_STORE_ARRAY_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v128 = delta1 v129 = envPtr2 if v128 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v129)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v129)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v129)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v129)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v129 + 64)) += int64(v128) } } else { if *(*int32)(unsafe.Pointer(bp)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = libc.Uint8FromInt32(int32(INST_STORE_ARRAY1)) v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_ARRAY1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v134 = delta1 v135 = envPtr2 if v134 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v135 + 64)) += int64(v134) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v137 = envPtr2 + 152 v136 = *(*uintptr)(unsafe.Pointer(v137)) *(*uintptr)(unsafe.Pointer(v137))++ *(*uint8)(unsafe.Pointer(v136)) = libc.Uint8FromInt32(int32(INST_STORE_ARRAY4)) v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(24)) v141 = envPtr2 + 152 v140 = *(*uintptr)(unsafe.Pointer(v141)) *(*uintptr)(unsafe.Pointer(v141))++ *(*uint8)(unsafe.Pointer(v140)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(16)) v143 = envPtr2 + 152 v142 = *(*uintptr)(unsafe.Pointer(v143)) *(*uintptr)(unsafe.Pointer(v143))++ *(*uint8)(unsafe.Pointer(v142)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(8)) v145 = envPtr2 + 152 v144 = *(*uintptr)(unsafe.Pointer(v145)) *(*uintptr)(unsafe.Pointer(v145))++ *(*uint8)(unsafe.Pointer(v144)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_ARRAY4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v146 = delta1 v147 = envPtr2 if v146 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v147)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v147)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v147)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v147)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v147 + 64)) += int64(v146) } } } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileNamespace*Cmd -- * * Procedures called to compile the "namespace" command; currently, only * the subcommands "namespace current" and "namespace upvar" are compiled * to bytecodes, and the latter only inside a procedure(-like) context. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "namespace upvar" * command at runtime. * *---------------------------------------------------------------------- */ func XTclCompileNamespaceCurrentCmd(tls *libc.TLS, dummy1632 uintptr, parsePtr uintptr, dummy1635 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var delta1, v3 int32 var v1, v2, v4 uintptr _, _, _, _, _ = delta1, v1, v2, v3, v4 /* * Only compile [namespace current] without arguments. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(1) { return int32(TCL_ERROR) } /* * Not much to do; we compile to a single instruction... */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_NS_CURRENT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NS_CURRENT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } return TCL_OK } func XTclCompileNamespaceCodeCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1659 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, v17, v23, v35, v39, v45, v5, v57, v69 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v4, v40, v41, v42, v43, v44, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v7, v70, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * The specification of [namespace code] is rather shocking, in that it is * supposed to check if the argument is itself the result of [namespace * code] and not apply itself in that case. Which is excessively cautious, * but what the test suite checks for. */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize > int64(20) && libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, __ccgo_ts+21788, uint64(20)) == 0 { /* * Technically, we could just pass a literal '::namespace inscope ' * term through, but that's something which really shouldn't be * occurring as something that the user writes so we'll just punt it. */ return int32(TCL_ERROR) } /* * Now we can compile using the same strategy as [namespace code]'s normal * implementation does internally. Note that we can't bind the namespace * name directly here, because TclOO plays complex games with namespaces; * the value needs to be determined at runtime for safety. */ _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21809, libc.Int64FromUint64(libc.Uint64FromInt64(12)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21821, libc.Int64FromUint64(libc.Uint64FromInt64(8)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_NS_CURRENT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NS_CURRENT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v45 = delta1 v46 = envPtr2 if v45 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v46 + 64)) += int64(v45) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = libc.Uint8FromInt32(int32(INST_LIST)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4)) >> libc.Int32FromInt32(24)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4)) >> libc.Int32FromInt32(16)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4)) >> libc.Int32FromInt32(8)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(4) } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } return TCL_OK } func XTclCompileNamespaceOriginCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1708 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, v17, v21, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_ORIGIN_COMMAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ORIGIN_COMMAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } return TCL_OK } func XTclCompileNamespaceQualifiersCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1729 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, delta1, off, v103, v115, v119, v125, v137, v141, v147, v151, v17, v23, v35, v41, v5, v53, v65, v69, v75, v87, v91 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v100, v101, v102, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v116, v117, v118, v12, v120, v121, v122, v123, v124, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v138, v139, v14, v140, v142, v143, v144, v145, v146, v148, v149, v15, v150, v152, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v66, v67, v68, v7, v70, v71, v72, v73, v74, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v88, v89, v9, v90, v92, v93, v94, v95, v96, v97, v98, v99 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, delta1, eclIndex, mapPtr, off, tokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+7650, libc.Int64FromUint64(libc.Uint64FromInt64(3)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_OVER)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v65 = delta1 v66 = envPtr2 if v65 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v66 + 64)) += int64(v65) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = libc.Uint8FromInt32(int32(INST_STR_FIND_LAST)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_FIND_LAST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } off = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v75 = delta1 v76 = envPtr2 if v75 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v76 + 64)) += int64(v75) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v87 = delta1 v88 = envPtr2 if v87 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v88 + 64)) += int64(v87) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = libc.Uint8FromInt32(int32(INST_SUB)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_SUB)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v91 = delta1 v92 = envPtr2 if v91 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v92 + 64)) += int64(v91) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = libc.Uint8FromInt32(int32(INST_OVER)) v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v100 = envPtr2 + 152 v99 = *(*uintptr)(unsafe.Pointer(v100)) *(*uintptr)(unsafe.Pointer(v100))++ *(*uint8)(unsafe.Pointer(v99)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v103 = delta1 v104 = envPtr2 if v103 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v104 + 64)) += int64(v103) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = libc.Uint8FromInt32(int32(INST_OVER)) v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v115 = delta1 v116 = envPtr2 if v115 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v116)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v116)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v116)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v116)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v116 + 64)) += int64(v115) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = libc.Uint8FromInt32(int32(INST_STR_INDEX)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_INDEX)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v119 = delta1 v120 = envPtr2 if v119 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v120)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v120)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v120)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v120)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v120 + 64)) += int64(v119) } _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21829, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v124 = envPtr2 + 152 v123 = *(*uintptr)(unsafe.Pointer(v124)) *(*uintptr)(unsafe.Pointer(v124))++ *(*uint8)(unsafe.Pointer(v123)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v125 = delta1 v126 = envPtr2 if v125 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v126)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v126)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v126)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v126)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v126 + 64)) += int64(v125) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v128 = envPtr2 + 152 v127 = *(*uintptr)(unsafe.Pointer(v128)) *(*uintptr)(unsafe.Pointer(v128))++ *(*uint8)(unsafe.Pointer(v127)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v130 = envPtr2 + 152 v129 = *(*uintptr)(unsafe.Pointer(v130)) *(*uintptr)(unsafe.Pointer(v130))++ *(*uint8)(unsafe.Pointer(v129)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v132 = envPtr2 + 152 v131 = *(*uintptr)(unsafe.Pointer(v132)) *(*uintptr)(unsafe.Pointer(v132))++ *(*uint8)(unsafe.Pointer(v131)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v134 = envPtr2 + 152 v133 = *(*uintptr)(unsafe.Pointer(v134)) *(*uintptr)(unsafe.Pointer(v134))++ *(*uint8)(unsafe.Pointer(v133)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v136 = envPtr2 + 152 v135 = *(*uintptr)(unsafe.Pointer(v136)) *(*uintptr)(unsafe.Pointer(v136))++ *(*uint8)(unsafe.Pointer(v135)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v137 = delta1 v138 = envPtr2 if v137 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v138)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v138)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v138)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v138)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v138 + 64)) += int64(v137) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v140 = envPtr2 + 152 v139 = *(*uintptr)(unsafe.Pointer(v140)) *(*uintptr)(unsafe.Pointer(v140))++ *(*uint8)(unsafe.Pointer(v139)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v141 = delta1 v142 = envPtr2 if v141 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v142)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v142)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v142)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v142)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v142 + 64)) += int64(v141) } off = int32(int64(off) - (int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v144 = envPtr2 + 152 v143 = *(*uintptr)(unsafe.Pointer(v144)) *(*uintptr)(unsafe.Pointer(v144))++ *(*uint8)(unsafe.Pointer(v143)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v146 = envPtr2 + 152 v145 = *(*uintptr)(unsafe.Pointer(v146)) *(*uintptr)(unsafe.Pointer(v146))++ *(*uint8)(unsafe.Pointer(v145)) = uint8(libc.Uint32FromInt32(off)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - off } v147 = delta1 v148 = envPtr2 if v147 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v148)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v148)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v148)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v148)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v148 + 64)) += int64(v147) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v150 = envPtr2 + 152 v149 = *(*uintptr)(unsafe.Pointer(v150)) *(*uintptr)(unsafe.Pointer(v150))++ *(*uint8)(unsafe.Pointer(v149)) = libc.Uint8FromInt32(int32(INST_STR_RANGE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v151 = delta1 v152 = envPtr2 if v151 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v152)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v152)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v152)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v152)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v152 + 64)) += int64(v151) } return TCL_OK } func XTclCompileNamespaceTailCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1764 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, delta1, v105, v117, v121, v17, v23, v35, v47, v5, v51, v55, v61, v73, v77, v83, v95, v99 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v118, v119, v12, v120, v122, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v48, v49, v50, v52, v53, v54, v56, v57, v58, v59, v6, v60, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v74, v75, v76, v78, v79, v8, v80, v81, v82, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v96, v97, v98 uintptr var _ /* jumpFixup at bp+0 */ TJumpFixup _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } /* * Take care; only add 2 to found index if the string was actually found. */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+7650, libc.Int64FromUint64(libc.Uint64FromInt64(3)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_OVER)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v47 = delta1 v48 = envPtr2 if v47 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v48 + 64)) += int64(v47) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = libc.Uint8FromInt32(int32(INST_STR_FIND_LAST)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_FIND_LAST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v55 = delta1 v56 = envPtr2 if v55 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v56)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v56)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v56)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v56)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v56 + 64)) += int64(v55) } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v61 = delta1 v62 = envPtr2 if v61 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v62 + 64)) += int64(v61) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v73 = delta1 v74 = envPtr2 if v73 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v74 + 64)) += int64(v73) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = libc.Uint8FromInt32(int32(INST_GE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_GE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v77 = delta1 v78 = envPtr2 if v77 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v78)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v78)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v78)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v78)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v78 + 64)) += int64(v77) } XTclEmitForwardJump(tls, envPtr2, int32(TCL_FALSE_JUMP), bp) _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21831, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v83 = delta1 v84 = envPtr2 if v83 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v84 + 64)) += int64(v83) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v95 = delta1 v96 = envPtr2 if v95 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v96)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v96)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v96)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v96)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v96 + 64)) += int64(v95) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = libc.Uint8FromInt32(int32(INST_ADD)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_ADD)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v99 = delta1 v100 = envPtr2 if v99 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v100 + 64)) += int64(v99) } XTclFixupForwardJump(tls, envPtr2, bp, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp)).FcodeOffset))), int32(127)) _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21833, libc.Int64FromUint64(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v104 = envPtr2 + 152 v103 = *(*uintptr)(unsafe.Pointer(v104)) *(*uintptr)(unsafe.Pointer(v104))++ *(*uint8)(unsafe.Pointer(v103)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v105 = delta1 v106 = envPtr2 if v105 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v106)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v106)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v106)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v106)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v106 + 64)) += int64(v105) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v117 = delta1 v118 = envPtr2 if v117 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v118)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v118)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v118)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v118)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v118 + 64)) += int64(v117) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = libc.Uint8FromInt32(int32(INST_STR_RANGE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v121 = delta1 v122 = envPtr2 if v121 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v122)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v122)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v122)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v122)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v122 + 64)) += int64(v121) } return TCL_OK } func XTclCompileNamespaceUpvarCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1800 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, i1, localIndex, numWords, v17, v24, v36, v48, v5, v52, v58, v70 int32 var eclIndex TTcl_Size var localTokenPtr, mapPtr, otherTokenPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v2, v20, v21, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v49, v50, v51, v53, v54, v55, v56, v57, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v71, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, eclIndex, i1, localIndex, localTokenPtr, mapPtr, numWords, otherTokenPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * Only compile [namespace upvar ...]: needs an even number of args, >=4 */ numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) if numWords%int32(2) != 0 || numWords < int32(4) { return int32(TCL_ERROR) } /* * Push the namespace */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } /* * Loop over the (otherVar, thisVar) pairs. If any of the thisVar is not a * local variable, return an error so that the non-compiled command will * be called at runtime. */ localTokenPtr = tokenPtr i1 = int32(2) for { if !(i1 < numWords) { break } otherTokenPtr = localTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(localTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 localTokenPtr = otherTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(otherTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(otherTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(otherTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(otherTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, otherTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(otherTokenPtr)).FnumComponents), envPtr2) } localIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, localTokenPtr, envPtr2)) if localIndex < 0 { return int32(TCL_ERROR) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_NSUPVAR)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(24)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(16)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(8)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(localIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NSUPVAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - localIndex } v48 = delta1 v49 = envPtr2 if v48 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v49 + 64)) += int64(v48) } goto _19 _19: ; i1 += int32(2) } /* * Pop the namespace, and set the result to empty */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v52 = delta1 v53 = envPtr2 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v58 = delta1 v59 = envPtr2 if v58 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v59)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v59)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v59)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v59)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v59 + 64)) += int64(v58) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v70 = delta1 v71 = envPtr2 if v70 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v71 + 64)) += int64(v70) } } return TCL_OK } func XTclCompileNamespaceWhichCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1860 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, idx, v17, v21, v5 int32 var eclIndex TTcl_Size var mapPtr, opt, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, idx, mapPtr, opt, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(2) || int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(3) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 idx = int32(1) /* * If there's an option, check that it's "-command". We don't handle * "-variable" (currently) and anything else is an error. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(3) { if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return int32(TCL_ERROR) } opt = tokenPtr + uintptr(1)*32 if (*TTcl_Token)(unsafe.Pointer(opt)).Fsize < int64(2) || (*TTcl_Token)(unsafe.Pointer(opt)).Fsize > int64(8) || libc.Xstrncmp(tls, (*TTcl_Token)(unsafe.Pointer(opt)).Fstart, __ccgo_ts+18236, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(opt)).Fsize)) != 0 { return int32(TCL_ERROR) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 idx++ } /* * Issue the bytecode. */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(idx)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(idx)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_RESOLVE_COMMAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RESOLVE_COMMAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileRegexpCmd -- * * Procedure called to compile the "regexp" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "regexp" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileRegexpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1923 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(240) defer tls.Free(240) /* Holds the resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, cflags, delta1, i1, nocase, sawLast, simple, v18, v24, v36, v42, v54, v6, v60, v72, v76, v82, v84, v89 int32 var eclIndex TTcl_Size var len1 Tsize_t var mapPtr, str, varTokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v55, v56, v57, v58, v59, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v73, v74, v75, v77, v78, v79, v8, v80, v81, v83, v85, v86, v87, v88, v9, v90 uintptr var _ /* ds at bp+8 */ TTcl_DString var _ /* exact at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, cflags, delta1, eclIndex, i1, len1, mapPtr, nocase, sawLast, simple, str, varTokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * We are only interested in compiling simple regexp cases. Currently * supported compile cases are: * regexp ?-nocase? ?--? staticString $var * regexp ?-nocase? ?--? {^staticString$} $var */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) { return int32(TCL_ERROR) } simple = 0 nocase = 0 sawLast = 0 varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr /* * We only look for -nocase and -- as options. Everything else gets pushed * to runtime execution. This is different than regexp's runtime option * handling, but satisfies our stricter needs. */ i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-int32(2)) { break } varTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { /* * Not a simple string, so punt to runtime. */ return int32(TCL_ERROR) } str = (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart len1 = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize) if len1 == uint64(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str))) == int32('-') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str + 1))) == int32('-') { sawLast++ i1++ break } else { if len1 > uint64(1) && libc.Xstrncmp(tls, str, __ccgo_ts+17555, len1) == 0 { nocase = int32(1) } else { /* * Not an option we recognize. */ return int32(TCL_ERROR) } } goto _1 _1: ; i1++ } if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-i1 != int32(2) { /* * We don't support capturing to variables. */ return int32(TCL_ERROR) } /* * Get the regexp string. If it is not a simple string or can't be * converted to a glob pattern, push the word for the INST_REGEXP. * Keep changes here in sync with TclCompileSwitchCmd Switch_Regexp. */ varTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { str = (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart len1 = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize) /* * If it has a '-', it could be an incorrectly formed regexp command. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(str))) == int32('-') && !(sawLast != 0) { return int32(TCL_ERROR) } if len1 == uint64(0) { /* * The semantics of regexp are always match on re == "". */ _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } return TCL_OK } /* * Attempt to convert pattern to glob. If successful, push the * converted pattern as a literal. */ if XTclReToGlob(tls, libc.UintptrFromInt32(0), (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart, libc.Int64FromUint64(len1), bp+8, bp, libc.UintptrFromInt32(0)) == TCL_OK { simple = int32(1) _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*TTcl_DString)(unsafe.Pointer(bp+8)).Fstring1, (*TTcl_DString)(unsafe.Pointer(bp+8)).Flength, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } XTcl_DStringFree(tls, bp+8) } } if !(simple != 0) { if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v54 = delta1 v55 = envPtr2 if v54 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v55 + 64)) += int64(v54) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2))*8)) XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents), envPtr2) } } /* * Push the string arg. */ varTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v60 = delta1 v61 = envPtr2 if v60 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v61)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v61)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v61)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v61)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v61 + 64)) += int64(v60) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v72 = delta1 v73 = envPtr2 if v72 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v73)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v73)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v73)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v73)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v73 + 64)) += int64(v72) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(1))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(1))*8)) XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents), envPtr2) } if simple != 0 { if *(*int32)(unsafe.Pointer(bp)) != 0 && !(nocase != 0) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v76 = delta1 v77 = envPtr2 if v76 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v77 + 64)) += int64(v76) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = libc.Uint8FromInt32(int32(INST_STR_MATCH)) v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = uint8(libc.Uint32FromInt32(nocase)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_MATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - nocase } v82 = delta1 v83 = envPtr2 if v82 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v83 + 64)) += int64(v82) } } } else { if nocase != 0 { v84 = int32(TCL_REG_NOCASE) } else { v84 = 0 } /* * Pass correct RE compile flags. We use only Int1 (8-bit), but * that handles all the flags we want to pass. * Don't use TCL_REG_NOSUB as we may have backrefs. */ cflags = int32(TCL_REG_ADVANCED) | v84 if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = libc.Uint8FromInt32(int32(INST_REGEXP)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(cflags)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REGEXP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - cflags } v89 = delta1 v90 = envPtr2 if v89 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v90)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v90)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v90)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v90)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v90 + 64)) += int64(v89) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileRegsubCmd -- * * Procedure called to compile the "regsub" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "regsub" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileRegsubCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2088 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(240) defer tls.Free(240) /* Holds the resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, result, v16, v28, v35, v47, v53, v65, v69 int32 var _objPtr, _objPtr1, _objPtr2, bytes, cachePtr, cachePtr1, cachePtr2, mapPtr, patternObj, replacementObj, stringTokenPtr, tokenPtr, v11, v12, v13, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v48, v49, v5, v50, v51, v52, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v66, v67, v68, v70, v72, v74, v8, v9 uintptr var eclIndex, v4, v71, v73 TTcl_Size var v1, v6, v7 bool var _ /* exact at bp+224 */ int32 var _ /* len at bp+232 */ TTcl_Size var _ /* pattern at bp+0 */ TTcl_DString var _ /* quantified at bp+228 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objPtr, _objPtr1, _objPtr2, bytes, cachePtr, cachePtr1, cachePtr2, delta1, eclIndex, mapPtr, patternObj, replacementObj, result, stringTokenPtr, tokenPtr, v1, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v8, v9 /* * We only compile the case with [regsub -all] where the pattern is both * known at compile time and simple (i.e., no RE metacharacters). That is, * the pattern must be translatable into a glob like "*foo*" with no other * glob metacharacters inside it; there must be some "foo" in there too. * The substitution string must also be known at compile time and free of * metacharacters ("\digit" and "&"). Finally, there must not be a * variable mentioned in the [regsub] to write the result back to (because * we can't get the count of substitutions that would be the result in * that case). The key is that these are the conditions under which a * [string map] could be used instead, in particular a [string map] of the * form we can compile to bytecode. * * In short, we look for: * * regsub -all [--] simpleRE string simpleReplacement * * The only optional part is the "--", and no other options are handled. */ mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) patternObj = libc.UintptrFromInt32(0) replacementObj = libc.UintptrFromInt32(0) result = int32(TCL_ERROR) if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(5) || int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(6) { return int32(TCL_ERROR) } /* * Parse the "-all", which must be the first argument (other options not * supported, non-"-all" substitution we can't compile). */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize != int64(4) || libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, __ccgo_ts+17462, uint64(4)) != 0 { return int32(TCL_ERROR) } /* * Get the pattern into patternObj, checking for "--" in the process. */ XTcl_DStringInit(tls, bp) tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { patternObj = XTclThreadAllocObj(tls) } else { patternObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(patternObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(patternObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(patternObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(patternObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(patternObj)).FtypePtr = libc.UintptrFromInt32(0) if !(XTclWordKnownAtCompileTime(tls, tokenPtr, patternObj) != 0) { goto done } if (*TTcl_Obj)(unsafe.Pointer(patternObj)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(patternObj)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, patternObj, libc.UintptrFromInt32(0)) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2))) == int32('-') { if (*TTcl_Obj)(unsafe.Pointer(patternObj)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(patternObj)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, patternObj, libc.UintptrFromInt32(0)) } if libc.Xstrcmp(tls, v3, __ccgo_ts+18684) != 0 || (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(5) { goto done } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 _objPtr = patternObj v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { patternObj = XTclThreadAllocObj(tls) } else { patternObj = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(patternObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(patternObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(patternObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(patternObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(patternObj)).FtypePtr = libc.UintptrFromInt32(0) if !(XTclWordKnownAtCompileTime(tls, tokenPtr, patternObj) != 0) { goto done } } else { if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(6) { goto done } } /* * Identify the code which produces the string to apply the substitution * to (stringTokenPtr), and the replacement string (into replacementObj). */ stringTokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 tokenPtr = stringTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v7 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v7 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v7 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { replacementObj = XTclThreadAllocObj(tls) } else { replacementObj = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(replacementObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(replacementObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(replacementObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(replacementObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(replacementObj)).FtypePtr = libc.UintptrFromInt32(0) if !(XTclWordKnownAtCompileTime(tls, tokenPtr, replacementObj) != 0) { goto done } /* * Next, higher-level checks. Is the RE a very simple glob? Is the * replacement "simple"? */ if (*TTcl_Obj)(unsafe.Pointer(patternObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 232)) = (*TTcl_Obj)(unsafe.Pointer(patternObj)).Flength v8 = (*TTcl_Obj)(unsafe.Pointer(patternObj)).Fbytes } else { v8 = XTcl_GetStringFromObj(tls, patternObj, bp+232) } bytes = v8 if XTclReToGlob(tls, libc.UintptrFromInt32(0), bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 232)), bp, bp+224, bp+228) != TCL_OK || *(*int32)(unsafe.Pointer(bp + 224)) != 0 || *(*int32)(unsafe.Pointer(bp + 228)) != 0 { goto done } bytes = (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1 v9 = bytes bytes++ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v9))) != int32('*') { goto done } for int32(1) != 0 { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes))) { case int32('*'): if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes + 1))) == int32('\000') { /* * OK, we've proved there are no metacharacters except for the * '*' at each end. */ *(*TTcl_Size)(unsafe.Pointer(bp + 232)) = (*TTcl_DString)(unsafe.Pointer(bp)).Flength - int64(2) if *(*TTcl_Size)(unsafe.Pointer(bp + 232))+int64(2) > int64(2) { goto isSimpleGlob } /* * The pattern is "**"! I believe that should be impossible, * but we definitely can't handle that at all. */ } fallthrough case int32('\000'): fallthrough case int32('?'): fallthrough case int32('['): fallthrough case int32('\\'): goto done } bytes++ } goto isSimpleGlob isSimpleGlob: ; if (*TTcl_Obj)(unsafe.Pointer(replacementObj)).Fbytes != 0 { v11 = (*TTcl_Obj)(unsafe.Pointer(replacementObj)).Fbytes } else { v11 = XTcl_GetStringFromObj(tls, replacementObj, libc.UintptrFromInt32(0)) } bytes = v11 for { if !(*(*uint8)(unsafe.Pointer(bytes)) != 0) { break } switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes))) { case int32('\\'): fallthrough case int32('&'): goto done } goto _10 _10: ; bytes++ } /* * Proved the simplicity constraints! Time to issue the code. */ result = TCL_OK bytes = (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1 + uintptr(1) _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 232)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v16 = delta1 v17 = envPtr2 if v16 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v17)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v17)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v17)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v17)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v17 + 64)) += int64(v16) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v28 = delta1 v29 = envPtr2 if v28 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v29 + 64)) += int64(v28) } } if (*TTcl_Obj)(unsafe.Pointer(replacementObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 232)) = (*TTcl_Obj)(unsafe.Pointer(replacementObj)).Flength v30 = (*TTcl_Obj)(unsafe.Pointer(replacementObj)).Fbytes } else { v30 = XTcl_GetStringFromObj(tls, replacementObj, bp+232) } bytes = v30 _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 232)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v47 = delta1 v48 = envPtr2 if v47 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v48 + 64)) += int64(v47) } } if (*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(stringTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(stringTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v65 = delta1 v66 = envPtr2 if v65 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v66 + 64)) += int64(v65) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(2))*8)) XTclCompileTokens(tls, interp, stringTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = libc.Uint8FromInt32(int32(INST_STR_MAP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_MAP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } goto done done: ; XTcl_DStringFree(tls, bp) if patternObj != 0 { _objPtr1 = patternObj v72 = _objPtr1 v71 = *(*TTcl_Size)(unsafe.Pointer(v72)) *(*TTcl_Size)(unsafe.Pointer(v72))-- if v71 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } if replacementObj != 0 { _objPtr2 = replacementObj v74 = _objPtr2 v73 = *(*TTcl_Size)(unsafe.Pointer(v74)) *(*TTcl_Size)(unsafe.Pointer(v74))-- if v73 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } return result } /* *---------------------------------------------------------------------- * * TclCompileReturnCmd -- * * Procedure called to compile the "return" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "return" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileReturnCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2263 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, delta1, enclosingCatch, explicitResult, index, numOptionWords, numWords, objc, status, v110, v122, v128, v140, v146, v158, v17, v23, v35, v43, v5, v51, v63, v69, v81, v87, v89, v98 int32 var _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr2, mapPtr, msgTokenPtr, objv, optsTokenPtr, wordTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v123, v124, v125, v126, v127, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v141, v142, v143, v144, v145, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v159, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v4, v41, v45, v47, v48, v49, v50, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v82, v84, v85, v86, v88, v9, v90, v92, v94, v95, v96, v97, v99 uintptr var eclIndex, v40, v44, v83, v91 TTcl_Size var range1 TExceptionRange var v38, v42, v46 bool var _ /* code at bp+4 */ int32 var _ /* level at bp+0 */ int32 var _ /* returnOpts at bp+16 */ uintptr var _ /* size at bp+8 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr2, delta1, eclIndex, enclosingCatch, explicitResult, index, mapPtr, msgTokenPtr, numOptionWords, numWords, objc, objv, optsTokenPtr, range1, status, wordTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v38, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) status = TCL_OK numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) explicitResult = libc.BoolInt32(0 == numWords%int32(2)) numOptionWords = numWords - int32(1) - explicitResult wordTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * Check for special case which can always be compiled: * return -options * Unlike the normal [return] compilation, this version does everything at * runtime so it can handle arbitrary words and not just literals. Note * that if INST_RETURN_STK wasn't already needed for something else * ('finally' clause processing) this piece of code would not be present. */ if numWords == int32(4) && (*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) && (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fsize == int64(8) && libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fstart, __ccgo_ts+21837, uint64(8)) == 0 { optsTokenPtr = wordTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 msgTokenPtr = optsTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(optsTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(optsTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(optsTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(optsTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, optsTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(optsTokenPtr)).FnumComponents), envPtr2) } if (*TTcl_Token)(unsafe.Pointer(msgTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(msgTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(msgTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileTokens(tls, interp, msgTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(msgTokenPtr)).FnumComponents), envPtr2) } XTclEmitInvoke(tls, envPtr2, int32(INST_RETURN_STK), 0) return TCL_OK } /* * Allocate some working space. */ objv = XTclStackAlloc(tls, interp, libc.Uint64FromInt32(numOptionWords)*uint64(8)) /* * Scan through the return options. If any are unknown at compile time, * there is no value in bytecompiling. Save the option values known in an * objv array for merging into a return options dictionary. * * TODO: There is potential for improvement if all option keys are known * at compile time and all option values relating to '-code' and '-level' * are known at compile time. */ objc = 0 for { if !(objc < numOptionWords) { break } if v38 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v38 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v38 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FrefCount++ if !(XTclWordKnownAtCompileTime(tls, wordTokenPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) != 0) { /* * Non-literal, so punt to run-time assembly of the dictionary. */ for { if !(objc >= 0) { break } v41 = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) v40 = *(*TTcl_Size)(unsafe.Pointer(v41)) *(*TTcl_Size)(unsafe.Pointer(v41))-- if !(v40 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Flength = int64(-libc.Int32FromInt32(1)) if v42 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v42 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v42 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) } } goto _39 _39: ; objc-- } XTclStackFree(tls, interp, objv) goto issueRuntimeReturn } wordTokenPtr = wordTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _37 _37: ; objc++ } status = XTclMergeReturnOptions(tls, interp, objc, objv, bp+16, bp+4, bp) for { objc-- v43 = objc if !(v43 >= 0) { break } v45 = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) v44 = *(*TTcl_Size)(unsafe.Pointer(v45)) *(*TTcl_Size)(unsafe.Pointer(v45))-- if !(v44 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Flength = int64(-libc.Int32FromInt32(1)) if v46 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v46 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v46 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) } } } XTclStackFree(tls, interp, objv) if int32(TCL_ERROR) == status { /* * Something was bogus in the return options. Clear the error message, * and report back to the compiler that this must be interpreted at * runtime. */ XTcl_ResetResult(tls, interp) return int32(TCL_ERROR) } /* * All options are known at compile time, so we're going to bytecompile. * Emit instructions to push the result on the stack. */ if explicitResult != 0 { if (*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v63 = delta1 v64 = envPtr2 if v63 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v64 + 64)) += int64(v63) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(numWords-libc.Int32FromInt32(1))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(numWords-libc.Int32FromInt32(1))*8)) XTclCompileTokens(tls, interp, wordTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents), envPtr2) } } else { /* * No explict result argument, so default result is empty string. */ _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v81 = delta1 v82 = envPtr2 if v81 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v82 + 64)) += int64(v81) } } } /* * Check for optimization: When [return] is in a proc, and there's no * enclosing [catch], and there are no return options, then the INST_DONE * instruction is equivalent, and may be more efficient. */ if numOptionWords == 0 && (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr != libc.UintptrFromInt32(0) { /* * We have default return options and we're in a proc ... */ index = int32((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayNext - int64(1)) enclosingCatch = 0 for index >= 0 { range1 = *(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(index)*56)) if range1.Ftype1 == int32(CATCH_EXCEPTION_RANGE) && range1.FcatchOffset == int64(-libc.Int32FromInt32(1)) { enclosingCatch = int32(1) break } index-- } if !(enclosingCatch != 0) { /* * ... and there is no enclosing catch. Issue the maximally * efficient exit instruction. */ _objPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) v84 = _objPtr v83 = *(*TTcl_Size)(unsafe.Pointer(v84)) *(*TTcl_Size)(unsafe.Pointer(v84))-- if v83 <= int64(1) { XTclFreeObj(tls, _objPtr) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = libc.Uint8FromInt32(int32(INST_DONE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DONE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v87 = delta1 v88 = envPtr2 if v87 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v88 + 64)) += int64(v87) } v89 = int32(1) v90 = envPtr2 if v89 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v90)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v90)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v90)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v90)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v90 + 64)) += int64(v89) return TCL_OK } } /* Optimize [return -level 0 $x]. */ XTcl_DictObjSize(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 16)), bp+8) if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 && *(*int32)(unsafe.Pointer(bp)) == 0 && *(*int32)(unsafe.Pointer(bp + 4)) == TCL_OK { _objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 16)) v92 = _objPtr1 v91 = *(*TTcl_Size)(unsafe.Pointer(v92)) *(*TTcl_Size)(unsafe.Pointer(v92))-- if v91 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return TCL_OK } /* * Could not use the optimization, so we push the return options dict, and * emit the INST_RETURN_IMM instruction with code and level as operands. */ _CompileReturnInternal(tls, envPtr2, uint8(INST_RETURN_IMM), *(*int32)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 16))) return TCL_OK goto issueRuntimeReturn issueRuntimeReturn: ; /* * Assemble the option dictionary (as a list as that's good enough). */ wordTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 objc = int32(1) for { if !(objc <= numOptionWords) { break } if (*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v95 = envPtr2 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v98 = delta1 v99 = envPtr2 if v98 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v99)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v99)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v99)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v99)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v99 + 64)) += int64(v98) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v101 = envPtr2 + 152 v100 = *(*uintptr)(unsafe.Pointer(v101)) *(*uintptr)(unsafe.Pointer(v101))++ *(*uint8)(unsafe.Pointer(v100)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v107 = envPtr2 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v110 = delta1 v111 = envPtr2 if v110 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v111)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v111)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v111)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v111)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v111 + 64)) += int64(v110) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(objc)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(objc)*8)) XTclCompileTokens(tls, interp, wordTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents), envPtr2) } wordTokenPtr = wordTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _93 _93: ; objc++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v113 = envPtr2 + 152 v112 = *(*uintptr)(unsafe.Pointer(v113)) *(*uintptr)(unsafe.Pointer(v113))++ *(*uint8)(unsafe.Pointer(v112)) = libc.Uint8FromInt32(int32(INST_LIST)) v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = uint8(libc.Uint32FromInt32(numOptionWords) >> libc.Int32FromInt32(24)) v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = uint8(libc.Uint32FromInt32(numOptionWords) >> libc.Int32FromInt32(16)) v119 = envPtr2 + 152 v118 = *(*uintptr)(unsafe.Pointer(v119)) *(*uintptr)(unsafe.Pointer(v119))++ *(*uint8)(unsafe.Pointer(v118)) = uint8(libc.Uint32FromInt32(numOptionWords) >> libc.Int32FromInt32(8)) v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = uint8(libc.Uint32FromInt32(numOptionWords)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - numOptionWords } v122 = delta1 v123 = envPtr2 if v122 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v123)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v123)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v123)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v123)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v123 + 64)) += int64(v122) } /* * Push the result. */ if explicitResult != 0 { if (*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v125 = envPtr2 + 152 v124 = *(*uintptr)(unsafe.Pointer(v125)) *(*uintptr)(unsafe.Pointer(v125))++ *(*uint8)(unsafe.Pointer(v124)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v127 = envPtr2 + 152 v126 = *(*uintptr)(unsafe.Pointer(v127)) *(*uintptr)(unsafe.Pointer(v127))++ *(*uint8)(unsafe.Pointer(v126)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v128 = delta1 v129 = envPtr2 if v128 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v129)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v129)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v129)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v129)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v129 + 64)) += int64(v128) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v135 = envPtr2 + 152 v134 = *(*uintptr)(unsafe.Pointer(v135)) *(*uintptr)(unsafe.Pointer(v135))++ *(*uint8)(unsafe.Pointer(v134)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v137 = envPtr2 + 152 v136 = *(*uintptr)(unsafe.Pointer(v137)) *(*uintptr)(unsafe.Pointer(v137))++ *(*uint8)(unsafe.Pointer(v136)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v140 = delta1 v141 = envPtr2 if v140 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v141)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v141)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v141)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v141)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v141 + 64)) += int64(v140) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(numWords-libc.Int32FromInt32(1))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(numWords-libc.Int32FromInt32(1))*8)) XTclCompileTokens(tls, interp, wordTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents), envPtr2) } } else { _objIndexCopy6 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy6 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v143 = envPtr2 + 152 v142 = *(*uintptr)(unsafe.Pointer(v143)) *(*uintptr)(unsafe.Pointer(v143))++ *(*uint8)(unsafe.Pointer(v142)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v145 = envPtr2 + 152 v144 = *(*uintptr)(unsafe.Pointer(v145)) *(*uintptr)(unsafe.Pointer(v145))++ *(*uint8)(unsafe.Pointer(v144)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v146 = delta1 v147 = envPtr2 if v146 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v147)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v147)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v147)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v147)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v147 + 64)) += int64(v146) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v149 = envPtr2 + 152 v148 = *(*uintptr)(unsafe.Pointer(v149)) *(*uintptr)(unsafe.Pointer(v149))++ *(*uint8)(unsafe.Pointer(v148)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v151 = envPtr2 + 152 v150 = *(*uintptr)(unsafe.Pointer(v151)) *(*uintptr)(unsafe.Pointer(v151))++ *(*uint8)(unsafe.Pointer(v150)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(24)) v153 = envPtr2 + 152 v152 = *(*uintptr)(unsafe.Pointer(v153)) *(*uintptr)(unsafe.Pointer(v153))++ *(*uint8)(unsafe.Pointer(v152)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(16)) v155 = envPtr2 + 152 v154 = *(*uintptr)(unsafe.Pointer(v155)) *(*uintptr)(unsafe.Pointer(v155))++ *(*uint8)(unsafe.Pointer(v154)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(8)) v157 = envPtr2 + 152 v156 = *(*uintptr)(unsafe.Pointer(v157)) *(*uintptr)(unsafe.Pointer(v157))++ *(*uint8)(unsafe.Pointer(v156)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v158 = delta1 v159 = envPtr2 if v158 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v159)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v159)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v159)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v159)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v159 + 64)) += int64(v158) } } } /* * Issue the RETURN itself. */ XTclEmitInvoke(tls, envPtr2, int32(INST_RETURN_STK), 0) return TCL_OK } func _CompileReturnInternal(tls *libc.TLS, envPtr2 uintptr, op1 uint8, code int32, level int32, returnOpts uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objIndexCopy, delta1, v19, v31, v32, v7 int32 var _objPtr, rangePtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v5, v6, v8, v9 uintptr var v1 TTcl_Size var _ /* exceptAux at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objPtr, delta1, rangePtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v5, v6, v7, v8, v9 if level == 0 && (code == int32(TCL_BREAK) || code == int32(TCL_CONTINUE)) { rangePtr = XTclGetInnermostExceptionRange(tls, envPtr2, code, bp) if rangePtr != 0 && (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 == int32(LOOP_EXCEPTION_RANGE) { XTclCleanupStackForBreakContinue(tls, envPtr2, *(*uintptr)(unsafe.Pointer(bp))) if code == int32(TCL_BREAK) { XTclAddLoopBreakFixup(tls, envPtr2, *(*uintptr)(unsafe.Pointer(bp))) } else { XTclAddLoopContinueFixup(tls, envPtr2, *(*uintptr)(unsafe.Pointer(bp))) } _objPtr = returnOpts v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return } } _objIndexCopy = XTclAddLiteralObj(tls, envPtr2, returnOpts, libc.UintptrFromInt32(0)) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v7 = delta1 v8 = envPtr2 if v7 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v8)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v8)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v8)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v8)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v8 + 64)) += int64(v7) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v19 = delta1 v20 = envPtr2 if v19 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v20 + 64)) += int64(v19) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = op1 v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = uint8(libc.Uint32FromInt32(code) >> libc.Int32FromInt32(24)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(code) >> libc.Int32FromInt32(16)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(code) >> libc.Int32FromInt32(8)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(code)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if libc.Int32FromUint8(op1) == int32(INST_START_CMD) { v31 = int32(1) } else { v31 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v31 } delta1 = XtclInstructionTable[op1].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - code } v32 = delta1 v33 = envPtr2 if v32 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v33 + 64)) += int64(v32) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(level) >> libc.Int32FromInt32(24)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(level) >> libc.Int32FromInt32(16)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(level) >> libc.Int32FromInt32(8)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(level)) } func XTclCompileSyntaxError(tls *libc.TLS, interp uintptr, envPtr2 uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objIndexCopy, delta1, v18, v6 int32 var bytes, msg, v1, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v3, v4, v5, v7, v8, v9 uintptr var _ /* numBytes at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, bytes, delta1, msg, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v3, v4, v5, v6, v7, v8, v9 msg = XTcl_GetObjResult(tls, interp) if (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(msg)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, msg, bp) } bytes = v1 XTclErrorStackResetIf(tls, interp, bytes, *(*TTcl_Size)(unsafe.Pointer(bp))) _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } _CompileReturnInternal(tls, envPtr2, uint8(INST_SYNTAX), int32(TCL_ERROR), 0, XTclNoErrorStack(tls, interp, XTcl_GetReturnOptions(tls, interp, int32(TCL_ERROR)))) XTcl_ResetResult(tls, interp) } /* *---------------------------------------------------------------------- * * TclCompileUpvarCmd -- * * Procedure called to compile the "upvar" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "upvar" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileUpvarCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2515 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, delta1, i1, localIndex, numWords, v20, v26, v38, v47, v59, v71, v75, v8, v81, v93 int32 var _objPtr, _objPtr1, cachePtr, localTokenPtr, mapPtr, newTypePtr, objPtr, otherTokenPtr, tokenPtr, typePtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v21, v22, v23, v24, v25, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v39, v4, v41, v43, v44, v45, v46, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v72, v73, v74, v76, v77, v78, v79, v80, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v94 uintptr var eclIndex, v2, v40 TTcl_Size var v1 bool var _ /* framePtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objPtr, _objPtr1, cachePtr, delta1, eclIndex, i1, localIndex, localTokenPtr, mapPtr, newTypePtr, numWords, objPtr, otherTokenPtr, tokenPtr, typePtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) if numWords < int32(3) { return int32(TCL_ERROR) } /* * Push the frame index if it is known at compile time */ if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if XTclWordKnownAtCompileTime(tls, tokenPtr, objPtr) != 0 { typePtr = (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr /* * Attempt to convert to a level reference. Note that TclObjGetFrame * only changes the obj type when a conversion was successful. */ XTclObjGetFrame(tls, interp, objPtr, bp) newTypePtr = (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr _objPtr = objPtr v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } if newTypePtr != typePtr { if numWords%int32(2) != 0 { return int32(TCL_ERROR) } /* TODO: Push the known value instead? */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v8 = delta1 v9 = envPtr2 if v8 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v9 + 64)) += int64(v8) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v20 = delta1 v21 = envPtr2 if v20 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v21 + 64)) += int64(v20) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } otherTokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(2) } else { if !(numWords%libc.Int32FromInt32(2) != 0) { return int32(TCL_ERROR) } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v26 = delta1 v27 = envPtr2 if v26 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v27 + 64)) += int64(v26) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v38 = delta1 v39 = envPtr2 if v38 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v39 + 64)) += int64(v38) } } otherTokenPtr = tokenPtr i1 = int32(1) } } else { _objPtr1 = objPtr v41 = _objPtr1 v40 = *(*TTcl_Size)(unsafe.Pointer(v41)) *(*TTcl_Size)(unsafe.Pointer(v41))-- if v40 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return int32(TCL_ERROR) } /* * Loop over the (otherVar, thisVar) pairs. If any of the thisVar is not a * local variable, return an error so that the non-compiled command will * be called at runtime. */ for { if !(i1 < numWords) { break } localTokenPtr = otherTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(otherTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(otherTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(otherTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(otherTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v47 = delta1 v48 = envPtr2 if v47 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v48 + 64)) += int64(v47) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v59 = delta1 v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, otherTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(otherTokenPtr)).FnumComponents), envPtr2) } localIndex = libc.Int32FromUint64(XTclLocalScalarFromToken(tls, localTokenPtr, envPtr2)) if localIndex < 0 { return int32(TCL_ERROR) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(int32(INST_UPVAR)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(24)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(16)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(8)) v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = uint8(libc.Uint32FromInt32(localIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UPVAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - localIndex } v71 = delta1 v72 = envPtr2 if v71 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v72 + 64)) += int64(v71) } goto _42 _42: ; i1 += int32(2) otherTokenPtr = localTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(localTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } /* * Pop the frame index, and set the result to empty */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v75 = delta1 v76 = envPtr2 if v75 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v76 + 64)) += int64(v75) } _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v81 = delta1 v82 = envPtr2 if v81 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v82 + 64)) += int64(v81) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v93 = delta1 v94 = envPtr2 if v93 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v94)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v94)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v94)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v94)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v94 + 64)) += int64(v93) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileVariableCmd -- * * Procedure called to compile the "variable" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "variable" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileVariableCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2621 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, i1, localIndex, numWords, v18, v30, v36, v48, v54, v6, v66, v70, v76, v88 int32 var eclIndex TTcl_Size var mapPtr, valueTokenPtr, varTokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v49, v5, v50, v51, v52, v53, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v67, v68, v69, v7, v71, v72, v73, v74, v75, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v89, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, eclIndex, i1, localIndex, mapPtr, numWords, valueTokenPtr, varTokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) if numWords < int32(2) { return int32(TCL_ERROR) } /* * Bail out if not compiling a proc body */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * Loop over the (var, value) pairs. */ valueTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr i1 = int32(1) for { if !(i1 < numWords) { break } varTokenPtr = valueTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 valueTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 localIndex = _IndexTailVarIfKnown(tls, interp, varTokenPtr, envPtr2) if localIndex < 0 { return int32(TCL_ERROR) } /* TODO: Consider what value can pass through the * IndexTailVarIfKnown() screen. Full CompileWord() * likely does not apply here. Push known value instead. */ if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, varTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_VARIABLE)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(24)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(16)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(8)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(localIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_VARIABLE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - localIndex } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } if i1+int32(1) < numWords { /* * A value has been given: set the variable, pop the value */ if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v48 = delta1 v49 = envPtr2 if v48 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v49 + 64)) += int64(v48) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1+libc.Int32FromInt32(1))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1+libc.Int32FromInt32(1))*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } if localIndex <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = uint8(libc.Uint32FromInt32(localIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - localIndex } v54 = delta1 v55 = envPtr2 if v54 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v55 + 64)) += int64(v54) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(24)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(16)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(localIndex) >> libc.Int32FromInt32(8)) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(localIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - localIndex } v66 = delta1 v67 = envPtr2 if v66 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v67)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v67)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v67 + 64)) += int64(v66) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v70 = delta1 v71 = envPtr2 if v70 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v71 + 64)) += int64(v70) } } goto _1 _1: ; i1 += int32(2) } /* * Set the result to empty */ _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v76 = delta1 v77 = envPtr2 if v76 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v77 + 64)) += int64(v76) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v83 = envPtr2 + 152 v82 = *(*uintptr)(unsafe.Pointer(v83)) *(*uintptr)(unsafe.Pointer(v83))++ *(*uint8)(unsafe.Pointer(v82)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v85 = envPtr2 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v88 = delta1 v89 = envPtr2 if v88 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v89)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v89)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v89)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v89)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v89 + 64)) += int64(v88) } } return TCL_OK } /* *---------------------------------------------------------------------- * * IndexTailVarIfKnown -- * * Procedure used in compiling [global] and [variable] commands. It * inspects the variable name described by varTokenPtr and, if the tail * is known at compile time, defines a corresponding local variable. * * Results: * Returns the variable's index in the table of compiled locals if the * tail is known at compile time, or -1 otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _IndexTailVarIfKnown(tls *libc.TLS, dummy2702 uintptr, varTokenPtr uintptr, envPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, cachePtr, lastTokenPtr, p, tailName, tailPtr, v11, v3, v4, v6, v9 uintptr var full, localIndex, n int32 var v1 bool var v10, v2, v5, v8 TTcl_Size var _ /* len at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, cachePtr, full, lastTokenPtr, localIndex, n, p, tailName, tailPtr, v1, v10, v11, v2, v3, v4, v5, v6, v8, v9 n = int32((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents) /* * Determine if the tail is (a) known at compile time, and (b) not an * array element. Should any of these fail, return an error so that the * non-compiled command will be called at runtime. * * In order for the tail to be known at compile time, the last token in * the word has to be constant and contain "::" if it is not the only one. */ if !((*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != 0 || (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FvarFramePtr)).FlocalCachePtr != 0) { return -int32(1) } if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { tailPtr = XTclThreadAllocObj(tls) } else { tailPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tailPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tailPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(tailPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tailPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(tailPtr)).FtypePtr = libc.UintptrFromInt32(0) if XTclWordKnownAtCompileTime(tls, varTokenPtr, tailPtr) != 0 { full = int32(1) lastTokenPtr = varTokenPtr } else { full = 0 lastTokenPtr = varTokenPtr + uintptr(n)*32 if (*TTcl_Token)(unsafe.Pointer(lastTokenPtr)).Ftype1 != int32(TCL_TOKEN_TEXT) { _objPtr = tailPtr v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } return -int32(1) } XTcl_SetStringObj(tls, tailPtr, (*TTcl_Token)(unsafe.Pointer(lastTokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(lastTokenPtr)).Fsize) } if (*TTcl_Obj)(unsafe.Pointer(tailPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(tailPtr)).Flength v4 = (*TTcl_Obj)(unsafe.Pointer(tailPtr)).Fbytes } else { v4 = XTcl_GetStringFromObj(tls, tailPtr, bp) } tailName = v4 if *(*TTcl_Size)(unsafe.Pointer(bp)) != 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(tailName + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp))) - libc.UintptrFromInt32(1)))) == int32(')') { /* * Possible array: bail out */ _objPtr1 = tailPtr v6 = _objPtr1 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return -int32(1) } /* * Get the tail: immediately after the last '::' */ p = tailName + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp))) - uintptr(1) for { if !(p > tailName) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(':') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + uintptr(-libc.Int32FromInt32(1))))) == int32(':') { p++ break } goto _7 _7: ; p-- } if !(full != 0) && p == tailName { /* * No :: in the last component. */ _objPtr2 = tailPtr v9 = _objPtr2 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr2) } return -int32(1) } *(*TTcl_Size)(unsafe.Pointer(bp)) -= int64(p) - int64(tailName) tailName = p } localIndex = int32(XTclFindCompiledLocal(tls, tailName, *(*TTcl_Size)(unsafe.Pointer(bp)), int32(1), envPtr)) _objPtr3 = tailPtr v11 = _objPtr3 v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if v10 <= int64(1) { XTclFreeObj(tls, _objPtr3) } return localIndex } /* * ---------------------------------------------------------------------- * * TclCompileObjectNextCmd, TclCompileObjectSelfCmd -- * * Compilations of the TclOO utility commands [next] and [self]. * * ---------------------------------------------------------------------- */ func XTclCompileObjectNextCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2795 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, i1, v18, v24, v6 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v25, v3, v4, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, i1, mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(255) { return int32(TCL_ERROR) } i1 = 0 for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_TCLOO_NEXT)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(i1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TCLOO_NEXT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - i1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } return TCL_OK } func XTclCompileObjectNextToCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2819 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, i1, v18, v24, v6 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v25, v3, v4, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, i1, mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(2) || int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(255) { return int32(TCL_ERROR) } i1 = 0 for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_TCLOO_NEXT_CLASS)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(i1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TCLOO_NEXT_CLASS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - i1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } return TCL_OK } func XTclCompileObjectSelfCmd(tls *libc.TLS, dummy2840 uintptr, parsePtr uintptr, dummy2843 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var delta1, v11, v15, v3, v7 int32 var subcmd, tokenPtr, v1, v10, v12, v13, v14, v16, v2, v4, v5, v6, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = delta1, subcmd, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v2, v3, v4, v5, v6, v7, v8, v9 /* * We only handle [self] and [self object] (which is the same operation). * These are the only very common operations on [self] for which * bytecoding is at all reasonable. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(1) { goto compileSelfObject } else { if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(2) { tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize == 0 { return int32(TCL_ERROR) } subcmd = tokenPtr + uintptr(1)*32 if libc.Xstrncmp(tls, (*TTcl_Token)(unsafe.Pointer(subcmd)).Fstart, __ccgo_ts+6499, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(subcmd)).Fsize)) == 0 { goto compileSelfObject } else { if libc.Xstrncmp(tls, (*TTcl_Token)(unsafe.Pointer(subcmd)).Fstart, __ccgo_ts+21846, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(subcmd)).Fsize)) == 0 { goto compileSelfNamespace } } } } /* * Can't compile; handle with runtime call. */ return int32(TCL_ERROR) goto compileSelfObject compileSelfObject: ; /* * This delegates the entire problem to a single opcode. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_TCLOO_SELF)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TCLOO_SELF)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } return TCL_OK goto compileSelfNamespace compileSelfNamespace: ; /* * This is formally only correct with TclOO methods as they are currently * implemented; it assumes that the current namespace is invariably when a * TclOO context is present is the object's namespace, and that's * technically only something that's a matter of current policy. But it * avoids creating another opcode, so that's all good! */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32(INST_TCLOO_SELF)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TCLOO_SELF)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v7 = delta1 v8 = envPtr2 if v7 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v8)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v8)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v8)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v8)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v8 + 64)) += int64(v7) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v11 = delta1 v12 = envPtr2 if v11 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v12 + 64)) += int64(v11) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32(int32(INST_NS_CURRENT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NS_CURRENT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v15 = delta1 v16 = envPtr2 if v15 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v16)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v16)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v16 + 64)) += int64(v15) } return TCL_OK } func init() { p := unsafe.Pointer(&XtclJumptableInfoType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_DupJumptableInfo) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_FreeJumptableInfo) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_PrintJumptableInfo) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_DisassembleJumptableInfo) } /* * Shorthand macros for instruction issuing. */ /* *---------------------------------------------------------------------- * * TclCompileSetCmd -- * * Procedure called to compile the "set" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "set" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileSetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy128 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, delta1, isAssignment, numWords, v17, v21, v22, v23, v24, v25, v29, v32, v33, v34, v35, v39, v48, v49, v5, v50, v51, v55, v56, v57, v58, v59, v63, v66, v67, v68, v69, v73, v82, v83, v84, v85 int32 var eclIndex TTcl_Size var mapPtr, valueTokenPtr, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v26, v27, v28, v3, v30, v31, v36, v37, v38, v4, v40, v41, v42, v43, v44, v45, v46, v47, v52, v53, v54, v6, v60, v61, v62, v64, v65, v7, v70, v71, v72, v74, v75, v76, v77, v78, v79, v8, v80, v81, v86, v9 uintptr var _ /* isScalar at bp+0 */ int32 var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, isAssignment, mapPtr, numWords, valueTokenPtr, varTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) if numWords != int32(2) && numWords != int32(3) { return int32(TCL_ERROR) } isAssignment = libc.BoolInt32(numWords == int32(3)) /* * Decide if we can use a frame slot for the var/array name or if we need * to emit code to compute and push the name at runtime. We use a frame * slot (entry in the array of local vars) if we are compiling a procedure * body and if the name is simple text that does not include namespace * qualifiers. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclPushVarName(tls, interp, varTokenPtr, envPtr2, 0, bp+4, bp) /* * If we are doing an assignment, push the new value. */ if isAssignment != 0 { valueTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } } /* * Emit instructions to set/get the variable. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ if isAssignment != 0 { v21 = int32(INST_STORE_STK) } else { v21 = int32(INST_LOAD_STK) } *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(v21) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if isAssignment != 0 { v23 = int32(INST_STORE_STK) } else { v23 = int32(INST_LOAD_STK) } if v23 == int32(INST_START_CMD) { v22 = int32(1) } else { v22 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v22 } if isAssignment != 0 { v24 = int32(INST_STORE_STK) } else { v24 = int32(INST_LOAD_STK) } delta1 = XtclInstructionTable[libc.Uint8FromInt32(v24)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v25 = delta1 v26 = envPtr2 if v25 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v26 + 64)) += int64(v25) } } else { if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ if isAssignment != 0 { v29 = int32(INST_STORE_SCALAR1) } else { v29 = int32(INST_LOAD_SCALAR1) } *(*uint8)(unsafe.Pointer(v27)) = libc.Uint8FromInt32(v29) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if isAssignment != 0 { v33 = int32(INST_STORE_SCALAR1) } else { v33 = int32(INST_LOAD_SCALAR1) } if v33 == int32(INST_START_CMD) { v32 = int32(1) } else { v32 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v32 } if isAssignment != 0 { v34 = int32(INST_STORE_SCALAR1) } else { v34 = int32(INST_LOAD_SCALAR1) } delta1 = XtclInstructionTable[libc.Uint8FromInt32(v34)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ if isAssignment != 0 { v39 = int32(INST_STORE_SCALAR4) } else { v39 = int32(INST_LOAD_SCALAR4) } *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(v39) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if isAssignment != 0 { v49 = int32(INST_STORE_SCALAR4) } else { v49 = int32(INST_LOAD_SCALAR4) } if v49 == int32(INST_START_CMD) { v48 = int32(1) } else { v48 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v48 } if isAssignment != 0 { v50 = int32(INST_STORE_SCALAR4) } else { v50 = int32(INST_LOAD_SCALAR4) } delta1 = XtclInstructionTable[libc.Uint8FromInt32(v50)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } } } } else { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ if isAssignment != 0 { v55 = int32(INST_STORE_ARRAY_STK) } else { v55 = int32(INST_LOAD_ARRAY_STK) } *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt32(v55) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if isAssignment != 0 { v57 = int32(INST_STORE_ARRAY_STK) } else { v57 = int32(INST_LOAD_ARRAY_STK) } if v57 == int32(INST_START_CMD) { v56 = int32(1) } else { v56 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v56 } if isAssignment != 0 { v58 = int32(INST_STORE_ARRAY_STK) } else { v58 = int32(INST_LOAD_ARRAY_STK) } delta1 = XtclInstructionTable[libc.Uint8FromInt32(v58)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v59 = delta1 v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) } } else { if *(*int32)(unsafe.Pointer(bp + 4)) <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ if isAssignment != 0 { v63 = int32(INST_STORE_ARRAY1) } else { v63 = int32(INST_LOAD_ARRAY1) } *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(v63) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if isAssignment != 0 { v67 = int32(INST_STORE_ARRAY1) } else { v67 = int32(INST_LOAD_ARRAY1) } if v67 == int32(INST_START_CMD) { v66 = int32(1) } else { v66 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v66 } if isAssignment != 0 { v68 = int32(INST_STORE_ARRAY1) } else { v68 = int32(INST_LOAD_ARRAY1) } delta1 = XtclInstructionTable[libc.Uint8FromInt32(v68)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ if isAssignment != 0 { v73 = int32(INST_STORE_ARRAY4) } else { v73 = int32(INST_LOAD_ARRAY4) } *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(v73) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v77 = envPtr2 + 152 v76 = *(*uintptr)(unsafe.Pointer(v77)) *(*uintptr)(unsafe.Pointer(v77))++ *(*uint8)(unsafe.Pointer(v76)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if isAssignment != 0 { v83 = int32(INST_STORE_ARRAY4) } else { v83 = int32(INST_LOAD_ARRAY4) } if v83 == int32(INST_START_CMD) { v82 = int32(1) } else { v82 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v82 } if isAssignment != 0 { v84 = int32(INST_STORE_ARRAY4) } else { v84 = int32(INST_LOAD_ARRAY4) } delta1 = XtclInstructionTable[libc.Uint8FromInt32(v84)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp + 4)) } v85 = delta1 v86 = envPtr2 if v85 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v86 + 64)) += int64(v85) } } } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileString*Cmd -- * * Procedures called to compile various subcommands of the "string" * command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "string" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileStringCatCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy221 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, delta1, i1, numArgs, numWords, v17, v30, v42, v5, v50, v62, v68, v75, v87, v95 int32 var _objPtr, _objPtr1, _objPtr2, _objPtr3, bytes, bytes1, cachePtr, folded, mapPtr, obj, wordTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v2, v22, v24, v25, v26, v27, v28, v29, v3, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v43, v45, v46, v47, v48, v49, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v63, v64, v65, v66, v67, v69, v7, v70, v71, v72, v73, v74, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v88, v9, v90, v91, v92, v93, v94, v96 uintptr var eclIndex, v21, v23, v44, v89 TTcl_Size var v20 bool var _ /* len at bp+0 */ TTcl_Size var _ /* len at bp+8 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objPtr, _objPtr1, _objPtr2, _objPtr3, bytes, bytes1, cachePtr, delta1, eclIndex, folded, i1, mapPtr, numArgs, numWords, obj, wordTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) /* Trivial case, no arg */ if numWords < int32(2) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } return TCL_OK } /* General case: issue CONCAT1's (by chunks of 254 if needed), folding * contiguous constants along the way */ numArgs = 0 folded = libc.UintptrFromInt32(0) wordTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = int32(1) for { if !(i1 < numWords) { break } if v20 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v20 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v20 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { obj = XTclThreadAllocObj(tls) } else { obj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(obj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(obj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(obj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(obj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(obj)).FtypePtr = libc.UintptrFromInt32(0) if XTclWordKnownAtCompileTime(tls, wordTokenPtr, obj) != 0 { if folded != 0 { XTcl_AppendObjToObj(tls, folded, obj) _objPtr = obj v22 = _objPtr v21 = *(*TTcl_Size)(unsafe.Pointer(v22)) *(*TTcl_Size)(unsafe.Pointer(v22))-- if v21 <= int64(1) { XTclFreeObj(tls, _objPtr) } } else { folded = obj } } else { _objPtr1 = obj v24 = _objPtr1 v23 = *(*TTcl_Size)(unsafe.Pointer(v24)) *(*TTcl_Size)(unsafe.Pointer(v24))-- if v23 <= int64(1) { XTclFreeObj(tls, _objPtr1) } if folded != 0 { if (*TTcl_Obj)(unsafe.Pointer(folded)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(folded)).Flength v25 = (*TTcl_Obj)(unsafe.Pointer(folded)).Fbytes } else { v25 = XTcl_GetStringFromObj(tls, folded, bp) } bytes = v25 _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } } _objPtr2 = folded v45 = _objPtr2 v44 = *(*TTcl_Size)(unsafe.Pointer(v45)) *(*TTcl_Size)(unsafe.Pointer(v45))-- if v44 <= int64(1) { XTclFreeObj(tls, _objPtr2) } folded = libc.UintptrFromInt32(0) numArgs++ } if (*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v50 = delta1 v51 = envPtr2 if v50 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v51 + 64)) += int64(v50) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v62 = delta1 v63 = envPtr2 if v62 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v63)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v63)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v63)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v63)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v63 + 64)) += int64(v62) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, wordTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents), envPtr2) } numArgs++ if numArgs >= int32(254) { /* 254 to take care of the possible +1 of "folded" above */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(numArgs)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - numArgs } v68 = delta1 v69 = envPtr2 if v68 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v69 + 64)) += int64(v68) } numArgs = int32(1) /* concat pushes 1 obj, the result */ } } wordTokenPtr = wordTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _19 _19: ; i1++ } if folded != 0 { if (*TTcl_Obj)(unsafe.Pointer(folded)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(folded)).Flength v70 = (*TTcl_Obj)(unsafe.Pointer(folded)).Fbytes } else { v70 = XTcl_GetStringFromObj(tls, folded, bp+8) } bytes1 = v70 _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, bytes1, *(*TTcl_Size)(unsafe.Pointer(bp + 8)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v75 = delta1 v76 = envPtr2 if v75 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v76 + 64)) += int64(v75) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v87 = delta1 v88 = envPtr2 if v87 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v88 + 64)) += int64(v87) } } _objPtr3 = folded v90 = _objPtr3 v89 = *(*TTcl_Size)(unsafe.Pointer(v90)) *(*TTcl_Size)(unsafe.Pointer(v90))-- if v89 <= int64(1) { XTclFreeObj(tls, _objPtr3) } folded = libc.UintptrFromInt32(0) numArgs++ } if numArgs > int32(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = uint8(libc.Uint32FromInt32(numArgs)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - numArgs } v95 = delta1 v96 = envPtr2 if v95 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v96)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v96)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v96)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v96)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v96 + 64)) += int64(v95) } } return TCL_OK } func XTclCompileStringCmpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy292 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, v17, v23, v35, v39, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v4, v40, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * We don't support any flags; the bytecode isn't that sophisticated. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } /* * Push the two operands onto the stack and then the test. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_STR_CMP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CMP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } return TCL_OK } func XTclCompileStringEqualCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy323 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, v17, v23, v35, v39, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v4, v40, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * We don't support any flags; the bytecode isn't that sophisticated. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } /* * Push the two operands onto the stack and then the test. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } return TCL_OK } func XTclCompileStringFirstCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy354 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, v17, v23, v35, v39, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v4, v40, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * We don't support any flags; the bytecode isn't that sophisticated. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } /* * Push the two operands onto the stack and then the test. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_STR_FIND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_FIND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } return TCL_OK } func XTclCompileStringLastCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy385 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, v17, v23, v35, v39, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v4, v40, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * We don't support any flags; the bytecode isn't that sophisticated. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } /* * Push the two operands onto the stack and then the test. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_STR_FIND_LAST)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_FIND_LAST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } return TCL_OK } func XTclCompileStringIndexCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy416 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, v17, v23, v35, v39, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v4, v40, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } /* * Push the two operands onto the stack and then the index operation. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_STR_INDEX)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_INDEX)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } return TCL_OK } func XTclCompileStringInsertCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy443 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, v103, v115, v129, v17, v23, v35, v47, v5, v53, v59, v71, v83 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v100, v101, v102, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v13, v130, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v48, v49, v50, v51, v52, v54, v55, v56, v57, v58, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 uintptr var _ /* idx at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(4) { return int32(TCL_ERROR) } /* Compute and push the string in which to insert */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } /* See what can be discovered about index at compile time */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if TCL_OK != XTclGetIndexFromToken(tls, tokenPtr, libc.Uint64FromInt64(libc.Int64FromInt32(0)), libc.Uint64FromInt64(int64(-libc.Int32FromInt32(2))), bp) { /* Nothing useful knowable - cease compile; let it direct eval */ return int32(TCL_ERROR) } /* Compute and push the string to be inserted */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if *(*int32)(unsafe.Pointer(bp)) == int32(libc.Int64FromInt32(0)) { /* Prepend the insertion string */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v47 = delta1 v48 = envPtr2 if v47 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v48)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v48)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v48 + 64)) += int64(v47) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } else { if *(*int32)(unsafe.Pointer(bp)) == int32(int64(-libc.Int32FromInt32(2))) { /* Append the insertion string */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v59 = delta1 v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) } } else { /* Prefix + insertion + suffix */ if *(*int32)(unsafe.Pointer(bp)) < int32(int64(-libc.Int32FromInt32(2))) { /* See comments in compiler for [linsert]. */ *(*int32)(unsafe.Pointer(bp))++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(int32(INST_OVER)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v71 = delta1 v72 = envPtr2 if v71 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v72 + 64)) += int64(v71) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = libc.Uint8FromInt32(int32(INST_STR_RANGE_IMM)) v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v83 = delta1 v84 = envPtr2 if v83 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v84 + 64)) += int64(v83) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)) - libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v100 = envPtr2 + 152 v99 = *(*uintptr)(unsafe.Pointer(v100)) *(*uintptr)(unsafe.Pointer(v100))++ *(*uint8)(unsafe.Pointer(v99)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v103 = delta1 v104 = envPtr2 if v103 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v104 + 64)) += int64(v103) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = libc.Uint8FromInt32(int32(INST_STR_RANGE_IMM)) v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(24)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(16)) v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(8)) v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v115 = delta1 v116 = envPtr2 if v115 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v116)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v116)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v116)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v116)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v116 + 64)) += int64(v115) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = uint8(libc.Uint32FromInt64(int64(-libc.Int32FromInt32(2))) >> libc.Int32FromInt32(24)) v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = uint8(libc.Uint32FromInt64(int64(-libc.Int32FromInt32(2))) >> libc.Int32FromInt32(16)) v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = uint8(libc.Uint32FromInt64(int64(-libc.Int32FromInt32(2))) >> libc.Int32FromInt32(8)) v124 = envPtr2 + 152 v123 = *(*uintptr)(unsafe.Pointer(v124)) *(*uintptr)(unsafe.Pointer(v124))++ *(*uint8)(unsafe.Pointer(v123)) = uint8(libc.Uint32FromInt64(int64(-libc.Int32FromInt32(2)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v126 = envPtr2 + 152 v125 = *(*uintptr)(unsafe.Pointer(v126)) *(*uintptr)(unsafe.Pointer(v126))++ *(*uint8)(unsafe.Pointer(v125)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v128 = envPtr2 + 152 v127 = *(*uintptr)(unsafe.Pointer(v128)) *(*uintptr)(unsafe.Pointer(v128))++ *(*uint8)(unsafe.Pointer(v127)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v129 = delta1 v130 = envPtr2 if v129 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v130)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v130)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v130)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v130)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v130 + 64)) += int64(v129) } } } return TCL_OK } func XTclCompileStringIsCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy10, _objIndexCopy11, _objIndexCopy12, _objIndexCopy13, _objIndexCopy14, _objIndexCopy15, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objIndexCopy7, _objIndexCopy8, _objIndexCopy9, allowEmpty, delta1, end, isEmpty, over, over1, over2, over21, range1, satisfied, testNumType, v103, v115, v119, v12, v123, v134, v140, v152, v156, v162, v166, v172, v184, v196, v200, v206, v212, v224, v228, v232, v238, v24, v250, v254, v258, v264, v270, v282, v286, v290, v296, v308, v312, v316, v322, v334, v338, v344, v348, v354, v360, v372, v378, v382, v386, v392, v398, v410, v416, v418, v424, v436, v440, v444, v448, v454, v458, v464, v476, v480, v486, v488, v500, v504, v508, v512, v518, v53, v532, v544, v548, v554, v566, v57, v570, v582, v587, v591, v595, v599, v603, v607, v619, v624, v628, v63, v632, v636, v640, v644, v648, v69, v73, v79, v91, v97 int32 var _objPtr, _objPtr1, _objPtr2, cachePtr, isClass, mapPtr, tokenPtr, v10, v100, v101, v102, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v116, v117, v118, v120, v121, v122, v124, v13, v130, v131, v132, v133, v135, v136, v137, v138, v139, v14, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v153, v154, v155, v157, v158, v159, v16, v160, v161, v163, v164, v165, v167, v168, v169, v17, v170, v171, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v197, v198, v199, v20, v201, v202, v203, v204, v205, v207, v208, v209, v21, v210, v211, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v225, v226, v227, v229, v23, v230, v231, v233, v234, v235, v236, v237, v239, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v251, v252, v253, v255, v256, v257, v259, v260, v261, v262, v263, v265, v266, v267, v268, v269, v271, v272, v273, v274, v275, v276, v277, v278, v279, v280, v281, v283, v284, v285, v287, v288, v289, v291, v292, v293, v294, v295, v297, v298, v299, v3, v300, v301, v302, v303, v304, v305, v306, v307, v309, v310, v311, v313, v314, v315, v317, v318, v319, v320, v321, v323, v324, v325, v326, v327, v328, v329, v330, v331, v332, v333, v335, v336, v337, v339, v340, v341, v342, v343, v345, v346, v347, v349, v350, v351, v352, v353, v355, v356, v357, v358, v359, v361, v362, v363, v364, v365, v366, v367, v368, v369, v370, v371, v373, v374, v375, v376, v377, v379, v380, v381, v383, v384, v385, v387, v388, v389, v390, v391, v393, v394, v395, v396, v397, v399, v400, v401, v402, v403, v404, v405, v406, v407, v408, v409, v411, v412, v413, v414, v415, v417, v419, v420, v421, v422, v423, v425, v426, v427, v428, v429, v430, v431, v432, v433, v434, v435, v437, v438, v439, v441, v442, v443, v445, v446, v447, v449, v450, v451, v452, v453, v455, v456, v457, v459, v460, v461, v462, v463, v465, v466, v467, v468, v469, v470, v471, v472, v473, v474, v475, v477, v478, v479, v481, v482, v483, v484, v485, v487, v489, v49, v490, v491, v492, v493, v494, v495, v496, v497, v498, v499, v5, v50, v501, v502, v503, v505, v506, v507, v509, v51, v510, v511, v513, v514, v515, v516, v517, v519, v52, v528, v529, v530, v531, v533, v534, v535, v536, v537, v538, v539, v54, v540, v541, v542, v543, v545, v546, v547, v549, v55, v550, v551, v552, v553, v555, v556, v557, v558, v559, v56, v560, v561, v562, v563, v564, v565, v567, v568, v569, v571, v572, v573, v574, v575, v576, v577, v578, v579, v58, v580, v581, v583, v585, v586, v588, v589, v59, v590, v592, v593, v594, v596, v597, v598, v60, v600, v601, v602, v604, v605, v606, v608, v609, v61, v610, v611, v612, v613, v614, v615, v616, v617, v618, v62, v620, v622, v623, v625, v626, v627, v629, v630, v631, v633, v634, v635, v637, v638, v639, v64, v641, v642, v643, v645, v646, v647, v649, v65, v66, v67, v68, v7, v70, v71, v72, v74, v75, v76, v77, v78, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v92, v93, v94, v95, v96, v98, v99 uintptr var eclIndex, v2, v4, v6 TTcl_Size var strClassType TInstStringClassType var v1 bool var v584, v621 int64 var _ /* t at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy10, _objIndexCopy11, _objIndexCopy12, _objIndexCopy13, _objIndexCopy14, _objIndexCopy15, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objIndexCopy7, _objIndexCopy8, _objIndexCopy9, _objPtr, _objPtr1, _objPtr2, allowEmpty, cachePtr, delta1, eclIndex, end, isClass, isEmpty, mapPtr, over, over1, over2, over21, range1, satisfied, strClassType, testNumType, tokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v280, v281, v282, v283, v284, v285, v286, v287, v288, v289, v290, v291, v292, v293, v294, v295, v296, v297, v298, v299, v3, v300, v301, v302, v303, v304, v305, v306, v307, v308, v309, v310, v311, v312, v313, v314, v315, v316, v317, v318, v319, v320, v321, v322, v323, v324, v325, v326, v327, v328, v329, v330, v331, v332, v333, v334, v335, v336, v337, v338, v339, v340, v341, v342, v343, v344, v345, v346, v347, v348, v349, v350, v351, v352, v353, v354, v355, v356, v357, v358, v359, v360, v361, v362, v363, v364, v365, v366, v367, v368, v369, v370, v371, v372, v373, v374, v375, v376, v377, v378, v379, v380, v381, v382, v383, v384, v385, v386, v387, v388, v389, v390, v391, v392, v393, v394, v395, v396, v397, v398, v399, v4, v400, v401, v402, v403, v404, v405, v406, v407, v408, v409, v410, v411, v412, v413, v414, v415, v416, v417, v418, v419, v420, v421, v422, v423, v424, v425, v426, v427, v428, v429, v430, v431, v432, v433, v434, v435, v436, v437, v438, v439, v440, v441, v442, v443, v444, v445, v446, v447, v448, v449, v450, v451, v452, v453, v454, v455, v456, v457, v458, v459, v460, v461, v462, v463, v464, v465, v466, v467, v468, v469, v470, v471, v472, v473, v474, v475, v476, v477, v478, v479, v480, v481, v482, v483, v484, v485, v486, v487, v488, v489, v49, v490, v491, v492, v493, v494, v495, v496, v497, v498, v499, v5, v50, v500, v501, v502, v503, v504, v505, v506, v507, v508, v509, v51, v510, v511, v512, v513, v514, v515, v516, v517, v518, v519, v52, v528, v529, v53, v530, v531, v532, v533, v534, v535, v536, v537, v538, v539, v54, v540, v541, v542, v543, v544, v545, v546, v547, v548, v549, v55, v550, v551, v552, v553, v554, v555, v556, v557, v558, v559, v56, v560, v561, v562, v563, v564, v565, v566, v567, v568, v569, v57, v570, v571, v572, v573, v574, v575, v576, v577, v578, v579, v58, v580, v581, v582, v583, v584, v585, v586, v587, v588, v589, v59, v590, v591, v592, v593, v594, v595, v596, v597, v598, v599, v6, v60, v600, v601, v602, v603, v604, v605, v606, v607, v608, v609, v61, v610, v611, v612, v613, v614, v615, v616, v617, v618, v619, v62, v620, v621, v622, v623, v624, v625, v626, v627, v628, v629, v63, v630, v631, v632, v633, v634, v635, v636, v637, v638, v639, v64, v640, v641, v642, v643, v644, v645, v646, v647, v648, v649, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 allowEmpty = 0 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < int64(3) || (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > int64(6) { return int32(TCL_ERROR) } if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { isClass = XTclThreadAllocObj(tls) } else { isClass = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(isClass + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(isClass)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(isClass)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(isClass)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(isClass)).FtypePtr = libc.UintptrFromInt32(0) if !(XTclWordKnownAtCompileTime(tls, tokenPtr, isClass) != 0) { _objPtr = isClass v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } return int32(TCL_ERROR) } else { if XTcl_GetIndexFromObjStruct(tls, interp, isClass, uintptr(unsafe.Pointer(&_isClasses1)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+19296, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart))) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(__ccgo_ts + 11034))) && libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, __ccgo_ts+11034, libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize)) == 0) { return int32(TCL_ERROR) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } /* * Compile the code. There are several main classes of check here. * 1. Character classes * 2. Booleans * 3. Integers * 4. Floats * 5. Lists */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v12 = delta1 v13 = envPtr2 if v12 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v13 + 64)) += int64(v12) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(1))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)-libc.Int32FromInt32(1))*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } switch *(*int32)(unsafe.Pointer(bp)) { case 0: goto _26 case 1: goto _27 case 2: goto _28 case 3: goto _29 case 6: goto _30 case 10: goto _31 case 13: goto _32 case 14: goto _33 case 15: goto _34 case 16: goto _35 case 18: goto _36 case 20: goto _37 case 21: goto _38 case 17: goto _39 case 9: goto _40 case 4: goto _41 case 7: goto _42 case 8: goto _43 case 19: goto _44 case 11: goto _45 case 5: goto _46 case 12: goto _47 } goto _48 _26: ; strClassType = int32(STR_CLASS_ALNUM) goto compileStrClass _27: ; strClassType = int32(STR_CLASS_ALPHA) goto compileStrClass _28: ; strClassType = int32(STR_CLASS_ASCII) goto compileStrClass _29: ; strClassType = int32(STR_CLASS_CONTROL) goto compileStrClass _30: ; strClassType = int32(STR_CLASS_DIGIT) goto compileStrClass _31: ; strClassType = int32(STR_CLASS_GRAPH) goto compileStrClass _32: ; strClassType = int32(STR_CLASS_LOWER) goto compileStrClass _33: ; strClassType = int32(STR_CLASS_PRINT) goto compileStrClass _34: ; strClassType = int32(STR_CLASS_PUNCT) goto compileStrClass _35: ; strClassType = int32(STR_CLASS_SPACE) goto compileStrClass _36: ; strClassType = int32(STR_CLASS_UPPER) goto compileStrClass _37: ; strClassType = int32(STR_CLASS_WORD) goto compileStrClass _38: ; strClassType = int32(STR_CLASS_XDIGIT) goto compileStrClass compileStrClass: ; if allowEmpty != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = libc.Uint8FromInt32(int32(INST_STR_CLASS)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(strClassType)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CLASS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - strClassType } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = libc.Uint8FromInt32(int32(INST_STR_CLASS)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(strClassType)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CLASS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - strClassType } v63 = delta1 v64 = envPtr2 if v63 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v64 + 64)) += int64(v63) } over = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v73 = delta1 v74 = envPtr2 if v73 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v74 + 64)) += int64(v73) } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v79 = delta1 v80 = envPtr2 if v79 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v80)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v80)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v80)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v80)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v80 + 64)) += int64(v79) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v91 = delta1 v92 = envPtr2 if v91 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v92 + 64)) += int64(v91) } } over2 = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v97 = delta1 v98 = envPtr2 if v97 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v98)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v98)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v98)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v98)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v98 + 64)) += int64(v97) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(over) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(over))) _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v100 = envPtr2 + 152 v99 = *(*uintptr)(unsafe.Pointer(v100)) *(*uintptr)(unsafe.Pointer(v100))++ *(*uint8)(unsafe.Pointer(v99)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v103 = delta1 v104 = envPtr2 if v103 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v104 + 64)) += int64(v103) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v115 = delta1 v116 = envPtr2 if v115 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v116)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v116)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v116)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v116)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v116 + 64)) += int64(v115) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = libc.Uint8FromInt32(int32(INST_STR_NEQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_NEQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v119 = delta1 v120 = envPtr2 if v119 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v120)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v120)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v120)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v120)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v120 + 64)) += int64(v119) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(over2) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(over2))) } return TCL_OK _41: ; _40: ; _39: ; if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = libc.Uint8FromInt32(int32(INST_TRY_CVT_TO_BOOLEAN)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TRY_CVT_TO_BOOLEAN)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v123 = delta1 v124 = envPtr2 if v123 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v124)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v124)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v124)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v124)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v124 + 64)) += int64(v123) } switch *(*int32)(unsafe.Pointer(bp)) { case 4: goto _125 case 17: goto _126 case 9: goto _127 default: goto _128 } goto _129 _125: ; if allowEmpty != 0 { over1 = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v134 = delta1 v135 = envPtr2 if v134 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v135 + 64)) += int64(v134) } _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v137 = envPtr2 + 152 v136 = *(*uintptr)(unsafe.Pointer(v137)) *(*uintptr)(unsafe.Pointer(v137))++ *(*uint8)(unsafe.Pointer(v136)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v140 = delta1 v141 = envPtr2 if v140 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v141)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v141)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v141)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v141)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v141 + 64)) += int64(v140) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v143 = envPtr2 + 152 v142 = *(*uintptr)(unsafe.Pointer(v143)) *(*uintptr)(unsafe.Pointer(v143))++ *(*uint8)(unsafe.Pointer(v142)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v145 = envPtr2 + 152 v144 = *(*uintptr)(unsafe.Pointer(v145)) *(*uintptr)(unsafe.Pointer(v145))++ *(*uint8)(unsafe.Pointer(v144)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v147 = envPtr2 + 152 v146 = *(*uintptr)(unsafe.Pointer(v147)) *(*uintptr)(unsafe.Pointer(v147))++ *(*uint8)(unsafe.Pointer(v146)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v149 = envPtr2 + 152 v148 = *(*uintptr)(unsafe.Pointer(v149)) *(*uintptr)(unsafe.Pointer(v149))++ *(*uint8)(unsafe.Pointer(v148)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v151 = envPtr2 + 152 v150 = *(*uintptr)(unsafe.Pointer(v151)) *(*uintptr)(unsafe.Pointer(v151))++ *(*uint8)(unsafe.Pointer(v150)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v152 = delta1 v153 = envPtr2 if v152 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v153)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v153)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v153)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v153)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v153 + 64)) += int64(v152) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v155 = envPtr2 + 152 v154 = *(*uintptr)(unsafe.Pointer(v155)) *(*uintptr)(unsafe.Pointer(v155))++ *(*uint8)(unsafe.Pointer(v154)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v156 = delta1 v157 = envPtr2 if v156 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v157)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v157)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v157)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v157)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v157 + 64)) += int64(v156) } over21 = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v159 = envPtr2 + 152 v158 = *(*uintptr)(unsafe.Pointer(v159)) *(*uintptr)(unsafe.Pointer(v159))++ *(*uint8)(unsafe.Pointer(v158)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v161 = envPtr2 + 152 v160 = *(*uintptr)(unsafe.Pointer(v161)) *(*uintptr)(unsafe.Pointer(v161))++ *(*uint8)(unsafe.Pointer(v160)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v162 = delta1 v163 = envPtr2 if v162 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v163)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v163)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v163)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v163)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v163 + 64)) += int64(v162) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(over1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(over1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v165 = envPtr2 + 152 v164 = *(*uintptr)(unsafe.Pointer(v165)) *(*uintptr)(unsafe.Pointer(v165))++ *(*uint8)(unsafe.Pointer(v164)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v166 = delta1 v167 = envPtr2 if v166 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v167)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v167)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v167)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v167)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v167 + 64)) += int64(v166) } _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v169 = envPtr2 + 152 v168 = *(*uintptr)(unsafe.Pointer(v169)) *(*uintptr)(unsafe.Pointer(v169))++ *(*uint8)(unsafe.Pointer(v168)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v171 = envPtr2 + 152 v170 = *(*uintptr)(unsafe.Pointer(v171)) *(*uintptr)(unsafe.Pointer(v171))++ *(*uint8)(unsafe.Pointer(v170)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v172 = delta1 v173 = envPtr2 if v172 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v173)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v173)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v173)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v173)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v173 + 64)) += int64(v172) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v175 = envPtr2 + 152 v174 = *(*uintptr)(unsafe.Pointer(v175)) *(*uintptr)(unsafe.Pointer(v175))++ *(*uint8)(unsafe.Pointer(v174)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v177 = envPtr2 + 152 v176 = *(*uintptr)(unsafe.Pointer(v177)) *(*uintptr)(unsafe.Pointer(v177))++ *(*uint8)(unsafe.Pointer(v176)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v179 = envPtr2 + 152 v178 = *(*uintptr)(unsafe.Pointer(v179)) *(*uintptr)(unsafe.Pointer(v179))++ *(*uint8)(unsafe.Pointer(v178)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v181 = envPtr2 + 152 v180 = *(*uintptr)(unsafe.Pointer(v181)) *(*uintptr)(unsafe.Pointer(v181))++ *(*uint8)(unsafe.Pointer(v180)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v183 = envPtr2 + 152 v182 = *(*uintptr)(unsafe.Pointer(v183)) *(*uintptr)(unsafe.Pointer(v183))++ *(*uint8)(unsafe.Pointer(v182)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v184 = delta1 v185 = envPtr2 if v184 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v185)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v185)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v185)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v185)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v185 + 64)) += int64(v184) } } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(over21) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(over21))) } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v187 = envPtr2 + 152 v186 = *(*uintptr)(unsafe.Pointer(v187)) *(*uintptr)(unsafe.Pointer(v187))++ *(*uint8)(unsafe.Pointer(v186)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v189 = envPtr2 + 152 v188 = *(*uintptr)(unsafe.Pointer(v189)) *(*uintptr)(unsafe.Pointer(v189))++ *(*uint8)(unsafe.Pointer(v188)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v191 = envPtr2 + 152 v190 = *(*uintptr)(unsafe.Pointer(v191)) *(*uintptr)(unsafe.Pointer(v191))++ *(*uint8)(unsafe.Pointer(v190)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v193 = envPtr2 + 152 v192 = *(*uintptr)(unsafe.Pointer(v193)) *(*uintptr)(unsafe.Pointer(v193))++ *(*uint8)(unsafe.Pointer(v192)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v195 = envPtr2 + 152 v194 = *(*uintptr)(unsafe.Pointer(v195)) *(*uintptr)(unsafe.Pointer(v195))++ *(*uint8)(unsafe.Pointer(v194)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v196 = delta1 v197 = envPtr2 if v196 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v197)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v197)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v197)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v197)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v197 + 64)) += int64(v196) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v199 = envPtr2 + 152 v198 = *(*uintptr)(unsafe.Pointer(v199)) *(*uintptr)(unsafe.Pointer(v199))++ *(*uint8)(unsafe.Pointer(v198)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v200 = delta1 v201 = envPtr2 if v200 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v201)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v201)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v201)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v201)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v201 + 64)) += int64(v200) } } return TCL_OK _126: ; over1 = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v203 = envPtr2 + 152 v202 = *(*uintptr)(unsafe.Pointer(v203)) *(*uintptr)(unsafe.Pointer(v203))++ *(*uint8)(unsafe.Pointer(v202)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v205 = envPtr2 + 152 v204 = *(*uintptr)(unsafe.Pointer(v205)) *(*uintptr)(unsafe.Pointer(v205))++ *(*uint8)(unsafe.Pointer(v204)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v206 = delta1 v207 = envPtr2 if v206 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v207)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v207)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v207)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v207)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v207 + 64)) += int64(v206) } if allowEmpty != 0 { _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v209 = envPtr2 + 152 v208 = *(*uintptr)(unsafe.Pointer(v209)) *(*uintptr)(unsafe.Pointer(v209))++ *(*uint8)(unsafe.Pointer(v208)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v211 = envPtr2 + 152 v210 = *(*uintptr)(unsafe.Pointer(v211)) *(*uintptr)(unsafe.Pointer(v211))++ *(*uint8)(unsafe.Pointer(v210)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v212 = delta1 v213 = envPtr2 if v212 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v213)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v213)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v213)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v213)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v213 + 64)) += int64(v212) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v215 = envPtr2 + 152 v214 = *(*uintptr)(unsafe.Pointer(v215)) *(*uintptr)(unsafe.Pointer(v215))++ *(*uint8)(unsafe.Pointer(v214)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v217 = envPtr2 + 152 v216 = *(*uintptr)(unsafe.Pointer(v217)) *(*uintptr)(unsafe.Pointer(v217))++ *(*uint8)(unsafe.Pointer(v216)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v219 = envPtr2 + 152 v218 = *(*uintptr)(unsafe.Pointer(v219)) *(*uintptr)(unsafe.Pointer(v219))++ *(*uint8)(unsafe.Pointer(v218)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v221 = envPtr2 + 152 v220 = *(*uintptr)(unsafe.Pointer(v221)) *(*uintptr)(unsafe.Pointer(v221))++ *(*uint8)(unsafe.Pointer(v220)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v223 = envPtr2 + 152 v222 = *(*uintptr)(unsafe.Pointer(v223)) *(*uintptr)(unsafe.Pointer(v223))++ *(*uint8)(unsafe.Pointer(v222)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v224 = delta1 v225 = envPtr2 if v224 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v225)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v225)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v225)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v225)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v225 + 64)) += int64(v224) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v227 = envPtr2 + 152 v226 = *(*uintptr)(unsafe.Pointer(v227)) *(*uintptr)(unsafe.Pointer(v227))++ *(*uint8)(unsafe.Pointer(v226)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v228 = delta1 v229 = envPtr2 if v228 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v229)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v229)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v229)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v229)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v229 + 64)) += int64(v228) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v231 = envPtr2 + 152 v230 = *(*uintptr)(unsafe.Pointer(v231)) *(*uintptr)(unsafe.Pointer(v231))++ *(*uint8)(unsafe.Pointer(v230)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v232 = delta1 v233 = envPtr2 if v232 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v233)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v233)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v233)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v233)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v233 + 64)) += int64(v232) } _objIndexCopy6 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy6 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v235 = envPtr2 + 152 v234 = *(*uintptr)(unsafe.Pointer(v235)) *(*uintptr)(unsafe.Pointer(v235))++ *(*uint8)(unsafe.Pointer(v234)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v237 = envPtr2 + 152 v236 = *(*uintptr)(unsafe.Pointer(v237)) *(*uintptr)(unsafe.Pointer(v237))++ *(*uint8)(unsafe.Pointer(v236)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v238 = delta1 v239 = envPtr2 if v238 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v239)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v239)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v239)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v239)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v239 + 64)) += int64(v238) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v241 = envPtr2 + 152 v240 = *(*uintptr)(unsafe.Pointer(v241)) *(*uintptr)(unsafe.Pointer(v241))++ *(*uint8)(unsafe.Pointer(v240)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v243 = envPtr2 + 152 v242 = *(*uintptr)(unsafe.Pointer(v243)) *(*uintptr)(unsafe.Pointer(v243))++ *(*uint8)(unsafe.Pointer(v242)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(24)) v245 = envPtr2 + 152 v244 = *(*uintptr)(unsafe.Pointer(v245)) *(*uintptr)(unsafe.Pointer(v245))++ *(*uint8)(unsafe.Pointer(v244)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(16)) v247 = envPtr2 + 152 v246 = *(*uintptr)(unsafe.Pointer(v247)) *(*uintptr)(unsafe.Pointer(v247))++ *(*uint8)(unsafe.Pointer(v246)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(8)) v249 = envPtr2 + 152 v248 = *(*uintptr)(unsafe.Pointer(v249)) *(*uintptr)(unsafe.Pointer(v249))++ *(*uint8)(unsafe.Pointer(v248)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v250 = delta1 v251 = envPtr2 if v250 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v251)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v251)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v251)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v251)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v251 + 64)) += int64(v250) } } } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(over1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(over1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v253 = envPtr2 + 152 v252 = *(*uintptr)(unsafe.Pointer(v253)) *(*uintptr)(unsafe.Pointer(v253))++ *(*uint8)(unsafe.Pointer(v252)) = libc.Uint8FromInt32(int32(INST_LNOT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LNOT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v254 = delta1 v255 = envPtr2 if v254 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v255)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v255)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v255)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v255)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v255 + 64)) += int64(v254) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v257 = envPtr2 + 152 v256 = *(*uintptr)(unsafe.Pointer(v257)) *(*uintptr)(unsafe.Pointer(v257))++ *(*uint8)(unsafe.Pointer(v256)) = libc.Uint8FromInt32(int32(INST_LNOT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LNOT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v258 = delta1 v259 = envPtr2 if v258 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v259)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v259)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v259)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v259)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v259 + 64)) += int64(v258) } return TCL_OK _127: ; over1 = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v261 = envPtr2 + 152 v260 = *(*uintptr)(unsafe.Pointer(v261)) *(*uintptr)(unsafe.Pointer(v261))++ *(*uint8)(unsafe.Pointer(v260)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v263 = envPtr2 + 152 v262 = *(*uintptr)(unsafe.Pointer(v263)) *(*uintptr)(unsafe.Pointer(v263))++ *(*uint8)(unsafe.Pointer(v262)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v264 = delta1 v265 = envPtr2 if v264 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v265)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v265)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v265)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v265)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v265 + 64)) += int64(v264) } if allowEmpty != 0 { _objIndexCopy7 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy7 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v267 = envPtr2 + 152 v266 = *(*uintptr)(unsafe.Pointer(v267)) *(*uintptr)(unsafe.Pointer(v267))++ *(*uint8)(unsafe.Pointer(v266)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v269 = envPtr2 + 152 v268 = *(*uintptr)(unsafe.Pointer(v269)) *(*uintptr)(unsafe.Pointer(v269))++ *(*uint8)(unsafe.Pointer(v268)) = uint8(libc.Uint32FromInt32(_objIndexCopy7)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy7 } v270 = delta1 v271 = envPtr2 if v270 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v271)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v271)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v271)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v271)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v271 + 64)) += int64(v270) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v273 = envPtr2 + 152 v272 = *(*uintptr)(unsafe.Pointer(v273)) *(*uintptr)(unsafe.Pointer(v273))++ *(*uint8)(unsafe.Pointer(v272)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v275 = envPtr2 + 152 v274 = *(*uintptr)(unsafe.Pointer(v275)) *(*uintptr)(unsafe.Pointer(v275))++ *(*uint8)(unsafe.Pointer(v274)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(24)) v277 = envPtr2 + 152 v276 = *(*uintptr)(unsafe.Pointer(v277)) *(*uintptr)(unsafe.Pointer(v277))++ *(*uint8)(unsafe.Pointer(v276)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(16)) v279 = envPtr2 + 152 v278 = *(*uintptr)(unsafe.Pointer(v279)) *(*uintptr)(unsafe.Pointer(v279))++ *(*uint8)(unsafe.Pointer(v278)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(8)) v281 = envPtr2 + 152 v280 = *(*uintptr)(unsafe.Pointer(v281)) *(*uintptr)(unsafe.Pointer(v281))++ *(*uint8)(unsafe.Pointer(v280)) = uint8(libc.Uint32FromInt32(_objIndexCopy7)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy7 } v282 = delta1 v283 = envPtr2 if v282 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v283)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v283)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v283)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v283)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v283 + 64)) += int64(v282) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v285 = envPtr2 + 152 v284 = *(*uintptr)(unsafe.Pointer(v285)) *(*uintptr)(unsafe.Pointer(v285))++ *(*uint8)(unsafe.Pointer(v284)) = libc.Uint8FromInt32(int32(INST_STR_NEQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_NEQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v286 = delta1 v287 = envPtr2 if v286 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v287)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v287)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v287)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v287)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v287 + 64)) += int64(v286) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v289 = envPtr2 + 152 v288 = *(*uintptr)(unsafe.Pointer(v289)) *(*uintptr)(unsafe.Pointer(v289))++ *(*uint8)(unsafe.Pointer(v288)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v290 = delta1 v291 = envPtr2 if v290 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v291)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v291)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v291)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v291)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v291 + 64)) += int64(v290) } _objIndexCopy8 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy8 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v293 = envPtr2 + 152 v292 = *(*uintptr)(unsafe.Pointer(v293)) *(*uintptr)(unsafe.Pointer(v293))++ *(*uint8)(unsafe.Pointer(v292)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v295 = envPtr2 + 152 v294 = *(*uintptr)(unsafe.Pointer(v295)) *(*uintptr)(unsafe.Pointer(v295))++ *(*uint8)(unsafe.Pointer(v294)) = uint8(libc.Uint32FromInt32(_objIndexCopy8)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy8 } v296 = delta1 v297 = envPtr2 if v296 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v297)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v297)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v297)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v297)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v297 + 64)) += int64(v296) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v299 = envPtr2 + 152 v298 = *(*uintptr)(unsafe.Pointer(v299)) *(*uintptr)(unsafe.Pointer(v299))++ *(*uint8)(unsafe.Pointer(v298)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v301 = envPtr2 + 152 v300 = *(*uintptr)(unsafe.Pointer(v301)) *(*uintptr)(unsafe.Pointer(v301))++ *(*uint8)(unsafe.Pointer(v300)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(24)) v303 = envPtr2 + 152 v302 = *(*uintptr)(unsafe.Pointer(v303)) *(*uintptr)(unsafe.Pointer(v303))++ *(*uint8)(unsafe.Pointer(v302)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(16)) v305 = envPtr2 + 152 v304 = *(*uintptr)(unsafe.Pointer(v305)) *(*uintptr)(unsafe.Pointer(v305))++ *(*uint8)(unsafe.Pointer(v304)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(8)) v307 = envPtr2 + 152 v306 = *(*uintptr)(unsafe.Pointer(v307)) *(*uintptr)(unsafe.Pointer(v307))++ *(*uint8)(unsafe.Pointer(v306)) = uint8(libc.Uint32FromInt32(_objIndexCopy8)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy8 } v308 = delta1 v309 = envPtr2 if v308 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v309)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v309)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v309)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v309)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v309 + 64)) += int64(v308) } } } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(over1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(over1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v311 = envPtr2 + 152 v310 = *(*uintptr)(unsafe.Pointer(v311)) *(*uintptr)(unsafe.Pointer(v311))++ *(*uint8)(unsafe.Pointer(v310)) = libc.Uint8FromInt32(int32(INST_LNOT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LNOT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v312 = delta1 v313 = envPtr2 if v312 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v313)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v313)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v313)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v313)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v313 + 64)) += int64(v312) } return TCL_OK _128: ; goto _129 _129: ; goto _48 _42: ; if allowEmpty != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v315 = envPtr2 + 152 v314 = *(*uintptr)(unsafe.Pointer(v315)) *(*uintptr)(unsafe.Pointer(v315))++ *(*uint8)(unsafe.Pointer(v314)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v316 = delta1 v317 = envPtr2 if v316 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v317)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v317)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v317)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v317)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v317 + 64)) += int64(v316) } _objIndexCopy9 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy9 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v319 = envPtr2 + 152 v318 = *(*uintptr)(unsafe.Pointer(v319)) *(*uintptr)(unsafe.Pointer(v319))++ *(*uint8)(unsafe.Pointer(v318)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v321 = envPtr2 + 152 v320 = *(*uintptr)(unsafe.Pointer(v321)) *(*uintptr)(unsafe.Pointer(v321))++ *(*uint8)(unsafe.Pointer(v320)) = uint8(libc.Uint32FromInt32(_objIndexCopy9)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy9 } v322 = delta1 v323 = envPtr2 if v322 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v323)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v323)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v323)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v323)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v323 + 64)) += int64(v322) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v325 = envPtr2 + 152 v324 = *(*uintptr)(unsafe.Pointer(v325)) *(*uintptr)(unsafe.Pointer(v325))++ *(*uint8)(unsafe.Pointer(v324)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v327 = envPtr2 + 152 v326 = *(*uintptr)(unsafe.Pointer(v327)) *(*uintptr)(unsafe.Pointer(v327))++ *(*uint8)(unsafe.Pointer(v326)) = uint8(libc.Uint32FromInt32(_objIndexCopy9) >> libc.Int32FromInt32(24)) v329 = envPtr2 + 152 v328 = *(*uintptr)(unsafe.Pointer(v329)) *(*uintptr)(unsafe.Pointer(v329))++ *(*uint8)(unsafe.Pointer(v328)) = uint8(libc.Uint32FromInt32(_objIndexCopy9) >> libc.Int32FromInt32(16)) v331 = envPtr2 + 152 v330 = *(*uintptr)(unsafe.Pointer(v331)) *(*uintptr)(unsafe.Pointer(v331))++ *(*uint8)(unsafe.Pointer(v330)) = uint8(libc.Uint32FromInt32(_objIndexCopy9) >> libc.Int32FromInt32(8)) v333 = envPtr2 + 152 v332 = *(*uintptr)(unsafe.Pointer(v333)) *(*uintptr)(unsafe.Pointer(v333))++ *(*uint8)(unsafe.Pointer(v332)) = uint8(libc.Uint32FromInt32(_objIndexCopy9)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy9 } v334 = delta1 v335 = envPtr2 if v334 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v335)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v335)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v335)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v335)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v335 + 64)) += int64(v334) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v337 = envPtr2 + 152 v336 = *(*uintptr)(unsafe.Pointer(v337)) *(*uintptr)(unsafe.Pointer(v337))++ *(*uint8)(unsafe.Pointer(v336)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v338 = delta1 v339 = envPtr2 if v338 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v339)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v339)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v339)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v339)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v339 + 64)) += int64(v338) } isEmpty = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v341 = envPtr2 + 152 v340 = *(*uintptr)(unsafe.Pointer(v341)) *(*uintptr)(unsafe.Pointer(v341))++ *(*uint8)(unsafe.Pointer(v340)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v343 = envPtr2 + 152 v342 = *(*uintptr)(unsafe.Pointer(v343)) *(*uintptr)(unsafe.Pointer(v343))++ *(*uint8)(unsafe.Pointer(v342)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v344 = delta1 v345 = envPtr2 if v344 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v345)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v345)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v345)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v345)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v345 + 64)) += int64(v344) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v347 = envPtr2 + 152 v346 = *(*uintptr)(unsafe.Pointer(v347)) *(*uintptr)(unsafe.Pointer(v347))++ *(*uint8)(unsafe.Pointer(v346)) = libc.Uint8FromInt32(int32(INST_NUM_TYPE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NUM_TYPE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v348 = delta1 v349 = envPtr2 if v348 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v349)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v349)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v349)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v349)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v349 + 64)) += int64(v348) } satisfied = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v351 = envPtr2 + 152 v350 = *(*uintptr)(unsafe.Pointer(v351)) *(*uintptr)(unsafe.Pointer(v351))++ *(*uint8)(unsafe.Pointer(v350)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v353 = envPtr2 + 152 v352 = *(*uintptr)(unsafe.Pointer(v353)) *(*uintptr)(unsafe.Pointer(v353))++ *(*uint8)(unsafe.Pointer(v352)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v354 = delta1 v355 = envPtr2 if v354 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v355)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v355)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v355)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v355)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v355 + 64)) += int64(v354) } _objIndexCopy10 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy10 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v357 = envPtr2 + 152 v356 = *(*uintptr)(unsafe.Pointer(v357)) *(*uintptr)(unsafe.Pointer(v357))++ *(*uint8)(unsafe.Pointer(v356)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v359 = envPtr2 + 152 v358 = *(*uintptr)(unsafe.Pointer(v359)) *(*uintptr)(unsafe.Pointer(v359))++ *(*uint8)(unsafe.Pointer(v358)) = uint8(libc.Uint32FromInt32(_objIndexCopy10)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy10 } v360 = delta1 v361 = envPtr2 if v360 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v361)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v361)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v361)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v361)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v361 + 64)) += int64(v360) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v363 = envPtr2 + 152 v362 = *(*uintptr)(unsafe.Pointer(v363)) *(*uintptr)(unsafe.Pointer(v363))++ *(*uint8)(unsafe.Pointer(v362)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v365 = envPtr2 + 152 v364 = *(*uintptr)(unsafe.Pointer(v365)) *(*uintptr)(unsafe.Pointer(v365))++ *(*uint8)(unsafe.Pointer(v364)) = uint8(libc.Uint32FromInt32(_objIndexCopy10) >> libc.Int32FromInt32(24)) v367 = envPtr2 + 152 v366 = *(*uintptr)(unsafe.Pointer(v367)) *(*uintptr)(unsafe.Pointer(v367))++ *(*uint8)(unsafe.Pointer(v366)) = uint8(libc.Uint32FromInt32(_objIndexCopy10) >> libc.Int32FromInt32(16)) v369 = envPtr2 + 152 v368 = *(*uintptr)(unsafe.Pointer(v369)) *(*uintptr)(unsafe.Pointer(v369))++ *(*uint8)(unsafe.Pointer(v368)) = uint8(libc.Uint32FromInt32(_objIndexCopy10) >> libc.Int32FromInt32(8)) v371 = envPtr2 + 152 v370 = *(*uintptr)(unsafe.Pointer(v371)) *(*uintptr)(unsafe.Pointer(v371))++ *(*uint8)(unsafe.Pointer(v370)) = uint8(libc.Uint32FromInt32(_objIndexCopy10)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy10 } v372 = delta1 v373 = envPtr2 if v372 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v373)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v373)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v373)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v373)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v373 + 64)) += int64(v372) } } end = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v375 = envPtr2 + 152 v374 = *(*uintptr)(unsafe.Pointer(v375)) *(*uintptr)(unsafe.Pointer(v375))++ *(*uint8)(unsafe.Pointer(v374)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v377 = envPtr2 + 152 v376 = *(*uintptr)(unsafe.Pointer(v377)) *(*uintptr)(unsafe.Pointer(v377))++ *(*uint8)(unsafe.Pointer(v376)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v378 = delta1 v379 = envPtr2 if v378 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v379)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v379)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v379)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v379)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v379 + 64)) += int64(v378) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(isEmpty) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(isEmpty))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v381 = envPtr2 + 152 v380 = *(*uintptr)(unsafe.Pointer(v381)) *(*uintptr)(unsafe.Pointer(v381))++ *(*uint8)(unsafe.Pointer(v380)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v382 = delta1 v383 = envPtr2 if v382 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v383)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v383)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v383)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v383)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v383 + 64)) += int64(v382) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(satisfied) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(satisfied))) } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v385 = envPtr2 + 152 v384 = *(*uintptr)(unsafe.Pointer(v385)) *(*uintptr)(unsafe.Pointer(v385))++ *(*uint8)(unsafe.Pointer(v384)) = libc.Uint8FromInt32(int32(INST_NUM_TYPE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NUM_TYPE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v386 = delta1 v387 = envPtr2 if v386 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v387)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v387)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v387)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v387)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v387 + 64)) += int64(v386) } satisfied = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v389 = envPtr2 + 152 v388 = *(*uintptr)(unsafe.Pointer(v389)) *(*uintptr)(unsafe.Pointer(v389))++ *(*uint8)(unsafe.Pointer(v388)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v391 = envPtr2 + 152 v390 = *(*uintptr)(unsafe.Pointer(v391)) *(*uintptr)(unsafe.Pointer(v391))++ *(*uint8)(unsafe.Pointer(v390)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v392 = delta1 v393 = envPtr2 if v392 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v393)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v393)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v393)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v393)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v393 + 64)) += int64(v392) } _objIndexCopy11 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy11 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v395 = envPtr2 + 152 v394 = *(*uintptr)(unsafe.Pointer(v395)) *(*uintptr)(unsafe.Pointer(v395))++ *(*uint8)(unsafe.Pointer(v394)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v397 = envPtr2 + 152 v396 = *(*uintptr)(unsafe.Pointer(v397)) *(*uintptr)(unsafe.Pointer(v397))++ *(*uint8)(unsafe.Pointer(v396)) = uint8(libc.Uint32FromInt32(_objIndexCopy11)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy11 } v398 = delta1 v399 = envPtr2 if v398 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v399)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v399)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v399)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v399)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v399 + 64)) += int64(v398) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v401 = envPtr2 + 152 v400 = *(*uintptr)(unsafe.Pointer(v401)) *(*uintptr)(unsafe.Pointer(v401))++ *(*uint8)(unsafe.Pointer(v400)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v403 = envPtr2 + 152 v402 = *(*uintptr)(unsafe.Pointer(v403)) *(*uintptr)(unsafe.Pointer(v403))++ *(*uint8)(unsafe.Pointer(v402)) = uint8(libc.Uint32FromInt32(_objIndexCopy11) >> libc.Int32FromInt32(24)) v405 = envPtr2 + 152 v404 = *(*uintptr)(unsafe.Pointer(v405)) *(*uintptr)(unsafe.Pointer(v405))++ *(*uint8)(unsafe.Pointer(v404)) = uint8(libc.Uint32FromInt32(_objIndexCopy11) >> libc.Int32FromInt32(16)) v407 = envPtr2 + 152 v406 = *(*uintptr)(unsafe.Pointer(v407)) *(*uintptr)(unsafe.Pointer(v407))++ *(*uint8)(unsafe.Pointer(v406)) = uint8(libc.Uint32FromInt32(_objIndexCopy11) >> libc.Int32FromInt32(8)) v409 = envPtr2 + 152 v408 = *(*uintptr)(unsafe.Pointer(v409)) *(*uintptr)(unsafe.Pointer(v409))++ *(*uint8)(unsafe.Pointer(v408)) = uint8(libc.Uint32FromInt32(_objIndexCopy11)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy11 } v410 = delta1 v411 = envPtr2 if v410 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v411)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v411)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v411)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v411)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v411 + 64)) += int64(v410) } } end = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v413 = envPtr2 + 152 v412 = *(*uintptr)(unsafe.Pointer(v413)) *(*uintptr)(unsafe.Pointer(v413))++ *(*uint8)(unsafe.Pointer(v412)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v415 = envPtr2 + 152 v414 = *(*uintptr)(unsafe.Pointer(v415)) *(*uintptr)(unsafe.Pointer(v415))++ *(*uint8)(unsafe.Pointer(v414)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v416 = delta1 v417 = envPtr2 if v416 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v417)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v417)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v417)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v417)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v417 + 64)) += int64(v416) } v418 = -int32(1) v419 = envPtr2 if v418 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v419)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v419)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v419)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v419)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v419 + 64)) += int64(v418) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(satisfied) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(satisfied))) } _objIndexCopy12 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy12 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v421 = envPtr2 + 152 v420 = *(*uintptr)(unsafe.Pointer(v421)) *(*uintptr)(unsafe.Pointer(v421))++ *(*uint8)(unsafe.Pointer(v420)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v423 = envPtr2 + 152 v422 = *(*uintptr)(unsafe.Pointer(v423)) *(*uintptr)(unsafe.Pointer(v423))++ *(*uint8)(unsafe.Pointer(v422)) = uint8(libc.Uint32FromInt32(_objIndexCopy12)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy12 } v424 = delta1 v425 = envPtr2 if v424 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v425)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v425)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v425)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v425)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v425 + 64)) += int64(v424) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v427 = envPtr2 + 152 v426 = *(*uintptr)(unsafe.Pointer(v427)) *(*uintptr)(unsafe.Pointer(v427))++ *(*uint8)(unsafe.Pointer(v426)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v429 = envPtr2 + 152 v428 = *(*uintptr)(unsafe.Pointer(v429)) *(*uintptr)(unsafe.Pointer(v429))++ *(*uint8)(unsafe.Pointer(v428)) = uint8(libc.Uint32FromInt32(_objIndexCopy12) >> libc.Int32FromInt32(24)) v431 = envPtr2 + 152 v430 = *(*uintptr)(unsafe.Pointer(v431)) *(*uintptr)(unsafe.Pointer(v431))++ *(*uint8)(unsafe.Pointer(v430)) = uint8(libc.Uint32FromInt32(_objIndexCopy12) >> libc.Int32FromInt32(16)) v433 = envPtr2 + 152 v432 = *(*uintptr)(unsafe.Pointer(v433)) *(*uintptr)(unsafe.Pointer(v433))++ *(*uint8)(unsafe.Pointer(v432)) = uint8(libc.Uint32FromInt32(_objIndexCopy12) >> libc.Int32FromInt32(8)) v435 = envPtr2 + 152 v434 = *(*uintptr)(unsafe.Pointer(v435)) *(*uintptr)(unsafe.Pointer(v435))++ *(*uint8)(unsafe.Pointer(v434)) = uint8(libc.Uint32FromInt32(_objIndexCopy12)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy12 } v436 = delta1 v437 = envPtr2 if v436 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v437)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v437)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v437)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v437)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v437 + 64)) += int64(v436) } } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(end) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(end))) return TCL_OK _45: ; _44: ; _43: ; if allowEmpty != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v439 = envPtr2 + 152 v438 = *(*uintptr)(unsafe.Pointer(v439)) *(*uintptr)(unsafe.Pointer(v439))++ *(*uint8)(unsafe.Pointer(v438)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v440 = delta1 v441 = envPtr2 if v440 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v441)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v441)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v441)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v441)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v441 + 64)) += int64(v440) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v443 = envPtr2 + 152 v442 = *(*uintptr)(unsafe.Pointer(v443)) *(*uintptr)(unsafe.Pointer(v443))++ *(*uint8)(unsafe.Pointer(v442)) = libc.Uint8FromInt32(int32(INST_NUM_TYPE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NUM_TYPE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v444 = delta1 v445 = envPtr2 if v444 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v445)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v445)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v445)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v445)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v445 + 64)) += int64(v444) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v447 = envPtr2 + 152 v446 = *(*uintptr)(unsafe.Pointer(v447)) *(*uintptr)(unsafe.Pointer(v447))++ *(*uint8)(unsafe.Pointer(v446)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v448 = delta1 v449 = envPtr2 if v448 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v449)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v449)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v449)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v449)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v449 + 64)) += int64(v448) } testNumType = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v451 = envPtr2 + 152 v450 = *(*uintptr)(unsafe.Pointer(v451)) *(*uintptr)(unsafe.Pointer(v451))++ *(*uint8)(unsafe.Pointer(v450)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v453 = envPtr2 + 152 v452 = *(*uintptr)(unsafe.Pointer(v453)) *(*uintptr)(unsafe.Pointer(v453))++ *(*uint8)(unsafe.Pointer(v452)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v454 = delta1 v455 = envPtr2 if v454 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v455)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v455)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v455)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v455)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v455 + 64)) += int64(v454) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v457 = envPtr2 + 152 v456 = *(*uintptr)(unsafe.Pointer(v457)) *(*uintptr)(unsafe.Pointer(v457))++ *(*uint8)(unsafe.Pointer(v456)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v458 = delta1 v459 = envPtr2 if v458 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v459)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v459)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v459)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v459)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v459 + 64)) += int64(v458) } _objIndexCopy13 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy13 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v461 = envPtr2 + 152 v460 = *(*uintptr)(unsafe.Pointer(v461)) *(*uintptr)(unsafe.Pointer(v461))++ *(*uint8)(unsafe.Pointer(v460)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v463 = envPtr2 + 152 v462 = *(*uintptr)(unsafe.Pointer(v463)) *(*uintptr)(unsafe.Pointer(v463))++ *(*uint8)(unsafe.Pointer(v462)) = uint8(libc.Uint32FromInt32(_objIndexCopy13)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy13 } v464 = delta1 v465 = envPtr2 if v464 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v465)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v465)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v465)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v465)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v465 + 64)) += int64(v464) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v467 = envPtr2 + 152 v466 = *(*uintptr)(unsafe.Pointer(v467)) *(*uintptr)(unsafe.Pointer(v467))++ *(*uint8)(unsafe.Pointer(v466)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v469 = envPtr2 + 152 v468 = *(*uintptr)(unsafe.Pointer(v469)) *(*uintptr)(unsafe.Pointer(v469))++ *(*uint8)(unsafe.Pointer(v468)) = uint8(libc.Uint32FromInt32(_objIndexCopy13) >> libc.Int32FromInt32(24)) v471 = envPtr2 + 152 v470 = *(*uintptr)(unsafe.Pointer(v471)) *(*uintptr)(unsafe.Pointer(v471))++ *(*uint8)(unsafe.Pointer(v470)) = uint8(libc.Uint32FromInt32(_objIndexCopy13) >> libc.Int32FromInt32(16)) v473 = envPtr2 + 152 v472 = *(*uintptr)(unsafe.Pointer(v473)) *(*uintptr)(unsafe.Pointer(v473))++ *(*uint8)(unsafe.Pointer(v472)) = uint8(libc.Uint32FromInt32(_objIndexCopy13) >> libc.Int32FromInt32(8)) v475 = envPtr2 + 152 v474 = *(*uintptr)(unsafe.Pointer(v475)) *(*uintptr)(unsafe.Pointer(v475))++ *(*uint8)(unsafe.Pointer(v474)) = uint8(libc.Uint32FromInt32(_objIndexCopy13)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy13 } v476 = delta1 v477 = envPtr2 if v476 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v477)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v477)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v477)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v477)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v477 + 64)) += int64(v476) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v479 = envPtr2 + 152 v478 = *(*uintptr)(unsafe.Pointer(v479)) *(*uintptr)(unsafe.Pointer(v479))++ *(*uint8)(unsafe.Pointer(v478)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v480 = delta1 v481 = envPtr2 if v480 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v481)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v481)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v481)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v481)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v481 + 64)) += int64(v480) } end = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v483 = envPtr2 + 152 v482 = *(*uintptr)(unsafe.Pointer(v483)) *(*uintptr)(unsafe.Pointer(v483))++ *(*uint8)(unsafe.Pointer(v482)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v485 = envPtr2 + 152 v484 = *(*uintptr)(unsafe.Pointer(v485)) *(*uintptr)(unsafe.Pointer(v485))++ *(*uint8)(unsafe.Pointer(v484)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v486 = delta1 v487 = envPtr2 if v486 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v487)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v487)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v487)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v487)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v487 + 64)) += int64(v486) } v488 = int32(1) v489 = envPtr2 if v488 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v489)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v489)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v489)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v489)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v489 + 64)) += int64(v488) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(testNumType) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(testNumType))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v491 = envPtr2 + 152 v490 = *(*uintptr)(unsafe.Pointer(v491)) *(*uintptr)(unsafe.Pointer(v491))++ *(*uint8)(unsafe.Pointer(v490)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v493 = envPtr2 + 152 v492 = *(*uintptr)(unsafe.Pointer(v493)) *(*uintptr)(unsafe.Pointer(v493))++ *(*uint8)(unsafe.Pointer(v492)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v495 = envPtr2 + 152 v494 = *(*uintptr)(unsafe.Pointer(v495)) *(*uintptr)(unsafe.Pointer(v495))++ *(*uint8)(unsafe.Pointer(v494)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v497 = envPtr2 + 152 v496 = *(*uintptr)(unsafe.Pointer(v497)) *(*uintptr)(unsafe.Pointer(v497))++ *(*uint8)(unsafe.Pointer(v496)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v499 = envPtr2 + 152 v498 = *(*uintptr)(unsafe.Pointer(v499)) *(*uintptr)(unsafe.Pointer(v499))++ *(*uint8)(unsafe.Pointer(v498)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v500 = delta1 v501 = envPtr2 if v500 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v501)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v501)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v501)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v501)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v501 + 64)) += int64(v500) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v503 = envPtr2 + 152 v502 = *(*uintptr)(unsafe.Pointer(v503)) *(*uintptr)(unsafe.Pointer(v503))++ *(*uint8)(unsafe.Pointer(v502)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v504 = delta1 v505 = envPtr2 if v504 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v505)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v505)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v505)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v505)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v505 + 64)) += int64(v504) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v507 = envPtr2 + 152 v506 = *(*uintptr)(unsafe.Pointer(v507)) *(*uintptr)(unsafe.Pointer(v507))++ *(*uint8)(unsafe.Pointer(v506)) = libc.Uint8FromInt32(int32(INST_NUM_TYPE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NUM_TYPE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v508 = delta1 v509 = envPtr2 if v508 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v509)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v509)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v509)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v509)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v509 + 64)) += int64(v508) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v511 = envPtr2 + 152 v510 = *(*uintptr)(unsafe.Pointer(v511)) *(*uintptr)(unsafe.Pointer(v511))++ *(*uint8)(unsafe.Pointer(v510)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v512 = delta1 v513 = envPtr2 if v512 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v513)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v513)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v513)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v513)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v513 + 64)) += int64(v512) } end = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v515 = envPtr2 + 152 v514 = *(*uintptr)(unsafe.Pointer(v515)) *(*uintptr)(unsafe.Pointer(v515))++ *(*uint8)(unsafe.Pointer(v514)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v517 = envPtr2 + 152 v516 = *(*uintptr)(unsafe.Pointer(v517)) *(*uintptr)(unsafe.Pointer(v517))++ *(*uint8)(unsafe.Pointer(v516)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v518 = delta1 v519 = envPtr2 if v518 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v519)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v519)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v519)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v519)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v519 + 64)) += int64(v518) } } switch *(*int32)(unsafe.Pointer(bp)) { case 19: goto _520 case 8: goto _521 case 11: goto _522 default: goto _523 } goto _524 _520: ; _527: ; _objIndexCopy14 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21831, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy14 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v529 = envPtr2 + 152 v528 = *(*uintptr)(unsafe.Pointer(v529)) *(*uintptr)(unsafe.Pointer(v529))++ *(*uint8)(unsafe.Pointer(v528)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v531 = envPtr2 + 152 v530 = *(*uintptr)(unsafe.Pointer(v531)) *(*uintptr)(unsafe.Pointer(v531))++ *(*uint8)(unsafe.Pointer(v530)) = uint8(libc.Uint32FromInt32(_objIndexCopy14)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy14 } v532 = delta1 v533 = envPtr2 if v532 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v533)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v533)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v533)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v533)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v533 + 64)) += int64(v532) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v535 = envPtr2 + 152 v534 = *(*uintptr)(unsafe.Pointer(v535)) *(*uintptr)(unsafe.Pointer(v535))++ *(*uint8)(unsafe.Pointer(v534)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v537 = envPtr2 + 152 v536 = *(*uintptr)(unsafe.Pointer(v537)) *(*uintptr)(unsafe.Pointer(v537))++ *(*uint8)(unsafe.Pointer(v536)) = uint8(libc.Uint32FromInt32(_objIndexCopy14) >> libc.Int32FromInt32(24)) v539 = envPtr2 + 152 v538 = *(*uintptr)(unsafe.Pointer(v539)) *(*uintptr)(unsafe.Pointer(v539))++ *(*uint8)(unsafe.Pointer(v538)) = uint8(libc.Uint32FromInt32(_objIndexCopy14) >> libc.Int32FromInt32(16)) v541 = envPtr2 + 152 v540 = *(*uintptr)(unsafe.Pointer(v541)) *(*uintptr)(unsafe.Pointer(v541))++ *(*uint8)(unsafe.Pointer(v540)) = uint8(libc.Uint32FromInt32(_objIndexCopy14) >> libc.Int32FromInt32(8)) v543 = envPtr2 + 152 v542 = *(*uintptr)(unsafe.Pointer(v543)) *(*uintptr)(unsafe.Pointer(v543))++ *(*uint8)(unsafe.Pointer(v542)) = uint8(libc.Uint32FromInt32(_objIndexCopy14)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy14 } v544 = delta1 v545 = envPtr2 if v544 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v545)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v545)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v545)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v545)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v545 + 64)) += int64(v544) } } goto _526 _526: ; if 0 != 0 { goto _527 } goto _525 _525: ; if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v547 = envPtr2 + 152 v546 = *(*uintptr)(unsafe.Pointer(v547)) *(*uintptr)(unsafe.Pointer(v547))++ *(*uint8)(unsafe.Pointer(v546)) = libc.Uint8FromInt32(int32(INST_LE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v548 = delta1 v549 = envPtr2 if v548 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v549)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v549)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v549)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v549)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v549 + 64)) += int64(v548) } goto _524 _522: ; _521: ; _objIndexCopy15 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21870, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy15 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v551 = envPtr2 + 152 v550 = *(*uintptr)(unsafe.Pointer(v551)) *(*uintptr)(unsafe.Pointer(v551))++ *(*uint8)(unsafe.Pointer(v550)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v553 = envPtr2 + 152 v552 = *(*uintptr)(unsafe.Pointer(v553)) *(*uintptr)(unsafe.Pointer(v553))++ *(*uint8)(unsafe.Pointer(v552)) = uint8(libc.Uint32FromInt32(_objIndexCopy15)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy15 } v554 = delta1 v555 = envPtr2 if v554 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v555)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v555)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v555)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v555)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v555 + 64)) += int64(v554) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v557 = envPtr2 + 152 v556 = *(*uintptr)(unsafe.Pointer(v557)) *(*uintptr)(unsafe.Pointer(v557))++ *(*uint8)(unsafe.Pointer(v556)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v559 = envPtr2 + 152 v558 = *(*uintptr)(unsafe.Pointer(v559)) *(*uintptr)(unsafe.Pointer(v559))++ *(*uint8)(unsafe.Pointer(v558)) = uint8(libc.Uint32FromInt32(_objIndexCopy15) >> libc.Int32FromInt32(24)) v561 = envPtr2 + 152 v560 = *(*uintptr)(unsafe.Pointer(v561)) *(*uintptr)(unsafe.Pointer(v561))++ *(*uint8)(unsafe.Pointer(v560)) = uint8(libc.Uint32FromInt32(_objIndexCopy15) >> libc.Int32FromInt32(16)) v563 = envPtr2 + 152 v562 = *(*uintptr)(unsafe.Pointer(v563)) *(*uintptr)(unsafe.Pointer(v563))++ *(*uint8)(unsafe.Pointer(v562)) = uint8(libc.Uint32FromInt32(_objIndexCopy15) >> libc.Int32FromInt32(8)) v565 = envPtr2 + 152 v564 = *(*uintptr)(unsafe.Pointer(v565)) *(*uintptr)(unsafe.Pointer(v565))++ *(*uint8)(unsafe.Pointer(v564)) = uint8(libc.Uint32FromInt32(_objIndexCopy15)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy15 } v566 = delta1 v567 = envPtr2 if v566 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v567)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v567)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v567)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v567)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v567 + 64)) += int64(v566) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v569 = envPtr2 + 152 v568 = *(*uintptr)(unsafe.Pointer(v569)) *(*uintptr)(unsafe.Pointer(v569))++ *(*uint8)(unsafe.Pointer(v568)) = libc.Uint8FromInt32(int32(INST_LE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v570 = delta1 v571 = envPtr2 if v570 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v571)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v571)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v571)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v571)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v571 + 64)) += int64(v570) } goto _524 _523: ; goto _524 _524: ; *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(end) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(end))) return TCL_OK _46: ; range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v573 = envPtr2 + 152 v572 = *(*uintptr)(unsafe.Pointer(v573)) *(*uintptr)(unsafe.Pointer(v573))++ *(*uint8)(unsafe.Pointer(v572)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v575 = envPtr2 + 152 v574 = *(*uintptr)(unsafe.Pointer(v575)) *(*uintptr)(unsafe.Pointer(v575))++ *(*uint8)(unsafe.Pointer(v574)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v577 = envPtr2 + 152 v576 = *(*uintptr)(unsafe.Pointer(v577)) *(*uintptr)(unsafe.Pointer(v577))++ *(*uint8)(unsafe.Pointer(v576)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v579 = envPtr2 + 152 v578 = *(*uintptr)(unsafe.Pointer(v579)) *(*uintptr)(unsafe.Pointer(v579))++ *(*uint8)(unsafe.Pointer(v578)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v581 = envPtr2 + 152 v580 = *(*uintptr)(unsafe.Pointer(v581)) *(*uintptr)(unsafe.Pointer(v581))++ *(*uint8)(unsafe.Pointer(v580)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v582 = delta1 v583 = envPtr2 if v582 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v583)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v583)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v583)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v583)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v583 + 64)) += int64(v582) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v584 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v584 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v584 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v586 = envPtr2 + 152 v585 = *(*uintptr)(unsafe.Pointer(v586)) *(*uintptr)(unsafe.Pointer(v586))++ *(*uint8)(unsafe.Pointer(v585)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v587 = delta1 v588 = envPtr2 if v587 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v588)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v588)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v588)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v588)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v588 + 64)) += int64(v587) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v590 = envPtr2 + 152 v589 = *(*uintptr)(unsafe.Pointer(v590)) *(*uintptr)(unsafe.Pointer(v590))++ *(*uint8)(unsafe.Pointer(v589)) = libc.Uint8FromInt32(int32(INST_DICT_VERIFY)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_VERIFY)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v591 = delta1 v592 = envPtr2 if v591 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v592)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v592)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v592)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v592)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v592 + 64)) += int64(v591) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v594 = envPtr2 + 152 v593 = *(*uintptr)(unsafe.Pointer(v594)) *(*uintptr)(unsafe.Pointer(v594))++ *(*uint8)(unsafe.Pointer(v593)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v595 = delta1 v596 = envPtr2 if v595 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v596)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v596)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v596)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v596)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v596 + 64)) += int64(v595) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v598 = envPtr2 + 152 v597 = *(*uintptr)(unsafe.Pointer(v598)) *(*uintptr)(unsafe.Pointer(v598))++ *(*uint8)(unsafe.Pointer(v597)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v599 = delta1 v600 = envPtr2 if v599 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v600)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v600)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v600)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v600)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v600 + 64)) += int64(v599) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v602 = envPtr2 + 152 v601 = *(*uintptr)(unsafe.Pointer(v602)) *(*uintptr)(unsafe.Pointer(v602))++ *(*uint8)(unsafe.Pointer(v601)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v603 = delta1 v604 = envPtr2 if v603 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v604)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v604)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v604)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v604)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v604 + 64)) += int64(v603) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v606 = envPtr2 + 152 v605 = *(*uintptr)(unsafe.Pointer(v606)) *(*uintptr)(unsafe.Pointer(v606))++ *(*uint8)(unsafe.Pointer(v605)) = libc.Uint8FromInt32(int32(INST_LNOT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LNOT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v607 = delta1 v608 = envPtr2 if v607 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v608)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v608)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v608)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v608)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v608 + 64)) += int64(v607) } return TCL_OK _47: ; range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v610 = envPtr2 + 152 v609 = *(*uintptr)(unsafe.Pointer(v610)) *(*uintptr)(unsafe.Pointer(v610))++ *(*uint8)(unsafe.Pointer(v609)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v612 = envPtr2 + 152 v611 = *(*uintptr)(unsafe.Pointer(v612)) *(*uintptr)(unsafe.Pointer(v612))++ *(*uint8)(unsafe.Pointer(v611)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v614 = envPtr2 + 152 v613 = *(*uintptr)(unsafe.Pointer(v614)) *(*uintptr)(unsafe.Pointer(v614))++ *(*uint8)(unsafe.Pointer(v613)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v616 = envPtr2 + 152 v615 = *(*uintptr)(unsafe.Pointer(v616)) *(*uintptr)(unsafe.Pointer(v616))++ *(*uint8)(unsafe.Pointer(v615)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v618 = envPtr2 + 152 v617 = *(*uintptr)(unsafe.Pointer(v618)) *(*uintptr)(unsafe.Pointer(v618))++ *(*uint8)(unsafe.Pointer(v617)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v619 = delta1 v620 = envPtr2 if v619 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v620)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v620)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v620)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v620)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v620 + 64)) += int64(v619) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v621 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v621 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v621 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v623 = envPtr2 + 152 v622 = *(*uintptr)(unsafe.Pointer(v623)) *(*uintptr)(unsafe.Pointer(v623))++ *(*uint8)(unsafe.Pointer(v622)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v624 = delta1 v625 = envPtr2 if v624 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v625)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v625)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v625)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v625)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v625 + 64)) += int64(v624) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v627 = envPtr2 + 152 v626 = *(*uintptr)(unsafe.Pointer(v627)) *(*uintptr)(unsafe.Pointer(v627))++ *(*uint8)(unsafe.Pointer(v626)) = libc.Uint8FromInt32(int32(INST_LIST_LENGTH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_LENGTH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v628 = delta1 v629 = envPtr2 if v628 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v629)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v629)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v629)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v629)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v629 + 64)) += int64(v628) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v631 = envPtr2 + 152 v630 = *(*uintptr)(unsafe.Pointer(v631)) *(*uintptr)(unsafe.Pointer(v631))++ *(*uint8)(unsafe.Pointer(v630)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v632 = delta1 v633 = envPtr2 if v632 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v633)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v633)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v633)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v633)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v633 + 64)) += int64(v632) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v635 = envPtr2 + 152 v634 = *(*uintptr)(unsafe.Pointer(v635)) *(*uintptr)(unsafe.Pointer(v635))++ *(*uint8)(unsafe.Pointer(v634)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v636 = delta1 v637 = envPtr2 if v636 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v637)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v637)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v637)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v637)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v637 + 64)) += int64(v636) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v639 = envPtr2 + 152 v638 = *(*uintptr)(unsafe.Pointer(v639)) *(*uintptr)(unsafe.Pointer(v639))++ *(*uint8)(unsafe.Pointer(v638)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v640 = delta1 v641 = envPtr2 if v640 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v641)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v641)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v641)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v641)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v641 + 64)) += int64(v640) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v643 = envPtr2 + 152 v642 = *(*uintptr)(unsafe.Pointer(v643)) *(*uintptr)(unsafe.Pointer(v643))++ *(*uint8)(unsafe.Pointer(v642)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v644 = delta1 v645 = envPtr2 if v644 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v645)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v645)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v645)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v645)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v645 + 64)) += int64(v644) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v647 = envPtr2 + 152 v646 = *(*uintptr)(unsafe.Pointer(v647)) *(*uintptr)(unsafe.Pointer(v647))++ *(*uint8)(unsafe.Pointer(v646)) = libc.Uint8FromInt32(int32(INST_LNOT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LNOT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v648 = delta1 v649 = envPtr2 if v648 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v649)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v649)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v649)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v649)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v649 + 64)) += int64(v648) } return TCL_OK _48: ; return XTclCompileBasicMin0ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } var _isClasses1 = [23]uintptr{ 0: __ccgo_ts + 1119, 1: __ccgo_ts + 1125, 2: __ccgo_ts + 1131, 3: __ccgo_ts + 19214, 4: __ccgo_ts + 3611, 5: __ccgo_ts + 19222, 6: __ccgo_ts + 1149, 7: __ccgo_ts + 6055, 8: __ccgo_ts + 6062, 9: __ccgo_ts + 19227, 10: __ccgo_ts + 1155, 11: __ccgo_ts + 6223, 12: __ccgo_ts + 2860, 13: __ccgo_ts + 1161, 14: __ccgo_ts + 1167, 15: __ccgo_ts + 1173, 16: __ccgo_ts + 558, 17: __ccgo_ts + 19233, 18: __ccgo_ts + 1179, 19: __ccgo_ts + 19238, 20: __ccgo_ts + 19250, 21: __ccgo_ts + 1185, 22: libc.UintptrFromInt32(0), } func XTclCompileStringMatchCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, exactMatch, i1, nocase, v10, v22, v26, v32 int32 var cachePtr, copy1, mapPtr, str, tokenPtr, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v23, v24, v25, v27, v28, v29, v30, v31, v33, v4, v6, v7, v8, v9 uintptr var eclIndex, v3 TTcl_Size var length Tsize_t var v5 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, cachePtr, copy1, delta1, eclIndex, exactMatch, i1, length, mapPtr, nocase, str, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) exactMatch = 0 nocase = 0 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < int64(3) || (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > int64(4) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* * Check if we have a -nocase flag. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(4) { if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } str = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart length = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize) if length <= uint64(1) || libc.Xstrncmp(tls, str, __ccgo_ts+17555, length) != 0 { /* * Fail at run time, not in compilation. */ return XTclCompileBasic3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } nocase = int32(1) tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } /* * Push the strings to match against each other. */ i1 = 0 for { if !(i1 < int32(2)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { str = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart length = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize) if !(nocase != 0) && i1 == 0 { /* * Trivial matches can be done by 'string equal'. If -nocase * was specified, we can't do this because INST_STR_EQ has no * support for nocase. */ copy1 = XTcl_NewStringObj(tls, str, libc.Int64FromUint64(length)) (*TTcl_Obj)(unsafe.Pointer(copy1)).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(copy1)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(copy1)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, copy1, libc.UintptrFromInt32(0)) } exactMatch = libc.BoolInt32(libc.Xstrpbrk(tls, v2, __ccgo_ts+16411) == libc.UintptrFromInt32(0)) v4 = copy1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if !(v3 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(copy1)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(copy1)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(copy1)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(copy1)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(copy1)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(copy1)).Flength = int64(-libc.Int32FromInt32(1)) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, copy1) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copy1 + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = copy1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, copy1) } } } _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, str, libc.Int64FromUint64(length), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v10 = delta1 v11 = envPtr2 if v10 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v11 + 64)) += int64(v10) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1+libc.Int32FromInt32(1)+nocase)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1+libc.Int32FromInt32(1)+nocase)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i1++ } /* * Push the matcher. */ if exactMatch != 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v26 = delta1 v27 = envPtr2 if v26 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v27 + 64)) += int64(v26) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = libc.Uint8FromInt32(int32(INST_STR_MATCH)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(nocase)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_MATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - nocase } v32 = delta1 v33 = envPtr2 if v32 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v33 + 64)) += int64(v32) } } return TCL_OK } func XTclCompileStringLenCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy873 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Holds resulting instructions. */ var _objIndexCopy, delta1, v18, v22, v6 int32 var cachePtr, cachePtr1, mapPtr, objPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v23, v25, v3, v4, v5, v7, v8, v9 uintptr var eclIndex, v24 TTcl_Size var len1 Tsize_t var v1, v26 bool var _ /* buf at bp+0 */ [24]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, cachePtr, cachePtr1, delta1, eclIndex, len1, mapPtr, objPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) if XTclWordKnownAtCompileTime(tls, tokenPtr, objPtr) != 0 { len1 = libc.Uint64FromInt64(XTcl_GetCharLength(tls, objPtr)) len1 = libc.Uint64FromInt32(libc.X__builtin_snprintf(tls, bp, uint64(24), __ccgo_ts+21872, libc.VaList(bp+32, len1))) _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, bp, libc.Int64FromUint64(len1), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_STR_LEN)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_LEN)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } } v25 = objPtr v24 = *(*TTcl_Size)(unsafe.Pointer(v25)) *(*TTcl_Size)(unsafe.Pointer(v25))-- if !(v24 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v26 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v26 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v26 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, objPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = objPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, objPtr) } } return TCL_OK } func XTclCompileStringMapCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, delta1, v16, v28, v34, v4, v46, v53, v65, v71, v83, v87 int32 var _objPtr, _objPtr1, _objPtr2, _objPtr3, bytes, cachePtr, mapObj, mapPtr, mapTokenPtr, stringTokenPtr, v10, v11, v12, v13, v14, v15, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v29, v3, v30, v31, v32, v33, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v47, v48, v49, v50, v51, v52, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v66, v67, v68, v69, v70, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v84, v85, v86, v88, v90 uintptr var eclIndex, v2, v7, v89, v9 TTcl_Size var v1 bool var v5, v6 int64 var _ /* len at bp+8 */ TTcl_Size var _ /* objv at bp+0 */ uintptr var _ /* slen at bp+16 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objPtr, _objPtr1, _objPtr2, _objPtr3, bytes, cachePtr, delta1, eclIndex, mapObj, mapPtr, mapTokenPtr, stringTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * We only handle the case: * * string map {foo bar} $thing * * That is, a literal two-element list (doesn't need to be brace-quoted, * but does need to be compile-time knowable) and any old argument (the * thing to map). */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } mapTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 stringTokenPtr = mapTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(mapTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { mapObj = XTclThreadAllocObj(tls) } else { mapObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(mapObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(mapObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(mapObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(mapObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(mapObj)).FrefCount++ if !(XTclWordKnownAtCompileTime(tls, mapTokenPtr, mapObj) != 0) { _objPtr = mapObj v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } return XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } else { if (*TTcl_Obj)(unsafe.Pointer(mapObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapObj + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapObj + 32))).Fptr2)).FspanStart } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapObj + 32))).Fptr1 + 40 + uintptr(v5)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapObj + 32))).Fptr2 != 0 { v6 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapObj + 32))).Fptr2)).FspanLength } else { v6 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v6 v4 = libc.Int32FromInt32(TCL_OK) } else { v4 = XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), mapObj, bp+8, bp) } if v4 != TCL_OK { _objPtr1 = mapObj v8 = _objPtr1 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) != int64(2) { _objPtr2 = mapObj v10 = _objPtr2 v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr2) } return XTclCompileBasic2ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } } } /* * Now issue the opcodes. Note that in the case that we know that the * first word is an empty word, we don't issue the map at all. That is the * correct semantics for mapping. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))).Flength v11 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))).Fbytes } else { v11 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), bp+16) } bytes = v11 if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) == 0 { if (*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(stringTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(stringTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v16 = delta1 v17 = envPtr2 if v16 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v17)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v17)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v17)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v17)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v17 + 64)) += int64(v16) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v28 = delta1 v29 = envPtr2 if v28 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v29 + 64)) += int64(v28) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, stringTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents), envPtr2) } } else { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 16)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v34 = delta1 v35 = envPtr2 if v34 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v35 + 64)) += int64(v34) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v46 = delta1 v47 = envPtr2 if v46 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v47)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v47)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v47)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v47)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v47 + 64)) += int64(v46) } } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)))).Flength v48 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)))).Fbytes } else { v48 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)), bp+16) } bytes = v48 _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 16)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v65 = delta1 v66 = envPtr2 if v65 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v66 + 64)) += int64(v65) } } if (*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(stringTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(stringTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v71 = delta1 v72 = envPtr2 if v71 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v72 + 64)) += int64(v71) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v83 = delta1 v84 = envPtr2 if v83 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v84 + 64)) += int64(v83) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, stringTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = libc.Uint8FromInt32(int32(INST_STR_MAP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_MAP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v87 = delta1 v88 = envPtr2 if v87 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v88 + 64)) += int64(v87) } } _objPtr3 = mapObj v90 = _objPtr3 v89 = *(*TTcl_Size)(unsafe.Pointer(v90)) *(*TTcl_Size)(unsafe.Pointer(v90))-- if v89 <= int64(1) { XTclFreeObj(tls, _objPtr3) } return TCL_OK } func XTclCompileStringRangeCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy975 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, delta1, v105, v117, v121, v17, v21, v27, v39, v43, v49, v5, v61, v73, v87, v99 int32 var eclIndex TTcl_Size var fromTokenPtr, mapPtr, stringTokenPtr, toTokenPtr, v1, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v118, v119, v12, v120, v122, v13, v14, v15, v16, v18, v19, v2, v20, v22, v23, v24, v25, v26, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v41, v42, v44, v45, v46, v47, v48, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98 uintptr var _ /* idx1 at bp+0 */ int32 var _ /* idx2 at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, delta1, eclIndex, fromTokenPtr, mapPtr, stringTokenPtr, toTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(4) { return int32(TCL_ERROR) } stringTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 fromTokenPtr = stringTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 toTokenPtr = fromTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(fromTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 /* Every path must push the string argument */ if (*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(stringTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(stringTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, stringTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(stringTokenPtr)).FnumComponents), envPtr2) } /* * Parse the two indices. */ if XTclGetIndexFromToken(tls, fromTokenPtr, libc.Uint64FromInt64(libc.Int64FromInt32(0)), libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))), bp) != TCL_OK { goto nonConstantIndices } /* * Token parsed as an index expression. We treat all indices before * the string the same as the start of the string. */ if *(*int32)(unsafe.Pointer(bp)) == int32(int64(-libc.Int32FromInt32(1))) { /* [string range $s end+1 $last] must be empty string */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v27 = delta1 v28 = envPtr2 if v27 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v28)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v28)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v28 + 64)) += int64(v27) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } } return TCL_OK } if XTclGetIndexFromToken(tls, toTokenPtr, libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))), libc.Uint64FromInt64(int64(-libc.Int32FromInt32(2))), bp+4) != TCL_OK { goto nonConstantIndices } /* * Token parsed as an index expression. We treat all indices after * the string the same as the end of the string. */ if *(*int32)(unsafe.Pointer(bp + 4)) == int32(int64(-libc.Int32FromInt32(1))) { /* [string range $s $first -1] must be empty string */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v43 = delta1 v44 = envPtr2 if v43 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v44 + 64)) += int64(v43) } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v49 = delta1 v50 = envPtr2 if v49 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v50 + 64)) += int64(v49) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v61 = delta1 v62 = envPtr2 if v61 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v62 + 64)) += int64(v61) } } return TCL_OK } /* * Push the operand onto the stack and then the substring operation. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = libc.Uint8FromInt32(int32(INST_STR_RANGE_IMM)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(24)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(16)) v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))) >> libc.Int32FromInt32(8)) v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(bp)) } v73 = delta1 v74 = envPtr2 if v73 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v74 + 64)) += int64(v73) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) return TCL_OK /* * Push the operands onto the stack and then the substring operation. */ goto nonConstantIndices nonConstantIndices: ; if (*TTcl_Token)(unsafe.Pointer(fromTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(fromTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(fromTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v87 = delta1 v88 = envPtr2 if v87 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v88)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v88 + 64)) += int64(v87) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v99 = delta1 v100 = envPtr2 if v99 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v100 + 64)) += int64(v99) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, fromTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(fromTokenPtr)).FnumComponents), envPtr2) } if (*TTcl_Token)(unsafe.Pointer(toTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(toTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(toTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v104 = envPtr2 + 152 v103 = *(*uintptr)(unsafe.Pointer(v104)) *(*uintptr)(unsafe.Pointer(v104))++ *(*uint8)(unsafe.Pointer(v103)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v105 = delta1 v106 = envPtr2 if v105 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v106)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v106)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v106)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v106)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v106 + 64)) += int64(v105) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v117 = delta1 v118 = envPtr2 if v117 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v118)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v118)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v118)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v118)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v118 + 64)) += int64(v117) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileTokens(tls, interp, toTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(toTokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = libc.Uint8FromInt32(int32(INST_STR_RANGE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v121 = delta1 v122 = envPtr2 if v121 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v122)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v122)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v122)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v122)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v122 + 64)) += int64(v121) } return TCL_OK } func XTclCompileStringReplaceCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1050 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds the resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objIndexCopy7, _objIndexCopy8, delta1, v111, v125, v137, v143, v147, v153, v165, v17, v177, v197, v209, v221, v23, v241, v253, v267, v273, v285, v291, v303, v309, v321, v327, v339, v343, v35, v39, v45, v5, v57, v69, v73, v85, v99 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, valueTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v138, v139, v14, v140, v141, v142, v144, v145, v146, v148, v149, v15, v150, v151, v152, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v166, v167, v168, v169, v170, v171, v172, v173, v174, v175, v176, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v222, v223, v224, v225, v226, v227, v228, v229, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v266, v268, v269, v27, v270, v271, v272, v274, v275, v276, v277, v278, v279, v28, v280, v281, v282, v283, v284, v286, v287, v288, v289, v29, v290, v292, v293, v294, v295, v296, v297, v298, v299, v3, v30, v300, v301, v302, v304, v305, v306, v307, v308, v31, v310, v311, v312, v313, v314, v315, v316, v317, v318, v319, v32, v320, v322, v323, v324, v325, v326, v328, v329, v33, v330, v331, v332, v333, v334, v335, v336, v337, v338, v34, v340, v341, v342, v344, v36, v37, v38, v4, v40, v41, v42, v43, v44, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v7, v70, v71, v72, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98 uintptr var _ /* first at bp+0 */ int32 var _ /* last at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objIndexCopy7, _objIndexCopy8, delta1, eclIndex, mapPtr, tokenPtr, valueTokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v28, v280, v281, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v292, v293, v294, v295, v296, v297, v298, v299, v3, v30, v300, v301, v302, v303, v304, v305, v306, v307, v308, v309, v31, v310, v311, v312, v313, v314, v315, v316, v317, v318, v319, v32, v320, v321, v322, v323, v324, v325, v326, v327, v328, v329, v33, v330, v331, v332, v333, v334, v335, v336, v337, v338, v339, v34, v340, v341, v342, v343, v344, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(4) || int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) > int32(5) { return int32(TCL_ERROR) } /* Bytecode to compute/push string argument being replaced */ valueTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } /* * Check for first index known and useful at compile time. */ tokenPtr = valueTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if XTclGetIndexFromToken(tls, tokenPtr, libc.Uint64FromInt64(libc.Int64FromInt32(0)), libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))), bp) != TCL_OK { goto genericReplace } /* * Check for last index known and useful at compile time. */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if XTclGetIndexFromToken(tls, tokenPtr, libc.Uint64FromInt64(int64(-libc.Int32FromInt32(1))), libc.Uint64FromInt64(int64(-libc.Int32FromInt32(2))), bp+4) != TCL_OK { goto genericReplace } /* * [string replace] is an odd bird. For many arguments it is * a conventional substring replacer. However it also goes out * of its way to become a no-op for many cases where it would be * replacing an empty substring. Precisely, it is a no-op when * * (last < first) OR * (last < 0) OR * (end < first) * * For some compile-time values we can detect these cases, and * compile direct to bytecode implementing the no-op. */ if *(*int32)(unsafe.Pointer(bp + 4)) == int32(int64(-libc.Int32FromInt32(1))) || *(*int32)(unsafe.Pointer(bp)) == int32(int64(-libc.Int32FromInt32(1))) || *(*int32)(unsafe.Pointer(bp)) <= int32(int64(-libc.Int32FromInt32(2))) && *(*int32)(unsafe.Pointer(bp + 4)) <= int32(int64(-libc.Int32FromInt32(2))) && *(*int32)(unsafe.Pointer(bp + 4)) < *(*int32)(unsafe.Pointer(bp)) || *(*int32)(unsafe.Pointer(bp)) >= int32(libc.Int64FromInt32(0)) && *(*int32)(unsafe.Pointer(bp + 4)) >= int32(libc.Int64FromInt32(0)) && *(*int32)(unsafe.Pointer(bp + 4)) < *(*int32)(unsafe.Pointer(bp)) { /* Know (last < first) */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(5) { tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 4*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 4*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } /* Pop newString */ } /* Original string argument now on TOS as result */ return TCL_OK } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(5) { /* * When we have a string replacement, we have to take care about * not replacing empty substrings that [string replace] promises * not to replace * * The remaining index values might be suitable for conventional * string replacement, but only if they cannot possibly meet the * conditions described above at runtime. If there's a chance they * might, we would have to emit bytecode to check and at that point * we're paying more in bytecode execution time than would make * things worthwhile. Trouble is we are very limited in * how much we can detect that at compile time. After decoding, * we need, first: * * (first <= end) * * The encoded indices (first <= TCL_INDEX END) and * (first == TCL_INDEX_NONE) always meets this condition, but * any other encoded first index has some list for which it fails. * * We also need, second: * * (last >= 0) * * The encoded index (last >= TCL_INDEX_START) always meet this * condition but any other encoded last index has some list for * which it fails. * * Finally we need, third: * * (first <= last) * * Considered in combination with the constraints we already have, * we see that we can proceed when (first == TCL_INDEX_NONE). * These also permit simplification of the prefix|replace|suffix * construction. The other constraints, though, interfere with * getting a guarantee that first <= last. */ if *(*int32)(unsafe.Pointer(bp)) == int32(libc.Int64FromInt32(0)) && *(*int32)(unsafe.Pointer(bp + 4)) >= int32(libc.Int64FromInt32(0)) { /* empty prefix */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v45 = delta1 v46 = envPtr2 if v45 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v46 + 64)) += int64(v45) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 4*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 4*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } if *(*int32)(unsafe.Pointer(bp + 4)) == int32(INT_MAX) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v73 = delta1 v74 = envPtr2 if v73 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v74 + 64)) += int64(v73) } /* Pop original */ } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = libc.Uint8FromInt32(int32(INST_STR_RANGE_IMM)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))+libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))+libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))+libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)) + libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (*(*int32)(unsafe.Pointer(bp + 4)) + int32(1)) } v85 = delta1 v86 = envPtr2 if v85 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v86 + 64)) += int64(v85) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(24)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(16)) v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(8)) v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2))))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v99 = delta1 v100 = envPtr2 if v99 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v100 + 64)) += int64(v99) } } return TCL_OK } if *(*int32)(unsafe.Pointer(bp + 4)) == int32(int64(-libc.Int32FromInt32(1))) && *(*int32)(unsafe.Pointer(bp)) <= int32(int64(-libc.Int32FromInt32(2))) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = libc.Uint8FromInt32(int32(INST_STR_RANGE_IMM)) v104 = envPtr2 + 152 v103 = *(*uintptr)(unsafe.Pointer(v104)) *(*uintptr)(unsafe.Pointer(v104))++ *(*uint8)(unsafe.Pointer(v103)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v111 = delta1 v112 = envPtr2 if v111 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v112)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v112)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v112 + 64)) += int64(v111) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)) - libc.Int32FromInt32(1))) tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v124 = envPtr2 + 152 v123 = *(*uintptr)(unsafe.Pointer(v124)) *(*uintptr)(unsafe.Pointer(v124))++ *(*uint8)(unsafe.Pointer(v123)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v125 = delta1 v126 = envPtr2 if v125 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v126)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v126)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v126)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v126)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v126 + 64)) += int64(v125) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v128 = envPtr2 + 152 v127 = *(*uintptr)(unsafe.Pointer(v128)) *(*uintptr)(unsafe.Pointer(v128))++ *(*uint8)(unsafe.Pointer(v127)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v130 = envPtr2 + 152 v129 = *(*uintptr)(unsafe.Pointer(v130)) *(*uintptr)(unsafe.Pointer(v130))++ *(*uint8)(unsafe.Pointer(v129)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v132 = envPtr2 + 152 v131 = *(*uintptr)(unsafe.Pointer(v132)) *(*uintptr)(unsafe.Pointer(v132))++ *(*uint8)(unsafe.Pointer(v131)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v134 = envPtr2 + 152 v133 = *(*uintptr)(unsafe.Pointer(v134)) *(*uintptr)(unsafe.Pointer(v134))++ *(*uint8)(unsafe.Pointer(v133)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v136 = envPtr2 + 152 v135 = *(*uintptr)(unsafe.Pointer(v136)) *(*uintptr)(unsafe.Pointer(v136))++ *(*uint8)(unsafe.Pointer(v135)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v137 = delta1 v138 = envPtr2 if v137 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v138)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v138)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v138)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v138)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v138 + 64)) += int64(v137) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 4*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 4*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v140 = envPtr2 + 152 v139 = *(*uintptr)(unsafe.Pointer(v140)) *(*uintptr)(unsafe.Pointer(v140))++ *(*uint8)(unsafe.Pointer(v139)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v142 = envPtr2 + 152 v141 = *(*uintptr)(unsafe.Pointer(v142)) *(*uintptr)(unsafe.Pointer(v142))++ *(*uint8)(unsafe.Pointer(v141)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v143 = delta1 v144 = envPtr2 if v143 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v144)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v144)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v144)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v144)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v144 + 64)) += int64(v143) } return TCL_OK } /* FLOW THROUGH TO genericReplace */ } else { /* * When we have no replacement string to worry about, we may * have more luck, because the forbidden empty string replacements * are harmless when they are replaced by another empty string. */ if *(*int32)(unsafe.Pointer(bp)) == int32(libc.Int64FromInt32(0)) { /* empty prefix - build suffix only */ if *(*int32)(unsafe.Pointer(bp + 4)) == int32(int64(-libc.Int32FromInt32(2))) { /* empty suffix too => empty result */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v146 = envPtr2 + 152 v145 = *(*uintptr)(unsafe.Pointer(v146)) *(*uintptr)(unsafe.Pointer(v146))++ *(*uint8)(unsafe.Pointer(v145)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v147 = delta1 v148 = envPtr2 if v147 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v148)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v148)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v148)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v148)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v148 + 64)) += int64(v147) } /* Pop original */ _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v150 = envPtr2 + 152 v149 = *(*uintptr)(unsafe.Pointer(v150)) *(*uintptr)(unsafe.Pointer(v150))++ *(*uint8)(unsafe.Pointer(v149)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v152 = envPtr2 + 152 v151 = *(*uintptr)(unsafe.Pointer(v152)) *(*uintptr)(unsafe.Pointer(v152))++ *(*uint8)(unsafe.Pointer(v151)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v153 = delta1 v154 = envPtr2 if v153 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v154)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v154)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v154)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v154)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v154 + 64)) += int64(v153) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v156 = envPtr2 + 152 v155 = *(*uintptr)(unsafe.Pointer(v156)) *(*uintptr)(unsafe.Pointer(v156))++ *(*uint8)(unsafe.Pointer(v155)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v158 = envPtr2 + 152 v157 = *(*uintptr)(unsafe.Pointer(v158)) *(*uintptr)(unsafe.Pointer(v158))++ *(*uint8)(unsafe.Pointer(v157)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v160 = envPtr2 + 152 v159 = *(*uintptr)(unsafe.Pointer(v160)) *(*uintptr)(unsafe.Pointer(v160))++ *(*uint8)(unsafe.Pointer(v159)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v162 = envPtr2 + 152 v161 = *(*uintptr)(unsafe.Pointer(v162)) *(*uintptr)(unsafe.Pointer(v162))++ *(*uint8)(unsafe.Pointer(v161)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v164 = envPtr2 + 152 v163 = *(*uintptr)(unsafe.Pointer(v164)) *(*uintptr)(unsafe.Pointer(v164))++ *(*uint8)(unsafe.Pointer(v163)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v165 = delta1 v166 = envPtr2 if v165 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v166)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v166)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v166)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v166)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v166 + 64)) += int64(v165) } } return TCL_OK } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v168 = envPtr2 + 152 v167 = *(*uintptr)(unsafe.Pointer(v168)) *(*uintptr)(unsafe.Pointer(v168))++ *(*uint8)(unsafe.Pointer(v167)) = libc.Uint8FromInt32(int32(INST_STR_RANGE_IMM)) v170 = envPtr2 + 152 v169 = *(*uintptr)(unsafe.Pointer(v170)) *(*uintptr)(unsafe.Pointer(v170))++ *(*uint8)(unsafe.Pointer(v169)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))+libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v172 = envPtr2 + 152 v171 = *(*uintptr)(unsafe.Pointer(v172)) *(*uintptr)(unsafe.Pointer(v172))++ *(*uint8)(unsafe.Pointer(v171)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))+libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v174 = envPtr2 + 152 v173 = *(*uintptr)(unsafe.Pointer(v174)) *(*uintptr)(unsafe.Pointer(v174))++ *(*uint8)(unsafe.Pointer(v173)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))+libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v176 = envPtr2 + 152 v175 = *(*uintptr)(unsafe.Pointer(v176)) *(*uintptr)(unsafe.Pointer(v176))++ *(*uint8)(unsafe.Pointer(v175)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)) + libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (*(*int32)(unsafe.Pointer(bp + 4)) + int32(1)) } v177 = delta1 v178 = envPtr2 if v177 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v178)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v178)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v178)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v178)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v178 + 64)) += int64(v177) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v180 = envPtr2 + 152 v179 = *(*uintptr)(unsafe.Pointer(v180)) *(*uintptr)(unsafe.Pointer(v180))++ *(*uint8)(unsafe.Pointer(v179)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(24)) v182 = envPtr2 + 152 v181 = *(*uintptr)(unsafe.Pointer(v182)) *(*uintptr)(unsafe.Pointer(v182))++ *(*uint8)(unsafe.Pointer(v181)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(16)) v184 = envPtr2 + 152 v183 = *(*uintptr)(unsafe.Pointer(v184)) *(*uintptr)(unsafe.Pointer(v184))++ *(*uint8)(unsafe.Pointer(v183)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(8)) v186 = envPtr2 + 152 v185 = *(*uintptr)(unsafe.Pointer(v186)) *(*uintptr)(unsafe.Pointer(v186))++ *(*uint8)(unsafe.Pointer(v185)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2))))) return TCL_OK } else { if *(*int32)(unsafe.Pointer(bp + 4)) == int32(int64(-libc.Int32FromInt32(2))) { /* empty suffix - build prefix only */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v188 = envPtr2 + 152 v187 = *(*uintptr)(unsafe.Pointer(v188)) *(*uintptr)(unsafe.Pointer(v188))++ *(*uint8)(unsafe.Pointer(v187)) = libc.Uint8FromInt32(int32(INST_STR_RANGE_IMM)) v190 = envPtr2 + 152 v189 = *(*uintptr)(unsafe.Pointer(v190)) *(*uintptr)(unsafe.Pointer(v190))++ *(*uint8)(unsafe.Pointer(v189)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v192 = envPtr2 + 152 v191 = *(*uintptr)(unsafe.Pointer(v192)) *(*uintptr)(unsafe.Pointer(v192))++ *(*uint8)(unsafe.Pointer(v191)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v194 = envPtr2 + 152 v193 = *(*uintptr)(unsafe.Pointer(v194)) *(*uintptr)(unsafe.Pointer(v194))++ *(*uint8)(unsafe.Pointer(v193)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v196 = envPtr2 + 152 v195 = *(*uintptr)(unsafe.Pointer(v196)) *(*uintptr)(unsafe.Pointer(v196))++ *(*uint8)(unsafe.Pointer(v195)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v197 = delta1 v198 = envPtr2 if v197 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v198)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v198)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v198)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v198)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v198 + 64)) += int64(v197) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v200 = envPtr2 + 152 v199 = *(*uintptr)(unsafe.Pointer(v200)) *(*uintptr)(unsafe.Pointer(v200))++ *(*uint8)(unsafe.Pointer(v199)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v202 = envPtr2 + 152 v201 = *(*uintptr)(unsafe.Pointer(v202)) *(*uintptr)(unsafe.Pointer(v202))++ *(*uint8)(unsafe.Pointer(v201)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v204 = envPtr2 + 152 v203 = *(*uintptr)(unsafe.Pointer(v204)) *(*uintptr)(unsafe.Pointer(v204))++ *(*uint8)(unsafe.Pointer(v203)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v206 = envPtr2 + 152 v205 = *(*uintptr)(unsafe.Pointer(v206)) *(*uintptr)(unsafe.Pointer(v206))++ *(*uint8)(unsafe.Pointer(v205)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)) - libc.Int32FromInt32(1))) return TCL_OK } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v208 = envPtr2 + 152 v207 = *(*uintptr)(unsafe.Pointer(v208)) *(*uintptr)(unsafe.Pointer(v208))++ *(*uint8)(unsafe.Pointer(v207)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v209 = delta1 v210 = envPtr2 if v209 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v210)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v210)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v210)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v210)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v210 + 64)) += int64(v209) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v212 = envPtr2 + 152 v211 = *(*uintptr)(unsafe.Pointer(v212)) *(*uintptr)(unsafe.Pointer(v212))++ *(*uint8)(unsafe.Pointer(v211)) = libc.Uint8FromInt32(int32(INST_STR_RANGE_IMM)) v214 = envPtr2 + 152 v213 = *(*uintptr)(unsafe.Pointer(v214)) *(*uintptr)(unsafe.Pointer(v214))++ *(*uint8)(unsafe.Pointer(v213)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v216 = envPtr2 + 152 v215 = *(*uintptr)(unsafe.Pointer(v216)) *(*uintptr)(unsafe.Pointer(v216))++ *(*uint8)(unsafe.Pointer(v215)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v218 = envPtr2 + 152 v217 = *(*uintptr)(unsafe.Pointer(v218)) *(*uintptr)(unsafe.Pointer(v218))++ *(*uint8)(unsafe.Pointer(v217)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v220 = envPtr2 + 152 v219 = *(*uintptr)(unsafe.Pointer(v220)) *(*uintptr)(unsafe.Pointer(v220))++ *(*uint8)(unsafe.Pointer(v219)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v221 = delta1 v222 = envPtr2 if v221 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v222)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v222)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v222)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v222)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v222 + 64)) += int64(v221) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v224 = envPtr2 + 152 v223 = *(*uintptr)(unsafe.Pointer(v224)) *(*uintptr)(unsafe.Pointer(v224))++ *(*uint8)(unsafe.Pointer(v223)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v226 = envPtr2 + 152 v225 = *(*uintptr)(unsafe.Pointer(v226)) *(*uintptr)(unsafe.Pointer(v226))++ *(*uint8)(unsafe.Pointer(v225)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v228 = envPtr2 + 152 v227 = *(*uintptr)(unsafe.Pointer(v228)) *(*uintptr)(unsafe.Pointer(v228))++ *(*uint8)(unsafe.Pointer(v227)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))-libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v230 = envPtr2 + 152 v229 = *(*uintptr)(unsafe.Pointer(v230)) *(*uintptr)(unsafe.Pointer(v230))++ *(*uint8)(unsafe.Pointer(v229)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp)) - libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v232 = envPtr2 + 152 v231 = *(*uintptr)(unsafe.Pointer(v232)) *(*uintptr)(unsafe.Pointer(v232))++ *(*uint8)(unsafe.Pointer(v231)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v234 = envPtr2 + 152 v233 = *(*uintptr)(unsafe.Pointer(v234)) *(*uintptr)(unsafe.Pointer(v234))++ *(*uint8)(unsafe.Pointer(v233)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v236 = envPtr2 + 152 v235 = *(*uintptr)(unsafe.Pointer(v236)) *(*uintptr)(unsafe.Pointer(v236))++ *(*uint8)(unsafe.Pointer(v235)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v238 = envPtr2 + 152 v237 = *(*uintptr)(unsafe.Pointer(v238)) *(*uintptr)(unsafe.Pointer(v238))++ *(*uint8)(unsafe.Pointer(v237)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v240 = envPtr2 + 152 v239 = *(*uintptr)(unsafe.Pointer(v240)) *(*uintptr)(unsafe.Pointer(v240))++ *(*uint8)(unsafe.Pointer(v239)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v241 = delta1 v242 = envPtr2 if v241 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v242)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v242)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v242)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v242)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v242 + 64)) += int64(v241) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v244 = envPtr2 + 152 v243 = *(*uintptr)(unsafe.Pointer(v244)) *(*uintptr)(unsafe.Pointer(v244))++ *(*uint8)(unsafe.Pointer(v243)) = libc.Uint8FromInt32(int32(INST_STR_RANGE_IMM)) v246 = envPtr2 + 152 v245 = *(*uintptr)(unsafe.Pointer(v246)) *(*uintptr)(unsafe.Pointer(v246))++ *(*uint8)(unsafe.Pointer(v245)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))+libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v248 = envPtr2 + 152 v247 = *(*uintptr)(unsafe.Pointer(v248)) *(*uintptr)(unsafe.Pointer(v248))++ *(*uint8)(unsafe.Pointer(v247)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))+libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v250 = envPtr2 + 152 v249 = *(*uintptr)(unsafe.Pointer(v250)) *(*uintptr)(unsafe.Pointer(v250))++ *(*uint8)(unsafe.Pointer(v249)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))+libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v252 = envPtr2 + 152 v251 = *(*uintptr)(unsafe.Pointer(v252)) *(*uintptr)(unsafe.Pointer(v252))++ *(*uint8)(unsafe.Pointer(v251)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)) + libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - (*(*int32)(unsafe.Pointer(bp + 4)) + int32(1)) } v253 = delta1 v254 = envPtr2 if v253 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v254)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v254)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v254)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v254)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v254 + 64)) += int64(v253) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v256 = envPtr2 + 152 v255 = *(*uintptr)(unsafe.Pointer(v256)) *(*uintptr)(unsafe.Pointer(v256))++ *(*uint8)(unsafe.Pointer(v255)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(24)) v258 = envPtr2 + 152 v257 = *(*uintptr)(unsafe.Pointer(v258)) *(*uintptr)(unsafe.Pointer(v258))++ *(*uint8)(unsafe.Pointer(v257)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(16)) v260 = envPtr2 + 152 v259 = *(*uintptr)(unsafe.Pointer(v260)) *(*uintptr)(unsafe.Pointer(v260))++ *(*uint8)(unsafe.Pointer(v259)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2)))) >> libc.Int32FromInt32(8)) v262 = envPtr2 + 152 v261 = *(*uintptr)(unsafe.Pointer(v262)) *(*uintptr)(unsafe.Pointer(v262))++ *(*uint8)(unsafe.Pointer(v261)) = uint8(libc.Uint32FromInt32(int32(int64(-libc.Int32FromInt32(2))))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v264 = envPtr2 + 152 v263 = *(*uintptr)(unsafe.Pointer(v264)) *(*uintptr)(unsafe.Pointer(v264))++ *(*uint8)(unsafe.Pointer(v263)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v266 = envPtr2 + 152 v265 = *(*uintptr)(unsafe.Pointer(v266)) *(*uintptr)(unsafe.Pointer(v266))++ *(*uint8)(unsafe.Pointer(v265)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v267 = delta1 v268 = envPtr2 if v267 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v268)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v268)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v268)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v268)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v268 + 64)) += int64(v267) } return TCL_OK } } goto genericReplace genericReplace: ; tokenPtr = valueTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v270 = envPtr2 + 152 v269 = *(*uintptr)(unsafe.Pointer(v270)) *(*uintptr)(unsafe.Pointer(v270))++ *(*uint8)(unsafe.Pointer(v269)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v272 = envPtr2 + 152 v271 = *(*uintptr)(unsafe.Pointer(v272)) *(*uintptr)(unsafe.Pointer(v272))++ *(*uint8)(unsafe.Pointer(v271)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v273 = delta1 v274 = envPtr2 if v273 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v274)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v274)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v274)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v274)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v274 + 64)) += int64(v273) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v276 = envPtr2 + 152 v275 = *(*uintptr)(unsafe.Pointer(v276)) *(*uintptr)(unsafe.Pointer(v276))++ *(*uint8)(unsafe.Pointer(v275)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v278 = envPtr2 + 152 v277 = *(*uintptr)(unsafe.Pointer(v278)) *(*uintptr)(unsafe.Pointer(v278))++ *(*uint8)(unsafe.Pointer(v277)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v280 = envPtr2 + 152 v279 = *(*uintptr)(unsafe.Pointer(v280)) *(*uintptr)(unsafe.Pointer(v280))++ *(*uint8)(unsafe.Pointer(v279)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v282 = envPtr2 + 152 v281 = *(*uintptr)(unsafe.Pointer(v282)) *(*uintptr)(unsafe.Pointer(v282))++ *(*uint8)(unsafe.Pointer(v281)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v284 = envPtr2 + 152 v283 = *(*uintptr)(unsafe.Pointer(v284)) *(*uintptr)(unsafe.Pointer(v284))++ *(*uint8)(unsafe.Pointer(v283)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v285 = delta1 v286 = envPtr2 if v285 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v286)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v286)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v286)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v286)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v286 + 64)) += int64(v285) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy6 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy6 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v288 = envPtr2 + 152 v287 = *(*uintptr)(unsafe.Pointer(v288)) *(*uintptr)(unsafe.Pointer(v288))++ *(*uint8)(unsafe.Pointer(v287)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v290 = envPtr2 + 152 v289 = *(*uintptr)(unsafe.Pointer(v290)) *(*uintptr)(unsafe.Pointer(v290))++ *(*uint8)(unsafe.Pointer(v289)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v291 = delta1 v292 = envPtr2 if v291 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v292)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v292)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v292)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v292)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v292 + 64)) += int64(v291) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v294 = envPtr2 + 152 v293 = *(*uintptr)(unsafe.Pointer(v294)) *(*uintptr)(unsafe.Pointer(v294))++ *(*uint8)(unsafe.Pointer(v293)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v296 = envPtr2 + 152 v295 = *(*uintptr)(unsafe.Pointer(v296)) *(*uintptr)(unsafe.Pointer(v296))++ *(*uint8)(unsafe.Pointer(v295)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(24)) v298 = envPtr2 + 152 v297 = *(*uintptr)(unsafe.Pointer(v298)) *(*uintptr)(unsafe.Pointer(v298))++ *(*uint8)(unsafe.Pointer(v297)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(16)) v300 = envPtr2 + 152 v299 = *(*uintptr)(unsafe.Pointer(v300)) *(*uintptr)(unsafe.Pointer(v300))++ *(*uint8)(unsafe.Pointer(v299)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(8)) v302 = envPtr2 + 152 v301 = *(*uintptr)(unsafe.Pointer(v302)) *(*uintptr)(unsafe.Pointer(v302))++ *(*uint8)(unsafe.Pointer(v301)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v303 = delta1 v304 = envPtr2 if v303 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v304)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v304)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v304)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v304)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v304 + 64)) += int64(v303) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(5) { tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy7 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy7 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v306 = envPtr2 + 152 v305 = *(*uintptr)(unsafe.Pointer(v306)) *(*uintptr)(unsafe.Pointer(v306))++ *(*uint8)(unsafe.Pointer(v305)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v308 = envPtr2 + 152 v307 = *(*uintptr)(unsafe.Pointer(v308)) *(*uintptr)(unsafe.Pointer(v308))++ *(*uint8)(unsafe.Pointer(v307)) = uint8(libc.Uint32FromInt32(_objIndexCopy7)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy7 } v309 = delta1 v310 = envPtr2 if v309 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v310)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v310)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v310)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v310)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v310 + 64)) += int64(v309) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v312 = envPtr2 + 152 v311 = *(*uintptr)(unsafe.Pointer(v312)) *(*uintptr)(unsafe.Pointer(v312))++ *(*uint8)(unsafe.Pointer(v311)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v314 = envPtr2 + 152 v313 = *(*uintptr)(unsafe.Pointer(v314)) *(*uintptr)(unsafe.Pointer(v314))++ *(*uint8)(unsafe.Pointer(v313)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(24)) v316 = envPtr2 + 152 v315 = *(*uintptr)(unsafe.Pointer(v316)) *(*uintptr)(unsafe.Pointer(v316))++ *(*uint8)(unsafe.Pointer(v315)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(16)) v318 = envPtr2 + 152 v317 = *(*uintptr)(unsafe.Pointer(v318)) *(*uintptr)(unsafe.Pointer(v318))++ *(*uint8)(unsafe.Pointer(v317)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(8)) v320 = envPtr2 + 152 v319 = *(*uintptr)(unsafe.Pointer(v320)) *(*uintptr)(unsafe.Pointer(v320))++ *(*uint8)(unsafe.Pointer(v319)) = uint8(libc.Uint32FromInt32(_objIndexCopy7)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy7 } v321 = delta1 v322 = envPtr2 if v321 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v322)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v322)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v322)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v322)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v322 + 64)) += int64(v321) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 4*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 4*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } } else { _objIndexCopy8 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy8 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v324 = envPtr2 + 152 v323 = *(*uintptr)(unsafe.Pointer(v324)) *(*uintptr)(unsafe.Pointer(v324))++ *(*uint8)(unsafe.Pointer(v323)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v326 = envPtr2 + 152 v325 = *(*uintptr)(unsafe.Pointer(v326)) *(*uintptr)(unsafe.Pointer(v326))++ *(*uint8)(unsafe.Pointer(v325)) = uint8(libc.Uint32FromInt32(_objIndexCopy8)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy8 } v327 = delta1 v328 = envPtr2 if v327 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v328)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v328)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v328)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v328)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v328 + 64)) += int64(v327) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v330 = envPtr2 + 152 v329 = *(*uintptr)(unsafe.Pointer(v330)) *(*uintptr)(unsafe.Pointer(v330))++ *(*uint8)(unsafe.Pointer(v329)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v332 = envPtr2 + 152 v331 = *(*uintptr)(unsafe.Pointer(v332)) *(*uintptr)(unsafe.Pointer(v332))++ *(*uint8)(unsafe.Pointer(v331)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(24)) v334 = envPtr2 + 152 v333 = *(*uintptr)(unsafe.Pointer(v334)) *(*uintptr)(unsafe.Pointer(v334))++ *(*uint8)(unsafe.Pointer(v333)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(16)) v336 = envPtr2 + 152 v335 = *(*uintptr)(unsafe.Pointer(v336)) *(*uintptr)(unsafe.Pointer(v336))++ *(*uint8)(unsafe.Pointer(v335)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(8)) v338 = envPtr2 + 152 v337 = *(*uintptr)(unsafe.Pointer(v338)) *(*uintptr)(unsafe.Pointer(v338))++ *(*uint8)(unsafe.Pointer(v337)) = uint8(libc.Uint32FromInt32(_objIndexCopy8)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy8 } v339 = delta1 v340 = envPtr2 if v339 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v340 + 64)) += int64(v339) } } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v342 = envPtr2 + 152 v341 = *(*uintptr)(unsafe.Pointer(v342)) *(*uintptr)(unsafe.Pointer(v342))++ *(*uint8)(unsafe.Pointer(v341)) = libc.Uint8FromInt32(int32(INST_STR_REPLACE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_REPLACE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v343 = delta1 v344 = envPtr2 if v343 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v344)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v344)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v344)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v344)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v344 + 64)) += int64(v343) } return TCL_OK } func XTclCompileStringTrimLCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1248 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, v17, v23, v35, v41, v5, v53, v57 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v54, v55, v56, v58, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) && (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(3) { tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } } else { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)), libc.Int64FromUint64(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)))), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_STR_TRIM_LEFT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_TRIM_LEFT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } return TCL_OK } func XTclCompileStringTrimRCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1275 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, v17, v23, v35, v41, v5, v53, v57 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v54, v55, v56, v58, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) && (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(3) { tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } } else { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)), libc.Int64FromUint64(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)))), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_STR_TRIM_RIGHT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_TRIM_RIGHT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } return TCL_OK } func XTclCompileStringTrimCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1302 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, v17, v23, v35, v41, v5, v53, v57 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v54, v55, v56, v58, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) && (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(3) { tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } } else { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)), libc.Int64FromUint64(libc.Xstrlen(tls, uintptr(unsafe.Pointer(&XtclDefaultTrimSet)))), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_STR_TRIM)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_TRIM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } return TCL_OK } func XTclCompileStringToUpperCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, v17, v21, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return XTclCompileBasic1To3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_STR_UPPER)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_UPPER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } return TCL_OK } func XTclCompileStringToLowerCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, v17, v21, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return XTclCompileBasic1To3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_STR_LOWER)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_LOWER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } return TCL_OK } func XTclCompileStringToTitleCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, v17, v21, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v22, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return XTclCompileBasic1To3ArgCmd(tls, interp, parsePtr, cmdPtr, envPtr2) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_STR_TITLE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_TITLE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v21 = delta1 v22 = envPtr2 if v21 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v22)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v22 + 64)) += int64(v21) } return TCL_OK } /* * Support definitions for the [string is] compilation. */ func _UniCharIsAscii1(tls *libc.TLS, character int32) (r int32) { return libc.BoolInt32(character >= 0 && character < int32(0x80)) } func _UniCharIsHexDigit1(tls *libc.TLS, character int32) (r int32) { return libc.BoolInt32(character >= 0 && character < int32(0x80) && libc.Xisxdigit(tls, libc.Int32FromUint8(libc.Uint8FromInt32(character))) != 0) } func init() { p := unsafe.Pointer(&XtclStringClassTable) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(XTcl_UniCharIsAlnum) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(XTcl_UniCharIsAlpha) *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_UniCharIsAscii1) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(XTcl_UniCharIsControl) *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(XTcl_UniCharIsDigit) *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(XTcl_UniCharIsGraph) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(XTcl_UniCharIsLower) *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(XTcl_UniCharIsPrint) *(*uintptr)(unsafe.Add(p, 136)) = __ccgo_fp(XTcl_UniCharIsPunct) *(*uintptr)(unsafe.Add(p, 152)) = __ccgo_fp(XTcl_UniCharIsSpace) *(*uintptr)(unsafe.Add(p, 168)) = __ccgo_fp(XTcl_UniCharIsUpper) *(*uintptr)(unsafe.Add(p, 184)) = __ccgo_fp(XTcl_UniCharIsWordChar) *(*uintptr)(unsafe.Add(p, 200)) = __ccgo_fp(_UniCharIsHexDigit1) } /* *---------------------------------------------------------------------- * * TclCompileSubstCmd -- * * Procedure called to compile the "subst" command. * * Results: * Returns TCL_OK for successful compile, or TCL_ERROR to defer * evaluation to runtime (either when it is too complex to get the * semantics right, or when we know for sure that it is an error but need * the error to happen at the right time). * * Side effects: * Instructions are added to envPtr to execute the "subst" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileSubstCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1450 uintptr, envPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var cachePtr, cachePtr1, mapPtr, objv, wordTokenPtr, v5 uintptr var code, numArgs, numOpts, objc, v3 int32 var eclIndex, v4 TTcl_Size var v2, v6 bool var _ /* flags at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, code, eclIndex, mapPtr, numArgs, numOpts, objc, objv, wordTokenPtr, v2, v3, v4, v5, v6 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ numArgs = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - int64(1)) numOpts = numArgs - int32(1) *(*int32)(unsafe.Pointer(bp)) = int32(TCL_SUBST_ALL) wordTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 code = int32(TCL_ERROR) if numArgs == 0 { return int32(TCL_ERROR) } objv = XTclStackAlloc(tls, interp, libc.Uint64FromInt32(numOpts)*uint64(8)) objc = 0 for { if !(objc < numOpts) { break } if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FrefCount++ if !(XTclWordKnownAtCompileTime(tls, wordTokenPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) != 0) { objc++ goto cleanup } wordTokenPtr = wordTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; objc++ } /* if (TclSubstOptions(NULL, numOpts, objv, &flags) == TCL_OK) { toSubst = objv[numOpts]; Tcl_IncrRefCount(toSubst); } */ /* TODO: Figure out expansion to cover WordKnownAtCompileTime * The difficulty is that WKACT makes a copy, and if TclSubstParse * below parses the copy of the original source string, some deep * parts of the compile machinery get upset. They want all pointers * stored in Tcl_Tokens to point back to the same original string. */ if (*TTcl_Token)(unsafe.Pointer(wordTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { code = XTclSubstOptions(tls, libc.UintptrFromInt32(0), int64(numOpts), objv, bp) } goto cleanup cleanup: ; for { objc-- v3 = objc if !(v3 >= 0) { break } v5 = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if !(v4 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)))).Flength = int64(-libc.Int32FromInt32(1)) if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8)) (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc)*8))) } } } XTclStackFree(tls, interp, objv) if code != TCL_OK { return int32(TCL_ERROR) } (*TCompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(numArgs)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(numArgs)*8)) XTclSubstCompile(tls, interp, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(wordTokenPtr + 1*32))).Fsize, *(*int32)(unsafe.Pointer(bp)), *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(numArgs)*8)), envPtr) /* TclDecrRefCount(toSubst);*/ return TCL_OK } func XTclSubstCompile(tls *libc.TLS, interp uintptr, bytes uintptr, numBytes TTcl_Size, flags int32, line TTcl_Size, envPtr2 uintptr) { bp := tls.Alloc(896) defer tls.Free(896) var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, breakJump, breakOffset, catchRange, count, delta1, foundCommand, literal, v102, v106, v110, v114, v118, v122, v126, v128, v132, v136, v148, v154, v156, v160, v164, v166, v17, v178, v182, v188, v194, v200, v202, v24, v36, v42, v5, v54, v61, v67, v79, v91, v96, v98 int32 var endTokenPtr, tokenPtr, v1, v10, v100, v101, v103, v104, v105, v107, v108, v109, v11, v111, v112, v113, v115, v116, v117, v119, v12, v120, v121, v123, v124, v125, v127, v129, v13, v130, v131, v133, v134, v135, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v149, v15, v150, v151, v152, v153, v155, v157, v158, v159, v16, v161, v162, v163, v165, v167, v168, v169, v170, v171, v172, v173, v174, v175, v176, v177, v179, v18, v180, v181, v183, v184, v185, v186, v187, v189, v190, v191, v192, v193, v195, v196, v197, v198, v199, v2, v20, v201, v203, v21, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v55, v57, v58, v59, v6, v60, v62, v63, v64, v65, v66, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v92, v94, v95, v97, v99 uintptr var i1, length TTcl_Size var v93 int64 var _ /* bline at bp+0 */ TTcl_Size var _ /* breakFixup at bp+812 */ TJumpFixup var _ /* buf at bp+760 */ [4]uint8 var _ /* continueFixup at bp+828 */ TJumpFixup var _ /* endFixup at bp+860 */ TJumpFixup var _ /* okFixup at bp+780 */ TJumpFixup var _ /* otherFixup at bp+844 */ TJumpFixup var _ /* parse at bp+8 */ TTcl_Parse var _ /* returnFixup at bp+796 */ TJumpFixup var _ /* startFixup at bp+764 */ TJumpFixup var _ /* state at bp+752 */ TTcl_InterpState _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, breakJump, breakOffset, catchRange, count, delta1, endTokenPtr, foundCommand, i1, length, literal, tokenPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 breakOffset = 0 count = 0 *(*TTcl_Size)(unsafe.Pointer(bp)) = line *(*TTcl_InterpState)(unsafe.Pointer(bp + 752)) = libc.UintptrFromInt32(0) XTclSubstParse(tls, interp, bytes, numBytes, flags, bp+8, bp+752) if *(*TTcl_InterpState)(unsafe.Pointer(bp + 752)) != libc.UintptrFromInt32(0) { XTcl_ResetResult(tls, interp) } /* * Tricky point! If the first token does not result in a *guaranteed* push * of a Tcl_Obj on the stack, we must push an empty object. Otherwise it * is possible to get to an INST_STR_CONCAT1 or INST_DONE without enough * values on the stack, resulting in a crash. Thanks to Joe Mistachkin for * identifying a script that could trigger this case. */ tokenPtr = (*(*TTcl_Parse)(unsafe.Pointer(bp + 8))).FtokenPtr if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_TEXT) && (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_BS) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } count++ } endTokenPtr = tokenPtr + uintptr((*(*TTcl_Parse)(unsafe.Pointer(bp + 8))).FnumTokens)*32 for { if !(tokenPtr < endTokenPtr) { break } *(*[4]uint8)(unsafe.Pointer(bp + 760)) = [4]uint8{} switch (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 { case int32(TCL_TOKEN_TEXT): literal = XTclRegisterLiteral(tls, envPtr2, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, 0) _objIndexCopy1 = literal if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } XTclAdvanceLines(tls, bp, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize)) count++ goto _19 case int32(TCL_TOKEN_BS): length = int64(XTclParseBackslash(tls, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, libc.UintptrFromInt32(0), bp+760)) literal = XTclRegisterLiteral(tls, envPtr2, bp+760, length, 0) _objIndexCopy2 = literal if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v54 = delta1 v55 = envPtr2 if v54 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v55 + 64)) += int64(v54) } } count++ goto _19 case int32(TCL_TOKEN_VARIABLE): /* * Check for simple variable access; see if we can only generate * TCL_OK or TCL_ERROR from the substituted variable read; if so, * there is no need to generate elaborate exception-management * code. Note that the first component of TCL_TOKEN_VARIABLE is * always TCL_TOKEN_TEXT... */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents > int64(1) { foundCommand = 0 i1 = int64(2) for { if !(i1 <= (*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents) { break } if (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + uintptr(i1)*32))).Ftype1 == int32(TCL_TOKEN_COMMAND) { foundCommand = int32(1) break } goto _56 _56: ; i1++ } if foundCommand != 0 { break } } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer(bp)) XTclCompileVarSubst(tls, interp, tokenPtr, envPtr2) *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline count++ goto _19 } for count > int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(255))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(255) } v61 = delta1 v62 = envPtr2 if v61 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v62 + 64)) += int64(v61) } count -= int32(254) } if count > int32(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(count)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - count } v67 = delta1 v68 = envPtr2 if v67 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v68 + 64)) += int64(v67) } count = int32(1) } if breakOffset == 0 { /* Jump to the start (jump over the jump to end) */ XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp+764) /* Jump to the end (all BREAKs land here) */ breakOffset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v79 = delta1 v80 = envPtr2 if v79 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v80)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v80)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v80)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v80)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v80 + 64)) += int64(v79) } /* Start */ if XTclFixupForwardJump(tls, envPtr2, bp+764, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp+764)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+21876, libc.VaList(bp+888, int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp + 764))).FcodeOffset))) } } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer(bp)) catchRange = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(catchRange) >> libc.Int32FromInt32(24)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(catchRange) >> libc.Int32FromInt32(16)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(catchRange) >> libc.Int32FromInt32(8)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(catchRange)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - catchRange } v91 = delta1 v92 = envPtr2 if v91 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v92 + 64)) += int64(v91) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v93 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v93 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v93 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(catchRange)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) switch (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 { case int32(TCL_TOKEN_COMMAND): XTclCompileScript(tls, interp, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr(1), (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize-int64(2), envPtr2) count++ case int32(TCL_TOKEN_VARIABLE): XTclCompileVarSubst(tls, interp, tokenPtr, envPtr2) count++ default: XTcl_Panic(tls, __ccgo_ts+21924, libc.VaList(bp+888, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1)) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(catchRange)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(catchRange)*56))).FcodeOffset)) /* Substitution produced TCL_OK */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v95 = envPtr2 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v96 = delta1 v97 = envPtr2 if v96 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v97)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v97)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v97)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v97)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v97 + 64)) += int64(v96) } XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp+780) v98 = -int32(1) v99 = envPtr2 if v98 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v99)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v99)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v99)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v99)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v99 + 64)) += int64(v98) /* Exceptional return codes processed here */ (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(catchRange)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v101 = envPtr2 + 152 v100 = *(*uintptr)(unsafe.Pointer(v101)) *(*uintptr)(unsafe.Pointer(v101))++ *(*uint8)(unsafe.Pointer(v100)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v102 = delta1 v103 = envPtr2 if v102 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v103)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v103)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v103)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v103)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v103 + 64)) += int64(v102) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v106 = delta1 v107 = envPtr2 if v106 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v107)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v107)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v107)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v107)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v107 + 64)) += int64(v106) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v110 = delta1 v111 = envPtr2 if v110 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v111)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v111)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v111)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v111)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v111 + 64)) += int64(v110) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v113 = envPtr2 + 152 v112 = *(*uintptr)(unsafe.Pointer(v113)) *(*uintptr)(unsafe.Pointer(v113))++ *(*uint8)(unsafe.Pointer(v112)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v114 = delta1 v115 = envPtr2 if v114 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v115)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v115)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v115)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v115)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v115 + 64)) += int64(v114) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = libc.Uint8FromInt32(int32(INST_RETURN_CODE_BRANCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RETURN_CODE_BRANCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v118 = delta1 v119 = envPtr2 if v118 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v119)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v119)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v119)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v119)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v119 + 64)) += int64(v118) } /* ERROR -> reraise it; NB: can't require BREAK/CONTINUE handling */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = libc.Uint8FromInt32(int32(INST_RETURN_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RETURN_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v122 = delta1 v123 = envPtr2 if v122 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v123)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v123)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v123)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v123)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v123 + 64)) += int64(v122) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v125 = envPtr2 + 152 v124 = *(*uintptr)(unsafe.Pointer(v125)) *(*uintptr)(unsafe.Pointer(v125))++ *(*uint8)(unsafe.Pointer(v124)) = libc.Uint8FromInt32(int32(INST_NOP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NOP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v126 = delta1 v127 = envPtr2 if v126 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v127)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v127)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v127)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v127)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v127 + 64)) += int64(v126) } /* RETURN */ XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp+796) /* BREAK */ XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp+812) /* CONTINUE */ XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp+828) /* OTHER */ XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp+844) v128 = int32(1) v129 = envPtr2 if v128 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v129)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v129)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v129)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v129)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v129 + 64)) += int64(v128) /* BREAK destination */ if XTclFixupForwardJump(tls, envPtr2, bp+812, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp+812)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+21972, libc.VaList(bp+888, int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp + 812))).FcodeOffset))) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v132 = delta1 v133 = envPtr2 if v132 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v133)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v133)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v133)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v133)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v133 + 64)) += int64(v132) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v135 = envPtr2 + 152 v134 = *(*uintptr)(unsafe.Pointer(v135)) *(*uintptr)(unsafe.Pointer(v135))++ *(*uint8)(unsafe.Pointer(v134)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v136 = delta1 v137 = envPtr2 if v136 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v137 + 64)) += int64(v136) } breakJump = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(breakOffset)) if breakJump > int32(127) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v141 = envPtr2 + 152 v140 = *(*uintptr)(unsafe.Pointer(v141)) *(*uintptr)(unsafe.Pointer(v141))++ *(*uint8)(unsafe.Pointer(v140)) = uint8(libc.Uint32FromInt32(-breakJump) >> libc.Int32FromInt32(24)) v143 = envPtr2 + 152 v142 = *(*uintptr)(unsafe.Pointer(v143)) *(*uintptr)(unsafe.Pointer(v143))++ *(*uint8)(unsafe.Pointer(v142)) = uint8(libc.Uint32FromInt32(-breakJump) >> libc.Int32FromInt32(16)) v145 = envPtr2 + 152 v144 = *(*uintptr)(unsafe.Pointer(v145)) *(*uintptr)(unsafe.Pointer(v145))++ *(*uint8)(unsafe.Pointer(v144)) = uint8(libc.Uint32FromInt32(-breakJump) >> libc.Int32FromInt32(8)) v147 = envPtr2 + 152 v146 = *(*uintptr)(unsafe.Pointer(v147)) *(*uintptr)(unsafe.Pointer(v147))++ *(*uint8)(unsafe.Pointer(v146)) = uint8(libc.Uint32FromInt32(-breakJump)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - -breakJump } v148 = delta1 v149 = envPtr2 if v148 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v149)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v149)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v149)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v149)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v149 + 64)) += int64(v148) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v151 = envPtr2 + 152 v150 = *(*uintptr)(unsafe.Pointer(v151)) *(*uintptr)(unsafe.Pointer(v151))++ *(*uint8)(unsafe.Pointer(v150)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v153 = envPtr2 + 152 v152 = *(*uintptr)(unsafe.Pointer(v153)) *(*uintptr)(unsafe.Pointer(v153))++ *(*uint8)(unsafe.Pointer(v152)) = uint8(libc.Uint32FromInt32(-breakJump)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - -breakJump } v154 = delta1 v155 = envPtr2 if v154 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v155)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v155)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v155)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v155)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v155 + 64)) += int64(v154) } } v156 = int32(2) v157 = envPtr2 if v156 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v157)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v157)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v157)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v157)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v157 + 64)) += int64(v156) /* CONTINUE destination */ if XTclFixupForwardJump(tls, envPtr2, bp+828, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp+828)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+22020, libc.VaList(bp+888, int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp + 828))).FcodeOffset))) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v159 = envPtr2 + 152 v158 = *(*uintptr)(unsafe.Pointer(v159)) *(*uintptr)(unsafe.Pointer(v159))++ *(*uint8)(unsafe.Pointer(v158)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v160 = delta1 v161 = envPtr2 if v160 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v161)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v161)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v161)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v161)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v161 + 64)) += int64(v160) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v163 = envPtr2 + 152 v162 = *(*uintptr)(unsafe.Pointer(v163)) *(*uintptr)(unsafe.Pointer(v163))++ *(*uint8)(unsafe.Pointer(v162)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v164 = delta1 v165 = envPtr2 if v164 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v165)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v165)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v165)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v165)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v165 + 64)) += int64(v164) } XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp+860) v166 = int32(2) v167 = envPtr2 if v166 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v167)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v167)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v167)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v167)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v167 + 64)) += int64(v166) /* RETURN + other destination */ if XTclFixupForwardJump(tls, envPtr2, bp+796, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp+796)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+22071, libc.VaList(bp+888, int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp + 796))).FcodeOffset))) } if XTclFixupForwardJump(tls, envPtr2, bp+844, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp+844)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+22120, libc.VaList(bp+888, int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp + 844))).FcodeOffset))) } /* * Pull the result to top of stack, discard options dict. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v169 = envPtr2 + 152 v168 = *(*uintptr)(unsafe.Pointer(v169)) *(*uintptr)(unsafe.Pointer(v169))++ *(*uint8)(unsafe.Pointer(v168)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v171 = envPtr2 + 152 v170 = *(*uintptr)(unsafe.Pointer(v171)) *(*uintptr)(unsafe.Pointer(v171))++ *(*uint8)(unsafe.Pointer(v170)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v173 = envPtr2 + 152 v172 = *(*uintptr)(unsafe.Pointer(v173)) *(*uintptr)(unsafe.Pointer(v173))++ *(*uint8)(unsafe.Pointer(v172)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v175 = envPtr2 + 152 v174 = *(*uintptr)(unsafe.Pointer(v175)) *(*uintptr)(unsafe.Pointer(v175))++ *(*uint8)(unsafe.Pointer(v174)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v177 = envPtr2 + 152 v176 = *(*uintptr)(unsafe.Pointer(v177)) *(*uintptr)(unsafe.Pointer(v177))++ *(*uint8)(unsafe.Pointer(v176)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v178 = delta1 v179 = envPtr2 if v178 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v179)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v179)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v179)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v179)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v179 + 64)) += int64(v178) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v181 = envPtr2 + 152 v180 = *(*uintptr)(unsafe.Pointer(v181)) *(*uintptr)(unsafe.Pointer(v181))++ *(*uint8)(unsafe.Pointer(v180)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v182 = delta1 v183 = envPtr2 if v182 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v183)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v183)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v183)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v183)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v183 + 64)) += int64(v182) } /* OK destination */ if XTclFixupForwardJump(tls, envPtr2, bp+780, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp+780)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+22168, libc.VaList(bp+888, int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp + 780))).FcodeOffset))) } if count > int32(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v185 = envPtr2 + 152 v184 = *(*uintptr)(unsafe.Pointer(v185)) *(*uintptr)(unsafe.Pointer(v185))++ *(*uint8)(unsafe.Pointer(v184)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v187 = envPtr2 + 152 v186 = *(*uintptr)(unsafe.Pointer(v187)) *(*uintptr)(unsafe.Pointer(v187))++ *(*uint8)(unsafe.Pointer(v186)) = uint8(libc.Uint32FromInt32(count)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - count } v188 = delta1 v189 = envPtr2 if v188 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v189)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v189)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v189)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v189)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v189 + 64)) += int64(v188) } count = int32(1) } /* CONTINUE jump to here */ if XTclFixupForwardJump(tls, envPtr2, bp+860, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp+860)).FcodeOffset))), int32(127)) != 0 { XTcl_Panic(tls, __ccgo_ts+22213, libc.VaList(bp+888, int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-libc.Int64FromUint32((*(*TJumpFixup)(unsafe.Pointer(bp + 860))).FcodeOffset))) } *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline goto _19 _19: ; tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } for count > int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v191 = envPtr2 + 152 v190 = *(*uintptr)(unsafe.Pointer(v191)) *(*uintptr)(unsafe.Pointer(v191))++ *(*uint8)(unsafe.Pointer(v190)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v193 = envPtr2 + 152 v192 = *(*uintptr)(unsafe.Pointer(v193)) *(*uintptr)(unsafe.Pointer(v193))++ *(*uint8)(unsafe.Pointer(v192)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(255))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(255) } v194 = delta1 v195 = envPtr2 if v194 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v195)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v195)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v195)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v195)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v195 + 64)) += int64(v194) } count -= int32(254) } if count > int32(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v197 = envPtr2 + 152 v196 = *(*uintptr)(unsafe.Pointer(v197)) *(*uintptr)(unsafe.Pointer(v197))++ *(*uint8)(unsafe.Pointer(v196)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v199 = envPtr2 + 152 v198 = *(*uintptr)(unsafe.Pointer(v199)) *(*uintptr)(unsafe.Pointer(v199))++ *(*uint8)(unsafe.Pointer(v198)) = uint8(libc.Uint32FromInt32(count)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - count } v200 = delta1 v201 = envPtr2 if v200 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v201)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v201)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v201)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v201)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v201 + 64)) += int64(v200) } } XTcl_FreeParse(tls, bp+8) if *(*TTcl_InterpState)(unsafe.Pointer(bp + 752)) != libc.UintptrFromInt32(0) { XTcl_RestoreInterpState(tls, interp, *(*TTcl_InterpState)(unsafe.Pointer(bp + 752))) XTclCompileSyntaxError(tls, interp, envPtr2) v202 = -int32(1) v203 = envPtr2 if v202 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v203)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v203)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v203)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v203)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v203 + 64)) += int64(v202) } /* Final target of the multi-jump from all BREAKs */ if breakOffset > 0 { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(breakOffset))) = libc.Uint8FromInt32(int32(INST_JUMP4)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(breakOffset) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(breakOffset)) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(breakOffset) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(breakOffset)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(breakOffset) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(breakOffset)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(breakOffset) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(breakOffset))) } } /* *---------------------------------------------------------------------- * * TclCompileSwitchCmd -- * * Procedure called to compile the "switch" command. * * Results: * Returns TCL_OK for successful compile, or TCL_ERROR to defer * evaluation to runtime (either when it is too complex to get the * semantics right, or when we know for sure that it is an error but need * the error to happen at the right time). * * Side effects: * Instructions are added to envPtr to execute the "switch" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileSwitchCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy1785 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Holds resulting instructions. */ var _objIndexCopy, delta1, foundMode, i1, mode, noCase, numWords, result, valueIndex, v10, v22 int32 var bodyContLines, bodyLines, bodyToken, bodyTokenArray, chrs, mapPtr, prevBytes, tokenPtr, valueTokenPtr, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v23, v6, v7, v8, v9 uintptr var eclIndex, maxLen, numBytes TTcl_Size var size Tsize_t var _ /* bline at bp+16 */ TTcl_Size var _ /* bytes at bp+8 */ uintptr var _ /* clNext at bp+0 */ uintptr var _ /* literal at bp+24 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, bodyContLines, bodyLines, bodyToken, bodyTokenArray, chrs, delta1, eclIndex, foundMode, i1, mapPtr, maxLen, mode, noCase, numBytes, numWords, prevBytes, result, size, tokenPtr, valueIndex, valueTokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* Has the -nocase flag been given? */ foundMode = 0 result = int32(TCL_ERROR) *(*uintptr)(unsafe.Pointer(bp)) = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext /* * Only handle the following versions: * switch ?--? word {pattern body ...} * switch -exact ?--? word {pattern body ...} * switch -glob ?--? word {pattern body ...} * switch -regexp ?--? word {pattern body ...} * switch -- word simpleWordPattern simpleWordBody ... * switch -exact -- word simpleWordPattern simpleWordBody ... * switch -glob -- word simpleWordPattern simpleWordBody ... * switch -regexp -- word simpleWordPattern simpleWordBody ... * When the mode is -glob, can also handle a -nocase flag. * * First off, we don't care how the command's word was generated; we're * compiling it anyway! So skip it... */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 valueIndex = int32(1) numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords - int64(1)) /* * Check for options. */ noCase = 0 mode = 0 if numWords == int32(2) { /* * There's just the switch value and the bodies list. In that case, we * can skip all option parsing and move on to consider switch values * and the body list. */ goto finishedOptionParse } /* * There must be at least one option, --, because without that there is no * way to statically avoid the problems you get from strings-to-be-matched * that start with a - (the interpreted code falls apart if it encounters * them, so we punt if we *might* encounter them as that is the easiest * way of emulating the behaviour). */ for { if !(numWords >= int32(3)) { break } size = libc.Uint64FromInt64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize) chrs = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart /* * We only process literal options, and we assume that -e, -g and -n * are unique prefixes of -exact, -glob and -nocase respectively (true * at time of writing). Note that -exact and -glob may only be given * at most once or we bail out (error case). */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || size < uint64(2) { return int32(TCL_ERROR) } if size <= uint64(6) && !(libc.Xmemcmp(tls, chrs, __ccgo_ts+17506, size) != 0) { if foundMode != 0 { return int32(TCL_ERROR) } mode = 0 foundMode = int32(1) valueIndex++ goto _1 } else { if size <= uint64(5) && !(libc.Xmemcmp(tls, chrs, __ccgo_ts+17513, size) != 0) { if foundMode != 0 { return int32(TCL_ERROR) } mode = 1 foundMode = int32(1) valueIndex++ goto _1 } else { if size <= uint64(7) && !(libc.Xmemcmp(tls, chrs, __ccgo_ts+17574, size) != 0) { if foundMode != 0 { return int32(TCL_ERROR) } mode = 2 foundMode = int32(1) valueIndex++ goto _1 } else { if size <= uint64(7) && !(libc.Xmemcmp(tls, chrs, __ccgo_ts+17555, size) != 0) { noCase = int32(1) valueIndex++ goto _1 } else { if size == uint64(2) && !(libc.Xmemcmp(tls, chrs, __ccgo_ts+18684, uint64(2)) != 0) { valueIndex++ break } } } } } /* * The switch command has many flags we cannot compile at all (e.g. * all the RE-related ones) which we must have encountered. Either * that or we have run off the end. The action here is the same: punt * to interpreted version. */ return int32(TCL_ERROR) goto _1 _1: ; tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 numWords-- } if numWords < int32(3) { return int32(TCL_ERROR) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 numWords-- if noCase != 0 && mode == 0 { /* * Can't compile this case; no opcode for case-insensitive equality! */ return int32(TCL_ERROR) } /* * The value to test against is going to always get pushed on the stack. * But not yet; we need to verify that the rest of the command is * compilable too. */ goto finishedOptionParse finishedOptionParse: ; valueTokenPtr = tokenPtr /* For valueIndex, see previous loop. */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 numWords-- /* * Build an array of tokens for the matcher terms and script bodies. Note * that in the case of the quoted bodies, this is tricky as we cannot use * copies of the string from the input token for the generated tokens (it * causes a crash during exception handling). When multiple tokens are * available at this point, this is pretty easy. */ if !(numWords == int32(1)) { goto _2 } /* TIP #280: line of the pattern/action list, * and start of list for when tracking the * location. This list comes immediately after * the value we switch on. */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart numBytes = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize /* Allocate enough space to work in. */ maxLen = XTclMaxListLength(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), numBytes, libc.UintptrFromInt32(0)) if maxLen < int64(2) { return int32(TCL_ERROR) } bodyTokenArray = XTcl_Alloc(tls, uint64(32)*libc.Uint64FromInt64(maxLen)) bodyToken = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt64(maxLen)) bodyLines = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt64(maxLen)) bodyContLines = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt64(maxLen)) *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(valueIndex+int32(1))*8)) numWords = 0 for numBytes > 0 { prevBytes = *(*uintptr)(unsafe.Pointer(bp + 8)) if TCL_OK != XTclFindElement(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), numBytes, bodyTokenArray+uintptr(numWords)*32+8, bp+8, bodyTokenArray+uintptr(numWords)*32+16, bp+24) || !(*(*int32)(unsafe.Pointer(bp + 24)) != 0) { goto abort } (*(*TTcl_Token)(unsafe.Pointer(bodyTokenArray + uintptr(numWords)*32))).Ftype1 = int32(TCL_TOKEN_TEXT) (*(*TTcl_Token)(unsafe.Pointer(bodyTokenArray + uintptr(numWords)*32))).FnumComponents = 0 *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numWords)*8)) = bodyTokenArray + uintptr(numWords)*32 /* * TIP #280: Now determine the line the list element starts on * (there is no need to do it earlier, due to the possibility of * aborting, see above). */ XTclAdvanceLines(tls, bp+16, prevBytes, (*(*TTcl_Token)(unsafe.Pointer(bodyTokenArray + uintptr(numWords)*32))).Fstart) XTclAdvanceContinuations(tls, bp+16, bp, int32(int64((*(*TTcl_Token)(unsafe.Pointer(bodyTokenArray + uintptr(numWords)*32))).Fstart)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).Fsource))) *(*TTcl_Size)(unsafe.Pointer(bodyLines + uintptr(numWords)*8)) = *(*TTcl_Size)(unsafe.Pointer(bp + 16)) *(*uintptr)(unsafe.Pointer(bodyContLines + uintptr(numWords)*8)) = *(*uintptr)(unsafe.Pointer(bp)) XTclAdvanceLines(tls, bp+16, (*(*TTcl_Token)(unsafe.Pointer(bodyTokenArray + uintptr(numWords)*32))).Fstart, *(*uintptr)(unsafe.Pointer(bp + 8))) XTclAdvanceContinuations(tls, bp+16, bp, int32(int64(*(*uintptr)(unsafe.Pointer(bp + 8)))-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).Fsource))) numBytes -= int64(*(*uintptr)(unsafe.Pointer(bp + 8))) - int64(prevBytes) numWords++ } if !(numWords%int32(2) != 0) { goto _4 } goto abort abort: ; XTclpFree(tls, bodyToken) XTclpFree(tls, bodyTokenArray) XTclpFree(tls, bodyLines) XTclpFree(tls, bodyContLines) return int32(TCL_ERROR) _4: ; goto _3 _2: ; if numWords%int32(2) != 0 || numWords == 0 { /* * Odd number of words (>1) available, or no words at all available. * Both are error cases, so punt and let the interpreted-version * generate the error message. Note that the second case probably * should get caught earlier, but it's easy to check here again anyway * because it'd cause a nasty crash otherwise. */ return int32(TCL_ERROR) } else { /* * Multi-word definition of patterns & actions. */ bodyToken = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt32(numWords)) bodyLines = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt32(numWords)) bodyContLines = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt32(numWords)) bodyTokenArray = libc.UintptrFromInt32(0) i1 = 0 for { if !(i1 < numWords) { break } /* * We only handle the very simplest case. Anything more complex is * a good reason to go to the interpreted case anyway due to * traces, etc. */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { goto freeTemporaries } *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)) = tokenPtr + uintptr(1)*32 /* * TIP #280: Copy line information from regular cmd info. */ *(*TTcl_Size)(unsafe.Pointer(bodyLines + uintptr(i1)*8)) = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(valueIndex+int32(1)+i1)*8)) *(*uintptr)(unsafe.Pointer(bodyContLines + uintptr(i1)*8)) = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(valueIndex+int32(1)+i1)*8)) tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _5 _5: ; i1++ } } _3: ; /* * Fall back to interpreted if the last body is a continuation (it's * illegal, but this makes the error happen at the right time). */ if (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numWords-int32(1))*8)))).Fsize == int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numWords-int32(1))*8)))).Fstart))) == int32('-') { goto freeTemporaries } /* * Now we commit to generating code; the parsing stage per se is done. * Check if we can generate a jump table, since if so that's faster than * doing an explicit compare with each body. Note that we're definitely * over-conservative with determining whether we can do the jump table, * but it handles the most common case well enough. */ /* Both methods push the value to match against onto the stack. */ if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v10 = delta1 v11 = envPtr2 if v10 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v11 + 64)) += int64(v10) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(valueIndex)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(valueIndex)*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } if mode == 0 { _IssueSwitchJumpTable(tls, interp, envPtr2, numWords, bodyToken, bodyLines, bodyContLines) } else { _IssueSwitchChainedTests(tls, interp, envPtr2, mode, noCase, int64(numWords), bodyToken, bodyLines, bodyContLines) } result = TCL_OK /* * Clean up all our temporary space and return. */ goto freeTemporaries freeTemporaries: ; XTclpFree(tls, bodyToken) XTclpFree(tls, bodyLines) XTclpFree(tls, bodyContLines) if bodyTokenArray != libc.UintptrFromInt32(0) { XTclpFree(tls, bodyTokenArray) } return result } /* *---------------------------------------------------------------------- * * IssueSwitchChainedTests -- * * Generate instructions for a [switch] command that is to be compiled * into a sequence of tests. This is the generic handle-everything mode * that inherently has performance that is (on average) linear in the * number of tests. It is the only mode that can handle -glob and -regexp * matches, or anything that is case-insensitive. It does not handle the * wild-and-wooly end of regexp matching (i.e., capture of match results) * so that's when we spill to the interpreted version. * *---------------------------------------------------------------------- */ func _IssueSwitchChainedTests(tls *libc.TLS, interp uintptr, envPtr2 uintptr, mode int32, noCase int32, numBodyTokens TTcl_Size, bodyToken uintptr, bodyLines uintptr, bodyContLines uintptr) { bp := tls.Alloc(256) defer tls.Free(256) /* Array of continuation line info. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, cflags, contFixCount, contFixIndex, delta1, fixupCount, foundDefault, i1, j, j1, nextArmFixupIndex, simple, v100, v105, v109, v115, v12, v127, v16, v28, v34, v36, v41, v53, v59, v71, v83, v85, v90, v94 int32 var fixupArray, fixupTargetArray, v10, v101, v103, v104, v106, v107, v108, v11, v110, v111, v112, v113, v114, v116, v117, v118, v119, v120, v121, v122, v123, v124, v125, v126, v128, v13, v14, v15, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v29, v30, v31, v32, v33, v35, v37, v38, v39, v40, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v54, v55, v56, v57, v58, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v70, v72, v73, v74, v75, v76, v77, v78, v79, v80, v81, v82, v84, v86, v87, v88, v89, v91, v92, v93, v95, v96, v97, v98, v99 uintptr var _ /* ds at bp+8 */ TTcl_DString var _ /* exact at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, cflags, contFixCount, contFixIndex, delta1, fixupArray, fixupCount, fixupTargetArray, foundDefault, i1, j, j1, nextArmFixupIndex, simple, v10, v100, v101, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 /* * Generate a test for each arm. */ contFixIndex = -int32(1) contFixCount = 0 fixupArray = XTclStackAlloc(tls, interp, uint64(16)*libc.Uint64FromInt64(numBodyTokens)) fixupTargetArray = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt64(numBodyTokens)) libc.Xmemset(tls, fixupTargetArray, 0, libc.Uint64FromInt64(numBodyTokens)*uint64(4)) fixupCount = 0 foundDefault = 0 i1 = 0 for { if !(int64(i1) < numBodyTokens) { break } nextArmFixupIndex = -int32(1) if int64(i1) != numBodyTokens-int64(2) || (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numBodyTokens-int64(2))*8)))).Fsize != int64(7) || libc.Xmemcmp(tls, (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numBodyTokens-int64(2))*8)))).Fstart, __ccgo_ts+16043, uint64(7)) != 0 { /* * Generate the test for the arm. */ switch mode { case 0: goto _2 case 1: goto _3 case 2: goto _4 default: goto _5 } goto _6 _2: ; _9: ; if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v12 = delta1 v13 = envPtr2 if v12 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v13 + 64)) += int64(v12) } goto _8 _8: ; if 0 != 0 { goto _9 } goto _7 _7: ; XTclCompileTokens(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)), uint64(1), envPtr2) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v16 = delta1 v17 = envPtr2 if v16 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v17)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v17)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v17)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v17)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v17 + 64)) += int64(v16) } goto _6 _3: ; XTclCompileTokens(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)), uint64(1), envPtr2) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = libc.Uint8FromInt32(int32(INST_OVER)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v28 = delta1 v29 = envPtr2 if v28 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v29 + 64)) += int64(v28) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = libc.Uint8FromInt32(int32(INST_STR_MATCH)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(noCase)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_MATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - noCase } v34 = delta1 v35 = envPtr2 if v34 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v35 + 64)) += int64(v34) } goto _6 _4: ; v36 = libc.Int32FromInt32(0) *(*int32)(unsafe.Pointer(bp)) = v36 simple = v36 /* * Keep in sync with TclCompileRegexpCmd. */ if (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)))).Ftype1 == int32(TCL_TOKEN_TEXT) { if (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)))).Fsize == 0 { /* * The semantics of regexps are that they always match * when the RE == "". */ _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } goto _6 } /* * Attempt to convert pattern to glob. If successful, push * the converted pattern. */ if XTclReToGlob(tls, libc.UintptrFromInt32(0), (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)))).Fstart, (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)))).Fsize, bp+8, bp, libc.UintptrFromInt32(0)) == TCL_OK { simple = int32(1) _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*TTcl_DString)(unsafe.Pointer(bp+8)).Fstring1, (*TTcl_DString)(unsafe.Pointer(bp+8)).Flength, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v59 = delta1 v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v71 = delta1 v72 = envPtr2 if v71 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v72 + 64)) += int64(v71) } } XTcl_DStringFree(tls, bp+8) } } if !(simple != 0) { XTclCompileTokens(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)), uint64(1), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = libc.Uint8FromInt32(int32(INST_OVER)) v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v83 = delta1 v84 = envPtr2 if v83 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v84 + 64)) += int64(v83) } if !(simple != 0) { if noCase != 0 { v85 = int32(TCL_REG_NOCASE) } else { v85 = 0 } /* * Pass correct RE compile flags. We use only Int1 * (8-bit), but that handles all the flags we want to * pass. Don't use TCL_REG_NOSUB as we may have backrefs * or capture vars. */ cflags = int32(TCL_REG_ADVANCED) | v85 if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = libc.Uint8FromInt32(int32(INST_REGEXP)) v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = uint8(libc.Uint32FromInt32(cflags)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REGEXP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - cflags } v90 = delta1 v91 = envPtr2 if v90 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v91)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v91)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v91)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v91)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v91 + 64)) += int64(v90) } } else { if *(*int32)(unsafe.Pointer(bp)) != 0 && !(noCase != 0) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v93 = envPtr2 + 152 v92 = *(*uintptr)(unsafe.Pointer(v93)) *(*uintptr)(unsafe.Pointer(v93))++ *(*uint8)(unsafe.Pointer(v92)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v94 = delta1 v95 = envPtr2 if v94 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v95)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v95)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v95)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v95)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v95 + 64)) += int64(v94) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = libc.Uint8FromInt32(int32(INST_STR_MATCH)) v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = uint8(libc.Uint32FromInt32(noCase)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_MATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - noCase } v100 = delta1 v101 = envPtr2 if v100 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v101 + 64)) += int64(v100) } } } goto _6 _5: ; XTcl_Panic(tls, __ccgo_ts+22259, libc.VaList(bp+240, mode)) _6: ; /* * In a fall-through case, we will jump on _true_ to the place * where the body starts (generated later, with guarantee of this * ensured earlier; the final body is never a fall-through). */ if (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1+int32(1))*8)))).Fsize == int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1+int32(1))*8)))).Fstart))) == int32('-') { if contFixIndex == -int32(1) { contFixIndex = fixupCount contFixCount = 0 } XTclEmitForwardJump(tls, envPtr2, int32(TCL_TRUE_JUMP), fixupArray+uintptr(contFixIndex+contFixCount)*16) fixupCount++ contFixCount++ goto _1 } XTclEmitForwardJump(tls, envPtr2, int32(TCL_FALSE_JUMP), fixupArray+uintptr(fixupCount)*16) nextArmFixupIndex = fixupCount fixupCount++ } else { /* * Got a default clause; set a flag to inhibit the generation of * the jump after the body and the cleanup of the intermediate * value that we are switching against. * * Note that default clauses (which are always terminal clauses) * cannot be fall-through clauses as well, since the last clause * is never a fall-through clause (which we have already * verified). */ foundDefault = int32(1) } /* * Generate the body for the arm. This is guaranteed not to be a * fall-through case, but it might have preceding fall-through cases, * so we must process those first. */ if contFixIndex != -int32(1) { j = 0 for { if !(j < contFixCount) { break } *(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(contFixIndex+j)*4)) = libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) goto _102 _102: ; j++ } contFixIndex = -int32(1) } /* * Now do the actual compilation. Note that we do not use BODY() * because we may have synthesized the tokens in a non-standard * pattern. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v104 = envPtr2 + 152 v103 = *(*uintptr)(unsafe.Pointer(v104)) *(*uintptr)(unsafe.Pointer(v104))++ *(*uint8)(unsafe.Pointer(v103)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v105 = delta1 v106 = envPtr2 if v105 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v106)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v106)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v106)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v106)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v106 + 64)) += int64(v105) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer(bodyLines + uintptr(i1+int32(1))*8)) /* TIP #280 */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer(bodyContLines + uintptr(i1+int32(1))*8)) /* TIP #280 */ XTclCompileCmdWord(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1+int32(1))*8)), uint64(1), envPtr2) if !(foundDefault != 0) { XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), fixupArray+uintptr(fixupCount)*16) fixupCount++ *(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(nextArmFixupIndex)*4)) = libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) } goto _1 _1: ; i1 += int32(2) } /* * Discard the value we are matching against unless we've had a default * clause (in which case it will already be gone due to the code at the * start of processing an arm, guaranteed) and make the result of the * command an empty string. */ if !(foundDefault != 0) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v109 = delta1 v110 = envPtr2 if v109 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v110)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v110)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v110)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v110)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v110 + 64)) += int64(v109) } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v115 = delta1 v116 = envPtr2 if v115 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v116)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v116)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v116)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v116)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v116 + 64)) += int64(v115) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v124 = envPtr2 + 152 v123 = *(*uintptr)(unsafe.Pointer(v124)) *(*uintptr)(unsafe.Pointer(v124))++ *(*uint8)(unsafe.Pointer(v123)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v126 = envPtr2 + 152 v125 = *(*uintptr)(unsafe.Pointer(v126)) *(*uintptr)(unsafe.Pointer(v126))++ *(*uint8)(unsafe.Pointer(v125)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v127 = delta1 v128 = envPtr2 if v127 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v128)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v128)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v128)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v128)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v128 + 64)) += int64(v127) } } } /* * Do jump fixups for arms that were executed. First, fill in the jumps of * all jumps that don't point elsewhere to point to here. */ i1 = 0 for { if !(i1 < fixupCount) { break } if *(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(i1)*4)) == uint32(0) { *(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(i1)*4)) = libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) } goto _129 _129: ; i1++ } /* * Now scan backwards over all the jumps (all of which are forward jumps) * doing each one. When we do one and there is a size changes, we must * scan back over all the previous ones and see if they need adjusting * before proceeding with further jump fixups (the interleaved nature of * all the jumps makes this impossible to do without nested loops). */ i1 = fixupCount - int32(1) for { if !(i1 >= 0) { break } if XTclFixupForwardJump(tls, envPtr2, fixupArray+uintptr(i1)*16, libc.Int32FromUint32(*(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(i1)*4))-(*(*TJumpFixup)(unsafe.Pointer(fixupArray + uintptr(i1)*16))).FcodeOffset), int32(127)) != 0 { j1 = i1 - int32(1) for { if !(j1 >= 0) { break } if *(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(j1)*4)) > (*(*TJumpFixup)(unsafe.Pointer(fixupArray + uintptr(i1)*16))).FcodeOffset { *(*uint32)(unsafe.Pointer(fixupTargetArray + uintptr(j1)*4)) += uint32(3) } goto _131 _131: ; j1-- } } goto _130 _130: ; i1-- } XTclStackFree(tls, interp, fixupTargetArray) XTclStackFree(tls, interp, fixupArray) } /* *---------------------------------------------------------------------- * * IssueSwitchJumpTable -- * * Generate instructions for a [switch] command that is to be compiled * into a jump table. This only handles the case where case-sensitive, * exact matching is used, but this is actually the most common case in * real code. * *---------------------------------------------------------------------- */ func _IssueSwitchJumpTable(tls *libc.TLS, interp uintptr, envPtr2 uintptr, numBodyTokens int32, bodyToken uintptr, bodyLines uintptr, bodyContLines uintptr) { bp := tls.Alloc(240) defer tls.Free(240) /* Array of continuation line info. */ var _objIndexCopy, delta1, foundDefault, i1, infoIndex, jumpLocation, jumpToDefault, mustGenerate, numRealBodies, v11, v23, v26, v37, v39, v45, v57 int32 var finalFixups, hPtr, jtPtr, v1, v10, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v24, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v38, v4, v40, v41, v42, v43, v44, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v58, v6, v7, v8, v9 uintptr var _ /* buffer at bp+8 */ TTcl_DString var _ /* isNew at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, finalFixups, foundDefault, hPtr, i1, infoIndex, jtPtr, jumpLocation, jumpToDefault, mustGenerate, numRealBodies, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v6, v7, v8, v9 numRealBodies = 0 /* * Compile the switch by using a jump table, which is basically a * hashtable that maps from literal values to match against to the offset * (relative to the INST_JUMP_TABLE instruction) to jump to. The jump * table itself is independent of any invocation of the bytecode, and as * such is stored in an auxData block. * * Start by allocating the jump table itself, plus some workspace. */ jtPtr = XTcl_Alloc(tls, uint64(104)) XTcl_InitHashTable(tls, jtPtr, TCL_STRING_KEYS) infoIndex = int32(XTclCreateAuxData(tls, jtPtr, uintptr(unsafe.Pointer(&XtclJumptableInfoType)), envPtr2)) finalFixups = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt32(numBodyTokens/libc.Int32FromInt32(2))) foundDefault = 0 mustGenerate = int32(1) /* * Next, issue the instruction to do the jump, together with what we want * to do if things do not work out (jump to either the default clause or * the "default" default, which just sets the result to empty). Note that * we will come back and rewrite the jump's offset parameter when we know * what it should be, and that all jumps we issue are of the wide kind * because that makes the code much easier to debug! */ jumpLocation = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_JUMP_TABLE)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(24)) v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(16)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(infoIndex) >> libc.Int32FromInt32(8)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(infoIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TABLE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - infoIndex } v11 = delta1 v12 = envPtr2 if v11 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v12 + 64)) += int64(v11) } jumpToDefault = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v18 = envPtr2 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } i1 = 0 for { if !(i1 < numBodyTokens) { break } /* * For each arm, we must first work out what to do with the match * term. */ if i1 != numBodyTokens-int32(2) || (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numBodyTokens-int32(2))*8)))).Fsize != int64(7) || libc.Xmemcmp(tls, (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(numBodyTokens-int32(2))*8)))).Fstart, __ccgo_ts+16043, uint64(7)) != 0 { /* * This is not a default clause, so insert the current location as * a target in the jump table (assuming it isn't already there, * which would indicate that this clause is probably masked by an * earlier one). Note that we use a Tcl_DString here simply * because the hash API does not let us specify the string length. */ XTcl_DStringInit(tls, bp+8) XTcl_DStringAppend(tls, bp+8, (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)))).Fstart, (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1)*8)))).Fsize) hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(jtPtr)).FcreateProc})))(tls, jtPtr, (*TTcl_DString)(unsafe.Pointer(bp+8)).Fstring1, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { /* * First time we've encountered this match clause, so it must * point to here. */ (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = uintptr(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(jumpLocation)) } XTcl_DStringFree(tls, bp+8) } else { /* * This is a default clause, so patch up the fallthrough from the * INST_JUMP_TABLE instruction to here. */ foundDefault = int32(1) *(*int32)(unsafe.Pointer(bp)) = int32(1) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpToDefault) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(jumpToDefault)) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpToDefault) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(jumpToDefault)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpToDefault) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(jumpToDefault)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpToDefault) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(jumpToDefault))) } /* * Now, for each arm we must deal with the body of the clause. * * If this is a continuation body (never true of a final clause, * whether default or not) we're done because the next jump target * will also point here, so we advance to the next clause. */ if (*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1+int32(1))*8)))).Fsize == int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1+int32(1))*8)))).Fstart))) == int32('-') { mustGenerate = int32(1) goto _25 } /* * Also skip this arm if its only match clause is masked. (We could * probably be more aggressive about this, but that would be much more * difficult to get right.) */ if !(*(*int32)(unsafe.Pointer(bp)) != 0) && !(mustGenerate != 0) { goto _25 } mustGenerate = 0 /* * Compile the body of the arm. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer(bodyLines + uintptr(i1+int32(1))*8)) /* TIP #280 */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer(bodyContLines + uintptr(i1+int32(1))*8)) /* TIP #280 */ XTclCompileCmdWord(tls, interp, *(*uintptr)(unsafe.Pointer(bodyToken + uintptr(i1+int32(1))*8)), uint64(1), envPtr2) /* * Compile a jump in to the end of the command if this body is * anything other than a user-supplied default arm (to either skip * over the remaining bodies or the code that generates an empty * result). */ if i1+int32(2) < numBodyTokens || !(foundDefault != 0) { v26 = numRealBodies numRealBodies++ *(*int32)(unsafe.Pointer(finalFixups + uintptr(v26)*4)) = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) /* * Easier by far to issue this jump as a fixed-width jump, since * otherwise we'd need to do a lot more (and more awkward) * rewriting when we fixed this all up. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v37 = delta1 v38 = envPtr2 if v37 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v38)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v38)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v38)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v38)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v38 + 64)) += int64(v37) } v39 = -int32(1) v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } goto _25 _25: ; i1 += int32(2) } /* * We're at the end. If we've not already done so through the processing * of a user-supplied default clause, add in a "default" default clause * now. */ if !(foundDefault != 0) { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpToDefault) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(jumpToDefault)) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpToDefault) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(jumpToDefault)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpToDefault) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(jumpToDefault)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpToDefault) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(jumpToDefault))) _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v45 = delta1 v46 = envPtr2 if v45 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v46 + 64)) += int64(v45) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } } } /* * No more instructions to be issued; everything that needs to jump to the * end of the command is fixed up at this point. */ i1 = 0 for { if !(i1 < numRealBodies) { break } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i1)*4))) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i1)*4)))) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i1)*4)))) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i1)*4)))) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(*(*int32)(unsafe.Pointer(finalFixups + uintptr(i1)*4))))) goto _59 _59: ; i1++ } /* * Clean up all our temporary space and return. */ XTclStackFree(tls, interp, finalFixups) } /* *---------------------------------------------------------------------- * * DupJumptableInfo, FreeJumptableInfo -- * * Functions to duplicate, release and print a jump-table created for use * with the INST_JUMP_TABLE instruction. * * Results: * DupJumptableInfo: a copy of the jump-table * FreeJumptableInfo: none * PrintJumptableInfo: none * DisassembleJumptableInfo: none * * Side effects: * DupJumptableInfo: allocates memory * FreeJumptableInfo: releases memory * PrintJumptableInfo: none * DisassembleJumptableInfo: none * *---------------------------------------------------------------------- */ func _DupJumptableInfo(tls *libc.TLS, clientData uintptr) (r uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var hPtr, jtPtr, newHPtr, newJtPtr, v2 uintptr var _ /* isNew at bp+24 */ int32 var _ /* search at bp+0 */ TTcl_HashSearch _, _, _, _, _ = hPtr, jtPtr, newHPtr, newJtPtr, v2 jtPtr = clientData newJtPtr = XTcl_Alloc(tls, uint64(104)) XTcl_InitHashTable(tls, newJtPtr, TCL_STRING_KEYS) hPtr = XTcl_FirstHashEntry(tls, jtPtr, bp) for { if !(hPtr != 0) { break } if (*TTcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == -int32(1) { v2 = *(*uintptr)(unsafe.Pointer(hPtr + 32)) } else { v2 = hPtr + 32 } newHPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(newJtPtr)).FcreateProc})))(tls, newJtPtr, v2, bp+24) (*TTcl_HashEntry)(unsafe.Pointer(newHPtr)).FclientData = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData goto _1 _1: ; hPtr = XTcl_NextHashEntry(tls, bp) } return newJtPtr } func _FreeJumptableInfo(tls *libc.TLS, clientData uintptr) { var jtPtr uintptr _ = jtPtr jtPtr = clientData XTcl_DeleteHashTable(tls, jtPtr) XTclpFree(tls, jtPtr) } func _PrintJumptableInfo(tls *libc.TLS, clientData uintptr, appendObj uintptr, dummy2587 uintptr, pcOffset Tsize_t) { bp := tls.Alloc(48) defer tls.Free(48) var hPtr, jtPtr, keyPtr, v2 uintptr var i, offset, v3 Tsize_t var _ /* search at bp+0 */ TTcl_HashSearch _, _, _, _, _, _, _ = hPtr, i, jtPtr, keyPtr, offset, v2, v3 jtPtr = clientData i = uint64(0) hPtr = XTcl_FirstHashEntry(tls, jtPtr, bp) for { if !(hPtr != 0) { break } if (*TTcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == -int32(1) { v2 = *(*uintptr)(unsafe.Pointer(hPtr + 32)) } else { v2 = hPtr + 32 } keyPtr = v2 offset = libc.Uint64FromInt64(int64((*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)) v3 = i i++ if v3 != 0 { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+21617, int64(-int32(1))) if i%uint64(4) == uint64(0) { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+22283, int64(-int32(1))) } } XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+22287, libc.VaList(bp+32, keyPtr, pcOffset+offset)) goto _1 _1: ; hPtr = XTcl_NextHashEntry(tls, bp) } } func _DisassembleJumptableInfo(tls *libc.TLS, clientData uintptr, dictObj uintptr, dummy2616 uintptr, dummy2617 Tsize_t) { bp := tls.Alloc(32) defer tls.Free(32) var cachePtr, hPtr, jtPtr, keyPtr, mapping, v3 uintptr var offset Tsize_t var v1 bool var _ /* search at bp+0 */ TTcl_HashSearch _, _, _, _, _, _, _, _ = cachePtr, hPtr, jtPtr, keyPtr, mapping, offset, v1, v3 jtPtr = clientData if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { mapping = XTclThreadAllocObj(tls) } else { mapping = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapping + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(mapping)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(mapping)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(mapping)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(mapping)).FtypePtr = libc.UintptrFromInt32(0) hPtr = XTcl_FirstHashEntry(tls, jtPtr, bp) for { if !(hPtr != 0) { break } if (*TTcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(jtPtr)).FkeyType == -int32(1) { v3 = *(*uintptr)(unsafe.Pointer(hPtr + 32)) } else { v3 = hPtr + 32 } keyPtr = v3 offset = libc.Uint64FromInt64(int64((*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData)) XTclDictPut(tls, libc.UintptrFromInt32(0), mapping, keyPtr, XTcl_NewWideIntObj(tls, libc.Int64FromUint64(offset))) goto _2 _2: ; hPtr = XTcl_NextHashEntry(tls, bp) } XTclDictPut(tls, libc.UintptrFromInt32(0), dictObj, __ccgo_ts+22300, mapping) } /* *---------------------------------------------------------------------- * * TclCompileTailcallCmd -- * * Procedure called to compile the "tailcall" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "tailcall" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileTailcallCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2659 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, i1, v17, v24, v36, v42, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v2, v20, v21, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v43, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, i1, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < int64(2) || (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords >= int64(256) || (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* make room for the nsObjPtr */ /* TODO: Doesn't this have to be a known value? */ if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } goto _19 _19: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_TAILCALL)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TAILCALL)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileThrowCmd -- * * Procedure called to compile the "throw" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "throw" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileThrowCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2705 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, codeIsList, codeIsValid, codeKnown, delta1, numWords, v100, v104, v110, v122, v134, v144, v148, v152, v156, v162, v174, v18, v180, v192, v204, v24, v36, v42, v54, v56, v6, v64, v76, v83, v96 int32 var cachePtr, cachePtr1, cachePtr2, codeToken, dictPtr, mapPtr, msgToken, objPtr, v10, v101, v102, v103, v105, v106, v107, v108, v109, v11, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v145, v146, v147, v149, v15, v150, v151, v153, v154, v155, v157, v158, v159, v16, v160, v161, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v175, v176, v177, v178, v179, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v55, v60, v61, v62, v63, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v77, v79, v8, v81, v82, v84, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v97, v98, v99 uintptr var eclIndex, v78 TTcl_Size var v1, v58, v59, v80 bool var v57 int64 var _ /* len at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, cachePtr, cachePtr1, cachePtr2, codeIsList, codeIsValid, codeKnown, codeToken, delta1, dictPtr, eclIndex, mapPtr, msgToken, numWords, objPtr, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) if numWords != int32(3) { return int32(TCL_ERROR) } codeToken = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 msgToken = codeToken + uintptr((*TTcl_Token)(unsafe.Pointer(codeToken)).FnumComponents+libc.Int64FromInt32(1))*32 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ codeKnown = XTclWordKnownAtCompileTime(tls, codeToken, objPtr) /* * First we must emit the code to substitute the arguments. This * must come first in case substitution raises errors. */ if !(codeKnown != 0) { if (*TTcl_Token)(unsafe.Pointer(codeToken)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(codeToken + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(codeToken + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, codeToken+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(codeToken)).FnumComponents), envPtr2) } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+15231, libc.Int64FromUint64(libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } } if (*TTcl_Token)(unsafe.Pointer(msgToken)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(msgToken + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(msgToken + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v54 = delta1 v55 = envPtr2 if v54 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v55 + 64)) += int64(v54) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, msgToken+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(msgToken)).FnumComponents), envPtr2) } if v58 = codeKnown != 0; v58 { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2 != 0 { v57 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2)).FspanLength } else { v57 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v57 v56 = libc.Int32FromInt32(TCL_OK) } else { v56 = XTcl_ListObjLength(tls, interp, objPtr, bp) } } codeIsList = libc.BoolInt32(v58 && TCL_OK == v56) codeIsValid = libc.BoolInt32(codeIsList != 0 && *(*TTcl_Size)(unsafe.Pointer(bp)) != 0) if codeIsValid != 0 { if v59 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v59 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v59 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { dictPtr = XTclThreadAllocObj(tls) } else { dictPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = libc.UintptrFromInt32(0) XTclDictPut(tls, libc.UintptrFromInt32(0), dictPtr, __ccgo_ts+15231, objPtr) _objIndexCopy3 = XTclAddLiteralObj(tls, envPtr2, dictPtr, libc.UintptrFromInt32(0)) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v64 = delta1 v65 = envPtr2 if v64 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v65 + 64)) += int64(v64) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v76 = delta1 v77 = envPtr2 if v76 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v77 + 64)) += int64(v76) } } } v79 = objPtr v78 = *(*TTcl_Size)(unsafe.Pointer(v79)) *(*TTcl_Size)(unsafe.Pointer(v79))-- if !(v78 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v80 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v80 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v80 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, objPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = objPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, objPtr) } } /* * Simpler bytecodes when we detect invalid arguments at compile time. */ if codeKnown != 0 && !(codeIsValid != 0) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v83 = delta1 v84 = envPtr2 if v83 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v84)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v84)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v84 + 64)) += int64(v83) } if codeIsList != 0 { /* Must be an empty list */ goto issueErrorForEmptyCode } XTclCompileSyntaxError(tls, interp, envPtr2) return TCL_OK } if !!(codeKnown != 0) { goto _85 } /* * Argument validity checking has to be done by bytecode at * run time. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v93 = envPtr2 + 152 v92 = *(*uintptr)(unsafe.Pointer(v93)) *(*uintptr)(unsafe.Pointer(v93))++ *(*uint8)(unsafe.Pointer(v92)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v95 = envPtr2 + 152 v94 = *(*uintptr)(unsafe.Pointer(v95)) *(*uintptr)(unsafe.Pointer(v95))++ *(*uint8)(unsafe.Pointer(v94)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v96 = delta1 v97 = envPtr2 if v96 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v97)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v97)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v97)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v97)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v97 + 64)) += int64(v96) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v100 = delta1 v101 = envPtr2 if v100 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v101 + 64)) += int64(v100) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = libc.Uint8FromInt32(int32(INST_LIST_LENGTH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_LENGTH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v104 = delta1 v105 = envPtr2 if v104 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v105)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v105)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v105)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v105)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v105 + 64)) += int64(v104) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v107 = envPtr2 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(16))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(16) } v110 = delta1 v111 = envPtr2 if v110 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v111)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v111)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v111)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v111)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v111 + 64)) += int64(v110) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v113 = envPtr2 + 152 v112 = *(*uintptr)(unsafe.Pointer(v113)) *(*uintptr)(unsafe.Pointer(v113))++ *(*uint8)(unsafe.Pointer(v112)) = libc.Uint8FromInt32(int32(INST_LIST)) v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v119 = envPtr2 + 152 v118 = *(*uintptr)(unsafe.Pointer(v119)) *(*uintptr)(unsafe.Pointer(v119))++ *(*uint8)(unsafe.Pointer(v118)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v122 = delta1 v123 = envPtr2 if v122 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v123)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v123)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v123)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v123)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v123 + 64)) += int64(v122) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v125 = envPtr2 + 152 v124 = *(*uintptr)(unsafe.Pointer(v125)) *(*uintptr)(unsafe.Pointer(v125))++ *(*uint8)(unsafe.Pointer(v124)) = libc.Uint8FromInt32(int32(INST_RETURN_IMM)) v127 = envPtr2 + 152 v126 = *(*uintptr)(unsafe.Pointer(v127)) *(*uintptr)(unsafe.Pointer(v127))++ *(*uint8)(unsafe.Pointer(v126)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(24)) v129 = envPtr2 + 152 v128 = *(*uintptr)(unsafe.Pointer(v129)) *(*uintptr)(unsafe.Pointer(v129))++ *(*uint8)(unsafe.Pointer(v128)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(16)) v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(8)) v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RETURN_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(TCL_ERROR) } v134 = delta1 v135 = envPtr2 if v134 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v135 + 64)) += int64(v134) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v137 = envPtr2 + 152 v136 = *(*uintptr)(unsafe.Pointer(v137)) *(*uintptr)(unsafe.Pointer(v137))++ *(*uint8)(unsafe.Pointer(v136)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v141 = envPtr2 + 152 v140 = *(*uintptr)(unsafe.Pointer(v141)) *(*uintptr)(unsafe.Pointer(v141))++ *(*uint8)(unsafe.Pointer(v140)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v143 = envPtr2 + 152 v142 = *(*uintptr)(unsafe.Pointer(v143)) *(*uintptr)(unsafe.Pointer(v143))++ *(*uint8)(unsafe.Pointer(v142)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) v144 = int32(2) v145 = envPtr2 if v144 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v145)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v145)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v145)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v145)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v145 + 64)) += int64(v144) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v147 = envPtr2 + 152 v146 = *(*uintptr)(unsafe.Pointer(v147)) *(*uintptr)(unsafe.Pointer(v147))++ *(*uint8)(unsafe.Pointer(v146)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v148 = delta1 v149 = envPtr2 if v148 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v149)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v149)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v149)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v149)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v149 + 64)) += int64(v148) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v151 = envPtr2 + 152 v150 = *(*uintptr)(unsafe.Pointer(v151)) *(*uintptr)(unsafe.Pointer(v151))++ *(*uint8)(unsafe.Pointer(v150)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v152 = delta1 v153 = envPtr2 if v152 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v153)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v153)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v153)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v153)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v153 + 64)) += int64(v152) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v155 = envPtr2 + 152 v154 = *(*uintptr)(unsafe.Pointer(v155)) *(*uintptr)(unsafe.Pointer(v155))++ *(*uint8)(unsafe.Pointer(v154)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v156 = delta1 v157 = envPtr2 if v156 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v157)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v157)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v157)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v157)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v157 + 64)) += int64(v156) } goto issueErrorForEmptyCode issueErrorForEmptyCode: ; _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+20541, libc.Int64FromUint64(libc.Uint64FromInt64(28)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v159 = envPtr2 + 152 v158 = *(*uintptr)(unsafe.Pointer(v159)) *(*uintptr)(unsafe.Pointer(v159))++ *(*uint8)(unsafe.Pointer(v158)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v161 = envPtr2 + 152 v160 = *(*uintptr)(unsafe.Pointer(v161)) *(*uintptr)(unsafe.Pointer(v161))++ *(*uint8)(unsafe.Pointer(v160)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v162 = delta1 v163 = envPtr2 if v162 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v163)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v163)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v163)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v163)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v163 + 64)) += int64(v162) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v165 = envPtr2 + 152 v164 = *(*uintptr)(unsafe.Pointer(v165)) *(*uintptr)(unsafe.Pointer(v165))++ *(*uint8)(unsafe.Pointer(v164)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v167 = envPtr2 + 152 v166 = *(*uintptr)(unsafe.Pointer(v167)) *(*uintptr)(unsafe.Pointer(v167))++ *(*uint8)(unsafe.Pointer(v166)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v169 = envPtr2 + 152 v168 = *(*uintptr)(unsafe.Pointer(v169)) *(*uintptr)(unsafe.Pointer(v169))++ *(*uint8)(unsafe.Pointer(v168)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v171 = envPtr2 + 152 v170 = *(*uintptr)(unsafe.Pointer(v171)) *(*uintptr)(unsafe.Pointer(v171))++ *(*uint8)(unsafe.Pointer(v170)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v173 = envPtr2 + 152 v172 = *(*uintptr)(unsafe.Pointer(v173)) *(*uintptr)(unsafe.Pointer(v173))++ *(*uint8)(unsafe.Pointer(v172)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v174 = delta1 v175 = envPtr2 if v174 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v175)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v175)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v175)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v175)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v175 + 64)) += int64(v174) } } _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+22308, libc.Int64FromUint64(libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v177 = envPtr2 + 152 v176 = *(*uintptr)(unsafe.Pointer(v177)) *(*uintptr)(unsafe.Pointer(v177))++ *(*uint8)(unsafe.Pointer(v176)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v179 = envPtr2 + 152 v178 = *(*uintptr)(unsafe.Pointer(v179)) *(*uintptr)(unsafe.Pointer(v179))++ *(*uint8)(unsafe.Pointer(v178)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v180 = delta1 v181 = envPtr2 if v180 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v181)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v181)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v181)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v181)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v181 + 64)) += int64(v180) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v183 = envPtr2 + 152 v182 = *(*uintptr)(unsafe.Pointer(v183)) *(*uintptr)(unsafe.Pointer(v183))++ *(*uint8)(unsafe.Pointer(v182)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v185 = envPtr2 + 152 v184 = *(*uintptr)(unsafe.Pointer(v185)) *(*uintptr)(unsafe.Pointer(v185))++ *(*uint8)(unsafe.Pointer(v184)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v187 = envPtr2 + 152 v186 = *(*uintptr)(unsafe.Pointer(v187)) *(*uintptr)(unsafe.Pointer(v187))++ *(*uint8)(unsafe.Pointer(v186)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v189 = envPtr2 + 152 v188 = *(*uintptr)(unsafe.Pointer(v189)) *(*uintptr)(unsafe.Pointer(v189))++ *(*uint8)(unsafe.Pointer(v188)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v191 = envPtr2 + 152 v190 = *(*uintptr)(unsafe.Pointer(v191)) *(*uintptr)(unsafe.Pointer(v191))++ *(*uint8)(unsafe.Pointer(v190)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v192 = delta1 v193 = envPtr2 if v192 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v193)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v193)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v193)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v193)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v193 + 64)) += int64(v192) } } _85: ; if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v195 = envPtr2 + 152 v194 = *(*uintptr)(unsafe.Pointer(v195)) *(*uintptr)(unsafe.Pointer(v195))++ *(*uint8)(unsafe.Pointer(v194)) = libc.Uint8FromInt32(int32(INST_RETURN_IMM)) v197 = envPtr2 + 152 v196 = *(*uintptr)(unsafe.Pointer(v197)) *(*uintptr)(unsafe.Pointer(v197))++ *(*uint8)(unsafe.Pointer(v196)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(24)) v199 = envPtr2 + 152 v198 = *(*uintptr)(unsafe.Pointer(v199)) *(*uintptr)(unsafe.Pointer(v199))++ *(*uint8)(unsafe.Pointer(v198)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(16)) v201 = envPtr2 + 152 v200 = *(*uintptr)(unsafe.Pointer(v201)) *(*uintptr)(unsafe.Pointer(v201))++ *(*uint8)(unsafe.Pointer(v200)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR)) >> libc.Int32FromInt32(8)) v203 = envPtr2 + 152 v202 = *(*uintptr)(unsafe.Pointer(v203)) *(*uintptr)(unsafe.Pointer(v203))++ *(*uint8)(unsafe.Pointer(v202)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(TCL_ERROR))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RETURN_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(TCL_ERROR) } v204 = delta1 v205 = envPtr2 if v204 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v205)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v205)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v205)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v205)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v205 + 64)) += int64(v204) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v207 = envPtr2 + 152 v206 = *(*uintptr)(unsafe.Pointer(v207)) *(*uintptr)(unsafe.Pointer(v207))++ *(*uint8)(unsafe.Pointer(v206)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v209 = envPtr2 + 152 v208 = *(*uintptr)(unsafe.Pointer(v209)) *(*uintptr)(unsafe.Pointer(v209))++ *(*uint8)(unsafe.Pointer(v208)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v211 = envPtr2 + 152 v210 = *(*uintptr)(unsafe.Pointer(v211)) *(*uintptr)(unsafe.Pointer(v211))++ *(*uint8)(unsafe.Pointer(v210)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v213 = envPtr2 + 152 v212 = *(*uintptr)(unsafe.Pointer(v213)) *(*uintptr)(unsafe.Pointer(v213))++ *(*uint8)(unsafe.Pointer(v212)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileTryCmd -- * * Procedure called to compile the "try" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "try" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileTryCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2808 uintptr, envPtr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Holds resulting instructions. */ var bodyToken, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, finallyToken, handlerTokens, mapPtr, matchClauses, matchCodes, optionVarIndices, resultVarIndices, tmpObj, tokenPtr, varname, varname1, v11, v14, v17, v21, v27, v29, v31, v33, v35, v38, v42, v7 uintptr var eclIndex, v10, v13, v16, v20, v26, v30, v34, v37, v41, v6 TTcl_Size var i, numHandlers, numWords, result, v23, v3 int32 var v12, v15, v18, v19, v2, v22, v28, v32, v36, v39, v43, v5, v8, v9 bool var v24, v25, v4 int64 var _ /* code at bp+16 */ int32 var _ /* len at bp+24 */ TTcl_Size var _ /* len at bp+32 */ TTcl_Size var _ /* objc at bp+8 */ TTcl_Size var _ /* objv at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bodyToken, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, eclIndex, finallyToken, handlerTokens, i, mapPtr, matchClauses, matchCodes, numHandlers, numWords, optionVarIndices, result, resultVarIndices, tmpObj, tokenPtr, varname, varname1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v42, v43, v5, v6, v7, v8, v9 numWords = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) result = int32(TCL_ERROR) handlerTokens = libc.UintptrFromInt32(0) matchClauses = libc.UintptrFromInt32(0) matchCodes = libc.UintptrFromInt32(0) resultVarIndices = libc.UintptrFromInt32(0) optionVarIndices = libc.UintptrFromInt32(0) if numWords < int32(2) { return int32(TCL_ERROR) } bodyToken = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if numWords == int32(2) { /* * No handlers or finally; do nothing beyond evaluating the body. */ mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ (*TCompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileCmdWord(tls, interp, bodyToken+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents), envPtr) return TCL_OK } numWords -= int32(2) tokenPtr = bodyToken + uintptr((*TTcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents+libc.Int64FromInt32(1))*32 /* * Extract information about what handlers there are. */ numHandlers = numWords >> int32(2) numWords -= numHandlers * int32(4) if numHandlers > 0 { handlerTokens = XTclStackAlloc(tls, interp, uint64(8)*libc.Uint64FromInt32(numHandlers)) matchClauses = XTclStackAlloc(tls, interp, uint64(8)*libc.Uint64FromInt32(numHandlers)) libc.Xmemset(tls, matchClauses, 0, uint64(8)*libc.Uint64FromInt32(numHandlers)) matchCodes = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt32(numHandlers)) resultVarIndices = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt32(numHandlers)) optionVarIndices = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt32(numHandlers)) i = 0 for { if !(i < numHandlers) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { goto failedToCompile } if (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize == int64(4) && !(libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, __ccgo_ts+20805, uint64(4)) != 0) { /* * Parse the list of errorCode words to match against. */ *(*int32)(unsafe.Pointer(matchCodes + uintptr(i)*4)) = int32(TCL_ERROR) tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++ if v5 = !(XTclWordKnownAtCompileTime(tls, tokenPtr, tmpObj) != 0); !v5 { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr2)).FspanLength } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v4 v3 = libc.Int32FromInt32(TCL_OK) } else { v3 = XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), tmpObj, bp+8) } } if v5 || v3 != TCL_OK || *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == 0 { v7 = tmpObj v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if !(v6 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } goto failedToCompile } XTcl_ListObjReplace(tls, libc.UintptrFromInt32(0), tmpObj, 0, 0, 0, libc.UintptrFromInt32(0)) *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) = tmpObj } else { if (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize == int64(2) && !(libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, __ccgo_ts+20802, uint64(2)) != 0) { /* * Parse the result code to look for. */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++ if !(XTclWordKnownAtCompileTime(tls, tokenPtr, tmpObj) != 0) { v11 = tmpObj v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if !(v10 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } goto failedToCompile } if int32(TCL_ERROR) == XTclGetCompletionCodeFromObj(tls, libc.UintptrFromInt32(0), tmpObj, bp+16) { v14 = tmpObj v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if !(v13 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v15 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v15 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v15 || ((*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } goto failedToCompile } *(*int32)(unsafe.Pointer(matchCodes + uintptr(i)*4)) = *(*int32)(unsafe.Pointer(bp + 16)) v17 = tmpObj v16 = *(*TTcl_Size)(unsafe.Pointer(v17)) *(*TTcl_Size)(unsafe.Pointer(v17))-- if !(v16 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v18 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v18 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v18 || ((*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } } else { goto failedToCompile } } /* * Parse the variable binding. */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == libc.Uint64FromInt32(0) { tmpObj = XTclThreadAllocObj(tls) } else { tmpObj = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++ if !(XTclWordKnownAtCompileTime(tls, tokenPtr, tmpObj) != 0) { v21 = tmpObj v20 = *(*TTcl_Size)(unsafe.Pointer(v21)) *(*TTcl_Size)(unsafe.Pointer(v21))-- if !(v20 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v22 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v22 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v22 || ((*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } goto failedToCompile } if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr2 != 0 { v24 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr2)).FspanStart } else { v24 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 + 40 + uintptr(v24)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr2 != 0 { v25 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr2)).FspanLength } else { v25 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v25 v23 = libc.Int32FromInt32(TCL_OK) } else { v23 = XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), tmpObj, bp+8, bp) } if v23 != TCL_OK || *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > int64(2) { v27 = tmpObj v26 = *(*TTcl_Size)(unsafe.Pointer(v27)) *(*TTcl_Size)(unsafe.Pointer(v27))-- if !(v26 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v28 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v28 { cachePtr8 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v28 || ((*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } goto failedToCompile } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))).Flength v29 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))).Fbytes } else { v29 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), bp+24) } varname = v29 *(*int32)(unsafe.Pointer(resultVarIndices + uintptr(i)*4)) = libc.Int32FromUint64(XTclLocalScalar(tls, varname, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 24))), envPtr)) if *(*int32)(unsafe.Pointer(resultVarIndices + uintptr(i)*4)) < 0 { v31 = tmpObj v30 = *(*TTcl_Size)(unsafe.Pointer(v31)) *(*TTcl_Size)(unsafe.Pointer(v31))-- if !(v30 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v32 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v32 { cachePtr9 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v32 || ((*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } goto failedToCompile } } else { *(*int32)(unsafe.Pointer(resultVarIndices + uintptr(i)*4)) = -int32(1) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(2) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)))).Flength v33 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)))).Fbytes } else { v33 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)), bp+32) } varname1 = v33 *(*int32)(unsafe.Pointer(optionVarIndices + uintptr(i)*4)) = libc.Int32FromUint64(XTclLocalScalar(tls, varname1, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 32))), envPtr)) if *(*int32)(unsafe.Pointer(optionVarIndices + uintptr(i)*4)) < 0 { v35 = tmpObj v34 = *(*TTcl_Size)(unsafe.Pointer(v35)) *(*TTcl_Size)(unsafe.Pointer(v35))-- if !(v34 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v36 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v36 { cachePtr10 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v36 || ((*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } goto failedToCompile } } else { *(*int32)(unsafe.Pointer(optionVarIndices + uintptr(i)*4)) = -int32(1) } v38 = tmpObj v37 = *(*TTcl_Size)(unsafe.Pointer(v38)) *(*TTcl_Size)(unsafe.Pointer(v38))-- if !(v37 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v39 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v39 { cachePtr11 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v39 || ((*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } /* * Extract the body for this handler. */ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { goto failedToCompile } if (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize == int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart))) == int32('-') { *(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8)) = libc.UintptrFromInt32(0) } else { *(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i)*8)) = tokenPtr } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i++ } if *(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(numHandlers-int32(1))*8)) == libc.UintptrFromInt32(0) { goto failedToCompile } } /* * Parse the finally clause */ if numWords == 0 { finallyToken = libc.UintptrFromInt32(0) } else { if numWords == int32(2) { if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize != int64(7) || libc.Xstrncmp(tls, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, __ccgo_ts+20794, uint64(7)) != 0 { goto failedToCompile } finallyToken = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(finallyToken)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { goto failedToCompile } } else { goto failedToCompile } } /* * Issue the bytecode. */ if !(finallyToken != 0) { result = _IssueTryClausesInstructions(tls, interp, envPtr, bodyToken, numHandlers, matchCodes, matchClauses, resultVarIndices, optionVarIndices, handlerTokens) } else { if numHandlers == 0 { result = _IssueTryFinallyInstructions(tls, interp, envPtr, bodyToken, finallyToken) } else { result = _IssueTryClausesFinallyInstructions(tls, interp, envPtr, bodyToken, numHandlers, matchCodes, matchClauses, resultVarIndices, optionVarIndices, handlerTokens, finallyToken) } } /* * Delete any temporary state and finish off. */ goto failedToCompile failedToCompile: ; if numHandlers > 0 { i = 0 for { if !(i < numHandlers) { break } if *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) != 0 { v42 = *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) v41 = *(*TTcl_Size)(unsafe.Pointer(v42)) *(*TTcl_Size)(unsafe.Pointer(v42))-- if !(v41 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)))).Flength = int64(-libc.Int32FromInt32(1)) if v43 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v43 { cachePtr12 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v43 || ((*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8)) (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i)*8))) } } } goto _40 _40: ; i++ } XTclStackFree(tls, interp, optionVarIndices) XTclStackFree(tls, interp, resultVarIndices) XTclStackFree(tls, interp, matchCodes) XTclStackFree(tls, interp, matchClauses) XTclStackFree(tls, interp, handlerTokens) } return result } /* *---------------------------------------------------------------------- * * IssueTryClausesInstructions, IssueTryClausesFinallyInstructions, * IssueTryFinallyInstructions -- * * The code generators for [try]. Split from the parsing engine for * reasons of developer sanity, and also split between no-finally, * just-finally and with-finally cases because so many of the details of * generation vary between the three. * * The macros below make the instruction issuing easier to follow. * *---------------------------------------------------------------------- */ func _IssueTryClausesInstructions(tls *libc.TLS, interp uintptr, envPtr2 uintptr, bodyToken uintptr, numHandlers int32, matchCodes uintptr, matchClauses uintptr, resultVars uintptr, optionVars uintptr, handlerTokens uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, afterBody, delta1, dontChangeOptions, forwardsNeedFixing, i1, j, notCodeJumpSource, notECJumpSource, optionsVar, range1, resultVar, trapZero, v103, v107, v113, v12, v125, v129, v134, v140, v152, v156, v168, v17, v176, v188, v194, v206, v218, v220, v232, v247, v259, v263, v275, v279, v285, v29, v297, v303, v31, v315, v319, v325, v337, v343, v355, v359, v37, v371, v373, v386, v391, v403, v405, v409, v413, v417, v421, v427, v439, v443, v449, v455, v467, v479, v485, v49, v497, v501, v507, v519, v531, v543, v553, v565, v577, v581, v587, v599, v605, v61, v617, v67, v69, v73, v77, v81, v85, v91 int32 var addrsToFix, forwardsToFix, mapPtr, noError, p, v10, v100, v101, v102, v104, v105, v106, v108, v109, v11, v110, v111, v112, v114, v115, v116, v117, v118, v119, v120, v121, v122, v123, v124, v126, v127, v128, v13, v130, v132, v133, v135, v136, v137, v138, v139, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v153, v154, v155, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v169, v172, v173, v174, v175, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v189, v19, v190, v191, v192, v193, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v219, v22, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v26, v260, v261, v262, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v273, v274, v276, v277, v278, v28, v280, v281, v282, v283, v284, v286, v287, v288, v289, v290, v291, v292, v293, v294, v295, v296, v298, v299, v3, v30, v300, v301, v302, v304, v305, v306, v307, v308, v309, v310, v311, v312, v313, v314, v316, v317, v318, v32, v320, v321, v322, v323, v324, v326, v327, v328, v329, v33, v330, v331, v332, v333, v334, v335, v336, v338, v339, v34, v340, v341, v342, v344, v345, v346, v347, v348, v349, v35, v350, v351, v352, v353, v354, v356, v357, v358, v36, v360, v361, v362, v363, v364, v365, v366, v367, v368, v369, v370, v372, v374, v376, v377, v378, v379, v38, v380, v381, v382, v383, v384, v385, v387, v389, v39, v390, v392, v393, v394, v395, v396, v397, v398, v399, v4, v40, v400, v401, v402, v404, v406, v407, v408, v41, v410, v411, v412, v414, v415, v416, v418, v419, v42, v420, v422, v423, v424, v425, v426, v428, v429, v43, v430, v431, v432, v433, v434, v435, v436, v437, v438, v44, v440, v441, v442, v444, v445, v446, v447, v448, v45, v450, v451, v452, v453, v454, v456, v457, v458, v459, v46, v460, v461, v462, v463, v464, v465, v466, v468, v469, v47, v470, v471, v472, v473, v474, v475, v476, v477, v478, v48, v480, v481, v482, v483, v484, v486, v487, v488, v489, v490, v491, v492, v493, v494, v495, v496, v498, v499, v5, v50, v500, v502, v503, v504, v505, v506, v508, v509, v51, v510, v511, v512, v513, v514, v515, v516, v517, v518, v52, v520, v521, v522, v523, v524, v525, v526, v527, v528, v529, v53, v530, v532, v533, v534, v535, v536, v537, v538, v539, v54, v540, v541, v542, v544, v545, v546, v547, v548, v549, v55, v550, v551, v552, v554, v555, v556, v557, v558, v559, v56, v560, v561, v562, v563, v564, v566, v567, v568, v569, v57, v570, v571, v572, v573, v574, v575, v576, v578, v579, v58, v580, v582, v583, v584, v585, v586, v588, v589, v59, v590, v591, v592, v593, v594, v595, v596, v597, v598, v6, v60, v600, v601, v602, v603, v604, v606, v607, v608, v609, v610, v611, v612, v613, v614, v615, v616, v618, v62, v63, v64, v65, v66, v68, v7, v70, v71, v72, v74, v75, v76, v78, v79, v8, v80, v82, v83, v84, v86, v87, v88, v89, v9, v90, v92, v93, v94, v95, v96, v97, v98, v99 uintptr var eclIndex TTcl_Size var v14, v171, v388 int64 var _ /* buf at bp+16 */ [24]uint8 var _ /* len at bp+8 */ TTcl_Size var _ /* slen at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, addrsToFix, afterBody, delta1, dontChangeOptions, eclIndex, forwardsNeedFixing, forwardsToFix, i1, j, mapPtr, noError, notCodeJumpSource, notECJumpSource, optionsVar, p, range1, resultVar, trapZero, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v230, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v28, v280, v281, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v292, v293, v294, v295, v296, v297, v298, v299, v3, v30, v300, v301, v302, v303, v304, v305, v306, v307, v308, v309, v31, v310, v311, v312, v313, v314, v315, v316, v317, v318, v319, v32, v320, v321, v322, v323, v324, v325, v326, v327, v328, v329, v33, v330, v331, v332, v333, v334, v335, v336, v337, v338, v339, v34, v340, v341, v342, v343, v344, v345, v346, v347, v348, v349, v35, v350, v351, v352, v353, v354, v355, v356, v357, v358, v359, v36, v360, v361, v362, v363, v364, v365, v366, v367, v368, v369, v37, v370, v371, v372, v373, v374, v376, v377, v378, v379, v38, v380, v381, v382, v383, v384, v385, v386, v387, v388, v389, v39, v390, v391, v392, v393, v394, v395, v396, v397, v398, v399, v4, v40, v400, v401, v402, v403, v404, v405, v406, v407, v408, v409, v41, v410, v411, v412, v413, v414, v415, v416, v417, v418, v419, v42, v420, v421, v422, v423, v424, v425, v426, v427, v428, v429, v43, v430, v431, v432, v433, v434, v435, v436, v437, v438, v439, v44, v440, v441, v442, v443, v444, v445, v446, v447, v448, v449, v45, v450, v451, v452, v453, v454, v455, v456, v457, v458, v459, v46, v460, v461, v462, v463, v464, v465, v466, v467, v468, v469, v47, v470, v471, v472, v473, v474, v475, v476, v477, v478, v479, v48, v480, v481, v482, v483, v484, v485, v486, v487, v488, v489, v49, v490, v491, v492, v493, v494, v495, v496, v497, v498, v499, v5, v50, v500, v501, v502, v503, v504, v505, v506, v507, v508, v509, v51, v510, v511, v512, v513, v514, v515, v516, v517, v518, v519, v52, v520, v521, v522, v523, v524, v525, v526, v527, v528, v529, v53, v530, v531, v532, v533, v534, v535, v536, v537, v538, v539, v54, v540, v541, v542, v543, v544, v545, v546, v547, v548, v549, v55, v550, v551, v552, v553, v554, v555, v556, v557, v558, v559, v56, v560, v561, v562, v563, v564, v565, v566, v567, v568, v569, v57, v570, v571, v572, v573, v574, v575, v576, v577, v578, v579, v58, v580, v581, v582, v583, v584, v585, v586, v587, v588, v589, v59, v590, v591, v592, v593, v594, v595, v596, v597, v598, v599, v6, v60, v600, v601, v602, v603, v604, v605, v606, v607, v608, v609, v61, v610, v611, v612, v613, v614, v615, v616, v617, v618, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) forwardsNeedFixing = 0 trapZero = 0 afterBody = 0 resultVar = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) optionsVar = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) if resultVar < 0 || optionsVar < 0 { return int32(TCL_ERROR) } /* * Check if we're supposed to trap a normal TCL_OK completion of the body. * If not, we can handle that case much more efficiently. */ i1 = 0 for { if !(i1 < numHandlers) { break } if *(*int32)(unsafe.Pointer(matchCodes + uintptr(i1)*4)) == 0 { trapZero = int32(1) break } goto _1 _1: ; i1++ } /* * Compile the body, trapping any error in it so that we can trap on it * and/or run a finally clause. Note that there must be at least one * on/trap clause; when none is present, this whole function is not called * (and it's never called when there's a finally clause). */ range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v12 = delta1 v13 = envPtr2 if v12 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v13 + 64)) += int64(v12) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v14 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v14 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v14 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileCmdWord(tls, interp, bodyToken+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) if !(trapZero != 0) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } afterBody = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v24 = envPtr2 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v29 = delta1 v30 = envPtr2 if v29 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v30)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v30)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v30)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v30)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v30 + 64)) += int64(v29) } v31 = -int32(1) v32 = envPtr2 if v31 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v32)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v32)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v32)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v32)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v32 + 64)) += int64(v31) } else { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v36 = envPtr2 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v37 = delta1 v38 = envPtr2 if v37 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v38)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v38)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v38)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v38)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v38 + 64)) += int64(v37) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v49 = delta1 v50 = envPtr2 if v49 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v50 + 64)) += int64(v49) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v61 = delta1 v62 = envPtr2 if v61 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v62 + 64)) += int64(v61) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(4) } v67 = delta1 v68 = envPtr2 if v67 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v68 + 64)) += int64(v67) } v69 = -int32(2) v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v73 = delta1 v74 = envPtr2 if v73 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v74 + 64)) += int64(v73) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v77 = delta1 v78 = envPtr2 if v77 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v78)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v78)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v78)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v78)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v78 + 64)) += int64(v77) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v81 = delta1 v82 = envPtr2 if v81 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v82 + 64)) += int64(v81) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v85 = delta1 v86 = envPtr2 if v85 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v86 + 64)) += int64(v85) } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v91 = delta1 v92 = envPtr2 if v91 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v92 + 64)) += int64(v91) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v98 = envPtr2 + 152 v97 = *(*uintptr)(unsafe.Pointer(v98)) *(*uintptr)(unsafe.Pointer(v98))++ *(*uint8)(unsafe.Pointer(v97)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v100 = envPtr2 + 152 v99 = *(*uintptr)(unsafe.Pointer(v100)) *(*uintptr)(unsafe.Pointer(v100))++ *(*uint8)(unsafe.Pointer(v99)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v103 = delta1 v104 = envPtr2 if v103 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v104 + 64)) += int64(v103) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v107 = delta1 v108 = envPtr2 if v107 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v108)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v108)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v108)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v108)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v108 + 64)) += int64(v107) } if resultVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v110 = envPtr2 + 152 v109 = *(*uintptr)(unsafe.Pointer(v110)) *(*uintptr)(unsafe.Pointer(v110))++ *(*uint8)(unsafe.Pointer(v109)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v113 = delta1 v114 = envPtr2 if v113 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v114)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v114)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v114)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v114)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v114 + 64)) += int64(v113) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(24)) v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(16)) v122 = envPtr2 + 152 v121 = *(*uintptr)(unsafe.Pointer(v122)) *(*uintptr)(unsafe.Pointer(v122))++ *(*uint8)(unsafe.Pointer(v121)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(8)) v124 = envPtr2 + 152 v123 = *(*uintptr)(unsafe.Pointer(v124)) *(*uintptr)(unsafe.Pointer(v124))++ *(*uint8)(unsafe.Pointer(v123)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v125 = delta1 v126 = envPtr2 if v125 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v126)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v126)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v126)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v126)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v126 + 64)) += int64(v125) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v128 = envPtr2 + 152 v127 = *(*uintptr)(unsafe.Pointer(v128)) *(*uintptr)(unsafe.Pointer(v128))++ *(*uint8)(unsafe.Pointer(v127)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v129 = delta1 v130 = envPtr2 if v129 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v130)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v130)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v130)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v130)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v130 + 64)) += int64(v129) } /* * Now we handle all the registered 'on' and 'trap' handlers in order. * For us to be here, there must be at least one handler. * * Slight overallocation, but reduces size of this function. */ addrsToFix = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt32(numHandlers)) forwardsToFix = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt32(numHandlers)) noError = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt32(numHandlers)) i1 = 0 for { if !(i1 < numHandlers) { break } *(*int32)(unsafe.Pointer(noError + uintptr(i1)*4)) = -int32(1) libc.X__builtin_snprintf(tls, bp+16, uint64(24), __ccgo_ts+260, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(matchCodes + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v134 = delta1 v135 = envPtr2 if v134 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v135)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v135)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v135 + 64)) += int64(v134) } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, bp+16, libc.Int64FromUint64(libc.Xstrlen(tls, bp+16)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v137 = envPtr2 + 152 v136 = *(*uintptr)(unsafe.Pointer(v137)) *(*uintptr)(unsafe.Pointer(v137))++ *(*uint8)(unsafe.Pointer(v136)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v140 = delta1 v141 = envPtr2 if v140 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v141)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v141)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v141)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v141)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v141 + 64)) += int64(v140) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v143 = envPtr2 + 152 v142 = *(*uintptr)(unsafe.Pointer(v143)) *(*uintptr)(unsafe.Pointer(v143))++ *(*uint8)(unsafe.Pointer(v142)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v145 = envPtr2 + 152 v144 = *(*uintptr)(unsafe.Pointer(v145)) *(*uintptr)(unsafe.Pointer(v145))++ *(*uint8)(unsafe.Pointer(v144)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v147 = envPtr2 + 152 v146 = *(*uintptr)(unsafe.Pointer(v147)) *(*uintptr)(unsafe.Pointer(v147))++ *(*uint8)(unsafe.Pointer(v146)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v149 = envPtr2 + 152 v148 = *(*uintptr)(unsafe.Pointer(v149)) *(*uintptr)(unsafe.Pointer(v149))++ *(*uint8)(unsafe.Pointer(v148)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v151 = envPtr2 + 152 v150 = *(*uintptr)(unsafe.Pointer(v151)) *(*uintptr)(unsafe.Pointer(v151))++ *(*uint8)(unsafe.Pointer(v150)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v152 = delta1 v153 = envPtr2 if v152 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v153)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v153)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v153)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v153)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v153 + 64)) += int64(v152) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v155 = envPtr2 + 152 v154 = *(*uintptr)(unsafe.Pointer(v155)) *(*uintptr)(unsafe.Pointer(v155))++ *(*uint8)(unsafe.Pointer(v154)) = libc.Uint8FromInt32(int32(INST_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v156 = delta1 v157 = envPtr2 if v156 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v157)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v157)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v157)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v157)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v157 + 64)) += int64(v156) } notCodeJumpSource = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v159 = envPtr2 + 152 v158 = *(*uintptr)(unsafe.Pointer(v159)) *(*uintptr)(unsafe.Pointer(v159))++ *(*uint8)(unsafe.Pointer(v158)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE4)) v161 = envPtr2 + 152 v160 = *(*uintptr)(unsafe.Pointer(v161)) *(*uintptr)(unsafe.Pointer(v161))++ *(*uint8)(unsafe.Pointer(v160)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v163 = envPtr2 + 152 v162 = *(*uintptr)(unsafe.Pointer(v163)) *(*uintptr)(unsafe.Pointer(v163))++ *(*uint8)(unsafe.Pointer(v162)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v165 = envPtr2 + 152 v164 = *(*uintptr)(unsafe.Pointer(v165)) *(*uintptr)(unsafe.Pointer(v165))++ *(*uint8)(unsafe.Pointer(v164)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v167 = envPtr2 + 152 v166 = *(*uintptr)(unsafe.Pointer(v167)) *(*uintptr)(unsafe.Pointer(v167))++ *(*uint8)(unsafe.Pointer(v166)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v168 = delta1 v169 = envPtr2 if v168 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v169)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v169)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v169)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v169)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v169 + 64)) += int64(v168) } if *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) != 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) + 32))).Fptr2 != 0 { v171 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) + 32))).Fptr2)).FspanLength } else { v171 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v171 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)), bp+8) } /* * Match the errorcode according to try/trap rules. */ if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v173 = envPtr2 + 152 v172 = *(*uintptr)(unsafe.Pointer(v173)) *(*uintptr)(unsafe.Pointer(v173))++ *(*uint8)(unsafe.Pointer(v172)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v175 = envPtr2 + 152 v174 = *(*uintptr)(unsafe.Pointer(v175)) *(*uintptr)(unsafe.Pointer(v175))++ *(*uint8)(unsafe.Pointer(v174)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v176 = delta1 v177 = envPtr2 if v176 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v177)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v177)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v177)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v177)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v177 + 64)) += int64(v176) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v179 = envPtr2 + 152 v178 = *(*uintptr)(unsafe.Pointer(v179)) *(*uintptr)(unsafe.Pointer(v179))++ *(*uint8)(unsafe.Pointer(v178)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v181 = envPtr2 + 152 v180 = *(*uintptr)(unsafe.Pointer(v181)) *(*uintptr)(unsafe.Pointer(v181))++ *(*uint8)(unsafe.Pointer(v180)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v183 = envPtr2 + 152 v182 = *(*uintptr)(unsafe.Pointer(v183)) *(*uintptr)(unsafe.Pointer(v183))++ *(*uint8)(unsafe.Pointer(v182)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v185 = envPtr2 + 152 v184 = *(*uintptr)(unsafe.Pointer(v185)) *(*uintptr)(unsafe.Pointer(v185))++ *(*uint8)(unsafe.Pointer(v184)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v187 = envPtr2 + 152 v186 = *(*uintptr)(unsafe.Pointer(v187)) *(*uintptr)(unsafe.Pointer(v187))++ *(*uint8)(unsafe.Pointer(v186)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v188 = delta1 v189 = envPtr2 if v188 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v189)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v189)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v189)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v189)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v189 + 64)) += int64(v188) } } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+15231, libc.Int64FromUint64(libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v191 = envPtr2 + 152 v190 = *(*uintptr)(unsafe.Pointer(v191)) *(*uintptr)(unsafe.Pointer(v191))++ *(*uint8)(unsafe.Pointer(v190)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v193 = envPtr2 + 152 v192 = *(*uintptr)(unsafe.Pointer(v193)) *(*uintptr)(unsafe.Pointer(v193))++ *(*uint8)(unsafe.Pointer(v192)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v194 = delta1 v195 = envPtr2 if v194 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v195)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v195)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v195)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v195)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v195 + 64)) += int64(v194) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v197 = envPtr2 + 152 v196 = *(*uintptr)(unsafe.Pointer(v197)) *(*uintptr)(unsafe.Pointer(v197))++ *(*uint8)(unsafe.Pointer(v196)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v199 = envPtr2 + 152 v198 = *(*uintptr)(unsafe.Pointer(v199)) *(*uintptr)(unsafe.Pointer(v199))++ *(*uint8)(unsafe.Pointer(v198)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v201 = envPtr2 + 152 v200 = *(*uintptr)(unsafe.Pointer(v201)) *(*uintptr)(unsafe.Pointer(v201))++ *(*uint8)(unsafe.Pointer(v200)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v203 = envPtr2 + 152 v202 = *(*uintptr)(unsafe.Pointer(v203)) *(*uintptr)(unsafe.Pointer(v203))++ *(*uint8)(unsafe.Pointer(v202)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v205 = envPtr2 + 152 v204 = *(*uintptr)(unsafe.Pointer(v205)) *(*uintptr)(unsafe.Pointer(v205))++ *(*uint8)(unsafe.Pointer(v204)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v206 = delta1 v207 = envPtr2 if v206 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v207)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v207)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v207)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v207)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v207 + 64)) += int64(v206) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v209 = envPtr2 + 152 v208 = *(*uintptr)(unsafe.Pointer(v209)) *(*uintptr)(unsafe.Pointer(v209))++ *(*uint8)(unsafe.Pointer(v208)) = libc.Uint8FromInt32(int32(INST_DICT_GET)) v211 = envPtr2 + 152 v210 = *(*uintptr)(unsafe.Pointer(v211)) *(*uintptr)(unsafe.Pointer(v211))++ *(*uint8)(unsafe.Pointer(v210)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v213 = envPtr2 + 152 v212 = *(*uintptr)(unsafe.Pointer(v213)) *(*uintptr)(unsafe.Pointer(v213))++ *(*uint8)(unsafe.Pointer(v212)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v215 = envPtr2 + 152 v214 = *(*uintptr)(unsafe.Pointer(v215)) *(*uintptr)(unsafe.Pointer(v215))++ *(*uint8)(unsafe.Pointer(v214)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v217 = envPtr2 + 152 v216 = *(*uintptr)(unsafe.Pointer(v217)) *(*uintptr)(unsafe.Pointer(v217))++ *(*uint8)(unsafe.Pointer(v216)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_GET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v218 = delta1 v219 = envPtr2 if v218 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v219)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v219)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v219)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v219)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v219 + 64)) += int64(v218) } v220 = -int32(1) v221 = envPtr2 if v220 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v221)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v221)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v221)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v221)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v221 + 64)) += int64(v220) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v223 = envPtr2 + 152 v222 = *(*uintptr)(unsafe.Pointer(v223)) *(*uintptr)(unsafe.Pointer(v223))++ *(*uint8)(unsafe.Pointer(v222)) = libc.Uint8FromInt32(int32(INST_LIST_RANGE_IMM)) v225 = envPtr2 + 152 v224 = *(*uintptr)(unsafe.Pointer(v225)) *(*uintptr)(unsafe.Pointer(v225))++ *(*uint8)(unsafe.Pointer(v224)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v227 = envPtr2 + 152 v226 = *(*uintptr)(unsafe.Pointer(v227)) *(*uintptr)(unsafe.Pointer(v227))++ *(*uint8)(unsafe.Pointer(v226)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v229 = envPtr2 + 152 v228 = *(*uintptr)(unsafe.Pointer(v229)) *(*uintptr)(unsafe.Pointer(v229))++ *(*uint8)(unsafe.Pointer(v228)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v231 = envPtr2 + 152 v230 = *(*uintptr)(unsafe.Pointer(v231)) *(*uintptr)(unsafe.Pointer(v231))++ *(*uint8)(unsafe.Pointer(v230)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v232 = delta1 v233 = envPtr2 if v232 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v233)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v233)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v233)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v233)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v233 + 64)) += int64(v232) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v235 = envPtr2 + 152 v234 = *(*uintptr)(unsafe.Pointer(v235)) *(*uintptr)(unsafe.Pointer(v235))++ *(*uint8)(unsafe.Pointer(v234)) = uint8(libc.Uint32FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8))-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(24)) v237 = envPtr2 + 152 v236 = *(*uintptr)(unsafe.Pointer(v237)) *(*uintptr)(unsafe.Pointer(v237))++ *(*uint8)(unsafe.Pointer(v236)) = uint8(libc.Uint32FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8))-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(16)) v239 = envPtr2 + 152 v238 = *(*uintptr)(unsafe.Pointer(v239)) *(*uintptr)(unsafe.Pointer(v239))++ *(*uint8)(unsafe.Pointer(v238)) = uint8(libc.Uint32FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8))-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(8)) v241 = envPtr2 + 152 v240 = *(*uintptr)(unsafe.Pointer(v241)) *(*uintptr)(unsafe.Pointer(v241))++ *(*uint8)(unsafe.Pointer(v240)) = uint8(libc.Uint32FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8)) - libc.Int64FromInt32(1))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)))).Flength v242 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)))).Fbytes } else { v242 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)), bp) } p = v242 _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, p, *(*TTcl_Size)(unsafe.Pointer(bp)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v244 = envPtr2 + 152 v243 = *(*uintptr)(unsafe.Pointer(v244)) *(*uintptr)(unsafe.Pointer(v244))++ *(*uint8)(unsafe.Pointer(v243)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v246 = envPtr2 + 152 v245 = *(*uintptr)(unsafe.Pointer(v246)) *(*uintptr)(unsafe.Pointer(v246))++ *(*uint8)(unsafe.Pointer(v245)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v247 = delta1 v248 = envPtr2 if v247 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v248)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v248)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v248)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v248)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v248 + 64)) += int64(v247) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v250 = envPtr2 + 152 v249 = *(*uintptr)(unsafe.Pointer(v250)) *(*uintptr)(unsafe.Pointer(v250))++ *(*uint8)(unsafe.Pointer(v249)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v252 = envPtr2 + 152 v251 = *(*uintptr)(unsafe.Pointer(v252)) *(*uintptr)(unsafe.Pointer(v252))++ *(*uint8)(unsafe.Pointer(v251)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v254 = envPtr2 + 152 v253 = *(*uintptr)(unsafe.Pointer(v254)) *(*uintptr)(unsafe.Pointer(v254))++ *(*uint8)(unsafe.Pointer(v253)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v256 = envPtr2 + 152 v255 = *(*uintptr)(unsafe.Pointer(v256)) *(*uintptr)(unsafe.Pointer(v256))++ *(*uint8)(unsafe.Pointer(v255)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v258 = envPtr2 + 152 v257 = *(*uintptr)(unsafe.Pointer(v258)) *(*uintptr)(unsafe.Pointer(v258))++ *(*uint8)(unsafe.Pointer(v257)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v259 = delta1 v260 = envPtr2 if v259 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v260)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v260)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v260)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v260)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v260 + 64)) += int64(v259) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v262 = envPtr2 + 152 v261 = *(*uintptr)(unsafe.Pointer(v262)) *(*uintptr)(unsafe.Pointer(v262))++ *(*uint8)(unsafe.Pointer(v261)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v263 = delta1 v264 = envPtr2 if v263 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v264)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v264)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v264)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v264)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v264 + 64)) += int64(v263) } notECJumpSource = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v266 = envPtr2 + 152 v265 = *(*uintptr)(unsafe.Pointer(v266)) *(*uintptr)(unsafe.Pointer(v266))++ *(*uint8)(unsafe.Pointer(v265)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE4)) v268 = envPtr2 + 152 v267 = *(*uintptr)(unsafe.Pointer(v268)) *(*uintptr)(unsafe.Pointer(v268))++ *(*uint8)(unsafe.Pointer(v267)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v270 = envPtr2 + 152 v269 = *(*uintptr)(unsafe.Pointer(v270)) *(*uintptr)(unsafe.Pointer(v270))++ *(*uint8)(unsafe.Pointer(v269)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v272 = envPtr2 + 152 v271 = *(*uintptr)(unsafe.Pointer(v272)) *(*uintptr)(unsafe.Pointer(v272))++ *(*uint8)(unsafe.Pointer(v271)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v274 = envPtr2 + 152 v273 = *(*uintptr)(unsafe.Pointer(v274)) *(*uintptr)(unsafe.Pointer(v274))++ *(*uint8)(unsafe.Pointer(v273)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v275 = delta1 v276 = envPtr2 if v275 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v276)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v276)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v276)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v276)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v276 + 64)) += int64(v275) } } else { notECJumpSource = -int32(1) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v278 = envPtr2 + 152 v277 = *(*uintptr)(unsafe.Pointer(v278)) *(*uintptr)(unsafe.Pointer(v278))++ *(*uint8)(unsafe.Pointer(v277)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v279 = delta1 v280 = envPtr2 if v279 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v280)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v280)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v280)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v280)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v280 + 64)) += int64(v279) } /* * There is no finally clause, so we can avoid wrapping a catch * context around the handler. That simplifies what instructions need * to be issued a lot since we can let errors just fall through. */ if *(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)) >= 0 { if resultVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v282 = envPtr2 + 152 v281 = *(*uintptr)(unsafe.Pointer(v282)) *(*uintptr)(unsafe.Pointer(v282))++ *(*uint8)(unsafe.Pointer(v281)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v284 = envPtr2 + 152 v283 = *(*uintptr)(unsafe.Pointer(v284)) *(*uintptr)(unsafe.Pointer(v284))++ *(*uint8)(unsafe.Pointer(v283)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v285 = delta1 v286 = envPtr2 if v285 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v286)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v286)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v286)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v286)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v286 + 64)) += int64(v285) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v288 = envPtr2 + 152 v287 = *(*uintptr)(unsafe.Pointer(v288)) *(*uintptr)(unsafe.Pointer(v288))++ *(*uint8)(unsafe.Pointer(v287)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v290 = envPtr2 + 152 v289 = *(*uintptr)(unsafe.Pointer(v290)) *(*uintptr)(unsafe.Pointer(v290))++ *(*uint8)(unsafe.Pointer(v289)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(24)) v292 = envPtr2 + 152 v291 = *(*uintptr)(unsafe.Pointer(v292)) *(*uintptr)(unsafe.Pointer(v292))++ *(*uint8)(unsafe.Pointer(v291)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(16)) v294 = envPtr2 + 152 v293 = *(*uintptr)(unsafe.Pointer(v294)) *(*uintptr)(unsafe.Pointer(v294))++ *(*uint8)(unsafe.Pointer(v293)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(8)) v296 = envPtr2 + 152 v295 = *(*uintptr)(unsafe.Pointer(v296)) *(*uintptr)(unsafe.Pointer(v296))++ *(*uint8)(unsafe.Pointer(v295)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v297 = delta1 v298 = envPtr2 if v297 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v298)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v298)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v298)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v298)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v298 + 64)) += int64(v297) } } if *(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)) < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v300 = envPtr2 + 152 v299 = *(*uintptr)(unsafe.Pointer(v300)) *(*uintptr)(unsafe.Pointer(v300))++ *(*uint8)(unsafe.Pointer(v299)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v302 = envPtr2 + 152 v301 = *(*uintptr)(unsafe.Pointer(v302)) *(*uintptr)(unsafe.Pointer(v302))++ *(*uint8)(unsafe.Pointer(v301)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)) } v303 = delta1 v304 = envPtr2 if v303 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v304)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v304)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v304)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v304)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v304 + 64)) += int64(v303) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v306 = envPtr2 + 152 v305 = *(*uintptr)(unsafe.Pointer(v306)) *(*uintptr)(unsafe.Pointer(v306))++ *(*uint8)(unsafe.Pointer(v305)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v308 = envPtr2 + 152 v307 = *(*uintptr)(unsafe.Pointer(v308)) *(*uintptr)(unsafe.Pointer(v308))++ *(*uint8)(unsafe.Pointer(v307)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4))) >> libc.Int32FromInt32(24)) v310 = envPtr2 + 152 v309 = *(*uintptr)(unsafe.Pointer(v310)) *(*uintptr)(unsafe.Pointer(v310))++ *(*uint8)(unsafe.Pointer(v309)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4))) >> libc.Int32FromInt32(16)) v312 = envPtr2 + 152 v311 = *(*uintptr)(unsafe.Pointer(v312)) *(*uintptr)(unsafe.Pointer(v312))++ *(*uint8)(unsafe.Pointer(v311)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4))) >> libc.Int32FromInt32(8)) v314 = envPtr2 + 152 v313 = *(*uintptr)(unsafe.Pointer(v314)) *(*uintptr)(unsafe.Pointer(v314))++ *(*uint8)(unsafe.Pointer(v313)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)) } v315 = delta1 v316 = envPtr2 if v315 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v316)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v316)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v316)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v316)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v316 + 64)) += int64(v315) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v318 = envPtr2 + 152 v317 = *(*uintptr)(unsafe.Pointer(v318)) *(*uintptr)(unsafe.Pointer(v318))++ *(*uint8)(unsafe.Pointer(v317)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v319 = delta1 v320 = envPtr2 if v319 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v320)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v320)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v320)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v320)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v320 + 64)) += int64(v319) } if *(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)) >= 0 { if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v322 = envPtr2 + 152 v321 = *(*uintptr)(unsafe.Pointer(v322)) *(*uintptr)(unsafe.Pointer(v322))++ *(*uint8)(unsafe.Pointer(v321)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v324 = envPtr2 + 152 v323 = *(*uintptr)(unsafe.Pointer(v324)) *(*uintptr)(unsafe.Pointer(v324))++ *(*uint8)(unsafe.Pointer(v323)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v325 = delta1 v326 = envPtr2 if v325 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v326)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v326)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v326)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v326)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v326 + 64)) += int64(v325) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v328 = envPtr2 + 152 v327 = *(*uintptr)(unsafe.Pointer(v328)) *(*uintptr)(unsafe.Pointer(v328))++ *(*uint8)(unsafe.Pointer(v327)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v330 = envPtr2 + 152 v329 = *(*uintptr)(unsafe.Pointer(v330)) *(*uintptr)(unsafe.Pointer(v330))++ *(*uint8)(unsafe.Pointer(v329)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v332 = envPtr2 + 152 v331 = *(*uintptr)(unsafe.Pointer(v332)) *(*uintptr)(unsafe.Pointer(v332))++ *(*uint8)(unsafe.Pointer(v331)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v334 = envPtr2 + 152 v333 = *(*uintptr)(unsafe.Pointer(v334)) *(*uintptr)(unsafe.Pointer(v334))++ *(*uint8)(unsafe.Pointer(v333)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v336 = envPtr2 + 152 v335 = *(*uintptr)(unsafe.Pointer(v336)) *(*uintptr)(unsafe.Pointer(v336))++ *(*uint8)(unsafe.Pointer(v335)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v337 = delta1 v338 = envPtr2 if v337 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v338)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v338)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v338)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v338)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v338 + 64)) += int64(v337) } } if *(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)) < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v340 = envPtr2 + 152 v339 = *(*uintptr)(unsafe.Pointer(v340)) *(*uintptr)(unsafe.Pointer(v340))++ *(*uint8)(unsafe.Pointer(v339)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v342 = envPtr2 + 152 v341 = *(*uintptr)(unsafe.Pointer(v342)) *(*uintptr)(unsafe.Pointer(v342))++ *(*uint8)(unsafe.Pointer(v341)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)) } v343 = delta1 v344 = envPtr2 if v343 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v344)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v344)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v344)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v344)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v344 + 64)) += int64(v343) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v346 = envPtr2 + 152 v345 = *(*uintptr)(unsafe.Pointer(v346)) *(*uintptr)(unsafe.Pointer(v346))++ *(*uint8)(unsafe.Pointer(v345)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v348 = envPtr2 + 152 v347 = *(*uintptr)(unsafe.Pointer(v348)) *(*uintptr)(unsafe.Pointer(v348))++ *(*uint8)(unsafe.Pointer(v347)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4))) >> libc.Int32FromInt32(24)) v350 = envPtr2 + 152 v349 = *(*uintptr)(unsafe.Pointer(v350)) *(*uintptr)(unsafe.Pointer(v350))++ *(*uint8)(unsafe.Pointer(v349)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4))) >> libc.Int32FromInt32(16)) v352 = envPtr2 + 152 v351 = *(*uintptr)(unsafe.Pointer(v352)) *(*uintptr)(unsafe.Pointer(v352))++ *(*uint8)(unsafe.Pointer(v351)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4))) >> libc.Int32FromInt32(8)) v354 = envPtr2 + 152 v353 = *(*uintptr)(unsafe.Pointer(v354)) *(*uintptr)(unsafe.Pointer(v354))++ *(*uint8)(unsafe.Pointer(v353)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)) } v355 = delta1 v356 = envPtr2 if v355 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v356)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v356)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v356)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v356)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v356 + 64)) += int64(v355) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v358 = envPtr2 + 152 v357 = *(*uintptr)(unsafe.Pointer(v358)) *(*uintptr)(unsafe.Pointer(v358))++ *(*uint8)(unsafe.Pointer(v357)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v359 = delta1 v360 = envPtr2 if v359 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v360)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v360)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v360)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v360)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v360 + 64)) += int64(v359) } } } if !(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i1)*8)) != 0) { forwardsNeedFixing = int32(1) *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i1)*4)) = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v362 = envPtr2 + 152 v361 = *(*uintptr)(unsafe.Pointer(v362)) *(*uintptr)(unsafe.Pointer(v362))++ *(*uint8)(unsafe.Pointer(v361)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v364 = envPtr2 + 152 v363 = *(*uintptr)(unsafe.Pointer(v364)) *(*uintptr)(unsafe.Pointer(v364))++ *(*uint8)(unsafe.Pointer(v363)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v366 = envPtr2 + 152 v365 = *(*uintptr)(unsafe.Pointer(v366)) *(*uintptr)(unsafe.Pointer(v366))++ *(*uint8)(unsafe.Pointer(v365)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v368 = envPtr2 + 152 v367 = *(*uintptr)(unsafe.Pointer(v368)) *(*uintptr)(unsafe.Pointer(v368))++ *(*uint8)(unsafe.Pointer(v367)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v370 = envPtr2 + 152 v369 = *(*uintptr)(unsafe.Pointer(v370)) *(*uintptr)(unsafe.Pointer(v370))++ *(*uint8)(unsafe.Pointer(v369)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v371 = delta1 v372 = envPtr2 if v371 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v372)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v372)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v372)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v372)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v372 + 64)) += int64(v371) } v373 = int32(1) v374 = envPtr2 if v373 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v374)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v374)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v374)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v374)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v374 + 64)) += int64(v373) } else { *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i1)*4)) = -int32(1) if forwardsNeedFixing != 0 { forwardsNeedFixing = 0 j = 0 for { if !(j < i1) { break } if *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)) == -int32(1) { goto _375 } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))))) *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)) = -int32(1) goto _375 _375: ; j++ } } range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v377 = envPtr2 + 152 v376 = *(*uintptr)(unsafe.Pointer(v377)) *(*uintptr)(unsafe.Pointer(v377))++ *(*uint8)(unsafe.Pointer(v376)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v379 = envPtr2 + 152 v378 = *(*uintptr)(unsafe.Pointer(v379)) *(*uintptr)(unsafe.Pointer(v379))++ *(*uint8)(unsafe.Pointer(v378)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v381 = envPtr2 + 152 v380 = *(*uintptr)(unsafe.Pointer(v381)) *(*uintptr)(unsafe.Pointer(v381))++ *(*uint8)(unsafe.Pointer(v380)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v383 = envPtr2 + 152 v382 = *(*uintptr)(unsafe.Pointer(v383)) *(*uintptr)(unsafe.Pointer(v383))++ *(*uint8)(unsafe.Pointer(v382)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v385 = envPtr2 + 152 v384 = *(*uintptr)(unsafe.Pointer(v385)) *(*uintptr)(unsafe.Pointer(v385))++ *(*uint8)(unsafe.Pointer(v384)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v386 = delta1 v387 = envPtr2 if v386 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v387)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v387)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v387)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v387)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v387 + 64)) += int64(v386) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v388 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v388 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v388 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(libc.Int32FromInt32(5)+i1*libc.Int32FromInt32(4))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(libc.Int32FromInt32(5)+i1*libc.Int32FromInt32(4))*8)) XTclCompileCmdWord(tls, interp, *(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i1)*8))+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i1)*8)))).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v390 = envPtr2 + 152 v389 = *(*uintptr)(unsafe.Pointer(v390)) *(*uintptr)(unsafe.Pointer(v390))++ *(*uint8)(unsafe.Pointer(v389)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v391 = delta1 v392 = envPtr2 if v391 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v392)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v392)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v392)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v392)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v392 + 64)) += int64(v391) } *(*int32)(unsafe.Pointer(noError + uintptr(i1)*4)) = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v394 = envPtr2 + 152 v393 = *(*uintptr)(unsafe.Pointer(v394)) *(*uintptr)(unsafe.Pointer(v394))++ *(*uint8)(unsafe.Pointer(v393)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v396 = envPtr2 + 152 v395 = *(*uintptr)(unsafe.Pointer(v396)) *(*uintptr)(unsafe.Pointer(v396))++ *(*uint8)(unsafe.Pointer(v395)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v398 = envPtr2 + 152 v397 = *(*uintptr)(unsafe.Pointer(v398)) *(*uintptr)(unsafe.Pointer(v398))++ *(*uint8)(unsafe.Pointer(v397)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v400 = envPtr2 + 152 v399 = *(*uintptr)(unsafe.Pointer(v400)) *(*uintptr)(unsafe.Pointer(v400))++ *(*uint8)(unsafe.Pointer(v399)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v402 = envPtr2 + 152 v401 = *(*uintptr)(unsafe.Pointer(v402)) *(*uintptr)(unsafe.Pointer(v402))++ *(*uint8)(unsafe.Pointer(v401)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v403 = delta1 v404 = envPtr2 if v403 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v404)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v404)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v404)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v404)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v404 + 64)) += int64(v403) } (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) v405 = -int32(1) v406 = envPtr2 if v405 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v406)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v406)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v406)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v406)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v406 + 64)) += int64(v405) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v408 = envPtr2 + 152 v407 = *(*uintptr)(unsafe.Pointer(v408)) *(*uintptr)(unsafe.Pointer(v408))++ *(*uint8)(unsafe.Pointer(v407)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v409 = delta1 v410 = envPtr2 if v409 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v410)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v410)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v410)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v410)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v410 + 64)) += int64(v409) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v412 = envPtr2 + 152 v411 = *(*uintptr)(unsafe.Pointer(v412)) *(*uintptr)(unsafe.Pointer(v412))++ *(*uint8)(unsafe.Pointer(v411)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v413 = delta1 v414 = envPtr2 if v413 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v414)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v414)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v414)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v414)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v414 + 64)) += int64(v413) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v416 = envPtr2 + 152 v415 = *(*uintptr)(unsafe.Pointer(v416)) *(*uintptr)(unsafe.Pointer(v416))++ *(*uint8)(unsafe.Pointer(v415)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v417 = delta1 v418 = envPtr2 if v417 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v418)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v418)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v418)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v418)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v418 + 64)) += int64(v417) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v420 = envPtr2 + 152 v419 = *(*uintptr)(unsafe.Pointer(v420)) *(*uintptr)(unsafe.Pointer(v420))++ *(*uint8)(unsafe.Pointer(v419)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v421 = delta1 v422 = envPtr2 if v421 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v422)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v422)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v422)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v422)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v422 + 64)) += int64(v421) } _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v424 = envPtr2 + 152 v423 = *(*uintptr)(unsafe.Pointer(v424)) *(*uintptr)(unsafe.Pointer(v424))++ *(*uint8)(unsafe.Pointer(v423)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v426 = envPtr2 + 152 v425 = *(*uintptr)(unsafe.Pointer(v426)) *(*uintptr)(unsafe.Pointer(v426))++ *(*uint8)(unsafe.Pointer(v425)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v427 = delta1 v428 = envPtr2 if v427 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v428)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v428)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v428)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v428)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v428 + 64)) += int64(v427) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v430 = envPtr2 + 152 v429 = *(*uintptr)(unsafe.Pointer(v430)) *(*uintptr)(unsafe.Pointer(v430))++ *(*uint8)(unsafe.Pointer(v429)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v432 = envPtr2 + 152 v431 = *(*uintptr)(unsafe.Pointer(v432)) *(*uintptr)(unsafe.Pointer(v432))++ *(*uint8)(unsafe.Pointer(v431)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v434 = envPtr2 + 152 v433 = *(*uintptr)(unsafe.Pointer(v434)) *(*uintptr)(unsafe.Pointer(v434))++ *(*uint8)(unsafe.Pointer(v433)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v436 = envPtr2 + 152 v435 = *(*uintptr)(unsafe.Pointer(v436)) *(*uintptr)(unsafe.Pointer(v436))++ *(*uint8)(unsafe.Pointer(v435)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v438 = envPtr2 + 152 v437 = *(*uintptr)(unsafe.Pointer(v438)) *(*uintptr)(unsafe.Pointer(v438))++ *(*uint8)(unsafe.Pointer(v437)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v439 = delta1 v440 = envPtr2 if v439 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v440)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v440)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v440)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v440)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v440 + 64)) += int64(v439) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v442 = envPtr2 + 152 v441 = *(*uintptr)(unsafe.Pointer(v442)) *(*uintptr)(unsafe.Pointer(v442))++ *(*uint8)(unsafe.Pointer(v441)) = libc.Uint8FromInt32(int32(INST_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v443 = delta1 v444 = envPtr2 if v443 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v444)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v444)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v444)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v444)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v444 + 64)) += int64(v443) } dontChangeOptions = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v446 = envPtr2 + 152 v445 = *(*uintptr)(unsafe.Pointer(v446)) *(*uintptr)(unsafe.Pointer(v446))++ *(*uint8)(unsafe.Pointer(v445)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v448 = envPtr2 + 152 v447 = *(*uintptr)(unsafe.Pointer(v448)) *(*uintptr)(unsafe.Pointer(v448))++ *(*uint8)(unsafe.Pointer(v447)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v449 = delta1 v450 = envPtr2 if v449 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v450)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v450)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v450)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v450)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v450 + 64)) += int64(v449) } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v452 = envPtr2 + 152 v451 = *(*uintptr)(unsafe.Pointer(v452)) *(*uintptr)(unsafe.Pointer(v452))++ *(*uint8)(unsafe.Pointer(v451)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v454 = envPtr2 + 152 v453 = *(*uintptr)(unsafe.Pointer(v454)) *(*uintptr)(unsafe.Pointer(v454))++ *(*uint8)(unsafe.Pointer(v453)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v455 = delta1 v456 = envPtr2 if v455 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v456)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v456)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v456)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v456)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v456 + 64)) += int64(v455) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v458 = envPtr2 + 152 v457 = *(*uintptr)(unsafe.Pointer(v458)) *(*uintptr)(unsafe.Pointer(v458))++ *(*uint8)(unsafe.Pointer(v457)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v460 = envPtr2 + 152 v459 = *(*uintptr)(unsafe.Pointer(v460)) *(*uintptr)(unsafe.Pointer(v460))++ *(*uint8)(unsafe.Pointer(v459)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v462 = envPtr2 + 152 v461 = *(*uintptr)(unsafe.Pointer(v462)) *(*uintptr)(unsafe.Pointer(v462))++ *(*uint8)(unsafe.Pointer(v461)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v464 = envPtr2 + 152 v463 = *(*uintptr)(unsafe.Pointer(v464)) *(*uintptr)(unsafe.Pointer(v464))++ *(*uint8)(unsafe.Pointer(v463)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v466 = envPtr2 + 152 v465 = *(*uintptr)(unsafe.Pointer(v466)) *(*uintptr)(unsafe.Pointer(v466))++ *(*uint8)(unsafe.Pointer(v465)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v467 = delta1 v468 = envPtr2 if v467 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v468)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v468)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v468)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v468)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v468 + 64)) += int64(v467) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v470 = envPtr2 + 152 v469 = *(*uintptr)(unsafe.Pointer(v470)) *(*uintptr)(unsafe.Pointer(v470))++ *(*uint8)(unsafe.Pointer(v469)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v472 = envPtr2 + 152 v471 = *(*uintptr)(unsafe.Pointer(v472)) *(*uintptr)(unsafe.Pointer(v472))++ *(*uint8)(unsafe.Pointer(v471)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v474 = envPtr2 + 152 v473 = *(*uintptr)(unsafe.Pointer(v474)) *(*uintptr)(unsafe.Pointer(v474))++ *(*uint8)(unsafe.Pointer(v473)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v476 = envPtr2 + 152 v475 = *(*uintptr)(unsafe.Pointer(v476)) *(*uintptr)(unsafe.Pointer(v476))++ *(*uint8)(unsafe.Pointer(v475)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v478 = envPtr2 + 152 v477 = *(*uintptr)(unsafe.Pointer(v478)) *(*uintptr)(unsafe.Pointer(v478))++ *(*uint8)(unsafe.Pointer(v477)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v479 = delta1 v480 = envPtr2 if v479 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v480)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v480)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v480)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v480)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v480 + 64)) += int64(v479) } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v482 = envPtr2 + 152 v481 = *(*uintptr)(unsafe.Pointer(v482)) *(*uintptr)(unsafe.Pointer(v482))++ *(*uint8)(unsafe.Pointer(v481)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v484 = envPtr2 + 152 v483 = *(*uintptr)(unsafe.Pointer(v484)) *(*uintptr)(unsafe.Pointer(v484))++ *(*uint8)(unsafe.Pointer(v483)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v485 = delta1 v486 = envPtr2 if v485 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v486)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v486)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v486)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v486)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v486 + 64)) += int64(v485) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v488 = envPtr2 + 152 v487 = *(*uintptr)(unsafe.Pointer(v488)) *(*uintptr)(unsafe.Pointer(v488))++ *(*uint8)(unsafe.Pointer(v487)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v490 = envPtr2 + 152 v489 = *(*uintptr)(unsafe.Pointer(v490)) *(*uintptr)(unsafe.Pointer(v490))++ *(*uint8)(unsafe.Pointer(v489)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v492 = envPtr2 + 152 v491 = *(*uintptr)(unsafe.Pointer(v492)) *(*uintptr)(unsafe.Pointer(v492))++ *(*uint8)(unsafe.Pointer(v491)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v494 = envPtr2 + 152 v493 = *(*uintptr)(unsafe.Pointer(v494)) *(*uintptr)(unsafe.Pointer(v494))++ *(*uint8)(unsafe.Pointer(v493)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v496 = envPtr2 + 152 v495 = *(*uintptr)(unsafe.Pointer(v496)) *(*uintptr)(unsafe.Pointer(v496))++ *(*uint8)(unsafe.Pointer(v495)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v497 = delta1 v498 = envPtr2 if v497 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v498)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v498)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v498)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v498)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v498 + 64)) += int64(v497) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v500 = envPtr2 + 152 v499 = *(*uintptr)(unsafe.Pointer(v500)) *(*uintptr)(unsafe.Pointer(v500))++ *(*uint8)(unsafe.Pointer(v499)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v501 = delta1 v502 = envPtr2 if v501 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v502)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v502)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v502)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v502)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v502 + 64)) += int64(v501) } _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21234, libc.Int64FromUint64(libc.Uint64FromInt64(8)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v504 = envPtr2 + 152 v503 = *(*uintptr)(unsafe.Pointer(v504)) *(*uintptr)(unsafe.Pointer(v504))++ *(*uint8)(unsafe.Pointer(v503)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v506 = envPtr2 + 152 v505 = *(*uintptr)(unsafe.Pointer(v506)) *(*uintptr)(unsafe.Pointer(v506))++ *(*uint8)(unsafe.Pointer(v505)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v507 = delta1 v508 = envPtr2 if v507 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v508)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v508)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v508)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v508)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v508 + 64)) += int64(v507) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v510 = envPtr2 + 152 v509 = *(*uintptr)(unsafe.Pointer(v510)) *(*uintptr)(unsafe.Pointer(v510))++ *(*uint8)(unsafe.Pointer(v509)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v512 = envPtr2 + 152 v511 = *(*uintptr)(unsafe.Pointer(v512)) *(*uintptr)(unsafe.Pointer(v512))++ *(*uint8)(unsafe.Pointer(v511)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v514 = envPtr2 + 152 v513 = *(*uintptr)(unsafe.Pointer(v514)) *(*uintptr)(unsafe.Pointer(v514))++ *(*uint8)(unsafe.Pointer(v513)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v516 = envPtr2 + 152 v515 = *(*uintptr)(unsafe.Pointer(v516)) *(*uintptr)(unsafe.Pointer(v516))++ *(*uint8)(unsafe.Pointer(v515)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v518 = envPtr2 + 152 v517 = *(*uintptr)(unsafe.Pointer(v518)) *(*uintptr)(unsafe.Pointer(v518))++ *(*uint8)(unsafe.Pointer(v517)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v519 = delta1 v520 = envPtr2 if v519 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v520)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v520)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v520)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v520)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v520 + 64)) += int64(v519) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v522 = envPtr2 + 152 v521 = *(*uintptr)(unsafe.Pointer(v522)) *(*uintptr)(unsafe.Pointer(v522))++ *(*uint8)(unsafe.Pointer(v521)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v524 = envPtr2 + 152 v523 = *(*uintptr)(unsafe.Pointer(v524)) *(*uintptr)(unsafe.Pointer(v524))++ *(*uint8)(unsafe.Pointer(v523)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v526 = envPtr2 + 152 v525 = *(*uintptr)(unsafe.Pointer(v526)) *(*uintptr)(unsafe.Pointer(v526))++ *(*uint8)(unsafe.Pointer(v525)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v528 = envPtr2 + 152 v527 = *(*uintptr)(unsafe.Pointer(v528)) *(*uintptr)(unsafe.Pointer(v528))++ *(*uint8)(unsafe.Pointer(v527)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v530 = envPtr2 + 152 v529 = *(*uintptr)(unsafe.Pointer(v530)) *(*uintptr)(unsafe.Pointer(v530))++ *(*uint8)(unsafe.Pointer(v529)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v531 = delta1 v532 = envPtr2 if v531 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v532)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v532)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v532)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v532)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v532 + 64)) += int64(v531) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v534 = envPtr2 + 152 v533 = *(*uintptr)(unsafe.Pointer(v534)) *(*uintptr)(unsafe.Pointer(v534))++ *(*uint8)(unsafe.Pointer(v533)) = libc.Uint8FromInt32(int32(INST_DICT_SET)) v536 = envPtr2 + 152 v535 = *(*uintptr)(unsafe.Pointer(v536)) *(*uintptr)(unsafe.Pointer(v536))++ *(*uint8)(unsafe.Pointer(v535)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v538 = envPtr2 + 152 v537 = *(*uintptr)(unsafe.Pointer(v538)) *(*uintptr)(unsafe.Pointer(v538))++ *(*uint8)(unsafe.Pointer(v537)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v540 = envPtr2 + 152 v539 = *(*uintptr)(unsafe.Pointer(v540)) *(*uintptr)(unsafe.Pointer(v540))++ *(*uint8)(unsafe.Pointer(v539)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v542 = envPtr2 + 152 v541 = *(*uintptr)(unsafe.Pointer(v542)) *(*uintptr)(unsafe.Pointer(v542))++ *(*uint8)(unsafe.Pointer(v541)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_SET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v543 = delta1 v544 = envPtr2 if v543 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v544)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v544)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v544)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v544)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v544 + 64)) += int64(v543) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v546 = envPtr2 + 152 v545 = *(*uintptr)(unsafe.Pointer(v546)) *(*uintptr)(unsafe.Pointer(v546))++ *(*uint8)(unsafe.Pointer(v545)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v548 = envPtr2 + 152 v547 = *(*uintptr)(unsafe.Pointer(v548)) *(*uintptr)(unsafe.Pointer(v548))++ *(*uint8)(unsafe.Pointer(v547)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v550 = envPtr2 + 152 v549 = *(*uintptr)(unsafe.Pointer(v550)) *(*uintptr)(unsafe.Pointer(v550))++ *(*uint8)(unsafe.Pointer(v549)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v552 = envPtr2 + 152 v551 = *(*uintptr)(unsafe.Pointer(v552)) *(*uintptr)(unsafe.Pointer(v552))++ *(*uint8)(unsafe.Pointer(v551)) = uint8(libc.Uint32FromInt32(optionsVar)) v553 = -int32(1) v554 = envPtr2 if v553 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v554)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v554)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v554)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v554)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v554 + 64)) += int64(v553) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(dontChangeOptions) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(dontChangeOptions))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v556 = envPtr2 + 152 v555 = *(*uintptr)(unsafe.Pointer(v556)) *(*uintptr)(unsafe.Pointer(v556))++ *(*uint8)(unsafe.Pointer(v555)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v558 = envPtr2 + 152 v557 = *(*uintptr)(unsafe.Pointer(v558)) *(*uintptr)(unsafe.Pointer(v558))++ *(*uint8)(unsafe.Pointer(v557)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v560 = envPtr2 + 152 v559 = *(*uintptr)(unsafe.Pointer(v560)) *(*uintptr)(unsafe.Pointer(v560))++ *(*uint8)(unsafe.Pointer(v559)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v562 = envPtr2 + 152 v561 = *(*uintptr)(unsafe.Pointer(v562)) *(*uintptr)(unsafe.Pointer(v562))++ *(*uint8)(unsafe.Pointer(v561)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v564 = envPtr2 + 152 v563 = *(*uintptr)(unsafe.Pointer(v564)) *(*uintptr)(unsafe.Pointer(v564))++ *(*uint8)(unsafe.Pointer(v563)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v565 = delta1 v566 = envPtr2 if v565 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v566)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v566)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v566)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v566)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v566 + 64)) += int64(v565) } XTclEmitInvoke(tls, envPtr2, int32(INST_RETURN_STK), 0) } *(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4)) = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v568 = envPtr2 + 152 v567 = *(*uintptr)(unsafe.Pointer(v568)) *(*uintptr)(unsafe.Pointer(v568))++ *(*uint8)(unsafe.Pointer(v567)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v570 = envPtr2 + 152 v569 = *(*uintptr)(unsafe.Pointer(v570)) *(*uintptr)(unsafe.Pointer(v570))++ *(*uint8)(unsafe.Pointer(v569)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v572 = envPtr2 + 152 v571 = *(*uintptr)(unsafe.Pointer(v572)) *(*uintptr)(unsafe.Pointer(v572))++ *(*uint8)(unsafe.Pointer(v571)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v574 = envPtr2 + 152 v573 = *(*uintptr)(unsafe.Pointer(v574)) *(*uintptr)(unsafe.Pointer(v574))++ *(*uint8)(unsafe.Pointer(v573)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v576 = envPtr2 + 152 v575 = *(*uintptr)(unsafe.Pointer(v576)) *(*uintptr)(unsafe.Pointer(v576))++ *(*uint8)(unsafe.Pointer(v575)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v577 = delta1 v578 = envPtr2 if v577 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v578)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v578)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v578)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v578)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v578 + 64)) += int64(v577) } if *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) != 0 { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notECJumpSource) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notECJumpSource)) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notECJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notECJumpSource)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notECJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notECJumpSource)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notECJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(notECJumpSource))) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notCodeJumpSource) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notCodeJumpSource)) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notCodeJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notCodeJumpSource)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notCodeJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notCodeJumpSource)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notCodeJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(notCodeJumpSource))) goto _131 _131: ; i1++ } /* * Drop the result code since it didn't match any clause, and reissue the * exception. Note also that INST_RETURN_STK can proceed to the next * instruction. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v580 = envPtr2 + 152 v579 = *(*uintptr)(unsafe.Pointer(v580)) *(*uintptr)(unsafe.Pointer(v580))++ *(*uint8)(unsafe.Pointer(v579)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v581 = delta1 v582 = envPtr2 if v581 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v582)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v582)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v582)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v582)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v582 + 64)) += int64(v581) } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v584 = envPtr2 + 152 v583 = *(*uintptr)(unsafe.Pointer(v584)) *(*uintptr)(unsafe.Pointer(v584))++ *(*uint8)(unsafe.Pointer(v583)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v586 = envPtr2 + 152 v585 = *(*uintptr)(unsafe.Pointer(v586)) *(*uintptr)(unsafe.Pointer(v586))++ *(*uint8)(unsafe.Pointer(v585)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v587 = delta1 v588 = envPtr2 if v587 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v588)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v588)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v588)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v588)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v588 + 64)) += int64(v587) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v590 = envPtr2 + 152 v589 = *(*uintptr)(unsafe.Pointer(v590)) *(*uintptr)(unsafe.Pointer(v590))++ *(*uint8)(unsafe.Pointer(v589)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v592 = envPtr2 + 152 v591 = *(*uintptr)(unsafe.Pointer(v592)) *(*uintptr)(unsafe.Pointer(v592))++ *(*uint8)(unsafe.Pointer(v591)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v594 = envPtr2 + 152 v593 = *(*uintptr)(unsafe.Pointer(v594)) *(*uintptr)(unsafe.Pointer(v594))++ *(*uint8)(unsafe.Pointer(v593)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v596 = envPtr2 + 152 v595 = *(*uintptr)(unsafe.Pointer(v596)) *(*uintptr)(unsafe.Pointer(v596))++ *(*uint8)(unsafe.Pointer(v595)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v598 = envPtr2 + 152 v597 = *(*uintptr)(unsafe.Pointer(v598)) *(*uintptr)(unsafe.Pointer(v598))++ *(*uint8)(unsafe.Pointer(v597)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v599 = delta1 v600 = envPtr2 if v599 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v600)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v600)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v600)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v600)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v600 + 64)) += int64(v599) } } if resultVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v602 = envPtr2 + 152 v601 = *(*uintptr)(unsafe.Pointer(v602)) *(*uintptr)(unsafe.Pointer(v602))++ *(*uint8)(unsafe.Pointer(v601)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v604 = envPtr2 + 152 v603 = *(*uintptr)(unsafe.Pointer(v604)) *(*uintptr)(unsafe.Pointer(v604))++ *(*uint8)(unsafe.Pointer(v603)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v605 = delta1 v606 = envPtr2 if v605 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v606)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v606)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v606)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v606)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v606 + 64)) += int64(v605) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v608 = envPtr2 + 152 v607 = *(*uintptr)(unsafe.Pointer(v608)) *(*uintptr)(unsafe.Pointer(v608))++ *(*uint8)(unsafe.Pointer(v607)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v610 = envPtr2 + 152 v609 = *(*uintptr)(unsafe.Pointer(v610)) *(*uintptr)(unsafe.Pointer(v610))++ *(*uint8)(unsafe.Pointer(v609)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(24)) v612 = envPtr2 + 152 v611 = *(*uintptr)(unsafe.Pointer(v612)) *(*uintptr)(unsafe.Pointer(v612))++ *(*uint8)(unsafe.Pointer(v611)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(16)) v614 = envPtr2 + 152 v613 = *(*uintptr)(unsafe.Pointer(v614)) *(*uintptr)(unsafe.Pointer(v614))++ *(*uint8)(unsafe.Pointer(v613)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(8)) v616 = envPtr2 + 152 v615 = *(*uintptr)(unsafe.Pointer(v616)) *(*uintptr)(unsafe.Pointer(v616))++ *(*uint8)(unsafe.Pointer(v615)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v617 = delta1 v618 = envPtr2 if v617 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v618)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v618)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v618)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v618)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v618 + 64)) += int64(v617) } } XTclEmitInvoke(tls, envPtr2, int32(INST_RETURN_STK), 0) /* * Fix all the jumps from taken clauses to here (which is the end of the * [try]). */ if !(trapZero != 0) { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(afterBody) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(afterBody)) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(afterBody) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(afterBody)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(afterBody) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(afterBody)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(afterBody) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(afterBody))) } i1 = 0 for { if !(i1 < numHandlers) { break } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4)))) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4)))) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4)))) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))))) if *(*int32)(unsafe.Pointer(noError + uintptr(i1)*4)) != -int32(1) { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(noError + uintptr(i1)*4))) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(noError + uintptr(i1)*4)))) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(noError + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(noError + uintptr(i1)*4)))) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(noError + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(noError + uintptr(i1)*4)))) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(noError + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(*(*int32)(unsafe.Pointer(noError + uintptr(i1)*4))))) } goto _619 _619: ; i1++ } XTclStackFree(tls, interp, noError) XTclStackFree(tls, interp, forwardsToFix) XTclStackFree(tls, interp, addrsToFix) return TCL_OK } func _IssueTryClausesFinallyInstructions(tls *libc.TLS, interp uintptr, envPtr2 uintptr, bodyToken uintptr, numHandlers int32, matchCodes uintptr, matchClauses uintptr, resultVars uintptr, optionVars uintptr, handlerTokens uintptr, finallyToken uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Not NULL */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objIndexCopy7, _objIndexCopy8, _objIndexCopy9, afterBody, delta1, finalError, finalOK, forwardsNeedFixing, i1, j, noFinalError, noTrapError, notCodeJumpSource, notECJumpSource, optionsVar, range1, resultVar, trapError, trapZero, v109, v12, v121, v127, v129, v133, v137, v141, v145, v151, v163, v167, v17, v173, v185, v189, v194, v200, v212, v216, v228, v23, v236, v248, v254, v266, v278, v280, v292, v307, v319, v323, v335, v339, v35, v351, v358, v370, v376, v388, v39, v392, v398, v410, v416, v428, v432, v436, v448, v45, v460, v466, v479, v485, v497, v501, v513, v519, v521, v525, v529, v533, v537, v543, v555, v559, v565, v57, v577, v581, v587, v593, v605, v611, v623, v63, v635, v641, v653, v657, v669, v679, v685, v691, v703, v707, v719, v721, v725, v738, v743, v747, v75, v753, v757, v761, v765, v769, v775, v787, v79, v791, v797, v803, v815, v821, v833, v845, v851, v863, v867, v879, v889, v893, v899, v901, v907, v91, v919, v923, v929, v941, v945, v951, v963, v969, v97, v981 int32 var addrsToFix, forwardsToFix, mapPtr, p, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v120, v122, v123, v124, v125, v126, v128, v13, v130, v131, v132, v134, v135, v136, v138, v139, v140, v142, v143, v144, v146, v147, v148, v149, v15, v150, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v164, v165, v166, v168, v169, v170, v171, v172, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v186, v187, v188, v19, v190, v192, v193, v195, v196, v197, v198, v199, v2, v20, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v213, v214, v215, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v229, v232, v233, v234, v235, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v249, v25, v250, v251, v252, v253, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v267, v268, v269, v27, v270, v271, v272, v273, v274, v275, v276, v277, v279, v28, v281, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v293, v294, v295, v296, v297, v298, v299, v3, v30, v300, v301, v302, v303, v304, v305, v306, v308, v309, v31, v310, v311, v312, v313, v314, v315, v316, v317, v318, v32, v320, v321, v322, v324, v325, v326, v327, v328, v329, v33, v330, v331, v332, v333, v334, v336, v337, v338, v34, v340, v341, v342, v343, v344, v345, v346, v347, v348, v349, v350, v352, v354, v355, v356, v357, v359, v36, v360, v361, v362, v363, v364, v365, v366, v367, v368, v369, v37, v371, v372, v373, v374, v375, v377, v378, v379, v38, v380, v381, v382, v383, v384, v385, v386, v387, v389, v390, v391, v393, v394, v395, v396, v397, v399, v4, v40, v400, v401, v402, v403, v404, v405, v406, v407, v408, v409, v41, v411, v412, v413, v414, v415, v417, v418, v419, v42, v420, v421, v422, v423, v424, v425, v426, v427, v429, v43, v430, v431, v433, v434, v435, v437, v438, v439, v44, v440, v441, v442, v443, v444, v445, v446, v447, v449, v450, v451, v452, v453, v454, v455, v456, v457, v458, v459, v46, v461, v462, v463, v464, v465, v467, v469, v47, v470, v471, v472, v473, v474, v475, v476, v477, v478, v48, v480, v481, v482, v483, v484, v486, v487, v488, v489, v49, v490, v491, v492, v493, v494, v495, v496, v498, v499, v5, v50, v500, v502, v503, v504, v505, v506, v507, v508, v509, v51, v510, v511, v512, v514, v515, v516, v517, v518, v52, v520, v522, v523, v524, v526, v527, v528, v53, v530, v531, v532, v534, v535, v536, v538, v539, v54, v540, v541, v542, v544, v545, v546, v547, v548, v549, v55, v550, v551, v552, v553, v554, v556, v557, v558, v56, v560, v561, v562, v563, v564, v566, v567, v568, v569, v570, v571, v572, v573, v574, v575, v576, v578, v579, v58, v580, v582, v583, v584, v585, v586, v588, v589, v59, v590, v591, v592, v594, v595, v596, v597, v598, v599, v6, v60, v600, v601, v602, v603, v604, v606, v607, v608, v609, v61, v610, v612, v613, v614, v615, v616, v617, v618, v619, v62, v620, v621, v622, v624, v625, v626, v627, v628, v629, v630, v631, v632, v633, v634, v636, v637, v638, v639, v64, v640, v642, v643, v644, v645, v646, v647, v648, v649, v65, v650, v651, v652, v654, v655, v656, v658, v659, v66, v660, v661, v662, v663, v664, v665, v666, v667, v668, v67, v670, v671, v672, v673, v674, v675, v676, v677, v678, v68, v680, v681, v682, v683, v684, v686, v687, v688, v689, v69, v690, v692, v693, v694, v695, v696, v697, v698, v699, v7, v70, v700, v701, v702, v704, v705, v706, v708, v709, v71, v710, v711, v712, v713, v714, v715, v716, v717, v718, v72, v720, v722, v723, v724, v726, v728, v729, v73, v730, v731, v732, v733, v734, v735, v736, v737, v739, v74, v741, v742, v744, v745, v746, v748, v749, v750, v751, v752, v754, v755, v756, v758, v759, v76, v760, v762, v763, v764, v766, v767, v768, v77, v770, v771, v772, v773, v774, v776, v777, v778, v779, v78, v780, v781, v782, v783, v784, v785, v786, v788, v789, v790, v792, v793, v794, v795, v796, v798, v799, v8, v80, v800, v801, v802, v804, v805, v806, v807, v808, v809, v81, v810, v811, v812, v813, v814, v816, v817, v818, v819, v82, v820, v822, v823, v824, v825, v826, v827, v828, v829, v83, v830, v831, v832, v834, v835, v836, v837, v838, v839, v84, v840, v841, v842, v843, v844, v846, v847, v848, v849, v85, v850, v852, v853, v854, v855, v856, v857, v858, v859, v86, v860, v861, v862, v864, v865, v866, v868, v869, v87, v870, v871, v872, v873, v874, v875, v876, v877, v878, v88, v880, v881, v882, v883, v884, v885, v886, v887, v888, v89, v890, v891, v892, v894, v895, v896, v897, v898, v9, v90, v900, v902, v903, v904, v905, v906, v908, v909, v910, v911, v912, v913, v914, v915, v916, v917, v918, v92, v920, v921, v922, v924, v925, v926, v927, v928, v93, v930, v931, v932, v933, v934, v935, v936, v937, v938, v939, v94, v940, v942, v943, v944, v946, v947, v948, v949, v95, v950, v952, v953, v954, v955, v956, v957, v958, v959, v96, v960, v961, v962, v964, v965, v966, v967, v968, v970, v971, v972, v973, v974, v975, v976, v977, v978, v979, v98, v980, v982, v99 uintptr var eclIndex TTcl_Size var v14, v231, v353, v740 int64 var _ /* buf at bp+0 */ [24]uint8 var _ /* len at bp+32 */ TTcl_Size var _ /* slen at bp+24 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, _objIndexCopy6, _objIndexCopy7, _objIndexCopy8, _objIndexCopy9, addrsToFix, afterBody, delta1, eclIndex, finalError, finalOK, forwardsNeedFixing, forwardsToFix, i1, j, mapPtr, noFinalError, noTrapError, notCodeJumpSource, notECJumpSource, optionsVar, p, range1, resultVar, trapError, trapZero, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v192, v193, v194, v195, v196, v197, v198, v199, v2, v20, v200, v201, v202, v203, v204, v205, v206, v207, v208, v209, v21, v210, v211, v212, v213, v214, v215, v216, v217, v218, v219, v22, v220, v221, v222, v223, v224, v225, v226, v227, v228, v229, v23, v231, v232, v233, v234, v235, v236, v237, v238, v239, v24, v240, v241, v242, v243, v244, v245, v246, v247, v248, v249, v25, v250, v251, v252, v253, v254, v255, v256, v257, v258, v259, v26, v260, v261, v262, v263, v264, v265, v266, v267, v268, v269, v27, v270, v271, v272, v273, v274, v275, v276, v277, v278, v279, v28, v280, v281, v282, v283, v284, v285, v286, v287, v288, v289, v29, v290, v291, v292, v293, v294, v295, v296, v297, v298, v299, v3, v30, v300, v301, v302, v303, v304, v305, v306, v307, v308, v309, v31, v310, v311, v312, v313, v314, v315, v316, v317, v318, v319, v32, v320, v321, v322, v323, v324, v325, v326, v327, v328, v329, v33, v330, v331, v332, v333, v334, v335, v336, v337, v338, v339, v34, v340, v341, v342, v343, v344, v345, v346, v347, v348, v349, v35, v350, v351, v352, v353, v354, v355, v356, v357, v358, v359, v36, v360, v361, v362, v363, v364, v365, v366, v367, v368, v369, v37, v370, v371, v372, v373, v374, v375, v376, v377, v378, v379, v38, v380, v381, v382, v383, v384, v385, v386, v387, v388, v389, v39, v390, v391, v392, v393, v394, v395, v396, v397, v398, v399, v4, v40, v400, v401, v402, v403, v404, v405, v406, v407, v408, v409, v41, v410, v411, v412, v413, v414, v415, v416, v417, v418, v419, v42, v420, v421, v422, v423, v424, v425, v426, v427, v428, v429, v43, v430, v431, v432, v433, v434, v435, v436, v437, v438, v439, v44, v440, v441, v442, v443, v444, v445, v446, v447, v448, v449, v45, v450, v451, v452, v453, v454, v455, v456, v457, v458, v459, v46, v460, v461, v462, v463, v464, v465, v466, v467, v469, v47, v470, v471, v472, v473, v474, v475, v476, v477, v478, v479, v48, v480, v481, v482, v483, v484, v485, v486, v487, v488, v489, v49, v490, v491, v492, v493, v494, v495, v496, v497, v498, v499, v5, v50, v500, v501, v502, v503, v504, v505, v506, v507, v508, v509, v51, v510, v511, v512, v513, v514, v515, v516, v517, v518, v519, v52, v520, v521, v522, v523, v524, v525, v526, v527, v528, v529, v53, v530, v531, v532, v533, v534, v535, v536, v537, v538, v539, v54, v540, v541, v542, v543, v544, v545, v546, v547, v548, v549, v55, v550, v551, v552, v553, v554, v555, v556, v557, v558, v559, v56, v560, v561, v562, v563, v564, v565, v566, v567, v568, v569, v57, v570, v571, v572, v573, v574, v575, v576, v577, v578, v579, v58, v580, v581, v582, v583, v584, v585, v586, v587, v588, v589, v59, v590, v591, v592, v593, v594, v595, v596, v597, v598, v599, v6, v60, v600, v601, v602, v603, v604, v605, v606, v607, v608, v609, v61, v610, v611, v612, v613, v614, v615, v616, v617, v618, v619, v62, v620, v621, v622, v623, v624, v625, v626, v627, v628, v629, v63, v630, v631, v632, v633, v634, v635, v636, v637, v638, v639, v64, v640, v641, v642, v643, v644, v645, v646, v647, v648, v649, v65, v650, v651, v652, v653, v654, v655, v656, v657, v658, v659, v66, v660, v661, v662, v663, v664, v665, v666, v667, v668, v669, v67, v670, v671, v672, v673, v674, v675, v676, v677, v678, v679, v68, v680, v681, v682, v683, v684, v685, v686, v687, v688, v689, v69, v690, v691, v692, v693, v694, v695, v696, v697, v698, v699, v7, v70, v700, v701, v702, v703, v704, v705, v706, v707, v708, v709, v71, v710, v711, v712, v713, v714, v715, v716, v717, v718, v719, v72, v720, v721, v722, v723, v724, v725, v726, v728, v729, v73, v730, v731, v732, v733, v734, v735, v736, v737, v738, v739, v74, v740, v741, v742, v743, v744, v745, v746, v747, v748, v749, v75, v750, v751, v752, v753, v754, v755, v756, v757, v758, v759, v76, v760, v761, v762, v763, v764, v765, v766, v767, v768, v769, v77, v770, v771, v772, v773, v774, v775, v776, v777, v778, v779, v78, v780, v781, v782, v783, v784, v785, v786, v787, v788, v789, v79, v790, v791, v792, v793, v794, v795, v796, v797, v798, v799, v8, v80, v800, v801, v802, v803, v804, v805, v806, v807, v808, v809, v81, v810, v811, v812, v813, v814, v815, v816, v817, v818, v819, v82, v820, v821, v822, v823, v824, v825, v826, v827, v828, v829, v83, v830, v831, v832, v833, v834, v835, v836, v837, v838, v839, v84, v840, v841, v842, v843, v844, v845, v846, v847, v848, v849, v85, v850, v851, v852, v853, v854, v855, v856, v857, v858, v859, v86, v860, v861, v862, v863, v864, v865, v866, v867, v868, v869, v87, v870, v871, v872, v873, v874, v875, v876, v877, v878, v879, v88, v880, v881, v882, v883, v884, v885, v886, v887, v888, v889, v89, v890, v891, v892, v893, v894, v895, v896, v897, v898, v899, v9, v90, v900, v901, v902, v903, v904, v905, v906, v907, v908, v909, v91, v910, v911, v912, v913, v914, v915, v916, v917, v918, v919, v92, v920, v921, v922, v923, v924, v925, v926, v927, v928, v929, v93, v930, v931, v932, v933, v934, v935, v936, v937, v938, v939, v94, v940, v941, v942, v943, v944, v945, v946, v947, v948, v949, v95, v950, v951, v952, v953, v954, v955, v956, v957, v958, v959, v96, v960, v961, v962, v963, v964, v965, v966, v967, v968, v969, v97, v970, v971, v972, v973, v974, v975, v976, v977, v978, v979, v98, v980, v981, v982, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) forwardsNeedFixing = 0 trapZero = 0 afterBody = 0 resultVar = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) optionsVar = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) if resultVar < 0 || optionsVar < 0 { return int32(TCL_ERROR) } /* * Check if we're supposed to trap a normal TCL_OK completion of the body. * If not, we can handle that case much more efficiently. */ i1 = 0 for { if !(i1 < numHandlers) { break } if *(*int32)(unsafe.Pointer(matchCodes + uintptr(i1)*4)) == 0 { trapZero = int32(1) break } goto _1 _1: ; i1++ } /* * Compile the body, trapping any error in it so that we can trap on it * (if any trap matches) and run a finally clause. */ range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v12 = delta1 v13 = envPtr2 if v12 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v13 + 64)) += int64(v12) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v14 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v14 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v14 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileCmdWord(tls, interp, bodyToken+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) if !(trapZero != 0) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } if resultVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+22354, libc.Int64FromUint64(libc.Uint64FromInt64(17)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v45 = delta1 v46 = envPtr2 if v45 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v46 + 64)) += int64(v45) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v57 = delta1 v58 = envPtr2 if v57 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v58)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v58)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v58 + 64)) += int64(v57) } } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v63 = delta1 v64 = envPtr2 if v63 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v64 + 64)) += int64(v63) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v72 = envPtr2 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v75 = delta1 v76 = envPtr2 if v75 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v76 + 64)) += int64(v75) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v79 = delta1 v80 = envPtr2 if v79 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v80)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v80)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v80)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v80)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v80 + 64)) += int64(v79) } afterBody = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v91 = delta1 v92 = envPtr2 if v91 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v92 + 64)) += int64(v91) } } else { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v94 = envPtr2 + 152 v93 = *(*uintptr)(unsafe.Pointer(v94)) *(*uintptr)(unsafe.Pointer(v94))++ *(*uint8)(unsafe.Pointer(v93)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v97 = delta1 v98 = envPtr2 if v97 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v98)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v98)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v98)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v98)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v98 + 64)) += int64(v97) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v100 = envPtr2 + 152 v99 = *(*uintptr)(unsafe.Pointer(v100)) *(*uintptr)(unsafe.Pointer(v100))++ *(*uint8)(unsafe.Pointer(v99)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v104 = envPtr2 + 152 v103 = *(*uintptr)(unsafe.Pointer(v104)) *(*uintptr)(unsafe.Pointer(v104))++ *(*uint8)(unsafe.Pointer(v103)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v109 = delta1 v110 = envPtr2 if v109 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v110)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v110)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v110)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v110)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v110 + 64)) += int64(v109) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v121 = delta1 v122 = envPtr2 if v121 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v122)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v122)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v122)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v122)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v122 + 64)) += int64(v121) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v124 = envPtr2 + 152 v123 = *(*uintptr)(unsafe.Pointer(v124)) *(*uintptr)(unsafe.Pointer(v124))++ *(*uint8)(unsafe.Pointer(v123)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v126 = envPtr2 + 152 v125 = *(*uintptr)(unsafe.Pointer(v126)) *(*uintptr)(unsafe.Pointer(v126))++ *(*uint8)(unsafe.Pointer(v125)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(4) } v127 = delta1 v128 = envPtr2 if v127 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v128)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v128)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v128)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v128)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v128 + 64)) += int64(v127) } v129 = -int32(2) v130 = envPtr2 if v129 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v130)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v130)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v130)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v130)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v130 + 64)) += int64(v129) } (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v132 = envPtr2 + 152 v131 = *(*uintptr)(unsafe.Pointer(v132)) *(*uintptr)(unsafe.Pointer(v132))++ *(*uint8)(unsafe.Pointer(v131)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v133 = delta1 v134 = envPtr2 if v133 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v134)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v134)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v134)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v134)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v134 + 64)) += int64(v133) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v136 = envPtr2 + 152 v135 = *(*uintptr)(unsafe.Pointer(v136)) *(*uintptr)(unsafe.Pointer(v136))++ *(*uint8)(unsafe.Pointer(v135)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v137 = delta1 v138 = envPtr2 if v137 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v138)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v138)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v138)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v138)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v138 + 64)) += int64(v137) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v140 = envPtr2 + 152 v139 = *(*uintptr)(unsafe.Pointer(v140)) *(*uintptr)(unsafe.Pointer(v140))++ *(*uint8)(unsafe.Pointer(v139)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v141 = delta1 v142 = envPtr2 if v141 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v142)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v142)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v142)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v142)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v142 + 64)) += int64(v141) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v144 = envPtr2 + 152 v143 = *(*uintptr)(unsafe.Pointer(v144)) *(*uintptr)(unsafe.Pointer(v144))++ *(*uint8)(unsafe.Pointer(v143)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v145 = delta1 v146 = envPtr2 if v145 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v146 + 64)) += int64(v145) } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v148 = envPtr2 + 152 v147 = *(*uintptr)(unsafe.Pointer(v148)) *(*uintptr)(unsafe.Pointer(v148))++ *(*uint8)(unsafe.Pointer(v147)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v150 = envPtr2 + 152 v149 = *(*uintptr)(unsafe.Pointer(v150)) *(*uintptr)(unsafe.Pointer(v150))++ *(*uint8)(unsafe.Pointer(v149)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v151 = delta1 v152 = envPtr2 if v151 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v152)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v152)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v152)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v152)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v152 + 64)) += int64(v151) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v154 = envPtr2 + 152 v153 = *(*uintptr)(unsafe.Pointer(v154)) *(*uintptr)(unsafe.Pointer(v154))++ *(*uint8)(unsafe.Pointer(v153)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v156 = envPtr2 + 152 v155 = *(*uintptr)(unsafe.Pointer(v156)) *(*uintptr)(unsafe.Pointer(v156))++ *(*uint8)(unsafe.Pointer(v155)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v158 = envPtr2 + 152 v157 = *(*uintptr)(unsafe.Pointer(v158)) *(*uintptr)(unsafe.Pointer(v158))++ *(*uint8)(unsafe.Pointer(v157)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v160 = envPtr2 + 152 v159 = *(*uintptr)(unsafe.Pointer(v160)) *(*uintptr)(unsafe.Pointer(v160))++ *(*uint8)(unsafe.Pointer(v159)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v162 = envPtr2 + 152 v161 = *(*uintptr)(unsafe.Pointer(v162)) *(*uintptr)(unsafe.Pointer(v162))++ *(*uint8)(unsafe.Pointer(v161)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v163 = delta1 v164 = envPtr2 if v163 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v164)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v164)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v164)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v164)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v164 + 64)) += int64(v163) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v166 = envPtr2 + 152 v165 = *(*uintptr)(unsafe.Pointer(v166)) *(*uintptr)(unsafe.Pointer(v166))++ *(*uint8)(unsafe.Pointer(v165)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v167 = delta1 v168 = envPtr2 if v167 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v168)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v168)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v168)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v168)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v168 + 64)) += int64(v167) } if resultVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v170 = envPtr2 + 152 v169 = *(*uintptr)(unsafe.Pointer(v170)) *(*uintptr)(unsafe.Pointer(v170))++ *(*uint8)(unsafe.Pointer(v169)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v172 = envPtr2 + 152 v171 = *(*uintptr)(unsafe.Pointer(v172)) *(*uintptr)(unsafe.Pointer(v172))++ *(*uint8)(unsafe.Pointer(v171)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v173 = delta1 v174 = envPtr2 if v173 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v174)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v174)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v174)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v174)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v174 + 64)) += int64(v173) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v176 = envPtr2 + 152 v175 = *(*uintptr)(unsafe.Pointer(v176)) *(*uintptr)(unsafe.Pointer(v176))++ *(*uint8)(unsafe.Pointer(v175)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v178 = envPtr2 + 152 v177 = *(*uintptr)(unsafe.Pointer(v178)) *(*uintptr)(unsafe.Pointer(v178))++ *(*uint8)(unsafe.Pointer(v177)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(24)) v180 = envPtr2 + 152 v179 = *(*uintptr)(unsafe.Pointer(v180)) *(*uintptr)(unsafe.Pointer(v180))++ *(*uint8)(unsafe.Pointer(v179)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(16)) v182 = envPtr2 + 152 v181 = *(*uintptr)(unsafe.Pointer(v182)) *(*uintptr)(unsafe.Pointer(v182))++ *(*uint8)(unsafe.Pointer(v181)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(8)) v184 = envPtr2 + 152 v183 = *(*uintptr)(unsafe.Pointer(v184)) *(*uintptr)(unsafe.Pointer(v184))++ *(*uint8)(unsafe.Pointer(v183)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v185 = delta1 v186 = envPtr2 if v185 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v186)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v186)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v186)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v186)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v186 + 64)) += int64(v185) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v188 = envPtr2 + 152 v187 = *(*uintptr)(unsafe.Pointer(v188)) *(*uintptr)(unsafe.Pointer(v188))++ *(*uint8)(unsafe.Pointer(v187)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v189 = delta1 v190 = envPtr2 if v189 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v190)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v190)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v190)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v190)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v190 + 64)) += int64(v189) } /* * Now we handle all the registered 'on' and 'trap' handlers in order. * * Slight overallocation, but reduces size of this function. */ addrsToFix = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt32(numHandlers)) forwardsToFix = XTclStackAlloc(tls, interp, uint64(4)*libc.Uint64FromInt32(numHandlers)) i1 = 0 for { if !(i1 < numHandlers) { break } libc.X__builtin_snprintf(tls, bp, uint64(24), __ccgo_ts+260, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(matchCodes + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v193 = envPtr2 + 152 v192 = *(*uintptr)(unsafe.Pointer(v193)) *(*uintptr)(unsafe.Pointer(v193))++ *(*uint8)(unsafe.Pointer(v192)) = libc.Uint8FromInt32(int32(INST_DUP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DUP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v194 = delta1 v195 = envPtr2 if v194 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v195)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v195)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v195)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v195)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v195 + 64)) += int64(v194) } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, bp, libc.Int64FromUint64(libc.Xstrlen(tls, bp)), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v197 = envPtr2 + 152 v196 = *(*uintptr)(unsafe.Pointer(v197)) *(*uintptr)(unsafe.Pointer(v197))++ *(*uint8)(unsafe.Pointer(v196)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v199 = envPtr2 + 152 v198 = *(*uintptr)(unsafe.Pointer(v199)) *(*uintptr)(unsafe.Pointer(v199))++ *(*uint8)(unsafe.Pointer(v198)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v200 = delta1 v201 = envPtr2 if v200 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v201)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v201)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v201)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v201)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v201 + 64)) += int64(v200) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v203 = envPtr2 + 152 v202 = *(*uintptr)(unsafe.Pointer(v203)) *(*uintptr)(unsafe.Pointer(v203))++ *(*uint8)(unsafe.Pointer(v202)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v205 = envPtr2 + 152 v204 = *(*uintptr)(unsafe.Pointer(v205)) *(*uintptr)(unsafe.Pointer(v205))++ *(*uint8)(unsafe.Pointer(v204)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v207 = envPtr2 + 152 v206 = *(*uintptr)(unsafe.Pointer(v207)) *(*uintptr)(unsafe.Pointer(v207))++ *(*uint8)(unsafe.Pointer(v206)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v209 = envPtr2 + 152 v208 = *(*uintptr)(unsafe.Pointer(v209)) *(*uintptr)(unsafe.Pointer(v209))++ *(*uint8)(unsafe.Pointer(v208)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v211 = envPtr2 + 152 v210 = *(*uintptr)(unsafe.Pointer(v211)) *(*uintptr)(unsafe.Pointer(v211))++ *(*uint8)(unsafe.Pointer(v210)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v212 = delta1 v213 = envPtr2 if v212 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v213)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v213)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v213)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v213)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v213 + 64)) += int64(v212) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v215 = envPtr2 + 152 v214 = *(*uintptr)(unsafe.Pointer(v215)) *(*uintptr)(unsafe.Pointer(v215))++ *(*uint8)(unsafe.Pointer(v214)) = libc.Uint8FromInt32(int32(INST_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v216 = delta1 v217 = envPtr2 if v216 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v217)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v217)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v217)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v217)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v217 + 64)) += int64(v216) } notCodeJumpSource = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v219 = envPtr2 + 152 v218 = *(*uintptr)(unsafe.Pointer(v219)) *(*uintptr)(unsafe.Pointer(v219))++ *(*uint8)(unsafe.Pointer(v218)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE4)) v221 = envPtr2 + 152 v220 = *(*uintptr)(unsafe.Pointer(v221)) *(*uintptr)(unsafe.Pointer(v221))++ *(*uint8)(unsafe.Pointer(v220)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v223 = envPtr2 + 152 v222 = *(*uintptr)(unsafe.Pointer(v223)) *(*uintptr)(unsafe.Pointer(v223))++ *(*uint8)(unsafe.Pointer(v222)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v225 = envPtr2 + 152 v224 = *(*uintptr)(unsafe.Pointer(v225)) *(*uintptr)(unsafe.Pointer(v225))++ *(*uint8)(unsafe.Pointer(v224)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v227 = envPtr2 + 152 v226 = *(*uintptr)(unsafe.Pointer(v227)) *(*uintptr)(unsafe.Pointer(v227))++ *(*uint8)(unsafe.Pointer(v226)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v228 = delta1 v229 = envPtr2 if v228 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v229)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v229)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v229)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v229)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v229 + 64)) += int64(v228) } if *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) != 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) + 32))).Fptr2 != 0 { v231 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) + 32))).Fptr2)).FspanLength } else { v231 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = v231 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)), bp+32) } /* * Match the errorcode according to try/trap rules. */ if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v233 = envPtr2 + 152 v232 = *(*uintptr)(unsafe.Pointer(v233)) *(*uintptr)(unsafe.Pointer(v233))++ *(*uint8)(unsafe.Pointer(v232)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v235 = envPtr2 + 152 v234 = *(*uintptr)(unsafe.Pointer(v235)) *(*uintptr)(unsafe.Pointer(v235))++ *(*uint8)(unsafe.Pointer(v234)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v236 = delta1 v237 = envPtr2 if v236 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v237)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v237)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v237)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v237)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v237 + 64)) += int64(v236) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v239 = envPtr2 + 152 v238 = *(*uintptr)(unsafe.Pointer(v239)) *(*uintptr)(unsafe.Pointer(v239))++ *(*uint8)(unsafe.Pointer(v238)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v241 = envPtr2 + 152 v240 = *(*uintptr)(unsafe.Pointer(v241)) *(*uintptr)(unsafe.Pointer(v241))++ *(*uint8)(unsafe.Pointer(v240)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v243 = envPtr2 + 152 v242 = *(*uintptr)(unsafe.Pointer(v243)) *(*uintptr)(unsafe.Pointer(v243))++ *(*uint8)(unsafe.Pointer(v242)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v245 = envPtr2 + 152 v244 = *(*uintptr)(unsafe.Pointer(v245)) *(*uintptr)(unsafe.Pointer(v245))++ *(*uint8)(unsafe.Pointer(v244)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v247 = envPtr2 + 152 v246 = *(*uintptr)(unsafe.Pointer(v247)) *(*uintptr)(unsafe.Pointer(v247))++ *(*uint8)(unsafe.Pointer(v246)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v248 = delta1 v249 = envPtr2 if v248 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v249)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v249)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v249)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v249)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v249 + 64)) += int64(v248) } } _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+15231, libc.Int64FromUint64(libc.Uint64FromInt64(11)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v251 = envPtr2 + 152 v250 = *(*uintptr)(unsafe.Pointer(v251)) *(*uintptr)(unsafe.Pointer(v251))++ *(*uint8)(unsafe.Pointer(v250)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v253 = envPtr2 + 152 v252 = *(*uintptr)(unsafe.Pointer(v253)) *(*uintptr)(unsafe.Pointer(v253))++ *(*uint8)(unsafe.Pointer(v252)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v254 = delta1 v255 = envPtr2 if v254 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v255)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v255)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v255)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v255)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v255 + 64)) += int64(v254) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v257 = envPtr2 + 152 v256 = *(*uintptr)(unsafe.Pointer(v257)) *(*uintptr)(unsafe.Pointer(v257))++ *(*uint8)(unsafe.Pointer(v256)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v259 = envPtr2 + 152 v258 = *(*uintptr)(unsafe.Pointer(v259)) *(*uintptr)(unsafe.Pointer(v259))++ *(*uint8)(unsafe.Pointer(v258)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v261 = envPtr2 + 152 v260 = *(*uintptr)(unsafe.Pointer(v261)) *(*uintptr)(unsafe.Pointer(v261))++ *(*uint8)(unsafe.Pointer(v260)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v263 = envPtr2 + 152 v262 = *(*uintptr)(unsafe.Pointer(v263)) *(*uintptr)(unsafe.Pointer(v263))++ *(*uint8)(unsafe.Pointer(v262)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v265 = envPtr2 + 152 v264 = *(*uintptr)(unsafe.Pointer(v265)) *(*uintptr)(unsafe.Pointer(v265))++ *(*uint8)(unsafe.Pointer(v264)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v266 = delta1 v267 = envPtr2 if v266 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v267)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v267)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v267)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v267)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v267 + 64)) += int64(v266) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v269 = envPtr2 + 152 v268 = *(*uintptr)(unsafe.Pointer(v269)) *(*uintptr)(unsafe.Pointer(v269))++ *(*uint8)(unsafe.Pointer(v268)) = libc.Uint8FromInt32(int32(INST_DICT_GET)) v271 = envPtr2 + 152 v270 = *(*uintptr)(unsafe.Pointer(v271)) *(*uintptr)(unsafe.Pointer(v271))++ *(*uint8)(unsafe.Pointer(v270)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v273 = envPtr2 + 152 v272 = *(*uintptr)(unsafe.Pointer(v273)) *(*uintptr)(unsafe.Pointer(v273))++ *(*uint8)(unsafe.Pointer(v272)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v275 = envPtr2 + 152 v274 = *(*uintptr)(unsafe.Pointer(v275)) *(*uintptr)(unsafe.Pointer(v275))++ *(*uint8)(unsafe.Pointer(v274)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v277 = envPtr2 + 152 v276 = *(*uintptr)(unsafe.Pointer(v277)) *(*uintptr)(unsafe.Pointer(v277))++ *(*uint8)(unsafe.Pointer(v276)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_GET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v278 = delta1 v279 = envPtr2 if v278 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v279)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v279)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v279)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v279)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v279 + 64)) += int64(v278) } v280 = -int32(1) v281 = envPtr2 if v280 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v281)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v281)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v281)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v281)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v281 + 64)) += int64(v280) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v283 = envPtr2 + 152 v282 = *(*uintptr)(unsafe.Pointer(v283)) *(*uintptr)(unsafe.Pointer(v283))++ *(*uint8)(unsafe.Pointer(v282)) = libc.Uint8FromInt32(int32(INST_LIST_RANGE_IMM)) v285 = envPtr2 + 152 v284 = *(*uintptr)(unsafe.Pointer(v285)) *(*uintptr)(unsafe.Pointer(v285))++ *(*uint8)(unsafe.Pointer(v284)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v287 = envPtr2 + 152 v286 = *(*uintptr)(unsafe.Pointer(v287)) *(*uintptr)(unsafe.Pointer(v287))++ *(*uint8)(unsafe.Pointer(v286)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v289 = envPtr2 + 152 v288 = *(*uintptr)(unsafe.Pointer(v289)) *(*uintptr)(unsafe.Pointer(v289))++ *(*uint8)(unsafe.Pointer(v288)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v291 = envPtr2 + 152 v290 = *(*uintptr)(unsafe.Pointer(v291)) *(*uintptr)(unsafe.Pointer(v291))++ *(*uint8)(unsafe.Pointer(v290)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_RANGE_IMM)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v292 = delta1 v293 = envPtr2 if v292 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v293)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v293)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v293)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v293)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v293 + 64)) += int64(v292) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v295 = envPtr2 + 152 v294 = *(*uintptr)(unsafe.Pointer(v295)) *(*uintptr)(unsafe.Pointer(v295))++ *(*uint8)(unsafe.Pointer(v294)) = uint8(libc.Uint32FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 32))-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(24)) v297 = envPtr2 + 152 v296 = *(*uintptr)(unsafe.Pointer(v297)) *(*uintptr)(unsafe.Pointer(v297))++ *(*uint8)(unsafe.Pointer(v296)) = uint8(libc.Uint32FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 32))-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(16)) v299 = envPtr2 + 152 v298 = *(*uintptr)(unsafe.Pointer(v299)) *(*uintptr)(unsafe.Pointer(v299))++ *(*uint8)(unsafe.Pointer(v298)) = uint8(libc.Uint32FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 32))-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(8)) v301 = envPtr2 + 152 v300 = *(*uintptr)(unsafe.Pointer(v301)) *(*uintptr)(unsafe.Pointer(v301))++ *(*uint8)(unsafe.Pointer(v300)) = uint8(libc.Uint32FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 32)) - libc.Int64FromInt32(1))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)))).Flength v302 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)))).Fbytes } else { v302 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)), bp+24) } p = v302 _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, p, *(*TTcl_Size)(unsafe.Pointer(bp + 24)), 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v304 = envPtr2 + 152 v303 = *(*uintptr)(unsafe.Pointer(v304)) *(*uintptr)(unsafe.Pointer(v304))++ *(*uint8)(unsafe.Pointer(v303)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v306 = envPtr2 + 152 v305 = *(*uintptr)(unsafe.Pointer(v306)) *(*uintptr)(unsafe.Pointer(v306))++ *(*uint8)(unsafe.Pointer(v305)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v307 = delta1 v308 = envPtr2 if v307 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v308)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v308)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v308)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v308)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v308 + 64)) += int64(v307) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v310 = envPtr2 + 152 v309 = *(*uintptr)(unsafe.Pointer(v310)) *(*uintptr)(unsafe.Pointer(v310))++ *(*uint8)(unsafe.Pointer(v309)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v312 = envPtr2 + 152 v311 = *(*uintptr)(unsafe.Pointer(v312)) *(*uintptr)(unsafe.Pointer(v312))++ *(*uint8)(unsafe.Pointer(v311)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v314 = envPtr2 + 152 v313 = *(*uintptr)(unsafe.Pointer(v314)) *(*uintptr)(unsafe.Pointer(v314))++ *(*uint8)(unsafe.Pointer(v313)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v316 = envPtr2 + 152 v315 = *(*uintptr)(unsafe.Pointer(v316)) *(*uintptr)(unsafe.Pointer(v316))++ *(*uint8)(unsafe.Pointer(v315)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v318 = envPtr2 + 152 v317 = *(*uintptr)(unsafe.Pointer(v318)) *(*uintptr)(unsafe.Pointer(v318))++ *(*uint8)(unsafe.Pointer(v317)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v319 = delta1 v320 = envPtr2 if v319 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v320)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v320)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v320)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v320)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v320 + 64)) += int64(v319) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v322 = envPtr2 + 152 v321 = *(*uintptr)(unsafe.Pointer(v322)) *(*uintptr)(unsafe.Pointer(v322))++ *(*uint8)(unsafe.Pointer(v321)) = libc.Uint8FromInt32(int32(INST_STR_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v323 = delta1 v324 = envPtr2 if v323 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v324)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v324)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v324)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v324)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v324 + 64)) += int64(v323) } notECJumpSource = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v326 = envPtr2 + 152 v325 = *(*uintptr)(unsafe.Pointer(v326)) *(*uintptr)(unsafe.Pointer(v326))++ *(*uint8)(unsafe.Pointer(v325)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE4)) v328 = envPtr2 + 152 v327 = *(*uintptr)(unsafe.Pointer(v328)) *(*uintptr)(unsafe.Pointer(v328))++ *(*uint8)(unsafe.Pointer(v327)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v330 = envPtr2 + 152 v329 = *(*uintptr)(unsafe.Pointer(v330)) *(*uintptr)(unsafe.Pointer(v330))++ *(*uint8)(unsafe.Pointer(v329)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v332 = envPtr2 + 152 v331 = *(*uintptr)(unsafe.Pointer(v332)) *(*uintptr)(unsafe.Pointer(v332))++ *(*uint8)(unsafe.Pointer(v331)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v334 = envPtr2 + 152 v333 = *(*uintptr)(unsafe.Pointer(v334)) *(*uintptr)(unsafe.Pointer(v334))++ *(*uint8)(unsafe.Pointer(v333)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v335 = delta1 v336 = envPtr2 if v335 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v336)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v336)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v336)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v336)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v336 + 64)) += int64(v335) } } else { notECJumpSource = -int32(1) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v338 = envPtr2 + 152 v337 = *(*uintptr)(unsafe.Pointer(v338)) *(*uintptr)(unsafe.Pointer(v338))++ *(*uint8)(unsafe.Pointer(v337)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v339 = delta1 v340 = envPtr2 if v339 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v340)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v340)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v340 + 64)) += int64(v339) } /* * There is a finally clause, so we need a fairly complex sequence of * instructions to deal with an on/trap handler because we must call * the finally handler *and* we need to substitute the result from a * failed trap for the result from the main script. */ if *(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)) >= 0 || *(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i1)*8)) != 0 { range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v342 = envPtr2 + 152 v341 = *(*uintptr)(unsafe.Pointer(v342)) *(*uintptr)(unsafe.Pointer(v342))++ *(*uint8)(unsafe.Pointer(v341)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v344 = envPtr2 + 152 v343 = *(*uintptr)(unsafe.Pointer(v344)) *(*uintptr)(unsafe.Pointer(v344))++ *(*uint8)(unsafe.Pointer(v343)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v346 = envPtr2 + 152 v345 = *(*uintptr)(unsafe.Pointer(v346)) *(*uintptr)(unsafe.Pointer(v346))++ *(*uint8)(unsafe.Pointer(v345)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v348 = envPtr2 + 152 v347 = *(*uintptr)(unsafe.Pointer(v348)) *(*uintptr)(unsafe.Pointer(v348))++ *(*uint8)(unsafe.Pointer(v347)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v350 = envPtr2 + 152 v349 = *(*uintptr)(unsafe.Pointer(v350)) *(*uintptr)(unsafe.Pointer(v350))++ *(*uint8)(unsafe.Pointer(v349)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v351 = delta1 v352 = envPtr2 if v351 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v352)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v352)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v352)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v352)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v352 + 64)) += int64(v351) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v353 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v353 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v353 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) } if *(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)) >= 0 { if resultVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v355 = envPtr2 + 152 v354 = *(*uintptr)(unsafe.Pointer(v355)) *(*uintptr)(unsafe.Pointer(v355))++ *(*uint8)(unsafe.Pointer(v354)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v357 = envPtr2 + 152 v356 = *(*uintptr)(unsafe.Pointer(v357)) *(*uintptr)(unsafe.Pointer(v357))++ *(*uint8)(unsafe.Pointer(v356)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v358 = delta1 v359 = envPtr2 if v358 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v359)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v359)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v359)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v359)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v359 + 64)) += int64(v358) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v361 = envPtr2 + 152 v360 = *(*uintptr)(unsafe.Pointer(v361)) *(*uintptr)(unsafe.Pointer(v361))++ *(*uint8)(unsafe.Pointer(v360)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v363 = envPtr2 + 152 v362 = *(*uintptr)(unsafe.Pointer(v363)) *(*uintptr)(unsafe.Pointer(v363))++ *(*uint8)(unsafe.Pointer(v362)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(24)) v365 = envPtr2 + 152 v364 = *(*uintptr)(unsafe.Pointer(v365)) *(*uintptr)(unsafe.Pointer(v365))++ *(*uint8)(unsafe.Pointer(v364)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(16)) v367 = envPtr2 + 152 v366 = *(*uintptr)(unsafe.Pointer(v367)) *(*uintptr)(unsafe.Pointer(v367))++ *(*uint8)(unsafe.Pointer(v366)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(8)) v369 = envPtr2 + 152 v368 = *(*uintptr)(unsafe.Pointer(v369)) *(*uintptr)(unsafe.Pointer(v369))++ *(*uint8)(unsafe.Pointer(v368)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v370 = delta1 v371 = envPtr2 if v370 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v371)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v371)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v371)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v371)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v371 + 64)) += int64(v370) } } if *(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)) < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v373 = envPtr2 + 152 v372 = *(*uintptr)(unsafe.Pointer(v373)) *(*uintptr)(unsafe.Pointer(v373))++ *(*uint8)(unsafe.Pointer(v372)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v375 = envPtr2 + 152 v374 = *(*uintptr)(unsafe.Pointer(v375)) *(*uintptr)(unsafe.Pointer(v375))++ *(*uint8)(unsafe.Pointer(v374)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)) } v376 = delta1 v377 = envPtr2 if v376 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v377)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v377)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v377)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v377)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v377 + 64)) += int64(v376) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v379 = envPtr2 + 152 v378 = *(*uintptr)(unsafe.Pointer(v379)) *(*uintptr)(unsafe.Pointer(v379))++ *(*uint8)(unsafe.Pointer(v378)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v381 = envPtr2 + 152 v380 = *(*uintptr)(unsafe.Pointer(v381)) *(*uintptr)(unsafe.Pointer(v381))++ *(*uint8)(unsafe.Pointer(v380)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4))) >> libc.Int32FromInt32(24)) v383 = envPtr2 + 152 v382 = *(*uintptr)(unsafe.Pointer(v383)) *(*uintptr)(unsafe.Pointer(v383))++ *(*uint8)(unsafe.Pointer(v382)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4))) >> libc.Int32FromInt32(16)) v385 = envPtr2 + 152 v384 = *(*uintptr)(unsafe.Pointer(v385)) *(*uintptr)(unsafe.Pointer(v385))++ *(*uint8)(unsafe.Pointer(v384)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4))) >> libc.Int32FromInt32(8)) v387 = envPtr2 + 152 v386 = *(*uintptr)(unsafe.Pointer(v387)) *(*uintptr)(unsafe.Pointer(v387))++ *(*uint8)(unsafe.Pointer(v386)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(resultVars + uintptr(i1)*4)) } v388 = delta1 v389 = envPtr2 if v388 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v389)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v389)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v389)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v389)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v389 + 64)) += int64(v388) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v391 = envPtr2 + 152 v390 = *(*uintptr)(unsafe.Pointer(v391)) *(*uintptr)(unsafe.Pointer(v391))++ *(*uint8)(unsafe.Pointer(v390)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v392 = delta1 v393 = envPtr2 if v392 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v393)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v393)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v393)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v393)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v393 + 64)) += int64(v392) } if *(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)) >= 0 { if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v395 = envPtr2 + 152 v394 = *(*uintptr)(unsafe.Pointer(v395)) *(*uintptr)(unsafe.Pointer(v395))++ *(*uint8)(unsafe.Pointer(v394)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v397 = envPtr2 + 152 v396 = *(*uintptr)(unsafe.Pointer(v397)) *(*uintptr)(unsafe.Pointer(v397))++ *(*uint8)(unsafe.Pointer(v396)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v398 = delta1 v399 = envPtr2 if v398 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v399)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v399)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v399)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v399)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v399 + 64)) += int64(v398) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v401 = envPtr2 + 152 v400 = *(*uintptr)(unsafe.Pointer(v401)) *(*uintptr)(unsafe.Pointer(v401))++ *(*uint8)(unsafe.Pointer(v400)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v403 = envPtr2 + 152 v402 = *(*uintptr)(unsafe.Pointer(v403)) *(*uintptr)(unsafe.Pointer(v403))++ *(*uint8)(unsafe.Pointer(v402)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v405 = envPtr2 + 152 v404 = *(*uintptr)(unsafe.Pointer(v405)) *(*uintptr)(unsafe.Pointer(v405))++ *(*uint8)(unsafe.Pointer(v404)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v407 = envPtr2 + 152 v406 = *(*uintptr)(unsafe.Pointer(v407)) *(*uintptr)(unsafe.Pointer(v407))++ *(*uint8)(unsafe.Pointer(v406)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v409 = envPtr2 + 152 v408 = *(*uintptr)(unsafe.Pointer(v409)) *(*uintptr)(unsafe.Pointer(v409))++ *(*uint8)(unsafe.Pointer(v408)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v410 = delta1 v411 = envPtr2 if v410 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v411)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v411)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v411)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v411)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v411 + 64)) += int64(v410) } } if *(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)) < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v413 = envPtr2 + 152 v412 = *(*uintptr)(unsafe.Pointer(v413)) *(*uintptr)(unsafe.Pointer(v413))++ *(*uint8)(unsafe.Pointer(v412)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v415 = envPtr2 + 152 v414 = *(*uintptr)(unsafe.Pointer(v415)) *(*uintptr)(unsafe.Pointer(v415))++ *(*uint8)(unsafe.Pointer(v414)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)) } v416 = delta1 v417 = envPtr2 if v416 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v417)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v417)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v417)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v417)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v417 + 64)) += int64(v416) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v419 = envPtr2 + 152 v418 = *(*uintptr)(unsafe.Pointer(v419)) *(*uintptr)(unsafe.Pointer(v419))++ *(*uint8)(unsafe.Pointer(v418)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v421 = envPtr2 + 152 v420 = *(*uintptr)(unsafe.Pointer(v421)) *(*uintptr)(unsafe.Pointer(v421))++ *(*uint8)(unsafe.Pointer(v420)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4))) >> libc.Int32FromInt32(24)) v423 = envPtr2 + 152 v422 = *(*uintptr)(unsafe.Pointer(v423)) *(*uintptr)(unsafe.Pointer(v423))++ *(*uint8)(unsafe.Pointer(v422)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4))) >> libc.Int32FromInt32(16)) v425 = envPtr2 + 152 v424 = *(*uintptr)(unsafe.Pointer(v425)) *(*uintptr)(unsafe.Pointer(v425))++ *(*uint8)(unsafe.Pointer(v424)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4))) >> libc.Int32FromInt32(8)) v427 = envPtr2 + 152 v426 = *(*uintptr)(unsafe.Pointer(v427)) *(*uintptr)(unsafe.Pointer(v427))++ *(*uint8)(unsafe.Pointer(v426)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - *(*int32)(unsafe.Pointer(optionVars + uintptr(i1)*4)) } v428 = delta1 v429 = envPtr2 if v428 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v429)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v429)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v429)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v429)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v429 + 64)) += int64(v428) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v431 = envPtr2 + 152 v430 = *(*uintptr)(unsafe.Pointer(v431)) *(*uintptr)(unsafe.Pointer(v431))++ *(*uint8)(unsafe.Pointer(v430)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v432 = delta1 v433 = envPtr2 if v432 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v433)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v433)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v433)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v433)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v433 + 64)) += int64(v432) } } if !(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i1)*8)) != 0) { /* * No handler. Will not be the last handler (that is a * condition that is checked by the caller). Chain to the next * one. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v435 = envPtr2 + 152 v434 = *(*uintptr)(unsafe.Pointer(v435)) *(*uintptr)(unsafe.Pointer(v435))++ *(*uint8)(unsafe.Pointer(v434)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v436 = delta1 v437 = envPtr2 if v436 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v437)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v437)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v437)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v437)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v437 + 64)) += int64(v436) } forwardsNeedFixing = int32(1) *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i1)*4)) = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v439 = envPtr2 + 152 v438 = *(*uintptr)(unsafe.Pointer(v439)) *(*uintptr)(unsafe.Pointer(v439))++ *(*uint8)(unsafe.Pointer(v438)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v441 = envPtr2 + 152 v440 = *(*uintptr)(unsafe.Pointer(v441)) *(*uintptr)(unsafe.Pointer(v441))++ *(*uint8)(unsafe.Pointer(v440)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v443 = envPtr2 + 152 v442 = *(*uintptr)(unsafe.Pointer(v443)) *(*uintptr)(unsafe.Pointer(v443))++ *(*uint8)(unsafe.Pointer(v442)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v445 = envPtr2 + 152 v444 = *(*uintptr)(unsafe.Pointer(v445)) *(*uintptr)(unsafe.Pointer(v445))++ *(*uint8)(unsafe.Pointer(v444)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v447 = envPtr2 + 152 v446 = *(*uintptr)(unsafe.Pointer(v447)) *(*uintptr)(unsafe.Pointer(v447))++ *(*uint8)(unsafe.Pointer(v446)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v448 = delta1 v449 = envPtr2 if v448 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v449)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v449)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v449)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v449)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v449 + 64)) += int64(v448) } goto finishTrapCatchHandling } } else { if !(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i1)*8)) != 0) { /* * No handler. Will not be the last handler (that condition is * checked by the caller). Chain to the next one. */ forwardsNeedFixing = int32(1) *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i1)*4)) = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v451 = envPtr2 + 152 v450 = *(*uintptr)(unsafe.Pointer(v451)) *(*uintptr)(unsafe.Pointer(v451))++ *(*uint8)(unsafe.Pointer(v450)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v453 = envPtr2 + 152 v452 = *(*uintptr)(unsafe.Pointer(v453)) *(*uintptr)(unsafe.Pointer(v453))++ *(*uint8)(unsafe.Pointer(v452)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v455 = envPtr2 + 152 v454 = *(*uintptr)(unsafe.Pointer(v455)) *(*uintptr)(unsafe.Pointer(v455))++ *(*uint8)(unsafe.Pointer(v454)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v457 = envPtr2 + 152 v456 = *(*uintptr)(unsafe.Pointer(v457)) *(*uintptr)(unsafe.Pointer(v457))++ *(*uint8)(unsafe.Pointer(v456)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v459 = envPtr2 + 152 v458 = *(*uintptr)(unsafe.Pointer(v459)) *(*uintptr)(unsafe.Pointer(v459))++ *(*uint8)(unsafe.Pointer(v458)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v460 = delta1 v461 = envPtr2 if v460 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v461)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v461)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v461)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v461)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v461 + 64)) += int64(v460) } goto endOfThisArm } } /* * Got a handler. Make sure that any pending patch-up actions from * previous unprocessed handlers are dealt with now that we know where * they are to jump to. */ if forwardsNeedFixing != 0 { forwardsNeedFixing = 0 if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v463 = envPtr2 + 152 v462 = *(*uintptr)(unsafe.Pointer(v463)) *(*uintptr)(unsafe.Pointer(v463))++ *(*uint8)(unsafe.Pointer(v462)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v465 = envPtr2 + 152 v464 = *(*uintptr)(unsafe.Pointer(v465)) *(*uintptr)(unsafe.Pointer(v465))++ *(*uint8)(unsafe.Pointer(v464)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(7))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(7) } v466 = delta1 v467 = envPtr2 if v466 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v467)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v467)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v467)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v467)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v467 + 64)) += int64(v466) } j = 0 for { if !(j < i1) { break } if *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)) == -int32(1) { goto _468 } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)))) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(*(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4))))) *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(j)*4)) = -int32(1) goto _468 _468: ; j++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v470 = envPtr2 + 152 v469 = *(*uintptr)(unsafe.Pointer(v470)) *(*uintptr)(unsafe.Pointer(v470))++ *(*uint8)(unsafe.Pointer(v469)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v472 = envPtr2 + 152 v471 = *(*uintptr)(unsafe.Pointer(v472)) *(*uintptr)(unsafe.Pointer(v472))++ *(*uint8)(unsafe.Pointer(v471)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v474 = envPtr2 + 152 v473 = *(*uintptr)(unsafe.Pointer(v474)) *(*uintptr)(unsafe.Pointer(v474))++ *(*uint8)(unsafe.Pointer(v473)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v476 = envPtr2 + 152 v475 = *(*uintptr)(unsafe.Pointer(v476)) *(*uintptr)(unsafe.Pointer(v476))++ *(*uint8)(unsafe.Pointer(v475)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v478 = envPtr2 + 152 v477 = *(*uintptr)(unsafe.Pointer(v478)) *(*uintptr)(unsafe.Pointer(v478))++ *(*uint8)(unsafe.Pointer(v477)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v479 = delta1 v480 = envPtr2 if v479 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v480)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v480)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v480)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v480)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v480 + 64)) += int64(v479) } } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(libc.Int32FromInt32(5)+i1*libc.Int32FromInt32(4))*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(libc.Int32FromInt32(5)+i1*libc.Int32FromInt32(4))*8)) XTclCompileCmdWord(tls, interp, *(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i1)*8))+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(handlerTokens + uintptr(i1)*8)))).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14828, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v482 = envPtr2 + 152 v481 = *(*uintptr)(unsafe.Pointer(v482)) *(*uintptr)(unsafe.Pointer(v482))++ *(*uint8)(unsafe.Pointer(v481)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v484 = envPtr2 + 152 v483 = *(*uintptr)(unsafe.Pointer(v484)) *(*uintptr)(unsafe.Pointer(v484))++ *(*uint8)(unsafe.Pointer(v483)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v485 = delta1 v486 = envPtr2 if v485 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v486)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v486)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v486)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v486)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v486 + 64)) += int64(v485) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v488 = envPtr2 + 152 v487 = *(*uintptr)(unsafe.Pointer(v488)) *(*uintptr)(unsafe.Pointer(v488))++ *(*uint8)(unsafe.Pointer(v487)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v490 = envPtr2 + 152 v489 = *(*uintptr)(unsafe.Pointer(v490)) *(*uintptr)(unsafe.Pointer(v490))++ *(*uint8)(unsafe.Pointer(v489)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v492 = envPtr2 + 152 v491 = *(*uintptr)(unsafe.Pointer(v492)) *(*uintptr)(unsafe.Pointer(v492))++ *(*uint8)(unsafe.Pointer(v491)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v494 = envPtr2 + 152 v493 = *(*uintptr)(unsafe.Pointer(v494)) *(*uintptr)(unsafe.Pointer(v494))++ *(*uint8)(unsafe.Pointer(v493)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v496 = envPtr2 + 152 v495 = *(*uintptr)(unsafe.Pointer(v496)) *(*uintptr)(unsafe.Pointer(v496))++ *(*uint8)(unsafe.Pointer(v495)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v497 = delta1 v498 = envPtr2 if v497 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v498)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v498)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v498)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v498)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v498 + 64)) += int64(v497) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v500 = envPtr2 + 152 v499 = *(*uintptr)(unsafe.Pointer(v500)) *(*uintptr)(unsafe.Pointer(v500))++ *(*uint8)(unsafe.Pointer(v499)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v501 = delta1 v502 = envPtr2 if v501 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v502)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v502)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v502)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v502)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v502 + 64)) += int64(v501) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v504 = envPtr2 + 152 v503 = *(*uintptr)(unsafe.Pointer(v504)) *(*uintptr)(unsafe.Pointer(v504))++ *(*uint8)(unsafe.Pointer(v503)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v506 = envPtr2 + 152 v505 = *(*uintptr)(unsafe.Pointer(v506)) *(*uintptr)(unsafe.Pointer(v506))++ *(*uint8)(unsafe.Pointer(v505)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v508 = envPtr2 + 152 v507 = *(*uintptr)(unsafe.Pointer(v508)) *(*uintptr)(unsafe.Pointer(v508))++ *(*uint8)(unsafe.Pointer(v507)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v510 = envPtr2 + 152 v509 = *(*uintptr)(unsafe.Pointer(v510)) *(*uintptr)(unsafe.Pointer(v510))++ *(*uint8)(unsafe.Pointer(v509)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v512 = envPtr2 + 152 v511 = *(*uintptr)(unsafe.Pointer(v512)) *(*uintptr)(unsafe.Pointer(v512))++ *(*uint8)(unsafe.Pointer(v511)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v513 = delta1 v514 = envPtr2 if v513 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v514)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v514)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v514)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v514)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v514 + 64)) += int64(v513) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v516 = envPtr2 + 152 v515 = *(*uintptr)(unsafe.Pointer(v516)) *(*uintptr)(unsafe.Pointer(v516))++ *(*uint8)(unsafe.Pointer(v515)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v518 = envPtr2 + 152 v517 = *(*uintptr)(unsafe.Pointer(v518)) *(*uintptr)(unsafe.Pointer(v518))++ *(*uint8)(unsafe.Pointer(v517)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(5))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(5) } v519 = delta1 v520 = envPtr2 if v519 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v520)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v520)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v520)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v520)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v520 + 64)) += int64(v519) } v521 = -int32(3) v522 = envPtr2 if v521 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v522)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v522)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v522)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v522)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v522 + 64)) += int64(v521) *(*int32)(unsafe.Pointer(forwardsToFix + uintptr(i1)*4)) = -int32(1) /* * Error in handler or setting of variables; replace the stored * exception with the new one. Note that we only push this if we have * either a body or some variable setting here. Otherwise this code is * unreachable. */ goto finishTrapCatchHandling finishTrapCatchHandling: ; (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v524 = envPtr2 + 152 v523 = *(*uintptr)(unsafe.Pointer(v524)) *(*uintptr)(unsafe.Pointer(v524))++ *(*uint8)(unsafe.Pointer(v523)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v525 = delta1 v526 = envPtr2 if v525 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v526)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v526)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v526)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v526)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v526 + 64)) += int64(v525) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v528 = envPtr2 + 152 v527 = *(*uintptr)(unsafe.Pointer(v528)) *(*uintptr)(unsafe.Pointer(v528))++ *(*uint8)(unsafe.Pointer(v527)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v529 = delta1 v530 = envPtr2 if v529 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v530)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v530)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v530)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v530)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v530 + 64)) += int64(v529) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v532 = envPtr2 + 152 v531 = *(*uintptr)(unsafe.Pointer(v532)) *(*uintptr)(unsafe.Pointer(v532))++ *(*uint8)(unsafe.Pointer(v531)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v533 = delta1 v534 = envPtr2 if v533 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v534)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v534)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v534)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v534)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v534 + 64)) += int64(v533) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v536 = envPtr2 + 152 v535 = *(*uintptr)(unsafe.Pointer(v536)) *(*uintptr)(unsafe.Pointer(v536))++ *(*uint8)(unsafe.Pointer(v535)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v537 = delta1 v538 = envPtr2 if v537 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v538)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v538)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v538)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v538)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v538 + 64)) += int64(v537) } if resultVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v540 = envPtr2 + 152 v539 = *(*uintptr)(unsafe.Pointer(v540)) *(*uintptr)(unsafe.Pointer(v540))++ *(*uint8)(unsafe.Pointer(v539)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v542 = envPtr2 + 152 v541 = *(*uintptr)(unsafe.Pointer(v542)) *(*uintptr)(unsafe.Pointer(v542))++ *(*uint8)(unsafe.Pointer(v541)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v543 = delta1 v544 = envPtr2 if v543 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v544)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v544)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v544)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v544)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v544 + 64)) += int64(v543) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v546 = envPtr2 + 152 v545 = *(*uintptr)(unsafe.Pointer(v546)) *(*uintptr)(unsafe.Pointer(v546))++ *(*uint8)(unsafe.Pointer(v545)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v548 = envPtr2 + 152 v547 = *(*uintptr)(unsafe.Pointer(v548)) *(*uintptr)(unsafe.Pointer(v548))++ *(*uint8)(unsafe.Pointer(v547)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(24)) v550 = envPtr2 + 152 v549 = *(*uintptr)(unsafe.Pointer(v550)) *(*uintptr)(unsafe.Pointer(v550))++ *(*uint8)(unsafe.Pointer(v549)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(16)) v552 = envPtr2 + 152 v551 = *(*uintptr)(unsafe.Pointer(v552)) *(*uintptr)(unsafe.Pointer(v552))++ *(*uint8)(unsafe.Pointer(v551)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(8)) v554 = envPtr2 + 152 v553 = *(*uintptr)(unsafe.Pointer(v554)) *(*uintptr)(unsafe.Pointer(v554))++ *(*uint8)(unsafe.Pointer(v553)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v555 = delta1 v556 = envPtr2 if v555 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v556)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v556)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v556)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v556)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v556 + 64)) += int64(v555) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v558 = envPtr2 + 152 v557 = *(*uintptr)(unsafe.Pointer(v558)) *(*uintptr)(unsafe.Pointer(v558))++ *(*uint8)(unsafe.Pointer(v557)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v559 = delta1 v560 = envPtr2 if v559 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v560)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v560)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v560)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v560)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v560 + 64)) += int64(v559) } _objIndexCopy6 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy6 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v562 = envPtr2 + 152 v561 = *(*uintptr)(unsafe.Pointer(v562)) *(*uintptr)(unsafe.Pointer(v562))++ *(*uint8)(unsafe.Pointer(v561)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v564 = envPtr2 + 152 v563 = *(*uintptr)(unsafe.Pointer(v564)) *(*uintptr)(unsafe.Pointer(v564))++ *(*uint8)(unsafe.Pointer(v563)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v565 = delta1 v566 = envPtr2 if v565 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v566)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v566)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v566)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v566)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v566 + 64)) += int64(v565) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v568 = envPtr2 + 152 v567 = *(*uintptr)(unsafe.Pointer(v568)) *(*uintptr)(unsafe.Pointer(v568))++ *(*uint8)(unsafe.Pointer(v567)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v570 = envPtr2 + 152 v569 = *(*uintptr)(unsafe.Pointer(v570)) *(*uintptr)(unsafe.Pointer(v570))++ *(*uint8)(unsafe.Pointer(v569)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(24)) v572 = envPtr2 + 152 v571 = *(*uintptr)(unsafe.Pointer(v572)) *(*uintptr)(unsafe.Pointer(v572))++ *(*uint8)(unsafe.Pointer(v571)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(16)) v574 = envPtr2 + 152 v573 = *(*uintptr)(unsafe.Pointer(v574)) *(*uintptr)(unsafe.Pointer(v574))++ *(*uint8)(unsafe.Pointer(v573)) = uint8(libc.Uint32FromInt32(_objIndexCopy6) >> libc.Int32FromInt32(8)) v576 = envPtr2 + 152 v575 = *(*uintptr)(unsafe.Pointer(v576)) *(*uintptr)(unsafe.Pointer(v576))++ *(*uint8)(unsafe.Pointer(v575)) = uint8(libc.Uint32FromInt32(_objIndexCopy6)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy6 } v577 = delta1 v578 = envPtr2 if v577 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v578)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v578)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v578)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v578)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v578 + 64)) += int64(v577) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v580 = envPtr2 + 152 v579 = *(*uintptr)(unsafe.Pointer(v580)) *(*uintptr)(unsafe.Pointer(v580))++ *(*uint8)(unsafe.Pointer(v579)) = libc.Uint8FromInt32(int32(INST_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v581 = delta1 v582 = envPtr2 if v581 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v582)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v582)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v582)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v582)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v582 + 64)) += int64(v581) } noTrapError = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v584 = envPtr2 + 152 v583 = *(*uintptr)(unsafe.Pointer(v584)) *(*uintptr)(unsafe.Pointer(v584))++ *(*uint8)(unsafe.Pointer(v583)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v586 = envPtr2 + 152 v585 = *(*uintptr)(unsafe.Pointer(v586)) *(*uintptr)(unsafe.Pointer(v586))++ *(*uint8)(unsafe.Pointer(v585)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v587 = delta1 v588 = envPtr2 if v587 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v588)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v588)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v588)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v588)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v588 + 64)) += int64(v587) } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v590 = envPtr2 + 152 v589 = *(*uintptr)(unsafe.Pointer(v590)) *(*uintptr)(unsafe.Pointer(v590))++ *(*uint8)(unsafe.Pointer(v589)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v592 = envPtr2 + 152 v591 = *(*uintptr)(unsafe.Pointer(v592)) *(*uintptr)(unsafe.Pointer(v592))++ *(*uint8)(unsafe.Pointer(v591)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v593 = delta1 v594 = envPtr2 if v593 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v594)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v594)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v594)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v594)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v594 + 64)) += int64(v593) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v596 = envPtr2 + 152 v595 = *(*uintptr)(unsafe.Pointer(v596)) *(*uintptr)(unsafe.Pointer(v596))++ *(*uint8)(unsafe.Pointer(v595)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v598 = envPtr2 + 152 v597 = *(*uintptr)(unsafe.Pointer(v598)) *(*uintptr)(unsafe.Pointer(v598))++ *(*uint8)(unsafe.Pointer(v597)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v600 = envPtr2 + 152 v599 = *(*uintptr)(unsafe.Pointer(v600)) *(*uintptr)(unsafe.Pointer(v600))++ *(*uint8)(unsafe.Pointer(v599)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v602 = envPtr2 + 152 v601 = *(*uintptr)(unsafe.Pointer(v602)) *(*uintptr)(unsafe.Pointer(v602))++ *(*uint8)(unsafe.Pointer(v601)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v604 = envPtr2 + 152 v603 = *(*uintptr)(unsafe.Pointer(v604)) *(*uintptr)(unsafe.Pointer(v604))++ *(*uint8)(unsafe.Pointer(v603)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v605 = delta1 v606 = envPtr2 if v605 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v606)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v606)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v606)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v606)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v606 + 64)) += int64(v605) } } _objIndexCopy7 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21234, libc.Int64FromUint64(libc.Uint64FromInt64(8)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy7 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v608 = envPtr2 + 152 v607 = *(*uintptr)(unsafe.Pointer(v608)) *(*uintptr)(unsafe.Pointer(v608))++ *(*uint8)(unsafe.Pointer(v607)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v610 = envPtr2 + 152 v609 = *(*uintptr)(unsafe.Pointer(v610)) *(*uintptr)(unsafe.Pointer(v610))++ *(*uint8)(unsafe.Pointer(v609)) = uint8(libc.Uint32FromInt32(_objIndexCopy7)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy7 } v611 = delta1 v612 = envPtr2 if v611 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v612)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v612)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v612)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v612)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v612 + 64)) += int64(v611) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v614 = envPtr2 + 152 v613 = *(*uintptr)(unsafe.Pointer(v614)) *(*uintptr)(unsafe.Pointer(v614))++ *(*uint8)(unsafe.Pointer(v613)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v616 = envPtr2 + 152 v615 = *(*uintptr)(unsafe.Pointer(v616)) *(*uintptr)(unsafe.Pointer(v616))++ *(*uint8)(unsafe.Pointer(v615)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(24)) v618 = envPtr2 + 152 v617 = *(*uintptr)(unsafe.Pointer(v618)) *(*uintptr)(unsafe.Pointer(v618))++ *(*uint8)(unsafe.Pointer(v617)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(16)) v620 = envPtr2 + 152 v619 = *(*uintptr)(unsafe.Pointer(v620)) *(*uintptr)(unsafe.Pointer(v620))++ *(*uint8)(unsafe.Pointer(v619)) = uint8(libc.Uint32FromInt32(_objIndexCopy7) >> libc.Int32FromInt32(8)) v622 = envPtr2 + 152 v621 = *(*uintptr)(unsafe.Pointer(v622)) *(*uintptr)(unsafe.Pointer(v622))++ *(*uint8)(unsafe.Pointer(v621)) = uint8(libc.Uint32FromInt32(_objIndexCopy7)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy7 } v623 = delta1 v624 = envPtr2 if v623 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v624)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v624)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v624)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v624)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v624 + 64)) += int64(v623) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v626 = envPtr2 + 152 v625 = *(*uintptr)(unsafe.Pointer(v626)) *(*uintptr)(unsafe.Pointer(v626))++ *(*uint8)(unsafe.Pointer(v625)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v628 = envPtr2 + 152 v627 = *(*uintptr)(unsafe.Pointer(v628)) *(*uintptr)(unsafe.Pointer(v628))++ *(*uint8)(unsafe.Pointer(v627)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v630 = envPtr2 + 152 v629 = *(*uintptr)(unsafe.Pointer(v630)) *(*uintptr)(unsafe.Pointer(v630))++ *(*uint8)(unsafe.Pointer(v629)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v632 = envPtr2 + 152 v631 = *(*uintptr)(unsafe.Pointer(v632)) *(*uintptr)(unsafe.Pointer(v632))++ *(*uint8)(unsafe.Pointer(v631)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v634 = envPtr2 + 152 v633 = *(*uintptr)(unsafe.Pointer(v634)) *(*uintptr)(unsafe.Pointer(v634))++ *(*uint8)(unsafe.Pointer(v633)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v635 = delta1 v636 = envPtr2 if v635 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v636)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v636)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v636)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v636)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v636 + 64)) += int64(v635) } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v638 = envPtr2 + 152 v637 = *(*uintptr)(unsafe.Pointer(v638)) *(*uintptr)(unsafe.Pointer(v638))++ *(*uint8)(unsafe.Pointer(v637)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v640 = envPtr2 + 152 v639 = *(*uintptr)(unsafe.Pointer(v640)) *(*uintptr)(unsafe.Pointer(v640))++ *(*uint8)(unsafe.Pointer(v639)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v641 = delta1 v642 = envPtr2 if v641 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v642)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v642)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v642)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v642)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v642 + 64)) += int64(v641) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v644 = envPtr2 + 152 v643 = *(*uintptr)(unsafe.Pointer(v644)) *(*uintptr)(unsafe.Pointer(v644))++ *(*uint8)(unsafe.Pointer(v643)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v646 = envPtr2 + 152 v645 = *(*uintptr)(unsafe.Pointer(v646)) *(*uintptr)(unsafe.Pointer(v646))++ *(*uint8)(unsafe.Pointer(v645)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v648 = envPtr2 + 152 v647 = *(*uintptr)(unsafe.Pointer(v648)) *(*uintptr)(unsafe.Pointer(v648))++ *(*uint8)(unsafe.Pointer(v647)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v650 = envPtr2 + 152 v649 = *(*uintptr)(unsafe.Pointer(v650)) *(*uintptr)(unsafe.Pointer(v650))++ *(*uint8)(unsafe.Pointer(v649)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v652 = envPtr2 + 152 v651 = *(*uintptr)(unsafe.Pointer(v652)) *(*uintptr)(unsafe.Pointer(v652))++ *(*uint8)(unsafe.Pointer(v651)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v653 = delta1 v654 = envPtr2 if v653 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v654)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v654)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v654)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v654)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v654 + 64)) += int64(v653) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v656 = envPtr2 + 152 v655 = *(*uintptr)(unsafe.Pointer(v656)) *(*uintptr)(unsafe.Pointer(v656))++ *(*uint8)(unsafe.Pointer(v655)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v657 = delta1 v658 = envPtr2 if v657 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v658)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v658)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v658)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v658)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v658 + 64)) += int64(v657) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v660 = envPtr2 + 152 v659 = *(*uintptr)(unsafe.Pointer(v660)) *(*uintptr)(unsafe.Pointer(v660))++ *(*uint8)(unsafe.Pointer(v659)) = libc.Uint8FromInt32(int32(INST_DICT_SET)) v662 = envPtr2 + 152 v661 = *(*uintptr)(unsafe.Pointer(v662)) *(*uintptr)(unsafe.Pointer(v662))++ *(*uint8)(unsafe.Pointer(v661)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v664 = envPtr2 + 152 v663 = *(*uintptr)(unsafe.Pointer(v664)) *(*uintptr)(unsafe.Pointer(v664))++ *(*uint8)(unsafe.Pointer(v663)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v666 = envPtr2 + 152 v665 = *(*uintptr)(unsafe.Pointer(v666)) *(*uintptr)(unsafe.Pointer(v666))++ *(*uint8)(unsafe.Pointer(v665)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v668 = envPtr2 + 152 v667 = *(*uintptr)(unsafe.Pointer(v668)) *(*uintptr)(unsafe.Pointer(v668))++ *(*uint8)(unsafe.Pointer(v667)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_SET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v669 = delta1 v670 = envPtr2 if v669 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v670)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v670)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v670)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v670)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v670 + 64)) += int64(v669) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v672 = envPtr2 + 152 v671 = *(*uintptr)(unsafe.Pointer(v672)) *(*uintptr)(unsafe.Pointer(v672))++ *(*uint8)(unsafe.Pointer(v671)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v674 = envPtr2 + 152 v673 = *(*uintptr)(unsafe.Pointer(v674)) *(*uintptr)(unsafe.Pointer(v674))++ *(*uint8)(unsafe.Pointer(v673)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v676 = envPtr2 + 152 v675 = *(*uintptr)(unsafe.Pointer(v676)) *(*uintptr)(unsafe.Pointer(v676))++ *(*uint8)(unsafe.Pointer(v675)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v678 = envPtr2 + 152 v677 = *(*uintptr)(unsafe.Pointer(v678)) *(*uintptr)(unsafe.Pointer(v678))++ *(*uint8)(unsafe.Pointer(v677)) = uint8(libc.Uint32FromInt32(optionsVar)) v679 = -int32(1) v680 = envPtr2 if v679 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v680)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v680)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v680)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v680)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v680 + 64)) += int64(v679) trapError = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v682 = envPtr2 + 152 v681 = *(*uintptr)(unsafe.Pointer(v682)) *(*uintptr)(unsafe.Pointer(v682))++ *(*uint8)(unsafe.Pointer(v681)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v684 = envPtr2 + 152 v683 = *(*uintptr)(unsafe.Pointer(v684)) *(*uintptr)(unsafe.Pointer(v684))++ *(*uint8)(unsafe.Pointer(v683)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v685 = delta1 v686 = envPtr2 if v685 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v686)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v686)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v686)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v686)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v686 + 64)) += int64(v685) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(noTrapError) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(noTrapError))) if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v688 = envPtr2 + 152 v687 = *(*uintptr)(unsafe.Pointer(v688)) *(*uintptr)(unsafe.Pointer(v688))++ *(*uint8)(unsafe.Pointer(v687)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v690 = envPtr2 + 152 v689 = *(*uintptr)(unsafe.Pointer(v690)) *(*uintptr)(unsafe.Pointer(v690))++ *(*uint8)(unsafe.Pointer(v689)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v691 = delta1 v692 = envPtr2 if v691 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v692)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v692)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v692)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v692)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v692 + 64)) += int64(v691) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v694 = envPtr2 + 152 v693 = *(*uintptr)(unsafe.Pointer(v694)) *(*uintptr)(unsafe.Pointer(v694))++ *(*uint8)(unsafe.Pointer(v693)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v696 = envPtr2 + 152 v695 = *(*uintptr)(unsafe.Pointer(v696)) *(*uintptr)(unsafe.Pointer(v696))++ *(*uint8)(unsafe.Pointer(v695)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v698 = envPtr2 + 152 v697 = *(*uintptr)(unsafe.Pointer(v698)) *(*uintptr)(unsafe.Pointer(v698))++ *(*uint8)(unsafe.Pointer(v697)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v700 = envPtr2 + 152 v699 = *(*uintptr)(unsafe.Pointer(v700)) *(*uintptr)(unsafe.Pointer(v700))++ *(*uint8)(unsafe.Pointer(v699)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v702 = envPtr2 + 152 v701 = *(*uintptr)(unsafe.Pointer(v702)) *(*uintptr)(unsafe.Pointer(v702))++ *(*uint8)(unsafe.Pointer(v701)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v703 = delta1 v704 = envPtr2 if v703 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v704)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v704)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v704)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v704)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v704 + 64)) += int64(v703) } } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(trapError) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(trapError))) /* Skip POP at end; can clean up with subsequent POP */ if i1+int32(1) < numHandlers { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v706 = envPtr2 + 152 v705 = *(*uintptr)(unsafe.Pointer(v706)) *(*uintptr)(unsafe.Pointer(v706))++ *(*uint8)(unsafe.Pointer(v705)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v707 = delta1 v708 = envPtr2 if v707 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v708)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v708)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v708)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v708)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v708 + 64)) += int64(v707) } } goto endOfThisArm endOfThisArm: ; if i1+int32(1) < numHandlers { *(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4)) = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v710 = envPtr2 + 152 v709 = *(*uintptr)(unsafe.Pointer(v710)) *(*uintptr)(unsafe.Pointer(v710))++ *(*uint8)(unsafe.Pointer(v709)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v712 = envPtr2 + 152 v711 = *(*uintptr)(unsafe.Pointer(v712)) *(*uintptr)(unsafe.Pointer(v712))++ *(*uint8)(unsafe.Pointer(v711)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v714 = envPtr2 + 152 v713 = *(*uintptr)(unsafe.Pointer(v714)) *(*uintptr)(unsafe.Pointer(v714))++ *(*uint8)(unsafe.Pointer(v713)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v716 = envPtr2 + 152 v715 = *(*uintptr)(unsafe.Pointer(v716)) *(*uintptr)(unsafe.Pointer(v716))++ *(*uint8)(unsafe.Pointer(v715)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v718 = envPtr2 + 152 v717 = *(*uintptr)(unsafe.Pointer(v718)) *(*uintptr)(unsafe.Pointer(v718))++ *(*uint8)(unsafe.Pointer(v717)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v719 = delta1 v720 = envPtr2 if v719 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v720)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v720)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v720)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v720)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v720 + 64)) += int64(v719) } v721 = int32(1) v722 = envPtr2 if v721 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v722)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v722)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v722)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v722)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v722 + 64)) += int64(v721) } if *(*uintptr)(unsafe.Pointer(matchClauses + uintptr(i1)*8)) != 0 { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notECJumpSource) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notECJumpSource)) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notECJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notECJumpSource)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notECJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notECJumpSource)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notECJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(notECJumpSource))) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notCodeJumpSource) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notCodeJumpSource)) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notCodeJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notCodeJumpSource)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notCodeJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(notCodeJumpSource)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(notCodeJumpSource) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(notCodeJumpSource))) goto _191 _191: ; i1++ } /* * Drop the result code, and fix all the jumps from taken clauses - which * drop the result code as their first action - to point straight after * (i.e., to the start of the finally clause). */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v724 = envPtr2 + 152 v723 = *(*uintptr)(unsafe.Pointer(v724)) *(*uintptr)(unsafe.Pointer(v724))++ *(*uint8)(unsafe.Pointer(v723)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v725 = delta1 v726 = envPtr2 if v725 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v726)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v726)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v726)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v726)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v726 + 64)) += int64(v725) } i1 = 0 for { if !(i1 < numHandlers-int32(1)) { break } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4)))) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4)))) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4)))) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(*(*int32)(unsafe.Pointer(addrsToFix + uintptr(i1)*4))))) goto _727 _727: ; i1++ } XTclStackFree(tls, interp, forwardsToFix) XTclStackFree(tls, interp, addrsToFix) /* * Process the finally clause (at last!) Note that we do not wrap this in * error handlers because we would just rethrow immediately anyway. Then * (on normal success) we reissue the exception. Note also that * INST_RETURN_STK can proceed to the next instruction; that'll be the * next command (or some inter-command manipulation). */ if !(trapZero != 0) { *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(afterBody) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(afterBody)) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(afterBody) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(afterBody)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(afterBody) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(afterBody)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(afterBody) + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(afterBody))) } range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v729 = envPtr2 + 152 v728 = *(*uintptr)(unsafe.Pointer(v729)) *(*uintptr)(unsafe.Pointer(v729))++ *(*uint8)(unsafe.Pointer(v728)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v731 = envPtr2 + 152 v730 = *(*uintptr)(unsafe.Pointer(v731)) *(*uintptr)(unsafe.Pointer(v731))++ *(*uint8)(unsafe.Pointer(v730)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v733 = envPtr2 + 152 v732 = *(*uintptr)(unsafe.Pointer(v733)) *(*uintptr)(unsafe.Pointer(v733))++ *(*uint8)(unsafe.Pointer(v732)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v735 = envPtr2 + 152 v734 = *(*uintptr)(unsafe.Pointer(v735)) *(*uintptr)(unsafe.Pointer(v735))++ *(*uint8)(unsafe.Pointer(v734)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v737 = envPtr2 + 152 v736 = *(*uintptr)(unsafe.Pointer(v737)) *(*uintptr)(unsafe.Pointer(v737))++ *(*uint8)(unsafe.Pointer(v736)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v738 = delta1 v739 = envPtr2 if v738 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v739)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v739)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v739)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v739)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v739 + 64)) += int64(v738) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v740 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v740 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v740 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(libc.Int32FromInt32(3)+libc.Int32FromInt32(4)*numHandlers)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(libc.Int32FromInt32(3)+libc.Int32FromInt32(4)*numHandlers)*8)) XTclCompileCmdWord(tls, interp, finallyToken+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(finallyToken)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v742 = envPtr2 + 152 v741 = *(*uintptr)(unsafe.Pointer(v742)) *(*uintptr)(unsafe.Pointer(v742))++ *(*uint8)(unsafe.Pointer(v741)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v743 = delta1 v744 = envPtr2 if v743 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v744)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v744)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v744)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v744)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v744 + 64)) += int64(v743) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v746 = envPtr2 + 152 v745 = *(*uintptr)(unsafe.Pointer(v746)) *(*uintptr)(unsafe.Pointer(v746))++ *(*uint8)(unsafe.Pointer(v745)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v747 = delta1 v748 = envPtr2 if v747 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v748)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v748)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v748)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v748)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v748 + 64)) += int64(v747) } finalOK = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v750 = envPtr2 + 152 v749 = *(*uintptr)(unsafe.Pointer(v750)) *(*uintptr)(unsafe.Pointer(v750))++ *(*uint8)(unsafe.Pointer(v749)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v752 = envPtr2 + 152 v751 = *(*uintptr)(unsafe.Pointer(v752)) *(*uintptr)(unsafe.Pointer(v752))++ *(*uint8)(unsafe.Pointer(v751)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v753 = delta1 v754 = envPtr2 if v753 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v754)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v754)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v754)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v754)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v754 + 64)) += int64(v753) } (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v756 = envPtr2 + 152 v755 = *(*uintptr)(unsafe.Pointer(v756)) *(*uintptr)(unsafe.Pointer(v756))++ *(*uint8)(unsafe.Pointer(v755)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v757 = delta1 v758 = envPtr2 if v757 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v758)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v758)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v758)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v758)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v758 + 64)) += int64(v757) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v760 = envPtr2 + 152 v759 = *(*uintptr)(unsafe.Pointer(v760)) *(*uintptr)(unsafe.Pointer(v760))++ *(*uint8)(unsafe.Pointer(v759)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v761 = delta1 v762 = envPtr2 if v761 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v762)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v762)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v762)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v762)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v762 + 64)) += int64(v761) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v764 = envPtr2 + 152 v763 = *(*uintptr)(unsafe.Pointer(v764)) *(*uintptr)(unsafe.Pointer(v764))++ *(*uint8)(unsafe.Pointer(v763)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v765 = delta1 v766 = envPtr2 if v765 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v766)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v766)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v766)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v766)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v766 + 64)) += int64(v765) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v768 = envPtr2 + 152 v767 = *(*uintptr)(unsafe.Pointer(v768)) *(*uintptr)(unsafe.Pointer(v768))++ *(*uint8)(unsafe.Pointer(v767)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v769 = delta1 v770 = envPtr2 if v769 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v770)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v770)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v770)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v770)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v770 + 64)) += int64(v769) } _objIndexCopy8 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy8 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v772 = envPtr2 + 152 v771 = *(*uintptr)(unsafe.Pointer(v772)) *(*uintptr)(unsafe.Pointer(v772))++ *(*uint8)(unsafe.Pointer(v771)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v774 = envPtr2 + 152 v773 = *(*uintptr)(unsafe.Pointer(v774)) *(*uintptr)(unsafe.Pointer(v774))++ *(*uint8)(unsafe.Pointer(v773)) = uint8(libc.Uint32FromInt32(_objIndexCopy8)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy8 } v775 = delta1 v776 = envPtr2 if v775 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v776)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v776)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v776)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v776)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v776 + 64)) += int64(v775) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v778 = envPtr2 + 152 v777 = *(*uintptr)(unsafe.Pointer(v778)) *(*uintptr)(unsafe.Pointer(v778))++ *(*uint8)(unsafe.Pointer(v777)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v780 = envPtr2 + 152 v779 = *(*uintptr)(unsafe.Pointer(v780)) *(*uintptr)(unsafe.Pointer(v780))++ *(*uint8)(unsafe.Pointer(v779)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(24)) v782 = envPtr2 + 152 v781 = *(*uintptr)(unsafe.Pointer(v782)) *(*uintptr)(unsafe.Pointer(v782))++ *(*uint8)(unsafe.Pointer(v781)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(16)) v784 = envPtr2 + 152 v783 = *(*uintptr)(unsafe.Pointer(v784)) *(*uintptr)(unsafe.Pointer(v784))++ *(*uint8)(unsafe.Pointer(v783)) = uint8(libc.Uint32FromInt32(_objIndexCopy8) >> libc.Int32FromInt32(8)) v786 = envPtr2 + 152 v785 = *(*uintptr)(unsafe.Pointer(v786)) *(*uintptr)(unsafe.Pointer(v786))++ *(*uint8)(unsafe.Pointer(v785)) = uint8(libc.Uint32FromInt32(_objIndexCopy8)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy8 } v787 = delta1 v788 = envPtr2 if v787 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v788)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v788)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v788)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v788)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v788 + 64)) += int64(v787) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v790 = envPtr2 + 152 v789 = *(*uintptr)(unsafe.Pointer(v790)) *(*uintptr)(unsafe.Pointer(v790))++ *(*uint8)(unsafe.Pointer(v789)) = libc.Uint8FromInt32(int32(INST_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v791 = delta1 v792 = envPtr2 if v791 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v792)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v792)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v792)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v792)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v792 + 64)) += int64(v791) } noFinalError = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v794 = envPtr2 + 152 v793 = *(*uintptr)(unsafe.Pointer(v794)) *(*uintptr)(unsafe.Pointer(v794))++ *(*uint8)(unsafe.Pointer(v793)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v796 = envPtr2 + 152 v795 = *(*uintptr)(unsafe.Pointer(v796)) *(*uintptr)(unsafe.Pointer(v796))++ *(*uint8)(unsafe.Pointer(v795)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v797 = delta1 v798 = envPtr2 if v797 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v798)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v798)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v798)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v798)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v798 + 64)) += int64(v797) } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v800 = envPtr2 + 152 v799 = *(*uintptr)(unsafe.Pointer(v800)) *(*uintptr)(unsafe.Pointer(v800))++ *(*uint8)(unsafe.Pointer(v799)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v802 = envPtr2 + 152 v801 = *(*uintptr)(unsafe.Pointer(v802)) *(*uintptr)(unsafe.Pointer(v802))++ *(*uint8)(unsafe.Pointer(v801)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v803 = delta1 v804 = envPtr2 if v803 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v804)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v804)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v804)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v804)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v804 + 64)) += int64(v803) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v806 = envPtr2 + 152 v805 = *(*uintptr)(unsafe.Pointer(v806)) *(*uintptr)(unsafe.Pointer(v806))++ *(*uint8)(unsafe.Pointer(v805)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v808 = envPtr2 + 152 v807 = *(*uintptr)(unsafe.Pointer(v808)) *(*uintptr)(unsafe.Pointer(v808))++ *(*uint8)(unsafe.Pointer(v807)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v810 = envPtr2 + 152 v809 = *(*uintptr)(unsafe.Pointer(v810)) *(*uintptr)(unsafe.Pointer(v810))++ *(*uint8)(unsafe.Pointer(v809)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v812 = envPtr2 + 152 v811 = *(*uintptr)(unsafe.Pointer(v812)) *(*uintptr)(unsafe.Pointer(v812))++ *(*uint8)(unsafe.Pointer(v811)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v814 = envPtr2 + 152 v813 = *(*uintptr)(unsafe.Pointer(v814)) *(*uintptr)(unsafe.Pointer(v814))++ *(*uint8)(unsafe.Pointer(v813)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v815 = delta1 v816 = envPtr2 if v815 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v816)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v816)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v816)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v816)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v816 + 64)) += int64(v815) } } _objIndexCopy9 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21234, libc.Int64FromUint64(libc.Uint64FromInt64(8)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy9 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v818 = envPtr2 + 152 v817 = *(*uintptr)(unsafe.Pointer(v818)) *(*uintptr)(unsafe.Pointer(v818))++ *(*uint8)(unsafe.Pointer(v817)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v820 = envPtr2 + 152 v819 = *(*uintptr)(unsafe.Pointer(v820)) *(*uintptr)(unsafe.Pointer(v820))++ *(*uint8)(unsafe.Pointer(v819)) = uint8(libc.Uint32FromInt32(_objIndexCopy9)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy9 } v821 = delta1 v822 = envPtr2 if v821 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v822)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v822)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v822)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v822)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v822 + 64)) += int64(v821) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v824 = envPtr2 + 152 v823 = *(*uintptr)(unsafe.Pointer(v824)) *(*uintptr)(unsafe.Pointer(v824))++ *(*uint8)(unsafe.Pointer(v823)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v826 = envPtr2 + 152 v825 = *(*uintptr)(unsafe.Pointer(v826)) *(*uintptr)(unsafe.Pointer(v826))++ *(*uint8)(unsafe.Pointer(v825)) = uint8(libc.Uint32FromInt32(_objIndexCopy9) >> libc.Int32FromInt32(24)) v828 = envPtr2 + 152 v827 = *(*uintptr)(unsafe.Pointer(v828)) *(*uintptr)(unsafe.Pointer(v828))++ *(*uint8)(unsafe.Pointer(v827)) = uint8(libc.Uint32FromInt32(_objIndexCopy9) >> libc.Int32FromInt32(16)) v830 = envPtr2 + 152 v829 = *(*uintptr)(unsafe.Pointer(v830)) *(*uintptr)(unsafe.Pointer(v830))++ *(*uint8)(unsafe.Pointer(v829)) = uint8(libc.Uint32FromInt32(_objIndexCopy9) >> libc.Int32FromInt32(8)) v832 = envPtr2 + 152 v831 = *(*uintptr)(unsafe.Pointer(v832)) *(*uintptr)(unsafe.Pointer(v832))++ *(*uint8)(unsafe.Pointer(v831)) = uint8(libc.Uint32FromInt32(_objIndexCopy9)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy9 } v833 = delta1 v834 = envPtr2 if v833 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v834)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v834)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v834)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v834)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v834 + 64)) += int64(v833) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v836 = envPtr2 + 152 v835 = *(*uintptr)(unsafe.Pointer(v836)) *(*uintptr)(unsafe.Pointer(v836))++ *(*uint8)(unsafe.Pointer(v835)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v838 = envPtr2 + 152 v837 = *(*uintptr)(unsafe.Pointer(v838)) *(*uintptr)(unsafe.Pointer(v838))++ *(*uint8)(unsafe.Pointer(v837)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v840 = envPtr2 + 152 v839 = *(*uintptr)(unsafe.Pointer(v840)) *(*uintptr)(unsafe.Pointer(v840))++ *(*uint8)(unsafe.Pointer(v839)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v842 = envPtr2 + 152 v841 = *(*uintptr)(unsafe.Pointer(v842)) *(*uintptr)(unsafe.Pointer(v842))++ *(*uint8)(unsafe.Pointer(v841)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v844 = envPtr2 + 152 v843 = *(*uintptr)(unsafe.Pointer(v844)) *(*uintptr)(unsafe.Pointer(v844))++ *(*uint8)(unsafe.Pointer(v843)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v845 = delta1 v846 = envPtr2 if v845 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v846)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v846)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v846)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v846)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v846 + 64)) += int64(v845) } if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v848 = envPtr2 + 152 v847 = *(*uintptr)(unsafe.Pointer(v848)) *(*uintptr)(unsafe.Pointer(v848))++ *(*uint8)(unsafe.Pointer(v847)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v850 = envPtr2 + 152 v849 = *(*uintptr)(unsafe.Pointer(v850)) *(*uintptr)(unsafe.Pointer(v850))++ *(*uint8)(unsafe.Pointer(v849)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v851 = delta1 v852 = envPtr2 if v851 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v852)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v852)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v852)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v852)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v852 + 64)) += int64(v851) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v854 = envPtr2 + 152 v853 = *(*uintptr)(unsafe.Pointer(v854)) *(*uintptr)(unsafe.Pointer(v854))++ *(*uint8)(unsafe.Pointer(v853)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v856 = envPtr2 + 152 v855 = *(*uintptr)(unsafe.Pointer(v856)) *(*uintptr)(unsafe.Pointer(v856))++ *(*uint8)(unsafe.Pointer(v855)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v858 = envPtr2 + 152 v857 = *(*uintptr)(unsafe.Pointer(v858)) *(*uintptr)(unsafe.Pointer(v858))++ *(*uint8)(unsafe.Pointer(v857)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v860 = envPtr2 + 152 v859 = *(*uintptr)(unsafe.Pointer(v860)) *(*uintptr)(unsafe.Pointer(v860))++ *(*uint8)(unsafe.Pointer(v859)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v862 = envPtr2 + 152 v861 = *(*uintptr)(unsafe.Pointer(v862)) *(*uintptr)(unsafe.Pointer(v862))++ *(*uint8)(unsafe.Pointer(v861)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v863 = delta1 v864 = envPtr2 if v863 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v864)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v864)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v864)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v864)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v864 + 64)) += int64(v863) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v866 = envPtr2 + 152 v865 = *(*uintptr)(unsafe.Pointer(v866)) *(*uintptr)(unsafe.Pointer(v866))++ *(*uint8)(unsafe.Pointer(v865)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v867 = delta1 v868 = envPtr2 if v867 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v868)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v868)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v868)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v868)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v868 + 64)) += int64(v867) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v870 = envPtr2 + 152 v869 = *(*uintptr)(unsafe.Pointer(v870)) *(*uintptr)(unsafe.Pointer(v870))++ *(*uint8)(unsafe.Pointer(v869)) = libc.Uint8FromInt32(int32(INST_DICT_SET)) v872 = envPtr2 + 152 v871 = *(*uintptr)(unsafe.Pointer(v872)) *(*uintptr)(unsafe.Pointer(v872))++ *(*uint8)(unsafe.Pointer(v871)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(24)) v874 = envPtr2 + 152 v873 = *(*uintptr)(unsafe.Pointer(v874)) *(*uintptr)(unsafe.Pointer(v874))++ *(*uint8)(unsafe.Pointer(v873)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(16)) v876 = envPtr2 + 152 v875 = *(*uintptr)(unsafe.Pointer(v876)) *(*uintptr)(unsafe.Pointer(v876))++ *(*uint8)(unsafe.Pointer(v875)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1)) >> libc.Int32FromInt32(8)) v878 = envPtr2 + 152 v877 = *(*uintptr)(unsafe.Pointer(v878)) *(*uintptr)(unsafe.Pointer(v878))++ *(*uint8)(unsafe.Pointer(v877)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DICT_SET)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(1) } v879 = delta1 v880 = envPtr2 if v879 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v880)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v880)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v880)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v880)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v880 + 64)) += int64(v879) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v882 = envPtr2 + 152 v881 = *(*uintptr)(unsafe.Pointer(v882)) *(*uintptr)(unsafe.Pointer(v882))++ *(*uint8)(unsafe.Pointer(v881)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v884 = envPtr2 + 152 v883 = *(*uintptr)(unsafe.Pointer(v884)) *(*uintptr)(unsafe.Pointer(v884))++ *(*uint8)(unsafe.Pointer(v883)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v886 = envPtr2 + 152 v885 = *(*uintptr)(unsafe.Pointer(v886)) *(*uintptr)(unsafe.Pointer(v886))++ *(*uint8)(unsafe.Pointer(v885)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v888 = envPtr2 + 152 v887 = *(*uintptr)(unsafe.Pointer(v888)) *(*uintptr)(unsafe.Pointer(v888))++ *(*uint8)(unsafe.Pointer(v887)) = uint8(libc.Uint32FromInt32(optionsVar)) v889 = -int32(1) v890 = envPtr2 if v889 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v890)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v890)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v890)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v890)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v890 + 64)) += int64(v889) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v892 = envPtr2 + 152 v891 = *(*uintptr)(unsafe.Pointer(v892)) *(*uintptr)(unsafe.Pointer(v892))++ *(*uint8)(unsafe.Pointer(v891)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v893 = delta1 v894 = envPtr2 if v893 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v894)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v894)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v894)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v894)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v894 + 64)) += int64(v893) } finalError = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v896 = envPtr2 + 152 v895 = *(*uintptr)(unsafe.Pointer(v896)) *(*uintptr)(unsafe.Pointer(v896))++ *(*uint8)(unsafe.Pointer(v895)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v898 = envPtr2 + 152 v897 = *(*uintptr)(unsafe.Pointer(v898)) *(*uintptr)(unsafe.Pointer(v898))++ *(*uint8)(unsafe.Pointer(v897)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v899 = delta1 v900 = envPtr2 if v899 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v900)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v900)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v900)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v900)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v900 + 64)) += int64(v899) } v901 = int32(1) v902 = envPtr2 if v901 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v902)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v902)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v902)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v902)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v902 + 64)) += int64(v901) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(noFinalError) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(noFinalError))) if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v904 = envPtr2 + 152 v903 = *(*uintptr)(unsafe.Pointer(v904)) *(*uintptr)(unsafe.Pointer(v904))++ *(*uint8)(unsafe.Pointer(v903)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v906 = envPtr2 + 152 v905 = *(*uintptr)(unsafe.Pointer(v906)) *(*uintptr)(unsafe.Pointer(v906))++ *(*uint8)(unsafe.Pointer(v905)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v907 = delta1 v908 = envPtr2 if v907 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v908)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v908)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v908)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v908)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v908 + 64)) += int64(v907) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v910 = envPtr2 + 152 v909 = *(*uintptr)(unsafe.Pointer(v910)) *(*uintptr)(unsafe.Pointer(v910))++ *(*uint8)(unsafe.Pointer(v909)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v912 = envPtr2 + 152 v911 = *(*uintptr)(unsafe.Pointer(v912)) *(*uintptr)(unsafe.Pointer(v912))++ *(*uint8)(unsafe.Pointer(v911)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v914 = envPtr2 + 152 v913 = *(*uintptr)(unsafe.Pointer(v914)) *(*uintptr)(unsafe.Pointer(v914))++ *(*uint8)(unsafe.Pointer(v913)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v916 = envPtr2 + 152 v915 = *(*uintptr)(unsafe.Pointer(v916)) *(*uintptr)(unsafe.Pointer(v916))++ *(*uint8)(unsafe.Pointer(v915)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v918 = envPtr2 + 152 v917 = *(*uintptr)(unsafe.Pointer(v918)) *(*uintptr)(unsafe.Pointer(v918))++ *(*uint8)(unsafe.Pointer(v917)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v919 = delta1 v920 = envPtr2 if v919 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v920)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v920)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v920)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v920)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v920 + 64)) += int64(v919) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v922 = envPtr2 + 152 v921 = *(*uintptr)(unsafe.Pointer(v922)) *(*uintptr)(unsafe.Pointer(v922))++ *(*uint8)(unsafe.Pointer(v921)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v923 = delta1 v924 = envPtr2 if v923 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v924)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v924)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v924)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v924)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v924 + 64)) += int64(v923) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(finalError) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(finalError))) if resultVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v926 = envPtr2 + 152 v925 = *(*uintptr)(unsafe.Pointer(v926)) *(*uintptr)(unsafe.Pointer(v926))++ *(*uint8)(unsafe.Pointer(v925)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v928 = envPtr2 + 152 v927 = *(*uintptr)(unsafe.Pointer(v928)) *(*uintptr)(unsafe.Pointer(v928))++ *(*uint8)(unsafe.Pointer(v927)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v929 = delta1 v930 = envPtr2 if v929 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v930)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v930)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v930)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v930)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v930 + 64)) += int64(v929) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v932 = envPtr2 + 152 v931 = *(*uintptr)(unsafe.Pointer(v932)) *(*uintptr)(unsafe.Pointer(v932))++ *(*uint8)(unsafe.Pointer(v931)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v934 = envPtr2 + 152 v933 = *(*uintptr)(unsafe.Pointer(v934)) *(*uintptr)(unsafe.Pointer(v934))++ *(*uint8)(unsafe.Pointer(v933)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(24)) v936 = envPtr2 + 152 v935 = *(*uintptr)(unsafe.Pointer(v936)) *(*uintptr)(unsafe.Pointer(v936))++ *(*uint8)(unsafe.Pointer(v935)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(16)) v938 = envPtr2 + 152 v937 = *(*uintptr)(unsafe.Pointer(v938)) *(*uintptr)(unsafe.Pointer(v938))++ *(*uint8)(unsafe.Pointer(v937)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(8)) v940 = envPtr2 + 152 v939 = *(*uintptr)(unsafe.Pointer(v940)) *(*uintptr)(unsafe.Pointer(v940))++ *(*uint8)(unsafe.Pointer(v939)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v941 = delta1 v942 = envPtr2 if v941 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v942)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v942)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v942)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v942)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v942 + 64)) += int64(v941) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v944 = envPtr2 + 152 v943 = *(*uintptr)(unsafe.Pointer(v944)) *(*uintptr)(unsafe.Pointer(v944))++ *(*uint8)(unsafe.Pointer(v943)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v945 = delta1 v946 = envPtr2 if v945 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v946)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v946)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v946)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v946)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v946 + 64)) += int64(v945) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(finalOK) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(finalOK))) if optionsVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v948 = envPtr2 + 152 v947 = *(*uintptr)(unsafe.Pointer(v948)) *(*uintptr)(unsafe.Pointer(v948))++ *(*uint8)(unsafe.Pointer(v947)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v950 = envPtr2 + 152 v949 = *(*uintptr)(unsafe.Pointer(v950)) *(*uintptr)(unsafe.Pointer(v950))++ *(*uint8)(unsafe.Pointer(v949)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v951 = delta1 v952 = envPtr2 if v951 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v952)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v952)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v952)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v952)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v952 + 64)) += int64(v951) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v954 = envPtr2 + 152 v953 = *(*uintptr)(unsafe.Pointer(v954)) *(*uintptr)(unsafe.Pointer(v954))++ *(*uint8)(unsafe.Pointer(v953)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v956 = envPtr2 + 152 v955 = *(*uintptr)(unsafe.Pointer(v956)) *(*uintptr)(unsafe.Pointer(v956))++ *(*uint8)(unsafe.Pointer(v955)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(24)) v958 = envPtr2 + 152 v957 = *(*uintptr)(unsafe.Pointer(v958)) *(*uintptr)(unsafe.Pointer(v958))++ *(*uint8)(unsafe.Pointer(v957)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(16)) v960 = envPtr2 + 152 v959 = *(*uintptr)(unsafe.Pointer(v960)) *(*uintptr)(unsafe.Pointer(v960))++ *(*uint8)(unsafe.Pointer(v959)) = uint8(libc.Uint32FromInt32(optionsVar) >> libc.Int32FromInt32(8)) v962 = envPtr2 + 152 v961 = *(*uintptr)(unsafe.Pointer(v962)) *(*uintptr)(unsafe.Pointer(v962))++ *(*uint8)(unsafe.Pointer(v961)) = uint8(libc.Uint32FromInt32(optionsVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - optionsVar } v963 = delta1 v964 = envPtr2 if v963 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v964)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v964)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v964)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v964)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v964 + 64)) += int64(v963) } } if resultVar < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v966 = envPtr2 + 152 v965 = *(*uintptr)(unsafe.Pointer(v966)) *(*uintptr)(unsafe.Pointer(v966))++ *(*uint8)(unsafe.Pointer(v965)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v968 = envPtr2 + 152 v967 = *(*uintptr)(unsafe.Pointer(v968)) *(*uintptr)(unsafe.Pointer(v968))++ *(*uint8)(unsafe.Pointer(v967)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v969 = delta1 v970 = envPtr2 if v969 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v970)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v970)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v970)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v970)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v970 + 64)) += int64(v969) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v972 = envPtr2 + 152 v971 = *(*uintptr)(unsafe.Pointer(v972)) *(*uintptr)(unsafe.Pointer(v972))++ *(*uint8)(unsafe.Pointer(v971)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v974 = envPtr2 + 152 v973 = *(*uintptr)(unsafe.Pointer(v974)) *(*uintptr)(unsafe.Pointer(v974))++ *(*uint8)(unsafe.Pointer(v973)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(24)) v976 = envPtr2 + 152 v975 = *(*uintptr)(unsafe.Pointer(v976)) *(*uintptr)(unsafe.Pointer(v976))++ *(*uint8)(unsafe.Pointer(v975)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(16)) v978 = envPtr2 + 152 v977 = *(*uintptr)(unsafe.Pointer(v978)) *(*uintptr)(unsafe.Pointer(v978))++ *(*uint8)(unsafe.Pointer(v977)) = uint8(libc.Uint32FromInt32(resultVar) >> libc.Int32FromInt32(8)) v980 = envPtr2 + 152 v979 = *(*uintptr)(unsafe.Pointer(v980)) *(*uintptr)(unsafe.Pointer(v980))++ *(*uint8)(unsafe.Pointer(v979)) = uint8(libc.Uint32FromInt32(resultVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - resultVar } v981 = delta1 v982 = envPtr2 if v981 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v982)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v982)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v982)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v982)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v982 + 64)) += int64(v981) } } XTclEmitInvoke(tls, envPtr2, int32(INST_RETURN_STK), 0) return TCL_OK } func _IssueTryFinallyInstructions(tls *libc.TLS, interp uintptr, envPtr2 uintptr, bodyToken uintptr, finallyToken uintptr) (r int32) { var _objIndexCopy, _objIndexCopy1, delta1, jumpOK, jumpSplice, range1, v103, v109, v11, v121, v133, v145, v149, v161, v165, v169, v175, v18, v187, v20, v24, v28, v32, v44, v49, v53, v59, v63, v67, v71, v75, v81, v93, v97 int32 var eclIndex TTcl_Size var mapPtr, v1, v10, v100, v101, v102, v104, v105, v106, v107, v108, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v122, v123, v124, v125, v126, v127, v128, v129, v130, v131, v132, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v146, v147, v148, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v162, v163, v164, v166, v167, v168, v17, v170, v171, v172, v173, v174, v176, v177, v178, v179, v180, v181, v182, v183, v184, v185, v186, v188, v19, v2, v21, v22, v23, v25, v26, v27, v29, v3, v30, v31, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v45, v47, v48, v5, v50, v51, v52, v54, v55, v56, v57, v58, v6, v60, v61, v62, v64, v65, v66, v68, v69, v7, v70, v72, v73, v74, v76, v77, v78, v79, v8, v80, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v94, v95, v96, v98, v99 uintptr var v13, v46 int64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, jumpOK, jumpSplice, mapPtr, range1, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v180, v181, v182, v183, v184, v185, v186, v187, v188, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* * Note that this one is simple enough that we can issue it without * needing a local variable table, making it a universal compilation. */ range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v11 = delta1 v12 = envPtr2 if v11 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v12 + 64)) += int64(v11) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v13 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v13 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v13 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileCmdWord(tls, interp, bodyToken+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(bodyToken)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } v20 = -int32(1) v21 = envPtr2 if v20 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v21 + 64)) += int64(v20) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v28 = delta1 v29 = envPtr2 if v28 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v29 + 64)) += int64(v28) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v32 = delta1 v33 = envPtr2 if v32 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v33)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v33 + 64)) += int64(v32) } range1 = int32(XTclCreateExceptRange(tls, int32(CATCH_EXCEPTION_RANGE), envPtr2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = libc.Uint8FromInt32(int32(INST_BEGIN_CATCH4)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(24)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(16)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(range1) >> libc.Int32FromInt32(8)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(range1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BEGIN_CATCH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - range1 } v44 = delta1 v45 = envPtr2 if v44 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v45 + 64)) += int64(v44) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v46 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v46 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v46 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 3*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 3*8)) XTclCompileCmdWord(tls, interp, finallyToken+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(finallyToken)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v49 = delta1 v50 = envPtr2 if v49 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v50)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v50)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v50 + 64)) += int64(v49) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } jumpOK = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v59 = delta1 v60 = envPtr2 if v59 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v60)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v60)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v60 + 64)) += int64(v59) } (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcatchOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = libc.Uint8FromInt32(int32(INST_PUSH_RESULT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RESULT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v63 = delta1 v64 = envPtr2 if v63 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v64)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v64)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v64 + 64)) += int64(v63) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v66 = envPtr2 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_OPTIONS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_OPTIONS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v67 = delta1 v68 = envPtr2 if v67 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v68 + 64)) += int64(v67) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v70 = envPtr2 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = libc.Uint8FromInt32(int32(INST_PUSH_RETURN_CODE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH_RETURN_CODE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v71 = delta1 v72 = envPtr2 if v71 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v72)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v72)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v72 + 64)) += int64(v71) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v74 = envPtr2 + 152 v73 = *(*uintptr)(unsafe.Pointer(v74)) *(*uintptr)(unsafe.Pointer(v74))++ *(*uint8)(unsafe.Pointer(v73)) = libc.Uint8FromInt32(int32(INST_END_CATCH)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_END_CATCH)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v75 = delta1 v76 = envPtr2 if v75 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v76)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v76)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v76 + 64)) += int64(v75) } _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v80 = envPtr2 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v81 = delta1 v82 = envPtr2 if v81 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v82)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v82)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v82 + 64)) += int64(v81) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v92 = envPtr2 + 152 v91 = *(*uintptr)(unsafe.Pointer(v92)) *(*uintptr)(unsafe.Pointer(v92))++ *(*uint8)(unsafe.Pointer(v91)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v93 = delta1 v94 = envPtr2 if v93 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v94)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v94)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v94)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v94)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v94 + 64)) += int64(v93) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v96 = envPtr2 + 152 v95 = *(*uintptr)(unsafe.Pointer(v96)) *(*uintptr)(unsafe.Pointer(v96))++ *(*uint8)(unsafe.Pointer(v95)) = libc.Uint8FromInt32(int32(INST_EQ)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EQ)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v97 = delta1 v98 = envPtr2 if v97 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v98)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v98)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v98)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v98)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v98 + 64)) += int64(v97) } jumpSplice = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v100 = envPtr2 + 152 v99 = *(*uintptr)(unsafe.Pointer(v100)) *(*uintptr)(unsafe.Pointer(v100))++ *(*uint8)(unsafe.Pointer(v99)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v102 = envPtr2 + 152 v101 = *(*uintptr)(unsafe.Pointer(v102)) *(*uintptr)(unsafe.Pointer(v102))++ *(*uint8)(unsafe.Pointer(v101)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v103 = delta1 v104 = envPtr2 if v103 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v104)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v104)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v104 + 64)) += int64(v103) } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21234, libc.Int64FromUint64(libc.Uint64FromInt64(8)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v106 = envPtr2 + 152 v105 = *(*uintptr)(unsafe.Pointer(v106)) *(*uintptr)(unsafe.Pointer(v106))++ *(*uint8)(unsafe.Pointer(v105)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v108 = envPtr2 + 152 v107 = *(*uintptr)(unsafe.Pointer(v108)) *(*uintptr)(unsafe.Pointer(v108))++ *(*uint8)(unsafe.Pointer(v107)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v109 = delta1 v110 = envPtr2 if v109 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v110)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v110)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v110)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v110)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v110 + 64)) += int64(v109) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v112 = envPtr2 + 152 v111 = *(*uintptr)(unsafe.Pointer(v112)) *(*uintptr)(unsafe.Pointer(v112))++ *(*uint8)(unsafe.Pointer(v111)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v114 = envPtr2 + 152 v113 = *(*uintptr)(unsafe.Pointer(v114)) *(*uintptr)(unsafe.Pointer(v114))++ *(*uint8)(unsafe.Pointer(v113)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v116 = envPtr2 + 152 v115 = *(*uintptr)(unsafe.Pointer(v116)) *(*uintptr)(unsafe.Pointer(v116))++ *(*uint8)(unsafe.Pointer(v115)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v118 = envPtr2 + 152 v117 = *(*uintptr)(unsafe.Pointer(v118)) *(*uintptr)(unsafe.Pointer(v118))++ *(*uint8)(unsafe.Pointer(v117)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v120 = envPtr2 + 152 v119 = *(*uintptr)(unsafe.Pointer(v120)) *(*uintptr)(unsafe.Pointer(v120))++ *(*uint8)(unsafe.Pointer(v119)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v121 = delta1 v122 = envPtr2 if v121 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v122)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v122)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v122)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v122)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v122 + 64)) += int64(v121) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v124 = envPtr2 + 152 v123 = *(*uintptr)(unsafe.Pointer(v124)) *(*uintptr)(unsafe.Pointer(v124))++ *(*uint8)(unsafe.Pointer(v123)) = libc.Uint8FromInt32(int32(INST_OVER)) v126 = envPtr2 + 152 v125 = *(*uintptr)(unsafe.Pointer(v126)) *(*uintptr)(unsafe.Pointer(v126))++ *(*uint8)(unsafe.Pointer(v125)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(24)) v128 = envPtr2 + 152 v127 = *(*uintptr)(unsafe.Pointer(v128)) *(*uintptr)(unsafe.Pointer(v128))++ *(*uint8)(unsafe.Pointer(v127)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(16)) v130 = envPtr2 + 152 v129 = *(*uintptr)(unsafe.Pointer(v130)) *(*uintptr)(unsafe.Pointer(v130))++ *(*uint8)(unsafe.Pointer(v129)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3)) >> libc.Int32FromInt32(8)) v132 = envPtr2 + 152 v131 = *(*uintptr)(unsafe.Pointer(v132)) *(*uintptr)(unsafe.Pointer(v132))++ *(*uint8)(unsafe.Pointer(v131)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(3))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_OVER)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(3) } v133 = delta1 v134 = envPtr2 if v133 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v134)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v134)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v134)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v134)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v134 + 64)) += int64(v133) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v136 = envPtr2 + 152 v135 = *(*uintptr)(unsafe.Pointer(v136)) *(*uintptr)(unsafe.Pointer(v136))++ *(*uint8)(unsafe.Pointer(v135)) = libc.Uint8FromInt32(int32(INST_LIST)) v138 = envPtr2 + 152 v137 = *(*uintptr)(unsafe.Pointer(v138)) *(*uintptr)(unsafe.Pointer(v138))++ *(*uint8)(unsafe.Pointer(v137)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v140 = envPtr2 + 152 v139 = *(*uintptr)(unsafe.Pointer(v140)) *(*uintptr)(unsafe.Pointer(v140))++ *(*uint8)(unsafe.Pointer(v139)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v142 = envPtr2 + 152 v141 = *(*uintptr)(unsafe.Pointer(v142)) *(*uintptr)(unsafe.Pointer(v142))++ *(*uint8)(unsafe.Pointer(v141)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v144 = envPtr2 + 152 v143 = *(*uintptr)(unsafe.Pointer(v144)) *(*uintptr)(unsafe.Pointer(v144))++ *(*uint8)(unsafe.Pointer(v143)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v145 = delta1 v146 = envPtr2 if v145 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v146)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v146)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v146 + 64)) += int64(v145) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v148 = envPtr2 + 152 v147 = *(*uintptr)(unsafe.Pointer(v148)) *(*uintptr)(unsafe.Pointer(v148))++ *(*uint8)(unsafe.Pointer(v147)) = libc.Uint8FromInt32(int32(INST_LIST_CONCAT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST_CONCAT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v149 = delta1 v150 = envPtr2 if v149 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v150)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v150)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v150)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v150)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v150 + 64)) += int64(v149) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpSplice) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(jumpSplice))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v152 = envPtr2 + 152 v151 = *(*uintptr)(unsafe.Pointer(v152)) *(*uintptr)(unsafe.Pointer(v152))++ *(*uint8)(unsafe.Pointer(v151)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v154 = envPtr2 + 152 v153 = *(*uintptr)(unsafe.Pointer(v154)) *(*uintptr)(unsafe.Pointer(v154))++ *(*uint8)(unsafe.Pointer(v153)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4)) >> libc.Int32FromInt32(24)) v156 = envPtr2 + 152 v155 = *(*uintptr)(unsafe.Pointer(v156)) *(*uintptr)(unsafe.Pointer(v156))++ *(*uint8)(unsafe.Pointer(v155)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4)) >> libc.Int32FromInt32(16)) v158 = envPtr2 + 152 v157 = *(*uintptr)(unsafe.Pointer(v158)) *(*uintptr)(unsafe.Pointer(v158))++ *(*uint8)(unsafe.Pointer(v157)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4)) >> libc.Int32FromInt32(8)) v160 = envPtr2 + 152 v159 = *(*uintptr)(unsafe.Pointer(v160)) *(*uintptr)(unsafe.Pointer(v160))++ *(*uint8)(unsafe.Pointer(v159)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(4))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(4) } v161 = delta1 v162 = envPtr2 if v161 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v162)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v162)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v162)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v162)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v162 + 64)) += int64(v161) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v164 = envPtr2 + 152 v163 = *(*uintptr)(unsafe.Pointer(v164)) *(*uintptr)(unsafe.Pointer(v164))++ *(*uint8)(unsafe.Pointer(v163)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v165 = delta1 v166 = envPtr2 if v165 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v166)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v166)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v166)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v166)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v166 + 64)) += int64(v165) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v168 = envPtr2 + 152 v167 = *(*uintptr)(unsafe.Pointer(v168)) *(*uintptr)(unsafe.Pointer(v168))++ *(*uint8)(unsafe.Pointer(v167)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v169 = delta1 v170 = envPtr2 if v169 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v170)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v170)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v170)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v170)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v170 + 64)) += int64(v169) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v172 = envPtr2 + 152 v171 = *(*uintptr)(unsafe.Pointer(v172)) *(*uintptr)(unsafe.Pointer(v172))++ *(*uint8)(unsafe.Pointer(v171)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v174 = envPtr2 + 152 v173 = *(*uintptr)(unsafe.Pointer(v174)) *(*uintptr)(unsafe.Pointer(v174))++ *(*uint8)(unsafe.Pointer(v173)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(7))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(7) } v175 = delta1 v176 = envPtr2 if v175 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v176)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v176)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v176)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v176)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v176 + 64)) += int64(v175) } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(jumpOK) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(jumpOK))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v178 = envPtr2 + 152 v177 = *(*uintptr)(unsafe.Pointer(v178)) *(*uintptr)(unsafe.Pointer(v178))++ *(*uint8)(unsafe.Pointer(v177)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v180 = envPtr2 + 152 v179 = *(*uintptr)(unsafe.Pointer(v180)) *(*uintptr)(unsafe.Pointer(v180))++ *(*uint8)(unsafe.Pointer(v179)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v182 = envPtr2 + 152 v181 = *(*uintptr)(unsafe.Pointer(v182)) *(*uintptr)(unsafe.Pointer(v182))++ *(*uint8)(unsafe.Pointer(v181)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v184 = envPtr2 + 152 v183 = *(*uintptr)(unsafe.Pointer(v184)) *(*uintptr)(unsafe.Pointer(v184))++ *(*uint8)(unsafe.Pointer(v183)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v186 = envPtr2 + 152 v185 = *(*uintptr)(unsafe.Pointer(v186)) *(*uintptr)(unsafe.Pointer(v186))++ *(*uint8)(unsafe.Pointer(v185)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v187 = delta1 v188 = envPtr2 if v187 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v188)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v188)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v188)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v188)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v188 + 64)) += int64(v187) } XTclEmitInvoke(tls, envPtr2, int32(INST_RETURN_STK), 0) return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileUnsetCmd -- * * Procedure called to compile the "unset" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "unset" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileUnsetCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy3622 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Holds resulting instructions. */ var _objIndexCopy, delta1, flags, haveFlags, i1, varCount, v16, v22, v36, v42, v56, v68 int32 var bytes, cachePtr, cachePtr1, cachePtr2, leadingWord, mapPtr, varTokenPtr, v12, v13, v14, v15, v17, v18, v19, v20, v21, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v69, v8 uintptr var eclIndex, v3, v7 TTcl_Size var v2, v5, v9 bool var _ /* isScalar at bp+0 */ int32 var _ /* len at bp+8 */ TTcl_Size var _ /* localIndex at bp+4 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, bytes, cachePtr, cachePtr1, cachePtr2, delta1, eclIndex, flags, haveFlags, i1, leadingWord, mapPtr, varCount, varTokenPtr, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) flags = int32(1) varCount = 0 haveFlags = 0 /* TODO: Consider support for compiling expanded args. */ /* * Verify that all words - except the first non-option one - are known at * compile time so that we can handle them without needing to do a nasty * push/rotate. [Bug 3970f54c4e] */ i1 = int32(1) varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { leadingWord = XTclThreadAllocObj(tls) } else { leadingWord = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(leadingWord + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(leadingWord)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(leadingWord)).FtypePtr = libc.UintptrFromInt32(0) varTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if !(XTclWordKnownAtCompileTime(tls, varTokenPtr, leadingWord) != 0) { v4 = leadingWord v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if !(v3 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(leadingWord)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(leadingWord)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Flength = int64(-libc.Int32FromInt32(1)) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, leadingWord) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(leadingWord + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = leadingWord (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, leadingWord) } } /* * We can tolerate non-trivial substitutions in the first variable * to be unset. If a '--' or '-nocomplain' was present, anything * goes in that one place! (All subsequent variable names must be * constants since we don't want to have to push them all first.) */ if varCount == 0 { if haveFlags != 0 { goto _1 } /* * In fact, we're OK as long as we're the first argument *and* * we provably don't start with a '-'. If that is true, then * even if everything else is varying, we still can't be a * flag. Otherwise we'll spill to runtime to place a limit on * the trickiness. */ if (*TTcl_Token)(unsafe.Pointer(varTokenPtr)).Ftype1 == int32(TCL_TOKEN_WORD) && (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Ftype1 == int32(TCL_TOKEN_TEXT) && (*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fsize > 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*(*TTcl_Token)(unsafe.Pointer(varTokenPtr + 1*32))).Fstart))) != int32('-') { goto _1 } } return int32(TCL_ERROR) } if varCount == 0 { if (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Flength v6 = (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, leadingWord, bp+8) } bytes = v6 if i1 == int32(1) && *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(11) && !(libc.Xstrncmp(tls, __ccgo_ts+22371, bytes, uint64(11)) != 0) { flags = 0 haveFlags++ } else { if i1 == int32(2)-flags && *(*TTcl_Size)(unsafe.Pointer(bp + 8)) == int64(2) && !(libc.Xstrncmp(tls, __ccgo_ts+18684, bytes, uint64(2)) != 0) { haveFlags++ } else { varCount++ } } } else { varCount++ } v8 = leadingWord v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if !(v7 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(leadingWord)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(leadingWord)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(leadingWord)).Flength = int64(-libc.Int32FromInt32(1)) if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, leadingWord) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(leadingWord + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = leadingWord (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, leadingWord) } } goto _1 _1: ; i1++ } /* * Issue instructions to unset each of the named variables. */ varTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 i1 = 0 for { if !(i1 < haveFlags) { break } varTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _10 _10: ; i1++ } i1 = int32(1) + haveFlags for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } /* * Decide if we can use a frame slot for the var/array name or if we * need to emit code to compute and push the name at runtime. We use a * frame slot (entry in the array of local vars) if we are compiling a * procedure body and if the name is simple text that does not include * namespace qualifiers. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclPushVarName(tls, interp, varTokenPtr, envPtr2, 0, bp+4, bp) /* * Emit instructions to unset the variable. */ if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(INST_UNSET_STK)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(flags)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - flags } v16 = delta1 v17 = envPtr2 if v16 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v17)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v17)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v17)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v17)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v17 + 64)) += int64(v16) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(flags)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - flags } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) } } else { if *(*int32)(unsafe.Pointer(bp + 4)) < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_UNSET_ARRAY_STK)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(flags)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - flags } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_UNSET_ARRAY)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(flags)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_ARRAY)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - flags } v42 = delta1 v43 = envPtr2 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(24)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(16)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4))) >> libc.Int32FromInt32(8)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 4)))) } } varTokenPtr = varTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(varTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _11 _11: ; i1++ } _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v56 = delta1 v57 = envPtr2 if v56 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v57)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v57)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v57)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v57)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v57 + 64)) += int64(v56) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v65 = envPtr2 + 152 v64 = *(*uintptr)(unsafe.Pointer(v65)) *(*uintptr)(unsafe.Pointer(v65))++ *(*uint8)(unsafe.Pointer(v64)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v68 = delta1 v69 = envPtr2 if v68 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v69 + 64)) += int64(v68) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileWhileCmd -- * * Procedure called to compile the "while" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "while" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileWhileCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy3760 uintptr, envPtr2 uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Holds resulting instructions. */ var _objIndexCopy, bodyCodeOffset, code, delta1, jumpDist, loopMayEnd, range1, testCodeOffset, v20, v26, v38, v44, v50, v62, v8 int32 var bodyTokenPtr, boolObj, cachePtr, mapPtr, testTokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v21, v22, v23, v24, v25, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v39, v40, v41, v42, v43, v45, v46, v47, v48, v49, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v63, v7, v9 uintptr var eclIndex, v1, v5 TTcl_Size var v3 bool var v4 int64 var _ /* boolVal at bp+16 */ int32 var _ /* jumpEvalCondFixup at bp+0 */ TJumpFixup _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, bodyCodeOffset, bodyTokenPtr, boolObj, cachePtr, code, delta1, eclIndex, jumpDist, loopMayEnd, mapPtr, range1, testCodeOffset, testTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) loopMayEnd = int32(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } /* * If the test expression requires substitutions, don't compile the while * command inline. E.g., the expression might cause the loop to never * execute or execute forever, as in "while "$x < 5" {}". * * Bail out also if the body expression requires substitutions in order to * insure correct behaviour [Bug 219166] */ testTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 bodyTokenPtr = testTokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(testTokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(testTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) || (*TTcl_Token)(unsafe.Pointer(bodyTokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { return int32(TCL_ERROR) } /* * Find out if the condition is a constant. */ boolObj = XTcl_NewStringObj(tls, (*(*TTcl_Token)(unsafe.Pointer(testTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(testTokenPtr + 1*32))).Fsize) (*TTcl_Obj)(unsafe.Pointer(boolObj)).FrefCount++ code = XTcl_GetBoolFromObj(tls, libc.UintptrFromInt32(0), boolObj, (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp+16) v2 = boolObj v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, boolObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = boolObj (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, boolObj) } } if code == TCL_OK { if *(*int32)(unsafe.Pointer(bp + 16)) != 0 { /* * It is an infinite loop; flag it so that we generate a more * efficient body. */ loopMayEnd = 0 } else { /* * This is an empty loop: "while 0 {...}" or such. Compile no * bytecodes. */ goto pushResult } } /* * Create a ExceptionRange record for the loop body. This is used to * implement break and continue. */ range1 = int32(XTclCreateExceptRange(tls, int32(LOOP_EXCEPTION_RANGE), envPtr2)) /* * Jump to the evaluation of the condition. This code uses the "loop * rotation" optimisation (which eliminates one branch from the loop). * "while cond body" produces then: * goto A * B: body : bodyCodeOffset * A: cond -> result : testCodeOffset, continueOffset * if (result) goto B * * The infinite loop "while 1 body" produces: * B: body : all three offsets here * goto B */ if loopMayEnd != 0 { XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), bp) testCodeOffset = 0 /* Avoid compiler warning. */ } else { /* * Make sure that the first command in the body is preceded by an * INST_START_CMD, and hence counted properly. [Bug 1752146] */ *(*int32)(unsafe.Pointer(envPtr2 + 4520)) &= ^libc.Int32FromInt32(1) testCodeOffset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) } /* * Compile the loop body. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth)+uint64(1) { v4 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth } else { v4 = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FmaxExceptDepth = v4 v5 = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = v5 bodyCodeOffset = int32(v5) if !(loopMayEnd != 0) { (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcontinueOffset = int64(testCodeOffset) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64(bodyCodeOffset) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileCmdWord(tls, interp, bodyTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(bodyTokenPtr)).FnumComponents), envPtr2) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v8 = delta1 v9 = envPtr2 if v8 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v9 + 64)) += int64(v8) } /* * Compile the test expression then emit the conditional jump that * terminates the while. We already know it's a simple word. */ if loopMayEnd != 0 { testCodeOffset = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) jumpDist = libc.Int32FromUint32(libc.Uint32FromInt32(testCodeOffset) - (*(*TJumpFixup)(unsafe.Pointer(bp))).FcodeOffset) if XTclFixupForwardJump(tls, envPtr2, bp, jumpDist, int32(127)) != 0 { bodyCodeOffset += int32(3) testCodeOffset += int32(3) } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileExprWords(tls, interp, testTokenPtr, uint64(1), envPtr2) jumpDist = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(bodyCodeOffset)) if jumpDist > int32(127) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE4)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(-jumpDist) >> libc.Int32FromInt32(24)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(-jumpDist) >> libc.Int32FromInt32(16)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(-jumpDist) >> libc.Int32FromInt32(8)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(-jumpDist)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - -jumpDist } v20 = delta1 v21 = envPtr2 if v20 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v21 + 64)) += int64(v20) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(-jumpDist)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - -jumpDist } v26 = delta1 v27 = envPtr2 if v26 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v27 + 64)) += int64(v26) } } } else { jumpDist = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(bodyCodeOffset)) if jumpDist > int32(127) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(-jumpDist) >> libc.Int32FromInt32(24)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(-jumpDist) >> libc.Int32FromInt32(16)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(-jumpDist) >> libc.Int32FromInt32(8)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(-jumpDist)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - -jumpDist } v38 = delta1 v39 = envPtr2 if v38 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v39 + 64)) += int64(v38) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt32(-jumpDist)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - -jumpDist } v44 = delta1 v45 = envPtr2 if v44 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v45 + 64)) += int64(v44) } } } /* * Set the loop's body, continue and break offsets. */ (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcontinueOffset = int64(testCodeOffset) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FcodeOffset = int64(bodyCodeOffset) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).FbreakOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) XTclFinalizeLoopExceptionRange(tls, envPtr2, range1) /* * The while command's result is an empty string. */ goto pushResult pushResult: ; _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v50 = delta1 v51 = envPtr2 if v50 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v51 + 64)) += int64(v50) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v62 = delta1 v63 = envPtr2 if v62 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v63)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v63)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v63)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v63)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v63 + 64)) += int64(v62) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileYieldCmd -- * * Procedure called to compile the "yield" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "yield" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileYieldCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy3937 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, delta1, v17, v23, v35, v39, v5 int32 var eclIndex TTcl_Size var mapPtr, valueTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v4, v40, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, valueTokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v5, v6, v7, v8, v9 if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < int64(1) || (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > int64(2) { return int32(TCL_ERROR) } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(1) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ valueTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(valueTokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, valueTokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(valueTokenPtr)).FnumComponents), envPtr2) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_YIELD)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_YIELD)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v39 = delta1 v40 = envPtr2 if v39 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v40)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v40)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v40 + 64)) += int64(v39) } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompileYieldToCmd -- * * Procedure called to compile the "yieldto" command. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the "yieldto" command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileYieldToCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy3979 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, i1, v10, v22, v3, v34, v38 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v35, v36, v37, v39, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, i1, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(2) { return int32(TCL_ERROR) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_NS_CURRENT)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_NS_CURRENT)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v10 = delta1 v11 = envPtr2 if v10 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v11 + 64)) += int64(v10) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _5 _5: ; i1++ } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = libc.Uint8FromInt32(int32(INST_LIST)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(i1) >> libc.Int32FromInt32(24)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(i1) >> libc.Int32FromInt32(16)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(i1) >> libc.Int32FromInt32(8)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(i1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LIST)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - i1 } v34 = delta1 v35 = envPtr2 if v34 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v35 + 64)) += int64(v34) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = libc.Uint8FromInt32(int32(INST_YIELD_TO_INVOKE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_YIELD_TO_INVOKE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v38 = delta1 v39 = envPtr2 if v38 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v39 + 64)) += int64(v38) } return TCL_OK } /* *---------------------------------------------------------------------- * * CompileUnaryOpCmd -- * * Utility routine to compile the unary operator commands. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the compiled command at * runtime. * *---------------------------------------------------------------------- */ func _CompileUnaryOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, instruction int32, envPtr2 uintptr) (r int32) { var _objIndexCopy, delta1, v17, v21, v22, v5 int32 var eclIndex TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v19, v2, v20, v23, v3, v4, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(instruction) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if instruction == int32(INST_START_CMD) { v21 = int32(1) } else { v21 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v21 } delta1 = XtclInstructionTable[libc.Uint8FromInt32(instruction)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } return TCL_OK } /* *---------------------------------------------------------------------- * * CompileAssociativeBinaryOpCmd -- * * Utility routine to compile the binary operator commands that accept an * arbitrary number of arguments, and that are associative operations. * Because of the associativity, we may combine operations from right to * left, saving us any effort of re-ordering the arguments on the stack * after substitutions are completed. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the compiled command at * runtime. * *---------------------------------------------------------------------- */ func _CompileAssociativeBinaryOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, identity uintptr, instruction int32, envPtr2 uintptr) (r int32) { var _objIndexCopy, _objIndexCopy1, delta1, v18, v24, v36, v48, v53, v54, v6 int32 var eclIndex, words, v50 TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v49, v5, v51, v52, v55, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, tokenPtr, words, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr /* TODO: Consider support for compiling expanded args. */ words = int64(1) for { if !(words < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(words)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(words)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } goto _1 _1: ; words++ } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords <= int64(2) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, identity, int64(-libc.Int32FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } words++ } if words > int64(3) { /* * Reverse order of arguments to get precise agreement with [expr] in * calculations, including roundoff errors. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt64(words-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(24)) v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = uint8(libc.Uint32FromInt64(words-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(16)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt64(words-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(8)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt64(words - libc.Int64FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(words-libc.Int64FromInt32(1)) } v48 = delta1 v49 = envPtr2 if v48 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v49 + 64)) += int64(v48) } } for { words-- v50 = words if !(v50 > int64(1)) { break } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = libc.Uint8FromInt32(instruction) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if instruction == int32(INST_START_CMD) { v53 = int32(1) } else { v53 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v53 } delta1 = XtclInstructionTable[libc.Uint8FromInt32(instruction)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v54 = delta1 v55 = envPtr2 if v54 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v55)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v55)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v55 + 64)) += int64(v54) } } return TCL_OK } /* *---------------------------------------------------------------------- * * CompileStrictlyBinaryOpCmd -- * * Utility routine to compile the binary operator commands, that strictly * accept exactly two arguments. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the compiled command at * runtime. * *---------------------------------------------------------------------- */ func _CompileStrictlyBinaryOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, instruction int32, envPtr uintptr) (r int32) { if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } return _CompileAssociativeBinaryOpCmd(tls, interp, parsePtr, libc.UintptrFromInt32(0), instruction, envPtr) } /* *---------------------------------------------------------------------- * * CompileComparisonOpCmd -- * * Utility routine to compile the n-ary comparison operator commands. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the compiled command at * runtime. * *---------------------------------------------------------------------- */ func _CompileComparisonOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, instruction int32, envPtr2 uintptr) (r int32) { var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, delta1, tmpIndex, v100, v112, v116, v117, v124, v136, v142, v154, v161, v17, v173, v177, v178, v183, v189, v23, v35, v41, v5, v53, v57, v58, v64, v76, v82, v94 int32 var eclIndex, words, v156 TTcl_Size var mapPtr, tokenPtr, v1, v10, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v113, v114, v115, v118, v12, v120, v121, v122, v123, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v137, v138, v139, v14, v140, v141, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v155, v157, v158, v159, v16, v160, v162, v163, v164, v165, v166, v167, v168, v169, v170, v171, v172, v174, v175, v176, v179, v18, v181, v182, v184, v185, v186, v187, v188, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v2, v20, v21, v22, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v36, v37, v38, v39, v4, v40, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v54, v55, v56, v59, v6, v60, v61, v62, v63, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v77, v78, v79, v8, v80, v81, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v95, v96, v97, v98, v99 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, delta1, eclIndex, mapPtr, tmpIndex, tokenPtr, words, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v157, v158, v159, v16, v160, v161, v162, v163, v164, v165, v166, v167, v168, v169, v17, v170, v171, v172, v173, v174, v175, v176, v177, v178, v179, v18, v181, v182, v183, v184, v185, v186, v187, v188, v189, v19, v190, v191, v192, v193, v194, v195, v196, v197, v198, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v93, v94, v95, v96, v97, v98, v99 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TODO: Consider support for compiling expanded args. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(3) { tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v20 = envPtr2 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v22 = envPtr2 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v23 = delta1 v24 = envPtr2 if v23 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v24)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v24)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v24 + 64)) += int64(v23) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v26 = envPtr2 + 152 v25 = *(*uintptr)(unsafe.Pointer(v26)) *(*uintptr)(unsafe.Pointer(v26))++ *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v28 = envPtr2 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v30 = envPtr2 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v32 = envPtr2 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v52 = envPtr2 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v53 = delta1 v54 = envPtr2 if v53 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v54)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v54)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v54 + 64)) += int64(v53) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(instruction) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if instruction == int32(INST_START_CMD) { v57 = int32(1) } else { v57 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v57 } delta1 = XtclInstructionTable[libc.Uint8FromInt32(instruction)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v58 = delta1 v59 = envPtr2 if v58 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v59)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v59)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v59)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v59)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v59 + 64)) += int64(v58) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FprocPtr == libc.UintptrFromInt32(0) { /* * No local variable space! */ return int32(TCL_ERROR) } else { tmpIndex = int32(XTclFindCompiledLocal(tls, libc.UintptrFromInt32(0), 0, int32(1), envPtr2)) tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v64 = delta1 v65 = envPtr2 if v64 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v65 + 64)) += int64(v64) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v71 = envPtr2 + 152 v70 = *(*uintptr)(unsafe.Pointer(v71)) *(*uintptr)(unsafe.Pointer(v71))++ *(*uint8)(unsafe.Pointer(v70)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v73 = envPtr2 + 152 v72 = *(*uintptr)(unsafe.Pointer(v73)) *(*uintptr)(unsafe.Pointer(v73))++ *(*uint8)(unsafe.Pointer(v72)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v75 = envPtr2 + 152 v74 = *(*uintptr)(unsafe.Pointer(v75)) *(*uintptr)(unsafe.Pointer(v75))++ *(*uint8)(unsafe.Pointer(v74)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v76 = delta1 v77 = envPtr2 if v76 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v77 + 64)) += int64(v76) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 1*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 1*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy4 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v79 = envPtr2 + 152 v78 = *(*uintptr)(unsafe.Pointer(v79)) *(*uintptr)(unsafe.Pointer(v79))++ *(*uint8)(unsafe.Pointer(v78)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v81 = envPtr2 + 152 v80 = *(*uintptr)(unsafe.Pointer(v81)) *(*uintptr)(unsafe.Pointer(v81))++ *(*uint8)(unsafe.Pointer(v80)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v82 = delta1 v83 = envPtr2 if v82 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v83)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v83)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v83 + 64)) += int64(v82) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v85 = envPtr2 + 152 v84 = *(*uintptr)(unsafe.Pointer(v85)) *(*uintptr)(unsafe.Pointer(v85))++ *(*uint8)(unsafe.Pointer(v84)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v87 = envPtr2 + 152 v86 = *(*uintptr)(unsafe.Pointer(v87)) *(*uintptr)(unsafe.Pointer(v87))++ *(*uint8)(unsafe.Pointer(v86)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v89 = envPtr2 + 152 v88 = *(*uintptr)(unsafe.Pointer(v89)) *(*uintptr)(unsafe.Pointer(v89))++ *(*uint8)(unsafe.Pointer(v88)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v91 = envPtr2 + 152 v90 = *(*uintptr)(unsafe.Pointer(v91)) *(*uintptr)(unsafe.Pointer(v91))++ *(*uint8)(unsafe.Pointer(v90)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v93 = envPtr2 + 152 v92 = *(*uintptr)(unsafe.Pointer(v93)) *(*uintptr)(unsafe.Pointer(v93))++ *(*uint8)(unsafe.Pointer(v92)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v94 = delta1 v95 = envPtr2 if v94 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v95)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v95)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v95)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v95)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v95 + 64)) += int64(v94) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + 2*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + 2*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } if tmpIndex < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v99 = envPtr2 + 152 v98 = *(*uintptr)(unsafe.Pointer(v99)) *(*uintptr)(unsafe.Pointer(v99))++ *(*uint8)(unsafe.Pointer(v98)) = uint8(libc.Uint32FromInt32(tmpIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - tmpIndex } v100 = delta1 v101 = envPtr2 if v100 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v101)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v101)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v101 + 64)) += int64(v100) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(24)) v107 = envPtr2 + 152 v106 = *(*uintptr)(unsafe.Pointer(v107)) *(*uintptr)(unsafe.Pointer(v107))++ *(*uint8)(unsafe.Pointer(v106)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(16)) v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(8)) v111 = envPtr2 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = uint8(libc.Uint32FromInt32(tmpIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - tmpIndex } v112 = delta1 v113 = envPtr2 if v112 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v113)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v113)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v113 + 64)) += int64(v112) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = libc.Uint8FromInt32(instruction) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if instruction == int32(INST_START_CMD) { v116 = int32(1) } else { v116 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v116 } delta1 = XtclInstructionTable[libc.Uint8FromInt32(instruction)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v117 = delta1 v118 = envPtr2 if v117 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v118)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v118)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v118)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v118)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v118 + 64)) += int64(v117) } words = int64(3) for { if !(words < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) { break } if tmpIndex < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v123 = envPtr2 + 152 v122 = *(*uintptr)(unsafe.Pointer(v123)) *(*uintptr)(unsafe.Pointer(v123))++ *(*uint8)(unsafe.Pointer(v122)) = uint8(libc.Uint32FromInt32(tmpIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - tmpIndex } v124 = delta1 v125 = envPtr2 if v124 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v125 + 64)) += int64(v124) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v127 = envPtr2 + 152 v126 = *(*uintptr)(unsafe.Pointer(v127)) *(*uintptr)(unsafe.Pointer(v127))++ *(*uint8)(unsafe.Pointer(v126)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v129 = envPtr2 + 152 v128 = *(*uintptr)(unsafe.Pointer(v129)) *(*uintptr)(unsafe.Pointer(v129))++ *(*uint8)(unsafe.Pointer(v128)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(24)) v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(16)) v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(8)) v135 = envPtr2 + 152 v134 = *(*uintptr)(unsafe.Pointer(v135)) *(*uintptr)(unsafe.Pointer(v135))++ *(*uint8)(unsafe.Pointer(v134)) = uint8(libc.Uint32FromInt32(tmpIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - tmpIndex } v136 = delta1 v137 = envPtr2 if v136 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v137 + 64)) += int64(v136) } } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy5 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v139 = envPtr2 + 152 v138 = *(*uintptr)(unsafe.Pointer(v139)) *(*uintptr)(unsafe.Pointer(v139))++ *(*uint8)(unsafe.Pointer(v138)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v141 = envPtr2 + 152 v140 = *(*uintptr)(unsafe.Pointer(v141)) *(*uintptr)(unsafe.Pointer(v141))++ *(*uint8)(unsafe.Pointer(v140)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v142 = delta1 v143 = envPtr2 if v142 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v143)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v143)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v143)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v143)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v143 + 64)) += int64(v142) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v145 = envPtr2 + 152 v144 = *(*uintptr)(unsafe.Pointer(v145)) *(*uintptr)(unsafe.Pointer(v145))++ *(*uint8)(unsafe.Pointer(v144)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v147 = envPtr2 + 152 v146 = *(*uintptr)(unsafe.Pointer(v147)) *(*uintptr)(unsafe.Pointer(v147))++ *(*uint8)(unsafe.Pointer(v146)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v149 = envPtr2 + 152 v148 = *(*uintptr)(unsafe.Pointer(v149)) *(*uintptr)(unsafe.Pointer(v149))++ *(*uint8)(unsafe.Pointer(v148)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v151 = envPtr2 + 152 v150 = *(*uintptr)(unsafe.Pointer(v151)) *(*uintptr)(unsafe.Pointer(v151))++ *(*uint8)(unsafe.Pointer(v150)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v153 = envPtr2 + 152 v152 = *(*uintptr)(unsafe.Pointer(v153)) *(*uintptr)(unsafe.Pointer(v153))++ *(*uint8)(unsafe.Pointer(v152)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v154 = delta1 v155 = envPtr2 if v154 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v155)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v155)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v155)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v155)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v155 + 64)) += int64(v154) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(words)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(words)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } words++ v156 = words if v156 < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords { if tmpIndex < int32(256) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v158 = envPtr2 + 152 v157 = *(*uintptr)(unsafe.Pointer(v158)) *(*uintptr)(unsafe.Pointer(v158))++ *(*uint8)(unsafe.Pointer(v157)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR1)) v160 = envPtr2 + 152 v159 = *(*uintptr)(unsafe.Pointer(v160)) *(*uintptr)(unsafe.Pointer(v160))++ *(*uint8)(unsafe.Pointer(v159)) = uint8(libc.Uint32FromInt32(tmpIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - tmpIndex } v161 = delta1 v162 = envPtr2 if v161 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v162)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v162)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v162)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v162)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v162 + 64)) += int64(v161) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v164 = envPtr2 + 152 v163 = *(*uintptr)(unsafe.Pointer(v164)) *(*uintptr)(unsafe.Pointer(v164))++ *(*uint8)(unsafe.Pointer(v163)) = libc.Uint8FromInt32(int32(INST_STORE_SCALAR4)) v166 = envPtr2 + 152 v165 = *(*uintptr)(unsafe.Pointer(v166)) *(*uintptr)(unsafe.Pointer(v166))++ *(*uint8)(unsafe.Pointer(v165)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(24)) v168 = envPtr2 + 152 v167 = *(*uintptr)(unsafe.Pointer(v168)) *(*uintptr)(unsafe.Pointer(v168))++ *(*uint8)(unsafe.Pointer(v167)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(16)) v170 = envPtr2 + 152 v169 = *(*uintptr)(unsafe.Pointer(v170)) *(*uintptr)(unsafe.Pointer(v170))++ *(*uint8)(unsafe.Pointer(v169)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(8)) v172 = envPtr2 + 152 v171 = *(*uintptr)(unsafe.Pointer(v172)) *(*uintptr)(unsafe.Pointer(v172))++ *(*uint8)(unsafe.Pointer(v171)) = uint8(libc.Uint32FromInt32(tmpIndex)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STORE_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - tmpIndex } v173 = delta1 v174 = envPtr2 if v173 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v174)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v174)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v174)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v174)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v174 + 64)) += int64(v173) } } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v176 = envPtr2 + 152 v175 = *(*uintptr)(unsafe.Pointer(v176)) *(*uintptr)(unsafe.Pointer(v176))++ *(*uint8)(unsafe.Pointer(v175)) = libc.Uint8FromInt32(instruction) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if instruction == int32(INST_START_CMD) { v177 = int32(1) } else { v177 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v177 } delta1 = XtclInstructionTable[libc.Uint8FromInt32(instruction)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v178 = delta1 v179 = envPtr2 if v178 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v179)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v179)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v179)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v179)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v179 + 64)) += int64(v178) } goto _119 _119: } for { if !(words > int64(3)) { break } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v182 = envPtr2 + 152 v181 = *(*uintptr)(unsafe.Pointer(v182)) *(*uintptr)(unsafe.Pointer(v182))++ *(*uint8)(unsafe.Pointer(v181)) = libc.Uint8FromInt32(int32(INST_BITAND)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_BITAND)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v183 = delta1 v184 = envPtr2 if v183 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v184)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v184)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v184)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v184)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v184 + 64)) += int64(v183) } goto _180 _180: ; words-- } /* * Drop the value from the temp variable; retaining that reference * might be expensive elsewhere. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v186 = envPtr2 + 152 v185 = *(*uintptr)(unsafe.Pointer(v186)) *(*uintptr)(unsafe.Pointer(v186))++ *(*uint8)(unsafe.Pointer(v185)) = libc.Uint8FromInt32(int32(INST_UNSET_SCALAR)) v188 = envPtr2 + 152 v187 = *(*uintptr)(unsafe.Pointer(v188)) *(*uintptr)(unsafe.Pointer(v188))++ *(*uint8)(unsafe.Pointer(v187)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UNSET_SCALAR)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v189 = delta1 v190 = envPtr2 if v189 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v190)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v190)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v190)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v190)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v190 + 64)) += int64(v189) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v192 = envPtr2 + 152 v191 = *(*uintptr)(unsafe.Pointer(v192)) *(*uintptr)(unsafe.Pointer(v192))++ *(*uint8)(unsafe.Pointer(v191)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(24)) v194 = envPtr2 + 152 v193 = *(*uintptr)(unsafe.Pointer(v194)) *(*uintptr)(unsafe.Pointer(v194))++ *(*uint8)(unsafe.Pointer(v193)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(16)) v196 = envPtr2 + 152 v195 = *(*uintptr)(unsafe.Pointer(v196)) *(*uintptr)(unsafe.Pointer(v196))++ *(*uint8)(unsafe.Pointer(v195)) = uint8(libc.Uint32FromInt32(tmpIndex) >> libc.Int32FromInt32(8)) v198 = envPtr2 + 152 v197 = *(*uintptr)(unsafe.Pointer(v198)) *(*uintptr)(unsafe.Pointer(v198))++ *(*uint8)(unsafe.Pointer(v197)) = uint8(libc.Uint32FromInt32(tmpIndex)) } } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclCompile*OpCmd -- * * Procedures called to compile the corresponding "::tcl::mathop::*" * commands. These are all wrappers around the utility operator command * compiler functions, except for the compilers for subtraction and * division, which are special. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the compiled command at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileInvertOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4228 uintptr, envPtr uintptr) (r int32) { return _CompileUnaryOpCmd(tls, interp, parsePtr, int32(INST_BITNOT), envPtr) } func XTclCompileNotOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4238 uintptr, envPtr uintptr) (r int32) { return _CompileUnaryOpCmd(tls, interp, parsePtr, int32(INST_LNOT), envPtr) } func XTclCompileAddOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4248 uintptr, envPtr uintptr) (r int32) { return _CompileAssociativeBinaryOpCmd(tls, interp, parsePtr, __ccgo_ts+14828, int32(INST_ADD), envPtr) } func XTclCompileMulOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4259 uintptr, envPtr uintptr) (r int32) { return _CompileAssociativeBinaryOpCmd(tls, interp, parsePtr, __ccgo_ts+21397, int32(INST_MULT), envPtr) } func XTclCompileAndOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4270 uintptr, envPtr uintptr) (r int32) { return _CompileAssociativeBinaryOpCmd(tls, interp, parsePtr, __ccgo_ts+22383, int32(INST_BITAND), envPtr) } func XTclCompileOrOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4281 uintptr, envPtr uintptr) (r int32) { return _CompileAssociativeBinaryOpCmd(tls, interp, parsePtr, __ccgo_ts+14828, int32(INST_BITOR), envPtr) } func XTclCompileXorOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4292 uintptr, envPtr uintptr) (r int32) { return _CompileAssociativeBinaryOpCmd(tls, interp, parsePtr, __ccgo_ts+14828, int32(INST_BITXOR), envPtr) } func XTclCompilePowOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4303 uintptr, envPtr2 uintptr) (r int32) { var _objIndexCopy, _objIndexCopy1, delta1, v18, v24, v36, v41, v6 int32 var eclIndex, words, v38 TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v39, v4, v40, v42, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, tokenPtr, words, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr /* * This one has its own implementation because the ** operator is the only * one with right associativity. */ words = int64(1) for { if !(words < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(words)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(words)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } goto _1 _1: ; words++ } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords <= int64(2) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+21397, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } words++ } for { words-- v38 = words if !(v38 > int64(1)) { break } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v40 = envPtr2 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = libc.Uint8FromInt32(int32(INST_EXPON)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EXPON)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v41 = delta1 v42 = envPtr2 if v41 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v42)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v42)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v42 + 64)) += int64(v41) } } return TCL_OK } func XTclCompileLshiftOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4333 uintptr, envPtr uintptr) (r int32) { return _CompileStrictlyBinaryOpCmd(tls, interp, parsePtr, int32(INST_LSHIFT), envPtr) } func XTclCompileRshiftOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4343 uintptr, envPtr uintptr) (r int32) { return _CompileStrictlyBinaryOpCmd(tls, interp, parsePtr, int32(INST_RSHIFT), envPtr) } func XTclCompileModOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4353 uintptr, envPtr uintptr) (r int32) { return _CompileStrictlyBinaryOpCmd(tls, interp, parsePtr, int32(INST_MOD), envPtr) } func XTclCompileNeqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4363 uintptr, envPtr uintptr) (r int32) { return _CompileStrictlyBinaryOpCmd(tls, interp, parsePtr, int32(INST_NEQ), envPtr) } func XTclCompileStrneqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4373 uintptr, envPtr uintptr) (r int32) { return _CompileStrictlyBinaryOpCmd(tls, interp, parsePtr, int32(INST_STR_NEQ), envPtr) } func XTclCompileInOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4383 uintptr, envPtr uintptr) (r int32) { return _CompileStrictlyBinaryOpCmd(tls, interp, parsePtr, int32(INST_LIST_IN), envPtr) } func XTclCompileNiOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4393 uintptr, envPtr uintptr) (r int32) { return _CompileStrictlyBinaryOpCmd(tls, interp, parsePtr, int32(INST_LIST_NOT_IN), envPtr) } func XTclCompileLessOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4404 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_LT), envPtr) } func XTclCompileLeqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4414 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_LE), envPtr) } func XTclCompileGreaterOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4424 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_GT), envPtr) } func XTclCompileGeqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4434 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_GE), envPtr) } func XTclCompileEqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4444 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_EQ), envPtr) } func XTclCompileStreqOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4454 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_STR_EQ), envPtr) } func XTclCompileStrLtOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4464 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_STR_LT), envPtr) } func XTclCompileStrLeOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4474 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_STR_LE), envPtr) } func XTclCompileStrGtOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4484 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_STR_GT), envPtr) } func XTclCompileStrGeOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4494 uintptr, envPtr uintptr) (r int32) { return _CompileComparisonOpCmd(tls, interp, parsePtr, int32(INST_STR_GE), envPtr) } func XTclCompileMinusOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4504 uintptr, envPtr2 uintptr) (r int32) { var _objIndexCopy, delta1, v18, v22, v26, v38, v51, v55, v6 int32 var eclIndex, words, v40 TTcl_Size var mapPtr, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v23, v24, v25, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v39, v4, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v52, v53, v54, v56, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, eclIndex, mapPtr, tokenPtr, words, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr /* TODO: Consider support for compiling expanded args. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(1) { /* * Fallback to direct eval to report syntax error. */ return int32(TCL_ERROR) } words = int64(1) for { if !(words < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(words)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(words)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } goto _1 _1: ; words++ } if words == int64(2) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_UMINUS)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_UMINUS)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } return TCL_OK } if words == int64(3) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = libc.Uint8FromInt32(int32(INST_SUB)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_SUB)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v26 = delta1 v27 = envPtr2 if v26 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v27 + 64)) += int64(v26) } return TCL_OK } /* * Reverse order of arguments to get precise agreement with [expr] in * calculations, including roundoff errors. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt64(words-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(24)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt64(words-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(16)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt64(words-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(8)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt64(words - libc.Int64FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(words-int64(1)) } v38 = delta1 v39 = envPtr2 if v38 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v39 + 64)) += int64(v38) } for { words-- v40 = words if !(v40 > int64(1)) { break } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v42 = envPtr2 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v44 = envPtr2 + 152 v43 = *(*uintptr)(unsafe.Pointer(v44)) *(*uintptr)(unsafe.Pointer(v44))++ *(*uint8)(unsafe.Pointer(v43)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v46 = envPtr2 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v48 = envPtr2 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v50 = envPtr2 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v51 = delta1 v52 = envPtr2 if v51 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v52)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v52)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v52 + 64)) += int64(v51) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v54 = envPtr2 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = libc.Uint8FromInt32(int32(INST_SUB)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_SUB)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v55 = delta1 v56 = envPtr2 if v55 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v56)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v56)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v56)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v56)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v56 + 64)) += int64(v55) } } return TCL_OK } func XTclCompileDivOpCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy4549 uintptr, envPtr2 uintptr) (r int32) { var _objIndexCopy, _objIndexCopy1, delta1, v17, v24, v36, v40, v5, v52, v65, v69 int32 var eclIndex, words, v54 TTcl_Size var mapPtr, tokenPtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v2, v20, v21, v22, v23, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v37, v38, v39, v4, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v53, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v66, v67, v68, v7, v70, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, delta1, eclIndex, mapPtr, tokenPtr, words, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) /* TIP #280 */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr /* TODO: Consider support for compiling expanded args. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(1) { /* * Fallback to direct eval to report syntax error. */ return int32(TCL_ERROR) } if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == int64(2) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+22386, libc.Int64FromUint64(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr2 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr2 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr2 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr2 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } words = int64(1) for { if !(words < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v36 = delta1 v37 = envPtr2 if v36 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v37)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v37)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v37 + 64)) += int64(v36) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(words)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(words)*8)) XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) } goto _19 _19: ; words++ } if words <= int64(3) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = libc.Uint8FromInt32(int32(INST_DIV)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DIV)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v40 = delta1 v41 = envPtr2 if v40 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v41 + 64)) += int64(v40) } return TCL_OK } /* * Reverse order of arguments to get precise agreement with [expr] in * calculations, including roundoff errors. */ if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = uint8(libc.Uint32FromInt64(words-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(24)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt64(words-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(16)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt64(words-libc.Int64FromInt32(1)) >> libc.Int32FromInt32(8)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt64(words - libc.Int64FromInt32(1))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(words-int64(1)) } v52 = delta1 v53 = envPtr2 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } for { words-- v54 = words if !(v54 > int64(1)) { break } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v56 = envPtr2 + 152 v55 = *(*uintptr)(unsafe.Pointer(v56)) *(*uintptr)(unsafe.Pointer(v56))++ *(*uint8)(unsafe.Pointer(v55)) = libc.Uint8FromInt32(int32(INST_REVERSE)) v58 = envPtr2 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(24)) v60 = envPtr2 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(16)) v62 = envPtr2 + 152 v61 = *(*uintptr)(unsafe.Pointer(v62)) *(*uintptr)(unsafe.Pointer(v62))++ *(*uint8)(unsafe.Pointer(v61)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2)) >> libc.Int32FromInt32(8)) v64 = envPtr2 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(2))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_REVERSE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(2) } v65 = delta1 v66 = envPtr2 if v65 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v66)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v66)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v66 + 64)) += int64(v65) } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v68 = envPtr2 + 152 v67 = *(*uintptr)(unsafe.Pointer(v68)) *(*uintptr)(unsafe.Pointer(v68))++ *(*uint8)(unsafe.Pointer(v67)) = libc.Uint8FromInt32(int32(INST_DIV)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DIV)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v69 = delta1 v70 = envPtr2 if v69 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v70)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v70)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v70 + 64)) += int64(v69) } } return TCL_OK } /* * Macros used to update the flag that indicates if we are at the start of a * command, based on whether the opcode is INST_START_COMMAND. * * void TclUpdateAtCmdStart(unsigned char op, CompileEnv *envPtr); */ /* * Macro to emit an opcode byte into a CompileEnv's code array. The ANSI C * "prototype" for this macro is: * * void TclEmitOpcode(unsigned char op, CompileEnv *envPtr); */ /* * Macros to emit an integer operand. The ANSI C "prototype" for these macros * are: * * void TclEmitInt1(int i, CompileEnv *envPtr); * void TclEmitInt4(int i, CompileEnv *envPtr); */ /* * Macros to emit an instruction with signed or unsigned integer operands. * Four byte integers are stored in "big-endian" order with the high order * byte stored at the lowest address. The ANSI C "prototypes" for these macros * are: * * void TclEmitInstInt1(unsigned char op, int i, CompileEnv *envPtr); * void TclEmitInstInt4(unsigned char op, int i, CompileEnv *envPtr); */ /* * Macro to push a Tcl object onto the Tcl evaluation stack. It emits the * object's one or four byte array index into the CompileEnv's code array. * These support, respectively, a maximum of 256 (2**8) and 2**32 objects in a * CompileEnv. The ANSI C "prototype" for this macro is: * * void TclEmitPush(int objIndex, CompileEnv *envPtr); */ /* * Macros to update a (signed or unsigned) integer starting at a pointer. The * two variants depend on the number of bytes. The ANSI C "prototypes" for * these macros are: * * void TclStoreInt1AtPtr(int i, unsigned char *p); * void TclStoreInt4AtPtr(int i, unsigned char *p); */ /* * Macros to update instructions at a particular pc with a new op code and a * (signed or unsigned) int operand. The ANSI C "prototypes" for these macros * are: * * void TclUpdateInstInt1AtPc(unsigned char op, int i, unsigned char *pc); * void TclUpdateInstInt4AtPc(unsigned char op, int i, unsigned char *pc); */ /* * Macro to fix up a forward jump to point to the current code-generation * position in the bytecode being created (the most common case). The ANSI C * "prototypes" for this macro is: * * int TclFixupForwardJumpToHere(CompileEnv *envPtr, JumpFixup *fixupPtr, * int threshold); */ /* * Macros to get a signed integer (GET_INT{1,2}) or an unsigned int * (GET_UINT{1,2}) from a pointer. There are two variants for each return type * that depend on the number of bytes fetched. The ANSI C "prototypes" for * these macros are: * * int TclGetInt1AtPtr(unsigned char *p); * int TclGetInt4AtPtr(unsigned char *p); * unsigned int TclGetUInt1AtPtr(unsigned char *p); * unsigned int TclGetUInt4AtPtr(unsigned char *p); */ /* * The TclGetInt1AtPtr macro is tricky because we want to do sign extension on * the 1-byte value. Unfortunately the "char" type isn't signed on all * platforms so sign-extension doesn't always happen automatically. Sometimes * we can explicitly declare the pointer to be signed, but other times we have * to explicitly sign-extend the value in software. */ /* * Macros used to compute the minimum and maximum of two values. The ANSI C * "prototypes" for these macros are: * * size_t TclMin(size_t i, size_t j); * size_t TclMax(size_t i, size_t j); */ /* * Convenience macros for use when compiling bodies of commands. The ANSI C * "prototype" for these macros are: * * static void BODY(Tcl_Token *tokenPtr, int word); */ /* * Convenience macro for use when compiling tokens to be pushed. The ANSI C * "prototype" for this macro is: * * static void CompileTokens(CompileEnv *envPtr, Tcl_Token *tokenPtr, * Tcl_Interp *interp); */ /* * Convenience macros for use when pushing literals. The ANSI C "prototype" for * these macros are: * * static void PushLiteral(CompileEnv *envPtr, * const char *string, Tcl_Size length); * static void PushStringLiteral(CompileEnv *envPtr, * const char *string); */ /* * Macro to advance to the next token; it is more mnemonic than the address * arithmetic that it replaces. The ANSI C "prototype" for this macro is: * * static Tcl_Token * TokenAfter(Tcl_Token *tokenPtr); */ /* * Macro to get the offset to the next instruction to be issued. The ANSI C * "prototype" for this macro is: * * static ptrdiff_t CurrentOffset(CompileEnv *envPtr); */ /* * Note: the exceptDepth is a bit of a misnomer: TEBC only needs the * maximal depth of nested CATCH ranges in order to alloc runtime * memory. These macros should compute precisely that? OTOH, the nesting depth * of LOOP ranges is an interesting datum for debugging purposes, and that is * what we compute now. * * static int ExceptionRangeStarts(CompileEnv *envPtr, Tcl_Size index); * static void ExceptionRangeEnds(CompileEnv *envPtr, Tcl_Size index); * static void ExceptionRangeTarget(CompileEnv *envPtr, Tcl_Size index, LABEL); */ /* * Check if there is an LVT for compiled locals */ /* * Macros for making it easier to deal with tokens and DStrings. */ /* * Macro that encapsulates an efficiency trick that avoids a function call for * the simplest of compiles. The ANSI C "prototype" for this macro is: * * static void CompileWord(CompileEnv *envPtr, Tcl_Token *tokenPtr, * Tcl_Interp *interp, int word); */ /* * TIP #280: Remember the per-word line information of the current command. An * index is used instead of a pointer as recursive compilation may reallocate, * i.e. move, the array. This is also the reason to save the nuloc now, it may * change during the course of the function. * * Macro to encapsulate the variable definition and setup. */ /* * Often want to issue one of two versions of an instruction based on whether * the argument will fit in a single byte or not. This makes it much clearer. */ /* * How to get an anonymous local variable (used for holding temporary values * off the stack) or a local simple scalar. */ /* * Flags bits used by TclPushVarName. */ /* * Flags bits used by lreplace4 instruction */ /* * DTrace probe macros (NOPs if DTrace support is not enabled). */ /* * Define the following macros to enable debug logging of the DTrace proc, * cmd, and inst probes. Note that this does _not_ require a platform with * DTrace, it simply logs all probe output to /tmp/tclDTraceDebug-[pid].log. * * If the second macro is defined, logging to file starts immediately, * otherwise only after the first call to [tcl::dtrace]. Note that the debug * probe data is always computed, even when it is not logged to file. * * Defining the third macro enables debug logging of inst probes (disabled * by default due to the significant performance impact). */ /* #define TCL_DTRACE_DEBUG 1 #define TCL_DTRACE_DEBUG_LOG_ENABLED 1 #define TCL_DTRACE_DEBUG_INST_PROBES 1 */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* * Expression parsing takes place in the routine ParseExpr(). It takes a * string as input, parses that string, and generates a representation of the * expression in the form of a tree of operators, a list of literals, a list * of function names, and an array of Tcl_Token's within a Tcl_Parse struct. * The tree is composed of OpNodes. */ type TOpNode = struct { Fleft int32 Fright int32 Fp struct { Fprev [0]int32 Fparent int32 } Flexeme uint8 Fprecedence uint8 Fmark uint8 Fconstant uint8 } /* * The storage for the tree is dynamically allocated array of OpNodes. The * array is grown as parsing needs dictate according to a scheme similar to * Tcl's string growth algorithm, so that the resizing costs are O(N) and so * that we use at least half the memory allocated as expressions get large. * * Each OpNode in the tree represents an operator in the expression, either * unary or binary. When parsing is completed successfully, a binary operator * OpNode will have its left and right fields filled with "pointers" to its * left and right operands. A unary operator OpNode will have its right field * filled with a pointer to its single operand. When an operand is a * subexpression the "pointer" takes the form of the index -- a non-negative * integer -- into the OpNode storage array where the root of that * subexpression parse tree is found. * * Non-operator elements of the expression do not get stored in the OpNode * tree. They are stored in the other structures according to their type. * Literal values get appended to the literal list. Elements that denote forms * of quoting or substitution known to the Tcl parser get stored as * Tcl_Tokens. These non-operator elements of the expression are the leaves of * the completed parse tree. When an operand of an OpNode is one of these leaf * elements, the following negative integer codes are used to indicate which * kind of elements it is. */ type OperandTypes = int32 const OT_LITERAL = -3 const /* Operand is a literal in the literal list */ OT_TOKENS = -2 const /* Operand is sequence of Tcl_Tokens */ OT_EMPTY = -1 /* * Readable macros to test whether a "pointer" value points to an operator. * They operate on the "non-negative integer -> operator; negative integer -> * a non-operator OperandType" distinction. */ /* * Note that it is sufficient to store in the tree just the type of leaf * operand, without any explicit pointer to which leaf. This is true because * the traversals of the completed tree we perform are known to visit the * leaves in the same order as the original parse. * * In a completed parse tree, those OpNodes that are themselves (roots of * subexpression trees that are) operands of some operator store in their * p.parent field a "pointer" to the OpNode of that operator. The p.parent * field permits a traversal of the tree within a non-recursive routine * (ConvertTreeToTokens() and CompileExprTree()). This means that even * expression trees of great depth pose no risk of blowing the C stack. * * While the parse tree is being constructed, the same memory space is used to * hold the p.prev field which chains together a stack of incomplete trees * awaiting their right operands. * * The lexeme field is filled in with the lexeme of the operator that is * returned by the ParseLexeme() routine. Only lexemes for unary and binary * operators get stored in an OpNode. Other lexmes get different treatment. * * The precedence field provides a place to store the precedence of the * operator, so it need not be looked up again and again. * * The mark field is use to control the traversal of the tree, so that it can * be done non-recursively. The mark values are: */ type Marks = int32 const MARK_LEFT = 0 const /* Next step of traversal is to visit left subtree */ MARK_RIGHT = 1 const /* Next step of traversal is to visit right subtree */ MARK_PARENT = 2 /* * The constant field is a boolean flag marking which subexpressions are * completely known at compile time, and are eligible for computing then * rather than waiting until run time. */ /* * The four category values are LEAF, UNARY, and BINARY, explained below, and * "uncategorized", which is used either temporarily, until context determines * which of the other three categories is correct, or for lexemes like * INVALID, which aren't really lexemes at all, but indicators of a parsing * error. Note that the codes must be distinct to distinguish categories, but * need not take the form of a bit array. */ type LexemeTypes = int32 const /* * Each lexeme belongs to one of four categories, which determine its place * in the parse tree. We use the two high bits of the (unsigned char) value * to store a NODE_TYPE code. */ NODE_TYPE = 192 const BINARY = 64 const /* This lexeme is a binary operator. An OpNode * representing it should go into the parse * tree, and two operands should be parsed for * it in the expression. */ UNARY = 128 const /* This lexeme is a unary operator. An OpNode * representing it should go into the parse * tree, and one operand should be parsed for * it in the expression. */ LEAF = 192 type LexemeCodes = int32 const /* Uncategorized lexemes */ PLUS = 1 const /* Ambiguous. Resolves to UNARY_PLUS or * BINARY_PLUS according to context. */ MINUS = 2 const /* Ambiguous. Resolves to UNARY_MINUS or * BINARY_MINUS according to context. */ BAREWORD = 3 const /* Ambiguous. Resolves to BOOL_LIT or to * FUNCTION or a parse error according to * context and value. */ INCOMPLETE = 4 const /* A parse error. Used only when the single * "=" is encountered. */ INVALID = 5 const /* A parse error. Used when any punctuation * appears that's not a supported operator. */ COMMENT = 6 const /* Comment. Lasts to end of line or end of * expression, whichever comes first. */ /* Leaf lexemes */ NUMBER = 193 const /* For literal numbers */ SCRIPT = 194 const /* Script substitution; [foo] */ BOOL_LIT = 195 const /* For literal booleans */ BRACED = 196 const /* Braced string; {foo bar} */ VARIABLE = 197 const /* Variable substitution; $x */ QUOTED = 198 const /* Quoted string; "foo $bar [soom]" */ EMPTY1 = 199 const /* Used only for an empty argument list to a * function. Represents the empty string * within parens in the expression: rand() */ /* Unary operator lexemes */ UNARY_PLUS = 129 const UNARY_MINUS = 130 const FUNCTION = 131 const /* This is a bit of "creative interpretation" * on the part of the parser. A function call * is parsed into the parse tree according to * the perspective that the function name is a * unary operator and its argument list, * enclosed in parens, is its operand. The * additional requirements not implied * generally by treatment as a unary operator * -- for example, the requirement that the * operand be enclosed in parens -- are hard * coded in the relevant portions of * ParseExpr(). We trade off the need to * include such exceptional handling in the * code against the need we would otherwise * have for more lexeme categories. */ START = 132 const /* This lexeme isn't parsed from the * expression text at all. It represents the * start of the expression and sits at the * root of the parse tree where it serves as * the start/end point of traversals. */ OPEN_PAREN = 133 const /* Another bit of creative interpretation, * where we treat "(" as a unary operator with * the sub-expression between it and its * matching ")" as its operand. See * CLOSE_PAREN below. */ NOT = 134 const BIT_NOT = 135 const /* Binary operator lexemes */ BINARY_PLUS = 65 const BINARY_MINUS = 66 const COMMA = 67 const /* The "," operator is a low precedence binary * operator that separates the arguments in a * function call. The additional constraint * that this operator can only legally appear * at the right places within a function call * argument list are hard coded within * ParseExpr(). */ MULT = 68 const DIVIDE = 69 const MOD = 70 const LESS = 71 const GREATER = 72 const BIT_AND = 73 const BIT_XOR = 74 const BIT_OR = 75 const QUESTION = 76 const /* These two lexemes make up the */ COLON = 77 const /* ternary conditional operator, $x ? $y : $z. * We treat them as two binary operators to * avoid another lexeme category, and code the * additional constraints directly in * ParseExpr(). For instance, the right * operand of a "?" operator must be a ":" * operator. */ LEFT_SHIFT = 78 const RIGHT_SHIFT = 79 const LEQ = 80 const GEQ = 81 const EQUAL = 82 const NEQ = 83 const AND = 84 const OR = 85 const STREQ = 86 const STRNEQ = 87 const EXPON = 88 const /* Unlike the other binary operators, EXPON is * right associative and this distinction is * coded directly in ParseExpr(). */ IN_LIST = 89 const NOT_IN_LIST = 90 const CLOSE_PAREN = 91 const /* By categorizing the CLOSE_PAREN lexeme as a * BINARY operator, the normal parsing rules * for binary operators assure that a close * paren will not directly follow another * operator, and the machinery already in * place to connect operands to operators * according to precedence performs most of * the work of matching open and close parens * for us. In the end though, a close paren is * not really a binary operator, and some * special coding in ParseExpr() make sure we * never put an actual CLOSE_PAREN node in the * parse tree. The sub-expression between * parens becomes the single argument of the * matching OPEN_PAREN unary operator. */ STR_LT = 92 const STR_GT = 93 const STR_LEQ = 94 const STR_GEQ = 95 const END1 = 96 /* * When ParseExpr() builds the parse tree it must choose which operands to * connect to which operators. This is done according to operator precedence. * The greater an operator's precedence the greater claim it has to link to an * available operand. The Precedence enumeration lists the precedence values * used by Tcl expression operators, from lowest to highest claim. Each * precedence level is commented with the operators that hold that precedence. */ type Precedence = int32 const PREC_END = 1 const /* END */ PREC_START = 2 const /* START */ PREC_CLOSE_PAREN = 3 const /* ")" */ PREC_OPEN_PAREN = 4 const /* "(" */ PREC_COMMA = 5 const /* "," */ PREC_CONDITIONAL = 6 const /* "?", ":" */ PREC_OR = 7 const /* "||" */ PREC_AND = 8 const /* "&&" */ PREC_BIT_OR = 9 const /* "|" */ PREC_BIT_XOR = 10 const /* "^" */ PREC_BIT_AND = 11 const /* "&" */ PREC_EQUAL = 12 const /* "==", "!=", "eq", "ne", "in", "ni" */ PREC_COMPARE = 13 const /* "<", ">", "<=", ">=" */ PREC_SHIFT = 14 const /* "<<", ">>" */ PREC_ADD = 15 const /* "+", "-" */ PREC_MULT = 16 const /* "*", "/", "%" */ PREC_EXPON = 17 const /* "**" */ PREC_UNARY = 18 /* * Here the same information contained in the comments above is stored in * inverted form, so that given a lexeme, one can quickly look up its * precedence value. */ var _prec = [136]uint8{ 65: uint8(PREC_ADD), 66: uint8(PREC_ADD), 67: uint8(PREC_COMMA), 68: uint8(PREC_MULT), 69: uint8(PREC_MULT), 70: uint8(PREC_MULT), 71: uint8(PREC_COMPARE), 72: uint8(PREC_COMPARE), 73: uint8(PREC_BIT_AND), 74: uint8(PREC_BIT_XOR), 75: uint8(PREC_BIT_OR), 76: uint8(PREC_CONDITIONAL), 77: uint8(PREC_CONDITIONAL), 78: uint8(PREC_SHIFT), 79: uint8(PREC_SHIFT), 80: uint8(PREC_COMPARE), 81: uint8(PREC_COMPARE), 82: uint8(PREC_EQUAL), 83: uint8(PREC_EQUAL), 84: uint8(PREC_AND), 85: uint8(PREC_OR), 86: uint8(PREC_EQUAL), 87: uint8(PREC_EQUAL), 88: uint8(PREC_EXPON), 89: uint8(PREC_EQUAL), 90: uint8(PREC_EQUAL), 91: uint8(PREC_CLOSE_PAREN), 92: uint8(PREC_COMPARE), 93: uint8(PREC_COMPARE), 94: uint8(PREC_COMPARE), 95: uint8(PREC_COMPARE), 96: uint8(PREC_END), 129: uint8(PREC_UNARY), 130: uint8(PREC_UNARY), 131: uint8(PREC_UNARY), 132: uint8(PREC_START), 133: uint8(PREC_OPEN_PAREN), 134: uint8(PREC_UNARY), 135: uint8(PREC_UNARY), } /* * A table mapping lexemes to bytecode instructions, used by CompileExprTree(). */ var _instruction = [136]uint8{ 65: uint8(INST_ADD), 66: uint8(INST_SUB), 68: uint8(INST_MULT), 69: uint8(INST_DIV), 70: uint8(INST_MOD), 71: uint8(INST_LT), 72: uint8(INST_GT), 73: uint8(INST_BITAND), 74: uint8(INST_BITXOR), 75: uint8(INST_BITOR), 78: uint8(INST_LSHIFT), 79: uint8(INST_RSHIFT), 80: uint8(INST_LE), 81: uint8(INST_GE), 82: uint8(INST_EQ), 83: uint8(INST_NEQ), 86: uint8(INST_STR_EQ), 87: uint8(INST_STR_NEQ), 88: uint8(INST_EXPON), 89: uint8(INST_LIST_IN), 90: uint8(INST_LIST_NOT_IN), 92: uint8(INST_STR_LT), 93: uint8(INST_STR_GT), 94: uint8(INST_STR_LE), 95: uint8(INST_STR_GE), 129: uint8(INST_UPLUS), 130: uint8(INST_UMINUS), 134: uint8(INST_LNOT), 135: uint8(INST_BITNOT), } /* * A table mapping a byte value to the corresponding lexeme for use by * ParseLexeme(). */ var _Lexeme = [128]uint8{ 0: uint8(INVALID), 1: uint8(INVALID), 2: uint8(INVALID), 3: uint8(INVALID), 4: uint8(INVALID), 5: uint8(INVALID), 6: uint8(INVALID), 7: uint8(INVALID), 8: uint8(INVALID), 9: uint8(INVALID), 10: uint8(INVALID), 11: uint8(INVALID), 12: uint8(INVALID), 13: uint8(INVALID), 14: uint8(INVALID), 15: uint8(INVALID), 16: uint8(INVALID), 17: uint8(INVALID), 18: uint8(INVALID), 19: uint8(INVALID), 20: uint8(INVALID), 21: uint8(INVALID), 22: uint8(INVALID), 23: uint8(INVALID), 24: uint8(INVALID), 25: uint8(INVALID), 26: uint8(INVALID), 27: uint8(INVALID), 28: uint8(INVALID), 29: uint8(INVALID), 30: uint8(INVALID), 31: uint8(INVALID), 32: uint8(INVALID), 34: uint8(QUOTED), 36: uint8(VARIABLE), 37: uint8(MOD), 39: uint8(INVALID), 40: uint8(OPEN_PAREN), 41: uint8(CLOSE_PAREN), 43: uint8(PLUS), 44: uint8(COMMA), 45: uint8(MINUS), 47: uint8(DIVIDE), 58: uint8(COLON), 59: uint8(INVALID), 63: uint8(QUESTION), 64: uint8(INVALID), 91: uint8(SCRIPT), 92: uint8(INVALID), 93: uint8(INVALID), 94: uint8(BIT_XOR), 95: uint8(INVALID), 96: uint8(INVALID), 123: uint8(BRACED), 125: uint8(INVALID), 126: uint8(BIT_NOT), 127: uint8(INVALID), } /* * The JumpList struct is used to create a stack of data needed for the * TclEmitForwardJump() and TclFixupForwardJump() calls that are performed * when compiling the short-circuiting operators QUESTION/COLON, AND, and OR. * Keeping a stack permits the CompileExprTree() routine to be non-recursive. */ type TJumpList = struct { Fjump TJumpFixup Fnext uintptr } /* *---------------------------------------------------------------------- * * ParseExpr -- * * Given a string, the numBytes bytes starting at start, this function * parses it as a Tcl expression and constructs a tree representing the * structure of the expression. The caller must pass in empty lists as * the funcList and litList arguments. The elements of the parsed * expression are returned to the caller as that tree, a list of literal * values, a list of function names, and in Tcl_Tokens added to a * Tcl_Parse struct passed in by the caller. * * Results: * If the string is successfully parsed as a valid Tcl expression, TCL_OK * is returned, and data about the expression structure is written to the * last four arguments. If the string cannot be parsed as a valid Tcl * expression, TCL_ERROR is returned, and if interp is non-NULL, an error * message is written to interp. * * Side effects: * Memory will be allocated. If TCL_OK is returned, the caller must clean * up the returned data structures. The (OpNode *) value written to * opTreePtr should be passed to Tcl_Free() and the parsePtr argument * should be passed to Tcl_FreeParse(). The elements appended to the * litList and funcList will automatically be freed whenever the refcount * on those lists indicates they can be freed. * *---------------------------------------------------------------------- */ func _ParseExpr(tls *libc.TLS, interp uintptr, start uintptr, numBytes TTcl_Size, opTreePtr uintptr, litList uintptr, funcList uintptr, parsePtr uintptr, parseOnly int32) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) /* A boolean indicating whether the caller's * aim is just a parse, or whether it will go * on to compile the expression. Different * optimizations are appropriate for the two * scenarios. */ var _needed, allocated, scanned, v16, v23, v37, v47, v6 TTcl_Size var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, errCode, incompletePtr, mark, msg, nestedPtr, newPtr, newPtr1, nodePtr, nodes, oldPtr, post, subErrCode, tokenPtr, v11, v13, v15, v17, v24, v38, v39, v41, v43, v44, v46, v48, v50, v7, v9 uintptr var code, complete, incomplete, insertMark, lastParsed, limit, scanned2, wordIndex, v18, v2, v22, v25, v26, v27, v36, v40, v42, v45, v49 int32 var nodesAvailable, nodesUsed, size uint32 var precedence uint8 var v1, v19, v20, v21, v28, v29, v3, v30, v31, v32, v33, v34, v35, v5 bool var v10, v12, v14, v8 int64 var _ /* b at bp+16 */ int32 var _ /* end at bp+32 */ uintptr var _ /* lexeme at bp+0 */ uint8 var _ /* literal at bp+8 */ uintptr var _ /* stop at bp+24 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _needed, _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, allocated, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, code, complete, errCode, incomplete, incompletePtr, insertMark, lastParsed, limit, mark, msg, nestedPtr, newPtr, newPtr1, nodePtr, nodes, nodesAvailable, nodesUsed, oldPtr, post, precedence, scanned, scanned2, size, subErrCode, tokenPtr, wordIndex, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v6, v7, v8, v9 nodes = libc.UintptrFromInt32(0) /* Pointer to the OpNode storage array where * we build the parse tree. */ nodesAvailable = uint32(64) /* Initial size of the storage array. This * value establishes a minimum tree memory * cost of only about 1 kilobyte, and is large * enough for most expressions to parse with * no need for array growth and * reallocation. */ nodesUsed = uint32(0) /* Number of OpNodes filled. */ scanned = 0 /* Index of the most recent incomplete tree in * the OpNode array. Heads a stack of * incomplete trees linked by p.prev. */ complete = int32(OT_EMPTY) /* "Index" of the complete tree (that is, a * complete subexpression) determined at the * moment. OT_EMPTY is a nonsense value used * only to silence compiler warnings. During a * parse, complete will always hold an index * or an OperandTypes value pointing to an * actual leaf at the time the complete tree * is needed. */ /* * These variables control generation of the error message. */ msg = libc.UintptrFromInt32(0) /* The error message. */ post = libc.UintptrFromInt32(0) /* In a few cases, an additional postscript * for the error message, supplying more * information after the error msg and * location have been reported. */ errCode = libc.UintptrFromInt32(0) /* The detail word of the errorCode list, or * NULL to indicate that no changes to the * errorCode are to be done. */ subErrCode = libc.UintptrFromInt32(0) /* Extra information for use in generating the * errorCode. */ mark = __ccgo_ts + 22390 /* In the portion of the complete error * message where the error location is * reported, this "mark" substring is inserted * into the string being parsed to aid in * pinpointing the location of the syntax * error in the expression. */ insertMark = 0 /* A boolean controlling whether the "mark" * should be inserted. */ limit = int32(25) /* Portions of the error message are * constructed out of substrings of the * original expression. In order to keep the * error message readable, we impose this * limit on the substring size we extract. */ XTclParseInit(tls, interp, start, numBytes, parsePtr) nodes = XTclpAlloc(tls, uint64(nodesAvailable)*uint64(16)) if nodes == libc.UintptrFromInt32(0) { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(38)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(38)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22394, libc.Uint64FromInt64(38)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(38)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(38) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) errCode = __ccgo_ts + 22432 goto error } /* * Initialize the parse tree with the special "START" node. */ (*TOpNode)(unsafe.Pointer(nodes)).Flexeme = uint8(START) (*TOpNode)(unsafe.Pointer(nodes)).Fprecedence = _prec[int32(START)] (*TOpNode)(unsafe.Pointer(nodes)).Fmark = uint8(MARK_RIGHT) (*TOpNode)(unsafe.Pointer(nodes)).Fconstant = uint8(1) v2 = libc.Int32FromUint32(nodesUsed) lastParsed = v2 incomplete = v2 nodesUsed++ /* * Main parsing loop parses one lexeme per iteration. We exit the loop * only when there's a syntax error with a "goto error" which takes us to * the error handling code following the loop, or when we've successfully * completed the parse and we return to the caller. */ for int32(1) != 0 { /* Filled by the ParseLexeme() call when a * literal is parsed that has a Tcl_Obj rep * worth preserving. */ /* * Each pass through this loop adds up to one more OpNode. Allocate * space for one if required. */ if nodesUsed >= nodesAvailable { size = nodesUsed * uint32(2) newPtr = libc.UintptrFromInt32(0) for { if uint64(size) <= libc.Uint64FromUint32(0xffffffff)/libc.Uint64FromInt64(16) { newPtr = XTclpRealloc(tls, nodes, uint64(size)*uint64(16)) } goto _4 _4: ; if v3 = newPtr == libc.UintptrFromInt32(0); v3 { size -= (size - nodesUsed) / uint32(2) } if !(v3 && size > nodesUsed) { break } } if newPtr == libc.UintptrFromInt32(0) { if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(38)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(38)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22394, libc.Uint64FromInt64(38)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(38)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(38) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) errCode = __ccgo_ts + 22432 goto error } nodesAvailable = size nodes = newPtr } nodePtr = nodes + uintptr(nodesUsed)*16 /* * Skip white space between lexemes. */ scanned = XTclParseAllWhiteSpace(tls, start, numBytes) start += uintptr(scanned) numBytes -= scanned scanned = _ParseLexeme(tls, start, numBytes, bp, bp+8) /* * Use context to categorize the lexemes that are ambiguous. */ if int32(NODE_TYPE)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == 0 { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) { case int32(COMMENT): start += uintptr(scanned) numBytes -= scanned continue case int32(INVALID): msg = XTcl_ObjPrintf(tls, __ccgo_ts+22438, libc.VaList(bp+48, int32(scanned), start)) errCode = __ccgo_ts + 22463 goto error case int32(INCOMPLETE): msg = XTcl_ObjPrintf(tls, __ccgo_ts+22471, libc.VaList(bp+48, int32(scanned), start)) errCode = __ccgo_ts + 22498 goto error case int32(BAREWORD): /* * Most barewords in an expression are a syntax error. The * exceptions are that when a bareword is followed by an open * paren, it might be a function call, and when the bareword * is a legal literal boolean value, we accept that as well. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + uintptr(scanned+XTclParseAllWhiteSpace(tls, start+uintptr(scanned), numBytes-scanned))))) == int32('(') { *(*uint8)(unsafe.Pointer(bp)) = uint8(FUNCTION) /* * When we compile the expression we'll need the function * name, and there's no place in the parse tree to store * it, so we keep a separate list of all the function * names we've parsed in the order we found them. */ XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), funcList, *(*uintptr)(unsafe.Pointer(bp + 8))) } else { if XTcl_GetBoolFromObj(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp+16) == TCL_OK { *(*uint8)(unsafe.Pointer(bp)) = uint8(BOOL_LIT) } else { /* * Tricky case: see test expr-62.10 */ scanned2 = int32(scanned) for cond := true; cond; cond = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(COMMENT) { scanned2 = int32(int64(scanned2) + XTclParseAllWhiteSpace(tls, start+uintptr(scanned2), numBytes-int64(scanned2))) scanned2 = int32(int64(scanned2) + _ParseLexeme(tls, start+uintptr(scanned2), numBytes-int64(scanned2), bp, libc.UintptrFromInt32(0))) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(OPEN_PAREN) { /* * Actually a function call, but with obscuring * comments. Skip to the start of the parentheses. * Note that we assume that open parentheses are one * byte long. */ *(*uint8)(unsafe.Pointer(bp)) = uint8(FUNCTION) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), funcList, *(*uintptr)(unsafe.Pointer(bp + 8))) scanned = int64(scanned2 - int32(1)) break } _objPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) v7 = _objPtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr) } if scanned < int64(limit) { v8 = scanned } else { v8 = int64(limit - int32(3)) } if scanned < int64(limit) { v9 = __ccgo_ts + 1945 } else { v9 = __ccgo_ts + 8560 } msg = XTcl_ObjPrintf(tls, __ccgo_ts+22505, libc.VaList(bp+48, int32(v8), start, v9)) if scanned < int64(limit) { v10 = scanned } else { v10 = int64(limit - int32(3)) } if scanned < int64(limit) { v11 = __ccgo_ts + 1945 } else { v11 = __ccgo_ts + 8560 } if scanned < int64(limit) { v12 = scanned } else { v12 = int64(limit - int32(3)) } if scanned < int64(limit) { v13 = __ccgo_ts + 1945 } else { v13 = __ccgo_ts + 8560 } post = XTcl_ObjPrintf(tls, __ccgo_ts+22531, libc.VaList(bp+48, int32(v10), start, v11, int32(v12), start, v13)) if scanned < int64(limit) { v14 = scanned } else { v14 = int64(limit - int32(3)) } if scanned < int64(limit) { v15 = __ccgo_ts + 1945 } else { v15 = __ccgo_ts + 8560 } XTcl_AppendPrintfToObj(tls, post, __ccgo_ts+22565, libc.VaList(bp+48, int32(v14), start, v15)) errCode = __ccgo_ts + 22590 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start))) == int32('0') { XTclParseNumber(tls, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), start, scanned, bp+24, int32(TCL_PARSE_NO_WHITESPACE)) if libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))))-uint32('0') < uint32(10)) != 0 || *(*uintptr)(unsafe.Pointer(bp + 24)) == start+uintptr(1) { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) { case int32('b'): XTcl_AppendToObj(tls, post, __ccgo_ts+22599, int64(-int32(1))) (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = int32(TCL_PARSE_BAD_NUMBER) errCode = __ccgo_ts + 22625 subErrCode = __ccgo_ts + 11120 case int32('o'): XTcl_AppendToObj(tls, post, __ccgo_ts+22635, int64(-int32(1))) (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = int32(TCL_PARSE_BAD_NUMBER) errCode = __ccgo_ts + 22625 subErrCode = __ccgo_ts + 22660 default: if libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(start + 1)))-uint32('0') < uint32(10)) != 0 { XTcl_AppendToObj(tls, post, __ccgo_ts+22635, int64(-int32(1))) (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = int32(TCL_PARSE_BAD_NUMBER) errCode = __ccgo_ts + 22625 subErrCode = __ccgo_ts + 22660 } break } } } goto error } } case int32(PLUS): fallthrough case int32(MINUS): if lastParsed >= 0 { /* * A "+" or "-" coming just after another operator must be * interpreted as a unary operator. */ *(*uint8)(unsafe.Pointer(bp)) = uint8(int32(*(*uint8)(unsafe.Pointer(bp))) | int32(UNARY)) } else { *(*uint8)(unsafe.Pointer(bp)) = uint8(int32(*(*uint8)(unsafe.Pointer(bp))) | int32(BINARY)) } } } /* Uncategorized lexemes */ /* * Handle lexeme based on its category. */ switch int32(NODE_TYPE) & libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) { case int32(LEAF): *(*uintptr)(unsafe.Pointer(bp + 32)) = start code = TCL_OK /* * A leaf operand appearing just after something that's not an * operator is a syntax error. */ if lastParsed < 0 { msg = XTcl_ObjPrintf(tls, __ccgo_ts+22666, libc.VaList(bp+48, mark)) errCode = __ccgo_ts + 17673 scanned = 0 insertMark = int32(1) /* * Free any literal to avoid a memleak. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(NUMBER) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(BOOL_LIT) { _objPtr1 = *(*uintptr)(unsafe.Pointer(bp + 8)) v17 = _objPtr1 v16 = *(*TTcl_Size)(unsafe.Pointer(v17)) *(*TTcl_Size)(unsafe.Pointer(v17))-- if v16 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } goto error } switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) { case int32(NUMBER): fallthrough case int32(BOOL_LIT): /* * TODO: Consider using a dict or hash to collapse all * duplicate literals into a single representative value. * (Like what is done with [split $s {}]). * Pro: ~75% memory saving on expressions like * {1+1+1+1+1+.....+1} (Convert "pointer + Tcl_Obj" cost * to "pointer" cost only) * Con: Cost of the dict store/retrieve on every literal in * every expression when expressions like the above tend * to be uncommon. * The memory savings is temporary; Compiling to bytecode * will collapse things as literals are registered * anyway, so the savings applies only to the time * between parsing and compiling. Possibly important due * to high-water mark nature of memory allocation. */ XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), litList, *(*uintptr)(unsafe.Pointer(bp + 8))) v18 = int32(OT_LITERAL) lastParsed = v18 complete = v18 start += uintptr(scanned) numBytes -= scanned continue default: break } /* * Remaining LEAF cases may involve filling Tcl_Tokens, so make * room for at least 2 more tokens. */ _needed = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + int64(libc.Int32FromInt32(2)) if _needed > (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable { allocated = int64(2) * _needed oldPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr if oldPtr == parsePtr+104 { oldPtr = libc.UintptrFromInt32(0) } newPtr1 = XTclpRealloc(tls, oldPtr, libc.Uint64FromInt64(allocated)*uint64(32)) if newPtr1 == libc.UintptrFromInt32(0) { allocated = libc.Int64FromUint64(libc.Uint64FromInt64(_needed+int64(libc.Int32FromInt32(2))) + libc.Uint64FromInt32(TCL_MIN_GROWTH)/libc.Uint64FromInt64(32)) newPtr1 = XTcl_Realloc(tls, oldPtr, libc.Uint64FromInt64(allocated)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated if oldPtr == libc.UintptrFromInt32(0) { libc.Xmemcpy(tls, newPtr1, parsePtr+104, libc.Uint64FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr1 } wordIndex = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens) tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(wordIndex)*32 (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 = int32(TCL_TOKEN_WORD) (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = start (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++ switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) { case int32(QUOTED): code = XTcl_ParseQuotedString(tls, libc.UintptrFromInt32(0), start, numBytes, parsePtr, int32(1), bp+32) scanned = int64(*(*uintptr)(unsafe.Pointer(bp + 32))) - int64(start) case int32(BRACED): code = XTcl_ParseBraces(tls, libc.UintptrFromInt32(0), start, numBytes, parsePtr, int32(1), bp+32) scanned = int64(*(*uintptr)(unsafe.Pointer(bp + 32))) - int64(start) case int32(VARIABLE): code = XTcl_ParseVarName(tls, libc.UintptrFromInt32(0), start, numBytes, parsePtr, int32(1)) /* * Handle the quirk that Tcl_ParseVarName reports a successful * parse even when it gets only a "$" with no variable name. */ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(wordIndex)*32 + uintptr(1)*32 if code == TCL_OK && (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_VARIABLE) { if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22689, libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(22) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) errCode = __ccgo_ts + 22463 goto error } scanned = (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize case int32(SCRIPT): nestedPtr = XTclStackAlloc(tls, interp, uint64(744)) tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*32 (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 = int32(TCL_TOKEN_COMMAND) (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart = start (*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = 0 *(*uintptr)(unsafe.Pointer(bp + 32)) = start + uintptr(numBytes) start++ for int32(1) != 0 { code = XTcl_ParseCommand(tls, interp, start, int64(*(*uintptr)(unsafe.Pointer(bp + 32)))-int64(start), int32(1), nestedPtr) if code != TCL_OK { (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*TTcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = (*TTcl_Parse)(unsafe.Pointer(nestedPtr)).FerrorType (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = (*TTcl_Parse)(unsafe.Pointer(nestedPtr)).Fincomplete break } start = (*TTcl_Parse)(unsafe.Pointer(nestedPtr)).FcommandStart + uintptr((*TTcl_Parse)(unsafe.Pointer(nestedPtr)).FcommandSize) XTcl_FreeParse(tls, nestedPtr) if (*TTcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm < *(*uintptr)(unsafe.Pointer(bp + 32)) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(nestedPtr)).Fterm))) == int32(']') && !((*TTcl_Parse)(unsafe.Pointer(nestedPtr)).Fincomplete != 0) { break } if start == *(*uintptr)(unsafe.Pointer(bp + 32)) { if v20 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v20 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v20 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22711, libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(22) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = int32(TCL_PARSE_MISSING_BRACKET) (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete = int32(1) code = int32(TCL_ERROR) errCode = __ccgo_ts + 19420 break } } XTclStackFree(tls, interp, nestedPtr) *(*uintptr)(unsafe.Pointer(bp + 32)) = start start = (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart scanned = int64(*(*uintptr)(unsafe.Pointer(bp + 32))) - int64(start) (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = scanned (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens++ break /* SCRIPT case */ } if code != TCL_OK { /* * Here we handle all the syntax errors generated by the * Tcl_Token generating parsing routines called in the switch * just above. If the value of parsePtr->incomplete is 1, then * the error was an unbalanced '[', '(', '{', or '"' and * parsePtr->term is pointing to that unbalanced character. If * the value of parsePtr->incomplete is 0, then the error is * one of lacking whitespace following a quoted word, for * example: expr {[an error {foo}bar]}, and parsePtr->term * points to where the whitespace is missing. We reset our * values of start and scanned so that when our error message * is constructed, the location of the syntax error is sure to * appear in it, even if the quoted expression is truncated. */ start = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm scanned = int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete) if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fincomplete != 0 { errCode = __ccgo_ts + 19420 } goto error } tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(wordIndex)*32 (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize = scanned (*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens - int64(wordIndex) - int64(1) if !(parseOnly != 0) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(QUOTED) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(BRACED)) { /* * When this expression is destined to be compiled, and a * braced or quoted word within an expression is known at * compile time (no runtime substitutions in it), we can store * it as a literal rather than in its tokenized form. This is * an advantage since the compiled bytecode is going to need * the argument in Tcl_Obj form eventually, so it's just as * well to get there now. Another advantage is that with this * conversion, larger constant expressions might be grown and * optimized. * * On the contrary, if the end goal of this parse is to fill a * Tcl_Parse for a caller of Tcl_ParseExpr(), then it's * wasteful to convert to a literal only to convert back again * later. */ if v21 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v21 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v21 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(bp + 8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(bp + 8)) = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr = libc.UintptrFromInt32(0) if XTclWordKnownAtCompileTime(tls, tokenPtr, *(*uintptr)(unsafe.Pointer(bp + 8))) != 0 { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), litList, *(*uintptr)(unsafe.Pointer(bp + 8))) v22 = int32(OT_LITERAL) lastParsed = v22 complete = v22 (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens = int64(wordIndex) break } _objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 8)) v24 = _objPtr2 v23 = *(*TTcl_Size)(unsafe.Pointer(v24)) *(*TTcl_Size)(unsafe.Pointer(v24))-- if v23 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } v25 = int32(OT_TOKENS) lastParsed = v25 complete = v25 break /* case LEAF */ fallthrough case int32(UNARY): /* * A unary operator appearing just after something that's not an * operator is a syntax error -- something trying to be the left * operand of an operator that doesn't take one. */ if lastParsed < 0 { msg = XTcl_ObjPrintf(tls, __ccgo_ts+22666, libc.VaList(bp+48, mark)) scanned = 0 insertMark = int32(1) errCode = __ccgo_ts + 17673 goto error } /* * Create an OpNode for the unary operator. */ (*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme = *(*uint8)(unsafe.Pointer(bp)) (*TOpNode)(unsafe.Pointer(nodePtr)).Fprecedence = _prec[*(*uint8)(unsafe.Pointer(bp))] (*TOpNode)(unsafe.Pointer(nodePtr)).Fmark = uint8(MARK_RIGHT) /* * A FUNCTION cannot be a constant expression, because Tcl allows * functions to return variable results with the same arguments; * for example, rand(). Other unary operators can root a constant * expression, so long as the argument is a constant expression. */ (*TOpNode)(unsafe.Pointer(nodePtr)).Fconstant = libc.BoolUint8(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) != int32(FUNCTION)) /* * This unary operator is a new incomplete tree, so push it onto * our stack of incomplete trees. Also remember it as the last * lexeme we parsed. */ *(*int32)(unsafe.Pointer(nodePtr + 8)) = incomplete v26 = libc.Int32FromUint32(nodesUsed) lastParsed = v26 incomplete = v26 nodesUsed++ case int32(BINARY): precedence = _prec[*(*uint8)(unsafe.Pointer(bp))] /* * A binary operator appearing just after another operator is a * syntax error -- one of the two operators is missing an operand. */ if lastParsed >= 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(CLOSE_PAREN) && libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodePtr + uintptr(-libc.Int32FromInt32(1))*16))).Flexeme) == int32(OPEN_PAREN) { if libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodePtr + uintptr(-libc.Int32FromInt32(2))*16))).Flexeme) == int32(FUNCTION) { /* * Normally, "()" is a syntax error, but as a special * case accept it as an argument list for a function. * Treat this as a special LEAF lexeme, and restart * the parsing loop with zero characters scanned. We * will parse the ")" again the next time through, but * with the OT_EMPTY leaf as the subexpression between * the parens. */ scanned = 0 v27 = int32(OT_EMPTY) lastParsed = v27 complete = v27 break } msg = XTcl_ObjPrintf(tls, __ccgo_ts+22733, libc.VaList(bp+48, mark)) scanned = 0 insertMark = int32(1) errCode = __ccgo_ts + 22759 goto error } if libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodePtr + uintptr(-libc.Int32FromInt32(1))*16))).Fprecedence) > libc.Int32FromUint8(precedence) { if libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodePtr + uintptr(-libc.Int32FromInt32(1))*16))).Flexeme) == int32(OPEN_PAREN) { if v28 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v28 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v28 || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22765, libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(22) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = int32(TCL_PARSE_MISSING_PAREN) errCode = __ccgo_ts + 19420 } else { if libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodePtr + uintptr(-libc.Int32FromInt32(1))*16))).Flexeme) == int32(COMMA) { msg = XTcl_ObjPrintf(tls, __ccgo_ts+22787, libc.VaList(bp+48, mark)) scanned = 0 insertMark = int32(1) errCode = __ccgo_ts + 17673 } else { if libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodePtr + uintptr(-libc.Int32FromInt32(1))*16))).Flexeme) == int32(START) { if v29 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v29 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v29 || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(17)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(17)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22819, libc.Uint64FromInt64(17)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(17)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(17) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) errCode = __ccgo_ts + 22759 } } } } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(CLOSE_PAREN) { if v30 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v30 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v30 || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22836, libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(23) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) errCode = __ccgo_ts + 19420 } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(COMMA) && libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodePtr + uintptr(-libc.Int32FromInt32(1))*16))).Flexeme) == int32(OPEN_PAREN) && libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodePtr + uintptr(-libc.Int32FromInt32(2))*16))).Flexeme) == int32(FUNCTION) { msg = XTcl_ObjPrintf(tls, __ccgo_ts+22787, libc.VaList(bp+48, mark)) scanned = 0 insertMark = int32(1) errCode = __ccgo_ts + 19420 } } } if msg == libc.UintptrFromInt32(0) { msg = XTcl_ObjPrintf(tls, __ccgo_ts+22859, libc.VaList(bp+48, mark)) scanned = 0 insertMark = int32(1) errCode = __ccgo_ts + 17673 } goto error } /* * Here is where the tree comes together. At this point, we have a * stack of incomplete trees corresponding to substrings that are * incomplete expressions, followed by a complete tree * corresponding to a substring that is itself a complete * expression, followed by the binary operator we have just * parsed. The incomplete trees can each be completed by adding a * right operand. * * To illustrate with an example, when we parse the expression * "1+2*3-4" and we reach this point having just parsed the "-" * operator, we have these incomplete trees: START, "1+", and * "2*". Next we have the complete subexpression "3". Last is the * "-" we've just parsed. * * The next step is to join our complete tree to an operator. The * choice is governed by the precedence and associativity of the * competing operators. If we connect it as the right operand of * our most recent incomplete tree, we get a new complete tree, * and we can repeat the process. The while loop following repeats * this until precedence indicates it is time to join the complete * tree as the left operand of the just parsed binary operator. * * Continuing the example, the first pass through the loop will * join "3" to "2*"; the next pass will join "2*3" to "1+". Then * we'll exit the loop and join "1+2*3" to "-". When we return to * parse another lexeme, our stack of incomplete trees is START * and "1+2*3-". */ for int32(1) != 0 { incompletePtr = nodes + uintptr(incomplete)*16 if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Fprecedence) < libc.Int32FromUint8(precedence) { break } if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Fprecedence) == libc.Int32FromUint8(precedence) { /* * Right association rules for exponentiation. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(EXPON) { break } /* * Special association rules for the conditional * operators. The "?" and ":" operators have equal * precedence, but must be linked up in sensible pairs. */ if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == int32(QUESTION) && (complete < 0 || libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodes + uintptr(complete)*16))).Flexeme) != int32(COLON)) { break } if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == int32(COLON) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(QUESTION) { break } } /* * Some special syntax checks... */ /* Parens must balance */ if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == int32(OPEN_PAREN) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) != int32(CLOSE_PAREN) { if v31 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v31 { cachePtr8 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v31 || (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22765, libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(22)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(22) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = int32(TCL_PARSE_MISSING_PAREN) errCode = __ccgo_ts + 19420 goto error } /* Right operand of "?" must be ":" */ if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == int32(QUESTION) && (complete < 0 || libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodes + uintptr(complete)*16))).Flexeme) != int32(COLON)) { msg = XTcl_ObjPrintf(tls, __ccgo_ts+22881, libc.VaList(bp+48, mark)) scanned = 0 insertMark = int32(1) errCode = __ccgo_ts + 17673 goto error } /* Operator ":" may only be right operand of "?" */ if complete >= 0 && libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodes + uintptr(complete)*16))).Flexeme) == int32(COLON) && libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) != int32(QUESTION) { if v32 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v32 { cachePtr9 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v32 || (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22908, libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(46) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) errCode = __ccgo_ts + 22954 goto error } /* * Attach complete tree as right operand of most recent * incomplete tree. */ (*TOpNode)(unsafe.Pointer(incompletePtr)).Fright = complete if complete >= 0 { *(*int32)(unsafe.Pointer(nodes + uintptr(complete)*16 + 8)) = incomplete (*TOpNode)(unsafe.Pointer(incompletePtr)).Fconstant = libc.BoolUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Fconstant != 0 && (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(complete)*16))).Fconstant != 0) } else { (*TOpNode)(unsafe.Pointer(incompletePtr)).Fconstant = libc.BoolUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Fconstant != 0 && complete == int32(OT_LITERAL)) } /* * The QUESTION/COLON and FUNCTION/OPEN_PAREN combinations * each make up a single operator. Force them to agree whether * they have a constant expression. */ if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == int32(QUESTION) || libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == int32(FUNCTION) { (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(complete)*16))).Fconstant = (*TOpNode)(unsafe.Pointer(incompletePtr)).Fconstant } if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == int32(START) { /* * Completing the START tree indicates we're done. * Transfer the parse tree to the caller and return. */ *(*uintptr)(unsafe.Pointer(opTreePtr)) = nodes return TCL_OK } /* * With a right operand attached, last incomplete tree has * become the complete tree. Pop it from the incomplete tree * stack. */ complete = incomplete incomplete = *(*int32)(unsafe.Pointer(incompletePtr + 8)) /* CLOSE_PAREN can only close one OPEN_PAREN. */ if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) == int32(OPEN_PAREN) { break } } /* * More syntax checks... */ /* Parens must balance. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(CLOSE_PAREN) { if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) != int32(OPEN_PAREN) { if v33 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v33 { cachePtr10 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v33 || (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22836, libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(23)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(23) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) errCode = __ccgo_ts + 19420 goto error } } /* Commas must appear only in function argument lists. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(COMMA) { if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(incompletePtr)).Flexeme) != int32(OPEN_PAREN) || libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(incompletePtr + uintptr(-libc.Int32FromInt32(1))*16))).Flexeme) != int32(FUNCTION) { if v34 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v34 { cachePtr11 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v34 || (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22963, libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(46) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) errCode = __ccgo_ts + 22954 goto error } } /* Operator ":" may only be right operand of "?" */ if complete >= 0 && libc.Int32FromUint8((*(*TOpNode)(unsafe.Pointer(nodes + uintptr(complete)*16))).Flexeme) == int32(COLON) { if v35 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v35 { cachePtr12 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v35 || (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects == libc.Uint64FromInt32(0) { msg = XTclThreadAllocObj(tls) } else { msg = (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(msg + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(msg)).FrefCount = 0 if libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes, __ccgo_ts+22908, libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(msg)).Fbytes + uintptr(libc.Uint64FromInt64(46)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(msg)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(46) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(msg)).FtypePtr = libc.UintptrFromInt32(0) errCode = __ccgo_ts + 22954 goto error } /* * Create no node for a CLOSE_PAREN lexeme. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(CLOSE_PAREN) { break } /* * Link complete tree as left operand of new node. */ (*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme = *(*uint8)(unsafe.Pointer(bp)) (*TOpNode)(unsafe.Pointer(nodePtr)).Fprecedence = precedence (*TOpNode)(unsafe.Pointer(nodePtr)).Fmark = uint8(MARK_LEFT) (*TOpNode)(unsafe.Pointer(nodePtr)).Fleft = complete /* * The COMMA operator cannot be optimized, since the function * needs all of its arguments, and optimization would reduce the * number. Other binary operators root constant expressions when * both arguments are constant expressions. */ (*TOpNode)(unsafe.Pointer(nodePtr)).Fconstant = libc.BoolUint8(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) != int32(COMMA)) if complete >= 0 { *(*int32)(unsafe.Pointer(nodes + uintptr(complete)*16 + 8)) = libc.Int32FromUint32(nodesUsed) (*TOpNode)(unsafe.Pointer(nodePtr)).Fconstant = libc.BoolUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Fconstant != 0 && (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(complete)*16))).Fconstant != 0) } else { (*TOpNode)(unsafe.Pointer(nodePtr)).Fconstant = libc.BoolUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Fconstant != 0 && complete == int32(OT_LITERAL)) } /* * With a left operand attached and a right operand missing, the * just-parsed binary operator is root of a new incomplete tree. * Push it onto the stack of incomplete trees. */ *(*int32)(unsafe.Pointer(nodePtr + 8)) = incomplete v36 = libc.Int32FromUint32(nodesUsed) lastParsed = v36 incomplete = v36 nodesUsed++ break /* case BINARY */ } /* lexeme handler */ /* Advance past the just-parsed lexeme */ start += uintptr(scanned) numBytes -= scanned } /* main parsing loop */ /* * We only get here if there's been an error. Any errors that didn't get a * suitable parsePtr->errorType, get recorded as syntax errors. */ goto error error: ; if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType == TCL_PARSE_SUCCESS { (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = int32(TCL_PARSE_SYNTAX) } /* * Free any partial parse tree we've built. */ if nodes != libc.UintptrFromInt32(0) { XTclpFree(tls, nodes) } if interp == libc.UintptrFromInt32(0) { /* * Nowhere to report an error message, so just free it. */ if msg != 0 { _objPtr3 = msg v38 = _objPtr3 v37 = *(*TTcl_Size)(unsafe.Pointer(v38)) *(*TTcl_Size)(unsafe.Pointer(v38))-- if v37 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } } else { /* * Construct the complete error message. Start with the simple error * message, pulled from the interp result if necessary... */ if msg == libc.UintptrFromInt32(0) { msg = XTcl_GetObjResult(tls, interp) } /* * Add a detailed quote from the bad expression, displaying and * sometimes marking the precise location of the syntax error. */ if start-uintptr(limit) < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fstring1 { v39 = __ccgo_ts + 1945 } else { v39 = __ccgo_ts + 8560 } if start-uintptr(limit) < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fstring1 { v40 = int32(int64(start) - int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fstring1)) } else { v40 = limit - int32(3) } if start-uintptr(limit) < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fstring1 { v41 = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fstring1 } else { v41 = start - uintptr(limit) + uintptr(3) } if scanned < int64(limit) { v42 = int32(scanned) } else { v42 = limit - int32(3) } if scanned < int64(limit) { v43 = __ccgo_ts + 1945 } else { v43 = __ccgo_ts + 8560 } if insertMark != 0 { v44 = mark } else { v44 = __ccgo_ts + 1945 } if start+uintptr(scanned)+uintptr(limit) > (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fend { v45 = int32(int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fend)-int64(start)) - int32(scanned) } else { v45 = limit - int32(3) } if start+uintptr(scanned)+uintptr(limit) > (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fend { v46 = __ccgo_ts + 1945 } else { v46 = __ccgo_ts + 8560 } XTcl_AppendPrintfToObj(tls, msg, __ccgo_ts+23009, libc.VaList(bp+48, v39, v40, v41, v42, start, v43, v44, v45, start+uintptr(scanned), v46)) /* * Next, append any postscript message. */ if post != libc.UintptrFromInt32(0) { XTcl_AppendToObj(tls, msg, __ccgo_ts+23047, int64(-int32(1))) XTcl_AppendObjToObj(tls, msg, post) _objPtr4 = post v48 = _objPtr4 v47 = *(*TTcl_Size)(unsafe.Pointer(v48)) *(*TTcl_Size)(unsafe.Pointer(v48))-- if v47 <= int64(1) { XTclFreeObj(tls, _objPtr4) } } XTcl_SetObjResult(tls, interp, msg) /* * Finally, place context information in the errorInfo. */ numBytes = int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fend) - int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fstring1) if numBytes < int64(limit) { v49 = int32(numBytes) } else { v49 = limit - int32(3) } if numBytes < int64(limit) { v50 = __ccgo_ts + 1945 } else { v50 = __ccgo_ts + 8560 } XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+23050, libc.VaList(bp+48, v49, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fstring1, v50))) if errCode != 0 { XTcl_SetErrorCode(tls, interp, libc.VaList(bp+48, __ccgo_ts+2004, __ccgo_ts+23085, __ccgo_ts+23091, errCode, subErrCode, libc.UintptrFromInt32(0))) } } return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * ConvertTreeToTokens -- * * Given a string, the numBytes bytes starting at start, and an OpNode * tree and Tcl_Token array created by passing that same string to * ParseExpr(), this function writes into *parsePtr the sequence of * Tcl_Tokens needed so to satisfy the historical interface provided by * Tcl_ParseExpr(). Note that this routine exists only for the sake of * the public Tcl_ParseExpr() routine. It is not used by Tcl itself at * all. * * Results: * None. * * Side effects: * The Tcl_Parse *parsePtr is filled with Tcl_Tokens representing the * parsed expression. * *---------------------------------------------------------------------- */ func _ConvertTreeToTokens(tls *libc.TLS, start uintptr, numBytes TTcl_Size, nodes uintptr, tokenPtr uintptr, parsePtr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _needed, _needed1, _needed2, _needed3, allocated, allocated1, allocated2, allocated3 TTcl_Size var newPtr, newPtr1, newPtr2, newPtr3, nodePtr, oldPtr, oldPtr1, oldPtr2, oldPtr3, subExprTokenPtr uintptr var next, parentIdx, scanned, subExprTokenIdx, toCopy int32 var _ /* lexeme at bp+0 */ uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _needed, _needed1, _needed2, _needed3, allocated, allocated1, allocated2, allocated3, newPtr, newPtr1, newPtr2, newPtr3, next, nodePtr, oldPtr, oldPtr1, oldPtr2, oldPtr3, parentIdx, scanned, subExprTokenIdx, subExprTokenPtr, toCopy subExprTokenIdx = 0 nodePtr = nodes next = (*TOpNode)(unsafe.Pointer(nodePtr)).Fright for int32(1) != 0 { /* * Advance the mark so the next exit from this node won't retrace * steps over ground already covered. */ (*TOpNode)(unsafe.Pointer(nodePtr)).Fmark++ /* * Handle next child node or leaf. */ switch next { case int32(OT_EMPTY): /* No tokens and no characters for the OT_EMPTY leaf. */ case int32(OT_LITERAL): /* * Skip any white space that comes before the literal. */ scanned = int32(XTclParseAllWhiteSpace(tls, start, numBytes)) start += uintptr(scanned) numBytes -= int64(scanned) /* * Reparse the literal to get pointers into source string. */ scanned = int32(_ParseLexeme(tls, start, numBytes, bp, libc.UintptrFromInt32(0))) _needed = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + int64(libc.Int32FromInt32(2)) if _needed > (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable { allocated = int64(2) * _needed oldPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr if oldPtr == parsePtr+104 { oldPtr = libc.UintptrFromInt32(0) } newPtr = XTclpRealloc(tls, oldPtr, libc.Uint64FromInt64(allocated)*uint64(32)) if newPtr == libc.UintptrFromInt32(0) { allocated = libc.Int64FromUint64(libc.Uint64FromInt64(_needed+int64(libc.Int32FromInt32(2))) + libc.Uint64FromInt32(TCL_MIN_GROWTH)/libc.Uint64FromInt64(32)) newPtr = XTcl_Realloc(tls, oldPtr, libc.Uint64FromInt64(allocated)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated if oldPtr == libc.UintptrFromInt32(0) { libc.Xmemcpy(tls, newPtr, parsePtr+104, libc.Uint64FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr } subExprTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*32 (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).Ftype1 = int32(TCL_TOKEN_SUB_EXPR) (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fstart = start (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fsize = int64(scanned) (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).FnumComponents = int64(1) (*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).Ftype1 = int32(TCL_TOKEN_TEXT) (*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).Fstart = start (*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).Fsize = int64(scanned) (*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).FnumComponents = 0 *(*TTcl_Size)(unsafe.Pointer(parsePtr + 48)) += int64(2) start += uintptr(scanned) numBytes -= int64(scanned) case int32(OT_TOKENS): /* * tokenPtr points to a token sequence that came from parsing a * Tcl word. A Tcl word is made up of a sequence of one or more * elements. When the word is only a single element, it's been the * historical practice to replace the TCL_TOKEN_WORD token * directly with a TCL_TOKEN_SUB_EXPR token. However, when the * word has multiple elements, a TCL_TOKEN_WORD token is kept as a * grouping device so that TCL_TOKEN_SUB_EXPR always has only one * element. Wise or not, these are the rules the Tcl expr parser * has followed, and for the sake of those few callers of * Tcl_ParseExpr() we do not change them now. Internally, we can * do better. */ toCopy = int32((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents + int64(1)) if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents == (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).FnumComponents+int64(1) { /* * Single element word. Copy tokens and convert the leading * token to TCL_TOKEN_SUB_EXPR. */ _needed1 = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + int64(toCopy) if _needed1 > (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable { allocated1 = int64(2) * _needed1 oldPtr1 = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr if oldPtr1 == parsePtr+104 { oldPtr1 = libc.UintptrFromInt32(0) } newPtr1 = XTclpRealloc(tls, oldPtr1, libc.Uint64FromInt64(allocated1)*uint64(32)) if newPtr1 == libc.UintptrFromInt32(0) { allocated1 = libc.Int64FromUint64(libc.Uint64FromInt64(_needed1+int64(toCopy)) + libc.Uint64FromInt32(TCL_MIN_GROWTH)/libc.Uint64FromInt64(32)) newPtr1 = XTcl_Realloc(tls, oldPtr1, libc.Uint64FromInt64(allocated1)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated1 if oldPtr1 == libc.UintptrFromInt32(0) { libc.Xmemcpy(tls, newPtr1, parsePtr+104, libc.Uint64FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr1 } subExprTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*32 libc.Xmemcpy(tls, subExprTokenPtr, tokenPtr, libc.Uint64FromInt32(toCopy)*uint64(32)) (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).Ftype1 = int32(TCL_TOKEN_SUB_EXPR) *(*TTcl_Size)(unsafe.Pointer(parsePtr + 48)) += int64(toCopy) } else { /* * Multiple element word. Create a TCL_TOKEN_SUB_EXPR token to * lead, with fields initialized from the leading token, then * copy entire set of word tokens. */ _needed2 = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + int64(toCopy+libc.Int32FromInt32(1)) if _needed2 > (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable { allocated2 = int64(2) * _needed2 oldPtr2 = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr if oldPtr2 == parsePtr+104 { oldPtr2 = libc.UintptrFromInt32(0) } newPtr2 = XTclpRealloc(tls, oldPtr2, libc.Uint64FromInt64(allocated2)*uint64(32)) if newPtr2 == libc.UintptrFromInt32(0) { allocated2 = libc.Int64FromUint64(libc.Uint64FromInt64(_needed2+int64(toCopy+libc.Int32FromInt32(1))) + libc.Uint64FromInt32(TCL_MIN_GROWTH)/libc.Uint64FromInt64(32)) newPtr2 = XTcl_Realloc(tls, oldPtr2, libc.Uint64FromInt64(allocated2)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated2 if oldPtr2 == libc.UintptrFromInt32(0) { libc.Xmemcpy(tls, newPtr2, parsePtr+104, libc.Uint64FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr2 } subExprTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*32 *(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)) = *(*TTcl_Token)(unsafe.Pointer(tokenPtr)) (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).Ftype1 = int32(TCL_TOKEN_SUB_EXPR) (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).FnumComponents++ subExprTokenPtr += 32 libc.Xmemcpy(tls, subExprTokenPtr, tokenPtr, libc.Uint64FromInt32(toCopy)*uint64(32)) *(*TTcl_Size)(unsafe.Pointer(parsePtr + 48)) += int64(toCopy + int32(1)) } scanned = int32(int64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize)) - int64(start)) start += uintptr(scanned) numBytes -= int64(scanned) tokenPtr += uintptr(toCopy) * 32 default: /* * Advance to the child node, which is an operator. */ nodePtr = nodes + uintptr(next)*16 /* * Skip any white space that comes before the subexpression. */ scanned = int32(XTclParseAllWhiteSpace(tls, start, numBytes)) start += uintptr(scanned) numBytes -= int64(scanned) /* * Generate tokens for the operator / subexpression... */ switch libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) { case int32(OPEN_PAREN): fallthrough case int32(COMMA): fallthrough case int32(COLON): /* * Historical practice has been to have no Tcl_Tokens for * these operators. */ default: /* * Remember the index of the last subexpression we were * working on -- that of our parent. We'll stack it later. */ parentIdx = subExprTokenIdx /* * Verify space for the two leading Tcl_Tokens representing * the subexpression rooted by this operator. The first * Tcl_Token will be of type TCL_TOKEN_SUB_EXPR; the second of * type TCL_TOKEN_OPERATOR. */ _needed3 = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens + int64(libc.Int32FromInt32(2)) if _needed3 > (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable { allocated3 = int64(2) * _needed3 oldPtr3 = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr if oldPtr3 == parsePtr+104 { oldPtr3 = libc.UintptrFromInt32(0) } newPtr3 = XTclpRealloc(tls, oldPtr3, libc.Uint64FromInt64(allocated3)*uint64(32)) if newPtr3 == libc.UintptrFromInt32(0) { allocated3 = libc.Int64FromUint64(libc.Uint64FromInt64(_needed3+int64(libc.Int32FromInt32(2))) + libc.Uint64FromInt32(TCL_MIN_GROWTH)/libc.Uint64FromInt64(32)) newPtr3 = XTcl_Realloc(tls, oldPtr3, libc.Uint64FromInt64(allocated3)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokensAvailable = allocated3 if oldPtr3 == libc.UintptrFromInt32(0) { libc.Xmemcpy(tls, newPtr3, parsePtr+104, libc.Uint64FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens)*uint64(32)) } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = newPtr3 } subExprTokenIdx = int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens) subExprTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(subExprTokenIdx)*32 *(*TTcl_Size)(unsafe.Pointer(parsePtr + 48)) += int64(2) (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).Ftype1 = int32(TCL_TOKEN_SUB_EXPR) (*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).Ftype1 = int32(TCL_TOKEN_OPERATOR) /* * Our current position scanning the string is the starting * point for this subexpression. */ (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fstart = start /* * Eventually, we know that the numComponents field of the * Tcl_Token of type TCL_TOKEN_OPERATOR will be 0. This means * we can make other use of this field for now to track the * stack of subexpressions we have pending. */ (*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).FnumComponents = int64(parentIdx) break } break } /* Determine which way to exit the node on this pass. */ goto router router: ; switch libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Fmark) { case int32(MARK_LEFT): next = (*TOpNode)(unsafe.Pointer(nodePtr)).Fleft case int32(MARK_RIGHT): next = (*TOpNode)(unsafe.Pointer(nodePtr)).Fright /* * Skip any white space that comes before the operator. */ scanned = int32(XTclParseAllWhiteSpace(tls, start, numBytes)) start += uintptr(scanned) numBytes -= int64(scanned) /* * Here we scan from the string the operator corresponding to * nodePtr->lexeme. */ scanned = int32(_ParseLexeme(tls, start, numBytes, bp, libc.UintptrFromInt32(0))) switch libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) { case int32(OPEN_PAREN): fallthrough case int32(COMMA): fallthrough case int32(COLON): /* * No tokens for these lexemes -> nothing to do. */ default: /* * Record in the TCL_TOKEN_OPERATOR token the pointers into * the string marking where the operator is. */ subExprTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(subExprTokenIdx)*32 (*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).Fstart = start (*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).Fsize = int64(scanned) break } start += uintptr(scanned) numBytes -= int64(scanned) case int32(MARK_PARENT): switch libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) { case int32(START): /* When we get back to the START node, we're done. */ return case int32(COMMA): fallthrough case int32(COLON): /* No tokens for these lexemes -> nothing to do. */ case int32(OPEN_PAREN): /* * Skip past matching close paren. */ scanned = int32(XTclParseAllWhiteSpace(tls, start, numBytes)) start += uintptr(scanned) numBytes -= int64(scanned) scanned = int32(_ParseLexeme(tls, start, numBytes, bp, libc.UintptrFromInt32(0))) start += uintptr(scanned) numBytes -= int64(scanned) default: /* * Before we leave this node/operator/subexpression for the * last time, finish up its tokens.... * * Our current position scanning the string is where the * substring for the subexpression ends. */ subExprTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr(subExprTokenIdx)*32 (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fsize = int64(start) - int64((*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).Fstart) /* * All the Tcl_Tokens allocated and filled belong to * this subexpression. The first token is the leading * TCL_TOKEN_SUB_EXPR token, and all the rest (one fewer) * are its components. */ (*TTcl_Token)(unsafe.Pointer(subExprTokenPtr)).FnumComponents = int64(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumTokens) - subExprTokenIdx - int32(1)) /* * Finally, as we return up the tree to our parent, pop the * parent subexpression off our subexpression stack, and * fill in the zero numComponents for the operator Tcl_Token. */ parentIdx = int32((*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).FnumComponents) (*(*TTcl_Token)(unsafe.Pointer(subExprTokenPtr + 1*32))).FnumComponents = 0 subExprTokenIdx = parentIdx break } /* * Since we're returning to parent, skip child handling code. */ nodePtr = nodes + uintptr(*(*int32)(unsafe.Pointer(nodePtr + 8)))*16 goto router } } } /* *---------------------------------------------------------------------- * * Tcl_ParseExpr -- * * Given a string, the numBytes bytes starting at start, this function * parses it as a Tcl expression and stores information about the * structure of the expression in the Tcl_Parse struct indicated by the * caller. * * Results: * If the string is successfully parsed as a valid Tcl expression, TCL_OK * is returned, and data about the expression structure is written to * *parsePtr. If the string cannot be parsed as a valid Tcl expression, * TCL_ERROR is returned, and if interp is non-NULL, an error message is * written to interp. * * Side effects: * If there is insufficient space in parsePtr to hold all the information * about the expression, then additional space is malloc-ed. If the * function returns TCL_OK then the caller must eventually invoke * Tcl_FreeParse to release any additional space that was allocated. * *---------------------------------------------------------------------- */ func XTcl_ParseExpr(tls *libc.TLS, interp uintptr, start uintptr, numBytes TTcl_Size, parsePtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Structure to fill with information about * the parsed expression; any previous * information in the structure is ignored. */ var _objPtr, _objPtr1, cachePtr, cachePtr1, exprParsePtr, funcList, litList, v5, v7 uintptr var code int32 var v1, v2 bool var v3 uint64 var v4, v6 TTcl_Size var _ /* opTree at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, code, exprParsePtr, funcList, litList, v1, v2, v3, v4, v5, v6, v7 *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) /* List to hold the functon names. */ exprParsePtr = XTclStackAlloc(tls, interp, uint64(744)) /* Holds the Tcl_Tokens of substitutions. */ if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { litList = XTclThreadAllocObj(tls) } else { litList = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(litList + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(litList)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(litList)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(litList)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(litList)).FtypePtr = libc.UintptrFromInt32(0) if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { funcList = XTclThreadAllocObj(tls) } else { funcList = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(funcList + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(funcList)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(funcList)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(funcList)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(funcList)).FtypePtr = libc.UintptrFromInt32(0) if numBytes < 0 { if start != 0 { v3 = libc.Xstrlen(tls, start) } else { v3 = uint64(0) } numBytes = libc.Int64FromUint64(v3) } code = _ParseExpr(tls, interp, start, numBytes, bp, litList, funcList, exprParsePtr, int32(1)) _objPtr = funcList v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = litList v7 = _objPtr1 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr1) } XTclParseInit(tls, interp, start, numBytes, parsePtr) if code == TCL_OK { _ConvertTreeToTokens(tls, start, numBytes, *(*uintptr)(unsafe.Pointer(bp)), (*TTcl_Parse)(unsafe.Pointer(exprParsePtr)).FtokenPtr, parsePtr) } else { (*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm = (*TTcl_Parse)(unsafe.Pointer(exprParsePtr)).Fterm (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FerrorType = (*TTcl_Parse)(unsafe.Pointer(exprParsePtr)).FerrorType } XTcl_FreeParse(tls, exprParsePtr) XTclStackFree(tls, interp, exprParsePtr) XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp))) return code } /* *---------------------------------------------------------------------- * * ParseLexeme -- * * Parse a single lexeme from the start of a string, scanning no more * than numBytes bytes. * * Results: * Returns the number of bytes scanned to produce the lexeme. * * Side effects: * Code identifying lexeme parsed is written to *lexemePtr. * *---------------------------------------------------------------------- */ func _ParseLexeme(tls *libc.TLS, start uintptr, numBytes TTcl_Size, lexemePtr uintptr, literalPtr uintptr) (r TTcl_Size) { bp := tls.Alloc(32) defer tls.Free(32) /* Write corresponding literal value to this * storage, if non-NULL. */ var _objPtr, _objPtr1, _objPtr2, cachePtr, literal, p, v12, v14, v5, v7, v8 uintptr var byte1 uint8 var scanned, size, v11, v13, v6 TTcl_Size var v10, v9 int64 var v2 bool var _ /* ch at bp+8 */ int32 var _ /* end at bp+0 */ uintptr var _ /* lexeme at bp+12 */ uint8 var _ /* utfBytes at bp+16 */ [8]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, byte1, cachePtr, literal, p, scanned, size, v10, v11, v12, v13, v14, v2, v5, v6, v7, v8, v9 literal = libc.UintptrFromInt32(0) if numBytes == 0 { *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(END1) return 0 } byte1 = *(*uint8)(unsafe.Pointer(start)) if uint64(byte1) < uint64(128) && libc.Int32FromUint8(_Lexeme[byte1]) != 0 { *(*uint8)(unsafe.Pointer(lexemePtr)) = _Lexeme[byte1] return int64(1) } switch libc.Int32FromUint8(byte1) { case int32('#'): size = 0 for { if !(libc.Int32FromUint8(byte1) != int32('\n') && libc.Int32FromUint8(byte1) != 0 && size < numBytes) { break } byte1 = *(*uint8)(unsafe.Pointer(start + uintptr(size))) goto _1 _1: ; size++ } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(COMMENT) return size - libc.BoolInt64(libc.Int32FromUint8(byte1) == libc.Int32FromUint8('\n')) case int32('*'): if numBytes > int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) == int32('*') { *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(EXPON) return int64(2) } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(MULT) return int64(1) case int32('='): if numBytes > int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) == int32('=') { *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(EQUAL) return int64(2) } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(INCOMPLETE) return int64(1) case int32('!'): if numBytes > int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) == int32('=') { *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(NEQ) return int64(2) } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(NOT) return int64(1) case int32('&'): if numBytes > int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) == int32('&') { *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(AND) return int64(2) } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BIT_AND) return int64(1) case int32('|'): if numBytes > int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) == int32('|') { *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(OR) return int64(2) } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BIT_OR) return int64(1) case int32('<'): if numBytes > int64(1) { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) { case int32('<'): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(LEFT_SHIFT) return int64(2) case int32('='): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(LEQ) return int64(2) } } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(LESS) return int64(1) case int32('>'): if numBytes > int64(1) { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) { case int32('>'): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(RIGHT_SHIFT) return int64(2) case int32('='): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(GEQ) return int64(2) } } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(GREATER) return int64(1) case int32('i'): if numBytes > int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) == int32('n') && (numBytes == int64(2) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 2)))&int32(0x80) != 0 || !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(start + 2)))|libc.Uint32FromInt32(32)-libc.Uint32FromUint8('a') < libc.Uint32FromInt32(26)) != 0)) { /* * Must make this check so we can tell the difference between the * "in" operator and the "int" function name and the "infinity" * numeric value. */ *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(IN_LIST) return int64(2) } case int32('e'): if numBytes > int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) == int32('q') && (numBytes == int64(2) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 2)))&int32(0x80) != 0 || !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(start + 2)))|libc.Uint32FromInt32(32)-libc.Uint32FromUint8('a') < libc.Uint32FromInt32(26)) != 0)) { *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(STREQ) return int64(2) } case int32('n'): if numBytes > int64(1) && (numBytes == int64(2) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 2)))&int32(0x80) != 0 || !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(start + 2)))|libc.Uint32FromInt32(32)-libc.Uint32FromUint8('a') < libc.Uint32FromInt32(26)) != 0)) { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) { case int32('e'): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(STRNEQ) return int64(2) case int32('i'): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(NOT_IN_LIST) return int64(2) } } case int32('l'): if numBytes > int64(1) && (numBytes == int64(2) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 2)))&int32(0x80) != 0 || !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(start + 2)))|libc.Uint32FromInt32(32)-libc.Uint32FromUint8('a') < libc.Uint32FromInt32(26)) != 0)) { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) { case int32('t'): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(STR_LT) return int64(2) case int32('e'): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(STR_LEQ) return int64(2) } } case int32('g'): if numBytes > int64(1) && (numBytes == int64(2) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 2)))&int32(0x80) != 0 || !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(start + 2)))|libc.Uint32FromInt32(32)-libc.Uint32FromUint8('a') < libc.Uint32FromInt32(26)) != 0)) { switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start + 1))) { case int32('t'): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(STR_GT) return int64(2) case int32('e'): *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(STR_GEQ) return int64(2) } } break } if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { literal = XTclThreadAllocObj(tls) } else { literal = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(literal + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(literal)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(literal)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(literal)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(literal)).FtypePtr = libc.UintptrFromInt32(0) if XTclParseNumber(tls, libc.UintptrFromInt32(0), literal, libc.UintptrFromInt32(0), start, numBytes, bp, int32(TCL_PARSE_NO_WHITESPACE)) == TCL_OK { if !(*(*uintptr)(unsafe.Pointer(bp)) < start+uintptr(numBytes) && !(XTclIsBareword(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))) != 0)) { goto _3 } goto number number: ; *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(NUMBER) if literalPtr != 0 { if int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start) == 0 { (*TTcl_Obj)(unsafe.Pointer(literal)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(literal)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(literal)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start)+libc.Int64FromUint32(1))) if start != 0 { v5 = start } else { v5 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(literal)).Fbytes, v5, libc.Uint64FromInt64(int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start))) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(literal)).Fbytes + uintptr(int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(literal)).Flength = int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(start) } *(*uintptr)(unsafe.Pointer(literalPtr)) = literal } else { _objPtr = literal v7 = _objPtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(start) goto _4 _3: ; /* * We have a number followed directly by bareword characters * (alpha, digit, underscore). Is this a number followed by * bareword syntax error? Or should we join into one bareword? * Example: Inf + luence + () becomes a valid function call. * [Bug 3401704] */ if (*TTcl_Obj)(unsafe.Pointer(literal)).FtypePtr == uintptr(unsafe.Pointer(&XtclDoubleType)) { p = start for p < *(*uintptr)(unsafe.Pointer(bp)) { v8 = p p++ if !(XTclIsBareword(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v8)))) != 0) { /* * The number has non-bareword characters, so we * must treat it as a number. */ goto number } } } _ParseLexeme(tls, *(*uintptr)(unsafe.Pointer(bp)), numBytes-(int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start)), bp+12, libc.UintptrFromInt32(0)) if int32(NODE_TYPE)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp + 12))) == int32(BINARY) { /* * The bareword characters following the number take the * form of an operator (eq, ne, in, ni, ...) so we treat * as number + operator. */ goto number } /* * Otherwise, fall through and parse the whole as a bareword. */ _4: } /* * We reject leading underscores in bareword. No sensible reason why. * Might be inspired by reserved identifier rules in C, which of course * have no direct relevance here. */ if !(XTclIsBareword(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start)))) != 0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start))) == int32('_') { if XTcl_UtfCharComplete(tls, start, numBytes) != 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp + 8)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(start))) v9 = int64(libc.Int32FromInt32(1)) } else { v9 = XTcl_UtfToUniChar(tls, start, bp+8) } scanned = v9 } else { libc.Xmemcpy(tls, bp+16, start, libc.Uint64FromInt64(numBytes)) (*(*[8]uint8)(unsafe.Pointer(bp + 16)))[numBytes] = uint8('\000') if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp + 16))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp + 8)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp + 16))) v10 = int64(libc.Int32FromInt32(1)) } else { v10 = XTcl_UtfToUniChar(tls, bp+16, bp+8) } scanned = v10 } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(INVALID) _objPtr1 = literal v12 = _objPtr1 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return scanned } *(*uintptr)(unsafe.Pointer(bp)) = start for numBytes != 0 && XTclIsBareword(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1) numBytes -= int64(1) } *(*uint8)(unsafe.Pointer(lexemePtr)) = uint8(BAREWORD) if literalPtr != 0 { XTcl_SetStringObj(tls, literal, start, int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(start)) *(*uintptr)(unsafe.Pointer(literalPtr)) = literal } else { _objPtr2 = literal v14 = _objPtr2 v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if v13 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } return int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(start) } /* *---------------------------------------------------------------------- * * TclCompileExpr -- * * This procedure compiles a string containing a Tcl expression into Tcl * bytecodes. * * Results: * None. * * Side effects: * Adds instructions to envPtr to evaluate the expression at runtime. * *---------------------------------------------------------------------- */ func XTclCompileExpr(tls *libc.TLS, interp uintptr, script uintptr, numBytes TTcl_Size, envPtr uintptr, optimize int32) { bp := tls.Alloc(32) defer tls.Free(32) /* 0 for one-off expressions. */ var _objPtr, _objPtr1, cachePtr, cachePtr1, funcList, litList, parsePtr, v10, v12 uintptr var code int32 var v1, v2 bool var v11, v9 TTcl_Size var v4, v5, v7, v8 int64 var _ /* funcObjv at bp+24 */ uintptr var _ /* litObjv at bp+16 */ uintptr var _ /* objc at bp+8 */ TTcl_Size var _ /* opTree at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, code, funcList, litList, parsePtr, v1, v10, v11, v12, v2, v4, v5, v7, v8, v9 *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) /* List to hold the functon names*/ parsePtr = XTclStackAlloc(tls, interp, uint64(744)) if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { litList = XTclThreadAllocObj(tls) } else { litList = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(litList + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(litList)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(litList)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(litList)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(litList)).FtypePtr = libc.UintptrFromInt32(0) if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { funcList = XTclThreadAllocObj(tls) } else { funcList = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(funcList + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(funcList)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(funcList)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(funcList)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(funcList)).FtypePtr = libc.UintptrFromInt32(0) code = _ParseExpr(tls, interp, script, numBytes, bp, litList, funcList, parsePtr, 0) if code == TCL_OK { /* TIP #280 : Track Lines within the expression */ XTclAdvanceLines(tls, envPtr+4512, script, script+uintptr(XTclParseAllWhiteSpace(tls, script, numBytes))) if (*TTcl_Obj)(unsafe.Pointer(litList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(litList + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(litList + 32))).Fptr2)).FspanStart } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(litList + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(litList + 32))).Fptr1 + 40 + uintptr(v4)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(litList + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(litList + 32))).Fptr2)).FspanLength } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(litList + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v5 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), litList, bp+8, bp+16) } if (*TTcl_Obj)(unsafe.Pointer(funcList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(funcList + 32))).Fptr2 != 0 { v7 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(funcList + 32))).Fptr2)).FspanStart } else { v7 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(funcList + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 24)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(funcList + 32))).Fptr1 + 40 + uintptr(v7)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(funcList + 32))).Fptr2 != 0 { v8 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(funcList + 32))).Fptr2)).FspanLength } else { v8 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(funcList + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v8 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), funcList, bp+8, bp+24) } _CompileExprTree(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), 0, bp+16, *(*uintptr)(unsafe.Pointer(bp + 24)), (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, envPtr, optimize) } else { XTclCompileSyntaxError(tls, interp, envPtr) } XTcl_FreeParse(tls, parsePtr) XTclStackFree(tls, interp, parsePtr) _objPtr = funcList v10 = _objPtr v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = litList v12 = _objPtr1 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr1) } XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } /* *---------------------------------------------------------------------- * * ExecConstantExprTree -- * Compiles and executes bytecode for the subexpression tree at index * in the nodes array. This subexpression must be constant, made up * of only constant operators (not functions) and literals. * * Results: * A standard Tcl return code and result left in interp. * * Side effects: * Consumes subtree of nodes rooted at index. Advances the pointer * *litObjvPtr. * *---------------------------------------------------------------------- */ func _ExecConstantExprTree(tls *libc.TLS, interp uintptr, nodes uintptr, index int32, litObjvPtr uintptr) (r int32) { var byteCodePtr, envPtr2, rootPtr, v1, v2, v4 uintptr var code, delta1, v3 int32 _, _, _, _, _, _, _, _, _ = byteCodePtr, code, delta1, envPtr2, rootPtr, v1, v2, v3, v4 rootPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr /* * Note we are compiling an expression with literal arguments. This means * there can be no [info frame] calls when we execute the resulting * bytecode, so there's no need to tend to TIP 280 issues. */ envPtr2 = XTclStackAlloc(tls, interp, uint64(4544)) XTclInitCompileEnv(tls, interp, envPtr2, libc.UintptrFromInt32(0), uint64(0), libc.UintptrFromInt32(0), 0) _CompileExprTree(tls, interp, nodes, index, litObjvPtr, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), envPtr2, 0) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_DONE)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DONE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } byteCodePtr = XTclInitByteCode(tls, envPtr2) XTclFreeCompileEnv(tls, envPtr2) XTclStackFree(tls, interp, envPtr2) XTclNRExecuteByteCode(tls, interp, byteCodePtr) code = XTclNRRunCallbacks(tls, interp, TCL_OK, rootPtr) XTclReleaseByteCode(tls, byteCodePtr) return code } /* *---------------------------------------------------------------------- * * CompileExprTree -- * * Compiles and writes to envPtr instructions for the subexpression tree * at index in the nodes array. (*litObjvPtr) must point to the proper * location in a corresponding literals list. Likewise, when non-NULL, * funcObjv and tokenPtr must point into matching arrays of function * names and Tcl_Token's derived from earlier call to ParseExpr(). When * optimize is true, any constant subexpressions will be precomputed. * * Results: * None. * * Side effects: * Adds instructions to envPtr to evaluate the expression at runtime. * Consumes subtree of nodes rooted at index. Advances the pointer * *litObjvPtr. * *---------------------------------------------------------------------- */ func _CompileExprTree(tls *libc.TLS, interp uintptr, nodes uintptr, index int32, litObjvPtr uintptr, funcObjv uintptr, tokenPtr uintptr, envPtr2 uintptr, optimize int32) { bp := tls.Alloc(272) defer tls.Free(272) var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, convert, delta1, idx, idx1, next, numWords, pc1, pc2, target, v106, v118, v124, v136, v143, v155, v18, v20, v22, v35, v39, v42, v43, v44, v45, v52, v6, v64, v70, v72, v79, v91, v98, v99 int32 var bytes, bytes1, freePtr, jumpPtr, litObjv, literal, newJump, nodePtr, objPtr, objPtr1, p, rootPtr, tableValue, v1, v10, v100, v101, v102, v103, v104, v105, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v119, v12, v120, v121, v122, v123, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v137, v138, v139, v14, v140, v141, v142, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v156, v16, v17, v19, v2, v21, v3, v33, v34, v36, v37, v38, v4, v40, v41, v46, v47, v48, v49, v5, v50, v51, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v65, v66, v67, v68, v69, v7, v71, v73, v74, v75, v76, v77, v78, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v92, v96, v97 uintptr var save TTcl_InterpState var _ /* cmdName at bp+0 */ TTcl_DString var _ /* length at bp+224 */ TTcl_Size var _ /* length at bp+232 */ TTcl_Size var _ /* numBytes at bp+240 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, _objIndexCopy4, _objIndexCopy5, bytes, bytes1, convert, delta1, freePtr, idx, idx1, jumpPtr, litObjv, literal, newJump, next, nodePtr, numWords, objPtr, objPtr1, p, pc1, pc2, rootPtr, save, tableValue, target, v1, v10, v100, v101, v102, v103, v104, v105, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v116, v117, v118, v119, v12, v120, v121, v122, v123, v124, v125, v126, v127, v128, v129, v13, v130, v131, v132, v133, v134, v135, v136, v137, v138, v139, v14, v140, v141, v142, v143, v144, v145, v146, v147, v148, v149, v15, v150, v151, v152, v153, v154, v155, v156, v16, v17, v18, v19, v2, v20, v21, v22, v3, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v9, v90, v91, v92, v96, v97, v98, v99 nodePtr = nodes + uintptr(index)*16 rootPtr = nodePtr numWords = 0 jumpPtr = libc.UintptrFromInt32(0) convert = int32(1) for int32(1) != 0 { if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Fmark) == int32(MARK_LEFT) { next = (*TOpNode)(unsafe.Pointer(nodePtr)).Fleft if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) == int32(QUESTION) { convert = int32(1) } } else { if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Fmark) == int32(MARK_RIGHT) { next = (*TOpNode)(unsafe.Pointer(nodePtr)).Fright switch libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) { case int32(FUNCTION): XTcl_DStringInit(tls, bp) XTcl_DStringAppend(tls, bp, __ccgo_ts+23096, libc.Int64FromUint64(libc.Uint64FromInt64(16)-libc.Uint64FromInt32(1))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(funcObjv)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 224)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(funcObjv)))).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(funcObjv)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(funcObjv)), bp+224) } p = v1 funcObjv += 8 XTcl_DStringAppend(tls, bp, p, *(*TTcl_Size)(unsafe.Pointer(bp + 224))) _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1, (*TTcl_DString)(unsafe.Pointer(bp)).Flength, int32(LITERAL_CMD_NAME)) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } XTcl_DStringFree(tls, bp) /* * Start a count of the number of words in this function * command invocation. In case there's already a count in * progress (nested functions), save it in our unused "left" * field for restoring later. */ (*TOpNode)(unsafe.Pointer(nodePtr)).Fleft = numWords numWords = int32(2) /* Command plus one argument */ case int32(QUESTION): newJump = XTclStackAlloc(tls, interp, uint64(24)) (*TJumpList)(unsafe.Pointer(newJump)).Fnext = jumpPtr jumpPtr = newJump XTclEmitForwardJump(tls, envPtr2, int32(TCL_FALSE_JUMP), jumpPtr) case int32(COLON): newJump = XTclStackAlloc(tls, interp, uint64(24)) (*TJumpList)(unsafe.Pointer(newJump)).Fnext = jumpPtr jumpPtr = newJump XTclEmitForwardJump(tls, envPtr2, int32(TCL_UNCONDITIONAL_JUMP), jumpPtr) v20 = -int32(1) v21 = envPtr2 if v20 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v21)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v21 + 64)) += int64(v20) if convert != 0 { (*TJumpList)(unsafe.Pointer(jumpPtr)).Fjump.FjumpType = int32(TCL_TRUE_JUMP) } convert = int32(1) case int32(AND): fallthrough case int32(OR): newJump = XTclStackAlloc(tls, interp, uint64(24)) (*TJumpList)(unsafe.Pointer(newJump)).Fnext = jumpPtr jumpPtr = newJump if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) == int32(AND) { v22 = int32(TCL_FALSE_JUMP) } else { v22 = int32(TCL_TRUE_JUMP) } XTclEmitForwardJump(tls, envPtr2, v22, jumpPtr) break } } else { switch libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) { case int32(QUESTION): goto _23 case int32(START): goto _24 case int32(OPEN_PAREN): goto _25 case int32(FUNCTION): goto _26 case int32(COMMA): goto _27 case int32(COLON): goto _28 case int32(OR): goto _29 case int32(AND): goto _30 default: goto _31 } goto _32 _24: ; _23: ; if convert != 0 && nodePtr == rootPtr { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v34 = envPtr2 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = libc.Uint8FromInt32(int32(INST_TRY_CVT_TO_NUMERIC)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_TRY_CVT_TO_NUMERIC)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v35 = delta1 v36 = envPtr2 if v35 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v36)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v36)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v36 + 64)) += int64(v35) } } goto _32 _25: ; /* do nothing */ goto _32 _26: ; /* * Use the numWords count we've kept to invoke the function * command with the correct number of arguments. */ if numWords < int32(255) { XTclEmitInvoke(tls, envPtr2, int32(INST_INVOKE_STK1), libc.VaList(bp+256, numWords)) } else { XTclEmitInvoke(tls, envPtr2, int32(INST_INVOKE_STK4), libc.VaList(bp+256, numWords)) } /* * Restore any saved numWords value. */ numWords = (*TOpNode)(unsafe.Pointer(nodePtr)).Fleft convert = int32(1) goto _32 _27: ; /* * Each comma implies another function argument. */ numWords++ goto _32 _28: ; if (*TJumpList)(unsafe.Pointer(jumpPtr)).Fjump.FjumpType == int32(TCL_TRUE_JUMP) { (*TJumpList)(unsafe.Pointer(jumpPtr)).Fjump.FjumpType = int32(TCL_UNCONDITIONAL_JUMP) convert = int32(1) } target = libc.Int32FromUint32((*TJumpList)(unsafe.Pointer(jumpPtr)).Fjump.FcodeOffset + uint32(2)) if XTclFixupForwardJump(tls, envPtr2, jumpPtr, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(jumpPtr)).FcodeOffset))), int32(127)) != 0 { target += int32(3) } freePtr = jumpPtr jumpPtr = (*TJumpList)(unsafe.Pointer(jumpPtr)).Fnext XTclStackFree(tls, interp, freePtr) XTclFixupForwardJump(tls, envPtr2, jumpPtr, libc.Int32FromUint32(libc.Uint32FromInt32(target)-(*TJumpList)(unsafe.Pointer(jumpPtr)).Fjump.FcodeOffset), int32(127)) freePtr = jumpPtr jumpPtr = (*TJumpList)(unsafe.Pointer(jumpPtr)).Fnext XTclStackFree(tls, interp, freePtr) goto _32 _30: ; _29: ; pc1 = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v38 = envPtr2 + 152 v37 = *(*uintptr)(unsafe.Pointer(v38)) *(*uintptr)(unsafe.Pointer(v38))++ if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) == int32(AND) { v39 = int32(INST_JUMP_FALSE1) } else { v39 = int32(INST_JUMP_TRUE1) } *(*uint8)(unsafe.Pointer(v37)) = libc.Uint8FromInt32(v39) v41 = envPtr2 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) == int32(AND) { v43 = int32(INST_JUMP_FALSE1) } else { v43 = int32(INST_JUMP_TRUE1) } if v43 == int32(INST_START_CMD) { v42 = int32(1) } else { v42 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v42 } if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) == int32(AND) { v44 = int32(INST_JUMP_FALSE1) } else { v44 = int32(INST_JUMP_TRUE1) } delta1 = XtclInstructionTable[libc.Uint8FromInt32(v44)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v45 = delta1 v46 = envPtr2 if v45 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v46)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v46)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v46 + 64)) += int64(v45) } if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) == int32(AND) { v47 = __ccgo_ts + 21397 } else { v47 = __ccgo_ts + 14828 } _objIndexCopy1 = XTclRegisterLiteral(tls, envPtr2, v47, int64(1), 0) if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v52 = delta1 v53 = envPtr2 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v63 = envPtr2 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v64 = delta1 v65 = envPtr2 if v64 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v65 + 64)) += int64(v64) } } pc2 = int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v67 = envPtr2 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v69 = envPtr2 + 152 v68 = *(*uintptr)(unsafe.Pointer(v69)) *(*uintptr)(unsafe.Pointer(v69))++ *(*uint8)(unsafe.Pointer(v68)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v70 = delta1 v71 = envPtr2 if v70 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v71 + 64)) += int64(v70) } v72 = -int32(1) v73 = envPtr2 if v72 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v73)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v73)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v73)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v73)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v73 + 64)) += int64(v72) *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(pc1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(pc1))) if XTclFixupForwardJump(tls, envPtr2, jumpPtr, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(jumpPtr)).FcodeOffset))), int32(127)) != 0 { pc2 += int32(3) } if libc.Int32FromUint8((*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme) == int32(AND) { v74 = __ccgo_ts + 14828 } else { v74 = __ccgo_ts + 21397 } _objIndexCopy2 = XTclRegisterLiteral(tls, envPtr2, v74, int64(1), 0) if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v76 = envPtr2 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v78 = envPtr2 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v79 = delta1 v80 = envPtr2 if v79 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v80)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v80)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v80)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v80)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v80 + 64)) += int64(v79) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v82 = envPtr2 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v84 = envPtr2 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v86 = envPtr2 + 152 v85 = *(*uintptr)(unsafe.Pointer(v86)) *(*uintptr)(unsafe.Pointer(v86))++ *(*uint8)(unsafe.Pointer(v85)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v88 = envPtr2 + 152 v87 = *(*uintptr)(unsafe.Pointer(v88)) *(*uintptr)(unsafe.Pointer(v88))++ *(*uint8)(unsafe.Pointer(v87)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v90 = envPtr2 + 152 v89 = *(*uintptr)(unsafe.Pointer(v90)) *(*uintptr)(unsafe.Pointer(v90))++ *(*uint8)(unsafe.Pointer(v89)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v91 = delta1 v92 = envPtr2 if v91 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v92)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v92)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v92 + 64)) += int64(v91) } } *(*uint8)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart + uintptr(pc2) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) - int64(pc2))) convert = 0 freePtr = jumpPtr jumpPtr = (*TJumpList)(unsafe.Pointer(jumpPtr)).Fnext XTclStackFree(tls, interp, freePtr) goto _32 _31: ; _95: ; if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v97 = envPtr2 + 152 v96 = *(*uintptr)(unsafe.Pointer(v97)) *(*uintptr)(unsafe.Pointer(v97))++ *(*uint8)(unsafe.Pointer(v96)) = _instruction[(*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme] if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { if libc.Int32FromUint8(_instruction[(*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme]) == int32(INST_START_CMD) { v98 = int32(1) } else { v98 = 0 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = v98 } delta1 = XtclInstructionTable[_instruction[(*TOpNode)(unsafe.Pointer(nodePtr)).Flexeme]].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v99 = delta1 v100 = envPtr2 if v99 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v100)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v100)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v100 + 64)) += int64(v99) } goto _94 _94: ; if 0 != 0 { goto _95 } goto _93 _93: ; convert = 0 goto _32 _32: ; if nodePtr == rootPtr { /* We're done */ return } nodePtr = nodes + uintptr(*(*int32)(unsafe.Pointer(nodePtr + 8)))*16 continue } } (*TOpNode)(unsafe.Pointer(nodePtr)).Fmark++ switch next { case int32(OT_EMPTY): numWords = int32(1) /* No arguments, so just the command */ case int32(OT_LITERAL): litObjv = *(*uintptr)(unsafe.Pointer(litObjvPtr)) literal = *(*uintptr)(unsafe.Pointer(litObjv)) if optimize != 0 { if (*TTcl_Obj)(unsafe.Pointer(literal)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 232)) = (*TTcl_Obj)(unsafe.Pointer(literal)).Flength v101 = (*TTcl_Obj)(unsafe.Pointer(literal)).Fbytes } else { v101 = XTcl_GetStringFromObj(tls, literal, bp+232) } bytes = v101 idx = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 232)), 0) objPtr = XTclFetchLiteral(tls, envPtr2, int64(idx)) if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == libc.UintptrFromInt32(0) && (*TTcl_Obj)(unsafe.Pointer(literal)).FtypePtr != libc.UintptrFromInt32(0) { /* * Would like to do this: * * lePtr->objPtr = literal; * Tcl_IncrRefCount(literal); * Tcl_DecrRefCount(objPtr); * * However, the design of the "global" and "local" * LiteralTable does not permit the value of lePtr->objPtr * to change. So rather than replace lePtr->objPtr, we do * surgery to transfer our desired internalrep into it. */ (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = (*TTcl_Obj)(unsafe.Pointer(literal)).FtypePtr (*TTcl_Obj)(unsafe.Pointer(objPtr)).FinternalRep = (*TTcl_Obj)(unsafe.Pointer(literal)).FinternalRep (*TTcl_Obj)(unsafe.Pointer(literal)).FtypePtr = libc.UintptrFromInt32(0) } _objIndexCopy3 = idx if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v103 = envPtr2 + 152 v102 = *(*uintptr)(unsafe.Pointer(v103)) *(*uintptr)(unsafe.Pointer(v103))++ *(*uint8)(unsafe.Pointer(v102)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v105 = envPtr2 + 152 v104 = *(*uintptr)(unsafe.Pointer(v105)) *(*uintptr)(unsafe.Pointer(v105))++ *(*uint8)(unsafe.Pointer(v104)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v106 = delta1 v107 = envPtr2 if v106 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v107)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v107)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v107)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v107)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v107 + 64)) += int64(v106) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v109 = envPtr2 + 152 v108 = *(*uintptr)(unsafe.Pointer(v109)) *(*uintptr)(unsafe.Pointer(v109))++ *(*uint8)(unsafe.Pointer(v108)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v111 = envPtr2 + 152 v110 = *(*uintptr)(unsafe.Pointer(v111)) *(*uintptr)(unsafe.Pointer(v111))++ *(*uint8)(unsafe.Pointer(v110)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v113 = envPtr2 + 152 v112 = *(*uintptr)(unsafe.Pointer(v113)) *(*uintptr)(unsafe.Pointer(v113))++ *(*uint8)(unsafe.Pointer(v112)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v115 = envPtr2 + 152 v114 = *(*uintptr)(unsafe.Pointer(v115)) *(*uintptr)(unsafe.Pointer(v115))++ *(*uint8)(unsafe.Pointer(v114)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v117 = envPtr2 + 152 v116 = *(*uintptr)(unsafe.Pointer(v117)) *(*uintptr)(unsafe.Pointer(v117))++ *(*uint8)(unsafe.Pointer(v116)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v118 = delta1 v119 = envPtr2 if v118 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v119)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v119)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v119)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v119)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v119 + 64)) += int64(v118) } } } else { /* * When optimize==0, we know the expression is a one-off and * there's nothing to be gained from sharing literals when * they won't live long, and the copies we have already have * an appropriate internalrep. In this case, skip literal * registration that would enable sharing, and use the routine * that preserves internalreps. */ _objIndexCopy4 = XTclAddLiteralObj(tls, envPtr2, literal, libc.UintptrFromInt32(0)) if _objIndexCopy4 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v121 = envPtr2 + 152 v120 = *(*uintptr)(unsafe.Pointer(v121)) *(*uintptr)(unsafe.Pointer(v121))++ *(*uint8)(unsafe.Pointer(v120)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v123 = envPtr2 + 152 v122 = *(*uintptr)(unsafe.Pointer(v123)) *(*uintptr)(unsafe.Pointer(v123))++ *(*uint8)(unsafe.Pointer(v122)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v124 = delta1 v125 = envPtr2 if v124 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v125)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v125)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v125 + 64)) += int64(v124) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v127 = envPtr2 + 152 v126 = *(*uintptr)(unsafe.Pointer(v127)) *(*uintptr)(unsafe.Pointer(v127))++ *(*uint8)(unsafe.Pointer(v126)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v129 = envPtr2 + 152 v128 = *(*uintptr)(unsafe.Pointer(v129)) *(*uintptr)(unsafe.Pointer(v129))++ *(*uint8)(unsafe.Pointer(v128)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(24)) v131 = envPtr2 + 152 v130 = *(*uintptr)(unsafe.Pointer(v131)) *(*uintptr)(unsafe.Pointer(v131))++ *(*uint8)(unsafe.Pointer(v130)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(16)) v133 = envPtr2 + 152 v132 = *(*uintptr)(unsafe.Pointer(v133)) *(*uintptr)(unsafe.Pointer(v133))++ *(*uint8)(unsafe.Pointer(v132)) = uint8(libc.Uint32FromInt32(_objIndexCopy4) >> libc.Int32FromInt32(8)) v135 = envPtr2 + 152 v134 = *(*uintptr)(unsafe.Pointer(v135)) *(*uintptr)(unsafe.Pointer(v135))++ *(*uint8)(unsafe.Pointer(v134)) = uint8(libc.Uint32FromInt32(_objIndexCopy4)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy4 } v136 = delta1 v137 = envPtr2 if v136 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v137)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v137)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v137 + 64)) += int64(v136) } } } *(*uintptr)(unsafe.Pointer(litObjvPtr)) += 8 case int32(OT_TOKENS): XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) tokenPtr += uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+int64(1)) * 32 default: if optimize != 0 && (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(next)*16))).Fconstant != 0 { save = XTcl_SaveInterpState(tls, interp, TCL_OK) if _ExecConstantExprTree(tls, interp, nodes, next, litObjvPtr) == TCL_OK { objPtr1 = XTcl_GetObjResult(tls, interp) /* * Don't generate a string rep, but if we have one * already, then use it to share via the literal table. */ if (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 240)) = (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Flength v138 = (*TTcl_Obj)(unsafe.Pointer(objPtr1)).Fbytes } else { v138 = XTcl_GetStringFromObj(tls, objPtr1, bp+240) } bytes1 = v138 idx1 = XTclRegisterLiteral(tls, envPtr2, bytes1, *(*TTcl_Size)(unsafe.Pointer(bp + 240)), 0) tableValue = XTclFetchLiteral(tls, envPtr2, int64(idx1)) if (*TTcl_Obj)(unsafe.Pointer(tableValue)).FtypePtr == libc.UintptrFromInt32(0) && (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FtypePtr != libc.UintptrFromInt32(0) { /* * Same internalrep surgery as for OT_LITERAL. */ (*TTcl_Obj)(unsafe.Pointer(tableValue)).FtypePtr = (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FtypePtr (*TTcl_Obj)(unsafe.Pointer(tableValue)).FinternalRep = (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FinternalRep (*TTcl_Obj)(unsafe.Pointer(objPtr1)).FtypePtr = libc.UintptrFromInt32(0) } } else { idx1 = XTclAddLiteralObj(tls, envPtr2, objPtr1, libc.UintptrFromInt32(0)) } _objIndexCopy5 = idx1 if _objIndexCopy5 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v140 = envPtr2 + 152 v139 = *(*uintptr)(unsafe.Pointer(v140)) *(*uintptr)(unsafe.Pointer(v140))++ *(*uint8)(unsafe.Pointer(v139)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v142 = envPtr2 + 152 v141 = *(*uintptr)(unsafe.Pointer(v142)) *(*uintptr)(unsafe.Pointer(v142))++ *(*uint8)(unsafe.Pointer(v141)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v143 = delta1 v144 = envPtr2 if v143 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v144)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v144)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v144)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v144)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v144 + 64)) += int64(v143) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v146 = envPtr2 + 152 v145 = *(*uintptr)(unsafe.Pointer(v146)) *(*uintptr)(unsafe.Pointer(v146))++ *(*uint8)(unsafe.Pointer(v145)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v148 = envPtr2 + 152 v147 = *(*uintptr)(unsafe.Pointer(v148)) *(*uintptr)(unsafe.Pointer(v148))++ *(*uint8)(unsafe.Pointer(v147)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(24)) v150 = envPtr2 + 152 v149 = *(*uintptr)(unsafe.Pointer(v150)) *(*uintptr)(unsafe.Pointer(v150))++ *(*uint8)(unsafe.Pointer(v149)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(16)) v152 = envPtr2 + 152 v151 = *(*uintptr)(unsafe.Pointer(v152)) *(*uintptr)(unsafe.Pointer(v152))++ *(*uint8)(unsafe.Pointer(v151)) = uint8(libc.Uint32FromInt32(_objIndexCopy5) >> libc.Int32FromInt32(8)) v154 = envPtr2 + 152 v153 = *(*uintptr)(unsafe.Pointer(v154)) *(*uintptr)(unsafe.Pointer(v154))++ *(*uint8)(unsafe.Pointer(v153)) = uint8(libc.Uint32FromInt32(_objIndexCopy5)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy5 } v155 = delta1 v156 = envPtr2 if v155 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v156)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v156)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v156)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v156)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v156 + 64)) += int64(v155) } } } else { XTclCompileSyntaxError(tls, interp, envPtr2) } XTcl_RestoreInterpState(tls, interp, save) convert = 0 } else { nodePtr = nodes + uintptr(next)*16 } } } } /* *---------------------------------------------------------------------- * * TclSingleOpCmd -- * * Implements the commands: ~, !, <<, >>, %, !=, ne, in, ni * in the ::tcl::mathop namespace. These commands have no * extension to arbitrary arguments; they accept only exactly one * or exactly two arguments as suitable for the operator. * * Results: * A standard Tcl return code and result left in interp. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclSingleOpCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var occdPtr uintptr var _ /* lexeme at bp+0 */ uint8 var _ /* litObjv at bp+40 */ uintptr var _ /* nodes at bp+4 */ [2]TOpNode _ = occdPtr occdPtr = clientData *(*uintptr)(unsafe.Pointer(bp + 40)) = objv + uintptr(1)*8 if objc != int32(1)+*(*int32)(unsafe.Pointer(occdPtr + 16)) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, (*TTclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fexpected) return int32(TCL_ERROR) } _ParseLexeme(tls, (*TTclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop, libc.Int64FromUint64(libc.Xstrlen(tls, (*TTclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop)), bp, libc.UintptrFromInt32(0)) (*(*[2]TOpNode)(unsafe.Pointer(bp + 4)))[0].Flexeme = uint8(START) (*(*[2]TOpNode)(unsafe.Pointer(bp + 4)))[0].Fmark = uint8(MARK_RIGHT) (*(*[2]TOpNode)(unsafe.Pointer(bp + 4)))[0].Fright = int32(1) (*(*[2]TOpNode)(unsafe.Pointer(bp + 4)))[int32(1)].Flexeme = *(*uint8)(unsafe.Pointer(bp)) if objc == int32(2) { (*(*[2]TOpNode)(unsafe.Pointer(bp + 4)))[int32(1)].Fmark = uint8(MARK_RIGHT) } else { (*(*[2]TOpNode)(unsafe.Pointer(bp + 4)))[int32(1)].Fmark = uint8(MARK_LEFT) (*(*[2]TOpNode)(unsafe.Pointer(bp + 4)))[int32(1)].Fleft = int32(OT_LITERAL) } (*(*[2]TOpNode)(unsafe.Pointer(bp + 4)))[int32(1)].Fright = int32(OT_LITERAL) *(*int32)(unsafe.Pointer(bp + 4 + 1*16 + 8)) = 0 return _ExecConstantExprTree(tls, interp, bp+4, 0, bp+40) } /* *---------------------------------------------------------------------- * * TclSortingOpCmd -- * Implements the commands: * <, <=, >, >=, ==, eq, lt, le, gt, ge * in the ::tcl::mathop namespace. These commands are defined for * arbitrary number of arguments by computing the AND of the base * operator applied to all neighbor argument pairs. * * Results: * A standard Tcl return code and result left in interp. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclSortingOpCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var code, i, lastAnd int32 var litObjv, nodes, occdPtr uintptr var _ /* lexeme at bp+0 */ uint8 var _ /* litObjPtrPtr at bp+8 */ uintptr _, _, _, _, _, _ = code, i, lastAnd, litObjv, nodes, occdPtr code = TCL_OK if objc < int32(3) { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(int32(1) != 0))) } else { occdPtr = clientData litObjv = XTclStackAlloc(tls, interp, libc.Uint64FromInt32(int32(2)*(objc-int32(2)))*uint64(8)) nodes = XTclStackAlloc(tls, interp, libc.Uint64FromInt32(int32(2)*(objc-int32(2)))*uint64(16)) lastAnd = int32(1) *(*uintptr)(unsafe.Pointer(bp + 8)) = litObjv _ParseLexeme(tls, (*TTclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop, libc.Int64FromUint64(libc.Xstrlen(tls, (*TTclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop)), bp, libc.UintptrFromInt32(0)) *(*uintptr)(unsafe.Pointer(litObjv)) = *(*uintptr)(unsafe.Pointer(objv + 1*8)) (*(*TOpNode)(unsafe.Pointer(nodes))).Flexeme = uint8(START) (*(*TOpNode)(unsafe.Pointer(nodes))).Fmark = uint8(MARK_RIGHT) i = int32(2) for { if !(i < objc-int32(1)) { break } *(*uintptr)(unsafe.Pointer(litObjv + uintptr(int32(2)*(i-int32(1))-int32(1))*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(i-int32(1))-int32(1))*16))).Flexeme = *(*uint8)(unsafe.Pointer(bp)) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(i-int32(1))-int32(1))*16))).Fmark = uint8(MARK_LEFT) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(i-int32(1))-int32(1))*16))).Fleft = int32(OT_LITERAL) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(i-int32(1))-int32(1))*16))).Fright = int32(OT_LITERAL) *(*uintptr)(unsafe.Pointer(litObjv + uintptr(int32(2)*(i-int32(1)))*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(i-int32(1)))*16))).Flexeme = uint8(AND) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(i-int32(1)))*16))).Fmark = uint8(MARK_LEFT) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(i-int32(1)))*16))).Fleft = lastAnd *(*int32)(unsafe.Pointer(nodes + uintptr(lastAnd)*16 + 8)) = int32(2) * (i - int32(1)) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(i-int32(1)))*16))).Fright = int32(2)*(i-int32(1)) + int32(1) *(*int32)(unsafe.Pointer(nodes + uintptr(int32(2)*(i-int32(1))+int32(1))*16 + 8)) = int32(2) * (i - int32(1)) lastAnd = int32(2) * (i - int32(1)) goto _1 _1: ; i++ } *(*uintptr)(unsafe.Pointer(litObjv + uintptr(int32(2)*(objc-int32(2))-int32(1))*8)) = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(objc-int32(2))-int32(1))*16))).Flexeme = *(*uint8)(unsafe.Pointer(bp)) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(objc-int32(2))-int32(1))*16))).Fmark = uint8(MARK_LEFT) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(objc-int32(2))-int32(1))*16))).Fleft = int32(OT_LITERAL) (*(*TOpNode)(unsafe.Pointer(nodes + uintptr(int32(2)*(objc-int32(2))-int32(1))*16))).Fright = int32(OT_LITERAL) (*(*TOpNode)(unsafe.Pointer(nodes))).Fright = lastAnd *(*int32)(unsafe.Pointer(nodes + uintptr(lastAnd)*16 + 8)) = 0 code = _ExecConstantExprTree(tls, interp, nodes, 0, bp+8) XTclStackFree(tls, interp, nodes) XTclStackFree(tls, interp, litObjv) } return code } /* *---------------------------------------------------------------------- * * TclVariadicOpCmd -- * Implements the commands: +, *, &, |, ^, ** * in the ::tcl::mathop namespace. These commands are defined for * arbitrary number of arguments by repeatedly applying the base * operator with suitable associative rules. When fewer than two * arguments are provided, suitable identity values are returned. * * Results: * A standard Tcl return code and result left in interp. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclVariadicOpCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var _objPtr, cachePtr, cachePtr1, cachePtr2, nodes1, occdPtr, v5 uintptr var code, decrMe, i, lastOp int32 var v1, v2, v3 bool var v4 TTcl_Size var _ /* lexeme at bp+0 */ uint8 var _ /* litObjPtrPtr at bp+56 */ uintptr var _ /* litObjv at bp+64 */ uintptr var _ /* litObjv at bp+8 */ [2]uintptr var _ /* nodes at bp+24 */ [2]TOpNode _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, cachePtr2, code, decrMe, i, lastOp, nodes1, occdPtr, v1, v2, v3, v4, v5 occdPtr = clientData if objc < int32(2) { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, int64(*(*int32)(unsafe.Pointer(occdPtr + 16))))) return TCL_OK } _ParseLexeme(tls, (*TTclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop, libc.Int64FromUint64(libc.Xstrlen(tls, (*TTclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fop)), bp, libc.UintptrFromInt32(0)) *(*uint8)(unsafe.Pointer(bp)) = uint8(int32(*(*uint8)(unsafe.Pointer(bp))) | int32(BINARY)) if objc == int32(2) { decrMe = 0 *(*uintptr)(unsafe.Pointer(bp + 56)) = bp + 8 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(EXPON) { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)] = XTclThreadAllocObj(tls) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)] = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)])).FinternalRep)) = int64(*(*int32)(unsafe.Pointer(occdPtr + 16))) (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)])).FrefCount++ decrMe = int32(1) (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0] = *(*uintptr)(unsafe.Pointer(objv + 1*8)) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[0].Flexeme = uint8(START) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[0].Fmark = uint8(MARK_RIGHT) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[0].Fright = int32(1) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[int32(1)].Flexeme = *(*uint8)(unsafe.Pointer(bp)) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[int32(1)].Fmark = uint8(MARK_LEFT) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[int32(1)].Fleft = int32(OT_LITERAL) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[int32(1)].Fright = int32(OT_LITERAL) *(*int32)(unsafe.Pointer(bp + 24 + 1*16 + 8)) = 0 } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(DIVIDE) { if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0] = XTclThreadAllocObj(tls) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0] = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0])).Fbytes = libc.UintptrFromInt32(0) *(*float64)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0])).FinternalRep)) = libc.Float64FromFloat64(1) (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0])).FtypePtr = uintptr(unsafe.Pointer(&XtclDoubleType)) } else { if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0] = XTclThreadAllocObj(tls) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0] = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0])).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0])).FinternalRep)) = int64(*(*int32)(unsafe.Pointer(occdPtr + 16))) (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0])).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[0])).FrefCount++ (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[int32(1)] = *(*uintptr)(unsafe.Pointer(objv + 1*8)) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[0].Flexeme = uint8(START) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[0].Fmark = uint8(MARK_RIGHT) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[0].Fright = int32(1) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[int32(1)].Flexeme = *(*uint8)(unsafe.Pointer(bp)) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[int32(1)].Fmark = uint8(MARK_LEFT) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[int32(1)].Fleft = int32(OT_LITERAL) (*(*[2]TOpNode)(unsafe.Pointer(bp + 24)))[int32(1)].Fright = int32(OT_LITERAL) *(*int32)(unsafe.Pointer(bp + 24 + 1*16 + 8)) = 0 } code = _ExecConstantExprTree(tls, interp, bp+24, 0, bp+56) _objPtr = (*(*[2]uintptr)(unsafe.Pointer(bp + 8)))[decrMe] v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } return code } else { *(*uintptr)(unsafe.Pointer(bp + 64)) = objv + uintptr(1)*8 nodes1 = XTclStackAlloc(tls, interp, libc.Uint64FromInt32(objc-libc.Int32FromInt32(1))*uint64(16)) lastOp = int32(OT_LITERAL) (*(*TOpNode)(unsafe.Pointer(nodes1))).Flexeme = uint8(START) (*(*TOpNode)(unsafe.Pointer(nodes1))).Fmark = uint8(MARK_RIGHT) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp))) == int32(EXPON) { i = objc - int32(2) for { if !(i > 0) { break } (*(*TOpNode)(unsafe.Pointer(nodes1 + uintptr(i)*16))).Flexeme = *(*uint8)(unsafe.Pointer(bp)) (*(*TOpNode)(unsafe.Pointer(nodes1 + uintptr(i)*16))).Fmark = uint8(MARK_LEFT) (*(*TOpNode)(unsafe.Pointer(nodes1 + uintptr(i)*16))).Fleft = int32(OT_LITERAL) (*(*TOpNode)(unsafe.Pointer(nodes1 + uintptr(i)*16))).Fright = lastOp if lastOp >= 0 { *(*int32)(unsafe.Pointer(nodes1 + uintptr(lastOp)*16 + 8)) = i } lastOp = i goto _6 _6: ; i-- } } else { i = int32(1) for { if !(i < objc-int32(1)) { break } (*(*TOpNode)(unsafe.Pointer(nodes1 + uintptr(i)*16))).Flexeme = *(*uint8)(unsafe.Pointer(bp)) (*(*TOpNode)(unsafe.Pointer(nodes1 + uintptr(i)*16))).Fmark = uint8(MARK_LEFT) (*(*TOpNode)(unsafe.Pointer(nodes1 + uintptr(i)*16))).Fleft = lastOp if lastOp >= 0 { *(*int32)(unsafe.Pointer(nodes1 + uintptr(lastOp)*16 + 8)) = i } (*(*TOpNode)(unsafe.Pointer(nodes1 + uintptr(i)*16))).Fright = int32(OT_LITERAL) lastOp = i goto _7 _7: ; i++ } } (*(*TOpNode)(unsafe.Pointer(nodes1))).Fright = lastOp *(*int32)(unsafe.Pointer(nodes1 + uintptr(lastOp)*16 + 8)) = 0 code = _ExecConstantExprTree(tls, interp, nodes1, 0, bp+64) XTclStackFree(tls, interp, nodes1) return code } return r } /* *---------------------------------------------------------------------- * * TclNoIdentOpCmd -- * Implements the commands: -, / * in the ::tcl::mathop namespace. These commands are defined for * arbitrary non-zero number of arguments by repeatedly applying the base * operator with suitable associative rules. When no arguments are * provided, an error is raised. * * Results: * A standard Tcl return code and result left in interp. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclNoIdentOpCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var occdPtr uintptr _ = occdPtr occdPtr = clientData if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, (*TTclOpCmdClientData)(unsafe.Pointer(occdPtr)).Fexpected) return int32(TCL_ERROR) } return XTclVariadicOpCmd(tls, clientData, interp, objc, objv) } const NUM_STATIC_POS = 20 func init() { p := unsafe.Pointer(&XtclByteCodeType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_FreeByteCodeInternalRep) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_DupByteCodeInternalRep) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_SetByteCodeFromAny) } /* * substCodeType provides the standard type management procedures for the * substcode type, which represents substitution within a Tcl value. */ var _substCodeType = TTcl_ObjType{ Fname: __ccgo_ts + 23867, } func init() { p := unsafe.Pointer(&_substCodeType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_FreeSubstCodeInternalRep) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_DupByteCodeInternalRep) } /* * Helper macros. */ /* *---------------------------------------------------------------------- * * TclSetByteCodeFromAny -- * * Part of the bytecode Tcl object type implementation. Attempts to * compile the string representation of the objPtr into bytecode. Accepts * a hook routine that is invoked to perform any needed post-processing on * the compilation results before generating byte codes. interp is the * compilation context and may not be NULL. * * Results: * A standard Tcl object result. If an error occurs during compilation, an * error message is left in the interpreter's result. * * Side effects: * Frees the old internal representation. If no error occurs, then the * compiled code is stored as "objPtr"s bytecode representation. Also, if * debugging, initializes the "tcl_traceCompile" Tcl variable used to * trace compilations. * *---------------------------------------------------------------------- */ func XTclSetByteCodeFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr, hookProc uintptr, clientData uintptr) (r int32) { bp := tls.Alloc(4576) defer tls.Free(4576) /* Hook procedure private data. */ var clLocPtr, iPtr, procPtr, stringPtr, v1, v2, v3, v5, v6, v7, v9 uintptr var delta1, result, v4, v8 int32 var _ /* compEnv at bp+0 */ TCompileEnv var _ /* length at bp+4544 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = clLocPtr, delta1, iPtr, procPtr, result, stringPtr, v1, v2, v3, v4, v5, v6, v7, v8, v9 iPtr = interp result = TCL_OK procPtr = (*TInterp)(unsafe.Pointer(iPtr)).FcompiledProcPtr if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 4544)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, objPtr, bp+4544) } stringPtr = v1 /* * TIP #280: Pick up the CmdFrame in which the BC compiler was invoked, and * use to initialize the tracking in the compiler. This information was * stored by TclCompEvalObj and ProcCompileProc. */ XTclInitCompileEnv(tls, interp, bp, stringPtr, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 4544))), (*TInterp)(unsafe.Pointer(iPtr)).FinvokeCmdFramePtr, (*TInterp)(unsafe.Pointer(iPtr)).FinvokeWord) /* * Make available to the compilation environment any data about invisible * continuation lines for the script. * * It is not clear if the script Tcl_Obj* can be free'd while the compiler * is using it, leading to the release of the associated ContLineLoc * structure as well. To ensure that the latter doesn't happen set a lock * on it, which is released in TclFreeCompileEnv(). The "lineCLPtr" * hashtable tclObj.c. */ clLocPtr = XTclContinuationsGet(tls, objPtr) if clLocPtr != 0 { (*(*TCompileEnv)(unsafe.Pointer(bp))).FclNext = clLocPtr + 8 } XTclCompileScript(tls, interp, stringPtr, *(*TTcl_Size)(unsafe.Pointer(bp + 4544)), bp) /* * Compilation succeeded. Add a "done" instruction at the end. */ if (*TCompileEnv)(unsafe.Pointer(bp)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(bp)).FcodeEnd { XTclExpandCodeArray(tls, bp) } v3 = bp + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_DONE)) if (*TCompileEnv)(unsafe.Pointer(bp)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(bp)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DONE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v4 = delta1 v5 = bp if v4 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v5)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v5)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v5)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v5)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v5 + 64)) += int64(v4) } /* * Check for optimizations! * * If the generated code is free of most hazards, recompile with generation * of INST_START_CMD disabled to produce code that more compact in many * cases, and also sometimes more performant. */ if XTcl_GetParent(tls, interp) == libc.UintptrFromInt32(0) && !(XTcl_LimitTypeEnabled(tls, interp, libc.Int32FromInt32(TCL_LIMIT_COMMANDS)|libc.Int32FromInt32(TCL_LIMIT_TIME)) != 0) && _IsCompactibleCompileEnv(tls, bp) != 0 { XTclFreeCompileEnv(tls, bp) (*TInterp)(unsafe.Pointer(iPtr)).FcompiledProcPtr = procPtr XTclInitCompileEnv(tls, interp, bp, stringPtr, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 4544))), (*TInterp)(unsafe.Pointer(iPtr)).FinvokeCmdFramePtr, (*TInterp)(unsafe.Pointer(iPtr)).FinvokeWord) if clLocPtr != 0 { (*(*TCompileEnv)(unsafe.Pointer(bp))).FclNext = clLocPtr + 8 } (*(*TCompileEnv)(unsafe.Pointer(bp))).FatCmdStart = int32(2) /* The disabling magic. */ XTclCompileScript(tls, interp, stringPtr, *(*TTcl_Size)(unsafe.Pointer(bp + 4544)), bp) if (*TCompileEnv)(unsafe.Pointer(bp)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(bp)).FcodeEnd { XTclExpandCodeArray(tls, bp) } v7 = bp + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(INST_DONE)) if (*TCompileEnv)(unsafe.Pointer(bp)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(bp)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DONE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v8 = delta1 v9 = bp if v8 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v9 + 64)) += int64(v8) } } /* * Apply some peephole optimizations that can cross specific/generic * instruction generator boundaries. */ if (*TInterp)(unsafe.Pointer(iPtr)).Foptimizer != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TInterp)(unsafe.Pointer(iPtr)).Foptimizer})))(tls, bp) } /* * Invoke the compilation hook procedure if there is one. */ if hookProc != 0 { result = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{hookProc})))(tls, interp, bp, clientData) } /* * After optimization is all done, check that byte code length limits * are not exceeded. Bug [27b3ce2997]. */ if int64((*(*TCompileEnv)(unsafe.Pointer(bp))).FcodeNext)-int64((*(*TCompileEnv)(unsafe.Pointer(bp))).FcodeStart) > int64(INT_MAX) { /* * Cannot just return TCL_ERROR as callers ignore return value. * TODO - May be use TclCompileSyntaxError here? */ XTcl_Panic(tls, __ccgo_ts+23877, libc.VaList(bp+4560, int32(INT_MAX))) } /* * Change the object into a ByteCode object. Ownership of the literal * objects and aux data items passes to the ByteCode object. */ if result == TCL_OK { XTclInitByteCodeObj(tls, objPtr, uintptr(unsafe.Pointer(&XtclByteCodeType)), bp) _ = objPtr } XTclFreeCompileEnv(tls, bp) return result } /* *----------------------------------------------------------------------- * * SetByteCodeFromAny -- * * Part of the bytecode Tcl object type implementation. Attempts to * generate an byte code internal form for the Tcl object "objPtr" by * compiling its string representation. * * Results: * A standard Tcl object result. If an error occurs during compilation and * "interp" is not null, an error message is left in the interpreter's * result. * * Side effects: * Frees the old internal representation. If no error occurs then the * compiled code is stored as "objPtr"s bytecode representation. Also, if * debugging, initializes the "tcl_traceCompile" Tcl variable used to * trace compilations. * *---------------------------------------------------------------------- */ func _SetByteCodeFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) (r int32) { /* The object to compile to bytecode */ if interp == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } return XTclSetByteCodeFromAny(tls, interp, objPtr, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0)) } /* *---------------------------------------------------------------------- * * DupByteCodeInternalRep -- * * Part of the bytecode Tcl object type implementation. However, it does * not copy the internal representation of a bytecode Tcl_Obj, instead * assigning NULL to the type pointer of the new object. Code is compiled * for the new object only if necessary. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _DupByteCodeInternalRep(tls *libc.TLS, dummy966 uintptr, dummy967 uintptr) { return } /* *---------------------------------------------------------------------- * * FreeByteCodeInternalRep -- * * Part of the bytecode Tcl object type implementation. Frees the storage * associated with a bytecode object's internal representation unless its * code is actively being executed. * * Results: * None. * * Side effects: * The bytecode object's internal rep is invalidated and its code is freed * unless the code is actively being executed, in which case cleanup is * delayed until the last execution of the code completes. * *---------------------------------------------------------------------- */ func _FreeByteCodeInternalRep(tls *libc.TLS, objPtr uintptr) { /* Object whose internal rep to free. */ var codePtr, irPtr, v1, v2 uintptr _, _, _, _ = codePtr, irPtr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteCodeType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } codePtr = v2 XTclReleaseByteCode(tls, codePtr) } /* *---------------------------------------------------------------------- * * TclReleaseByteCode -- * * Does all the real work of freeing up a bytecode object's ByteCode * structure. Called only when the structure's reference count * is zero. * * Results: * None. * * Side effects: * Frees objPtr's bytecode internal representation and sets its type to * NULL. Also releases its literals and frees its auxiliary data items. * *---------------------------------------------------------------------- */ func XTclPreserveByteCode(tls *libc.TLS, codePtr uintptr) { (*TByteCode)(unsafe.Pointer(codePtr)).FrefCount++ } func XTclReleaseByteCode(tls *libc.TLS, codePtr uintptr) { var v1 TTcl_Size var v2 uintptr _, _ = v1, v2 v2 = codePtr + 32 v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 > int64(1) { return } /* Just dropped to refcount==0. Clean up. */ _CleanupByteCode(tls, codePtr) } func _CleanupByteCode(tls *libc.TLS, codePtr uintptr) { /* Points to the ByteCode to free. */ var _objPtr, auxDataPtr, hePtr, iPtr, interp, objArrayPtr, objPtr, v3, v5, v8 uintptr var i, numAuxDataItems, numLitObjects, v4 int32 var v2, v7 TTcl_Size var v9 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, auxDataPtr, hePtr, i, iPtr, interp, numAuxDataItems, numLitObjects, objArrayPtr, objPtr, v2, v3, v4, v5, v7, v8, v9 interp = *(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) iPtr = interp numLitObjects = int32((*TByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects) numAuxDataItems = int32((*TByteCode)(unsafe.Pointer(codePtr)).FnumAuxDataItems) /* * A single heap object holds the ByteCode structure and its code, object, * command location, and auxiliary data arrays. This means we only need to * 1) decrement the ref counts of each LiteralEntry in the literal array, * 2) call the free procedures for the auxiliary data items, 3) free the * localCache if it is unused, and finally 4) free the ByteCode * structure's heap object. * * The case for TCL_BYTECODE_PRECOMPILED (precompiled ByteCodes, like * those generated from tbcload) is special, as they doesn't make use of * the global literal table. They instead maintain private references to * their literals which must be decremented. * * In order to ensure proper and efficient cleanup of the literal array * when it contains non-shared literals [Bug 983660], distinguish the case * of an interpreter being deleted, which is signaled by interp == NULL. * Also, as the interp deletion will remove the global literal table * anyway, avoid the extra cost of updating it for each literal being * released. */ if (*TByteCode)(unsafe.Pointer(codePtr)).Fflags&uint32(TCL_BYTECODE_PRECOMPILED) != 0 { objArrayPtr = (*TByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr i = 0 for { if !(i < numLitObjects) { break } objPtr = *(*uintptr)(unsafe.Pointer(objArrayPtr)) if objPtr != 0 { _objPtr = objPtr v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } } objArrayPtr += 8 goto _1 _1: ; i++ } (*TByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects = 0 } else { objArrayPtr = (*TByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr for { v4 = numLitObjects numLitObjects-- if !(v4 != 0) { break } /* TclReleaseLiteral calls Tcl_DecrRefCount() for us */ v5 = objArrayPtr objArrayPtr += 8 XTclReleaseLiteral(tls, interp, *(*uintptr)(unsafe.Pointer(v5))) } } auxDataPtr = (*TByteCode)(unsafe.Pointer(codePtr)).FauxDataArrayPtr i = 0 for { if !(i < numAuxDataItems) { break } if (*TAuxDataType)(unsafe.Pointer((*TAuxData)(unsafe.Pointer(auxDataPtr)).Ftype1)).FfreeProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TAuxDataType)(unsafe.Pointer((*TAuxData)(unsafe.Pointer(auxDataPtr)).Ftype1)).FfreeProc})))(tls, (*TAuxData)(unsafe.Pointer(auxDataPtr)).FclientData) } auxDataPtr += 16 goto _6 _6: ; i++ } /* * TIP #280. Release the location data associated with this bytecode * structure, if any. The associated interp may be gone already, and the * data with it. * * See also tclBasic.c, DeleteInterpProc */ if iPtr != 0 { hePtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr)).FfindProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr, codePtr) if hePtr != 0 { _ReleaseCmdWordData(tls, (*TTcl_HashEntry)(unsafe.Pointer(hePtr)).FclientData) XTcl_DeleteHashEntry(tls, hePtr) } } if v9 = (*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr != 0; v9 { v8 = (*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- } if v9 && v7 <= int64(1) { XTclFreeLocalCache(tls, interp, (*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr) } XTclHandleRelease(tls, (*TByteCode)(unsafe.Pointer(codePtr)).FinterpHandle) XTclpFree(tls, codePtr) } /* * --------------------------------------------------------------------- * * IsCompactibleCompileEnv -- * * Determines whether some basic compaction optimizations may be applied * to a piece of bytecode. Idempotent. * * --------------------------------------------------------------------- */ func _IsCompactibleCompileEnv(tls *libc.TLS, envPtr uintptr) (r int32) { var nsPtr, pc uintptr var size int32 _, _, _ = nsPtr, pc, size /* * Special: procedures in the '::tcl' namespace (or its children) are * considered to be well-behaved, so compaction can be applied to them even * if it would otherwise be invalid. */ if (*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != libc.UintptrFromInt32(0) && (*TProc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr)).FcmdPtr != libc.UintptrFromInt32(0) && (*TCommand1)(unsafe.Pointer((*TProc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr)).FcmdPtr)).FnsPtr != libc.UintptrFromInt32(0) { nsPtr = (*TCommand1)(unsafe.Pointer((*TProc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr)).FcmdPtr)).FnsPtr if libc.Xstrcmp(tls, (*TNamespace)(unsafe.Pointer(nsPtr)).FfullName, __ccgo_ts+23915) == 0 || libc.Xstrncmp(tls, (*TNamespace)(unsafe.Pointer(nsPtr)).FfullName, __ccgo_ts+23921, uint64(7)) == 0 { return int32(1) } } /* * Go through and ensure that no operation involved can cause a desired * change of bytecode sequence during its execution. This comes down to * ensuring that there are no mapped variables (due to traces) or calls to * external commands (traces, [uplevel] trickery). This is actually a very * conservative check. It turns down a lot of code that is OK in practice. */ pc = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart for { if !(pc < (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) { break } switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(pc))) { /* Invokes */ case int32(INST_INVOKE_STK1): fallthrough case int32(INST_INVOKE_STK4): fallthrough case int32(INST_INVOKE_EXPANDED): fallthrough case int32(INST_INVOKE_REPLACE): return 0 /* Runtime evals */ fallthrough case int32(INST_EVAL_STK): fallthrough case int32(INST_EXPR_STK): fallthrough case int32(INST_YIELD): return 0 /* Upvars */ fallthrough case int32(INST_UPVAR): fallthrough case int32(INST_NSUPVAR): fallthrough case int32(INST_VARIABLE): return 0 default: size = int32(XtclInstructionTable[*(*uint8)(unsafe.Pointer(pc))].FnumBytes) break } goto _1 _1: ; pc += uintptr(size) } return int32(1) } /* *---------------------------------------------------------------------- * * Tcl_SubstObj -- * * Performs substitutions on the given string as described in the user * documentation for "subst". * * Results: * A Tcl_Obj* containing the substituted string, or NULL to indicate that * an error occurred. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func XTcl_SubstObj(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) (r uintptr) { /* What substitutions to do. */ var rootPtr uintptr _ = rootPtr rootPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr if XTclNRRunCallbacks(tls, interp, XTcl_NRSubstObj(tls, interp, objPtr, flags), rootPtr) != TCL_OK { return libc.UintptrFromInt32(0) } return XTcl_GetObjResult(tls, interp) } /* *---------------------------------------------------------------------- * * Tcl_NRSubstObj -- * * Adds substitution within the value of objPtr to the NR execution stack. * * Results: * TCL_OK. * * Side effects: * Compiles objPtr into bytecode that performs the substitutions as * governed by flags, adds a callback to the NR execution stack to execute * the bytecode and store the result in the interp. * *---------------------------------------------------------------------- */ func XTcl_NRSubstObj(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) (r int32) { var codePtr uintptr _ = codePtr codePtr = _CompileSubstObj(tls, interp, objPtr, flags) /* TODO: Confirm we do not need this. */ /* Tcl_ResetResult(interp); */ return XTclNRExecuteByteCode(tls, interp, codePtr) } /* *---------------------------------------------------------------------- * * CompileSubstObj -- * * Compiles a value into bytecode that performs substitution within the * value, as governed by flags. * * Results: * A (ByteCode *) is pointing to the resulting ByteCode. * * Side effects: * The Tcl_ObjType of objPtr is changed to the "substcode" type, and the * ByteCode and governing flags value are kept in the internal rep for * faster operations the next time CompileSubstObj is called on the same * value. * *---------------------------------------------------------------------- */ func _CompileSubstObj(tls *libc.TLS, interp uintptr, objPtr uintptr, flags int32) (r uintptr) { bp := tls.Alloc(4560) defer tls.Free(4560) var bytes, codePtr, iPtr, irPtr, nsPtr, v1, v2, v3, v4, v5, v7 uintptr var delta1, v6 int32 var _ /* compEnv at bp+0 */ TCompileEnv var _ /* numBytes at bp+4544 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _ = bytes, codePtr, delta1, iPtr, irPtr, nsPtr, v1, v2, v3, v4, v5, v6, v7 iPtr = interp codePtr = libc.UintptrFromInt32(0) if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_substCodeType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } codePtr = v2 if codePtr != libc.UintptrFromInt32(0) { nsPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FnsPtr if int64(flags) != int64((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2) || *(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) != iPtr || (*TByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch != (*TInterp)(unsafe.Pointer(iPtr)).FcompileEpoch || (*TByteCode)(unsafe.Pointer(codePtr)).FnsPtr != nsPtr || (*TByteCode)(unsafe.Pointer(codePtr)).FnsEpoch != (*TNamespace)(unsafe.Pointer(nsPtr)).FresolverEpoch || (*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr != (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr { XTcl_StoreInternalRep(tls, objPtr, uintptr(unsafe.Pointer(&_substCodeType)), libc.UintptrFromInt32(0)) codePtr = libc.UintptrFromInt32(0) } } if codePtr == libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 4544)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v3 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, objPtr, bp+4544) } bytes = v3 /* TODO: Check for more TIP 280 */ XTclInitCompileEnv(tls, interp, bp, bytes, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 4544))), libc.UintptrFromInt32(0), 0) XTclSubstCompile(tls, interp, bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 4544)), flags, int64(1), bp) if (*TCompileEnv)(unsafe.Pointer(bp)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(bp)).FcodeEnd { XTclExpandCodeArray(tls, bp) } v5 = bp + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = libc.Uint8FromInt32(int32(INST_DONE)) if (*TCompileEnv)(unsafe.Pointer(bp)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(bp)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_DONE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v6 = delta1 v7 = bp if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } codePtr = XTclInitByteCodeObj(tls, objPtr, uintptr(unsafe.Pointer(&_substCodeType)), bp) XTclFreeCompileEnv(tls, bp) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2 = uintptr(int64(flags)) if (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr != 0 { (*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FvarFramePtr)).FlocalCachePtr (*TLocalCache)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr)).FrefCount++ } _ = objPtr } return codePtr } /* *---------------------------------------------------------------------- * * FreeSubstCodeInternalRep -- * * Part of the "substcode" Tcl object type implementation. Frees the * storage associated with the substcode internal representation of a * Tcl_Obj unless its code is actively being executed. * * Results: * None. * * Side effects: * The substcode object's internal rep is marked invalid and its code * gets freed unless the code is actively being executed. In that case * the cleanup is delayed until the last execution of the code completes. * *---------------------------------------------------------------------- */ func _FreeSubstCodeInternalRep(tls *libc.TLS, objPtr uintptr) { /* Object whose internal rep to free. */ var codePtr, irPtr, v1, v2 uintptr _, _, _, _ = codePtr, irPtr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_substCodeType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } codePtr = v2 XTclReleaseByteCode(tls, codePtr) } func _ReleaseCmdWordData(tls *libc.TLS, eclPtr uintptr) { var _objPtr, v2 uintptr var i, v1 TTcl_Size _, _, _, _ = _objPtr, i, v1, v2 if (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { _objPtr = (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fpath v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } i = 0 for { if !(i < (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc) { break } XTclpFree(tls, (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(i)*32))).Fline) goto _3 _3: ; i++ } if (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc != libc.UintptrFromInt32(0) { XTclpFree(tls, (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc) } XTclpFree(tls, eclPtr) } /* *---------------------------------------------------------------------- * * TclInitCompileEnv -- * * Initializes a CompileEnv compilation environment structure for the * compilation of a string in an interpreter. * * Results: * None. * * Side effects: * The CompileEnv structure is initialized. * *---------------------------------------------------------------------- */ func XTclInitCompileEnv(tls *libc.TLS, interp uintptr, envPtr uintptr, stringPtr uintptr, numBytes Tsize_t, invoker uintptr, word int32) { /* Index of the word in that context getting * compiled */ var _objPtr, cachePtr, cachePtr1, ctxPtr, iPtr, norm, v6 uintptr var pc, v3, v4 int32 var v1, v2 bool var v5 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, ctxPtr, iPtr, norm, pc, v1, v2, v3, v4, v5, v6 iPtr = interp (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr = iPtr (*TCompileEnv)(unsafe.Pointer(envPtr)).Fsource = stringPtr (*TCompileEnv)(unsafe.Pointer(envPtr)).FnumSrcBytes = libc.Int64FromUint64(numBytes) (*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr = (*TInterp)(unsafe.Pointer(iPtr)).FcompiledProcPtr (*TInterp)(unsafe.Pointer(iPtr)).FcompiledProcPtr = libc.UintptrFromInt32(0) (*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = 0 XTclInitLiteralTable(tls, envPtr+72) (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart = envPtr + 288 (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(COMPILEENV_INIT_CODE_BYTES) (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedCodeArray = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr = envPtr + 544 (*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayEnd = int64(COMPILEENV_INIT_NUM_OBJECTS) (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedLiteralArray = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr = envPtr + 2464 (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr = envPtr + 2744 (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayEnd = int64(COMPILEENV_INIT_EXCEPT_RANGES) (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedExceptArray = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr = envPtr + 3144 (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd = int64(COMPILEENV_INIT_CMD_MAP_SIZE) (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedCmdMap = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FatCmdStart = int32(1) (*TCompileEnv)(unsafe.Pointer(envPtr)).FexpandCount = 0 /* * TIP #280: Set up the extended command location information, based on * the context invoking the byte code compiler. This structure is used to * keep the per-word line information for all compiled commands. * * See also tclBasic.c, TclEvalObjEx, for the equivalent code in the * non-compiling evaluator */ (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr = XTcl_Alloc(tls, uint64(48)) (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Floc = libc.UintptrFromInt32(0) (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fnloc = 0 (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fnuloc = 0 (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = libc.UintptrFromInt32(0) if invoker == libc.UintptrFromInt32(0) { /* * Initialize the compiler for relative counting in case of a * dynamic context. */ (*TCompileEnv)(unsafe.Pointer(envPtr)).Fline = int64(1) if (*TInterp)(unsafe.Pointer(iPtr)).FevalFlags&int32(TCL_EVAL_FILE) != 0 { *(*int32)(unsafe.Pointer(iPtr + 256)) &= ^libc.Int32FromInt32(TCL_EVAL_FILE) (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Ftype1 = int32(TCL_LOCATION_SOURCE) if (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile != 0 { /* * Normalization here, to have the correct pwd. Should have * negligible impact on performance, as the norm should have * been done already by the 'source' invoking us, and it * caches the result. */ norm = XTcl_FSGetNormalizedPath(tls, interp, (*TInterp)(unsafe.Pointer(iPtr)).FscriptFile) if norm == libc.UintptrFromInt32(0) { /* * Error message in the interp result. No place to put it. * And no place to serve the error itself to either. Fake * a path, empty string. */ if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = XTclThreadAllocObj(tls) } else { (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FrefCount = 0 if libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes, __ccgo_ts+1945, libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes + uintptr(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FtypePtr = libc.UintptrFromInt32(0) } else { (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = norm } } else { if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = XTclThreadAllocObj(tls) } else { (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FrefCount = 0 if libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes, __ccgo_ts+1945, libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Fbytes + uintptr(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FtypePtr = libc.UintptrFromInt32(0) } (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FrefCount++ } else { if (*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != 0 { v3 = int32(TCL_LOCATION_PROC) } else { v3 = int32(TCL_LOCATION_BC) } (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Ftype1 = v3 } } else { /* * Initialize the compiler using the context, making counting absolute * to that context. Note that the context can be byte code execution. * In that case we have to fill out the missing pieces (line, path, * ...) which may make change the type as well. */ ctxPtr = XTclStackAlloc(tls, interp, uint64(88)) pc = 0 *(*TCmdFrame)(unsafe.Pointer(ctxPtr)) = *(*TCmdFrame)(unsafe.Pointer(invoker)) if (*TCmdFrame)(unsafe.Pointer(invoker)).Ftype1 == int32(TCL_LOCATION_BC) { /* * Note: Type BC => ctx.data.eval.path is not used. * ctx.data.tebc.codePtr is used instead. */ XTclGetSrcInfoForPc(tls, ctxPtr) pc = int32(1) } if (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fnline <= int64(word) || *(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(word)*8)) < 0 { /* * Word is not a literal, relative counting. */ (*TCompileEnv)(unsafe.Pointer(envPtr)).Fline = int64(1) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr != 0 { v4 = int32(TCL_LOCATION_PROC) } else { v4 = int32(TCL_LOCATION_BC) } (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Ftype1 = v4 if pc != 0 && (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { /* * The reference made by 'TclGetSrcInfoForPc' is dead. */ _objPtr = (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fdata.Feval.Fpath v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } else { (*TCompileEnv)(unsafe.Pointer(envPtr)).Fline = *(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fline + uintptr(word)*8)) (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Ftype1 = (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Ftype1 if (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath = (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fdata.Feval.Fpath if pc != 0 { /* * The reference 'TclGetSrcInfoForPc' made is transfered. */ (*TCmdFrame)(unsafe.Pointer(ctxPtr)).Fdata.Feval.Fpath = libc.UintptrFromInt32(0) } else { /* * We have a new reference here. */ (*TTcl_Obj)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fpath)).FrefCount++ } } } XTclStackFree(tls, interp, ctxPtr) } (*TExtCmdLoc)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr)).Fstart = (*TCompileEnv)(unsafe.Pointer(envPtr)).Fline /* * Initialize the data about invisible continuation lines as empty, i.e. * not used. The caller (TclSetByteCodeFromAny) will set this up, if such * data is available. */ (*TCompileEnv)(unsafe.Pointer(envPtr)).FclNext = libc.UintptrFromInt32(0) (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr = envPtr + 4424 (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext = 0 (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayEnd = int64(COMPILEENV_INIT_AUX_DATA_SIZE) (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedAuxDataArray = 0 } /* *---------------------------------------------------------------------- * * TclFreeCompileEnv -- * * Frees the storage allocated in a CompileEnv compilation environment * structure. * * Results: * None. * * Side effects: * Allocated storage in the CompileEnv structure is freed, although its * local literal table is not deleted and its literal objects are not * released. In addition, storage referenced by its auxiliary data items * is not freed. This is done so that, when compilation is successful, * "ownership" of these objects and aux data items is handed over to the * corresponding ByteCode structure. * *---------------------------------------------------------------------- */ func XTclFreeCompileEnv(tls *libc.TLS, envPtr uintptr) { /* Points to the CompileEnv structure. */ var auxDataPtr, entryPtr uintptr var i TTcl_Size _, _, _ = auxDataPtr, entryPtr, i if (*TCompileEnv)(unsafe.Pointer(envPtr)).FlocalLitTable.Fbuckets != envPtr+72+8 { XTclpFree(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FlocalLitTable.Fbuckets) (*TCompileEnv)(unsafe.Pointer(envPtr)).FlocalLitTable.Fbuckets = envPtr + 72 + 8 } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr != 0 { entryPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr auxDataPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr i = 0 for { if !(i < (*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext) { break } XTclReleaseLiteral(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr, (*TLiteralEntry)(unsafe.Pointer(entryPtr)).FobjPtr) entryPtr += 32 goto _1 _1: ; i++ } i = 0 for { if !(i < (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext) { break } if (*TAuxDataType)(unsafe.Pointer((*TAuxData)(unsafe.Pointer(auxDataPtr)).Ftype1)).FfreeProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TAuxDataType)(unsafe.Pointer((*TAuxData)(unsafe.Pointer(auxDataPtr)).Ftype1)).FfreeProc})))(tls, (*TAuxData)(unsafe.Pointer(auxDataPtr)).FclientData) } auxDataPtr += 16 goto _2 _2: ; i++ } } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedCodeArray != 0 { XTclpFree(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart) } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedLiteralArray != 0 { XTclpFree(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr) } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedExceptArray != 0 { XTclpFree(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr) XTclpFree(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr) } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedCmdMap != 0 { XTclpFree(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr) } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedAuxDataArray != 0 { XTclpFree(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr) } if (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr != 0 { _ReleaseCmdWordData(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr) (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr = libc.UintptrFromInt32(0) } } /* *---------------------------------------------------------------------- * * TclWordKnownAtCompileTime -- * * Determines whether the value of a token is completely known at compile * time. * * Results: * True if the tokenPtr argument points to a word value that is * completely known at compile time. Generally, values that are known at * compile time can be compiled to their values, while values that cannot * be known until substitution at runtime must be compiled to bytecode * instructions that perform that substitution. For several commands, * whether or not arguments are known at compile time determine whether * it is worthwhile to compile at all. * * Side effects: * When returning true, appends the known value of the word to the * unshared Tcl_Obj (*valuePtr), unless valuePtr is NULL. * *---------------------------------------------------------------------- */ func XTclWordKnownAtCompileTime(tls *libc.TLS, tokenPtr uintptr, valuePtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* If not NULL, points to an unshared Tcl_Obj * to which we should append the known value * of the word. */ var _objPtr, _objPtr1, cachePtr, tempPtr, v4, v6 uintptr var length Tsize_t var numComponents, v2 int32 var v1 bool var v3, v5 TTcl_Size var _ /* utfBuf at bp+0 */ [4]uint8 _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, length, numComponents, tempPtr, v1, v2, v3, v4, v5, v6 numComponents = int32((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents) tempPtr = libc.UintptrFromInt32(0) if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { if valuePtr != libc.UintptrFromInt32(0) { XTcl_AppendToObj(tls, valuePtr, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize) } return int32(1) } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_WORD) { return 0 } tokenPtr += 32 if valuePtr != libc.UintptrFromInt32(0) { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { tempPtr = XTclThreadAllocObj(tls) } else { tempPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tempPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(tempPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(tempPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(tempPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(tempPtr)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(tempPtr)).FrefCount++ } for { v2 = numComponents numComponents-- if !(v2 != 0) { break } switch (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 { case int32(TCL_TOKEN_TEXT): if tempPtr != libc.UintptrFromInt32(0) { XTcl_AppendToObj(tls, tempPtr, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize) } case int32(TCL_TOKEN_BS): if tempPtr != libc.UintptrFromInt32(0) { *(*[4]uint8)(unsafe.Pointer(bp)) = [4]uint8{} length = libc.Uint64FromInt32(XTclParseBackslash(tls, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, libc.UintptrFromInt32(0), bp)) XTcl_AppendToObj(tls, tempPtr, bp, libc.Int64FromUint64(length)) } default: if tempPtr != libc.UintptrFromInt32(0) { _objPtr = tempPtr v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return 0 } tokenPtr += 32 } if valuePtr != libc.UintptrFromInt32(0) { XTcl_AppendObjToObj(tls, valuePtr, tempPtr) _objPtr1 = tempPtr v6 = _objPtr1 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } return int32(1) } /* *---------------------------------------------------------------------- * * TclCompileScript -- * * Compiles a Tcl script in a string. * * Results: * * A standard Tcl result. If an error occurs, an * error message is left in the interpreter's result. * * Side effects: * Adds instructions to envPtr to evaluate the script at runtime. * *---------------------------------------------------------------------- */ func _ExpandRequested(tls *libc.TLS, tokenPtr uintptr, numWords Tsize_t) (r int32) { var v1 Tsize_t _ = v1 /* Determine whether any words of the command require expansion */ for { v1 = numWords numWords-- if !(v1 != 0) { break } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_EXPAND_WORD) { return int32(1) } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } return 0 } func _CompileCmdLiteral(tls *libc.TLS, interp uintptr, cmdObj uintptr, envPtr2 uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objIndexCopy, cmdLitIdx, delta1, extraLiteralFlags, v18, v6 int32 var bytes, cmdPtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v3, v4, v5, v7, v8, v9 uintptr var _ /* length at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, bytes, cmdLitIdx, cmdPtr, delta1, extraLiteralFlags, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v3, v4, v5, v6, v7, v8, v9 extraLiteralFlags = int32(LITERAL_CMD_NAME) cmdPtr = XTcl_GetCommandFromObj(tls, interp, cmdObj) if cmdPtr != libc.UintptrFromInt32(0) && (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_VIA_RESOLVER) != 0 { extraLiteralFlags |= int32(LITERAL_UNSHARED) } if (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Flength v1 = (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, cmdObj, bp) } bytes = v1 cmdLitIdx = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp)), extraLiteralFlags) if cmdPtr != 0 && (*TCommand)(unsafe.Pointer(cmdPtr)).FhPtr != libc.UintptrFromInt32(0) { XTclSetCmdNameObj(tls, interp, XTclFetchLiteral(tls, envPtr2, int64(cmdLitIdx)), cmdPtr) } _objIndexCopy = cmdLitIdx if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } func XTclCompileInvocation(tls *libc.TLS, interp uintptr, tokenPtr uintptr, cmdObj uintptr, numWords Tsize_t, envPtr3 uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var _objIndexCopy, delta1, depth1, objIdx, v18, v6 int32 var eclIndex TTcl_Size var mapPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v21, v3, v4, v5, v7, v8, v9 uintptr var wordIdx, v20 Tsize_t _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, depth1, eclIndex, mapPtr, objIdx, wordIdx, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) wordIdx = uint64(0) depth1 = int32((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) if cmdObj != 0 { _CompileCmdLiteral(tls, interp, cmdObj, envPtr3) wordIdx = uint64(1) tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } for { if !(wordIdx < numWords) { break } (*TCompileEnv)(unsafe.Pointer(envPtr3)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(wordIdx)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(wordIdx)*8)) if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr3) goto _1 } objIdx = XTclRegisterLiteral(tls, envPtr3, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext != 0 { XTclContinuationsEnterDerived(tls, XTclFetchLiteral(tls, envPtr3, int64(objIdx)), int64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).Fsource), (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext) } _objIndexCopy = objIdx if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v3 = envPtr3 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr3 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr3 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v9 = envPtr3 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr3 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr3 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr3 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr3 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr3 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } goto _1 _1: ; wordIdx++ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } if wordIdx <= uint64(255) { XTclEmitInvoke(tls, envPtr3, int32(INST_INVOKE_STK1), libc.VaList(bp+8, wordIdx)) } else { XTclEmitInvoke(tls, envPtr3, int32(INST_INVOKE_STK4), libc.VaList(bp+8, wordIdx)) } v20 = libc.Uint64FromInt32(depth1 + int32(1)) v21 = envPtr3 if v20 != libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth) { XTcl_Panic(tls, __ccgo_ts+21474, libc.VaList(bp+8, libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v21)).FcurrStackDepth), v20)) } } func _CompileExpanded(tls *libc.TLS, interp uintptr, tokenPtr uintptr, cmdObj uintptr, numWords int32, envPtr3 uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var _objIndexCopy, delta1, depth1, objIdx, wordIdx, v12, v18, v30 int32 var eclIndex TTcl_Size var mapPtr, v10, v11, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v31, v33, v4, v5, v6, v7, v8, v9 uintptr var v32 Tsize_t _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, depth1, eclIndex, mapPtr, objIdx, wordIdx, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) wordIdx = 0 depth1 = int32((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) _StartExpanding(tls, envPtr3) if cmdObj != 0 { _CompileCmdLiteral(tls, interp, cmdObj, envPtr3) wordIdx = int32(1) tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } for { if !(wordIdx < numWords) { break } (*TCompileEnv)(unsafe.Pointer(envPtr3)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(wordIdx)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(wordIdx)*8)) if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr3) if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_EXPAND_WORD) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v3 = envPtr3 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_EXPAND_STKTOP)) v5 = envPtr3 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) >> libc.Int32FromInt32(24)) v7 = envPtr3 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = uint8(libc.Uint32FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) >> libc.Int32FromInt32(16)) v9 = envPtr3 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) >> libc.Int32FromInt32(8)) v11 = envPtr3 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EXPAND_STKTOP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) } v12 = delta1 v13 = envPtr3 if v12 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v13 + 64)) += int64(v12) } } goto _1 } objIdx = XTclRegisterLiteral(tls, envPtr3, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, 0) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext != 0 { XTclContinuationsEnterDerived(tls, XTclFetchLiteral(tls, envPtr3, int64(objIdx)), int64((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).Fsource), (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext) } _objIndexCopy = objIdx if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v15 = envPtr3 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v17 = envPtr3 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr3 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v21 = envPtr3 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v23 = envPtr3 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v25 = envPtr3 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v27 = envPtr3 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v29 = envPtr3 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v30 = delta1 v31 = envPtr3 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } } goto _1 _1: ; wordIdx++ tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } /* * The stack depth during argument expansion can only be managed at * runtime, as the number of elements in the expanded lists is not known * at compile time. Adjust the stack depth estimate here so that it is * correct after the command with expanded arguments returns. * * The end effect of this command's invocation is that all the words of * the command are popped from the stack and the result is pushed: The * stack top changes by (1-wordIdx). * * The estimates are not correct while the command is being * prepared and run, INST_EXPAND_STKTOP is not stack-neutral in general. */ XTclEmitInvoke(tls, envPtr3, int32(INST_INVOKE_EXPANDED), libc.VaList(bp+8, wordIdx)) v32 = libc.Uint64FromInt32(depth1 + int32(1)) v33 = envPtr3 if v32 != libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth) { XTcl_Panic(tls, __ccgo_ts+21474, libc.VaList(bp+8, libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v33)).FcurrStackDepth), v32)) } } func _CompileCmdCompileProc(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr3 uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var delta1, depth1, unwind, v11 int32 var eclIndex, incrOffset TTcl_Size var incrPtr, mapPtr, startPtr, v1, v10, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v22, v3, v4, v5, v6, v7, v8, v9 uintptr var v21 Tsize_t _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = delta1, depth1, eclIndex, incrOffset, incrPtr, mapPtr, startPtr, unwind, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) unwind = 0 incrOffset = int64(-int32(1)) depth1 = int32((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) /* * Emission of the INST_START_CMD instruction is controlled by the value of * envPtr->atCmdStart: * * atCmdStart == 2 : Don't use the INST_START_CMD instruction. * atCmdStart == 1 : INST_START_CMD was the last instruction emitted, * : so no need to emit another. Instead * : increment the number of cmds started at it, except * : for the special case at the start of a script. * atCmdStart == 0 : The last instruction was something else. * : Emit INST_START_CMD here. */ switch (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart { case 0: unwind = int32(XtclInstructionTable[int32(INST_START_CMD)].FnumBytes) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v2 = envPtr3 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_START_CMD)) v4 = envPtr3 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v6 = envPtr3 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v8 = envPtr3 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v10 = envPtr3 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = int32(1) } delta1 = XtclInstructionTable[uint8(INST_START_CMD)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v11 = delta1 v12 = envPtr3 if v11 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v12 + 64)) += int64(v11) } incrOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(4) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v14 = envPtr3 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v16 = envPtr3 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v18 = envPtr3 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v20 = envPtr3 + 152 v19 = *(*uintptr)(unsafe.Pointer(v20)) *(*uintptr)(unsafe.Pointer(v20))++ *(*uint8)(unsafe.Pointer(v19)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) case int32(1): if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart { incrOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext-uintptr(4)) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) } case int32(2): /* Nothing to do */ } if TCL_OK == XTclAttemptCompileProc(tls, interp, parsePtr, int64(1), cmdPtr, envPtr3) { if incrOffset >= 0 { /* * Command compiled succesfully. Increment the number of * commands that start at the currently active INST_START_CMD. */ incrPtr = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart + uintptr(incrOffset) startPtr = incrPtr - uintptr(5) *(*uint8)(unsafe.Pointer(incrPtr)) = uint8((libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(incrPtr)))<> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(incrPtr + libc.UintptrFromInt32(1))) = uint8((libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(incrPtr)))<> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(incrPtr + libc.UintptrFromInt32(2))) = uint8((libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(incrPtr)))<> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(incrPtr + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(incrPtr)))<> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(startPtr + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext)-int64(startPtr)) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(startPtr + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext)-int64(startPtr)) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(startPtr + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64(startPtr))) } } v21 = libc.Uint64FromInt32(depth1 + int32(1)) v22 = envPtr3 if v21 != libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth) { XTcl_Panic(tls, __ccgo_ts+21474, libc.VaList(bp+8, libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v22)).FcurrStackDepth), v21)) } return TCL_OK } *(*uintptr)(unsafe.Pointer(envPtr3 + 152)) -= uintptr(unwind) /* Unwind INST_START_CMD */ /* * Throw out any line information generated by the failed compile attempt. */ for (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc-int64(1) > eclIndex { (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc-- XTclpFree(tls, (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc)*32))).Fline) (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc)*32))).Fline = libc.UintptrFromInt32(0) } /* * Reset the index of next command. Toss out any from failed nested * partial compiles. */ (*TCompileEnv)(unsafe.Pointer(envPtr3)).FnumCommands = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc return int32(TCL_ERROR) } func _CompileCommandTokens(tls *libc.TLS, interp uintptr, parsePtr uintptr, envPtr3 uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, cachePtr, clNext, cmdObj, cmdPtr, eclPtr, iPtr, tokenPtr, v11, v2, v3, v5, v6, v7, v9 uintptr var cmdIdx, cmdLine, startCodeOffset, wlineat, v4 TTcl_Size var cmdKnown, code, delta1, depth1, expand, v8 int32 var v1 bool var v10 Tsize_t var _ /* wlines at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, clNext, cmdIdx, cmdKnown, cmdLine, cmdObj, cmdPtr, code, delta1, depth1, eclPtr, expand, iPtr, startCodeOffset, tokenPtr, wlineat, v1, v10, v11, v2, v3, v4, v5, v6, v7, v8, v9 iPtr = interp tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr eclPtr = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FextCmdMapPtr cmdPtr = libc.UintptrFromInt32(0) code = int32(TCL_ERROR) expand = -int32(1) cmdLine = (*TCompileEnv)(unsafe.Pointer(envPtr3)).Fline clNext = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext cmdIdx = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FnumCommands startCodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) depth1 = int32((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) /* Precompile */ if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { cmdObj = XTclThreadAllocObj(tls) } else { cmdObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(cmdObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(cmdObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(cmdObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(cmdObj)).FtypePtr = libc.UintptrFromInt32(0) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FnumCommands++ _EnterCmdStartData(tls, envPtr3, cmdIdx, int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).Fsource), startCodeOffset) /* * TIP #280. Scan the words and compute the extended location information. * At first the map first contains full per-word line information for use by the * compiler. This is later replaced by a reduced form which signals * non-literal words, stored in 'wlines'. */ _EnterCmdWordData(tls, eclPtr, int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).Fsource), (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords, cmdLine, clNext, bp, envPtr3) wlineat = (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc - int64(1) (*TCompileEnv)(unsafe.Pointer(envPtr3)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*32))).Fline)) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*32))).Fnext)) /* Do we know the command word? */ (*TTcl_Obj)(unsafe.Pointer(cmdObj)).FrefCount++ tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr cmdKnown = XTclWordKnownAtCompileTime(tls, tokenPtr, cmdObj) /* Is this a command we should (try to) compile with a compileProc ? */ if cmdKnown != 0 && !((*TInterp)(unsafe.Pointer(iPtr)).Fflags&libc.Int32FromInt32(DONT_COMPILE_CMDS_INLINE) != 0) { cmdPtr = XTcl_GetCommandFromObj(tls, interp, cmdObj) if cmdPtr != 0 { /* * Found a command. Test the ways we can be told not to attempt * to compile it. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc == libc.UintptrFromInt32(0) || (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(cmdPtr)).FnsPtr)).Fflags&int32(NS_SUPPRESS_COMPILATION) != 0 || (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_HAS_EXEC_TRACES) != 0 { cmdPtr = libc.UintptrFromInt32(0) } } if cmdPtr != 0 && !((*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&libc.Int32FromInt32(CMD_COMPILES_EXPANDED) != 0) { expand = _ExpandRequested(tls, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, libc.Uint64FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords))) if expand != 0 { /* We need to expand, but compileProc cannot. */ cmdPtr = libc.UintptrFromInt32(0) } } } /* If cmdPtr != NULL, try to call cmdPtr->compileProc */ if cmdPtr != 0 { code = _CompileCmdCompileProc(tls, interp, parsePtr, cmdPtr, envPtr3) } if code == int32(TCL_ERROR) { if expand < 0 { expand = _ExpandRequested(tls, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, libc.Uint64FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords))) } if expand != 0 { if cmdKnown != 0 { v2 = cmdObj } else { v2 = libc.UintptrFromInt32(0) } _CompileExpanded(tls, interp, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, v2, int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords), envPtr3) } else { if cmdKnown != 0 { v3 = cmdObj } else { v3 = libc.UintptrFromInt32(0) } XTclCompileInvocation(tls, interp, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, v3, libc.Uint64FromInt32(int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)), envPtr3) } } _objPtr = cmdObj v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v7 = envPtr3 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v8 = delta1 v9 = envPtr3 if v8 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v9)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v9)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v9 + 64)) += int64(v8) } _EnterCmdExtentData(tls, envPtr3, cmdIdx, int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm)-int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart), int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart)-startCodeOffset) /* * TIP #280: Free the full form of per-word line data and insert the * reduced form now. */ (*TCompileEnv)(unsafe.Pointer(envPtr3)).Fline = cmdLine (*TCompileEnv)(unsafe.Pointer(envPtr3)).FclNext = clNext XTclpFree(tls, (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*32))).Fline) XTclpFree(tls, (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*32))).Fnext) (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*32))).Fline = *(*uintptr)(unsafe.Pointer(bp)) (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr(wlineat)*32))).Fnext = libc.UintptrFromInt32(0) v10 = libc.Uint64FromInt32(depth1) v11 = envPtr3 if v10 != libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth) { XTcl_Panic(tls, __ccgo_ts+21474, libc.VaList(bp+16, libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth), v10)) } return int32(cmdIdx) } func XTclCompileScript(tls *libc.TLS, interp uintptr, script uintptr, numBytes TTcl_Size, envPtr3 uintptr) { bp := tls.Alloc(48) defer tls.Free(48) /* Holds resulting instructions. */ var _objIndexCopy, delta1, depth1, lastCmdIdx, v17, v5 int32 var iPtr, next, p, parsePtr, v1, v10, v11, v12, v13, v14, v15, v16, v18, v2, v20, v3, v4, v6, v7, v8, v9 uintptr var v19 Tsize_t _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, depth1, iPtr, lastCmdIdx, next, p, parsePtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v3, v4, v5, v6, v7, v8, v9 lastCmdIdx = -int32(1) /* Index into envPtr->cmdMapPtr of the last * command this routine compiles into bytecode. * Initial value of -1 indicates this routine * has not yet generated any bytecode. */ p = script /* Where we are in our compile. */ depth1 = int32((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) iPtr = interp if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FiPtr == libc.UintptrFromInt32(0) { XTcl_Panic(tls, __ccgo_ts+23929, 0) } /* * Check depth to avoid overflow of the C execution stack by too many * nested calls of TclCompileScript, considering interp recursionlimit. * Use factor 5/4 (1.25) to avoid being too mistaken when recognizing the * limit during "mixed" evaluation and compilation process (nested * eval+compile) and is good enough for default recursionlimit (1000). */ if (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels/int64(5) > (*TInterp)(unsafe.Pointer(iPtr)).FmaxNestingDepth/int64(4) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+23983, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+8338, __ccgo_ts+8344, libc.UintptrFromInt32(0))) XTclCompileSyntaxError(tls, interp, envPtr3) return } if numBytes < 0 { numBytes = libc.Int64FromUint64(libc.Xstrlen(tls, script)) } /* Each iteration compiles one command from the script. */ if numBytes > 0 { if numBytes >= int64(INT_MAX) { /* * Note this gets -errorline as 1. Not worth figuring out which line * crosses the limit to get -errorline for this error case. */ XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+24029, libc.VaList(bp+8, numBytes, libc.Int32FromInt32(INT_MAX)-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+8338, __ccgo_ts+24080, libc.UintptrFromInt32(0))) XTclCompileSyntaxError(tls, interp, envPtr3) return } /* * Don't use system stack (size of Tcl_Parse is ca. 400 bytes), so * many nested compilations (body enclosed in body) can cause abnormal * program termination with a stack overflow exception, bug [fec0c17d39]. */ parsePtr = XTcl_Alloc(tls, uint64(744)) for cond := true; cond; cond = numBytes > 0 { if TCL_OK != XTcl_ParseCommand(tls, interp, p, numBytes, 0, parsePtr) { /* * Compile bytecodes to report the parsePtr error at runtime. */ XTcl_LogCommandInfo(tls, interp, script, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).Fterm+uintptr(1))-int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)) XTclCompileSyntaxError(tls, interp, envPtr3) XTclpFree(tls, parsePtr) return } /* * TIP #280: Count newlines before the command start. * (See test info-30.33). */ XTclAdvanceLines(tls, envPtr3+4512, p, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart) XTclAdvanceContinuations(tls, envPtr3+4512, envPtr3+4536, int32(int64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).Fsource))) /* * Advance parser to the next command in the script. */ next = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart + uintptr((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandSize) numBytes -= int64(next) - int64(p) p = next if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords == 0 { /* * The "command" parsed has no words. In this case we can skip * the rest of the loop body. With no words, clearly * CompileCommandTokens() has nothing to do. Since the parser * aggressively sucks up leading comment and white space, * including newlines, parsePtr->commandStart must be pointing at * either the end of script, or a command-terminating semi-colon. * In either case, the TclAdvance*() calls have nothing to do. * Finally, when no words are parsed, no tokens have been * allocated at parsePtr->tokenPtr so there's also nothing for * Tcl_FreeParse() to do. * * The advantage of this shortcut is that CompileCommandTokens() * can be written with an assumption that (int)parsePtr->numWords > 0, with * the implication the CCT() always generates bytecode. */ continue } /* * Avoid stack exhaustion by too many nested calls of TclCompileScript * (considering interp recursionlimit). */ (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels++ lastCmdIdx = _CompileCommandTokens(tls, interp, parsePtr, envPtr3) (*TInterp)(unsafe.Pointer(iPtr)).FnumLevels-- /* * TIP #280: Track lines in the just compiled command. */ XTclAdvanceLines(tls, envPtr3+4512, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FcommandStart, p) XTclAdvanceContinuations(tls, envPtr3+4512, envPtr3+4536, int32(int64(p)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).Fsource))) XTcl_FreeParse(tls, parsePtr) } XTclpFree(tls, parsePtr) } if lastCmdIdx == -int32(1) { /* * Compiling the script yielded no bytecode. The script must be all * whitespace, comments, and empty commands. Such scripts are defined * to successfully produce the empty string result, so we emit the * simple bytecode that makes that happen. */ _objIndexCopy = XTclRegisterLiteral(tls, envPtr3, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v2 = envPtr3 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v4 = envPtr3 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v5 = delta1 v6 = envPtr3 if v5 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v6)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v6)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v6 + 64)) += int64(v5) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v8 = envPtr3 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v10 = envPtr3 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v12 = envPtr3 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v14 = envPtr3 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v16 = envPtr3 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v17 = delta1 v18 = envPtr3 if v17 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v18)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v18)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v18 + 64)) += int64(v17) } } } else { /* * We compiled at least one command to bytecode. The routine * CompileCommandTokens() follows the bytecode of each compiled * command with an INST_POP, so that stack balance is maintained when * several commands are in sequence. (The result of each command is * thrown away before moving on to the next command). For the last * command compiled, we need to undo that INST_POP so that the result * of the last command becomes the result of the script. The code * here removes that trailing INST_POP. */ (*(*TCmdLocation)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcmdMapPtr + uintptr(lastCmdIdx)*32))).FnumCodeBytes-- (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext-- (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth++ } v19 = libc.Uint64FromInt32(depth1 + int32(1)) v20 = envPtr3 if v19 != libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth) { XTcl_Panic(tls, __ccgo_ts+21474, libc.VaList(bp+8, libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth), v19)) } } /* *---------------------------------------------------------------------- * * TclCompileTokens -- * * Given an array of tokens parsed from a Tcl command, e.g. the tokens * that make up a word, emits instructions to evaluate the * tokens and concatenate their values to form a single result value on * the interpreter's runtime evaluation stack. * * Results: * The return value is a standard Tcl result. If an error occurs, an * error message is left in the interpreter's result. * * Side effects: * Instructions are added to envPtr to push and evaluate the tokens at * runtime. * *---------------------------------------------------------------------- */ func XTclCompileVarSubst(tls *libc.TLS, interp uintptr, tokenPtr uintptr, envPtr2 uintptr) { var _objIndexCopy, delta1, localVarName, v18, v22, v28, v40, v44, v50, v6, v62 int32 var i1, localVar, nameBytes TTcl_Size var name, p, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v23, v24, v25, v26, v27, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v42, v43, v45, v46, v47, v48, v49, v5, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v63, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, i1, localVar, localVarName, name, nameBytes, p, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v7, v8, v9 name = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart nameBytes = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize localVarName = int32(1) /* * Determine how the variable name should be handled: if it contains any * namespace qualifiers it is not a local variable (localVarName=-1); if * it looks like an array element and the token has a single component, it * should not be created here [Bug 569438] (localVarName=0); otherwise, * the local variable can safely be created (localVarName=1). */ i1 = 0 p = name for { if !(i1 < nameBytes) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(':') && i1 < nameBytes-int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) == int32(':') { localVarName = -int32(1) break } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32('(') && (*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents == int64(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(name + uintptr(nameBytes-int64(1))))) == int32(')') { localVarName = 0 break } } goto _1 _1: ; i1++ p++ } /* * Either push the variable's name, or find its index in the array * of local variables in a procedure frame. */ localVar = int64(-int32(1)) if localVarName != -int32(1) { localVar = XTclFindCompiledLocal(tls, name, nameBytes, localVarName, envPtr2) } if localVar < 0 { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, name, nameBytes, 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } /* * Emit instructions to load the variable. */ XTclAdvanceLines(tls, envPtr2+4512, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart+uintptr((*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize)) if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents == int64(1) { if localVar < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_LOAD_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } } else { if localVar <= int64(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR1)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt64(localVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(localVar) } v28 = delta1 v29 = envPtr2 if v28 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v29 + 64)) += int64(v28) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = libc.Uint8FromInt32(int32(INST_LOAD_SCALAR4)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(24)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(16)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(8)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt64(localVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_SCALAR4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(localVar) } v40 = delta1 v41 = envPtr2 if v40 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v41 + 64)) += int64(v40) } } } } else { XTclCompileTokens(tls, interp, tokenPtr+uintptr(2)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents-int64(1)), envPtr2) if localVar < 0 { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v43 = envPtr2 + 152 v42 = *(*uintptr)(unsafe.Pointer(v43)) *(*uintptr)(unsafe.Pointer(v43))++ *(*uint8)(unsafe.Pointer(v42)) = libc.Uint8FromInt32(int32(INST_LOAD_ARRAY_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_ARRAY_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v44 = delta1 v45 = envPtr2 if v44 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v45 + 64)) += int64(v44) } } else { if localVar <= int64(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = libc.Uint8FromInt32(int32(INST_LOAD_ARRAY1)) v49 = envPtr2 + 152 v48 = *(*uintptr)(unsafe.Pointer(v49)) *(*uintptr)(unsafe.Pointer(v49))++ *(*uint8)(unsafe.Pointer(v48)) = uint8(libc.Uint32FromInt64(localVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_ARRAY1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(localVar) } v50 = delta1 v51 = envPtr2 if v50 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v51)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v51)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v51 + 64)) += int64(v50) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = libc.Uint8FromInt32(int32(INST_LOAD_ARRAY4)) v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(24)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(16)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt64(localVar) >> libc.Int32FromInt32(8)) v61 = envPtr2 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt64(localVar)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_LOAD_ARRAY4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(localVar) } v62 = delta1 v63 = envPtr2 if v62 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v63)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v63)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v63)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v63)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v63 + 64)) += int64(v62) } } } } } func XTclCompileTokens(tls *libc.TLS, interp uintptr, tokenPtr uintptr, count1 Tsize_t, envPtr3 uintptr) { bp := tls.Alloc(272) defer tls.Free(272) /* Holds the resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, clPos, count, delta1, depth1, isLiteral, literal, literal1, literal2, v19, v25, v37, v43, v55, v61, v67, v7, v73, v85 int32 var adjust, i1, maxNumCL, numCL, numObjsToConcat TTcl_Size var clPosition, entryCodeNext, v10, v11, v12, v13, v14, v15, v16, v17, v18, v20, v21, v22, v23, v24, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v38, v39, v4, v40, v41, v42, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v56, v57, v58, v59, v6, v60, v62, v63, v64, v65, v66, v68, v69, v70, v71, v72, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v86, v88, v9 uintptr var length, v87 Tsize_t var _ /* buffer at bp+224 */ [4]uint8 var _ /* textBuffer at bp+0 */ TTcl_DString _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, _objIndexCopy3, adjust, clPos, clPosition, count, delta1, depth1, entryCodeNext, i1, isLiteral, length, literal, literal1, literal2, maxNumCL, numCL, numObjsToConcat, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v84, v85, v86, v87, v88, v9 /* Holds concatenated chars from adjacent * TCL_TOKEN_TEXT, TCL_TOKEN_BS tokens. */ *(*[4]uint8)(unsafe.Pointer(bp + 224)) = [4]uint8{} entryCodeNext = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext clPosition = libc.UintptrFromInt32(0) depth1 = int32((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) count = libc.Int32FromUint64(count1) /* * If this is actually a literal, handle continuation lines by * preallocating a small table to store the locations of any continuation * lines found in this literal. The table is extended if needed. * * Note: In contrast with the analagous code in 'TclSubstTokens()' the * 'adjust' variable seems unneeded here. The code which merges * continuation line information of multiple words which concat'd at * runtime also seems unneeded. Either that or I have not managed to find a * test case for these two possibilities yet. It might be a difference * between compile- versus run-time processing. */ numCL = 0 maxNumCL = 0 isLiteral = int32(1) i1 = 0 for { if !(i1 < int64(count)) { break } if (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + uintptr(i1)*32))).Ftype1 != int32(TCL_TOKEN_TEXT) && (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + uintptr(i1)*32))).Ftype1 != int32(TCL_TOKEN_BS) { isLiteral = 0 break } goto _1 _1: ; i1++ } if isLiteral != 0 { maxNumCL = int64(NUM_STATIC_POS) clPosition = XTcl_Alloc(tls, libc.Uint64FromInt64(maxNumCL)*uint64(8)) } adjust = 0 XTcl_DStringInit(tls, bp) numObjsToConcat = 0 for { if !(count > 0) { break } switch (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 { case int32(TCL_TOKEN_TEXT): XTcl_DStringAppend(tls, bp, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize) XTclAdvanceLines(tls, envPtr3+4512, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize)) case int32(TCL_TOKEN_BS): length = libc.Uint64FromInt32(XTclParseBackslash(tls, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, libc.UintptrFromInt32(0), bp+224)) XTcl_DStringAppend(tls, bp, bp+224, libc.Int64FromUint64(length)) /* * If the identified backslash sequence is in a literal and * represented a continuation line, compute and store its * location (as char offset to the beginning of the _result_ * script). We may have to extend the table of locations. * * The continuation line information is relevant even if the word * being processed is not a literal, as it can affect nested * commands. See the branch below for TCL_TOKEN_COMMAND, where the * adjustment being tracked here is taken into account. The good * thing is a table of everything is not needed, just the number of * lines to add as correction. */ if length == uint64(1) && libc.Int32FromUint8((*(*[4]uint8)(unsafe.Pointer(bp + 224)))[0]) == int32(' ') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart + 1))) == int32('\n') { if isLiteral != 0 { clPos = int32((*TTcl_DString)(unsafe.Pointer(bp)).Flength) if numCL >= maxNumCL { maxNumCL *= int64(2) clPosition = XTcl_Realloc(tls, clPosition, libc.Uint64FromInt64(maxNumCL)*uint64(8)) } *(*TTcl_Size)(unsafe.Pointer(clPosition + uintptr(numCL)*8)) = int64(clPos) numCL++ } adjust++ } case int32(TCL_TOKEN_COMMAND): /* * Push any accumulated chars appearing before the command. */ if (*TTcl_DString)(unsafe.Pointer(bp)).Flength > 0 { literal = XTclRegisterLiteral(tls, envPtr3, (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1, (*TTcl_DString)(unsafe.Pointer(bp)).Flength, 0) _objIndexCopy = literal if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v4 = envPtr3 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v6 = envPtr3 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v7 = delta1 v8 = envPtr3 if v7 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v8)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v8)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v8)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v8)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v8 + 64)) += int64(v7) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v10 = envPtr3 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v12 = envPtr3 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v14 = envPtr3 + 152 v13 = *(*uintptr)(unsafe.Pointer(v14)) *(*uintptr)(unsafe.Pointer(v14))++ *(*uint8)(unsafe.Pointer(v13)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v16 = envPtr3 + 152 v15 = *(*uintptr)(unsafe.Pointer(v16)) *(*uintptr)(unsafe.Pointer(v16))++ *(*uint8)(unsafe.Pointer(v15)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v18 = envPtr3 + 152 v17 = *(*uintptr)(unsafe.Pointer(v18)) *(*uintptr)(unsafe.Pointer(v18))++ *(*uint8)(unsafe.Pointer(v17)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v19 = delta1 v20 = envPtr3 if v19 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v20)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v20)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v20 + 64)) += int64(v19) } } numObjsToConcat++ XTcl_DStringFree(tls, bp) if numCL != 0 { XTclContinuationsEnter(tls, XTclFetchLiteral(tls, envPtr3, int64(literal)), numCL, clPosition) } numCL = 0 } *(*TTcl_Size)(unsafe.Pointer(envPtr3 + 4512)) += adjust XTclCompileScript(tls, interp, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart+uintptr(1), (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize-int64(2), envPtr3) *(*TTcl_Size)(unsafe.Pointer(envPtr3 + 4512)) -= adjust numObjsToConcat++ case int32(TCL_TOKEN_VARIABLE): /* * Push any accumulated chars appearing before the $. */ if (*TTcl_DString)(unsafe.Pointer(bp)).Flength > 0 { literal1 = XTclRegisterLiteral(tls, envPtr3, (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1, (*TTcl_DString)(unsafe.Pointer(bp)).Flength, 0) _objIndexCopy1 = literal1 if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v22 = envPtr3 + 152 v21 = *(*uintptr)(unsafe.Pointer(v22)) *(*uintptr)(unsafe.Pointer(v22))++ *(*uint8)(unsafe.Pointer(v21)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v24 = envPtr3 + 152 v23 = *(*uintptr)(unsafe.Pointer(v24)) *(*uintptr)(unsafe.Pointer(v24))++ *(*uint8)(unsafe.Pointer(v23)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v25 = delta1 v26 = envPtr3 if v25 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v26)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v26)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v26 + 64)) += int64(v25) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v28 = envPtr3 + 152 v27 = *(*uintptr)(unsafe.Pointer(v28)) *(*uintptr)(unsafe.Pointer(v28))++ *(*uint8)(unsafe.Pointer(v27)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v30 = envPtr3 + 152 v29 = *(*uintptr)(unsafe.Pointer(v30)) *(*uintptr)(unsafe.Pointer(v30))++ *(*uint8)(unsafe.Pointer(v29)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v32 = envPtr3 + 152 v31 = *(*uintptr)(unsafe.Pointer(v32)) *(*uintptr)(unsafe.Pointer(v32))++ *(*uint8)(unsafe.Pointer(v31)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v34 = envPtr3 + 152 v33 = *(*uintptr)(unsafe.Pointer(v34)) *(*uintptr)(unsafe.Pointer(v34))++ *(*uint8)(unsafe.Pointer(v33)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v36 = envPtr3 + 152 v35 = *(*uintptr)(unsafe.Pointer(v36)) *(*uintptr)(unsafe.Pointer(v36))++ *(*uint8)(unsafe.Pointer(v35)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v37 = delta1 v38 = envPtr3 if v37 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v38)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v38)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v38)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v38)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v38 + 64)) += int64(v37) } } numObjsToConcat++ XTcl_DStringFree(tls, bp) } XTclCompileVarSubst(tls, interp, tokenPtr, envPtr3) numObjsToConcat++ count = int32(int64(count) - (*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents) tokenPtr += uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents) * 32 default: XTcl_Panic(tls, __ccgo_ts+24093, libc.VaList(bp+240, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1, int32((*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize), (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)) } goto _2 _2: ; count-- tokenPtr += 32 } /* * Push any accumulated characters appearing at the end. */ if (*TTcl_DString)(unsafe.Pointer(bp)).Flength > 0 { literal2 = XTclRegisterLiteral(tls, envPtr3, (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1, (*TTcl_DString)(unsafe.Pointer(bp)).Flength, 0) _objIndexCopy2 = literal2 if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v40 = envPtr3 + 152 v39 = *(*uintptr)(unsafe.Pointer(v40)) *(*uintptr)(unsafe.Pointer(v40))++ *(*uint8)(unsafe.Pointer(v39)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v42 = envPtr3 + 152 v41 = *(*uintptr)(unsafe.Pointer(v42)) *(*uintptr)(unsafe.Pointer(v42))++ *(*uint8)(unsafe.Pointer(v41)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v43 = delta1 v44 = envPtr3 if v43 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v44)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v44)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v44 + 64)) += int64(v43) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v46 = envPtr3 + 152 v45 = *(*uintptr)(unsafe.Pointer(v46)) *(*uintptr)(unsafe.Pointer(v46))++ *(*uint8)(unsafe.Pointer(v45)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v48 = envPtr3 + 152 v47 = *(*uintptr)(unsafe.Pointer(v48)) *(*uintptr)(unsafe.Pointer(v48))++ *(*uint8)(unsafe.Pointer(v47)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v50 = envPtr3 + 152 v49 = *(*uintptr)(unsafe.Pointer(v50)) *(*uintptr)(unsafe.Pointer(v50))++ *(*uint8)(unsafe.Pointer(v49)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v52 = envPtr3 + 152 v51 = *(*uintptr)(unsafe.Pointer(v52)) *(*uintptr)(unsafe.Pointer(v52))++ *(*uint8)(unsafe.Pointer(v51)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v54 = envPtr3 + 152 v53 = *(*uintptr)(unsafe.Pointer(v54)) *(*uintptr)(unsafe.Pointer(v54))++ *(*uint8)(unsafe.Pointer(v53)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v55 = delta1 v56 = envPtr3 if v55 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v56)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v56)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v56)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v56)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v56 + 64)) += int64(v55) } } numObjsToConcat++ if numCL != 0 { XTclContinuationsEnter(tls, XTclFetchLiteral(tls, envPtr3, int64(literal2)), numCL, clPosition) } numCL = 0 } /* * If necessary, concatenate the parts of the word. */ for numObjsToConcat > int64(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v58 = envPtr3 + 152 v57 = *(*uintptr)(unsafe.Pointer(v58)) *(*uintptr)(unsafe.Pointer(v58))++ *(*uint8)(unsafe.Pointer(v57)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v60 = envPtr3 + 152 v59 = *(*uintptr)(unsafe.Pointer(v60)) *(*uintptr)(unsafe.Pointer(v60))++ *(*uint8)(unsafe.Pointer(v59)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(255))) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(255) } v61 = delta1 v62 = envPtr3 if v61 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v62)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v62)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v62 + 64)) += int64(v61) } numObjsToConcat -= int64(254) /* concat pushes 1 obj, the result */ } if numObjsToConcat > int64(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v64 = envPtr3 + 152 v63 = *(*uintptr)(unsafe.Pointer(v64)) *(*uintptr)(unsafe.Pointer(v64))++ *(*uint8)(unsafe.Pointer(v63)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v66 = envPtr3 + 152 v65 = *(*uintptr)(unsafe.Pointer(v66)) *(*uintptr)(unsafe.Pointer(v66))++ *(*uint8)(unsafe.Pointer(v65)) = uint8(libc.Uint32FromInt64(numObjsToConcat)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(numObjsToConcat) } v67 = delta1 v68 = envPtr3 if v67 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v68)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v68)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v68 + 64)) += int64(v67) } } /* * If the tokens yielded no instructions, push an empty string. */ if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == entryCodeNext { _objIndexCopy3 = XTclRegisterLiteral(tls, envPtr3, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy3 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v70 = envPtr3 + 152 v69 = *(*uintptr)(unsafe.Pointer(v70)) *(*uintptr)(unsafe.Pointer(v70))++ *(*uint8)(unsafe.Pointer(v69)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v72 = envPtr3 + 152 v71 = *(*uintptr)(unsafe.Pointer(v72)) *(*uintptr)(unsafe.Pointer(v72))++ *(*uint8)(unsafe.Pointer(v71)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v73 = delta1 v74 = envPtr3 if v73 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v74)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v74)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v74 + 64)) += int64(v73) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v76 = envPtr3 + 152 v75 = *(*uintptr)(unsafe.Pointer(v76)) *(*uintptr)(unsafe.Pointer(v76))++ *(*uint8)(unsafe.Pointer(v75)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v78 = envPtr3 + 152 v77 = *(*uintptr)(unsafe.Pointer(v78)) *(*uintptr)(unsafe.Pointer(v78))++ *(*uint8)(unsafe.Pointer(v77)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(24)) v80 = envPtr3 + 152 v79 = *(*uintptr)(unsafe.Pointer(v80)) *(*uintptr)(unsafe.Pointer(v80))++ *(*uint8)(unsafe.Pointer(v79)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(16)) v82 = envPtr3 + 152 v81 = *(*uintptr)(unsafe.Pointer(v82)) *(*uintptr)(unsafe.Pointer(v82))++ *(*uint8)(unsafe.Pointer(v81)) = uint8(libc.Uint32FromInt32(_objIndexCopy3) >> libc.Int32FromInt32(8)) v84 = envPtr3 + 152 v83 = *(*uintptr)(unsafe.Pointer(v84)) *(*uintptr)(unsafe.Pointer(v84))++ *(*uint8)(unsafe.Pointer(v83)) = uint8(libc.Uint32FromInt32(_objIndexCopy3)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy3 } v85 = delta1 v86 = envPtr3 if v85 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v86)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v86)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v86 + 64)) += int64(v85) } } } XTcl_DStringFree(tls, bp) /* * Release the temp table we used to collect the locations of continuation * lines, if any. */ if maxNumCL != 0 { XTclpFree(tls, clPosition) } v87 = libc.Uint64FromInt32(depth1 + int32(1)) v88 = envPtr3 if v87 != libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth) { XTcl_Panic(tls, __ccgo_ts+21474, libc.VaList(bp+240, libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v88)).FcurrStackDepth), v87)) } } /* *---------------------------------------------------------------------- * * TclCompileCmdWord -- * * Given an array of parse tokens for a word containing one or more Tcl * commands, emits inline instructions to execute them. In contrast with * TclCompileTokens, a simple word such as a loop body enclosed in braces * is not just pushed as a string, but is itself parsed into tokens and * compiled. * * Results: * A standard Tcl result. If an error occurs, an * error message is left in the interpreter's result. * * Side effects: * Instructions are added to envPtr to execute the tokens at runtime. * *---------------------------------------------------------------------- */ func XTclCompileCmdWord(tls *libc.TLS, interp uintptr, tokenPtr uintptr, count1 Tsize_t, envPtr uintptr) { /* Holds the resulting instructions. */ var count int32 _ = count count = libc.Int32FromUint64(count1) if count == int32(1) && (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_TEXT) { /* * The common case that there is a single text token. Compile it * into an inline sequence of instructions. */ XTclCompileScript(tls, interp, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fsize, envPtr) } else { /* * Either there are multiple tokens, or the single token involves * substitutions. Emit instructions to invoke the eval command * procedure at runtime on the result of evaluating the tokens. */ XTclCompileTokens(tls, interp, tokenPtr, libc.Uint64FromInt32(count), envPtr) XTclEmitInvoke(tls, envPtr, int32(INST_EVAL_STK), 0) } } /* *---------------------------------------------------------------------- * * TclCompileExprWords -- * * Given an array of parse tokens representing one or more words that * contain a Tcl expression, emits inline instructions to execute the * expression. In contrast with TclCompileExpr, supports Tcl's two-level * substitution semantics for an expression that appears as command words. * * Results: * A standard Tcl result. If an error occurs, an * error message is left in the interpreter's result. * * Side effects: * Instructions are added to envPtr to execute the expression. * *---------------------------------------------------------------------- */ func XTclCompileExprWords(tls *libc.TLS, interp uintptr, tokenPtr uintptr, numWords1 Tsize_t, envPtr2 uintptr) { /* Holds the resulting instructions. */ var _objIndexCopy, concatItems, delta1, i1, numWords, v18, v24, v30, v34, v6 int32 var wordPtr, v10, v11, v12, v13, v14, v15, v16, v17, v19, v2, v20, v21, v22, v23, v25, v26, v27, v28, v29, v3, v31, v32, v33, v35, v4, v5, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, concatItems, delta1, i1, numWords, wordPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v4, v5, v6, v7, v8, v9 numWords = libc.Int32FromUint64(numWords1) /* * If the expression is a single word that doesn't require substitutions, * just compile its string into inline instructions. */ if numWords == int32(1) && (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { XTclCompileExpr(tls, interp, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize, envPtr2, int32(1)) return } /* * Emit code to call the expr command proc at runtime. Concatenate the * (already substituted once) expr tokens with a space between each. */ wordPtr = tokenPtr i1 = 0 for { if !(i1 < numWords) { break } XTclCompileTokens(tls, interp, wordPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(wordPtr)).FnumComponents), envPtr2) if i1 < numWords-int32(1) { _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+14830, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v5 = envPtr2 + 152 v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5))++ *(*uint8)(unsafe.Pointer(v4)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v6 = delta1 v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } } } wordPtr += uintptr((*TTcl_Token)(unsafe.Pointer(wordPtr)).FnumComponents+int64(1)) * 32 goto _1 _1: ; i1++ } concatItems = int32(2)*numWords - int32(1) for concatItems > int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(255))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - int32(255) } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } concatItems -= int32(254) } if concatItems > int32(1) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(INST_STR_CONCAT1)) v29 = envPtr2 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = uint8(libc.Uint32FromInt32(concatItems)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_STR_CONCAT1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - concatItems } v30 = delta1 v31 = envPtr2 if v30 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v31)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v31)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v31 + 64)) += int64(v30) } } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = libc.Uint8FromInt32(int32(INST_EXPR_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EXPR_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v34 = delta1 v35 = envPtr2 if v34 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v35)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v35)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v35 + 64)) += int64(v34) } } /* *---------------------------------------------------------------------- * * TclCompileNoOp -- * * Compiles no-op's * * Results: * TCL_OK if completion was successful. * * Side effects: * Instructions are added to envPtr to execute a no-op at runtime. No * result is pushed onto the stack: the compiler has to take care of this * itself if the last compiled command is a NoOp. * *---------------------------------------------------------------------- */ func XTclCompileNoOp(tls *libc.TLS, interp uintptr, parsePtr uintptr, dummy2758 uintptr, envPtr2 uintptr) (r int32) { /* Holds resulting instructions. */ var _objIndexCopy, delta1, i1, v10, v22, v4 int32 var tokenPtr, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v23, v3, v5, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, delta1, i1, tokenPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v3, v4, v5, v6, v7, v8, v9 tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr i1 = int32(1) for { if !(i1 < int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords)) { break } tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents)*32 + uintptr(1)*32 if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { XTclCompileTokens(tls, interp, tokenPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents), envPtr2) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v4 = delta1 v5 = envPtr2 if v4 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v5)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v5)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v5)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v5)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v5 + 64)) += int64(v4) } } goto _1 _1: ; i1++ } _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, __ccgo_ts+1945, libc.Int64FromUint64(libc.Uint64FromInt64(1)-libc.Uint64FromInt32(1)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v10 = delta1 v11 = envPtr2 if v10 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v11 + 64)) += int64(v10) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } } return TCL_OK } /* *---------------------------------------------------------------------- * * TclInitByteCodeObj -- * * Creates a ByteCode structure and initializes it from a CompileEnv * compilation environment structure. The ByteCode structure is smaller * and contains just that information needed to execute the bytecode * instructions resulting from compiling a Tcl script. The resulting * structure is placed in the specified object. * * Results: * A newly-constructed ByteCode object is stored in the internal * representation of the objPtr. * * Side effects: * A single heap object is allocated to hold the new ByteCode structure * and its code, object, command location, and aux data arrays. Note that * "ownership" (i.e., the pointers to) the Tcl objects and aux data items * will be handed over to the new ByteCode structure from the CompileEnv * structure. * *---------------------------------------------------------------------- */ func _PreventCycle(tls *libc.TLS, objPtr uintptr, envPtr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var bytes, copyPtr, v2 uintptr var i TTcl_Size var _ /* numBytes at bp+0 */ TTcl_Size _, _, _, _ = bytes, copyPtr, i, v2 i = 0 for { if !(i < (*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext) { break } if objPtr == XTclFetchLiteral(tls, envPtr, i) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v2 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, objPtr, bp) } bytes = v2 copyPtr = XTcl_NewStringObj(tls, bytes, *(*TTcl_Size)(unsafe.Pointer(bp))) (*TTcl_Obj)(unsafe.Pointer(copyPtr)).FrefCount++ XTclReleaseLiteral(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr, objPtr) (*(*TLiteralEntry)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayPtr + uintptr(i)*32))).FobjPtr = copyPtr } goto _1 _1: ; i++ } } func XTclInitByteCode(tls *libc.TLS, envPtr uintptr) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* Points to the CompileEnv structure from * which to create a ByteCode structure. */ var auxDataArrayBytes, cmdLocBytes, codeBytes, exceptArrayBytes, objArrayBytes, structureSize Tsize_t var codePtr, iPtr, namespacePtr, p uintptr var i, numLitObjects int32 var _ /* isNew at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = auxDataArrayBytes, cmdLocBytes, codeBytes, codePtr, exceptArrayBytes, i, iPtr, namespacePtr, numLitObjects, objArrayBytes, p, structureSize numLitObjects = int32((*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr == libc.UintptrFromInt32(0) { XTcl_Panic(tls, __ccgo_ts+24145, 0) } iPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr codeBytes = libc.Uint64FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) objArrayBytes = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FliteralArrayNext) * uint64(8) exceptArrayBytes = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) * uint64(56) auxDataArrayBytes = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext) * uint64(16) cmdLocBytes = libc.Uint64FromInt32(_GetCmdLocEncodingSize(tls, envPtr)) /* * Compute the total number of bytes needed for this bytecode. * * Note that code bytes need not be aligned but since later elements are we * need to pad anyway, either directly after ByteCode or after codeBytes, * and it's easier and more consistent to do the former. */ structureSize = (libc.Uint64FromInt64(216) + (uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) & ^(uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1)) /* align code bytes */ structureSize += (codeBytes + (uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) & ^(uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1)) /* align object array */ structureSize += (objArrayBytes + (uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) & ^(uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1)) /* align exc range arr */ structureSize += (exceptArrayBytes + (uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) & ^(uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1)) /* align AuxData array */ structureSize += auxDataArrayBytes structureSize += cmdLocBytes if (*TInterp)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FvarFramePtr != libc.UintptrFromInt32(0) { namespacePtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FvarFramePtr)).FnsPtr } else { namespacePtr = (*TInterp)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FglobalNsPtr } p = XTcl_Alloc(tls, structureSize) codePtr = p (*TByteCode)(unsafe.Pointer(codePtr)).FinterpHandle = XTclHandlePreserve(tls, (*TInterp)(unsafe.Pointer(iPtr)).Fhandle) (*TByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch = (*TInterp)(unsafe.Pointer(iPtr)).FcompileEpoch (*TByteCode)(unsafe.Pointer(codePtr)).FnsPtr = namespacePtr (*TByteCode)(unsafe.Pointer(codePtr)).FnsEpoch = (*TNamespace)(unsafe.Pointer(namespacePtr)).FresolverEpoch (*TByteCode)(unsafe.Pointer(codePtr)).FrefCount = 0 XTclPreserveByteCode(tls, codePtr) if (*TNamespace)(unsafe.Pointer(namespacePtr)).FcompiledVarResProc != 0 || (*TInterp)(unsafe.Pointer(iPtr)).FresolverPtr != 0 { (*TByteCode)(unsafe.Pointer(codePtr)).Fflags = uint32(TCL_BYTECODE_RESOLVE_VARS) } else { (*TByteCode)(unsafe.Pointer(codePtr)).Fflags = uint32(0) } (*TByteCode)(unsafe.Pointer(codePtr)).Fsource = (*TCompileEnv)(unsafe.Pointer(envPtr)).Fsource (*TByteCode)(unsafe.Pointer(codePtr)).FprocPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr (*TByteCode)(unsafe.Pointer(codePtr)).FnumCommands = (*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands (*TByteCode)(unsafe.Pointer(codePtr)).FnumSrcBytes = (*TCompileEnv)(unsafe.Pointer(envPtr)).FnumSrcBytes (*TByteCode)(unsafe.Pointer(codePtr)).FnumCodeBytes = libc.Int64FromUint64(codeBytes) (*TByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects = int64(numLitObjects) (*TByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext (*TByteCode)(unsafe.Pointer(codePtr)).FnumAuxDataItems = (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext (*TByteCode)(unsafe.Pointer(codePtr)).FnumCmdLocBytes = libc.Int64FromUint64(cmdLocBytes) (*TByteCode)(unsafe.Pointer(codePtr)).FmaxExceptDepth = (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxExceptDepth (*TByteCode)(unsafe.Pointer(codePtr)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(envPtr)).FmaxStackDepth p += uintptr((libc.Uint64FromInt64(216) + (uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) & ^(uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) /* align code bytes */ (*TByteCode)(unsafe.Pointer(codePtr)).FcodeStart = p libc.Xmemcpy(tls, p, (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart, codeBytes) p += uintptr((codeBytes + (uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) & ^(uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) /* align object array */ (*TByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr = p i = 0 for { if !(i < numLitObjects) { break } *(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(i)*8)) = XTclFetchLiteral(tls, envPtr, int64(i)) goto _1 _1: ; i++ } p += uintptr((objArrayBytes + (uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) & ^(uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) /* align exception range array */ if exceptArrayBytes > uint64(0) { (*TByteCode)(unsafe.Pointer(codePtr)).FexceptArrayPtr = p libc.Xmemcpy(tls, p, (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr, exceptArrayBytes) } else { (*TByteCode)(unsafe.Pointer(codePtr)).FexceptArrayPtr = libc.UintptrFromInt32(0) } p += uintptr((exceptArrayBytes + (uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) & ^(uint64(libc.UintptrFromInt32(0)+8) - libc.Uint64FromInt32(1))) /* align AuxData array */ if auxDataArrayBytes > uint64(0) { (*TByteCode)(unsafe.Pointer(codePtr)).FauxDataArrayPtr = p libc.Xmemcpy(tls, p, (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr, auxDataArrayBytes) } else { (*TByteCode)(unsafe.Pointer(codePtr)).FauxDataArrayPtr = libc.UintptrFromInt32(0) } p += uintptr(auxDataArrayBytes) _EncodeCmdLocMap(tls, envPtr, codePtr, p) /* * Record various compilation-related statistics about the new ByteCode * structure. Don't include overhead for statistics-related fields. */ /* * TIP #280. Associate the extended per-word line information with the * byte code object (internal rep), for use with the bc compiler. */ (*TTcl_HashEntry)(unsafe.Pointer((*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr)).FcreateProc})))(tls, (*TInterp)(unsafe.Pointer(iPtr)).FlineBCPtr, codePtr, bp))).FclientData = (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr = libc.UintptrFromInt32(0) /* We've used up the CompileEnv. Mark as uninitialized. */ (*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr = libc.UintptrFromInt32(0) (*TByteCode)(unsafe.Pointer(codePtr)).FlocalCachePtr = libc.UintptrFromInt32(0) return codePtr } func XTclInitByteCodeObj(tls *libc.TLS, objPtr uintptr, typePtr uintptr, envPtr uintptr) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* Points to the CompileEnv structure from * which to create a ByteCode structure. */ var codePtr uintptr var _ /* ir at bp+0 */ TTcl_ObjInternalRep _ = codePtr _PreventCycle(tls, objPtr, envPtr) codePtr = XTclInitByteCode(tls, envPtr) /* * Free the old internal rep then convert the object to a bytecode object * by making its internal rep point to the just compiled ByteCode. */ (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr1 = codePtr (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr2 = libc.UintptrFromInt32(0) XTcl_StoreInternalRep(tls, objPtr, typePtr, bp) return codePtr } /* *---------------------------------------------------------------------- * * TclFindCompiledLocal -- * * This procedure is called at compile time to look up and optionally * allocate an entry ("slot") for a variable in a procedure's array of * local variables. If the variable's name is NULL, a new temporary * variable is always created. (Such temporary variables can only be * referenced using their slot index.) * * Results: * If create is 0 and the name is non-NULL, then if the variable is * found, the index of its entry in the procedure's array of local * variables is returned; otherwise -1 is returned. If name is NULL, the * index of a new temporary variable is returned. Finally, if create is 1 * and name is non-NULL, the index of a new entry is returned. * * Side effects: * Creates and registers a new local variable if create is 1 and the * variable is unknown, or if the name is NULL. * *---------------------------------------------------------------------- */ func XTclFindCompiledLocal(tls *libc.TLS, name uintptr, nameBytes TTcl_Size, create int32, envPtr uintptr) (r TTcl_Size) { bp := tls.Alloc(16) defer tls.Free(16) /* Points to the current compile environment*/ var cachePtr, localName, localName1, localPtr, procPtr, varNamePtr, v2, v4 uintptr var i, localCt, localVar TTcl_Size var _ /* len at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _ = cachePtr, i, localCt, localName, localName1, localPtr, localVar, procPtr, varNamePtr, v2, v4 localVar = int64(-libc.Int32FromInt32(1)) /* * If not creating a temporary, does a local variable of the specified * name already exist? */ procPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FprocPtr if procPtr == libc.UintptrFromInt32(0) { /* * Compiling a non-body script: give it read access to the LVT in the * current localCache */ cachePtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FiPtr)).FvarFramePtr)).FlocalCachePtr if !(cachePtr != 0) || !(name != 0) { return int64(-libc.Int32FromInt32(1)) } varNamePtr = cachePtr + 16 i = 0 for { if !(i < (*TLocalCache)(unsafe.Pointer(cachePtr)).FnumVars) { break } if *(*uintptr)(unsafe.Pointer(varNamePtr)) != 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(varNamePtr)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(varNamePtr)))).Flength v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(varNamePtr)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(varNamePtr)), bp) } localName = v2 if *(*TTcl_Size)(unsafe.Pointer(bp)) == nameBytes && !(libc.Xstrncmp(tls, name, localName, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))) != 0) { return i } } goto _1 _1: ; varNamePtr += 8 i++ } return int64(-libc.Int32FromInt32(1)) } if name != libc.UintptrFromInt32(0) { localCt = (*TProc)(unsafe.Pointer(procPtr)).FnumCompiledLocals localPtr = (*TProc)(unsafe.Pointer(procPtr)).FfirstLocalPtr i = 0 for { if !(i < localCt) { break } if !((*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&libc.Int32FromInt32(VAR_TEMPORARY) != 0) { localName1 = localPtr + 44 if nameBytes == (*TCompiledLocal)(unsafe.Pointer(localPtr)).FnameLength && libc.Xstrncmp(tls, name, localName1, libc.Uint64FromInt64(nameBytes)) == 0 { return i } } localPtr = (*TCompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr goto _3 _3: ; i++ } } /* * Create a new variable if appropriate. */ if create != 0 || name == libc.UintptrFromInt32(0) { localVar = (*TProc)(unsafe.Pointer(procPtr)).FnumCompiledLocals localPtr = XTcl_Alloc(tls, uint64(libc.UintptrFromInt32(0)+44)+libc.Uint64FromUint32(1)+libc.Uint64FromInt64(nameBytes)) if (*TProc)(unsafe.Pointer(procPtr)).FfirstLocalPtr == libc.UintptrFromInt32(0) { v4 = localPtr (*TProc)(unsafe.Pointer(procPtr)).FlastLocalPtr = v4 (*TProc)(unsafe.Pointer(procPtr)).FfirstLocalPtr = v4 } else { (*TCompiledLocal)(unsafe.Pointer((*TProc)(unsafe.Pointer(procPtr)).FlastLocalPtr)).FnextPtr = localPtr (*TProc)(unsafe.Pointer(procPtr)).FlastLocalPtr = localPtr } (*TCompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr = libc.UintptrFromInt32(0) (*TCompiledLocal)(unsafe.Pointer(localPtr)).FnameLength = nameBytes (*TCompiledLocal)(unsafe.Pointer(localPtr)).FframeIndex = localVar (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags = 0 if name == libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(localPtr + 40)) |= int32(VAR_TEMPORARY) } (*TCompiledLocal)(unsafe.Pointer(localPtr)).FdefValuePtr = libc.UintptrFromInt32(0) (*TCompiledLocal)(unsafe.Pointer(localPtr)).FresolveInfo = libc.UintptrFromInt32(0) if name != libc.UintptrFromInt32(0) { libc.Xmemcpy(tls, localPtr+44, name, libc.Uint64FromInt64(nameBytes)) } *(*uint8)(unsafe.Pointer(localPtr + 44 + uintptr(nameBytes))) = uint8('\000') (*TProc)(unsafe.Pointer(procPtr)).FnumCompiledLocals++ } return localVar } /* *---------------------------------------------------------------------- * * TclExpandCodeArray -- * * Uses malloc to allocate more storage for a CompileEnv's code array. * * Results: * None. * * Side effects: * The size of the bytecode array is doubled. If envPtr->mallocedCodeArray * is non-zero the old array is freed. Byte codes are copied from the old * array to the new one. * *---------------------------------------------------------------------- */ func XTclExpandCodeArray(tls *libc.TLS, envArgPtr uintptr) { /* Points to the CompileEnv whose code array * must be enlarged. */ var currBytes, newBytes Tsize_t var envPtr, newPtr uintptr _, _, _, _ = currBytes, envPtr, newBytes, newPtr envPtr = envArgPtr /* The CompileEnv containing the code array to * be doubled in size. */ /* * envPtr->codeNext is equal to envPtr->codeEnd. The currently defined * code bytes are stored between envPtr->codeStart and envPtr->codeNext-1 * [inclusive]. */ currBytes = libc.Uint64FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart)) newBytes = libc.Uint64FromInt64(int64(2) * (int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd) - int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart))) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedCodeArray != 0 { (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart = XTcl_Realloc(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart, newBytes) } else { /* * envPtr->exceptArrayPtr isn't a Tcl_Alloc'd pointer, so * perform the equivalent of Tcl_Realloc directly. */ newPtr = XTcl_Alloc(tls, newBytes) libc.Xmemcpy(tls, newPtr, (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart, currBytes) (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart = newPtr (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedCodeArray = int32(1) } (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(currBytes) (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(newBytes) } /* *---------------------------------------------------------------------- * * EnterCmdStartData -- * * Registers the starting source and bytecode location of a command. This * information is used at runtime to map between instruction pc and * source locations. * * Results: * None. * * Side effects: * Inserts source and code location information into the compilation * environment envPtr for the command at index cmdIndex. The compilation * environment's CmdLocation array is grown if necessary. * *---------------------------------------------------------------------- */ func _EnterCmdStartData(tls *libc.TLS, envPtr uintptr, cmdIndex TTcl_Size, srcOffset TTcl_Size, codeOffset TTcl_Size) { bp := tls.Alloc(16) defer tls.Free(16) /* Offset of first byte of command code. */ var cmdLocPtr, newPtr uintptr var currBytes, currElems, newBytes, newElems Tsize_t _, _, _, _, _, _ = cmdLocPtr, currBytes, currElems, newBytes, newElems, newPtr if cmdIndex < 0 || cmdIndex >= (*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands { XTcl_Panic(tls, __ccgo_ts+24201, libc.VaList(bp+8, cmdIndex)) } if cmdIndex >= (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd { /* * Expand the command location array by allocating more storage from * the heap. The currently allocated CmdLocation entries are stored * from cmdMapPtr[0] up to cmdMapPtr[envPtr->cmdMapEnd] (inclusive). */ currElems = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd) newElems = uint64(2) * currElems currBytes = currElems * uint64(32) newBytes = newElems * uint64(32) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedCmdMap != 0 { (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr = XTcl_Realloc(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr, newBytes) } else { /* * envPtr->cmdMapPtr isn't a Tcl_Alloc'd pointer, so we must code a * Tcl_Realloc equivalent for ourselves. */ newPtr = XTcl_Alloc(tls, newBytes) libc.Xmemcpy(tls, newPtr, (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr, currBytes) (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr = newPtr (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedCmdMap = int32(1) } (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd = libc.Int64FromUint64(newElems) } if cmdIndex > 0 { if codeOffset < (*(*TCmdLocation)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr + uintptr(cmdIndex-int64(1))*32))).FcodeOffset { XTcl_Panic(tls, __ccgo_ts+24242, 0) } } cmdLocPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr + uintptr(cmdIndex)*32 (*TCmdLocation)(unsafe.Pointer(cmdLocPtr)).FcodeOffset = codeOffset (*TCmdLocation)(unsafe.Pointer(cmdLocPtr)).FsrcOffset = srcOffset (*TCmdLocation)(unsafe.Pointer(cmdLocPtr)).FnumSrcBytes = int64(-libc.Int32FromInt32(1)) (*TCmdLocation)(unsafe.Pointer(cmdLocPtr)).FnumCodeBytes = int64(-libc.Int32FromInt32(1)) } /* *---------------------------------------------------------------------- * * EnterCmdExtentData -- * * Registers the source and bytecode length for a command. This * information is used at runtime to map between instruction pc and * source locations. * * Results: * None. * * Side effects: * Inserts source and code length information into the compilation * environment envPtr for the command at index cmdIndex. Starting source * and bytecode information for the command must already have been * registered. * *---------------------------------------------------------------------- */ func _EnterCmdExtentData(tls *libc.TLS, envPtr uintptr, cmdIndex TTcl_Size, numSrcBytes TTcl_Size, numCodeBytes TTcl_Size) { bp := tls.Alloc(16) defer tls.Free(16) /* Offset of last byte of command code. */ var cmdLocPtr uintptr _ = cmdLocPtr if cmdIndex < 0 || cmdIndex >= (*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands { XTcl_Panic(tls, __ccgo_ts+24295, libc.VaList(bp+8, cmdIndex)) } if cmdIndex > (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapEnd { XTcl_Panic(tls, __ccgo_ts+24337, libc.VaList(bp+8, cmdIndex)) } cmdLocPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr + uintptr(cmdIndex)*32 (*TCmdLocation)(unsafe.Pointer(cmdLocPtr)).FnumSrcBytes = numSrcBytes (*TCmdLocation)(unsafe.Pointer(cmdLocPtr)).FnumCodeBytes = numCodeBytes } /* *---------------------------------------------------------------------- * TIP #280 * * EnterCmdWordData -- * * Registers the lines for the words of a command. This information is * used at runtime by 'info frame'. * * Results: * None. * * Side effects: * Inserts word location information into the compilation environment * envPtr for the command at index cmdIndex. The compilation * environment's ExtCmdLoc.ECL array is grown if necessary. * *---------------------------------------------------------------------- */ func _EnterCmdWordData(tls *libc.TLS, eclPtr uintptr, srcOffset TTcl_Size, tokenPtr uintptr, cmd uintptr, numWords TTcl_Size, line TTcl_Size, clNext uintptr, wlines uintptr, envPtr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var currElems, newBytes, newElems Tsize_t var ePtr, last, wwlines uintptr var wordIdx TTcl_Size var v1 uint64 var v3 int64 var _ /* wordLine at bp+0 */ TTcl_Size var _ /* wordNext at bp+8 */ uintptr _, _, _, _, _, _, _, _, _ = currElems, ePtr, last, newBytes, newElems, wordIdx, wwlines, v1, v3 if (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc >= (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnloc { /* * Expand the ECL array by allocating more storage from the heap. The * currently allocated ECL entries are stored from eclPtr->loc[0] up * to eclPtr->loc[eclPtr->nuloc-1] (inclusive). */ currElems = libc.Uint64FromInt64((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnloc) if currElems != 0 { v1 = uint64(2) * currElems } else { v1 = uint64(1) } newElems = v1 newBytes = newElems * uint64(32) (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc = XTcl_Realloc(tls, (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc, newBytes) (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnloc = libc.Int64FromUint64(newElems) } ePtr = (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Floc + uintptr((*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc)*32 (*TECL)(unsafe.Pointer(ePtr)).FsrcOffset = srcOffset (*TECL)(unsafe.Pointer(ePtr)).Fline = XTcl_Alloc(tls, libc.Uint64FromInt64(numWords)*uint64(8)) (*TECL)(unsafe.Pointer(ePtr)).Fnext = XTcl_Alloc(tls, libc.Uint64FromInt64(numWords)*uint64(8)) (*TECL)(unsafe.Pointer(ePtr)).Fnline = numWords wwlines = XTcl_Alloc(tls, libc.Uint64FromInt64(numWords)*uint64(8)) last = cmd *(*TTcl_Size)(unsafe.Pointer(bp)) = line *(*uintptr)(unsafe.Pointer(bp + 8)) = clNext wordIdx = 0 for { if !(wordIdx < numWords) { break } XTclAdvanceLines(tls, bp, last, (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart) XTclAdvanceContinuations(tls, bp, bp+8, int32(int64((*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart)-int64((*TCompileEnv)(unsafe.Pointer(envPtr)).Fsource))) /* See Ticket 4b61afd660 */ if wordIdx == 0 || XTclWordKnownAtCompileTime(tls, tokenPtr, libc.UintptrFromInt32(0)) != 0 { v3 = *(*TTcl_Size)(unsafe.Pointer(bp)) } else { v3 = int64(-int32(1)) } *(*TTcl_Size)(unsafe.Pointer(wwlines + uintptr(wordIdx)*8)) = v3 *(*TTcl_Size)(unsafe.Pointer((*TECL)(unsafe.Pointer(ePtr)).Fline + uintptr(wordIdx)*8)) = *(*TTcl_Size)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer((*TECL)(unsafe.Pointer(ePtr)).Fnext + uintptr(wordIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp + 8)) last = (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Fstart goto _2 _2: ; wordIdx++ tokenPtr += uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+int64(1)) * 32 } *(*uintptr)(unsafe.Pointer(wlines)) = wwlines (*TExtCmdLoc)(unsafe.Pointer(eclPtr)).Fnuloc++ } /* *---------------------------------------------------------------------- * * TclCreateExceptRange -- * * Procedure that allocates and initializes a new ExceptionRange * structure of the specified kind in a CompileEnv. * * Results: * Returns the index for the newly created ExceptionRange. * * Side effects: * If there is not enough room in the CompileEnv's ExceptionRange array, * the array in expanded: a new array of double the size is allocated, if * envPtr->mallocedExceptArray is non-zero the old array is freed, and * ExceptionRange entries are copied from the old array to the new one. * *---------------------------------------------------------------------- */ func XTclCreateExceptRange(tls *libc.TLS, type1 TExceptionRangeType, envPtr uintptr) (r TTcl_Size) { /* Points to CompileEnv for which to create a * new ExceptionRange structure. */ var auxPtr, newPtr, newPtr2, rangePtr uintptr var currBytes, currBytes2, newBytes, newBytes2, newElems Tsize_t var index TTcl_Size _, _, _, _, _, _, _, _, _, _ = auxPtr, currBytes, currBytes2, index, newBytes, newBytes2, newElems, newPtr, newPtr2, rangePtr index = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext if index >= (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayEnd { /* * Expand the ExceptionRange array. The currently allocated entries * are stored between elements 0 and (envPtr->exceptArrayNext - 1) * [inclusive]. */ currBytes = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) * uint64(56) currBytes2 = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) * uint64(80) newElems = libc.Uint64FromInt64(int64(2) * (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayEnd) newBytes = newElems * uint64(56) newBytes2 = newElems * uint64(80) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedExceptArray != 0 { (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr = XTcl_Realloc(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr, newBytes) (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr = XTcl_Realloc(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr, newBytes2) } else { /* * envPtr->exceptArrayPtr isn't a Tcl_Alloc'd pointer, so we must * code a Tcl_Realloc equivalent for ourselves. */ newPtr = XTcl_Alloc(tls, newBytes) newPtr2 = XTcl_Alloc(tls, newBytes2) libc.Xmemcpy(tls, newPtr, (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr, currBytes) libc.Xmemcpy(tls, newPtr2, (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr, currBytes2) (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr = newPtr (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr = newPtr2 (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedExceptArray = int32(1) } (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayEnd = libc.Int64FromUint64(newElems) } (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext++ rangePtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(index)*56 (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 = type1 (*TExceptionRange)(unsafe.Pointer(rangePtr)).FnestingLevel = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptDepth (*TExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset = int64(-libc.Int32FromInt32(1)) (*TExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes = int64(-libc.Int32FromInt32(1)) (*TExceptionRange)(unsafe.Pointer(rangePtr)).FbreakOffset = int64(-libc.Int32FromInt32(1)) (*TExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset = int64(-libc.Int32FromInt32(1)) (*TExceptionRange)(unsafe.Pointer(rangePtr)).FcatchOffset = int64(-libc.Int32FromInt32(1)) auxPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(index)*80 (*TExceptionAux)(unsafe.Pointer(auxPtr)).FsupportsContinue = int32(1) (*TExceptionAux)(unsafe.Pointer(auxPtr)).FstackDepth = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth (*TExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTarget = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexpandCount (*TExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTargetDepth = int64(-libc.Int32FromInt32(1)) (*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets = 0 (*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets = libc.UintptrFromInt32(0) (*TExceptionAux)(unsafe.Pointer(auxPtr)).FallocBreakTargets = 0 (*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets = 0 (*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets = libc.UintptrFromInt32(0) (*TExceptionAux)(unsafe.Pointer(auxPtr)).FallocContinueTargets = 0 return index } /* * --------------------------------------------------------------------- * * TclGetInnermostExceptionRange -- * * Returns the innermost exception range that covers the current code * creation point, and optionally the stack depth that is expected at * that point. Relies on the fact that the range has a numCodeBytes = -1 * when it is being populated and that inner ranges come after outer * ranges. * * --------------------------------------------------------------------- */ func XTclGetInnermostExceptionRange(tls *libc.TLS, envPtr uintptr, returnCode int32, auxPtrPtr uintptr) (r uintptr) { var i Tsize_t var rangePtr uintptr _, _ = i, rangePtr i = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext) rangePtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(i)*56 for i > uint64(0) { rangePtr -= 56 i-- if int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart) >= int64(int32((*TExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset)) && ((*TExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes == int64(-libc.Int32FromInt32(1)) || int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart) < int64(int32((*TExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset)+int32((*TExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes))) && (returnCode != int32(TCL_CONTINUE) || (*(*TExceptionAux)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(i)*80))).FsupportsContinue != 0) { if auxPtrPtr != 0 { *(*uintptr)(unsafe.Pointer(auxPtrPtr)) = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(i)*80 } return rangePtr } } return libc.UintptrFromInt32(0) } /* * --------------------------------------------------------------------- * * TclAddLoopBreakFixup, TclAddLoopContinueFixup -- * * Adds a place that wants to break/continue to the loop exception range * tracking that will be fixed up once the loop can be finalized. These * functions generate an INST_JUMP4 that is fixed up during the * loop finalization. * * --------------------------------------------------------------------- */ func XTclAddLoopBreakFixup(tls *libc.TLS, envPtr2 uintptr, auxPtr uintptr) { var delta1, range1, v13 int32 var v1 TTcl_Size var v10, v11, v12, v14, v2, v3, v4, v5, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = delta1, range1, v1, v10, v11, v12, v13, v14, v2, v3, v4, v5, v6, v7, v8, v9 range1 = int32((int64(auxPtr) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptAuxArrayPtr)) / 80) if (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).Ftype1 != int32(LOOP_EXCEPTION_RANGE) { XTcl_Panic(tls, __ccgo_ts+24392, 0) } v2 = auxPtr + 32 *(*TTcl_Size)(unsafe.Pointer(v2))++ v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) if v1 > (*TExceptionAux)(unsafe.Pointer(auxPtr)).FallocBreakTargets { *(*TTcl_Size)(unsafe.Pointer(auxPtr + 48)) *= int64(2) *(*TTcl_Size)(unsafe.Pointer(auxPtr + 48)) += int64(2) if (*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets != 0 { (*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets = XTcl_Realloc(tls, (*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets, uint64(8)*libc.Uint64FromInt64((*TExceptionAux)(unsafe.Pointer(auxPtr)).FallocBreakTargets)) } else { (*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt64((*TExceptionAux)(unsafe.Pointer(auxPtr)).FallocBreakTargets)) } } *(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr((*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets-int64(1))*8)) = libc.Uint64FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v13 = delta1 v14 = envPtr2 if v13 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v14)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v14)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v14)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v14)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v14 + 64)) += int64(v13) } } func XTclAddLoopContinueFixup(tls *libc.TLS, envPtr2 uintptr, auxPtr uintptr) { var delta1, range1, v13 int32 var v1 TTcl_Size var v10, v11, v12, v14, v2, v3, v4, v5, v6, v7, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = delta1, range1, v1, v10, v11, v12, v13, v14, v2, v3, v4, v5, v6, v7, v8, v9 range1 = int32((int64(auxPtr) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptAuxArrayPtr)) / 80) if (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(range1)*56))).Ftype1 != int32(LOOP_EXCEPTION_RANGE) { XTcl_Panic(tls, __ccgo_ts+24444, 0) } v2 = auxPtr + 56 *(*TTcl_Size)(unsafe.Pointer(v2))++ v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) if v1 > (*TExceptionAux)(unsafe.Pointer(auxPtr)).FallocContinueTargets { *(*TTcl_Size)(unsafe.Pointer(auxPtr + 72)) *= int64(2) *(*TTcl_Size)(unsafe.Pointer(auxPtr + 72)) += int64(2) if (*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets != 0 { (*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets = XTcl_Realloc(tls, (*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets, uint64(8)*libc.Uint64FromInt64((*TExceptionAux)(unsafe.Pointer(auxPtr)).FallocContinueTargets)) } else { (*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt64((*TExceptionAux)(unsafe.Pointer(auxPtr)).FallocContinueTargets)) } } *(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr((*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets-int64(1))*8)) = libc.Uint64FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v4 = envPtr2 + 152 v3 = *(*uintptr)(unsafe.Pointer(v4)) *(*uintptr)(unsafe.Pointer(v4))++ *(*uint8)(unsafe.Pointer(v3)) = libc.Uint8FromInt32(int32(INST_JUMP4)) v6 = envPtr2 + 152 v5 = *(*uintptr)(unsafe.Pointer(v6)) *(*uintptr)(unsafe.Pointer(v6))++ *(*uint8)(unsafe.Pointer(v5)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(24)) v8 = envPtr2 + 152 v7 = *(*uintptr)(unsafe.Pointer(v8)) *(*uintptr)(unsafe.Pointer(v8))++ *(*uint8)(unsafe.Pointer(v7)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(16)) v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0)) >> libc.Int32FromInt32(8)) v12 = envPtr2 + 152 v11 = *(*uintptr)(unsafe.Pointer(v12)) *(*uintptr)(unsafe.Pointer(v12))++ *(*uint8)(unsafe.Pointer(v11)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v13 = delta1 v14 = envPtr2 if v13 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v14)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v14)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v14)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v14)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v14 + 64)) += int64(v13) } } /* * --------------------------------------------------------------------- * * TclCleanupStackForBreakContinue -- * * Removes the extra elements from the auxiliary stack and the main stack. * How this is done depends on whether there are any elements on * the auxiliary stack to pop. * * --------------------------------------------------------------------- */ func XTclCleanupStackForBreakContinue(tls *libc.TLS, envPtr2 uintptr, auxPtr uintptr) { var delta1, toPop, v1, v11, v4, v6, v8 int32 var savedStackDepth Tsize_t var v10, v12, v2, v3, v5, v7, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = delta1, savedStackDepth, toPop, v1, v10, v11, v12, v2, v3, v4, v5, v6, v7, v8, v9 savedStackDepth = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcurrStackDepth) toPop = int32((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexpandCount - (*TExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTarget) if toPop > 0 { for { v1 = toPop toPop-- if !(v1 > 0) { break } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v3 = envPtr2 + 152 v2 = *(*uintptr)(unsafe.Pointer(v3)) *(*uintptr)(unsafe.Pointer(v3))++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(int32(INST_EXPAND_DROP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EXPAND_DROP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v4 = delta1 v5 = envPtr2 if v4 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v5)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v5)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v5)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v5)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v5 + 64)) += int64(v4) } } v6 = int32((*TExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTargetDepth - (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcurrStackDepth) v7 = envPtr2 if v6 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v7)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v7)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v7 + 64)) += int64(v6) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcurrStackDepth = (*TExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTargetDepth } toPop = int32((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcurrStackDepth - (*TExceptionAux)(unsafe.Pointer(auxPtr)).FstackDepth) for { v8 = toPop toPop-- if !(v8 > 0) { break } if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v10 = envPtr2 + 152 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(int32(INST_POP)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_POP)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v11 = delta1 v12 = envPtr2 if v11 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v12)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v12)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v12 + 64)) += int64(v11) } } (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcurrStackDepth = libc.Int64FromUint64(savedStackDepth) } /* * --------------------------------------------------------------------- * * StartExpanding -- * * Pushes an INST_EXPAND_START and does some additional housekeeping so * that the [break] and [continue] compilers can use an exception-free * issue to discard it. * * --------------------------------------------------------------------- */ func _StartExpanding(tls *libc.TLS, envPtr2 uintptr) { var auxPtr, rangePtr, v1, v2, v4 uintptr var delta1, i1, v3 int32 _, _, _, _, _, _, _, _ = auxPtr, delta1, i1, rangePtr, v1, v2, v3, v4 if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v2 = envPtr2 + 152 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ *(*uint8)(unsafe.Pointer(v1)) = libc.Uint8FromInt32(int32(INST_EXPAND_START)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EXPAND_START)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v3 = delta1 v4 = envPtr2 if v3 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v4)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v4)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v4 + 64)) += int64(v3) } /* * Update inner exception ranges with information about the environment * where this expansion started. */ i1 = 0 for { if !(i1 < int32((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayNext)) { break } rangePtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayPtr + uintptr(i1)*56 auxPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptAuxArrayPtr + uintptr(i1)*80 /* * Ignore loops unless they're still being built. */ if int64(int32((*TExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset)) > int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart) { goto _5 } if (*TExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes != int64(-libc.Int32FromInt32(1)) { goto _5 } /* * Adequate condition: loops further out and exceptions further in * don't actually need this information. */ if (*TExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTarget == (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexpandCount { (*TExceptionAux)(unsafe.Pointer(auxPtr)).FexpandTargetDepth = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcurrStackDepth } goto _5 _5: ; i1++ } /* * One more expansion is now being processed on the auxiliary stack. */ (*TCompileEnv)(unsafe.Pointer(envPtr2)).FexpandCount++ } /* * --------------------------------------------------------------------- * * TclFinalizeLoopExceptionRange -- * * Finalizes a loop exception range, binding the registered [break] and * [continue] implementations so that they jump to the correct place. * This must be called only after *all* the exception range * target offsets have been set. * * --------------------------------------------------------------------- */ func XTclFinalizeLoopExceptionRange(tls *libc.TLS, envPtr uintptr, range1 int32) { var auxPtr, rangePtr, site, v4 uintptr var i, j, offset int32 _, _, _, _, _, _, _ = auxPtr, i, j, offset, rangePtr, site, v4 rangePtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(range1)*56 auxPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(range1)*80 if (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 != int32(LOOP_EXCEPTION_RANGE) { XTcl_Panic(tls, __ccgo_ts+24499, 0) } /* * Do the jump fixups. Note that these are always issued as INST_JUMP4 so * there is no need to fuss around with updating code offsets. */ i = 0 for { if !(i < int32((*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets)) { break } site = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr(i)*8))) offset = libc.Int32FromUint64(libc.Uint64FromInt64((*TExceptionRange)(unsafe.Pointer(rangePtr)).FbreakOffset) - *(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr(i)*8))) *(*uint8)(unsafe.Pointer(site)) = libc.Uint8FromInt32(int32(INST_JUMP4)) *(*uint8)(unsafe.Pointer(site + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(offset) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(site + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(offset) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(site + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(offset) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(site + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(offset)) goto _1 _1: ; i++ } i = 0 for { if !(i < int32((*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets)) { break } site = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(*(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr(i)*8))) if (*TExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset == int64(-libc.Int32FromInt32(1)) { /* * WTF? Can't bind, so revert to an INST_CONTINUE. Not enough * space to do anything else. */ *(*uint8)(unsafe.Pointer(site)) = uint8(INST_CONTINUE) j = 0 for { if !(j < int32(4)) { break } site++ v4 = site *(*uint8)(unsafe.Pointer(v4)) = uint8(INST_NOP) goto _3 _3: ; j++ } } else { offset = libc.Int32FromUint64(libc.Uint64FromInt64((*TExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset) - *(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr(i)*8))) *(*uint8)(unsafe.Pointer(site)) = libc.Uint8FromInt32(int32(INST_JUMP4)) *(*uint8)(unsafe.Pointer(site + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(offset) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(site + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(offset) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(site + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(offset) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(site + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(offset)) } goto _2 _2: ; i++ } /* * Drop the arrays we were holding the only reference to. */ if (*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets != 0 { XTclpFree(tls, (*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets) (*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets = libc.UintptrFromInt32(0) (*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets = 0 } if (*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets != 0 { XTclpFree(tls, (*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets) (*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets = libc.UintptrFromInt32(0) (*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets = 0 } } /* *---------------------------------------------------------------------- * * TclCreateAuxData -- * * Allocates and initializes a new AuxData structure in a * CompileEnv's array of compilation auxiliary data records. These * AuxData records hold information created during compilation by * CompileProcs and used by instructions during execution. * * Results: * The index of the newly-created AuxData structure in the array. * * Side effects: * If there is not enough room in the CompileEnv's AuxData array, its size * is doubled. *---------------------------------------------------------------------- */ func XTclCreateAuxData(tls *libc.TLS, clientData uintptr, typePtr uintptr, envPtr uintptr) (r TTcl_Size) { /* Points to the CompileEnv for which a new * aux data structure is to be allocated. */ var auxDataPtr, newPtr uintptr var currBytes, newBytes, newElems Tsize_t var index TTcl_Size _, _, _, _, _, _ = auxDataPtr, currBytes, index, newBytes, newElems, newPtr /* Points to the new AuxData structure */ index = (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext if index >= (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayEnd { /* * Expand the AuxData array. The currently allocated entries are * stored between elements 0 and (envPtr->auxDataArrayNext - 1) * [inclusive]. */ currBytes = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext) * uint64(16) newElems = libc.Uint64FromInt64(int64(2) * (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayEnd) newBytes = newElems * uint64(16) if (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedAuxDataArray != 0 { (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr = XTcl_Realloc(tls, (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr, newBytes) } else { /* * envPtr->auxDataArrayPtr isn't a Tcl_Alloc'd pointer, so we must * code a Tcl_Realloc equivalent for ourselves. */ newPtr = XTcl_Alloc(tls, newBytes) libc.Xmemcpy(tls, newPtr, (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr, currBytes) (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr = newPtr (*TCompileEnv)(unsafe.Pointer(envPtr)).FmallocedAuxDataArray = int32(1) } (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayEnd = libc.Int64FromUint64(newElems) } (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext++ auxDataPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr + uintptr(index)*16 (*TAuxData)(unsafe.Pointer(auxDataPtr)).FclientData = clientData (*TAuxData)(unsafe.Pointer(auxDataPtr)).Ftype1 = typePtr return index } /* *---------------------------------------------------------------------- * * TclInitJumpFixupArray -- * * Initializes a JumpFixupArray structure to hold some number of jump * fixup entries. * * Results: * None. * * Side effects: * The JumpFixupArray structure is initialized. * *---------------------------------------------------------------------- */ func XTclInitJumpFixupArray(tls *libc.TLS, fixupArrayPtr uintptr) { /* Points to the JumpFixupArray structure to * initialize. */ (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup = fixupArrayPtr + 28 (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fnext = 0 (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fend = int64(libc.Int32FromInt32(JUMPFIXUP_INIT_ENTRIES) - libc.Int32FromInt32(1)) (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).FmallocedArray = 0 } /* *---------------------------------------------------------------------- * * TclExpandJumpFixupArray -- * * Uses malloc to allocate more storage for a jump fixup array. * * Results: * None. * * Side effects: * The jump fixup array in *fixupArrayPtr is reallocated to a new array * of double the size, and if fixupArrayPtr->mallocedArray is non-zero * the old array is freed. Jump fixup structures are copied from the old * array to the new one. * *---------------------------------------------------------------------- */ func XTclExpandJumpFixupArray(tls *libc.TLS, fixupArrayPtr uintptr) { /* Points to the JumpFixupArray structure to * enlarge. */ var currBytes, newBytes, newElems Tsize_t var newPtr uintptr _, _, _, _ = currBytes, newBytes, newElems, newPtr /* * The currently allocated jump fixup entries are stored from fixup[0] up * to fixup[fixupArrayPtr->fixupNext] (*not* inclusive). We assume * fixupArrayPtr->fixupNext is equal to fixupArrayPtr->fixupEnd. */ currBytes = libc.Uint64FromInt64((*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fnext) * uint64(16) newElems = libc.Uint64FromInt64(int64(2) * ((*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fend + int64(1))) newBytes = newElems * uint64(16) if (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).FmallocedArray != 0 { (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup = XTcl_Realloc(tls, (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup, newBytes) } else { /* * fixupArrayPtr->fixup isn't a Tcl_Alloc'd pointer, so we must code a * Tcl_Realloc equivalent for ourselves. */ newPtr = XTcl_Alloc(tls, newBytes) libc.Xmemcpy(tls, newPtr, (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup, currBytes) (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup = newPtr (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).FmallocedArray = int32(1) } (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Fend = libc.Int64FromUint64(newElems) } /* *---------------------------------------------------------------------- * * TclFreeJumpFixupArray -- * * Free any storage allocated in a jump fixup array structure. * * Results: * None. * * Side effects: * Allocated storage in the JumpFixupArray structure is freed. * *---------------------------------------------------------------------- */ func XTclFreeJumpFixupArray(tls *libc.TLS, fixupArrayPtr uintptr) { /* Points to the JumpFixupArray structure to * free. */ if (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).FmallocedArray != 0 { XTclpFree(tls, (*TJumpFixupArray)(unsafe.Pointer(fixupArrayPtr)).Ffixup) } } /* *---------------------------------------------------------------------- * * TclEmitForwardJump -- * * Emits a two-byte forward jump of kind "jumpType". Also initializes a * JumpFixup record with information about the jump. Since may later be * necessary to increase the size of the jump instruction to five bytes if * the jump target is more than, say, 127 bytes away. * * * Results: * None. * * Side effects: * The JumpFixup record pointed to by "jumpFixupPtr" is initialized with * information needed later if the jump is to be grown. Also, a two byte * jump of the designated type is emitted at the current point in the * bytecode stream. * *---------------------------------------------------------------------- */ func XTclEmitForwardJump(tls *libc.TLS, envPtr2 uintptr, jumpType TTclJumpType, jumpFixupPtr uintptr) { /* Points to the JumpFixup structure to * initialize with information about this * forward jump. */ var delta1, v12, v18, v24 int32 var v10, v11, v13, v14, v15, v16, v17, v19, v20, v21, v22, v23, v25, v8, v9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = delta1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v8, v9 /* * Initialize the JumpFixup structure: * - codeOffset is offset of first byte of jump below * - cmdIndex is index of the command after the current one * - exceptIndex is the index of the first ExceptionRange after the * current one. */ (*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FjumpType = jumpType (*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset = libc.Uint32FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeStart)) (*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcmdIndex = int32((*TCompileEnv)(unsafe.Pointer(envPtr2)).FnumCommands) (*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FexceptIndex = int32((*TCompileEnv)(unsafe.Pointer(envPtr2)).FexceptArrayNext) switch jumpType { case int32(TCL_UNCONDITIONAL_JUMP): goto _1 case int32(TCL_TRUE_JUMP): goto _2 default: goto _3 } goto _4 _1: ; _7: ; if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(INST_JUMP1)) v11 = envPtr2 + 152 v10 = *(*uintptr)(unsafe.Pointer(v11)) *(*uintptr)(unsafe.Pointer(v11))++ *(*uint8)(unsafe.Pointer(v10)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v12 = delta1 v13 = envPtr2 if v12 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v13)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v13)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v13 + 64)) += int64(v12) } goto _6 _6: ; if 0 != 0 { goto _7 } goto _5 _5: ; goto _4 _2: ; if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_TRUE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v18 = delta1 v19 = envPtr2 if v18 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v19)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v19)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v19 + 64)) += int64(v18) } goto _4 _3: ; if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) v23 = envPtr2 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0))) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_JUMP_FALSE1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v24 = delta1 v25 = envPtr2 if v24 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v25)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v25)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v25 + 64)) += int64(v24) } goto _4 _4: } /* *---------------------------------------------------------------------- * * TclFixupForwardJump -- * * Modifies a previously-emitted forward jump to jump a specified number * of bytes, "jumpDist". If necessary, the size of the jump instruction is * increased from two to five bytes. This is done if the jump distance is * greater than "distThreshold" (normally 127 bytes). The jump is * described by a JumpFixup record previously initialized by * TclEmitForwardJump. * * Results: * 1 if the jump was grown and subsequent instructions had to be moved, or * 0 otherwsie. This allows callers to update any additional code offsets * they may hold. * * Side effects: * The jump may be grown and subsequent instructions moved. If this * happens, the code offsets for any commands and any ExceptionRange * records between the jump and the current code address will be updated * to reflect the moved code. Also, the bytecode instruction array in the * CompileEnv structure may be grown and reallocated. * *---------------------------------------------------------------------- */ func XTclFixupForwardJump(tls *libc.TLS, envPtr uintptr, jumpFixupPtr uintptr, jumpDist int32, distThreshold int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Maximum distance before the two byte jump * is grown to five bytes. */ var auxPtr, jumpPc, p, rangePtr uintptr var firstCmd, firstRange, i, k, lastCmd, lastRange int32 var numBytes Tsize_t _, _, _, _, _, _, _, _, _, _, _ = auxPtr, firstCmd, firstRange, i, jumpPc, k, lastCmd, lastRange, numBytes, p, rangePtr if jumpDist <= distThreshold { jumpPc = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset) switch (*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FjumpType { case int32(TCL_UNCONDITIONAL_JUMP): goto _1 case int32(TCL_TRUE_JUMP): goto _2 default: goto _3 } goto _4 _1: ; _7: ; *(*uint8)(unsafe.Pointer(jumpPc)) = libc.Uint8FromInt32(int32(INST_JUMP1)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDist)) goto _6 _6: ; if 0 != 0 { goto _7 } goto _5 _5: ; goto _4 _2: ; *(*uint8)(unsafe.Pointer(jumpPc)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE1)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDist)) goto _4 _3: ; *(*uint8)(unsafe.Pointer(jumpPc)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE1)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDist)) goto _4 _4: ; return 0 } /* * Increase the size of the jump instruction, and then move subsequent * instructions down. Expanding the space for generated instructions means * that code addresses might change. Be careful about updating any of * these addresses held in variables. */ if (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext+uintptr(3) > (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeEnd { XTclExpandCodeArray(tls, envPtr) } jumpPc = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr((*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset) numBytes = libc.Uint64FromInt64(int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64(jumpPc) - int64(2)) p = jumpPc + uintptr(2) libc.Xmemmove(tls, p+uintptr(3), p, numBytes) *(*uintptr)(unsafe.Pointer(envPtr + 152)) += uintptr(3) jumpDist += int32(3) switch (*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FjumpType { case int32(TCL_UNCONDITIONAL_JUMP): goto _8 case int32(TCL_TRUE_JUMP): goto _9 default: goto _10 } goto _11 _8: ; _14: ; *(*uint8)(unsafe.Pointer(jumpPc)) = libc.Uint8FromInt32(int32(INST_JUMP4)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDist) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDist) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(jumpDist) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(jumpDist)) goto _13 _13: ; if 0 != 0 { goto _14 } goto _12 _12: ; goto _11 _9: ; *(*uint8)(unsafe.Pointer(jumpPc)) = libc.Uint8FromInt32(int32(INST_JUMP_TRUE4)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDist) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDist) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(jumpDist) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(jumpDist)) goto _11 _10: ; *(*uint8)(unsafe.Pointer(jumpPc)) = libc.Uint8FromInt32(int32(INST_JUMP_FALSE4)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDist) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(jumpDist) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(jumpDist) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(jumpPc + libc.UintptrFromInt32(1) + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(jumpDist)) goto _11 _11: ; /* * Adjust the code offsets for any commands and any ExceptionRange records * between the jump and the current code address. */ firstCmd = (*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcmdIndex lastCmd = int32((*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands - int64(1)) if firstCmd < lastCmd { k = firstCmd for { if !(k <= lastCmd) { break } (*(*TCmdLocation)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr + uintptr(k)*32))).FcodeOffset += int64(3) goto _15 _15: ; k++ } } firstRange = (*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FexceptIndex lastRange = int32((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext - int64(1)) k = firstRange for { if !(k <= lastRange) { break } rangePtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayPtr + uintptr(k)*56 *(*TTcl_Size)(unsafe.Pointer(rangePtr + 16)) += int64(3) switch (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 { case int32(LOOP_EXCEPTION_RANGE): *(*TTcl_Size)(unsafe.Pointer(rangePtr + 32)) += int64(3) if (*TExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset != int64(-libc.Int32FromInt32(1)) { *(*TTcl_Size)(unsafe.Pointer(rangePtr + 40)) += int64(3) } case int32(CATCH_EXCEPTION_RANGE): *(*TTcl_Size)(unsafe.Pointer(rangePtr + 48)) += int64(3) default: XTcl_Panic(tls, __ccgo_ts+24541, libc.VaList(bp+8, (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1)) } goto _16 _16: ; k++ } k = 0 for { if !(k < int32((*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext)) { break } auxPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr + uintptr(k)*80 i = 0 for { if !(i < int32((*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets)) { break } if uint64((*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset) < *(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr(i)*8)) { *(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr(i)*8)) += uint64(3) } goto _18 _18: ; i++ } i = 0 for { if !(i < int32((*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets)) { break } if uint64((*TJumpFixup)(unsafe.Pointer(jumpFixupPtr)).FcodeOffset) < *(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr(i)*8)) { *(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr(i)*8)) += uint64(3) } goto _19 _19: ; i++ } goto _17 _17: ; k++ } return int32(1) /* the jump was grown */ } /* *---------------------------------------------------------------------- * * TclEmitInvoke -- * * Emits one of the invoke-related instructions, wrapping it if necessary * in code that ensures that any break or continue operation passing * through it gets the stack unwinding correct, converting it into an * internal jump if in an appropriate context. * * Results: * None * * Side effects: * Issues the jump with all correct stack management. May create another * loop exception range. Pointers to ExceptionRange and ExceptionAux * structures should not be held across this call. * *---------------------------------------------------------------------- */ func XTclEmitInvoke(tls *libc.TLS, envPtr3 uintptr, opcode int32, va uintptr) { bp := tls.Alloc(64) defer tls.Free(64) var arg1, arg2, breakRange, cleanup, continueRange, delta1, depth1, expandCount, loopRange, wordCount, v1, v10, v2, v26, v3, v38, v4, v42, v44, v48, v5, v52, v6, v64, v68, v7, v70, v72, v74, v76, v8, v9 int32 var argList Tva_list var rangePtr, v22, v23, v24, v25, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v39, v40, v41, v43, v45, v46, v47, v49, v50, v51, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v65, v66, v67, v69, v71, v73, v75, v77, v79 uintptr var savedExpandCount, savedStackDepth, v78 Tsize_t var v11 int64 var _ /* auxBreakPtr at bp+0 */ uintptr var _ /* auxContinuePtr at bp+8 */ uintptr var _ /* nonTrapFixup at bp+16 */ TJumpFixup _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = arg1, arg2, argList, breakRange, cleanup, continueRange, delta1, depth1, expandCount, loopRange, rangePtr, savedExpandCount, savedStackDepth, wordCount, v1, v10, v11, v2, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v9 wordCount = 0 expandCount = 0 loopRange = 0 breakRange = 0 continueRange = 0 depth1 = int32((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) /* * Parse the arguments. */ argList = va switch opcode { case int32(INST_INVOKE_STK1): v2 = libc.VaInt32(&argList) cleanup = v2 v1 = v2 arg1 = v1 wordCount = v1 arg2 = 0 case int32(INST_INVOKE_STK4): v4 = libc.VaInt32(&argList) cleanup = v4 v3 = v4 arg1 = v3 wordCount = v3 arg2 = 0 case int32(INST_INVOKE_REPLACE): arg1 = libc.VaInt32(&argList) arg2 = libc.VaInt32(&argList) wordCount = arg1 + arg2 - int32(1) cleanup = arg1 + int32(1) default: XTcl_Panic(tls, __ccgo_ts+24589, 0) fallthrough case int32(INST_EVAL_STK): v5 = libc.Int32FromInt32(1) cleanup = v5 wordCount = v5 v6 = libc.Int32FromInt32(0) arg2 = v6 arg1 = v6 case int32(INST_RETURN_STK): v7 = libc.Int32FromInt32(2) cleanup = v7 wordCount = v7 v8 = libc.Int32FromInt32(0) arg2 = v8 arg1 = v8 case int32(INST_INVOKE_EXPANDED): v10 = libc.VaInt32(&argList) cleanup = v10 v9 = v10 arg1 = v9 wordCount = v9 arg2 = 0 expandCount = int32(1) break } _ = argList /* * If the exceptions is for break or continue handle it with special * handling exception range so the stack may be correctly unwound. * * These must be done separately since they can be different, especially * for calls from inside a [for] increment clause. */ rangePtr = XTclGetInnermostExceptionRange(tls, envPtr3, int32(TCL_CONTINUE), bp+8) if rangePtr == libc.UintptrFromInt32(0) || (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 != int32(LOOP_EXCEPTION_RANGE) { *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0) } else { if (*TExceptionAux)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FstackDepth == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth-int64(wordCount) && (*TExceptionAux)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FexpandTarget+int64(expandCount) == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexpandCount { *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0) } else { continueRange = int32((int64(*(*uintptr)(unsafe.Pointer(bp + 8))) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptAuxArrayPtr)) / 80) } } rangePtr = XTclGetInnermostExceptionRange(tls, envPtr3, int32(TCL_BREAK), bp) if rangePtr == libc.UintptrFromInt32(0) || (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 != int32(LOOP_EXCEPTION_RANGE) { *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) } else { if *(*uintptr)(unsafe.Pointer(bp + 8)) == libc.UintptrFromInt32(0) && (*TExceptionAux)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FstackDepth+int64(wordCount) == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth && (*TExceptionAux)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FexpandTarget+int64(expandCount) == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexpandCount { *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) } else { breakRange = int32((int64(*(*uintptr)(unsafe.Pointer(bp))) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptAuxArrayPtr)) / 80) } } if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) || *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { loopRange = int32(XTclCreateExceptRange(tls, int32(LOOP_EXCEPTION_RANGE), envPtr3)) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth++ if libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth)+uint64(1) > libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FmaxExceptDepth)+uint64(1) { v11 = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth } else { v11 = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FmaxExceptDepth } (*TCompileEnv)(unsafe.Pointer(envPtr3)).FmaxExceptDepth = v11 (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(loopRange)*56))).FcodeOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) } /* * Issue the invoke itself. */ switch opcode { case int32(INST_INVOKE_STK1): goto _12 case int32(INST_INVOKE_STK4): goto _13 case int32(INST_INVOKE_EXPANDED): goto _14 case int32(INST_EVAL_STK): goto _15 case int32(INST_RETURN_STK): goto _16 case int32(INST_INVOKE_REPLACE): goto _17 } goto _18 _12: ; _21: ; if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v23 = envPtr3 + 152 v22 = *(*uintptr)(unsafe.Pointer(v23)) *(*uintptr)(unsafe.Pointer(v23))++ *(*uint8)(unsafe.Pointer(v22)) = libc.Uint8FromInt32(int32(INST_INVOKE_STK1)) v25 = envPtr3 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = uint8(libc.Uint32FromInt32(arg1)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INVOKE_STK1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - arg1 } v26 = delta1 v27 = envPtr3 if v26 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v27)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v27)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v27 + 64)) += int64(v26) } goto _20 _20: ; if 0 != 0 { goto _21 } goto _19 _19: ; goto _18 _13: ; if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v29 = envPtr3 + 152 v28 = *(*uintptr)(unsafe.Pointer(v29)) *(*uintptr)(unsafe.Pointer(v29))++ *(*uint8)(unsafe.Pointer(v28)) = libc.Uint8FromInt32(int32(INST_INVOKE_STK4)) v31 = envPtr3 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = uint8(libc.Uint32FromInt32(arg1) >> libc.Int32FromInt32(24)) v33 = envPtr3 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(arg1) >> libc.Int32FromInt32(16)) v35 = envPtr3 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(arg1) >> libc.Int32FromInt32(8)) v37 = envPtr3 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(arg1)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INVOKE_STK4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - arg1 } v38 = delta1 v39 = envPtr3 if v38 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v39)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v39)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v39 + 64)) += int64(v38) } goto _18 _14: ; if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v41 = envPtr3 + 152 v40 = *(*uintptr)(unsafe.Pointer(v41)) *(*uintptr)(unsafe.Pointer(v41))++ *(*uint8)(unsafe.Pointer(v40)) = libc.Uint8FromInt32(int32(INST_INVOKE_EXPANDED)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INVOKE_EXPANDED)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v42 = delta1 v43 = envPtr3 if v42 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v43)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v43)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v43 + 64)) += int64(v42) } (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexpandCount-- v44 = int32(1) - arg1 v45 = envPtr3 if v44 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v45)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v45)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v45 + 64)) += int64(v44) goto _18 _15: ; if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v47 = envPtr3 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = libc.Uint8FromInt32(int32(INST_EVAL_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_EVAL_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v48 = delta1 v49 = envPtr3 if v48 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v49 + 64)) += int64(v48) } goto _18 _16: ; if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v51 = envPtr3 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = libc.Uint8FromInt32(int32(INST_RETURN_STK)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_RETURN_STK)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - 0 } v52 = delta1 v53 = envPtr3 if v52 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v53)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v53)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v53 + 64)) += int64(v52) } goto _18 _17: ; if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v55 = envPtr3 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = libc.Uint8FromInt32(int32(INST_INVOKE_REPLACE)) v57 = envPtr3 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(arg1) >> libc.Int32FromInt32(24)) v59 = envPtr3 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(arg1) >> libc.Int32FromInt32(16)) v61 = envPtr3 + 152 v60 = *(*uintptr)(unsafe.Pointer(v61)) *(*uintptr)(unsafe.Pointer(v61))++ *(*uint8)(unsafe.Pointer(v60)) = uint8(libc.Uint32FromInt32(arg1) >> libc.Int32FromInt32(8)) v63 = envPtr3 + 152 v62 = *(*uintptr)(unsafe.Pointer(v63)) *(*uintptr)(unsafe.Pointer(v63))++ *(*uint8)(unsafe.Pointer(v62)) = uint8(libc.Uint32FromInt32(arg1)) if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr3)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_INVOKE_REPLACE)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - arg1 } v64 = delta1 v65 = envPtr3 if v64 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v65)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v65)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v65 + 64)) += int64(v64) } if (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext == (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeEnd { XTclExpandCodeArray(tls, envPtr3) } v67 = envPtr3 + 152 v66 = *(*uintptr)(unsafe.Pointer(v67)) *(*uintptr)(unsafe.Pointer(v67))++ *(*uint8)(unsafe.Pointer(v66)) = uint8(libc.Uint32FromInt32(arg2)) v68 = -int32(1) v69 = envPtr3 if v68 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v69)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v69)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v69 + 64)) += int64(v68) /* Correction to stack depth calcs */ goto _18 _18: ; /* * If we're generating a special wrapper exception range, we need to * finish that up now. */ if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) || *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { savedStackDepth = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth) savedExpandCount = libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexpandCount) if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptAuxArrayPtr + uintptr(breakRange)*80 } if *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp + 8)) = (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptAuxArrayPtr + uintptr(continueRange)*80 } (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptDepth-- (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(loopRange)*56))).FnumCodeBytes = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) - int64(int32((*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(loopRange)*56))).FcodeOffset)) XTclEmitForwardJump(tls, envPtr3, int32(TCL_UNCONDITIONAL_JUMP), bp+16) /* * Careful! When generating these stack unwinding sequences, the depth * of stack in the cases where they are taken is not the same as if * the exception is not taken. */ if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { v70 = -int32(1) v71 = envPtr3 if v70 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v71)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v71)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v71 + 64)) += int64(v70) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(loopRange)*56))).FbreakOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) XTclCleanupStackForBreakContinue(tls, envPtr3, *(*uintptr)(unsafe.Pointer(bp))) XTclAddLoopBreakFixup(tls, envPtr3, *(*uintptr)(unsafe.Pointer(bp))) v72 = int32(1) v73 = envPtr3 if v72 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v73)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v73)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v73)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v73)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v73 + 64)) += int64(v72) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth = libc.Int64FromUint64(savedStackDepth) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexpandCount = libc.Int64FromUint64(savedExpandCount) } if *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { v74 = -int32(1) v75 = envPtr3 if v74 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v75)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v75)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v75)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v75)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v75 + 64)) += int64(v74) (*(*TExceptionRange)(unsafe.Pointer((*TCompileEnv)(unsafe.Pointer(envPtr3)).FexceptArrayPtr + uintptr(loopRange)*56))).FcontinueOffset = int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart) XTclCleanupStackForBreakContinue(tls, envPtr3, *(*uintptr)(unsafe.Pointer(bp + 8))) XTclAddLoopContinueFixup(tls, envPtr3, *(*uintptr)(unsafe.Pointer(bp + 8))) v76 = int32(1) v77 = envPtr3 if v76 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v77)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v77)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v77 + 64)) += int64(v76) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FcurrStackDepth = libc.Int64FromUint64(savedStackDepth) (*TCompileEnv)(unsafe.Pointer(envPtr3)).FexpandCount = libc.Int64FromUint64(savedExpandCount) } XTclFinalizeLoopExceptionRange(tls, envPtr3, loopRange) XTclFixupForwardJump(tls, envPtr3, bp+16, int32(int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeNext)-int64((*TCompileEnv)(unsafe.Pointer(envPtr3)).FcodeStart)-int64(libc.Int32FromUint32((*TJumpFixup)(unsafe.Pointer(bp+16)).FcodeOffset))), int32(127)) } v78 = libc.Uint64FromInt32(depth1 + int32(1) - cleanup) v79 = envPtr3 if v78 != libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v79)).FcurrStackDepth) { XTcl_Panic(tls, __ccgo_ts+21474, libc.VaList(bp+40, libc.Uint64FromInt64((*TCompileEnv)(unsafe.Pointer(v79)).FcurrStackDepth), v78)) } } /* *---------------------------------------------------------------------- * * TclGetInstructionTable -- * * Returns a pointer to the table describing Tcl bytecode instructions. * This procedure is defined so that clients can access the pointer from * outside the TCL DLLs. * * Results: * Returns a pointer to the global instruction table, same as the * expression (&tclInstructionTable[0]). * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclGetInstructionTable(tls *libc.TLS) (r uintptr) { return uintptr(unsafe.Pointer(&XtclInstructionTable)) } /* *---------------------------------------------------------------------- * * GetCmdLocEncodingSize -- * * Computes the total number of bytes needed to encode the command * location information for some compiled code. * * Results: * The byte count needed to encode the compiled location information. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _GetCmdLocEncodingSize(tls *libc.TLS, envPtr uintptr) (r int32) { /* Points to compilation environment structure * containing the CmdLocation structure to * encode. */ var codeDelta, codeDeltaNext, codeLen, codeLengthNext, i, numCmds, prevCodeOffset, prevSrcOffset, srcDelta, srcDeltaNext, srcLen, srcLengthNext, v1, v2, v3, v4 int32 var mapPtr uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = codeDelta, codeDeltaNext, codeLen, codeLengthNext, i, mapPtr, numCmds, prevCodeOffset, prevSrcOffset, srcDelta, srcDeltaNext, srcLen, srcLengthNext, v1, v2, v3, v4 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr numCmds = int32((*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands) v3 = libc.Int32FromInt32(0) srcLengthNext = v3 v2 = v3 srcDeltaNext = v2 v1 = v2 codeLengthNext = v1 codeDeltaNext = v1 v4 = libc.Int32FromInt32(0) prevSrcOffset = v4 prevCodeOffset = v4 i = 0 for { if !(i < numCmds) { break } codeDelta = int32((*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FcodeOffset - int64(prevCodeOffset)) if codeDelta < 0 { XTcl_Panic(tls, __ccgo_ts+24607, 0) } else { if codeDelta <= int32(127) { codeDeltaNext++ } else { codeDeltaNext += int32(5) /* 1 byte for 0xFF, 4 for positive delta */ } } prevCodeOffset = int32((*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FcodeOffset) codeLen = int32((*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FnumCodeBytes) if codeLen < 0 { XTcl_Panic(tls, __ccgo_ts+24646, 0) } else { if codeLen <= int32(127) { codeLengthNext++ } else { codeLengthNext += int32(5) /* 1 byte for 0xFF, 4 for length */ } } srcDelta = int32((*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FsrcOffset - int64(prevSrcOffset)) if -int32(127) <= srcDelta && srcDelta <= int32(127) && srcDelta != -int32(1) { srcDeltaNext++ } else { srcDeltaNext += int32(5) /* 1 byte for 0xFF, 4 for delta */ } prevSrcOffset = int32((*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FsrcOffset) srcLen = int32((*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FnumSrcBytes) if srcLen < 0 { XTcl_Panic(tls, __ccgo_ts+24685, 0) } else { if srcLen <= int32(127) { srcLengthNext++ } else { srcLengthNext += int32(5) /* 1 byte for 0xFF, 4 for length */ } } goto _5 _5: ; i++ } return codeDeltaNext + codeLengthNext + srcDeltaNext + srcLengthNext } /* *---------------------------------------------------------------------- * * EncodeCmdLocMap -- * * Encodes the command location information for some compiled code into a * ByteCode structure. The encoded command location map is stored as * three-adjacent-byte sequences. * * Results: * A pointer to the first byte after the encoded command location * information. * * Side effects: * Stores encoded information into the block of memory headed by * codePtr. Also records pointers to the start of the four byte sequences * in fields in codePtr's ByteCode header structure. * *---------------------------------------------------------------------- */ func _EncodeCmdLocMap(tls *libc.TLS, envPtr uintptr, codePtr uintptr, startPtr uintptr) (r uintptr) { /* Points to the first byte in codePtr's * memory block where the location information * is to be stored. */ var codeDelta, codeLen, i, numCmds, prevOffset, srcLen TTcl_Size var mapPtr, p uintptr var srcDelta int32 _, _, _, _, _, _, _, _, _ = codeDelta, codeLen, i, mapPtr, numCmds, p, prevOffset, srcDelta, srcLen mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcmdMapPtr numCmds = (*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands p = startPtr /* * Encode the code offset for each command as a sequence of deltas. */ (*TByteCode)(unsafe.Pointer(codePtr)).FcodeDeltaStart = p prevOffset = 0 i = 0 for { if !(i < numCmds) { break } codeDelta = (*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FcodeOffset - prevOffset if codeDelta < 0 { XTcl_Panic(tls, __ccgo_ts+24726, 0) } else { if codeDelta <= int64(127) { *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt64(codeDelta)) p++ } else { *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0xFF))) p++ *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt64(codeDelta) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(codeDelta) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(codeDelta) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(codeDelta)) p += uintptr(4) } } prevOffset = (*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FcodeOffset goto _1 _1: ; i++ } /* * Encode the code length for each command. */ (*TByteCode)(unsafe.Pointer(codePtr)).FcodeLengthStart = p i = 0 for { if !(i < numCmds) { break } codeLen = (*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FnumCodeBytes if codeLen < 0 { XTcl_Panic(tls, __ccgo_ts+24759, 0) } else { if codeLen <= int64(127) { *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt64(codeLen)) p++ } else { *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0xFF))) p++ *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt64(codeLen) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(codeLen) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(codeLen) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(codeLen)) p += uintptr(4) } } goto _2 _2: ; i++ } /* * Encode the source offset for each command as a sequence of deltas. */ (*TByteCode)(unsafe.Pointer(codePtr)).FsrcDeltaStart = p prevOffset = 0 i = 0 for { if !(i < numCmds) { break } srcDelta = int32((*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FsrcOffset - prevOffset) if -int32(127) <= srcDelta && srcDelta <= int32(127) && srcDelta != -int32(1) { *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt32(srcDelta)) p++ } else { *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0xFF))) p++ *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt32(srcDelta) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt32(srcDelta) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt32(srcDelta) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt32(srcDelta)) p += uintptr(4) } prevOffset = (*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FsrcOffset goto _3 _3: ; i++ } /* * Encode the source length for each command. */ (*TByteCode)(unsafe.Pointer(codePtr)).FsrcLengthStart = p i = 0 for { if !(i < numCmds) { break } srcLen = (*(*TCmdLocation)(unsafe.Pointer(mapPtr + uintptr(i)*32))).FnumSrcBytes if srcLen < 0 { XTcl_Panic(tls, __ccgo_ts+24792, 0) } else { if srcLen <= int64(127) { *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt64(srcLen)) p++ } else { *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt32(libc.Int32FromInt32(0xFF))) p++ *(*uint8)(unsafe.Pointer(p)) = uint8(libc.Uint32FromInt64(srcLen) >> libc.Int32FromInt32(24)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(1))) = uint8(libc.Uint32FromInt64(srcLen) >> libc.Int32FromInt32(16)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(2))) = uint8(libc.Uint32FromInt64(srcLen) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(p + libc.UintptrFromInt32(3))) = uint8(libc.Uint32FromInt64(srcLen)) p += uintptr(4) } } goto _4 _4: ; i++ } return p } const ASSOC_KEY = "tclPackageAboutDict" /* Epoch of the tcl environment * (if changed with tcl-env). */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* * Internal structure to hold embedded configuration information. * * Our structure is a two-level dictionary associated with the 'interp'. The * first level is keyed with the package name and maps to the dictionary for * that package. The package dictionary is keyed with metadata keys and maps * to the metadata value for that key. This is package specific. The metadata * values are in UTF-8, converted from the external representation given to us * by the caller. */ /* * A ClientData struct for the QueryConfig command. Store the three bits * of data we need; the package name for which we store a config dict, * the (Tcl_Interp *) in which it is stored, and the encoding. */ type TQCCD = struct { Fpkg uintptr Finterp uintptr Fencoding uintptr } /* *---------------------------------------------------------------------- * * Tcl_RegisterConfig -- * * See TIP#59 for details on what this function does. * * Results: * None. * * Side effects: * Creates namespace and cfg query command in it as per TIP #59. * *---------------------------------------------------------------------- */ func XTcl_RegisterConfig(tls *libc.TLS, interp uintptr, pkgName uintptr, configuration uintptr, valEncoding uintptr) { bp := tls.Alloc(272) defer tls.Free(272) /* Name of the encoding used to store the * configuration values, ASCII, thus UTF-8. */ var cdPtr, cfg, pDB uintptr var _ /* cmdName at bp+8 */ TTcl_DString var _ /* pkgDict at bp+0 */ uintptr _, _, _ = cdPtr, cfg, pDB cdPtr = XTcl_Alloc(tls, uint64(24)) (*TQCCD)(unsafe.Pointer(cdPtr)).Finterp = interp if valEncoding != 0 { (*TQCCD)(unsafe.Pointer(cdPtr)).Fencoding = XTcl_Alloc(tls, libc.Xstrlen(tls, valEncoding)+uint64(1)) libc.Xstrcpy(tls, (*TQCCD)(unsafe.Pointer(cdPtr)).Fencoding, valEncoding) } else { (*TQCCD)(unsafe.Pointer(cdPtr)).Fencoding = libc.UintptrFromInt32(0) } (*TQCCD)(unsafe.Pointer(cdPtr)).Fpkg = XTcl_NewStringObj(tls, pkgName, int64(-int32(1))) /* * Phase I: Adding the provided information to the internal database of * package meta data. * * Phase II: Create a command for querying this database, specific to the * package registering its configuration. This is the approved interface * in TIP 59. In the future a more general interface should be done, as * follow-up to TIP 59. Simply because our database is now general across * packages, and not a structure tied to one package. * * Note, the created command will have a reference through its clientdata. */ (*TTcl_Obj)(unsafe.Pointer((*TQCCD)(unsafe.Pointer(cdPtr)).Fpkg)).FrefCount++ /* * For venc == NULL aka bogus encoding we skip the step setting up the * dictionaries visible at Tcl level. I.e. they are not filled */ pDB = _GetConfigDict(tls, interp) /* * Retrieve package specific configuration... */ if XTcl_DictObjGet(tls, interp, pDB, (*TQCCD)(unsafe.Pointer(cdPtr)).Fpkg, bp) != TCL_OK || *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = XTcl_NewDictObj(tls) } else { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount > int64(1) { *(*uintptr)(unsafe.Pointer(bp)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp))) } } /* * Extend the package configuration... * We cannot assume that the encodings are initialized, therefore * store the value as-is in a byte array. See Bug [9b2e636361]. */ cfg = configuration for { if !((*TTcl_Config)(unsafe.Pointer(cfg)).Fkey != libc.UintptrFromInt32(0) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TTcl_Config)(unsafe.Pointer(cfg)).Fkey))) != int32('\000')) { break } XTclDictPut(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), (*TTcl_Config)(unsafe.Pointer(cfg)).Fkey, XTcl_NewByteArrayObj(tls, (*TTcl_Config)(unsafe.Pointer(cfg)).Fvalue, libc.Int64FromUint64(libc.Xstrlen(tls, (*TTcl_Config)(unsafe.Pointer(cfg)).Fvalue)))) goto _1 _1: ; cfg += 16 } /* * Write the changes back into the overall database. */ XTcl_DictObjPut(tls, interp, pDB, (*TQCCD)(unsafe.Pointer(cdPtr)).Fpkg, *(*uintptr)(unsafe.Pointer(bp))) /* * Now create the interface command for retrieval of the package * information. */ XTcl_DStringInit(tls, bp+8) XTcl_DStringAppend(tls, bp+8, __ccgo_ts+7650, libc.Int64FromUint64(libc.Uint64FromInt64(3)-libc.Uint64FromInt32(1))) XTcl_DStringAppend(tls, bp+8, pkgName, int64(-int32(1))) /* * The incomplete command name is the name of the namespace to place it * in. */ if XTcl_FindNamespace(tls, interp, (*TTcl_DString)(unsafe.Pointer(bp+8)).Fstring1, libc.UintptrFromInt32(0), int32(TCL_GLOBAL_ONLY)) == libc.UintptrFromInt32(0) { if XTcl_CreateNamespace(tls, interp, (*TTcl_DString)(unsafe.Pointer(bp+8)).Fstring1, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0)) == libc.UintptrFromInt32(0) { XTcl_Panic(tls, __ccgo_ts+24827, libc.VaList(bp+240, XTcl_GetStringFromObj(tls, XTcl_GetObjResult(tls, interp), libc.UintptrFromInt32(0)), __ccgo_ts+24838, __ccgo_ts+24857)) } } XTcl_DStringAppend(tls, bp+8, __ccgo_ts+24911, libc.Int64FromUint64(libc.Uint64FromInt64(12)-libc.Uint64FromInt32(1))) if XTcl_CreateObjCommand(tls, interp, (*TTcl_DString)(unsafe.Pointer(bp+8)).Fstring1, __ccgo_fp(_QueryConfigObjCmd), cdPtr, __ccgo_fp(_QueryConfigDelete)) == libc.UintptrFromInt32(0) { XTcl_Panic(tls, __ccgo_ts+24923, libc.VaList(bp+240, __ccgo_ts+24838, __ccgo_ts+24930)) } XTcl_DStringFree(tls, bp+8) } /* *---------------------------------------------------------------------- * * QueryConfigObjCmd -- * * Implementation of "::::pkgconfig", the command to query * configuration information embedded into a library. * * Results: * A standard Tcl result. * * Side effects: * See the manual for what this command does. * *---------------------------------------------------------------------- */ func _QueryConfigObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var cdPtr, listPtr, pDB, pkgName, value, v1, v2 uintptr var venc TTcl_Encoding var _ /* conv at bp+40 */ TTcl_DString var _ /* done at bp+296 */ int32 var _ /* index at bp+32 */ int32 var _ /* key at bp+288 */ uintptr var _ /* m at bp+16 */ TTcl_Size var _ /* n at bp+24 */ TTcl_Size var _ /* pkgDict at bp+0 */ uintptr var _ /* s at bp+264 */ TTcl_DictSearch var _ /* val at bp+8 */ uintptr _, _, _, _, _, _, _, _ = cdPtr, listPtr, pDB, pkgName, value, venc, v1, v2 cdPtr = clientData pkgName = (*TQCCD)(unsafe.Pointer(cdPtr)).Fpkg *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = 0 venc = libc.UintptrFromInt32(0) if objc < int32(2) || objc > int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+24991) return int32(TCL_ERROR) } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&_subcmdStrings)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+25008, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< and (if available) are included so that the code can choose integer types of a good width. */ /* Narrow types that promote to a signed type and that can represent a signed or unsigned integer of at least N bits. In tables they can save space and decrease cache pressure. Promoting to a signed type helps avoid bugs in integer arithmetic. */ type Tyytype_int8 = int8 type Tyytype_int16 = int16 /* Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants. This workaround can likely be removed in 2023, as HPE has promised support for HP-UX 11.23 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of . */ type Tyytype_uint8 = uint8 type Tyytype_uint16 = uint16 // C documentation // // /* Stored state numbers (used for stacks). */ type Tyy_state_t = int8 // C documentation // // /* State numbers in computations. */ type Tyy_state_fast_t = int32 /* Suppress unused-variable warnings by "using" E. */ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ /* The parser invokes alloca or malloc; define the necessary symbols. */ /* A type that is properly aligned for any stack member. */ type Tyyalloc = struct { Fyyvs_alloc [0]TYYSTYPE Fyyls_alloc [0]TYYLTYPE Fyyss_alloc Tyy_state_t F__ccgo_pad3 [15]byte } /* The size of the maximum gap between one aligned stack and the next. */ /* The size of an array large to enough to hold all stacks, each with N elements. */ /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ /* YYFINAL -- State number of the termination state. */ /* YYLAST -- Last index in YYTABLE. */ /* YYNTOKENS -- Number of terminals. */ /* YYNNTS -- Number of nonterminals. */ /* YYNRULES -- Number of rules. */ /* YYNSTATES -- Number of states. */ /* YYMAXUTOK -- Last valid token kind. */ /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ // C documentation // // /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM // as returned by yylex. */ var _yytranslate = [279]Tyytype_int8{ 1: int8(2), 2: int8(2), 3: int8(2), 4: int8(2), 5: int8(2), 6: int8(2), 7: int8(2), 8: int8(2), 9: int8(2), 10: int8(2), 11: int8(2), 12: int8(2), 13: int8(2), 14: int8(2), 15: int8(2), 16: int8(2), 17: int8(2), 18: int8(2), 19: int8(2), 20: int8(2), 21: int8(2), 22: int8(2), 23: int8(2), 24: int8(2), 25: int8(2), 26: int8(2), 27: int8(2), 28: int8(2), 29: int8(2), 30: int8(2), 31: int8(2), 32: int8(2), 33: int8(2), 34: int8(2), 35: int8(2), 36: int8(2), 37: int8(2), 38: int8(2), 39: int8(2), 40: int8(2), 41: int8(2), 42: int8(2), 43: int8(30), 44: int8(25), 45: int8(26), 46: int8(29), 47: int8(27), 48: int8(2), 49: int8(2), 50: int8(2), 51: int8(2), 52: int8(2), 53: int8(2), 54: int8(2), 55: int8(2), 56: int8(2), 57: int8(2), 58: int8(24), 59: int8(2), 60: int8(2), 61: int8(2), 62: int8(2), 63: int8(2), 64: int8(2), 65: int8(2), 66: int8(2), 67: int8(2), 68: int8(2), 69: int8(2), 70: int8(2), 71: int8(2), 72: int8(2), 73: int8(2), 74: int8(2), 75: int8(2), 76: int8(2), 77: int8(2), 78: int8(2), 79: int8(2), 80: int8(2), 81: int8(2), 82: int8(2), 83: int8(2), 84: int8(28), 85: int8(2), 86: int8(2), 87: int8(2), 88: int8(2), 89: int8(2), 90: int8(2), 91: int8(2), 92: int8(2), 93: int8(2), 94: int8(2), 95: int8(2), 96: int8(2), 97: int8(2), 98: int8(2), 99: int8(2), 100: int8(2), 101: int8(2), 102: int8(2), 103: int8(2), 104: int8(2), 105: int8(2), 106: int8(2), 107: int8(2), 108: int8(2), 109: int8(2), 110: int8(2), 111: int8(2), 112: int8(2), 113: int8(2), 114: int8(2), 115: int8(2), 116: int8(2), 117: int8(2), 118: int8(2), 119: int8(2), 120: int8(2), 121: int8(2), 122: int8(2), 123: int8(2), 124: int8(2), 125: int8(2), 126: int8(2), 127: int8(2), 128: int8(2), 129: int8(2), 130: int8(2), 131: int8(2), 132: int8(2), 133: int8(2), 134: int8(2), 135: int8(2), 136: int8(2), 137: int8(2), 138: int8(2), 139: int8(2), 140: int8(2), 141: int8(2), 142: int8(2), 143: int8(2), 144: int8(2), 145: int8(2), 146: int8(2), 147: int8(2), 148: int8(2), 149: int8(2), 150: int8(2), 151: int8(2), 152: int8(2), 153: int8(2), 154: int8(2), 155: int8(2), 156: int8(2), 157: int8(2), 158: int8(2), 159: int8(2), 160: int8(2), 161: int8(2), 162: int8(2), 163: int8(2), 164: int8(2), 165: int8(2), 166: int8(2), 167: int8(2), 168: int8(2), 169: int8(2), 170: int8(2), 171: int8(2), 172: int8(2), 173: int8(2), 174: int8(2), 175: int8(2), 176: int8(2), 177: int8(2), 178: int8(2), 179: int8(2), 180: int8(2), 181: int8(2), 182: int8(2), 183: int8(2), 184: int8(2), 185: int8(2), 186: int8(2), 187: int8(2), 188: int8(2), 189: int8(2), 190: int8(2), 191: int8(2), 192: int8(2), 193: int8(2), 194: int8(2), 195: int8(2), 196: int8(2), 197: int8(2), 198: int8(2), 199: int8(2), 200: int8(2), 201: int8(2), 202: int8(2), 203: int8(2), 204: int8(2), 205: int8(2), 206: int8(2), 207: int8(2), 208: int8(2), 209: int8(2), 210: int8(2), 211: int8(2), 212: int8(2), 213: int8(2), 214: int8(2), 215: int8(2), 216: int8(2), 217: int8(2), 218: int8(2), 219: int8(2), 220: int8(2), 221: int8(2), 222: int8(2), 223: int8(2), 224: int8(2), 225: int8(2), 226: int8(2), 227: int8(2), 228: int8(2), 229: int8(2), 230: int8(2), 231: int8(2), 232: int8(2), 233: int8(2), 234: int8(2), 235: int8(2), 236: int8(2), 237: int8(2), 238: int8(2), 239: int8(2), 240: int8(2), 241: int8(2), 242: int8(2), 243: int8(2), 244: int8(2), 245: int8(2), 246: int8(2), 247: int8(2), 248: int8(2), 249: int8(2), 250: int8(2), 251: int8(2), 252: int8(2), 253: int8(2), 254: int8(2), 255: int8(2), 256: int8(1), 257: int8(2), 258: int8(3), 259: int8(4), 260: int8(5), 261: int8(6), 262: int8(7), 263: int8(8), 264: int8(9), 265: int8(10), 266: int8(11), 267: int8(12), 268: int8(13), 269: int8(14), 270: int8(15), 271: int8(16), 272: int8(17), 273: int8(18), 274: int8(19), 275: int8(20), 276: int8(21), 277: int8(22), 278: int8(23), } /** Accessing symbol of state STATE. */ // C documentation // // /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing // STATE-NUM. */ var _yypact = [103]Tyytype_int8{ 0: int8(-int32(21)), 1: int8(11), 2: int8(-int32(21)), 3: int8(-int32(20)), 4: int8(-int32(21)), 5: int8(5), 6: int8(-int32(21)), 7: int8(-int32(9)), 8: int8(-int32(21)), 9: int8(46), 10: int8(17), 11: int8(9), 12: int8(9), 13: int8(-int32(21)), 14: int8(-int32(21)), 15: int8(-int32(21)), 16: int8(24), 17: int8(-int32(21)), 18: int8(57), 19: int8(-int32(21)), 20: int8(-int32(21)), 21: int8(-int32(21)), 22: int8(33), 23: int8(-int32(21)), 24: int8(-int32(21)), 25: int8(-int32(21)), 26: int8(-int32(21)), 27: int8(-int32(21)), 28: int8(-int32(21)), 29: int8(-int32(15)), 30: int8(-int32(21)), 31: int8(-int32(21)), 32: int8(-int32(21)), 33: int8(45), 34: int8(26), 35: int8(-int32(21)), 36: int8(-int32(7)), 37: int8(-int32(21)), 38: int8(51), 39: int8(-int32(21)), 40: int8(-int32(20)), 41: int8(-int32(21)), 42: int8(-int32(21)), 43: int8(-int32(21)), 44: int8(48), 45: int8(-int32(21)), 46: int8(-int32(21)), 47: int8(67), 48: int8(68), 49: int8(52), 50: int8(69), 51: int8(-int32(21)), 52: int8(-int32(9)), 53: int8(-int32(9)), 54: int8(-int32(21)), 55: int8(-int32(21)), 56: int8(-int32(21)), 57: int8(-int32(21)), 58: int8(74), 59: int8(-int32(21)), 60: int8(-int32(7)), 61: int8(-int32(21)), 62: int8(-int32(21)), 63: int8(-int32(21)), 64: int8(-int32(21)), 65: int8(44), 66: int8(-int32(21)), 67: int8(79), 68: int8(40), 69: int8(-int32(7)), 70: int8(-int32(21)), 71: int8(-int32(21)), 72: int8(72), 73: int8(73), 74: int8(-int32(21)), 75: int8(62), 76: int8(61), 77: int8(63), 78: int8(64), 79: int8(-int32(21)), 80: int8(-int32(21)), 81: int8(-int32(21)), 82: int8(-int32(21)), 83: int8(66), 84: int8(-int32(21)), 85: int8(-int32(21)), 86: int8(-int32(21)), 87: int8(-int32(21)), 88: int8(84), 89: int8(-int32(7)), 90: int8(-int32(21)), 91: int8(-int32(21)), 92: int8(-int32(21)), 93: int8(80), 94: int8(81), 95: int8(82), 96: int8(83), 97: int8(-int32(21)), 98: int8(-int32(21)), 99: int8(-int32(21)), 100: int8(-int32(21)), 101: int8(-int32(21)), 102: int8(-int32(21)), } // C documentation // // /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. // Performed when YYTABLE does not specify something else to do. Zero // means the default is an error. */ var _yydefact = [103]Tyytype_int8{ 0: int8(2), 2: int8(1), 3: int8(25), 4: int8(19), 6: int8(66), 8: int8(64), 9: int8(70), 10: int8(18), 13: int8(39), 14: int8(45), 15: int8(46), 17: int8(65), 19: int8(62), 20: int8(63), 21: int8(3), 22: int8(71), 23: int8(4), 24: int8(5), 25: int8(8), 26: int8(47), 27: int8(6), 28: int8(7), 29: int8(34), 30: int8(10), 31: int8(11), 32: int8(9), 33: int8(55), 35: int8(61), 37: int8(12), 38: int8(23), 39: int8(26), 40: int8(36), 41: int8(67), 42: int8(69), 43: int8(68), 45: int8(27), 46: int8(15), 47: int8(38), 51: int8(17), 54: int8(52), 55: int8(51), 56: int8(30), 57: int8(41), 58: int8(67), 59: int8(59), 61: int8(72), 62: int8(16), 63: int8(44), 64: int8(43), 66: int8(54), 67: int8(67), 69: int8(22), 70: int8(58), 71: int8(24), 74: int8(40), 75: int8(14), 78: int8(32), 79: int8(20), 80: int8(21), 81: int8(42), 82: int8(60), 84: int8(48), 85: int8(49), 86: int8(50), 87: int8(29), 88: int8(67), 90: int8(57), 91: int8(37), 92: int8(53), 97: int8(28), 98: int8(56), 99: int8(13), 100: int8(35), 101: int8(31), 102: int8(33), } // C documentation // // /* YYPGOTO[NTERM-NUM]. */ var _yypgoto = [23]Tyytype_int8{ 0: int8(-int32(21)), 1: int8(-int32(21)), 2: int8(-int32(21)), 3: int8(31), 4: int8(-int32(21)), 5: int8(-int32(21)), 6: int8(58), 7: int8(-int32(21)), 8: int8(-int32(21)), 9: int8(-int32(21)), 10: int8(-int32(21)), 11: int8(-int32(21)), 12: int8(-int32(21)), 13: int8(-int32(21)), 14: int8(-int32(21)), 15: int8(-int32(21)), 16: int8(-int32(21)), 17: int8(-int32(21)), 18: int8(-int32(5)), 19: int8(-int32(18)), 20: int8(-int32(6)), 21: int8(-int32(21)), 22: int8(-int32(21)), } // C documentation // // /* YYDEFGOTO[NTERM-NUM]. */ var _yydefgoto = [23]Tyytype_int8{ 1: int8(1), 2: int8(21), 3: int8(22), 4: int8(23), 5: int8(24), 6: int8(39), 7: int8(25), 8: int8(26), 9: int8(27), 10: int8(28), 11: int8(65), 12: int8(29), 13: int8(86), 14: int8(30), 15: int8(31), 16: int8(32), 17: int8(33), 18: int8(34), 19: int8(35), 20: int8(36), 21: int8(37), 22: int8(62), } // C documentation // // /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If // positive, shift that token. If negative, reduce the rule whose // number is the opposite. If YYTABLE_NINF, syntax error. */ var _yytable = [99]Tyytype_int8{ 0: int8(59), 1: int8(44), 2: int8(6), 3: int8(41), 4: int8(8), 5: int8(38), 6: int8(52), 7: int8(53), 8: int8(63), 9: int8(42), 10: int8(43), 11: int8(2), 12: int8(60), 13: int8(64), 14: int8(17), 15: int8(3), 16: int8(4), 17: int8(40), 18: int8(70), 19: int8(5), 20: int8(6), 21: int8(7), 22: int8(8), 23: int8(9), 24: int8(10), 25: int8(11), 26: int8(12), 27: int8(13), 28: int8(69), 29: int8(14), 30: int8(15), 31: int8(16), 32: int8(17), 33: int8(18), 34: int8(51), 35: int8(19), 36: int8(54), 37: int8(19), 38: int8(67), 39: int8(20), 40: int8(61), 41: int8(20), 42: int8(82), 43: int8(55), 44: int8(42), 45: int8(43), 46: int8(79), 47: int8(80), 48: int8(66), 49: int8(68), 50: int8(45), 51: int8(90), 52: int8(88), 53: int8(46), 54: int8(47), 55: int8(-int32(67)), 56: int8(83), 57: int8(-int32(67)), 58: int8(42), 59: int8(43), 60: int8(76), 61: int8(56), 62: int8(89), 63: int8(84), 64: int8(77), 65: int8(57), 66: int8(6), 67: int8(-int32(67)), 68: int8(8), 69: int8(58), 70: int8(48), 71: int8(98), 72: int8(49), 73: int8(50), 74: int8(71), 75: int8(42), 76: int8(43), 77: int8(73), 78: int8(17), 79: int8(74), 80: int8(75), 81: int8(78), 82: int8(81), 83: int8(87), 84: int8(91), 85: int8(92), 86: int8(93), 87: int8(94), 88: int8(97), 89: int8(95), 90: int8(48), 91: int8(96), 92: int8(99), 93: int8(100), 94: int8(101), 95: int8(102), 96: int8(85), 98: int8(72), } var _yycheck = [99]Tyytype_int8{ 0: int8(18), 1: int8(7), 2: int8(9), 3: int8(12), 4: int8(11), 5: int8(25), 6: int8(11), 7: int8(12), 8: int8(23), 9: int8(18), 10: int8(19), 12: int8(18), 13: int8(28), 14: int8(21), 15: int8(4), 16: int8(5), 17: int8(12), 18: int8(36), 19: int8(8), 20: int8(9), 21: int8(10), 22: int8(11), 23: int8(12), 24: int8(13), 25: int8(14), 26: int8(15), 27: int8(16), 28: int8(34), 29: int8(18), 30: int8(19), 31: int8(20), 32: int8(21), 33: int8(22), 34: int8(17), 35: int8(26), 36: int8(12), 37: int8(26), 38: int8(12), 39: int8(30), 40: int8(7), 41: int8(30), 42: int8(60), 43: int8(19), 44: int8(18), 45: int8(19), 46: int8(52), 47: int8(53), 48: int8(3), 49: int8(23), 50: int8(4), 51: int8(69), 52: int8(12), 53: int8(7), 54: int8(8), 55: int8(9), 56: int8(12), 57: int8(11), 58: int8(18), 59: int8(19), 60: int8(8), 61: int8(4), 62: int8(68), 63: int8(19), 64: int8(12), 65: int8(8), 66: int8(9), 67: int8(21), 68: int8(11), 69: int8(12), 70: int8(24), 71: int8(89), 72: int8(26), 73: int8(27), 74: int8(23), 75: int8(18), 76: int8(19), 77: int8(29), 78: int8(21), 79: int8(12), 80: int8(12), 81: int8(12), 82: int8(8), 83: int8(4), 84: int8(12), 85: int8(12), 86: int8(24), 87: int8(26), 88: int8(4), 89: int8(26), 90: int8(24), 91: int8(27), 92: int8(12), 93: int8(12), 94: int8(12), 95: int8(12), 96: int8(65), 97: int8(-int32(1)), 98: int8(40), } // C documentation // // /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of // state STATE-NUM. */ var _yystos = [103]Tyytype_int8{ 1: int8(32), 3: int8(4), 4: int8(5), 5: int8(8), 6: int8(9), 7: int8(10), 8: int8(11), 9: int8(12), 10: int8(13), 11: int8(14), 12: int8(15), 13: int8(16), 14: int8(18), 15: int8(19), 16: int8(20), 17: int8(21), 18: int8(22), 19: int8(26), 20: int8(30), 21: int8(33), 22: int8(34), 23: int8(35), 24: int8(36), 25: int8(38), 26: int8(39), 27: int8(40), 28: int8(41), 29: int8(43), 30: int8(45), 31: int8(46), 32: int8(47), 33: int8(48), 34: int8(49), 35: int8(50), 36: int8(51), 37: int8(52), 38: int8(25), 39: int8(37), 40: int8(12), 41: int8(12), 42: int8(18), 43: int8(19), 44: int8(51), 45: int8(4), 46: int8(7), 47: int8(8), 48: int8(24), 49: int8(26), 50: int8(27), 51: int8(17), 52: int8(49), 53: int8(49), 54: int8(12), 55: int8(19), 56: int8(4), 57: int8(8), 58: int8(12), 59: int8(50), 60: int8(51), 61: int8(7), 62: int8(53), 63: int8(23), 64: int8(28), 65: int8(42), 66: int8(3), 67: int8(12), 68: int8(23), 69: int8(51), 70: int8(50), 71: int8(23), 72: int8(37), 73: int8(29), 74: int8(12), 75: int8(12), 76: int8(8), 77: int8(12), 78: int8(12), 79: int8(51), 80: int8(51), 81: int8(8), 82: int8(50), 83: int8(12), 84: int8(19), 85: int8(34), 86: int8(44), 87: int8(4), 88: int8(12), 89: int8(51), 90: int8(50), 91: int8(12), 92: int8(12), 93: int8(24), 94: int8(26), 95: int8(26), 96: int8(27), 97: int8(4), 98: int8(50), 99: int8(12), 100: int8(12), 101: int8(12), 102: int8(12), } // C documentation // // /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ var _yyr1 = [73]Tyytype_int8{ 1: int8(31), 2: int8(32), 3: int8(32), 4: int8(33), 5: int8(33), 6: int8(33), 7: int8(33), 8: int8(33), 9: int8(33), 10: int8(33), 11: int8(33), 12: int8(33), 13: int8(34), 14: int8(34), 15: int8(35), 16: int8(35), 17: int8(36), 18: int8(36), 19: int8(36), 20: int8(36), 21: int8(36), 22: int8(36), 23: int8(37), 24: int8(37), 25: int8(38), 26: int8(38), 27: int8(38), 28: int8(38), 29: int8(38), 30: int8(38), 31: int8(39), 32: int8(40), 33: int8(40), 34: int8(40), 35: int8(40), 36: int8(40), 37: int8(40), 38: int8(40), 39: int8(40), 40: int8(40), 41: int8(41), 42: int8(41), 43: int8(42), 44: int8(42), 45: int8(43), 46: int8(43), 47: int8(43), 48: int8(44), 49: int8(44), 50: int8(45), 51: int8(45), 52: int8(45), 53: int8(46), 54: int8(47), 55: int8(47), 56: int8(48), 57: int8(48), 58: int8(48), 59: int8(48), 60: int8(48), 61: int8(48), 62: int8(49), 63: int8(49), 64: int8(50), 65: int8(50), 66: int8(50), 67: int8(51), 68: int8(51), 69: int8(51), 70: int8(52), 71: int8(53), 72: int8(53), } // C documentation // // /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ var _yyr2 = [73]Tyytype_int8{ 1: int8(2), 3: int8(2), 4: int8(1), 5: int8(1), 6: int8(1), 7: int8(1), 8: int8(1), 9: int8(1), 10: int8(1), 11: int8(1), 12: int8(1), 13: int8(5), 14: int8(3), 15: int8(2), 16: int8(2), 17: int8(2), 18: int8(1), 19: int8(1), 20: int8(3), 21: int8(3), 22: int8(2), 23: int8(1), 24: int8(2), 25: int8(1), 26: int8(2), 27: int8(2), 28: int8(4), 29: int8(3), 30: int8(2), 31: int8(5), 32: int8(3), 33: int8(5), 34: int8(1), 35: int8(5), 36: int8(2), 37: int8(4), 38: int8(2), 39: int8(1), 40: int8(3), 41: int8(2), 42: int8(3), 43: int8(1), 44: int8(1), 45: int8(1), 46: int8(1), 47: int8(1), 48: int8(1), 49: int8(1), 50: int8(3), 51: int8(2), 52: int8(2), 53: int8(4), 54: int8(2), 55: int8(1), 56: int8(4), 57: int8(3), 58: int8(2), 59: int8(2), 60: int8(3), 61: int8(1), 62: int8(1), 63: int8(1), 64: int8(1), 65: int8(1), 66: int8(1), 67: int8(1), 68: int8(1), 69: int8(1), 70: int8(1), 72: int8(1), } const YYENOMEM = -2 /* Backward compatibility with an undocumented macro. Use YYerror or YYUNDEF. */ /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ /* Enable debugging if requested. */ /* YYINITDEPTH -- initial size of the parser's stacks. */ /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ func _yydestruct(tls *libc.TLS, yymsg uintptr, yykind Tyysymbol_kind_t, yyvaluep uintptr, yylocationp uintptr, info uintptr) { _ = yyvaluep _ = yylocationp _ = info if !(yymsg != 0) { yymsg = __ccgo_ts + 25207 } _ = yykind } /*----------. | yyparse. | `----------*/ func XTclDateparse(tls *libc.TLS, info uintptr) (r int32) { bp := tls.Alloc(5040) defer tls.Free(5040) var TclDatenerrs, yychar, yyerrstatus, yyi, yylen, yylhs, yyn, yyresult, v1, v10, v13, v14, v15, v4, v5, v8, v9 int32 var yyerror_range [3]TYYLTYPE var yyloc TYYLTYPE var yyls, yylsp, yyptr, yyss, yyss1, yyssp, yyvs, yyvsp, v12, v2, v3, v6, v7 uintptr var yynewbytes, yynewbytes1, yynewbytes2, yysize, yystacksize int64 var yystate Tyy_state_fast_t var yytoken Tyysymbol_kind_t var _ /* yylloc at bp+8 */ TYYLTYPE var _ /* yylsa at bp+1824 */ [200]TYYLTYPE var _ /* yylval at bp+0 */ TYYSTYPE var _ /* yyssa at bp+24 */ [200]Tyy_state_t var _ /* yyval at bp+5024 */ TYYSTYPE var _ /* yyvsa at bp+224 */ [200]TYYSTYPE _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = TclDatenerrs, yychar, yyerror_range, yyerrstatus, yyi, yylen, yylhs, yyloc, yyls, yylsp, yyn, yynewbytes, yynewbytes1, yynewbytes2, yyptr, yyresult, yysize, yyss, yyss1, yyssp, yystacksize, yystate, yytoken, yyvs, yyvsp, v1, v10, v12, v13, v14, v15, v2, v3, v4, v5, v6, v7, v8, v9 *(*TYYLTYPE)(unsafe.Pointer(bp + 8)) = _yyloc_default /* Number of syntax errors so far. */ TclDatenerrs = 0 yystate = 0 /* Number of tokens to shift before error messages enabled. */ yyerrstatus = 0 /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ yystacksize = int64(YYINITDEPTH) yyss = bp + 24 yyssp = yyss yyvs = bp + 224 yyvsp = yyvs yyls = bp + 1824 yylsp = yyls /* Lookahead symbol kind. */ yytoken = int32(YYSYMBOL_YYEMPTY) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ yylen = 0 yychar = int32(YYEMPTY) /* Cause a token to be read. */ *(*TYYLTYPE)(unsafe.Pointer(yylsp)) = *(*TYYLTYPE)(unsafe.Pointer(bp + 8)) goto yysetstate /* ------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------ */ goto yynewstate yynewstate: ; /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++ /* --------------------------------------------------------------------. | yysetstate -- set current state (the top of the stack) to yystate. | `-------------------------------------------------------------------- */ goto yysetstate yysetstate: ; _ = libc.Bool(0 != 0) && (0 <= yystate && yystate < int32(YYNSTATES)) *(*Tyy_state_t)(unsafe.Pointer(yyssp)) = int8(yystate) if yyss+uintptr(yystacksize)-uintptr(1) <= yyssp { /* Get the current used size of the three stacks, in elements. */ yysize = int64(yyssp) - int64(yyss) + int64(1) /* Extend the stack our own way. */ if int64(YYMAXDEPTH) <= yystacksize { goto yyexhaustedlab } yystacksize *= int64(2) if int64(YYMAXDEPTH) < yystacksize { yystacksize = int64(YYMAXDEPTH) } yyss1 = yyss yyptr = XTcl_Alloc(tls, libc.Uint64FromInt64(yystacksize*(libc.Int64FromUint64(libc.Uint64FromInt64(1))+libc.Int64FromUint64(libc.Uint64FromInt64(8))+libc.Int64FromUint64(libc.Uint64FromInt64(16)))+libc.Int64FromInt32(2)*(libc.Int64FromUint64(libc.Uint64FromInt64(16))-libc.Int64FromInt32(1)))) if !(yyptr != 0) { goto yyexhaustedlab } libc.X__builtin_memcpy(tls, yyptr, yyss, libc.Uint64FromInt64(yysize)*uint64(1)) yyss = yyptr yynewbytes = yystacksize*libc.Int64FromUint64(libc.Uint64FromInt64(1)) + (libc.Int64FromUint64(libc.Uint64FromInt64(16)) - libc.Int64FromInt32(1)) yyptr += uintptr(yynewbytes/libc.Int64FromUint64(libc.Uint64FromInt64(16))) * 16 libc.X__builtin_memcpy(tls, yyptr, yyvs, libc.Uint64FromInt64(yysize)*uint64(8)) yyvs = yyptr yynewbytes1 = yystacksize*libc.Int64FromUint64(libc.Uint64FromInt64(8)) + (libc.Int64FromUint64(libc.Uint64FromInt64(16)) - libc.Int64FromInt32(1)) yyptr += uintptr(yynewbytes1/libc.Int64FromUint64(libc.Uint64FromInt64(16))) * 16 libc.X__builtin_memcpy(tls, yyptr, yyls, libc.Uint64FromInt64(yysize)*uint64(16)) yyls = yyptr yynewbytes2 = yystacksize*libc.Int64FromUint64(libc.Uint64FromInt64(16)) + (libc.Int64FromUint64(libc.Uint64FromInt64(16)) - libc.Int64FromInt32(1)) yyptr += uintptr(yynewbytes2/libc.Int64FromUint64(libc.Uint64FromInt64(16))) * 16 if yyss1 != bp+24 { XTclpFree(tls, yyss1) } yyssp = yyss + uintptr(yysize) - uintptr(1) yyvsp = yyvs + uintptr(yysize)*8 - uintptr(1)*8 yylsp = yyls + uintptr(yysize)*16 - uintptr(1)*16 if yyss+uintptr(yystacksize)-uintptr(1) <= yyssp { goto yyabortlab } } if yystate == int32(YYFINAL) { goto yyacceptlab } goto yybackup /* -----------. | yybackup. | `----------- */ goto yybackup yybackup: ; /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = int32(_yypact[yystate]) if yyn == -int32(21) { goto yydefault } /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if yychar == int32(YYEMPTY) { yychar = _TclDatelex(tls, bp, bp+8, info) } if yychar <= int32(YYEOF) { yychar = int32(YYEOF) yytoken = int32(YYSYMBOL_YYEOF) } else { if yychar == int32(YYerror) { /* The scanner already issued an error message, process directly to error recovery. But do not keep the error token as lookahead, it is too special and may lead us to an endless loop in error recovery. */ yychar = int32(YYUNDEF) yytoken = int32(YYSYMBOL_YYerror) yyerror_range[int32(1)] = *(*TYYLTYPE)(unsafe.Pointer(bp + 8)) goto yyerrlab1 } else { if 0 <= yychar && yychar <= int32(YYMAXUTOK) { v1 = int32(_yytranslate[yychar]) } else { v1 = int32(YYSYMBOL_YYUNDEF) } yytoken = v1 } } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken if yyn < 0 || int32(YYLAST) < yyn || int32(_yycheck[yyn]) != yytoken { goto yydefault } yyn = int32(_yytable[yyn]) if yyn <= 0 { if 0 != 0 { goto yyerrlab } yyn = -yyn goto yyreduce } /* Count tokens shifted since error; after three, turn off error status. */ if yyerrstatus != 0 { yyerrstatus-- } /* Shift the lookahead token. */ yystate = yyn yyvsp += 8 v2 = yyvsp *(*TYYSTYPE)(unsafe.Pointer(v2)) = *(*TYYSTYPE)(unsafe.Pointer(bp)) yylsp += 16 v3 = yylsp *(*TYYLTYPE)(unsafe.Pointer(v3)) = *(*TYYLTYPE)(unsafe.Pointer(bp + 8)) /* Discard the shifted token. */ yychar = int32(YYEMPTY) goto yynewstate /* -----------------------------------------------------------. | yydefault -- do the default action for the current state. | `----------------------------------------------------------- */ goto yydefault yydefault: ; yyn = int32(_yydefact[yystate]) if yyn == 0 { goto yyerrlab } goto yyreduce /* -----------------------------. | yyreduce -- do a reduction. | `----------------------------- */ goto yyreduce yyreduce: ; /* yyn is the number of a rule to reduce with. */ yylen = int32(_yyr2[yyn]) /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ *(*TYYSTYPE)(unsafe.Pointer(bp + 5024)) = *(*TYYSTYPE)(unsafe.Pointer(yyvsp + uintptr(int32(1)-yylen)*8)) /* Default location. */ if yylen != 0 { yyloc.Ffirst_line = (*(*TYYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16 + 1*16))).Ffirst_line yyloc.Ffirst_column = (*(*TYYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16 + 1*16))).Ffirst_column yyloc.Flast_line = (*(*TYYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16 + uintptr(yylen)*16))).Flast_line yyloc.Flast_column = (*(*TYYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16 + uintptr(yylen)*16))).Flast_column } else { v4 = (*(*TYYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16))).Flast_line yyloc.Flast_line = v4 yyloc.Ffirst_line = v4 v5 = (*(*TYYLTYPE)(unsafe.Pointer(yylsp - uintptr(yylen)*16))).Flast_column yyloc.Flast_column = v5 yyloc.Ffirst_column = v5 } yyerror_range[int32(1)] = yyloc switch yyn { case int32(4): /* item: time */ *(*int32)(unsafe.Pointer(info + 140)) |= (*TDateInfo)(unsafe.Pointer(info)).Fflags & int32(CLF_TIME) if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags != 0 { goto yyabortlab } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_TIME) case int32(5): /* item: zone */ *(*int32)(unsafe.Pointer(info + 140)) |= (*TDateInfo)(unsafe.Pointer(info)).Fflags & int32(CLF_ZONE) if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags != 0 { goto yyabortlab } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ZONE) case int32(6): /* item: date */ *(*int32)(unsafe.Pointer(info + 140)) |= (*TDateInfo)(unsafe.Pointer(info)).Fflags & int32(CLF_HAVEDATE) if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags != 0 { goto yyabortlab } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_HAVEDATE) case int32(7): /* item: ordMonth */ *(*int32)(unsafe.Pointer(info + 140)) |= (*TDateInfo)(unsafe.Pointer(info)).Fflags & int32(CLF_ORDINALMONTH) if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags != 0 { goto yyabortlab } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_ORDINALMONTH) case int32(8): /* item: day */ *(*int32)(unsafe.Pointer(info + 140)) |= (*TDateInfo)(unsafe.Pointer(info)).Fflags & int32(CLF_DAYOFWEEK) if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags != 0 { goto yyabortlab } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_DAYOFWEEK) case int32(9): /* item: relspec */ *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_RELCONV) case int32(10): /* item: iso */ *(*int32)(unsafe.Pointer(info + 140)) |= (*TDateInfo)(unsafe.Pointer(info)).Fflags & (int32(CLF_TIME) | int32(CLF_HAVEDATE)) if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags != 0 { goto yyabortlab } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_TIME) | int32(CLF_HAVEDATE) case int32(11): /* item: trek */ *(*int32)(unsafe.Pointer(info + 140)) |= (*TDateInfo)(unsafe.Pointer(info)).Fflags & (int32(CLF_TIME) | int32(CLF_HAVEDATE)) if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags != 0 { goto yyabortlab } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_TIME) | int32(CLF_HAVEDATE) *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_RELCONV) case int32(13): /* iextime: tUNUMBER ':' tUNUMBER ':' tUNUMBER */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(4))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin = *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(14): /* iextime: tUNUMBER ':' tUNUMBER */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin = 0 case int32(15): /* time: tUNUMBER tMERIDIAN */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes = 0 (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin = 0 (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian = *(*_MERIDIAN)(unsafe.Pointer(&*(*TYYSTYPE)(unsafe.Pointer(yyvsp)))) case int32(16): /* time: iextime o_merid */ (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian = *(*_MERIDIAN)(unsafe.Pointer(&*(*TYYSTYPE)(unsafe.Pointer(yyvsp)))) case int32(17): /* zone: tZONE tDST */ (*TDateInfo)(unsafe.Pointer(info)).FdateTimezone = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) (*TDateInfo)(unsafe.Pointer(info)).FdateDSTmode = int32(DSTon) case int32(18): /* zone: tZONE */ (*TDateInfo)(unsafe.Pointer(info)).FdateTimezone = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) (*TDateInfo)(unsafe.Pointer(info)).FdateDSTmode = int32(DSToff) case int32(19): /* zone: tDAYZONE */ (*TDateInfo)(unsafe.Pointer(info)).FdateTimezone = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) (*TDateInfo)(unsafe.Pointer(info)).FdateDSTmode = int32(DSTon) case int32(20): /* zone: tZONEwO4 sign INTNUM */ /* GMT+0100, GMT-1000, etc. */ (*TDateInfo)(unsafe.Pointer(info)).FdateTimezone = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8)) - *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))*(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))%int64(100)+*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))/int64(100)*int64(60))) (*TDateInfo)(unsafe.Pointer(info)).FdateDSTmode = int32(DSToff) case int32(21): /* zone: tZONEwO2 sign INTNUM */ /* GMT+1, GMT-10, etc. */ (*TDateInfo)(unsafe.Pointer(info)).FdateTimezone = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8)) - *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))*(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))*int64(60))) (*TDateInfo)(unsafe.Pointer(info)).FdateDSTmode = int32(DSToff) case int32(22): /* zone: sign INTNUM */ /* +0100, -0100 */ (*TDateInfo)(unsafe.Pointer(info)).FdateTimezone = int32(-*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) * (*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))%int64(100) + *(*TTcl_WideInt)(unsafe.Pointer(yyvsp))/int64(100)*int64(60))) (*TDateInfo)(unsafe.Pointer(info)).FdateDSTmode = int32(DSToff) case int32(25): /* day: tDAY */ (*TDateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int32(1) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(26): /* day: tDAY comma */ (*TDateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int32(1) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) case int32(27): /* day: tUNUMBER tDAY */ (*TDateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(28): /* day: sign SP tUNUMBER tDAY */ (*TDateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(3))*8)) * *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(29): /* day: sign tUNUMBER tDAY */ (*TDateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8)) * *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(30): /* day: tNEXT tDAY */ (*TDateInfo)(unsafe.Pointer(info)).FdateDayOrdinal = int32(2) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfWeek = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(31): /* iexdate: tUNUMBER '-' tUNUMBER '-' tUNUMBER */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(4))*8))) case int32(32): /* date: tUNUMBER '/' tUNUMBER */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(33): /* date: tUNUMBER '/' tUNUMBER '/' tUNUMBER */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(4))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(35): /* date: tUNUMBER '-' tMONTH '-' tUNUMBER */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(4))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(36): /* date: tMONTH tUNUMBER */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(37): /* date: tMONTH tUNUMBER comma tUNUMBER */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(3))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(38): /* date: tUNUMBER tMONTH */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) case int32(39): /* date: tEPOCH */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(1) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(1) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(EPOCH) case int32(40): /* date: tUNUMBER tMONTH tUNUMBER */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(41): /* ordMonth: tNEXT tMONTH */ (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinalIncr = int32(1) (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinal = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(42): /* ordMonth: tNEXT tUNUMBER tMONTH */ (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinalIncr = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8))) (*TDateInfo)(unsafe.Pointer(info)).FdateMonthOrdinal = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) case int32(45): /* isodate: tISOBAS8 */ /* YYYYMMDD */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) / int64(10000)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % int64(10000) / int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % int64(100)) case int32(46): /* isodate: tISOBAS6 */ /* YYMMDD */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) / int64(10000)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % int64(10000) / int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % int64(100)) case int32(48): /* isotime: tISOBAS6 */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) / int64(10000)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % int64(10000) / int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin = *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % int64(100) case int32(51): /* iso: tISOBASL tISOBAS6 */ /* YYYYMMDDhhmmss */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) / int64(10000)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) % int64(10000) / int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) % int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) / int64(10000)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % int64(10000) / int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin = *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % int64(100) case int32(52): /* iso: tISOBASL tUNUMBER */ /* YYYYMMDDhhmm */ if (*TDateInfo)(unsafe.Pointer(info)).FdateDigitCount != int32(4) { goto yyabortlab } /* normally unreached */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) / int64(10000)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) % int64(10000) / int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) % int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) / int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % libc.Int64FromInt32(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin = 0 case int32(53): /* trek: tSTARDATE INTNUM '.' tUNUMBER */ /* * Offset computed year by -377 so that the returned years will be * in a range accessible with a 32 bit clock seconds value. */ (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8))/int64(1000) + int64(2323) - int64(377)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.FdayOfMonth = int32(1) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fmonth = int32(1) *(*TTcl_WideInt)(unsafe.Pointer(info + 168)) += *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8)) % int64(1000) * int64(libc.Int32FromInt32(365)+libc.BoolInt32((*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear%int32(4) == 0 && ((*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear%int32(100) != 0 || (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear%int32(400) == 0))) / int64(1000) *(*TTcl_WideInt)(unsafe.Pointer(info + 176)) += *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) * (libc.Int64FromInt64(144) * libc.Int64FromInt64(60)) case int32(54): /* relspec: relunits tAGO */ *(*TTcl_WideInt)(unsafe.Pointer(info + 176)) *= int64(-int32(1)) *(*TTcl_WideInt)(unsafe.Pointer(info + 160)) *= int64(-int32(1)) *(*TTcl_WideInt)(unsafe.Pointer(info + 168)) *= int64(-int32(1)) case int32(56): /* relunits: sign SP INTNUM unit */ *(*TTcl_WideInt)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(3))*8)) * *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) * *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(57): /* relunits: sign INTNUM unit */ *(*TTcl_WideInt)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(2))*8)) * *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) * *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(58): /* relunits: INTNUM unit */ *(*TTcl_WideInt)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) * *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(59): /* relunits: tNEXT unit */ *(*TTcl_WideInt)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(60): /* relunits: tNEXT INTNUM unit */ *(*TTcl_WideInt)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*TTcl_WideInt)(unsafe.Pointer(yyvsp + uintptr(-libc.Int32FromInt32(1))*8)) * *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(61): /* relunits: unit */ *(*TTcl_WideInt)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateRelPointer)) += *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(62): /* sign: '-' */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 5024)) = int64(-int32(1)) case int32(63): /* sign: '+' */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 5024)) = int64(1) case int32(64): /* unit: tSEC_UNIT */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 5024)) = *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) (*TDateInfo)(unsafe.Pointer(info)).FdateRelPointer = info + 176 case int32(65): /* unit: tDAY_UNIT */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 5024)) = *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) (*TDateInfo)(unsafe.Pointer(info)).FdateRelPointer = info + 168 case int32(66): /* unit: tMONTH_UNIT */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 5024)) = *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) (*TDateInfo)(unsafe.Pointer(info)).FdateRelPointer = info + 160 case int32(67): /* INTNUM: tUNUMBER */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 5024)) = *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(68): /* INTNUM: tISOBAS6 */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 5024)) = *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(69): /* INTNUM: tISOBAS8 */ *(*TTcl_WideInt)(unsafe.Pointer(bp + 5024)) = *(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) case int32(70): /* numitem: tUNUMBER */ if (*TDateInfo)(unsafe.Pointer(info)).Fflags&(int32(CLF_TIME)|int32(CLF_HAVEDATE)|int32(CLF_RELCONV)) == int32(CLF_TIME)|int32(CLF_HAVEDATE) { (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fyear = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) } else { *(*int32)(unsafe.Pointer(info + 140)) |= (*TDateInfo)(unsafe.Pointer(info)).Fflags & int32(CLF_TIME) if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags != 0 { goto yyabortlab } *(*int32)(unsafe.Pointer(info + 136)) |= int32(CLF_TIME) if (*TDateInfo)(unsafe.Pointer(info)).FdateDigitCount <= int32(2) { (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp))) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes = 0 } else { (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fhour = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) / int64(100)) (*TDateInfo)(unsafe.Pointer(info)).Fdate.Fminutes = int32(*(*TTcl_WideInt)(unsafe.Pointer(yyvsp)) % int64(100)) } (*TDateInfo)(unsafe.Pointer(info)).Fdate.FsecondOfMin = 0 (*TDateInfo)(unsafe.Pointer(info)).FdateMeridian = int32(MER24) } case int32(71): /* o_merid: %empty */ *(*_MERIDIAN)(unsafe.Pointer(&*(*TYYSTYPE)(unsafe.Pointer(bp + 5024)))) = int32(MER24) case int32(72): /* o_merid: tMERIDIAN */ *(*_MERIDIAN)(unsafe.Pointer(&*(*TYYSTYPE)(unsafe.Pointer(bp + 5024)))) = *(*_MERIDIAN)(unsafe.Pointer(&*(*TYYSTYPE)(unsafe.Pointer(yyvsp)))) default: break } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ yyvsp -= uintptr(yylen) * 8 yyssp -= uintptr(yylen) yylsp -= uintptr(yylen) * 16 yylen = 0 yyvsp += 8 v6 = yyvsp *(*TYYSTYPE)(unsafe.Pointer(v6)) = *(*TYYSTYPE)(unsafe.Pointer(bp + 5024)) yylsp += 16 v7 = yylsp *(*TYYLTYPE)(unsafe.Pointer(v7)) = yyloc /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yylhs = int32(_yyr1[yyn]) - int32(YYNTOKENS) yyi = int32(_yypgoto[yylhs]) + int32(*(*Tyy_state_t)(unsafe.Pointer(yyssp))) if 0 <= yyi && yyi <= int32(YYLAST) && int32(_yycheck[yyi]) == int32(*(*Tyy_state_t)(unsafe.Pointer(yyssp))) { v8 = int32(_yytable[yyi]) } else { v8 = int32(_yydefgoto[yylhs]) } yystate = v8 goto yynewstate /* --------------------------------------. | yyerrlab -- here on detecting error. | `-------------------------------------- */ goto yyerrlab yyerrlab: ; /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ if yychar == int32(YYEMPTY) { v9 = int32(YYSYMBOL_YYEMPTY) } else { if 0 <= yychar && yychar <= int32(YYMAXUTOK) { v10 = int32(_yytranslate[yychar]) } else { v10 = int32(YYSYMBOL_YYUNDEF) } v9 = v10 } yytoken = v9 /* If not already recovering from an error, report this error. */ if !(yyerrstatus != 0) { TclDatenerrs++ _TclDateerror(tls, bp+8, info, __ccgo_ts+25216) } yyerror_range[int32(1)] = *(*TYYLTYPE)(unsafe.Pointer(bp + 8)) if yyerrstatus == int32(3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if yychar <= int32(YYEOF) { /* Return failure if at end of input. */ if yychar == int32(YYEOF) { goto yyabortlab } } else { _yydestruct(tls, __ccgo_ts+25229, yytoken, bp, bp+8, info) yychar = int32(YYEMPTY) } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1 /* ---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `--------------------------------------------------- */ goto yyerrorlab yyerrorlab: ; /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if 0 != 0 { goto yyerrorlab } TclDatenerrs++ /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ yyvsp -= uintptr(yylen) * 8 yyssp -= uintptr(yylen) yylsp -= uintptr(yylen) * 16 yylen = 0 yystate = int32(*(*Tyy_state_t)(unsafe.Pointer(yyssp))) goto yyerrlab1 /* -------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `------------------------------------------------------------- */ goto yyerrlab1 yyerrlab1: ; yyerrstatus = int32(3) /* Each real token shifted decrements this. */ /* Pop stack until we find a state that shifts the error token. */ for { yyn = int32(_yypact[yystate]) if !(yyn == -libc.Int32FromInt32(21)) { yyn += int32(YYSYMBOL_YYerror) if 0 <= yyn && yyn <= int32(YYLAST) && int32(_yycheck[yyn]) == int32(YYSYMBOL_YYerror) { yyn = int32(_yytable[yyn]) if 0 < yyn { break } } } /* Pop the current state because it cannot handle the error token. */ if yyssp == yyss { goto yyabortlab } yyerror_range[int32(1)] = *(*TYYLTYPE)(unsafe.Pointer(yylsp)) _yydestruct(tls, __ccgo_ts+25247, int32(_yystos[yystate]), yyvsp, yylsp, info) yyvsp -= uintptr(libc.Int32FromInt32(1)) * 8 yyssp -= uintptr(libc.Int32FromInt32(1)) yylsp -= uintptr(libc.Int32FromInt32(1)) * 16 yystate = int32(*(*Tyy_state_t)(unsafe.Pointer(yyssp))) goto _11 _11: } yyvsp += 8 v12 = yyvsp *(*TYYSTYPE)(unsafe.Pointer(v12)) = *(*TYYSTYPE)(unsafe.Pointer(bp)) yyerror_range[int32(2)] = *(*TYYLTYPE)(unsafe.Pointer(bp + 8)) yylsp += 16 if int32(2) != 0 { (*TYYLTYPE)(unsafe.Pointer(yylsp)).Ffirst_line = yyerror_range[int32(1)].Ffirst_line (*TYYLTYPE)(unsafe.Pointer(yylsp)).Ffirst_column = yyerror_range[int32(1)].Ffirst_column (*TYYLTYPE)(unsafe.Pointer(yylsp)).Flast_line = yyerror_range[int32(2)].Flast_line (*TYYLTYPE)(unsafe.Pointer(yylsp)).Flast_column = yyerror_range[int32(2)].Flast_column } else { v13 = yyerror_range[0].Flast_line (*TYYLTYPE)(unsafe.Pointer(yylsp)).Flast_line = v13 (*TYYLTYPE)(unsafe.Pointer(yylsp)).Ffirst_line = v13 v14 = yyerror_range[0].Flast_column (*TYYLTYPE)(unsafe.Pointer(yylsp)).Flast_column = v14 (*TYYLTYPE)(unsafe.Pointer(yylsp)).Ffirst_column = v14 } /* Shift the error token. */ yystate = yyn goto yynewstate /* -------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `------------------------------------- */ goto yyacceptlab yyacceptlab: ; yyresult = 0 goto yyreturnlab /* -----------------------------------. | yyabortlab -- YYABORT comes here. | `----------------------------------- */ goto yyabortlab yyabortlab: ; yyresult = int32(1) goto yyreturnlab /* -----------------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | `----------------------------------------------------------- */ goto yyexhaustedlab yyexhaustedlab: ; _TclDateerror(tls, bp+8, info, __ccgo_ts+25262) yyresult = int32(2) goto yyreturnlab /* ----------------------------------------------------------. | yyreturnlab -- parsing is finished, clean up and return. | `---------------------------------------------------------- */ goto yyreturnlab yyreturnlab: ; if yychar != int32(YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ if 0 <= yychar && yychar <= int32(YYMAXUTOK) { v15 = int32(_yytranslate[yychar]) } else { v15 = int32(YYSYMBOL_YYUNDEF) } yytoken = v15 _yydestruct(tls, __ccgo_ts+25279, yytoken, bp, bp+8, info) } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ yyvsp -= uintptr(yylen) * 8 yyssp -= uintptr(yylen) yylsp -= uintptr(yylen) * 16 for yyssp != yyss { _yydestruct(tls, __ccgo_ts+25309, int32(_yystos[+int32(*(*Tyy_state_t)(unsafe.Pointer(yyssp)))]), yyvsp, yylsp, info) yyvsp -= uintptr(libc.Int32FromInt32(1)) * 8 yyssp -= uintptr(libc.Int32FromInt32(1)) yylsp -= uintptr(libc.Int32FromInt32(1)) * 16 } if yyss != bp+24 { XTclpFree(tls, yyss) } return yyresult } /* Location data for the lookahead symbol. */ var _yyloc_default = TYYLTYPE{ Ffirst_line: int32(1), Ffirst_column: int32(1), Flast_line: int32(1), Flast_column: int32(1), } /* * Month and day table. */ var _MonthDayTable = [25]TTABLE{ 0: { Fname: __ccgo_ts + 25326, Ftype1: int32(tMONTH), Fvalue: int32(1), }, 1: { Fname: __ccgo_ts + 25334, Ftype1: int32(tMONTH), Fvalue: int32(2), }, 2: { Fname: __ccgo_ts + 25343, Ftype1: int32(tMONTH), Fvalue: int32(3), }, 3: { Fname: __ccgo_ts + 25349, Ftype1: int32(tMONTH), Fvalue: int32(4), }, 4: { Fname: __ccgo_ts + 25355, Ftype1: int32(tMONTH), Fvalue: int32(5), }, 5: { Fname: __ccgo_ts + 25359, Ftype1: int32(tMONTH), Fvalue: int32(6), }, 6: { Fname: __ccgo_ts + 25364, Ftype1: int32(tMONTH), Fvalue: int32(7), }, 7: { Fname: __ccgo_ts + 25369, Ftype1: int32(tMONTH), Fvalue: int32(8), }, 8: { Fname: __ccgo_ts + 25376, Ftype1: int32(tMONTH), Fvalue: int32(9), }, 9: { Fname: __ccgo_ts + 25386, Ftype1: int32(tMONTH), Fvalue: int32(9), }, 10: { Fname: __ccgo_ts + 25391, Ftype1: int32(tMONTH), Fvalue: int32(10), }, 11: { Fname: __ccgo_ts + 25399, Ftype1: int32(tMONTH), Fvalue: int32(11), }, 12: { Fname: __ccgo_ts + 25408, Ftype1: int32(tMONTH), Fvalue: int32(12), }, 13: { Fname: __ccgo_ts + 25417, Ftype1: int32(tDAY), Fvalue: int32(7), }, 14: { Fname: __ccgo_ts + 25424, Ftype1: int32(tDAY), Fvalue: int32(1), }, 15: { Fname: __ccgo_ts + 25431, Ftype1: int32(tDAY), Fvalue: int32(2), }, 16: { Fname: __ccgo_ts + 25439, Ftype1: int32(tDAY), Fvalue: int32(2), }, 17: { Fname: __ccgo_ts + 25444, Ftype1: int32(tDAY), Fvalue: int32(3), }, 18: { Fname: __ccgo_ts + 25454, Ftype1: int32(tDAY), Fvalue: int32(3), }, 19: { Fname: __ccgo_ts + 25461, Ftype1: int32(tDAY), Fvalue: int32(4), }, 20: { Fname: __ccgo_ts + 25470, Ftype1: int32(tDAY), Fvalue: int32(4), }, 21: { Fname: __ccgo_ts + 25475, Ftype1: int32(tDAY), Fvalue: int32(4), }, 22: { Fname: __ccgo_ts + 25481, Ftype1: int32(tDAY), Fvalue: int32(5), }, 23: { Fname: __ccgo_ts + 25488, Ftype1: int32(tDAY), Fvalue: int32(6), }, 24: {}, } /* * Time units table. */ var _UnitsTable = [11]TTABLE{ 0: { Fname: __ccgo_ts + 11851, Ftype1: int32(tMONTH_UNIT), Fvalue: int32(12), }, 1: { Fname: __ccgo_ts + 11821, Ftype1: int32(tMONTH_UNIT), Fvalue: int32(1), }, 2: { Fname: __ccgo_ts + 25497, Ftype1: int32(tDAY_UNIT), Fvalue: int32(14), }, 3: { Fname: __ccgo_ts + 14447, Ftype1: int32(tDAY_UNIT), Fvalue: int32(7), }, 4: { Fname: __ccgo_ts + 14045, Ftype1: int32(tDAY_UNIT), Fvalue: int32(1), }, 5: { Fname: __ccgo_ts + 14128, Ftype1: int32(tSEC_UNIT), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(60), }, 6: { Fname: __ccgo_ts + 25507, Ftype1: int32(tSEC_UNIT), Fvalue: int32(60), }, 7: { Fname: __ccgo_ts + 6168, Ftype1: int32(tSEC_UNIT), Fvalue: int32(60), }, 8: { Fname: __ccgo_ts + 25514, Ftype1: int32(tSEC_UNIT), Fvalue: int32(1), }, 9: { Fname: __ccgo_ts + 25521, Ftype1: int32(tSEC_UNIT), Fvalue: int32(1), }, 10: {}, } /* * Assorted relative-time words. */ var _OtherTable = [11]TTABLE{ 0: { Fname: __ccgo_ts + 25525, Ftype1: int32(tDAY_UNIT), Fvalue: int32(1), }, 1: { Fname: __ccgo_ts + 25534, Ftype1: int32(tDAY_UNIT), Fvalue: -int32(1), }, 2: { Fname: __ccgo_ts + 25544, Ftype1: int32(tDAY_UNIT), }, 3: { Fname: __ccgo_ts + 13454, Ftype1: int32(tSEC_UNIT), }, 4: { Fname: __ccgo_ts + 19703, Ftype1: int32(tUNUMBER), Fvalue: -int32(1), }, 5: { Fname: __ccgo_ts + 25550, Ftype1: int32(tSEC_UNIT), }, 6: { Fname: __ccgo_ts + 25555, Ftype1: int32(tNEXT), Fvalue: int32(1), }, 7: { Fname: __ccgo_ts + 25560, Ftype1: int32(tAGO), Fvalue: int32(1), }, 8: { Fname: __ccgo_ts + 25564, Ftype1: int32(tEPOCH), }, 9: { Fname: __ccgo_ts + 25570, Ftype1: int32(tSTARDATE), }, 10: {}, } /* * The timezone table. (Note: This table was modified to not use any floating * point constants to work around an SGI compiler bug). */ var _TimezoneTable = [66]TTABLE{ 0: { Fname: __ccgo_ts + 25579, Ftype1: int32(tZONE), }, 1: { Fname: __ccgo_ts + 25583, Ftype1: int32(tZONE), }, 2: { Fname: __ccgo_ts + 25586, Ftype1: int32(tZONE), }, 3: { Fname: __ccgo_ts + 25590, Ftype1: int32(tZONE), }, 4: { Fname: __ccgo_ts + 25594, Ftype1: int32(tZONE), }, 5: { Fname: __ccgo_ts + 25598, Ftype1: int32(tDAYZONE), }, 6: { Fname: __ccgo_ts + 25602, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(1), }, 7: { Fname: __ccgo_ts + 25606, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(2), }, 8: { Fname: __ccgo_ts + 25609, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * (libc.Int32FromInt32(7) / libc.Int32FromInt32(2)), }, 9: { Fname: __ccgo_ts + 25613, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * (libc.Int32FromInt32(7) / libc.Int32FromInt32(2)), }, 10: { Fname: __ccgo_ts + 25617, Ftype1: int32(tDAYZONE), Fvalue: libc.Int32FromInt32(60) * (libc.Int32FromInt32(7) / libc.Int32FromInt32(2)), }, 11: { Fname: __ccgo_ts + 25621, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(4), }, 12: { Fname: __ccgo_ts + 25625, Ftype1: int32(tDAYZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(4), }, 13: { Fname: __ccgo_ts + 25629, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(5), }, 14: { Fname: __ccgo_ts + 25633, Ftype1: int32(tDAYZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(5), }, 15: { Fname: __ccgo_ts + 25637, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(6), }, 16: { Fname: __ccgo_ts + 25641, Ftype1: int32(tDAYZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(6), }, 17: { Fname: __ccgo_ts + 25645, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(7), }, 18: { Fname: __ccgo_ts + 25649, Ftype1: int32(tDAYZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(7), }, 19: { Fname: __ccgo_ts + 25653, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(8), }, 20: { Fname: __ccgo_ts + 25657, Ftype1: int32(tDAYZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(8), }, 21: { Fname: __ccgo_ts + 25661, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(9), }, 22: { Fname: __ccgo_ts + 25665, Ftype1: int32(tDAYZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(9), }, 23: { Fname: __ccgo_ts + 25669, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(9), }, 24: { Fname: __ccgo_ts + 25674, Ftype1: int32(tDAYZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(9), }, 25: { Fname: __ccgo_ts + 25679, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(10), }, 26: { Fname: __ccgo_ts + 25683, Ftype1: int32(tDAYZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(10), }, 27: { Fname: __ccgo_ts + 19663, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(10), }, 28: { Fname: __ccgo_ts + 25687, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(10), }, 29: { Fname: __ccgo_ts + 25692, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(11), }, 30: { Fname: __ccgo_ts + 25695, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(12), }, 31: { Fname: __ccgo_ts + 25700, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 32: { Fname: __ccgo_ts + 25704, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 33: { Fname: __ccgo_ts + 25709, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 34: { Fname: __ccgo_ts + 25713, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 35: { Fname: __ccgo_ts + 25718, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 36: { Fname: __ccgo_ts + 25723, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 37: { Fname: __ccgo_ts + 25727, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 38: { Fname: __ccgo_ts + 25731, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 39: { Fname: __ccgo_ts + 25735, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 40: { Fname: __ccgo_ts + 25739, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(2)), }, 41: { Fname: __ccgo_ts + 25743, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(3)), }, 42: { Fname: __ccgo_ts + 25746, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * (libc.Int32FromInt32(7) / libc.Int32FromInt32(2))), }, 43: { Fname: __ccgo_ts + 25749, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(4)), }, 44: { Fname: __ccgo_ts + 25753, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(5)), }, 45: { Fname: __ccgo_ts + 25757, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * (libc.Int32FromInt32(11) / libc.Int32FromInt32(2))), }, 46: { Fname: __ccgo_ts + 25761, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(6)), }, 47: { Fname: __ccgo_ts + 25765, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(7)), }, 48: { Fname: __ccgo_ts + 25770, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(7)), }, 49: { Fname: __ccgo_ts + 25775, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * (libc.Int32FromInt32(15) / libc.Int32FromInt32(2))), }, 50: { Fname: __ccgo_ts + 25778, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(8)), }, 51: { Fname: __ccgo_ts + 25782, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(9)), }, 52: { Fname: __ccgo_ts + 25786, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(9)), }, 53: { Fname: __ccgo_ts + 25790, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(9)), }, 54: { Fname: __ccgo_ts + 25794, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(9)), }, 55: { Fname: __ccgo_ts + 25798, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * (libc.Int32FromInt32(19) / libc.Int32FromInt32(2))), }, 56: { Fname: __ccgo_ts + 25803, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * (libc.Int32FromInt32(19) / libc.Int32FromInt32(2))), }, 57: { Fname: __ccgo_ts + 25808, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(10)), }, 58: { Fname: __ccgo_ts + 25813, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(10)), }, 59: { Fname: __ccgo_ts + 25818, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(10)), }, 60: { Fname: __ccgo_ts + 25822, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(12)), }, 61: { Fname: __ccgo_ts + 25826, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(12)), }, 62: { Fname: __ccgo_ts + 25831, Ftype1: int32(tDAYZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(12)), }, 63: { Fname: __ccgo_ts + 25836, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(12)), }, 64: { Fname: __ccgo_ts + 25841, Ftype1: int32(tDST), }, 65: {}, } /* * Military timezone table. */ var _MilitaryTable = [26]TTABLE{ 0: { Fname: __ccgo_ts + 25845, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(1)), }, 1: { Fname: __ccgo_ts + 25847, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(2)), }, 2: { Fname: __ccgo_ts + 25849, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(3)), }, 3: { Fname: __ccgo_ts + 25851, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(4)), }, 4: { Fname: __ccgo_ts + 25853, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(5)), }, 5: { Fname: __ccgo_ts + 25855, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(6)), }, 6: { Fname: __ccgo_ts + 25857, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(7)), }, 7: { Fname: __ccgo_ts + 25859, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(8)), }, 8: { Fname: __ccgo_ts + 25861, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(9)), }, 9: { Fname: __ccgo_ts + 25863, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(10)), }, 10: { Fname: __ccgo_ts + 25865, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(11)), }, 11: { Fname: __ccgo_ts + 25867, Ftype1: int32(tZONE), Fvalue: -(libc.Int32FromInt32(60) * libc.Int32FromInt32(12)), }, 12: { Fname: __ccgo_ts + 25869, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(1), }, 13: { Fname: __ccgo_ts + 25871, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(2), }, 14: { Fname: __ccgo_ts + 25873, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(3), }, 15: { Fname: __ccgo_ts + 25875, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(4), }, 16: { Fname: __ccgo_ts + 25877, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(5), }, 17: { Fname: __ccgo_ts + 25879, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(6), }, 18: { Fname: __ccgo_ts + 25881, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(7), }, 19: { Fname: __ccgo_ts + 25883, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(8), }, 20: { Fname: __ccgo_ts + 25885, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(9), }, 21: { Fname: __ccgo_ts + 25887, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(10), }, 22: { Fname: __ccgo_ts + 25889, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(11), }, 23: { Fname: __ccgo_ts + 14842, Ftype1: int32(tZONE), Fvalue: libc.Int32FromInt32(60) * libc.Int32FromInt32(12), }, 24: { Fname: __ccgo_ts + 25891, Ftype1: int32(tZONE), }, 25: {}, } func _bypassSpaces(tls *libc.TLS, s uintptr) (r uintptr) { for XTclIsSpaceProc(tls, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(s)))) != 0 { s++ } return s } /* * Dump error messages in the bit bucket. */ func _TclDateerror(tls *libc.TLS, location uintptr, infoPtr uintptr, s uintptr) { var _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr2, t, v4, v7 uintptr var v1, v2, v5 bool var v3, v6 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr2, t, v1, v2, v3, v4, v5, v6, v7 if !((*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages != 0) { if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { (*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages = XTclThreadAllocObj(tls) } else { (*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages)).FtypePtr = libc.UintptrFromInt32(0) } XTcl_AppendToObj(tls, (*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages, (*TDateInfo)(unsafe.Pointer(infoPtr)).Fseparatrix, int64(-int32(1))) XTcl_AppendToObj(tls, (*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages, s, int64(-int32(1))) XTcl_AppendToObj(tls, (*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages, __ccgo_ts+25893, int64(-int32(1))) if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { t = XTclThreadAllocObj(tls) } else { t = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(t + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(t)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(t)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(t)).FinternalRep)) = int64((*TYYLTYPE)(unsafe.Pointer(location)).Ffirst_column) (*TTcl_Obj)(unsafe.Pointer(t)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) (*TTcl_Obj)(unsafe.Pointer(t)).FrefCount++ XTcl_AppendObjToObj(tls, (*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages, t) _objPtr = t v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } XTcl_AppendToObj(tls, (*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages, __ccgo_ts+6319, int64(-int32(1))) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { t = XTclThreadAllocObj(tls) } else { t = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(t + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(t)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(t)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(t)).FinternalRep)) = int64((*TYYLTYPE)(unsafe.Pointer(location)).Flast_column) (*TTcl_Obj)(unsafe.Pointer(t)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) (*TTcl_Obj)(unsafe.Pointer(t)).FrefCount++ XTcl_AppendObjToObj(tls, (*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages, t) _objPtr1 = t v7 = _objPtr1 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr1) } XTcl_AppendToObj(tls, (*TDateInfo)(unsafe.Pointer(infoPtr)).Fmessages, __ccgo_ts+3563, int64(-int32(1))) (*TDateInfo)(unsafe.Pointer(infoPtr)).Fseparatrix = __ccgo_ts + 286 } func XToSeconds(tls *libc.TLS, Hours int32, Minutes int32, Seconds int32, Meridian TMERIDIAN) (r int32) { switch Meridian { case int32(MER24): return (Hours*int32(60)+Minutes)*int32(60) + Seconds case int32(MERam): return ((Hours/int32(24)*int32(24)+Hours%int32(12))*int32(60)+Minutes)*int32(60) + Seconds case int32(MERpm): return ((Hours/int32(24)*int32(24)+Hours%int32(12)+int32(12))*int32(60)+Minutes)*int32(60) + Seconds } return -int32(1) /* Should never be reached */ } func _LookupWord(tls *libc.TLS, yylvalPtr uintptr, buff uintptr) (r int32) { var abbrev, i int32 var p, q, tp, v8, v9 uintptr _, _, _, _, _, _, _ = abbrev, i, p, q, tp, v8, v9 /* * Make it lowercase. */ XTcl_UtfToLower(tls, buff) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buff))) == int32('a') && (libc.Xstrcmp(tls, buff, __ccgo_ts+25907) == 0 || libc.Xstrcmp(tls, buff, __ccgo_ts+25910) == 0) { *(*_MERIDIAN)(unsafe.Pointer(yylvalPtr)) = int32(MERam) return int32(tMERIDIAN) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buff))) == int32('p') && (libc.Xstrcmp(tls, buff, __ccgo_ts+25915) == 0 || libc.Xstrcmp(tls, buff, __ccgo_ts+25918) == 0) { *(*_MERIDIAN)(unsafe.Pointer(yylvalPtr)) = int32(MERpm) return int32(tMERIDIAN) } /* * See if we have an abbreviation for a month. */ if libc.Xstrlen(tls, buff) == uint64(3) { abbrev = int32(1) } else { if libc.Xstrlen(tls, buff) == uint64(4) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buff + 3))) == int32('.') { abbrev = int32(1) *(*uint8)(unsafe.Pointer(buff + 3)) = uint8('\000') } else { abbrev = 0 } } tp = uintptr(unsafe.Pointer(&_MonthDayTable)) for { if !((*TTABLE)(unsafe.Pointer(tp)).Fname != 0) { break } if abbrev != 0 { if libc.Xstrncmp(tls, buff, (*TTABLE)(unsafe.Pointer(tp)).Fname, uint64(3)) == 0 { (*TYYSTYPE)(unsafe.Pointer(yylvalPtr)).FNumber = int64((*TTABLE)(unsafe.Pointer(tp)).Fvalue) return (*TTABLE)(unsafe.Pointer(tp)).Ftype1 } } else { if libc.Xstrcmp(tls, buff, (*TTABLE)(unsafe.Pointer(tp)).Fname) == 0 { (*TYYSTYPE)(unsafe.Pointer(yylvalPtr)).FNumber = int64((*TTABLE)(unsafe.Pointer(tp)).Fvalue) return (*TTABLE)(unsafe.Pointer(tp)).Ftype1 } } goto _1 _1: ; tp += 16 } tp = uintptr(unsafe.Pointer(&_TimezoneTable)) for { if !((*TTABLE)(unsafe.Pointer(tp)).Fname != 0) { break } if libc.Xstrcmp(tls, buff, (*TTABLE)(unsafe.Pointer(tp)).Fname) == 0 { (*TYYSTYPE)(unsafe.Pointer(yylvalPtr)).FNumber = int64((*TTABLE)(unsafe.Pointer(tp)).Fvalue) return (*TTABLE)(unsafe.Pointer(tp)).Ftype1 } goto _2 _2: ; tp += 16 } tp = uintptr(unsafe.Pointer(&_UnitsTable)) for { if !((*TTABLE)(unsafe.Pointer(tp)).Fname != 0) { break } if libc.Xstrcmp(tls, buff, (*TTABLE)(unsafe.Pointer(tp)).Fname) == 0 { (*TYYSTYPE)(unsafe.Pointer(yylvalPtr)).FNumber = int64((*TTABLE)(unsafe.Pointer(tp)).Fvalue) return (*TTABLE)(unsafe.Pointer(tp)).Ftype1 } goto _3 _3: ; tp += 16 } /* * Strip off any plural and try the units table again. */ i = libc.Int32FromUint64(libc.Xstrlen(tls, buff) - uint64(1)) if i > 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buff + uintptr(i)))) == int32('s') { *(*uint8)(unsafe.Pointer(buff + uintptr(i))) = uint8('\000') tp = uintptr(unsafe.Pointer(&_UnitsTable)) for { if !((*TTABLE)(unsafe.Pointer(tp)).Fname != 0) { break } if libc.Xstrcmp(tls, buff, (*TTABLE)(unsafe.Pointer(tp)).Fname) == 0 { (*TYYSTYPE)(unsafe.Pointer(yylvalPtr)).FNumber = int64((*TTABLE)(unsafe.Pointer(tp)).Fvalue) return (*TTABLE)(unsafe.Pointer(tp)).Ftype1 } goto _4 _4: ; tp += 16 } } tp = uintptr(unsafe.Pointer(&_OtherTable)) for { if !((*TTABLE)(unsafe.Pointer(tp)).Fname != 0) { break } if libc.Xstrcmp(tls, buff, (*TTABLE)(unsafe.Pointer(tp)).Fname) == 0 { (*TYYSTYPE)(unsafe.Pointer(yylvalPtr)).FNumber = int64((*TTABLE)(unsafe.Pointer(tp)).Fvalue) return (*TTABLE)(unsafe.Pointer(tp)).Ftype1 } goto _5 _5: ; tp += 16 } /* * Military timezones. */ if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buff + 1))) == int32('\000') && !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(buff)))&libc.Int32FromInt32(0x80) != 0) && libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(buff)))|uint32(32)-uint32('a') < uint32(26)) != 0 { /* INTL: ISO only */ tp = uintptr(unsafe.Pointer(&_MilitaryTable)) for { if !((*TTABLE)(unsafe.Pointer(tp)).Fname != 0) { break } if libc.Xstrcmp(tls, buff, (*TTABLE)(unsafe.Pointer(tp)).Fname) == 0 { (*TYYSTYPE)(unsafe.Pointer(yylvalPtr)).FNumber = int64((*TTABLE)(unsafe.Pointer(tp)).Fvalue) return (*TTABLE)(unsafe.Pointer(tp)).Ftype1 } goto _6 _6: ; tp += 16 } } /* * Drop out any periods and try the timezone table again. */ i = 0 v8 = buff q = v8 p = v8 for { if !(*(*uint8)(unsafe.Pointer(q)) != 0) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(q))) != int32('.') { v9 = p p++ *(*uint8)(unsafe.Pointer(v9)) = *(*uint8)(unsafe.Pointer(q)) } else { i++ } goto _7 _7: ; q++ } *(*uint8)(unsafe.Pointer(p)) = uint8('\000') if i != 0 { tp = uintptr(unsafe.Pointer(&_TimezoneTable)) for { if !((*TTABLE)(unsafe.Pointer(tp)).Fname != 0) { break } if libc.Xstrcmp(tls, buff, (*TTABLE)(unsafe.Pointer(tp)).Fname) == 0 { (*TYYSTYPE)(unsafe.Pointer(yylvalPtr)).FNumber = int64((*TTABLE)(unsafe.Pointer(tp)).Fvalue) return (*TTABLE)(unsafe.Pointer(tp)).Ftype1 } goto _10 _10: ; tp += 16 } } return int32(tID) } func _TclDatelex(tls *libc.TLS, yylvalPtr uintptr, location uintptr, info uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var Count, ret, v2, v3 int32 var c, v5, v8 uint8 var p, tokStart, v10, v11, v12, v13, v14, v15, v16, v17, v6, v9 uintptr var _ /* buff at bp+0 */ [20]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = Count, c, p, ret, tokStart, v10, v11, v12, v13, v14, v15, v16, v17, v2, v3, v5, v6, v8, v9 (*TYYLTYPE)(unsafe.Pointer(location)).Ffirst_column = int32(int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateStart)) for { v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput))) v3 = libc.BoolInt32(v2 == int32(' ') || libc.Uint32FromInt32(v2)-uint32('\t') < uint32(5)) goto _4 _4: if v3 != 0 { (*TDateInfo)(unsafe.Pointer(info)).FdateInput = _bypassSpaces(tls, (*TDateInfo)(unsafe.Pointer(info)).FdateInput) /* ignore space at end of text and before some words */ c = *(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput)) if libc.Int32FromUint8(c) != int32('\000') && !(libc.BoolInt32(uint32(c)|libc.Uint32FromInt32(32)-libc.Uint32FromUint8('a') < libc.Uint32FromInt32(26)) != 0) { return int32(SP) } } tokStart = (*TDateInfo)(unsafe.Pointer(info)).FdateInput v5 = *(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput)) c = v5 if libc.BoolInt32(uint32(v5)-uint32('0') < uint32(10)) != 0 { /* INTL: digit */ /* * Count the number of digits. */ p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput for { p++ v6 = p if !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer(v6)))-uint32('0') < uint32(10)) != 0) { break } } (*TDateInfo)(unsafe.Pointer(info)).FdateDigitCount = int32(int64(p) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput)) /* * A number with 12 or 14 digits is considered an ISO 8601 date. */ if (*TDateInfo)(unsafe.Pointer(info)).FdateDigitCount == int32(14) || (*TDateInfo)(unsafe.Pointer(info)).FdateDigitCount == int32(12) { /* long form of ISO 8601 (without separator), either * YYYYMMDDhhmmss or YYYYMMDDhhmm, so reduce to date * (8 chars is isodate) */ p = (*TDateInfo)(unsafe.Pointer(info)).FdateInput + uintptr(8) if XTclAtoWIe(tls, yylvalPtr, (*TDateInfo)(unsafe.Pointer(info)).FdateInput, p, int32(1)) != TCL_OK { return int32(tID) /* overflow*/ } (*TDateInfo)(unsafe.Pointer(info)).FdateDigitCount = int32(8) (*TDateInfo)(unsafe.Pointer(info)).FdateInput = p (*TYYLTYPE)(unsafe.Pointer(location)).Flast_column = int32(int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateStart) - int64(1)) return int32(tISOBASL) } /* * Convert the string into a number */ if XTclAtoWIe(tls, yylvalPtr, (*TDateInfo)(unsafe.Pointer(info)).FdateInput, p, int32(1)) != TCL_OK { return int32(tID) /* overflow*/ } (*TDateInfo)(unsafe.Pointer(info)).FdateInput = p /* * A number with 6 or more digits is considered an ISO 8601 base. */ (*TYYLTYPE)(unsafe.Pointer(location)).Flast_column = int32(int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateStart) - int64(1)) if (*TDateInfo)(unsafe.Pointer(info)).FdateDigitCount >= int32(6) { if (*TDateInfo)(unsafe.Pointer(info)).FdateDigitCount == int32(8) { return int32(tISOBAS8) } if (*TDateInfo)(unsafe.Pointer(info)).FdateDigitCount == int32(6) { return int32(tISOBAS6) } } /* ignore spaces after digits (optional) */ (*TDateInfo)(unsafe.Pointer(info)).FdateInput = _bypassSpaces(tls, (*TDateInfo)(unsafe.Pointer(info)).FdateInput) return int32(tUNUMBER) } if !(libc.Int32FromUint8(c)&libc.Int32FromInt32(0x80) != 0) && libc.BoolInt32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) != 0 { p = bp for { v10 = info + 8 v9 = *(*uintptr)(unsafe.Pointer(v10)) *(*uintptr)(unsafe.Pointer(v10))++ v8 = *(*uint8)(unsafe.Pointer(v9)) c = v8 if !(libc.BoolInt32(uint32(v8)|uint32(32)-uint32('a') < uint32(26)) != 0 || libc.Int32FromUint8(c) == int32('.')) { break } if p < bp+uintptr(libc.Uint64FromInt64(20)-libc.Uint64FromInt32(1)) { v11 = p p++ *(*uint8)(unsafe.Pointer(v11)) = c } goto _7 _7: } *(*uint8)(unsafe.Pointer(p)) = uint8('\000') (*TDateInfo)(unsafe.Pointer(info)).FdateInput-- (*TYYLTYPE)(unsafe.Pointer(location)).Flast_column = int32(int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateStart) - int64(1)) ret = _LookupWord(tls, yylvalPtr, bp) /* * lookahead: * for spaces to consider word boundaries (for instance * literal T in isodateTisotimeZ is not a TZ, but Z is UTC); * for +/- digit, to differentiate between "GMT+1000 day" and "GMT +1000 day"; * bypass spaces after token (but ignore by TZ+OFFS), because should * recognize next SP token, if TZ only. */ if ret == int32(tZONE) || ret == int32(tDAYZONE) { c = *(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput)) if libc.BoolInt32(uint32(c)-uint32('0') < uint32(10)) != 0 { /* literal not a TZ */ (*TDateInfo)(unsafe.Pointer(info)).FdateInput = tokStart v13 = info + 8 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v12))) } if (libc.Int32FromUint8(c) == int32('+') || libc.Int32FromUint8(c) == int32('-')) && libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput + libc.UintptrFromInt32(1))))-uint32('0') < uint32(10)) != 0 { if !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput + libc.UintptrFromInt32(2))))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) || !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput + libc.UintptrFromInt32(3))))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) { /* GMT+1, GMT-10, etc. */ return int32(tZONEwO2) } if libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput + libc.UintptrFromInt32(4))))-uint32('0') < uint32(10)) != 0 && !(libc.BoolInt32(uint32(*(*uint8)(unsafe.Pointer((*TDateInfo)(unsafe.Pointer(info)).FdateInput + libc.UintptrFromInt32(5))))-libc.Uint32FromUint8('0') < libc.Uint32FromInt32(10)) != 0) { /* GMT+1000, etc. */ return int32(tZONEwO4) } } } (*TDateInfo)(unsafe.Pointer(info)).FdateInput = _bypassSpaces(tls, (*TDateInfo)(unsafe.Pointer(info)).FdateInput) return ret } if libc.Int32FromUint8(c) != int32('(') { (*TYYLTYPE)(unsafe.Pointer(location)).Flast_column = int32(int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateStart)) v15 = info + 8 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v14))) } Count = 0 for cond := true; cond; cond = Count > 0 { v17 = info + 8 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ c = *(*uint8)(unsafe.Pointer(v16)) if libc.Int32FromUint8(c) == int32('\000') { (*TYYLTYPE)(unsafe.Pointer(location)).Flast_column = int32(int64((*TDateInfo)(unsafe.Pointer(info)).FdateInput) - int64((*TDateInfo)(unsafe.Pointer(info)).FdateStart) - int64(1)) return libc.Int32FromUint8(c) } else { if libc.Int32FromUint8(c) == int32('(') { Count++ } else { if libc.Int32FromUint8(c) == int32(')') { Count-- } } } } goto _1 _1: } return r } func XTclClockFreeScan(tls *libc.TLS, interp uintptr, info uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Input and result parameters */ var _objPtr, msg, v1, v3 uintptr var status int32 var v2 TTcl_Size _, _, _, _, _, _ = _objPtr, msg, status, v1, v2, v3 /* * yyInput = stringToParse; * * ClockInitDateInfo(info) should be executed to pre-init info; */ (*TDateInfo)(unsafe.Pointer(info)).FdateDSTmode = int32(DSTmaybe) (*TDateInfo)(unsafe.Pointer(info)).Fseparatrix = __ccgo_ts + 1945 (*TDateInfo)(unsafe.Pointer(info)).FdateStart = (*TDateInfo)(unsafe.Pointer(info)).FdateInput /* ignore spaces at begin */ (*TDateInfo)(unsafe.Pointer(info)).FdateInput = _bypassSpaces(tls, (*TDateInfo)(unsafe.Pointer(info)).FdateInput) /* parse */ status = XTclDateparse(tls, info) if status == int32(1) { msg = libc.UintptrFromInt32(0) if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags&int32(CLF_HAVEDATE) != 0 { msg = __ccgo_ts + 25923 } else { if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags&int32(CLF_TIME) != 0 { msg = __ccgo_ts + 25952 } else { if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags&int32(CLF_ZONE) != 0 { msg = __ccgo_ts + 25988 } else { if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags&int32(CLF_DAYOFWEEK) != 0 { msg = __ccgo_ts + 26022 } else { if (*TDateInfo)(unsafe.Pointer(info)).FerrFlags&int32(CLF_ORDINALMONTH) != 0 { msg = __ccgo_ts + 26054 } } } } } if msg != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, msg, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+26092, __ccgo_ts+26097, libc.UintptrFromInt32(0))) } else { if (*TDateInfo)(unsafe.Pointer(info)).Fmessages != 0 { v1 = (*TDateInfo)(unsafe.Pointer(info)).Fmessages } else { v1 = XTcl_NewObj(tls) } XTcl_SetObjResult(tls, interp, v1) (*TDateInfo)(unsafe.Pointer(info)).Fmessages = libc.UintptrFromInt32(0) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+26092, __ccgo_ts+23085, libc.UintptrFromInt32(0))) } status = int32(TCL_ERROR) } else { if status == int32(2) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+25262, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+2008, libc.UintptrFromInt32(0))) status = int32(TCL_ERROR) } else { if status != 0 { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+26106, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+26190, libc.UintptrFromInt32(0))) status = int32(TCL_ERROR) } } } if (*TDateInfo)(unsafe.Pointer(info)).Fmessages != 0 { _objPtr = (*TDateInfo)(unsafe.Pointer(info)).Fmessages v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } } return status } const LOCAL_SIZE = 64 /* * Forward declaration. */ type TDict1 = struct { Ftable TTcl_HashTable FentryChainHead uintptr FentryChainTail uintptr Fepoch Tsize_t FrefCount Tsize_t Fchain uintptr } /* * Table of dict subcommand names and implementations. */ var _implementationMap = [23]TEnsembleImplMap{ 0: { Fname: __ccgo_ts + 2125, }, 1: { Fname: __ccgo_ts + 26194, }, 2: { Fname: __ccgo_ts + 5689, }, 3: { Fname: __ccgo_ts + 26201, }, 4: { Fname: __ccgo_ts + 5187, }, 5: { Fname: __ccgo_ts + 24987, }, 6: { Fname: __ccgo_ts + 26208, }, 7: { Fname: __ccgo_ts + 26215, }, 8: { Fname: __ccgo_ts + 2542, }, 9: { Fname: __ccgo_ts + 5873, }, 10: { Fname: __ccgo_ts + 26230, }, 11: { Fname: __ccgo_ts + 2733, }, 12: { Fname: __ccgo_ts + 19715, }, 13: { Fname: __ccgo_ts + 26235, }, 14: { Fname: __ccgo_ts + 26241, }, 15: { Fname: __ccgo_ts + 19738, }, 16: { Fname: __ccgo_ts + 5383, }, 17: { Fname: __ccgo_ts + 5807, }, 18: { Fname: __ccgo_ts + 3450, }, 19: { Fname: __ccgo_ts + 5602, }, 20: { Fname: __ccgo_ts + 26248, }, 21: { Fname: __ccgo_ts + 26255, }, 22: {}, } func init() { p := unsafe.Pointer(&_implementationMap) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_DictAppendCmd) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompileDictAppendCmd) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_DictCreateCmd) *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(XTclCompileDictCreateCmd) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_DictExistsCmd) *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(XTclCompileDictExistsCmd) *(*uintptr)(unsafe.Add(p, 152)) = __ccgo_fp(_DictFilterCmd) *(*uintptr)(unsafe.Add(p, 208)) = __ccgo_fp(XTclCompileDictForCmd) *(*uintptr)(unsafe.Add(p, 216)) = __ccgo_fp(_DictForNRCmd) *(*uintptr)(unsafe.Add(p, 248)) = __ccgo_fp(_DictGetCmd) *(*uintptr)(unsafe.Add(p, 256)) = __ccgo_fp(XTclCompileDictGetCmd) *(*uintptr)(unsafe.Add(p, 296)) = __ccgo_fp(_DictGetDefCmd) *(*uintptr)(unsafe.Add(p, 304)) = __ccgo_fp(XTclCompileDictGetWithDefaultCmd) *(*uintptr)(unsafe.Add(p, 344)) = __ccgo_fp(_DictGetDefCmd) *(*uintptr)(unsafe.Add(p, 352)) = __ccgo_fp(XTclCompileDictGetWithDefaultCmd) *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_DictIncrCmd) *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(XTclCompileDictIncrCmd) *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_DictInfoCmd) *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 488)) = __ccgo_fp(_DictKeysCmd) *(*uintptr)(unsafe.Add(p, 496)) = __ccgo_fp(XTclCompileBasic1Or2ArgCmd) *(*uintptr)(unsafe.Add(p, 536)) = __ccgo_fp(_DictLappendCmd) *(*uintptr)(unsafe.Add(p, 544)) = __ccgo_fp(XTclCompileDictLappendCmd) *(*uintptr)(unsafe.Add(p, 592)) = __ccgo_fp(XTclCompileDictMapCmd) *(*uintptr)(unsafe.Add(p, 600)) = __ccgo_fp(_DictMapNRCmd) *(*uintptr)(unsafe.Add(p, 632)) = __ccgo_fp(_DictMergeCmd) *(*uintptr)(unsafe.Add(p, 640)) = __ccgo_fp(XTclCompileDictMergeCmd) *(*uintptr)(unsafe.Add(p, 680)) = __ccgo_fp(_DictRemoveCmd) *(*uintptr)(unsafe.Add(p, 688)) = __ccgo_fp(XTclCompileBasicMin1ArgCmd) *(*uintptr)(unsafe.Add(p, 728)) = __ccgo_fp(_DictReplaceCmd) *(*uintptr)(unsafe.Add(p, 776)) = __ccgo_fp(_DictSetCmd) *(*uintptr)(unsafe.Add(p, 784)) = __ccgo_fp(XTclCompileDictSetCmd) *(*uintptr)(unsafe.Add(p, 824)) = __ccgo_fp(_DictSizeCmd) *(*uintptr)(unsafe.Add(p, 832)) = __ccgo_fp(XTclCompileBasic1ArgCmd) *(*uintptr)(unsafe.Add(p, 872)) = __ccgo_fp(_DictUnsetCmd) *(*uintptr)(unsafe.Add(p, 880)) = __ccgo_fp(XTclCompileDictUnsetCmd) *(*uintptr)(unsafe.Add(p, 920)) = __ccgo_fp(_DictUpdateCmd) *(*uintptr)(unsafe.Add(p, 928)) = __ccgo_fp(XTclCompileDictUpdateCmd) *(*uintptr)(unsafe.Add(p, 968)) = __ccgo_fp(_DictValuesCmd) *(*uintptr)(unsafe.Add(p, 976)) = __ccgo_fp(XTclCompileBasic1Or2ArgCmd) *(*uintptr)(unsafe.Add(p, 1016)) = __ccgo_fp(_DictWithCmd) *(*uintptr)(unsafe.Add(p, 1024)) = __ccgo_fp(XTclCompileDictWithCmd) } /* * Internal representation of the entries in the hash table that backs a * dictionary. */ type TChainEntry = struct { Fentry TTcl_HashEntry FprevPtr uintptr FnextPtr uintptr } /* * Internal representation of a dictionary. * * The internal representation of a dictionary object is a hash table (with * Tcl_Objs for both keys and values), a reference count and epoch number for * detecting concurrent modifications of the dictionary, and a pointer to the * parent object (used when invalidating string reps of pathed dictionary * trees) which is NULL in normal use. The fact that hash tables know (with * appropriate initialisation) already about objects makes key management /so/ * much easier! * * Reference counts are used to enable safe iteration across hashes while * allowing the type of the containing object to be modified. */ type TDict = struct { Ftable TTcl_HashTable FentryChainHead uintptr FentryChainTail uintptr Fepoch Tsize_t FrefCount Tsize_t Fchain uintptr } func init() { p := unsafe.Pointer(&XtclDictType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_FreeDictInternalRep) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_DupDictInternalRep) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_UpdateStringOfDict) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_SetDictFromAny) } /* * The type of the specially adapted version of the Tcl_Obj*-containing hash * table defined in the tclObj.c code. This version differs in that it * allocates a bit more space in each hash entry in order to hold the pointers * used to keep the hash entries in a linked list. * * Note that this type of hash table is *only* suitable for direct use in * *this* file. Everything else should use the dict iterator API. */ var _chainHashType = TTcl_HashKeyType{ Fversion: int32(TCL_HASH_KEY_TYPE_VERSION), Fflags: int32(TCL_HASH_KEY_DIRECT_COMPARE), } func init() { p := unsafe.Pointer(&_chainHashType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(XTclHashObjKey) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(XTclCompareObjKeys) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_AllocChainEntry) *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(XTclFreeObjEntry) } /* * Structure used in implementation of 'dict map' to hold the state that gets * passed between parts of the implementation. */ type TDictMapStorage = struct { FkeyVarObj uintptr FvalueVarObj uintptr Fsearch TTcl_DictSearch FscriptObj uintptr FaccumulatorObj uintptr } /***** START OF FUNCTIONS IMPLEMENTING DICT CORE API *****/ /* *---------------------------------------------------------------------- * * AllocChainEntry -- * * Allocate space for a Tcl_HashEntry containing the Tcl_Obj * key, and * which has a bit of extra space afterwards for storing pointers to the * rest of the chain of entries (the extra pointers are left NULL). * * Results: * The return value is a pointer to the created entry. * * Side effects: * Increments the reference count on the object. * *---------------------------------------------------------------------- */ func _AllocChainEntry(tls *libc.TLS, dummy226 uintptr, keyPtr uintptr) (r uintptr) { var cPtr, objPtr, v1 uintptr _, _, _ = cPtr, objPtr, v1 objPtr = keyPtr cPtr = XTcl_Alloc(tls, uint64(56)) *(*uintptr)(unsafe.Pointer(cPtr + 32)) = objPtr (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ (*TTcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData = libc.UintptrFromInt32(0) v1 = libc.UintptrFromInt32(0) (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr = v1 (*TChainEntry)(unsafe.Pointer(cPtr)).FprevPtr = v1 return cPtr } /* * Helper functions that disguise most of the details relating to how the * linked list of hash entries is managed. In particular, these manage the * creation of the table and initializing of the chain, the deletion of the * table and chain, the adding of an entry to the chain, and the removal of an * entry from the chain. */ func _InitChainTable(tls *libc.TLS, dict uintptr) { var v1 uintptr _ = v1 XTcl_InitCustomHashTable(tls, dict, -int32(1), uintptr(unsafe.Pointer(&_chainHashType))) v1 = libc.UintptrFromInt32(0) (*TDict)(unsafe.Pointer(dict)).FentryChainTail = v1 (*TDict)(unsafe.Pointer(dict)).FentryChainHead = v1 } func _DeleteChainTable(tls *libc.TLS, dict uintptr) { var cPtr, cachePtr, valuePtr, v3 uintptr var v2 TTcl_Size var v4 bool _, _, _, _, _, _ = cPtr, cachePtr, valuePtr, v2, v3, v4 cPtr = (*TDict)(unsafe.Pointer(dict)).FentryChainHead for { if !(cPtr != libc.UintptrFromInt32(0)) { break } valuePtr = (*TTcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData v3 = valuePtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if !(v2 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength = int64(-libc.Int32FromInt32(1)) if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, valuePtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valuePtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = valuePtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, valuePtr) } } goto _1 _1: ; cPtr = (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr } XTcl_DeleteHashTable(tls, dict) } func _CreateChainEntry(tls *libc.TLS, dict uintptr, keyPtr uintptr, newPtr uintptr) (r uintptr) { var cPtr uintptr _ = cPtr cPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(dict)).FcreateProc})))(tls, dict, keyPtr, newPtr) /* * If this is a new entry in the hash table, stitch it into the chain. */ if *(*int32)(unsafe.Pointer(newPtr)) != 0 { (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr = libc.UintptrFromInt32(0) if (*TDict)(unsafe.Pointer(dict)).FentryChainHead == libc.UintptrFromInt32(0) { (*TChainEntry)(unsafe.Pointer(cPtr)).FprevPtr = libc.UintptrFromInt32(0) (*TDict)(unsafe.Pointer(dict)).FentryChainHead = cPtr (*TDict)(unsafe.Pointer(dict)).FentryChainTail = cPtr } else { (*TChainEntry)(unsafe.Pointer(cPtr)).FprevPtr = (*TDict)(unsafe.Pointer(dict)).FentryChainTail (*TChainEntry)(unsafe.Pointer((*TDict)(unsafe.Pointer(dict)).FentryChainTail)).FnextPtr = cPtr (*TDict)(unsafe.Pointer(dict)).FentryChainTail = cPtr } } return cPtr } func _DeleteChainEntry(tls *libc.TLS, dict uintptr, keyPtr uintptr) (r int32) { var cPtr, cachePtr, valuePtr, v2 uintptr var v1 TTcl_Size var v3 bool _, _, _, _, _, _ = cPtr, cachePtr, valuePtr, v1, v2, v3 cPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(dict)).FfindProc})))(tls, dict, keyPtr) if cPtr == libc.UintptrFromInt32(0) { return 0 } else { valuePtr = (*TTcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData v2 = valuePtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, valuePtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valuePtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = valuePtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, valuePtr) } } } /* * Unstitch from the chain. */ if (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr != 0 { (*TChainEntry1)(unsafe.Pointer((*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr)).FprevPtr = (*TChainEntry)(unsafe.Pointer(cPtr)).FprevPtr } else { (*TDict)(unsafe.Pointer(dict)).FentryChainTail = (*TChainEntry)(unsafe.Pointer(cPtr)).FprevPtr } if (*TChainEntry)(unsafe.Pointer(cPtr)).FprevPtr != 0 { (*TChainEntry1)(unsafe.Pointer((*TChainEntry)(unsafe.Pointer(cPtr)).FprevPtr)).FnextPtr = (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr } else { (*TDict)(unsafe.Pointer(dict)).FentryChainHead = (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr } XTcl_DeleteHashEntry(tls, cPtr) return int32(1) } /* *---------------------------------------------------------------------- * * DupDictInternalRep -- * * Initialize the internal representation of a dictionary Tcl_Obj to a * copy of the internal representation of an existing dictionary object. * * Results: * None. * * Side effects: * "srcPtr"s dictionary internal rep pointer should not be NULL and we * assume it is not NULL. We set "copyPtr"s internal rep to a pointer to * a newly allocated dictionary rep that, in turn, points to "srcPtr"s * key and value objects. Those objects are not actually copied but are * shared between "srcPtr" and "copyPtr". The ref count of each key and * value object is incremented. * *---------------------------------------------------------------------- */ func _DupDictInternalRep(tls *libc.TLS, srcPtr uintptr, copyPtr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var cPtr, hPtr, irPtr, key, newDict, oldDict, valuePtr, v1, v2, v4 uintptr var _ /* ir at bp+8 */ TTcl_ObjInternalRep var _ /* n at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = cPtr, hPtr, irPtr, key, newDict, oldDict, valuePtr, v1, v2, v4 newDict = XTcl_Alloc(tls, uint64(144)) if (*TTcl_Obj)(unsafe.Pointer(srcPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = srcPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } oldDict = v2 /* * Copy values across from the old hash table. */ _InitChainTable(tls, newDict) cPtr = (*TDict)(unsafe.Pointer(oldDict)).FentryChainHead for { if !(cPtr != libc.UintptrFromInt32(0)) { break } if (*TTcl_HashTable)(unsafe.Pointer(oldDict)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(oldDict)).FkeyType == -int32(1) { v4 = *(*uintptr)(unsafe.Pointer(cPtr + 32)) } else { v4 = cPtr + 32 } key = v4 valuePtr = (*TTcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData hPtr = _CreateChainEntry(tls, newDict, key, bp) /* * Fill in the contents. */ (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = valuePtr (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++ goto _3 _3: ; cPtr = (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr } /* * Initialise other fields. */ (*TDict)(unsafe.Pointer(newDict)).Fepoch = uint64(1) (*TDict)(unsafe.Pointer(newDict)).Fchain = libc.UintptrFromInt32(0) (*TDict)(unsafe.Pointer(newDict)).FrefCount = uint64(1) /* * Store in the object. */ (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp + 8))).Fptr1 = newDict (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp + 8))).Fptr2 = libc.UintptrFromInt32(0) XTcl_StoreInternalRep(tls, copyPtr, uintptr(unsafe.Pointer(&XtclDictType)), bp+8) } /* *---------------------------------------------------------------------- * * FreeDictInternalRep -- * * Deallocate the storage associated with a dictionary object's internal * representation. * * Results: * None * * Side effects: * Frees the memory holding the dictionary's internal hash table unless * it is locked by an iteration going over it. * *---------------------------------------------------------------------- */ func _FreeDictInternalRep(tls *libc.TLS, dictPtr uintptr) { var dict, irPtr, v1, v2, v4 uintptr var v3 Tsize_t _, _, _, _, _, _ = dict, irPtr, v1, v2, v3, v4 if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = dictPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } dict = v2 v4 = dict + 128 v3 = *(*Tsize_t)(unsafe.Pointer(v4)) *(*Tsize_t)(unsafe.Pointer(v4))-- if v3 <= uint64(1) { _DeleteDict(tls, dict) } } /* *---------------------------------------------------------------------- * * DeleteDict -- * * Delete the structure that is used to implement a dictionary's internal * representation. Called when either the dictionary object loses its * internal representation or when the last iteration over the dictionary * completes. * * Results: * None * * Side effects: * Decrements the reference count of all key and value objects in the * dictionary, which may free them. * *---------------------------------------------------------------------- */ func _DeleteDict(tls *libc.TLS, dict uintptr) { _DeleteChainTable(tls, dict) XTclpFree(tls, dict) } /* *---------------------------------------------------------------------- * * UpdateStringOfDict -- * * Update the string representation for a dictionary object. Note: This * function does not invalidate an existing old string rep so storage * will be lost if this has not already been done. This code is based on * UpdateStringOfList in tclListObj.c * * Results: * None. * * Side effects: * The object's string is set to a valid string that results from the * dict-to-string conversion. This string will be empty if the dictionary * has no key/value pairs. The dictionary internal representation should * not be NULL and we assume it is not NULL. * *---------------------------------------------------------------------- */ func _UpdateStringOfDict(tls *libc.TLS, dictPtr uintptr) { bp := tls.Alloc(96) defer tls.Free(96) var bytesNeeded Tsize_t var cPtr, dict, dst, elem, flagPtr, irPtr, keyPtr, valuePtr, v1, v13, v14, v15, v17, v18, v2, v5, v6, v7, p11, p16 uintptr var i, numElems TTcl_Size var v12, v4 int32 var v8, v9 bool var _ /* length at bp+64 */ TTcl_Size var _ /* localFlags at bp+0 */ [64]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bytesNeeded, cPtr, dict, dst, elem, flagPtr, i, irPtr, keyPtr, numElems, valuePtr, v1, v12, v13, v14, v15, v17, v18, v2, v4, v5, v6, v7, v8, v9, p11, p16 flagPtr = libc.UintptrFromInt32(0) bytesNeeded = uint64(0) if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = dictPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } dict = v2 numElems = (*TDict)(unsafe.Pointer(dict)).Ftable.FnumEntries * int64(2) /* Handle empty list case first, simplifies what follows */ if numElems == 0 { XTcl_InitStringRep(tls, dictPtr, libc.UintptrFromInt32(0), uint64(0)) return } /* * Pass 1: estimate space, gather flags. */ if numElems <= int64(LOCAL_SIZE) { flagPtr = bp } else { flagPtr = XTcl_Alloc(tls, libc.Uint64FromInt64(numElems)) } i = 0 cPtr = (*TDict)(unsafe.Pointer(dict)).FentryChainHead for { if !(i < numElems) { break } /* * Assume that cPtr is never NULL since we know the number of array * elements already. */ if i != 0 { v4 = int32(TCL_DONT_QUOTE_HASH) } else { v4 = 0 } *(*uint8)(unsafe.Pointer(flagPtr + uintptr(i))) = libc.Uint8FromInt32(v4) if (*TTcl_HashTable)(unsafe.Pointer(dict)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(dict)).FkeyType == -int32(1) { v5 = *(*uintptr)(unsafe.Pointer(cPtr + 32)) } else { v5 = cPtr + 32 } keyPtr = v5 if (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 64)) = (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Flength v6 = (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, keyPtr, bp+64) } elem = v6 bytesNeeded += libc.Uint64FromInt64(XTclScanElement(tls, elem, *(*TTcl_Size)(unsafe.Pointer(bp + 64)), flagPtr+uintptr(i))) *(*uint8)(unsafe.Pointer(flagPtr + uintptr(i+int64(1)))) = uint8(TCL_DONT_QUOTE_HASH) valuePtr = (*TTcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData if (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 64)) = (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength v7 = (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, valuePtr, bp+64) } elem = v7 bytesNeeded += libc.Uint64FromInt64(XTclScanElement(tls, elem, *(*TTcl_Size)(unsafe.Pointer(bp + 64)), flagPtr+uintptr(i)+uintptr(1))) goto _3 _3: ; i += int64(2) cPtr = (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr } bytesNeeded += libc.Uint64FromInt64(numElems) /* * Pass 2: copy into string rep buffer. */ dst = XTcl_InitStringRep(tls, dictPtr, libc.UintptrFromInt32(0), bytesNeeded-uint64(1)) if v9 = bytesNeeded != 0; v9 { if v8 = dst != 0; !v8 { XTcl_Panic(tls, __ccgo_ts+10479, libc.VaList(bp+80, bytesNeeded)) } } _ = v9 && (v8 || libc.Bool(libc.Int32FromInt32(1) != 0)) i = 0 cPtr = (*TDict)(unsafe.Pointer(dict)).FentryChainHead for { if !(i < numElems) { break } p11 = flagPtr + uintptr(i) if i != 0 { v12 = int32(TCL_DONT_QUOTE_HASH) } else { v12 = 0 } *(*uint8)(unsafe.Pointer(p11)) = uint8(int32(*(*uint8)(unsafe.Pointer(p11))) | v12) if (*TTcl_HashTable)(unsafe.Pointer(dict)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(dict)).FkeyType == -int32(1) { v13 = *(*uintptr)(unsafe.Pointer(cPtr + 32)) } else { v13 = cPtr + 32 } keyPtr = v13 if (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 64)) = (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Flength v14 = (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes } else { v14 = XTcl_GetStringFromObj(tls, keyPtr, bp+64) } elem = v14 dst += uintptr(XTclConvertElement(tls, elem, *(*TTcl_Size)(unsafe.Pointer(bp + 64)), dst, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(flagPtr + uintptr(i)))))) v15 = dst dst++ *(*uint8)(unsafe.Pointer(v15)) = uint8(' ') p16 = flagPtr + uintptr(i+int64(1)) *(*uint8)(unsafe.Pointer(p16)) = uint8(int32(*(*uint8)(unsafe.Pointer(p16))) | libc.Int32FromInt32(TCL_DONT_QUOTE_HASH)) valuePtr = (*TTcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData if (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 64)) = (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength v17 = (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes } else { v17 = XTcl_GetStringFromObj(tls, valuePtr, bp+64) } elem = v17 dst += uintptr(XTclConvertElement(tls, elem, *(*TTcl_Size)(unsafe.Pointer(bp + 64)), dst, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(flagPtr + uintptr(i+int64(1))))))) v18 = dst dst++ *(*uint8)(unsafe.Pointer(v18)) = uint8(' ') goto _10 _10: ; i += int64(2) cPtr = (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr } /* Last space overwrote the terminating NUL; cal T_ISR again to restore */ XTcl_InitStringRep(tls, dictPtr, libc.UintptrFromInt32(0), bytesNeeded-uint64(1)) if flagPtr != bp { XTclpFree(tls, flagPtr) } } /* *---------------------------------------------------------------------- * * SetDictFromAny -- * * Convert a non-dictionary object into a dictionary object. This code is * very closely related to SetListFromAny in tclListObj.c but does not * actually guarantee that a dictionary object will have a string rep (as * conversions from lists are handled with a special case.) * * Results: * A standard Tcl result. * * Side effects: * If the string can be converted, it loses any old internal * representation that it had and gains a dictionary's internalRep. * *---------------------------------------------------------------------- */ func _SetDictFromAny(tls *libc.TLS, interp uintptr, objPtr uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) var cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, dict, discardedValue, discardedValue1, dst, dst1, hPtr, keyPtr, limit, valuePtr, v11, v16, v19, v24, v27, v7, v9 uintptr var i, v15, v23, v26, v6 TTcl_Size var v10, v12, v13, v14, v17, v18, v20, v21, v22, v25, v28, v8 bool var v2, v3 int64 var _ /* elemSize at bp+48 */ TTcl_Size var _ /* elemStart at bp+40 */ uintptr var _ /* ir at bp+64 */ TTcl_ObjInternalRep var _ /* isNew at bp+0 */ int32 var _ /* length at bp+24 */ TTcl_Size var _ /* literal at bp+56 */ int32 var _ /* nextElem at bp+32 */ uintptr var _ /* objc at bp+8 */ TTcl_Size var _ /* objv at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, dict, discardedValue, discardedValue1, dst, dst1, hPtr, i, keyPtr, limit, valuePtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v3, v6, v7, v8, v9 dict = XTcl_Alloc(tls, uint64(144)) _InitChainTable(tls, dict) /* * Since lists and dictionaries have very closely-related string * representations (i.e. the same parsing code) we can safely special-case * the conversion from lists to dictionaries. */ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { /* Cannot fail, we already know the Tcl_ObjType is "list". */ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v3 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), objPtr, bp+8, bp+16) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8))&int64(1) != 0 { goto missingValue } i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } /* Store key and value in the hash table we're building. */ hPtr = _CreateChainEntry(tls, dict, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i)*8)), bp) if !(*(*int32)(unsafe.Pointer(bp)) != 0) { discardedValue = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData /* * Not really a well-formed dictionary as there are duplicate * keys, so better get the string rep here so that we can * convert back. */ if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { _ = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { XTcl_GetStringFromObj(tls, objPtr, libc.UintptrFromInt32(0)) } v7 = discardedValue v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if !(v6 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(discardedValue)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(discardedValue)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(discardedValue)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(discardedValue)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(discardedValue)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(discardedValue)).Flength = int64(-libc.Int32FromInt32(1)) if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, discardedValue) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(discardedValue + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = discardedValue (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, discardedValue) } } } (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i+int64(1))*8)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(i+int64(1))*8)))).FrefCount++ /* Since hash now holds ref to it */ goto _4 _4: ; i += int64(2) } } else { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v9 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v9 = XTcl_GetStringFromObj(tls, objPtr, bp+24) } *(*uintptr)(unsafe.Pointer(bp + 32)) = v9 limit = *(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 24))) for *(*uintptr)(unsafe.Pointer(bp + 32)) < limit { if XTclFindDictElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 32)), int64(limit)-int64(*(*uintptr)(unsafe.Pointer(bp + 32))), bp+40, bp+32, bp+48, bp+56) != TCL_OK { goto errorInFindDictElement } if *(*uintptr)(unsafe.Pointer(bp + 40)) == limit { break } if *(*uintptr)(unsafe.Pointer(bp + 32)) == limit { goto missingValue } if *(*int32)(unsafe.Pointer(bp + 56)) != 0 { if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { keyPtr = XTclThreadAllocObj(tls) } else { keyPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0 if *(*TTcl_Size)(unsafe.Pointer(bp + 48)) == 0 { (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 48))+libc.Int64FromUint32(1))) if *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 { v11 = *(*uintptr)(unsafe.Pointer(bp + 40)) } else { v11 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes, v11, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 48)))) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 48))))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Flength = *(*TTcl_Size)(unsafe.Pointer(bp + 48)) } (*TTcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = libc.UintptrFromInt32(0) } else { if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { keyPtr = XTclThreadAllocObj(tls) } else { keyPtr = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_InvalidateStringRep(tls, keyPtr) dst = XTcl_InitStringRep(tls, keyPtr, libc.UintptrFromInt32(0), libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 48)))) if v14 = *(*TTcl_Size)(unsafe.Pointer(bp + 48)) != 0; v14 { if v13 = dst != 0; !v13 { XTcl_Panic(tls, __ccgo_ts+10479, libc.VaList(bp+88, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 48))))) } } _ = v14 && (v13 || libc.Bool(libc.Int32FromInt32(1) != 0)) /* Consider error */ XTcl_InitStringRep(tls, keyPtr, libc.UintptrFromInt32(0), libc.Uint64FromInt64(XTclCopyAndCollapse(tls, *(*TTcl_Size)(unsafe.Pointer(bp + 48)), *(*uintptr)(unsafe.Pointer(bp + 40)), dst))) } if XTclFindDictElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 32)), int64(limit)-int64(*(*uintptr)(unsafe.Pointer(bp + 32))), bp+40, bp+32, bp+48, bp+56) != TCL_OK { v16 = keyPtr v15 = *(*TTcl_Size)(unsafe.Pointer(v16)) *(*TTcl_Size)(unsafe.Pointer(v16))-- if !(v15 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v17 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v17 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v17 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, keyPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = keyPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, keyPtr) } } goto errorInFindDictElement } if *(*int32)(unsafe.Pointer(bp + 56)) != 0 { if v18 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v18 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v18 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { valuePtr = XTclThreadAllocObj(tls) } else { valuePtr = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valuePtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount = 0 if *(*TTcl_Size)(unsafe.Pointer(bp + 48)) == 0 { (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 48))+libc.Int64FromUint32(1))) if *(*uintptr)(unsafe.Pointer(bp + 40)) != 0 { v19 = *(*uintptr)(unsafe.Pointer(bp + 40)) } else { v19 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes, v19, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 48)))) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 48))))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength = *(*TTcl_Size)(unsafe.Pointer(bp + 48)) } (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = libc.UintptrFromInt32(0) } else { if v20 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v20 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v20 || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == libc.Uint64FromInt32(0) { valuePtr = XTclThreadAllocObj(tls) } else { valuePtr = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valuePtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(valuePtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_InvalidateStringRep(tls, valuePtr) dst1 = XTcl_InitStringRep(tls, valuePtr, libc.UintptrFromInt32(0), libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 48)))) if v22 = *(*TTcl_Size)(unsafe.Pointer(bp + 48)) != 0; v22 { if v21 = dst1 != 0; !v21 { XTcl_Panic(tls, __ccgo_ts+10479, libc.VaList(bp+88, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 48))))) } } _ = v22 && (v21 || libc.Bool(libc.Int32FromInt32(1) != 0)) /* Consider error */ XTcl_InitStringRep(tls, valuePtr, libc.UintptrFromInt32(0), libc.Uint64FromInt64(XTclCopyAndCollapse(tls, *(*TTcl_Size)(unsafe.Pointer(bp + 48)), *(*uintptr)(unsafe.Pointer(bp + 40)), dst1))) } /* Store key and value in the hash table we're building. */ hPtr = _CreateChainEntry(tls, dict, keyPtr, bp) if !(*(*int32)(unsafe.Pointer(bp)) != 0) { discardedValue1 = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData v24 = keyPtr v23 = *(*TTcl_Size)(unsafe.Pointer(v24)) *(*TTcl_Size)(unsafe.Pointer(v24))-- if !(v23 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keyPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(keyPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v25 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v25 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v25 || ((*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, keyPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = keyPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++ } } else { XTclFreeObj(tls, keyPtr) } } v27 = discardedValue1 v26 = *(*TTcl_Size)(unsafe.Pointer(v27)) *(*TTcl_Size)(unsafe.Pointer(v27))-- if !(v26 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(discardedValue1)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(discardedValue1)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(discardedValue1)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(discardedValue1)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(discardedValue1)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(discardedValue1)).Flength = int64(-libc.Int32FromInt32(1)) if v28 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v28 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v28 || ((*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, discardedValue1) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(discardedValue1 + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = discardedValue1 (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++ } } else { XTclFreeObj(tls, discardedValue1) } } } (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = valuePtr (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++ /* since hash now holds ref to it */ } } /* * Free the old internalRep before setting the new one. We do this as late * as possible to allow the conversion code, in particular * Tcl_GetStringFromObj, to use that old internalRep. */ (*TDict)(unsafe.Pointer(dict)).Fepoch = uint64(1) (*TDict)(unsafe.Pointer(dict)).Fchain = libc.UintptrFromInt32(0) (*TDict)(unsafe.Pointer(dict)).FrefCount = uint64(1) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp + 64))).Fptr1 = dict (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp + 64))).Fptr2 = libc.UintptrFromInt32(0) XTcl_StoreInternalRep(tls, objPtr, uintptr(unsafe.Pointer(&XtclDictType)), bp+64) return TCL_OK goto missingValue missingValue: ; if interp != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+26260, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+88, __ccgo_ts+2004, __ccgo_ts+2089, __ccgo_ts+26289, libc.UintptrFromInt32(0))) } goto errorInFindDictElement errorInFindDictElement: ; _DeleteChainTable(tls, dict) XTclpFree(tls, dict) return int32(TCL_ERROR) } func _GetDictFromObj(tls *libc.TLS, interp uintptr, dictPtr uintptr) (r uintptr) { var dict, irPtr, irPtr1, v1, v2, v3, v4 uintptr _, _, _, _, _, _, _ = dict, irPtr, irPtr1, v1, v2, v3, v4 if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = dictPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } dict = v2 if dict == libc.UintptrFromInt32(0) { if _SetDictFromAny(tls, interp, dictPtr) != TCL_OK { return libc.UintptrFromInt32(0) } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v3 = dictPtr + 32 } else { v3 = libc.UintptrFromInt32(0) } irPtr1 = v3 if irPtr1 != 0 { v4 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr1))).Fptr1 } else { v4 = libc.UintptrFromInt32(0) } dict = v4 } return dict } /* *---------------------------------------------------------------------- * * TclTraceDictPath -- * * Trace through a tree of dictionaries using the array of keys given. If * the flags argument has the DICT_PATH_UPDATE flag is set, a * backward-pointing chain of dictionaries is also built (in the Dict's * chain field) and the chained dictionaries are made into unshared * dictionaries (if they aren't already.) * * Results: * The object at the end of the path, or NULL if there was an error. Note * that this it is an error for an intermediate dictionary on the path to * not exist. If the flags argument has the DICT_PATH_EXISTS set, a * non-existent path gives a DICT_PATH_NON_EXISTENT result. * * Side effects: * If the flags argument is zero or DICT_PATH_EXISTS, there are no side * effects (other than potential conversion of objects to dictionaries.) * If the flags argument is DICT_PATH_UPDATE, the following additional * side effects occur. Shared dictionaries along the path are converted * into unshared objects, and a backward-pointing chain is built using * the chain fields of the dictionaries (for easy invalidation of string * representations using InvalidateDictChain). If the flags argument has * the DICT_PATH_CREATE bits set (and not the DICT_PATH_EXISTS bit), * non-extant keys will be inserted with a value of an empty * dictionary, resulting in the path being built. * *---------------------------------------------------------------------- */ func XTclTraceDictPath(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyc TTcl_Size, keyv uintptr, flags int32) (r uintptr) { bp := tls.Alloc(64) defer tls.Free(64) var cachePtr, dict, hPtr, irPtr, irPtr1, irPtr2, irPtr3, irPtr4, newDict, tmpObj, v1, v10, v11, v13, v15, v16, v2, v3, v4, v6, v7, v8, v9 uintptr var i, v12 TTcl_Size var v14 bool var _ /* isNew at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, dict, hPtr, i, irPtr, irPtr1, irPtr2, irPtr3, irPtr4, newDict, tmpObj, v1, v10, v11, v12, v13, v14, v15, v16, v2, v3, v4, v6, v7, v8, v9 if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = dictPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } dict = v2 if dict == libc.UintptrFromInt32(0) { if _SetDictFromAny(tls, interp, dictPtr) != TCL_OK { return libc.UintptrFromInt32(0) } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v3 = dictPtr + 32 } else { v3 = libc.UintptrFromInt32(0) } irPtr1 = v3 if irPtr1 != 0 { v4 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr1))).Fptr1 } else { v4 = libc.UintptrFromInt32(0) } dict = v4 } if flags&int32(DICT_PATH_UPDATE) != 0 { (*TDict)(unsafe.Pointer(dict)).Fchain = libc.UintptrFromInt32(0) } i = 0 for { if !(i < keyc) { break } hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(dict)).FfindProc})))(tls, dict, *(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8))) if hPtr == libc.UintptrFromInt32(0) { /* Dummy */ if flags&int32(DICT_PATH_EXISTS) != 0 { return libc.UintptrFromInt32(1) } if flags&int32(DICT_PATH_CREATE) != int32(DICT_PATH_CREATE) { if interp != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))).Fbytes != 0 { v6 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+26300, libc.VaList(bp+16, v6))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))).Fbytes != 0 { v7 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)))).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)), libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+26333, v7, libc.UintptrFromInt32(0))) } return libc.UintptrFromInt32(0) } /* * The next line should always set isNew to 1. */ hPtr = _CreateChainEntry(tls, dict, *(*uintptr)(unsafe.Pointer(keyv + uintptr(i)*8)), bp) tmpObj = XTcl_NewDictObj(tls) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++ (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = tmpObj } else { tmpObj = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v8 = tmpObj + 32 } else { v8 = libc.UintptrFromInt32(0) } irPtr2 = v8 if irPtr2 != 0 { v9 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr2))).Fptr1 } else { v9 = libc.UintptrFromInt32(0) } newDict = v9 if newDict == libc.UintptrFromInt32(0) { if _SetDictFromAny(tls, interp, tmpObj) != TCL_OK { return libc.UintptrFromInt32(0) } } } if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v10 = tmpObj + 32 } else { v10 = libc.UintptrFromInt32(0) } irPtr3 = v10 if irPtr3 != 0 { v11 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr3))).Fptr1 } else { v11 = libc.UintptrFromInt32(0) } newDict = v11 if flags&int32(DICT_PATH_UPDATE) != 0 { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount > int64(1) { v13 = tmpObj v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if !(v12 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(tmpObj)).Flength = int64(-libc.Int32FromInt32(1)) if v14 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v14 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v14 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, tmpObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(tmpObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = tmpObj (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, tmpObj) } } tmpObj = XTcl_DuplicateObj(tls, tmpObj) (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FrefCount++ (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = tmpObj (*TDict)(unsafe.Pointer(dict)).Fepoch++ if (*TTcl_Obj)(unsafe.Pointer(tmpObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v15 = tmpObj + 32 } else { v15 = libc.UintptrFromInt32(0) } irPtr4 = v15 if irPtr4 != 0 { v16 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr4))).Fptr1 } else { v16 = libc.UintptrFromInt32(0) } newDict = v16 } (*TDict)(unsafe.Pointer(newDict)).Fchain = dictPtr } dict = newDict dictPtr = tmpObj goto _5 _5: ; i++ } return dictPtr } /* *---------------------------------------------------------------------- * * InvalidateDictChain -- * * Go through a dictionary chain (built by an updating invocation of * TclTraceDictPath) and invalidate the string representations of all the * dictionaries on the chain. * * Results: * None * * Side effects: * String reps are invalidated and epoch counters (for detecting illegal * concurrent modifications) are updated through the chain of updated * dictionaries. * *---------------------------------------------------------------------- */ func _InvalidateDictChain(tls *libc.TLS, dictObj uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _isobjPtr, dict, irPtr, irPtr1, v1, v2, v3, v4 uintptr var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _, _, _, _, _, _ = _isobjPtr, dict, irPtr, irPtr1, v1, v2, v3, v4 if (*TTcl_Obj)(unsafe.Pointer(dictObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = dictObj + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } dict = v2 for cond := true; cond; cond = dict != libc.UintptrFromInt32(0) { (*TDict)(unsafe.Pointer(dict)).FrefCount++ _isobjPtr = dictObj if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } if (*TTcl_Obj)(unsafe.Pointer(dictObj)).FtypePtr != libc.UintptrFromInt32(0) { if (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictObj)).FtypePtr)).FfreeIntRepProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictObj)).FtypePtr)).FfreeIntRepProc})))(tls, dictObj) } (*TTcl_Obj)(unsafe.Pointer(dictObj)).FtypePtr = libc.UintptrFromInt32(0) } (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr1 = dict (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr2 = libc.UintptrFromInt32(0) XTcl_StoreInternalRep(tls, dictObj, uintptr(unsafe.Pointer(&XtclDictType)), bp) (*TDict)(unsafe.Pointer(dict)).Fepoch++ dictObj = (*TDict)(unsafe.Pointer(dict)).Fchain if dictObj == libc.UintptrFromInt32(0) { break } (*TDict)(unsafe.Pointer(dict)).Fchain = libc.UintptrFromInt32(0) if (*TTcl_Obj)(unsafe.Pointer(dictObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v3 = dictObj + 32 } else { v3 = libc.UintptrFromInt32(0) } irPtr1 = v3 if irPtr1 != 0 { v4 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr1))).Fptr1 } else { v4 = libc.UintptrFromInt32(0) } dict = v4 } } /* *---------------------------------------------------------------------- * * Tcl_DictObjPut -- * * Add a key,value pair to a dictionary, or update the value for a key if * that key already has a mapping in the dictionary. * * Results: * A standard Tcl result. * * Side effects: * The object pointed to by dictPtr is converted to a dictionary if it is * not already one, and any string representation that it has is * invalidated. * *---------------------------------------------------------------------- */ func XTcl_DictObjPut(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyPtr uintptr, valuePtr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var _isobjPtr, cachePtr, dict, hPtr, oldValuePtr, v2 uintptr var v1 TTcl_Size var v3 bool var _ /* ir at bp+8 */ TTcl_ObjInternalRep var _ /* isNew at bp+0 */ int32 _, _, _, _, _, _, _, _ = _isobjPtr, cachePtr, dict, hPtr, oldValuePtr, v1, v2, v3 if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { XTcl_Panic(tls, __ccgo_ts+10229, libc.VaList(bp+32, __ccgo_ts+26338)) } dict = _GetDictFromObj(tls, interp, dictPtr) if dict == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } _isobjPtr = dictPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } hPtr = _CreateChainEntry(tls, dict, keyPtr, bp) (*TDict)(unsafe.Pointer(dict)).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != libc.UintptrFromInt32(0) { if (*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc})))(tls, dictPtr) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = libc.UintptrFromInt32(0) } (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp + 8))).Fptr1 = dict (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp + 8))).Fptr2 = libc.UintptrFromInt32(0) XTcl_StoreInternalRep(tls, dictPtr, uintptr(unsafe.Pointer(&XtclDictType)), bp+8) (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++ if !(*(*int32)(unsafe.Pointer(bp)) != 0) { oldValuePtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData v2 = oldValuePtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, oldValuePtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldValuePtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldValuePtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, oldValuePtr) } } } (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = valuePtr (*TDict)(unsafe.Pointer(dict)).Fepoch++ return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_DictObjGet -- * * Given a key, get its value from the dictionary (or NULL if key is not * found in dictionary.) * * Results: * A standard Tcl result. The variable pointed to by valuePtrPtr is * updated with the value for the key. Note that it is not an error for * the key to have no mapping in the dictionary. * * Side effects: * The object pointed to by dictPtr is converted to a dictionary if it is * not already one. * *---------------------------------------------------------------------- */ func XTcl_DictObjGet(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyPtr uintptr, valuePtrPtr uintptr) (r int32) { var dict, hPtr uintptr _, _ = dict, hPtr dict = _GetDictFromObj(tls, interp, dictPtr) if dict == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(valuePtrPtr)) = libc.UintptrFromInt32(0) return int32(TCL_ERROR) } hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(dict)).FfindProc})))(tls, dict, keyPtr) if hPtr == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(valuePtrPtr)) = libc.UintptrFromInt32(0) } else { *(*uintptr)(unsafe.Pointer(valuePtrPtr)) = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_DictObjRemove -- * * Remove the key,value pair with the given key from the dictionary; the * key does not need to be present in the dictionary. * * Results: * A standard Tcl result. * * Side effects: * The object pointed to by dictPtr is converted to a dictionary if it is * not already one, and any string representation that it has is * invalidated. * *---------------------------------------------------------------------- */ func XTcl_DictObjRemove(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _isobjPtr, dict uintptr _, _ = _isobjPtr, dict if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { XTcl_Panic(tls, __ccgo_ts+10229, libc.VaList(bp+8, __ccgo_ts+26353)) } dict = _GetDictFromObj(tls, interp, dictPtr) if dict == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if _DeleteChainEntry(tls, dict, keyPtr) != 0 { _isobjPtr = dictPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } (*TDict)(unsafe.Pointer(dict)).Fepoch++ } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_DictGetSize * * Returns the size of dictPtr. Caller must ensure that dictPtr has type * 'tclDicttype'. * * *---------------------------------------------------------------------- */ func XTclDictGetSize(tls *libc.TLS, dictPtr uintptr) (r TTcl_Size) { var dict, irPtr, v1, v2 uintptr _, _, _, _ = dict, irPtr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = dictPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } dict = v2 return (*TDict)(unsafe.Pointer(dict)).Ftable.FnumEntries } /* *---------------------------------------------------------------------- * * Tcl_DictObjSize -- * * How many key,value pairs are there in the dictionary? * * Results: * A standard Tcl result. Updates the variable pointed to by sizePtr with * the number of key,value pairs in the dictionary. * * Side effects: * The dictPtr object is converted to a dictionary type if it is not a * dictionary already. * *---------------------------------------------------------------------- */ func XTcl_DictObjSize(tls *libc.TLS, interp uintptr, dictPtr uintptr, sizePtr uintptr) (r int32) { var dict uintptr _ = dict dict = _GetDictFromObj(tls, interp, dictPtr) if dict == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*TTcl_Size)(unsafe.Pointer(sizePtr)) = (*TDict)(unsafe.Pointer(dict)).Ftable.FnumEntries return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_DictObjFirst -- * * Start a traversal of the dictionary. Caller must supply the search * context, pointers for returning key and value, and a pointer to allow * indication of whether the dictionary has been traversed (i.e. the * dictionary is empty). The order of traversal is undefined. * * Results: * A standard Tcl result. Updates the variables pointed to by keyPtrPtr, * valuePtrPtr and donePtr. Either of keyPtrPtr and valuePtrPtr may be * NULL, in which case the key/value is not made available to the caller. * * Side effects: * The dictPtr object is converted to a dictionary type if it is not a * dictionary already. The search context is initialised if the search * has not finished. The dictionary's internal rep is Tcl_Preserve()d if * the dictionary has at least one element. * *---------------------------------------------------------------------- */ func XTcl_DictObjFirst(tls *libc.TLS, interp uintptr, dictPtr uintptr, searchPtr uintptr, keyPtrPtr uintptr, valuePtrPtr uintptr, donePtr uintptr) (r int32) { /* Pointer to a variable which will have a 1 * written into when there are no further * values in the dictionary, or a 0 * otherwise. */ var cPtr, dict, v1 uintptr _, _, _ = cPtr, dict, v1 dict = _GetDictFromObj(tls, interp, dictPtr) if dict == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } cPtr = (*TDict)(unsafe.Pointer(dict)).FentryChainHead if cPtr == libc.UintptrFromInt32(0) { (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch = uint64(0) *(*int32)(unsafe.Pointer(donePtr)) = int32(1) } else { *(*int32)(unsafe.Pointer(donePtr)) = 0 (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr = dict (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch = (*TDict)(unsafe.Pointer(dict)).Fepoch (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).Fnext = (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr (*TDict)(unsafe.Pointer(dict)).FrefCount++ if keyPtrPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer(dict)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(dict)).FkeyType == -int32(1) { v1 = *(*uintptr)(unsafe.Pointer(cPtr + 32)) } else { v1 = cPtr + 32 } *(*uintptr)(unsafe.Pointer(keyPtrPtr)) = v1 } if valuePtrPtr != libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(valuePtrPtr)) = (*TTcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData } } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_DictObjNext -- * * Continue a traversal of a dictionary previously started with * Tcl_DictObjFirst. This function is safe against concurrent * modification of the underlying object (including type shimmering), * treating such situations as if the search has terminated, though it is * up to the caller to ensure that the object itself is not disposed * until the search has finished. It is _not_ safe against modifications * from other threads. * * Results: * Updates the variables pointed to by keyPtrPtr, valuePtrPtr and * donePtr. Either of keyPtrPtr and valuePtrPtr may be NULL, in which * case the key/value is not made available to the caller. * * Side effects: * Removes a reference to the dictionary's internal rep if the search * terminates. * *---------------------------------------------------------------------- */ func XTcl_DictObjNext(tls *libc.TLS, searchPtr uintptr, keyPtrPtr uintptr, valuePtrPtr uintptr, donePtr uintptr) { /* Pointer to a variable which will have a 1 * written into when there are no further * values in the dictionary, or a 0 * otherwise. */ var cPtr, v1 uintptr _, _ = cPtr, v1 /* * If the search is done; we do no work. */ if !((*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch != 0) { *(*int32)(unsafe.Pointer(donePtr)) = int32(1) return } /* * Bail out if the dictionary has had any elements added, modified or * removed. This *shouldn't* happen, but... */ if (*TDict)(unsafe.Pointer((*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr)).Fepoch != (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch { XTcl_Panic(tls, __ccgo_ts+26371, 0) } cPtr = (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).Fnext if cPtr == libc.UintptrFromInt32(0) { XTcl_DictObjDone(tls, searchPtr) *(*int32)(unsafe.Pointer(donePtr)) = int32(1) return } (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).Fnext = (*TChainEntry)(unsafe.Pointer(cPtr)).FnextPtr *(*int32)(unsafe.Pointer(donePtr)) = 0 if keyPtrPtr != libc.UintptrFromInt32(0) { if (*TTcl_HashTable)(unsafe.Pointer((*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer((*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr)).FkeyType == -int32(1) { v1 = *(*uintptr)(unsafe.Pointer(cPtr + 32)) } else { v1 = cPtr + 32 } *(*uintptr)(unsafe.Pointer(keyPtrPtr)) = v1 } if valuePtrPtr != libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(valuePtrPtr)) = (*TTcl_HashEntry)(unsafe.Pointer(cPtr)).FclientData } } /* *---------------------------------------------------------------------- * * Tcl_DictObjDone -- * * Call this if you want to stop a search before you reach the end of the * dictionary (e.g. because of abnormal termination of the search). It * need not be used if the search reaches its natural end (i.e. if either * Tcl_DictObjFirst or Tcl_DictObjNext sets its donePtr variable to 1). * * Results: * None. * * Side effects: * Removes a reference to the dictionary's internal rep. * *---------------------------------------------------------------------- */ func XTcl_DictObjDone(tls *libc.TLS, searchPtr uintptr) { /* Pointer to a hash search context. */ var dict, v2 uintptr var v1 Tsize_t _, _, _ = dict, v1, v2 if (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch != 0 { (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).Fepoch = uint64(0) dict = (*TTcl_DictSearch)(unsafe.Pointer(searchPtr)).FdictionaryPtr v2 = dict + 128 v1 = *(*Tsize_t)(unsafe.Pointer(v2)) *(*Tsize_t)(unsafe.Pointer(v2))-- if v1 <= uint64(1) { _DeleteDict(tls, dict) } } } /* *---------------------------------------------------------------------- * * Tcl_DictObjPutKeyList -- * * Add a key...key,value pair to a dictionary tree. The main dictionary * value must not be shared, though sub-dictionaries may be. All * intermediate dictionaries on the path must exist. * * Results: * A standard Tcl result. Note that in the error case, a message is left * in interp unless that is NULL. * * Side effects: * If the dictionary and any of its sub-dictionaries on the path have * string representations, these are invalidated. * *---------------------------------------------------------------------- */ func XTcl_DictObjPutKeyList(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyc TTcl_Size, keyv uintptr, valuePtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var cachePtr, dict, hPtr, irPtr, oldValuePtr, v1, v2, v4 uintptr var v3 TTcl_Size var v5 bool var _ /* isNew at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = cachePtr, dict, hPtr, irPtr, oldValuePtr, v1, v2, v3, v4, v5 if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { XTcl_Panic(tls, __ccgo_ts+10229, libc.VaList(bp+16, __ccgo_ts+26417)) } if keyc < int64(1) { XTcl_Panic(tls, __ccgo_ts+26439, libc.VaList(bp+16, __ccgo_ts+26417)) } dictPtr = XTclTraceDictPath(tls, interp, dictPtr, keyc-int64(1), keyv, int32(DICT_PATH_CREATE)) if dictPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = dictPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } dict = v2 hPtr = _CreateChainEntry(tls, dict, *(*uintptr)(unsafe.Pointer(keyv + uintptr(keyc-int64(1))*8)), bp) (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++ if !(*(*int32)(unsafe.Pointer(bp)) != 0) { oldValuePtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData v4 = oldValuePtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if !(v3 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(oldValuePtr)).Flength = int64(-libc.Int32FromInt32(1)) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, oldValuePtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldValuePtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldValuePtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, oldValuePtr) } } } (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = valuePtr _InvalidateDictChain(tls, dictPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_DictObjRemoveKeyList -- * * Remove a key...key,value pair from a dictionary tree (the value * removed is implicit in the key path). The main dictionary value must * not be shared, though sub-dictionaries may be. It is not an error if * there is no value associated with the given key list, but all * intermediate dictionaries on the key path must exist. * * Results: * A standard Tcl result. Note that in the error case, a message is left * in interp unless that is NULL. * * Side effects: * If the dictionary and any of its sub-dictionaries on the key path have * string representations, these are invalidated. * *---------------------------------------------------------------------- */ func XTcl_DictObjRemoveKeyList(tls *libc.TLS, interp uintptr, dictPtr uintptr, keyc TTcl_Size, keyv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var dict, irPtr, v1, v2 uintptr _, _, _, _ = dict, irPtr, v1, v2 if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { XTcl_Panic(tls, __ccgo_ts+10229, libc.VaList(bp+8, __ccgo_ts+26469)) } if keyc < int64(1) { XTcl_Panic(tls, __ccgo_ts+26439, libc.VaList(bp+8, __ccgo_ts+26469)) } dictPtr = XTclTraceDictPath(tls, interp, dictPtr, keyc-int64(1), keyv, int32(DICT_PATH_UPDATE)) if dictPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = dictPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } dict = v2 _DeleteChainEntry(tls, dict, *(*uintptr)(unsafe.Pointer(keyv + uintptr(keyc-int64(1))*8))) _InvalidateDictChain(tls, dictPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_NewDictObj -- * * This function is normally called when not debugging: i.e., when * TCL_MEM_DEBUG is not defined. It creates a new dict object without any * content. * * When TCL_MEM_DEBUG is defined, this function just returns the result * of calling the debugging version Tcl_DbNewDictObj. * * Results: * A new dict object is returned; it has no keys defined in it. The new * object's string representation is left NULL, and the ref count of the * object is 0. * * Side Effects: * None. * *---------------------------------------------------------------------- */ func XTcl_NewDictObj(tls *libc.TLS) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _isobjPtr, cachePtr, dict, dictPtr uintptr var v1 bool var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _, _, _ = _isobjPtr, cachePtr, dict, dictPtr, v1 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { dictPtr = XTclThreadAllocObj(tls) } else { dictPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = libc.UintptrFromInt32(0) _isobjPtr = dictPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } dict = XTcl_Alloc(tls, uint64(144)) _InitChainTable(tls, dict) (*TDict)(unsafe.Pointer(dict)).Fepoch = uint64(1) (*TDict)(unsafe.Pointer(dict)).Fchain = libc.UintptrFromInt32(0) (*TDict)(unsafe.Pointer(dict)).FrefCount = uint64(1) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr1 = dict (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr2 = libc.UintptrFromInt32(0) XTcl_StoreInternalRep(tls, dictPtr, uintptr(unsafe.Pointer(&XtclDictType)), bp) return dictPtr } /* *---------------------------------------------------------------------- * * Tcl_DbNewDictObj -- * * This function is normally called when debugging: i.e., when * TCL_MEM_DEBUG is defined. It creates new dict objects. It is the same * as the Tcl_NewDictObj function above except that it calls * Tcl_DbCkalloc directly with the file name and line number from its * caller. This simplifies debugging since then the [memory active] * command will report the correct file name and line number when * reporting objects that haven't been freed. * * When TCL_MEM_DEBUG is not defined, this function just returns the * result of calling Tcl_NewDictObj. * * Results: * A new dict object is returned; it has no keys defined in it. The new * object's string representation is left NULL, and the ref count of the * object is 0. * * Side Effects: * None. * *---------------------------------------------------------------------- */ func XTcl_DbNewDictObj(tls *libc.TLS, dummy1484 uintptr, dummy1485 int32) (r uintptr) { return XTcl_NewDictObj(tls) } /***** START OF FUNCTIONS ACTING AS HELPERS *****/ // C documentation // // /* // *---------------------------------------------------------------------- // * // * TclDictGet -- // * // * Given a key, get its value from the dictionary (or NULL if key is not // * found in dictionary.) // * // * Results: // * A standard Tcl result. The variable pointed to by valuePtrPtr is // * updated with the value for the key. Note that it is not an error for // * the key to have no mapping in the dictionary. // * // * Side effects: // * The object pointed to by dictPtr is converted to a dictionary if it is // * not already one. // * // *---------------------------------------------------------------------- // */ func XTclDictGet(tls *libc.TLS, interp uintptr, dictPtr uintptr, key uintptr, valuePtrPtr uintptr) (r int32) { /* Where to write the value. */ var _objPtr, keyPtr, v2 uintptr var code int32 var v1 TTcl_Size _, _, _, _, _ = _objPtr, code, keyPtr, v1, v2 keyPtr = XTcl_NewStringObj(tls, key, int64(-int32(1))) (*TTcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++ code = XTcl_DictObjGet(tls, interp, dictPtr, keyPtr, valuePtrPtr) _objPtr = keyPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return code } // C documentation // // /* // *---------------------------------------------------------------------- // * // * TclDictPut -- // * // * Add a key,value pair to a dictionary, or update the value for a key if // * that key already has a mapping in the dictionary. // * // * If valuePtr is a zero-count object and is not written into the // * dictionary because of an error, it is freed by this routine. The caller // * does NOT need to do reference count management. // * // * Results: // * A standard Tcl result. // * // * Side effects: // * The object pointed to by dictPtr is converted to a dictionary if it is // * not already one, and any string representation that it has is // * invalidated. // * // *---------------------------------------------------------------------- // */ func XTclDictPut(tls *libc.TLS, interp uintptr, dictPtr uintptr, key uintptr, valuePtr uintptr) (r int32) { /* The value to write in. */ var _objPtr, _objPtr1, keyPtr, v2, v4 uintptr var code int32 var v1, v3 TTcl_Size _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, code, keyPtr, v1, v2, v3, v4 keyPtr = XTcl_NewStringObj(tls, key, int64(-int32(1))) (*TTcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++ (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++ code = XTcl_DictObjPut(tls, interp, dictPtr, keyPtr, valuePtr) _objPtr = keyPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = valuePtr v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return code } // C documentation // // /* // *---------------------------------------------------------------------- // * // * TclDictPutString -- // * // * Add a key,value pair to a dictionary, or update the value for a key if // * that key already has a mapping in the dictionary. // * // * Results: // * A standard Tcl result. // * // * Side effects: // * The object pointed to by dictPtr is converted to a dictionary if it is // * not already one, and any string representation that it has is // * invalidated. // * // *---------------------------------------------------------------------- // */ func XTclDictPutString(tls *libc.TLS, interp uintptr, dictPtr uintptr, key uintptr, value uintptr) (r int32) { /* The value in a C string. */ var _objPtr, _objPtr1, keyPtr, valuePtr, v2, v4 uintptr var code int32 var v1, v3 TTcl_Size _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, code, keyPtr, valuePtr, v1, v2, v3, v4 keyPtr = XTcl_NewStringObj(tls, key, int64(-int32(1))) valuePtr = XTcl_NewStringObj(tls, value, int64(-int32(1))) (*TTcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++ (*TTcl_Obj)(unsafe.Pointer(valuePtr)).FrefCount++ code = XTcl_DictObjPut(tls, interp, dictPtr, keyPtr, valuePtr) _objPtr = keyPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = valuePtr v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } return code } // C documentation // // /* // *---------------------------------------------------------------------- // * // * TclDictRemove -- // * // * Remove the key,value pair with the given key from the dictionary; the // * key does not need to be present in the dictionary. // * // * Results: // * A standard Tcl result. // * // * Side effects: // * The object pointed to by dictPtr is converted to a dictionary if it is // * not already one, and any string representation that it has is // * invalidated. // * // *---------------------------------------------------------------------- // */ func XTclDictRemove(tls *libc.TLS, interp uintptr, dictPtr uintptr, key uintptr) (r int32) { /* The key in a C string. */ var _objPtr, keyPtr, v2 uintptr var code int32 var v1 TTcl_Size _, _, _, _, _ = _objPtr, code, keyPtr, v1, v2 keyPtr = XTcl_NewStringObj(tls, key, int64(-int32(1))) (*TTcl_Obj)(unsafe.Pointer(keyPtr)).FrefCount++ code = XTcl_DictObjRemove(tls, interp, dictPtr, keyPtr) _objPtr = keyPtr v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } return code } /***** START OF FUNCTIONS IMPLEMENTING TCL COMMANDS *****/ /* *---------------------------------------------------------------------- * * DictCreateCmd -- * * This function implements the "dict create" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictCreateCmd(tls *libc.TLS, dummy1660 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var dictObj uintptr var i int32 _, _ = dictObj, i /* * Must have an even number of arguments; note that number of preceding * arguments (i.e. "dict create" is also even, which makes this much * easier.) */ if objc&int32(1) == 0 { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26494) return int32(TCL_ERROR) } dictObj = XTcl_NewDictObj(tls) i = int32(1) for { if !(i < objc) { break } /* * The next command is assumed to never fail... */ XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictObj, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8))) goto _1 _1: ; i += int32(2) } XTcl_SetObjResult(tls, interp, dictObj) return TCL_OK } /* *---------------------------------------------------------------------- * * DictGetCmd -- * * This function implements the "dict get" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictGetCmd(tls *libc.TLS, dummy1710 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) var dictPtr, listPtr, v1, v2 uintptr var result int32 var _ /* done at bp+40 */ int32 var _ /* keyPtr at bp+8 */ uintptr var _ /* search at bp+16 */ TTcl_DictSearch var _ /* valuePtr at bp+0 */ uintptr _, _, _, _, _ = dictPtr, listPtr, result, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26510) return int32(TCL_ERROR) } /* * Test for the special case of no keys, which returns a *list* of all * key,value pairs. We produce a copy here because that makes subsequent * list handling more efficient. */ if objc == int32(2) { *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0) result = XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16, bp+8, bp, bp+40) if result != TCL_OK { return result } listPtr = XTcl_NewListObj(tls, 0, libc.UintptrFromInt32(0)) for !(*(*int32)(unsafe.Pointer(bp + 40)) != 0) { /* * Assume these won't fail as we have complete control over the * types of things here. */ XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(bp + 8))) XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(bp))) XTcl_DictObjNext(tls, bp+16, bp+8, bp, bp+40) } XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } /* * Loop through the list of keys, looking up the key at the current index * in the current dictionary each time. Once we've done the lookup, we set * the current dictionary to be the value we looked up (in case the value * was not the last one and we are going through a chain of searches.) * Note that this loop always executes at least once. */ dictPtr = XTclTraceDictPath(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), int64(objc-int32(3)), objv+uintptr(2)*8, DICT_PATH_READ) if dictPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } result = XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), bp) if result != TCL_OK { return result } if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+26300, libc.VaList(bp+56, v1))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+26333, v2, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp))) return TCL_OK } /* *---------------------------------------------------------------------- * * DictGetDefCmd -- * * This function implements the "dict getdef" and "dict getwithdefault" * Tcl commands. See the user documentation for details on what it does, * and TIP#342 for the formal specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictGetDefCmd(tls *libc.TLS, dummy1803 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var defaultPtr, dictPtr, keyPath, keyPtr uintptr var numKeys int32 var _ /* valuePtr at bp+0 */ uintptr _, _, _, _, _ = defaultPtr, dictPtr, keyPath, keyPtr, numKeys if objc < int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26531) return int32(TCL_ERROR) } /* * Give the bits of arguments names for clarity. */ dictPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) keyPath = objv + 2*8 numKeys = objc - int32(4) /* Number of keys in keyPath; there's always * one extra key afterwards too. */ keyPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(2))*8)) defaultPtr = *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)) /* * Implement the getting-with-default operation. */ dictPtr = XTclTraceDictPath(tls, interp, dictPtr, int64(numKeys), keyPath, int32(DICT_PATH_EXISTS)) if dictPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } else { if dictPtr == libc.UintptrFromInt32(1) { XTcl_SetObjResult(tls, interp, defaultPtr) } else { if XTcl_DictObjGet(tls, interp, dictPtr, keyPtr, bp) != TCL_OK { return int32(TCL_ERROR) } else { if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, defaultPtr) } else { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp))) } } } } return TCL_OK } /* *---------------------------------------------------------------------- * * DictReplaceCmd -- * * This function implements the "dict replace" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictReplaceCmd(tls *libc.TLS, dummy1868 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var _isobjPtr, dictPtr uintptr var i int32 _, _, _ = _isobjPtr, dictPtr, i if objc < int32(2) || objc&int32(1) != 0 { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26564) return int32(TCL_ERROR) } dictPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if _GetDictFromObj(tls, interp, dictPtr) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { dictPtr = XTcl_DuplicateObj(tls, dictPtr) } _isobjPtr = dictPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } i = int32(2) for { if !(i < objc) { break } XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8))) goto _1 _1: ; i += int32(2) } XTcl_SetObjResult(tls, interp, dictPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * DictRemoveCmd -- * * This function implements the "dict remove" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictRemoveCmd(tls *libc.TLS, dummy1916 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var _isobjPtr, dictPtr uintptr var i int32 _, _, _ = _isobjPtr, dictPtr, i if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26510) return int32(TCL_ERROR) } dictPtr = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if _GetDictFromObj(tls, interp, dictPtr) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { dictPtr = XTcl_DuplicateObj(tls, dictPtr) } _isobjPtr = dictPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } i = int32(2) for { if !(i < objc) { break } XTcl_DictObjRemove(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) goto _1 _1: ; i++ } XTcl_SetObjResult(tls, interp, dictPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * DictMergeCmd -- * * This function implements the "dict merge" Tcl command. See the user * documentation for details on what it does, and TIP#163 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictMergeCmd(tls *libc.TLS, dummy1964 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var allocatedDict, i int32 var cachePtr, targetObj, v3 uintptr var v2 TTcl_Size var v4 bool var _ /* done at bp+16 */ int32 var _ /* keyObj at bp+0 */ uintptr var _ /* search at bp+24 */ TTcl_DictSearch var _ /* valueObj at bp+8 */ uintptr _, _, _, _, _, _, _ = allocatedDict, cachePtr, i, targetObj, v2, v3, v4 *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0) allocatedDict = 0 if objc == int32(1) { /* * No dictionary arguments; return default (empty value). */ return TCL_OK } /* * Make sure first argument is a dictionary. */ targetObj = *(*uintptr)(unsafe.Pointer(objv + 1*8)) if _GetDictFromObj(tls, interp, targetObj) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if objc == int32(2) { /* * Single argument, return it. */ XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) return TCL_OK } /* * Normal behaviour: combining two (or more) dictionaries. */ if (*TTcl_Obj)(unsafe.Pointer(targetObj)).FrefCount > int64(1) { targetObj = XTcl_DuplicateObj(tls, targetObj) allocatedDict = int32(1) } i = int32(2) for { if !(i < objc) { break } if XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp+24, bp, bp+8, bp+16) != TCL_OK { if allocatedDict != 0 { v3 = targetObj v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if !(v2 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(targetObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(targetObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(targetObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(targetObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(targetObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(targetObj)).Flength = int64(-libc.Int32FromInt32(1)) if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, targetObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(targetObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = targetObj (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, targetObj) } } } return int32(TCL_ERROR) } for !(*(*int32)(unsafe.Pointer(bp + 16)) != 0) { /* * Next line can't fail; already know we have a dictionary in * targetObj. */ XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), targetObj, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8))) XTcl_DictObjNext(tls, bp+24, bp, bp+8, bp+16) } XTcl_DictObjDone(tls, bp+24) goto _1 _1: ; i++ } XTcl_SetObjResult(tls, interp, targetObj) return TCL_OK } /* *---------------------------------------------------------------------- * * DictKeysCmd -- * * This function implements the "dict keys" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictKeysCmd(tls *libc.TLS, dummy2051 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var listPtr, pattern, v1, v3 uintptr var v4 bool var _ /* done at bp+40 */ int32 var _ /* keyPtr at bp+32 */ uintptr var _ /* search at bp+8 */ TTcl_DictSearch var _ /* valuePtr at bp+0 */ uintptr _, _, _, _, _ = listPtr, pattern, v1, v3, v4 pattern = libc.UintptrFromInt32(0) if objc != int32(2) && objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26591) return int32(TCL_ERROR) } /* * A direct check that we have a dictionary. We don't start the iteration * yet because that might allocate memory or set locks that we do not * need. [Bug 1705778, leak K04] */ if _GetDictFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if objc == int32(3) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), libc.UintptrFromInt32(0)) } pattern = v1 } listPtr = XTcl_NewListObj(tls, 0, libc.UintptrFromInt32(0)) if pattern != libc.UintptrFromInt32(0) && libc.Xstrpbrk(tls, pattern, __ccgo_ts+16411) == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) XTcl_DictObjGet(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8))) } } else { *(*uintptr)(unsafe.Pointer(bp + 32)) = libc.UintptrFromInt32(0) *(*int32)(unsafe.Pointer(bp + 40)) = 0 /* * At this point, we know we have a dictionary (or at least something * that can be represented; it could theoretically have shimmered away * when the pattern was fetched, but that shouldn't be damaging) so we * can start the iteration process without checking for failures. */ XTcl_DictObjFirst(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, bp+32, libc.UintptrFromInt32(0), bp+40) for { if !!(*(*int32)(unsafe.Pointer(bp + 40)) != 0) { break } if v4 = !(pattern != 0); !v4 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), libc.UintptrFromInt32(0)) } } if v4 || XTcl_StringCaseMatch(tls, v3, pattern, 0) != 0 { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), listPtr, *(*uintptr)(unsafe.Pointer(bp + 32))) } goto _2 _2: ; XTcl_DictObjNext(tls, bp+8, bp+32, libc.UintptrFromInt32(0), bp+40) } XTcl_DictObjDone(tls, bp+8) } XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * DictValuesCmd -- * * This function implements the "dict values" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictValuesCmd(tls *libc.TLS, dummy2130 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var listPtr, pattern, v1, v3 uintptr var v4 bool var _ /* done at bp+32 */ int32 var _ /* search at bp+8 */ TTcl_DictSearch var _ /* valuePtr at bp+0 */ uintptr _, _, _, _, _ = listPtr, pattern, v1, v3, v4 *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) if objc != int32(2) && objc != int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26591) return int32(TCL_ERROR) } if XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+8, libc.UintptrFromInt32(0), bp, bp+32) != TCL_OK { return int32(TCL_ERROR) } if objc == int32(3) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 2*8)))).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + 2*8)), libc.UintptrFromInt32(0)) } pattern = v1 } else { pattern = libc.UintptrFromInt32(0) } listPtr = XTcl_NewListObj(tls, 0, libc.UintptrFromInt32(0)) for { if !!(*(*int32)(unsafe.Pointer(bp + 32)) != 0) { break } if v4 = pattern == libc.UintptrFromInt32(0); !v4 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp)), libc.UintptrFromInt32(0)) } } if v4 || XTcl_StringCaseMatch(tls, v3, pattern, 0) != 0 { /* * Assume this operation always succeeds. */ XTcl_ListObjAppendElement(tls, interp, listPtr, *(*uintptr)(unsafe.Pointer(bp))) } goto _2 _2: ; XTcl_DictObjNext(tls, bp+8, libc.UintptrFromInt32(0), bp, bp+32) } XTcl_DictObjDone(tls, bp+8) XTcl_SetObjResult(tls, interp, listPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * DictSizeCmd -- * * This function implements the "dict size" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictSizeCmd(tls *libc.TLS, dummy2190 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var result int32 var _ /* size at bp+0 */ TTcl_Size _ = result if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26612) return int32(TCL_ERROR) } result = XTcl_DictObjSize(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) if result == TCL_OK { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, *(*TTcl_Size)(unsafe.Pointer(bp)))) } return result } /* *---------------------------------------------------------------------- * * TclDictObjSmartRef -- * * This function returns new tcl-object with the smart reference to * dictionary object. * * Object returned with this function is a smart reference (pointer), * so new object of type tclDictType, that directly references given * dictionary object (with internally increased refCount). * * The usage of such pointer objects allows to hold more as one * reference to the same real dictionary object, allows to make a pointer * to part of another dictionary, allows to change the dictionary without * regarding of the "shared" state of the dictionary object. * * Prevents "called with shared object" exception if object is multiple * referenced. * * Results: * The newly create object (contains smart reference) is returned. * The returned object has a ref count of 0. * * Side effects: * Increases ref count of the referenced dictionary. * *---------------------------------------------------------------------- */ func XTclDictObjSmartRef(tls *libc.TLS, interp uintptr, dictPtr uintptr) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var dict, irPtr, result, v1, v2 uintptr var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _, _, _ = dict, irPtr, result, v1, v2 if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType))) && _SetDictFromAny(tls, interp, dictPtr) != TCL_OK { return libc.UintptrFromInt32(0) } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclDictType)) { v1 = dictPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } dict = v2 result = XTcl_NewObj(tls) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr1 = dict (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr2 = libc.UintptrFromInt32(0) XTcl_StoreInternalRep(tls, result, uintptr(unsafe.Pointer(&XtclDictType)), bp) (*TDict)(unsafe.Pointer(dict)).FrefCount++ (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(result + 32))).Fptr2 = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(result)).FtypePtr = uintptr(unsafe.Pointer(&XtclDictType)) return result } /* *---------------------------------------------------------------------- * * DictExistsCmd -- * * This function implements the "dict exists" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictExistsCmd(tls *libc.TLS, dummy2283 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var dictPtr uintptr var _ /* valuePtr at bp+0 */ uintptr _ = dictPtr if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26623) return int32(TCL_ERROR) } dictPtr = XTclTraceDictPath(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), int64(objc-int32(3)), objv+uintptr(2)*8, int32(DICT_PATH_EXISTS)) if dictPtr == libc.UintptrFromInt32(0) || dictPtr == libc.UintptrFromInt32(1) || XTcl_DictObjGet(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), bp) != TCL_OK { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(0 != 0))) } else { XTcl_SetObjResult(tls, interp, XTcl_NewWideIntObj(tls, libc.BoolInt64(libc.BoolInt32(*(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0)) != 0))) } return TCL_OK } /* *---------------------------------------------------------------------- * * DictInfoCmd -- * * This function implements the "dict info" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictInfoCmd(tls *libc.TLS, dummy2325 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var dict, statsStr uintptr _, _ = dict, statsStr if objc != int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26612) return int32(TCL_ERROR) } dict = _GetDictFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8))) if dict == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } statsStr = XTcl_HashStats(tls, dict) XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, statsStr, int64(-int32(1)))) XTclpFree(tls, statsStr) return TCL_OK } /* *---------------------------------------------------------------------- * * DictIncrCmd -- * * This function implements the "dict incr" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictIncrCmd(tls *libc.TLS, dummy2369 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _isobjPtr, _isobjPtr1, cachePtr, cachePtr1, cachePtr2, cachePtr3, dictPtr, incrPtr, oldPtr, v4, v7 uintptr var code int32 var v1, v2, v5, v8 bool var v3, v6 TTcl_Size var _ /* increment at bp+8 */ Tmp_int var _ /* valuePtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _isobjPtr, _isobjPtr1, cachePtr, cachePtr1, cachePtr2, cachePtr3, code, dictPtr, incrPtr, oldPtr, v1, v2, v3, v4, v5, v6, v7, v8 code = TCL_OK *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) if objc < int32(3) || objc > int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26648) return int32(TCL_ERROR) } dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), 0) if dictPtr == libc.UintptrFromInt32(0) { /* * Variable didn't yet exist. Create new dictionary value. */ dictPtr = XTcl_NewDictObj(tls) } else { if XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) != TCL_OK { /* * Variable contents are not a dict, report error. */ return int32(TCL_ERROR) } } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { /* * A little internals surgery to avoid copying a string rep that will * soon be no good. */ oldPtr = dictPtr if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { dictPtr = XTclThreadAllocObj(tls) } else { dictPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr = libc.UintptrFromInt32(0) _isobjPtr = dictPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } _DupDictInternalRep(tls, oldPtr, dictPtr) } if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { /* * Key not in dictionary. Create new key with increment as value. */ if objc == int32(4) { code = XTcl_GetBignumFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 3*8)), bp+8) if code != TCL_OK { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+26676, int64(-int32(1)))) } else { /* * Remember to dispose with the bignum as we're not actually * using it directly. [Bug 2874678] */ XTclBN_mp_clear(tls, bp+8) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(objv + 3*8))) } } else { XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), XTcl_NewWideIntObj(tls, int64(1))) } } else { /* * Key in dictionary. Increment its value with minimum dup. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount > int64(1) { *(*uintptr)(unsafe.Pointer(bp)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp))) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(bp))) } if objc == int32(4) { code = XTclIncrObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(objv + 3*8))) } else { if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { incrPtr = XTclThreadAllocObj(tls) } else { incrPtr = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(incrPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes = libc.UintptrFromInt32(0) *(*TTcl_WideInt)(unsafe.Pointer(&(*TTcl_Obj)(unsafe.Pointer(incrPtr)).FinternalRep)) = int64(libc.Int32FromInt32(1)) (*TTcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr = uintptr(unsafe.Pointer(&XtclIntType)) (*TTcl_Obj)(unsafe.Pointer(incrPtr)).FrefCount++ code = XTclIncrObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), incrPtr) v4 = incrPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if !(v3 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(incrPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(incrPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(incrPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, incrPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(incrPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = incrPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, incrPtr) } } } } if code == TCL_OK { _isobjPtr1 = dictPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr1)).Fbytes = libc.UintptrFromInt32(0) } *(*uintptr)(unsafe.Pointer(bp)) = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), dictPtr, int32(TCL_LEAVE_ERR_MSG)) if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { code = int32(TCL_ERROR) } else { XTcl_SetObjResult(tls, interp, *(*uintptr)(unsafe.Pointer(bp))) } } else { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount == 0 { v7 = dictPtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if !(v6 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } } } return code } /* *---------------------------------------------------------------------- * * DictLappendCmd -- * * This function implements the "dict lappend" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictLappendCmd(tls *libc.TLS, dummy2490 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _isobjPtr, cachePtr, cachePtr1, cachePtr2, dictPtr, resultPtr, v2, v6, v9 uintptr var allocatedDict, allocatedValue, i int32 var v1, v5, v8 TTcl_Size var v10, v3, v7 bool var _ /* valuePtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _isobjPtr, allocatedDict, allocatedValue, cachePtr, cachePtr1, cachePtr2, dictPtr, i, resultPtr, v1, v10, v2, v3, v5, v6, v7, v8, v9 allocatedDict = 0 allocatedValue = 0 if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26701) return int32(TCL_ERROR) } dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), 0) if dictPtr == libc.UintptrFromInt32(0) { allocatedDict = int32(1) dictPtr = XTcl_NewDictObj(tls) } else { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { allocatedDict = int32(1) dictPtr = XTcl_DuplicateObj(tls, dictPtr) } } if XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) != TCL_OK { if allocatedDict != 0 { v2 = dictPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } } return int32(TCL_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = XTcl_NewListObj(tls, int64(objc-int32(3)), objv+uintptr(3)*8) allocatedValue = int32(1) } else { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount > int64(1) { allocatedValue = int32(1) *(*uintptr)(unsafe.Pointer(bp)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp))) } i = int32(3) for { if !(i < objc) { break } if XTcl_ListObjAppendElement(tls, interp, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) != TCL_OK { if allocatedValue != 0 { v6 = *(*uintptr)(unsafe.Pointer(bp)) v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if !(v5 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = int64(-libc.Int32FromInt32(1)) if v7 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v7 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v7 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp)) (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp))) } } } if allocatedDict != 0 { v9 = dictPtr v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if !(v8 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } } return int32(TCL_ERROR) } goto _4 _4: ; i++ } } if allocatedValue != 0 { XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(bp))) } else { _isobjPtr = dictPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } } resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), dictPtr, int32(TCL_LEAVE_ERR_MSG)) if resultPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, resultPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * DictAppendCmd -- * * This function implements the "dict append" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictAppendCmd(tls *libc.TLS, dummy2577 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, appendObjPtr, cachePtr, cachePtr1, dictPtr, resultPtr, v2, v6 uintptr var allocatedDict int32 var v1, v5 TTcl_Size var v3, v4 bool var _ /* valuePtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, allocatedDict, appendObjPtr, cachePtr, cachePtr1, dictPtr, resultPtr, v1, v2, v3, v4, v5, v6 allocatedDict = 0 if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26701) return int32(TCL_ERROR) } dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), 0) if dictPtr == libc.UintptrFromInt32(0) { allocatedDict = int32(1) dictPtr = XTcl_NewDictObj(tls) } else { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { allocatedDict = int32(1) dictPtr = XTcl_DuplicateObj(tls, dictPtr) } } if XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), bp) != TCL_OK { if allocatedDict != 0 { v2 = dictPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } } return int32(TCL_ERROR) } if objc > int32(3) || *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { /* Only go through append activites when something will change. */ appendObjPtr = libc.UintptrFromInt32(0) if objc > int32(3) { /* Something to append */ if objc == int32(4) { appendObjPtr = *(*uintptr)(unsafe.Pointer(objv + 3*8)) } else { appendObjPtr = XTclStringCat(tls, interp, int64(objc-int32(3)), objv+uintptr(3)*8, libc.Int32FromInt32(1)< (objc == 3) => (valuePtr == NULL) */ if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(bp)) = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr = libc.UintptrFromInt32(0) } else { if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer(bp)) = appendObjPtr appendObjPtr = libc.UintptrFromInt32(0) } } if appendObjPtr != 0 { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount > int64(1) { *(*uintptr)(unsafe.Pointer(bp)) = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp))) } (*TTcl_Obj)(unsafe.Pointer(appendObjPtr)).FrefCount++ XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(bp)), appendObjPtr) _objPtr = appendObjPtr v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } } XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(objv + 2*8)), *(*uintptr)(unsafe.Pointer(bp))) } /* * Even if nothing changed, we still overwrite so that variable * trace expectations are met. */ resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), dictPtr, int32(TCL_LEAVE_ERR_MSG)) if resultPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, resultPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * DictForNRCmd -- * * These functions implement the "dict for" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictForNRCmd(tls *libc.TLS, dummy2679 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) var _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, iPtr, keyVarObj, scriptObj, searchPtr, valueVarObj, v11, v15, v18, v21, v8 uintptr var v1 int32 var v10, v14, v17, v20, v7 TTcl_Size var v12, v13, v16, v19, v22, v9 bool var v2, v3, v5, v6 int64 var _ /* _callbackPtr at bp+40 */ uintptr var _ /* done at bp+32 */ int32 var _ /* keyObj at bp+8 */ uintptr var _ /* valueObj at bp+16 */ uintptr var _ /* varc at bp+24 */ TTcl_Size var _ /* varv at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, iPtr, keyVarObj, scriptObj, searchPtr, valueVarObj, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v5, v6, v7, v8, v9 iPtr = interp if objc != int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26729) return int32(TCL_ERROR) } /* * Parse arguments. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = v3 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+24, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 24)) != int64(2) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+26773, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, __ccgo_ts+2004, __ccgo_ts+26810, __ccgo_ts+19222, __ccgo_ts+5187, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } searchPtr = XTclStackAlloc(tls, interp, uint64(24)) if XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), searchPtr, bp+8, bp+16, bp+32) != TCL_OK { XTclStackFree(tls, interp, searchPtr) return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 32)) != 0 { XTclStackFree(tls, interp, searchPtr) return TCL_OK } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanStart } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1 + 40 + uintptr(v5)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v6 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v6 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = v6 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+24, bp) } keyVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) valueVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)) scriptObj = *(*uintptr)(unsafe.Pointer(objv + 3*8)) /* * Make sure that these objects (which we need throughout the body of the * loop) don't vanish. Note that the dictionary internal rep is locked * internally so that updates, shimmering, etc are not a problem. */ (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FrefCount++ (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FrefCount++ (*TTcl_Obj)(unsafe.Pointer(scriptObj)).FrefCount++ /* * Stop the value from getting hit in any way by any traces on the key * variable. */ (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++ if XTcl_ObjSetVar2(tls, interp, keyVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v8 = *(*uintptr)(unsafe.Pointer(bp + 16)) v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if !(v7 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int64(-libc.Int32FromInt32(1)) if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } } goto error } v11 = *(*uintptr)(unsafe.Pointer(bp + 16)) v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if !(v10 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int64(-libc.Int32FromInt32(1)) if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } } if XTcl_ObjSetVar2(tls, interp, valueVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 16)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { goto error } /* * Run the script. */ if v13 = interp == libc.UintptrFromInt32(0); !v13 { cachePtr2 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v13 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 40)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FprocPtr = __ccgo_fp(_DictForLoopCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 8)) = searchPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 8 + 1*8)) = keyVarObj *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 8 + 2*8)) = valueVarObj *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 8 + 3*8)) = scriptObj (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 40)) return XTclNREvalObjEx(tls, interp, scriptObj, 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, int32(3)) /* * For unwinding everything on error. */ goto error error: ; v15 = keyVarObj v14 = *(*TTcl_Size)(unsafe.Pointer(v15)) *(*TTcl_Size)(unsafe.Pointer(v15))-- if !(v14 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v16 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v16 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v16 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, keyVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = keyVarObj (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, keyVarObj) } } v18 = valueVarObj v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if !(v17 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || ((*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, valueVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valueVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = valueVarObj (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++ } } else { XTclFreeObj(tls, valueVarObj) } } v21 = scriptObj v20 = *(*TTcl_Size)(unsafe.Pointer(v21)) *(*TTcl_Size)(unsafe.Pointer(v21))-- if !(v20 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Flength = int64(-libc.Int32FromInt32(1)) if v22 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v22 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v22 || ((*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, scriptObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(scriptObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = scriptObj (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++ } } else { XTclFreeObj(tls, scriptObj) } } XTcl_DictObjDone(tls, searchPtr) XTclStackFree(tls, interp, searchPtr) return int32(TCL_ERROR) } func _DictForLoopCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, iPtr, keyVarObj, scriptObj, searchPtr, valueVarObj, v12, v15, v2, v5, v9 uintptr var v1, v11, v14, v4, v8 TTcl_Size var v10, v13, v16, v3, v6, v7 bool var _ /* _callbackPtr at bp+24 */ uintptr var _ /* done at bp+16 */ int32 var _ /* keyObj at bp+0 */ uintptr var _ /* valueObj at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, iPtr, keyVarObj, scriptObj, searchPtr, valueVarObj, v1, v10, v11, v12, v13, v14, v15, v16, v2, v3, v4, v5, v6, v7, v8, v9 iPtr = interp searchPtr = *(*uintptr)(unsafe.Pointer(data)) keyVarObj = *(*uintptr)(unsafe.Pointer(data + 1*8)) valueVarObj = *(*uintptr)(unsafe.Pointer(data + 2*8)) scriptObj = *(*uintptr)(unsafe.Pointer(data + 3*8)) /* * Process the result from the previous execution of the script body. */ if result == int32(TCL_CONTINUE) { result = TCL_OK } else { if result != TCL_OK { if result == int32(TCL_BREAK) { XTcl_ResetResult(tls, interp) result = TCL_OK } else { if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+26817, libc.VaList(bp+40, XTcl_GetErrorLine(tls, interp)))) } } goto done } } /* * Get the next mapping from the dictionary. */ XTcl_DictObjNext(tls, searchPtr, bp, bp+8, bp+16) if *(*int32)(unsafe.Pointer(bp + 16)) != 0 { XTcl_ResetResult(tls, interp) goto done } /* * Stop the value from getting hit in any way by any traces on the key * variable. */ (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++ if XTcl_ObjSetVar2(tls, interp, keyVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v2 = *(*uintptr)(unsafe.Pointer(bp + 8)) v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } } result = int32(TCL_ERROR) goto done } v5 = *(*uintptr)(unsafe.Pointer(bp + 8)) v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if !(v4 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = int64(-libc.Int32FromInt32(1)) if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } } if XTcl_ObjSetVar2(tls, interp, valueVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { result = int32(TCL_ERROR) goto done } /* * Run the script. */ if v7 = interp == libc.UintptrFromInt32(0); !v7 { cachePtr2 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v7 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 24)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FprocPtr = __ccgo_fp(_DictForLoopCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8)) = searchPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 1*8)) = keyVarObj *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 2*8)) = valueVarObj *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 3*8)) = scriptObj (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 24)) return XTclNREvalObjEx(tls, interp, scriptObj, 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, int32(3)) /* * For unwinding everything once the iterating is done. */ goto done done: ; v9 = keyVarObj v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if !(v8 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, keyVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = keyVarObj (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, keyVarObj) } } v12 = valueVarObj v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if !(v11 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v13 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v13 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v13 || ((*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, valueVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valueVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = valueVarObj (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++ } } else { XTclFreeObj(tls, valueVarObj) } } v15 = scriptObj v14 = *(*TTcl_Size)(unsafe.Pointer(v15)) *(*TTcl_Size)(unsafe.Pointer(v15))-- if !(v14 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Flength = int64(-libc.Int32FromInt32(1)) if v16 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v16 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v16 || ((*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, scriptObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(scriptObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = scriptObj (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++ } } else { XTclFreeObj(tls, scriptObj) } } XTcl_DictObjDone(tls, searchPtr) XTclStackFree(tls, interp, searchPtr) return result } /* *---------------------------------------------------------------------- * * DictMapNRCmd -- * * These functions implement the "dict map" Tcl command. See the user * documentation for details on what it does, and TIP#405 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictMapNRCmd(tls *libc.TLS, dummy2875 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) var _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, iPtr, storagePtr, v12, v15, v19, v22, v25, v28, v9 uintptr var v1 int32 var v10, v13, v16, v17, v20, v23, v26, v29, v4 bool var v11, v14, v18, v21, v24, v27, v8 TTcl_Size var v2, v3, v6, v7 int64 var _ /* _callbackPtr at bp+40 */ uintptr var _ /* done at bp+32 */ int32 var _ /* keyObj at bp+8 */ uintptr var _ /* valueObj at bp+16 */ uintptr var _ /* varc at bp+24 */ TTcl_Size var _ /* varv at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, iPtr, storagePtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v4, v6, v7, v8, v9 iPtr = interp if objc != int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26729) return int32(TCL_ERROR) } /* * Parse arguments. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = v3 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+24, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 24)) != int64(2) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+26773, int64(-int32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, __ccgo_ts+2004, __ccgo_ts+26810, __ccgo_ts+19222, __ccgo_ts+19715, libc.UintptrFromInt32(0))) return int32(TCL_ERROR) } storagePtr = XTclStackAlloc(tls, interp, uint64(56)) if XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), storagePtr+16, bp+8, bp+16, bp+32) != TCL_OK { XTclStackFree(tls, interp, storagePtr) return int32(TCL_ERROR) } if *(*int32)(unsafe.Pointer(bp + 32)) != 0 { /* * Note that this exit leaves an empty value in the result (due to * command calling conventions) but that is OK since an empty value is * an empty dictionary. */ XTclStackFree(tls, interp, storagePtr) return TCL_OK } if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj = XTclThreadAllocObj(tls) } else { (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr = libc.UintptrFromInt32(0) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v6 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanStart } else { v6 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1 + 40 + uintptr(v6)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v7 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v7 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = v7 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+24, bp) } (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1*8)) (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj = *(*uintptr)(unsafe.Pointer(objv + 3*8)) /* * Make sure that these objects (which we need throughout the body of the * loop) don't vanish. Note that the dictionary internal rep is locked * internally so that updates, shimmering, etc are not a problem. */ (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FrefCount++ (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FrefCount++ (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FrefCount++ (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FrefCount++ /* * Stop the value from getting hit in any way by any traces on the key * variable. */ (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++ if XTcl_ObjSetVar2(tls, interp, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v9 = *(*uintptr)(unsafe.Pointer(bp + 16)) v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if !(v8 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int64(-libc.Int32FromInt32(1)) if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } } goto error } if XTcl_ObjSetVar2(tls, interp, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 16)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v12 = *(*uintptr)(unsafe.Pointer(bp + 16)) v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if !(v11 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int64(-libc.Int32FromInt32(1)) if v13 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v13 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v13 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } } goto error } v15 = *(*uintptr)(unsafe.Pointer(bp + 16)) v14 = *(*TTcl_Size)(unsafe.Pointer(v15)) *(*TTcl_Size)(unsafe.Pointer(v15))-- if !(v14 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int64(-libc.Int32FromInt32(1)) if v16 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v16 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v16 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } } /* * Run the script. */ if v17 = interp == libc.UintptrFromInt32(0); !v17 { cachePtr4 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v17 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 40)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FprocPtr = __ccgo_fp(_DictMapLoopCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 8)) = storagePtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 40)) return XTclNREvalObjEx(tls, interp, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj, 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, int32(3)) /* * For unwinding everything on error. */ goto error error: ; v19 = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj v18 = *(*TTcl_Size)(unsafe.Pointer(v19)) *(*TTcl_Size)(unsafe.Pointer(v19))-- if !(v18 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v20 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v20 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v20 || ((*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++ } } else { XTclFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj) } } v22 = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj v21 = *(*TTcl_Size)(unsafe.Pointer(v22)) *(*TTcl_Size)(unsafe.Pointer(v22))-- if !(v21 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v23 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v23 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v23 || ((*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++ } } else { XTclFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj) } } v25 = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj v24 = *(*TTcl_Size)(unsafe.Pointer(v25)) *(*TTcl_Size)(unsafe.Pointer(v25))-- if !(v24 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Flength = int64(-libc.Int32FromInt32(1)) if v26 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v26 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v26 || ((*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++ } } else { XTclFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj) } } v28 = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj v27 = *(*TTcl_Size)(unsafe.Pointer(v28)) *(*TTcl_Size)(unsafe.Pointer(v28))-- if !(v27 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Flength = int64(-libc.Int32FromInt32(1)) if v29 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v29 { cachePtr8 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v29 || ((*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects++ } } else { XTclFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj) } } XTcl_DictObjDone(tls, storagePtr+16) XTclStackFree(tls, interp, storagePtr) return int32(TCL_ERROR) } func _DictMapLoopCallback(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, iPtr, storagePtr, v12, v15, v18, v2, v21, v5, v8 uintptr var v1, v11, v14, v17, v20, v4, v7 TTcl_Size var v10, v13, v16, v19, v22, v3, v6, v9 bool var _ /* _callbackPtr at bp+24 */ uintptr var _ /* done at bp+16 */ int32 var _ /* keyObj at bp+0 */ uintptr var _ /* valueObj at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, iPtr, storagePtr, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v3, v4, v5, v6, v7, v8, v9 iPtr = interp storagePtr = *(*uintptr)(unsafe.Pointer(data)) /* * Process the result from the previous execution of the script body. */ if result == int32(TCL_CONTINUE) { result = TCL_OK } else { if result != TCL_OK { if result == int32(TCL_BREAK) { XTcl_ResetResult(tls, interp) result = TCL_OK } else { if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+26848, libc.VaList(bp+40, XTcl_GetErrorLine(tls, interp)))) } } goto done } else { *(*uintptr)(unsafe.Pointer(bp)) = XTcl_ObjGetVar2(tls, interp, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj, libc.UintptrFromInt32(0), int32(TCL_LEAVE_ERR_MSG)) if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { result = int32(TCL_ERROR) goto done } XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj, *(*uintptr)(unsafe.Pointer(bp)), XTcl_GetObjResult(tls, interp)) } } /* * Get the next mapping from the dictionary. */ XTcl_DictObjNext(tls, storagePtr+16, bp, bp+8, bp+16) if *(*int32)(unsafe.Pointer(bp + 16)) != 0 { XTcl_SetObjResult(tls, interp, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj) goto done } /* * Stop the value from getting hit in any way by any traces on the key * variable. */ (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount++ if XTcl_ObjSetVar2(tls, interp, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v2 = *(*uintptr)(unsafe.Pointer(bp + 8)) v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } } result = int32(TCL_ERROR) goto done } if XTcl_ObjSetVar2(tls, interp, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 8)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v5 = *(*uintptr)(unsafe.Pointer(bp + 8)) v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if !(v4 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = int64(-libc.Int32FromInt32(1)) if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } } result = int32(TCL_ERROR) goto done } v8 = *(*uintptr)(unsafe.Pointer(bp + 8)) v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if !(v7 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = int64(-libc.Int32FromInt32(1)) if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } } /* * Run the script. */ if v10 = interp == libc.UintptrFromInt32(0); !v10 { cachePtr3 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v10 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 24)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FprocPtr = __ccgo_fp(_DictMapLoopCallback) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8)) = storagePtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 24)) return XTclNREvalObjEx(tls, interp, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj, 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, int32(3)) /* * For unwinding everything once the iterating is done. */ goto done done: ; v12 = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if !(v11 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v13 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v13 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v13 || ((*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++ } } else { XTclFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FkeyVarObj) } } v15 = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj v14 = *(*TTcl_Size)(unsafe.Pointer(v15)) *(*TTcl_Size)(unsafe.Pointer(v15))-- if !(v14 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v16 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v16 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v16 || ((*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++ } } else { XTclFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FvalueVarObj) } } v18 = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if !(v17 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj)).Flength = int64(-libc.Int32FromInt32(1)) if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || ((*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++ } } else { XTclFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FscriptObj) } } v21 = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj v20 = *(*TTcl_Size)(unsafe.Pointer(v21)) *(*TTcl_Size)(unsafe.Pointer(v21))-- if !(v20 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj)).Flength = int64(-libc.Int32FromInt32(1)) if v22 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v22 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v22 || ((*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++ } } else { XTclFreeObj(tls, (*TDictMapStorage)(unsafe.Pointer(storagePtr)).FaccumulatorObj) } } XTcl_DictObjDone(tls, storagePtr+16) XTclStackFree(tls, interp, storagePtr) return result } /* *---------------------------------------------------------------------- * * DictSetCmd -- * * This function implements the "dict set" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictSetCmd(tls *libc.TLS, dummy3088 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var allocatedDict, result int32 var cachePtr, dictPtr, resultPtr, v2 uintptr var v1 TTcl_Size var v3 bool _, _, _, _, _, _, _, _ = allocatedDict, cachePtr, dictPtr, result, resultPtr, v1, v2, v3 allocatedDict = 0 if objc < int32(4) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26879) return int32(TCL_ERROR) } dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), 0) if dictPtr == libc.UintptrFromInt32(0) { allocatedDict = int32(1) dictPtr = XTcl_NewDictObj(tls) } else { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { allocatedDict = int32(1) dictPtr = XTcl_DuplicateObj(tls, dictPtr) } } result = XTcl_DictObjPutKeyList(tls, interp, dictPtr, int64(objc-int32(3)), objv+uintptr(2)*8, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8))) if result != TCL_OK { if allocatedDict != 0 { v2 = dictPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } } return int32(TCL_ERROR) } resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), dictPtr, int32(TCL_LEAVE_ERR_MSG)) if resultPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, resultPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * DictUnsetCmd -- * * This function implements the "dict unset" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictUnsetCmd(tls *libc.TLS, dummy3148 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { var allocatedDict, result int32 var cachePtr, dictPtr, resultPtr, v2 uintptr var v1 TTcl_Size var v3 bool _, _, _, _, _, _, _, _ = allocatedDict, cachePtr, dictPtr, result, resultPtr, v1, v2, v3 allocatedDict = 0 if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26911) return int32(TCL_ERROR) } dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), 0) if dictPtr == libc.UintptrFromInt32(0) { allocatedDict = int32(1) dictPtr = XTcl_NewDictObj(tls) } else { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { allocatedDict = int32(1) dictPtr = XTcl_DuplicateObj(tls, dictPtr) } } result = XTcl_DictObjRemoveKeyList(tls, interp, dictPtr, int64(objc-int32(2)), objv+uintptr(2)*8) if result != TCL_OK { if allocatedDict != 0 { v2 = dictPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } } return int32(TCL_ERROR) } resultPtr = XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), dictPtr, int32(TCL_LEAVE_ERR_MSG)) if resultPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } XTcl_SetObjResult(tls, interp, resultPtr) return TCL_OK } /* *---------------------------------------------------------------------- * * DictFilterCmd -- * * This function implements the "dict filter" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictFilterCmd(tls *libc.TLS, dummy3207 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) var boolObj, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr13, cachePtr14, cachePtr15, cachePtr16, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, iPtr, keyVarObj, pattern, resultObj, scriptObj, valueVarObj, v11, v12, v17, v20, v23, v26, v29, v32, v35, v38, v41, v44, v47, v5, v50, v53, v56, v59, v6, v62, v65, v8, v9 uintptr var i, i1, result, v13 int32 var v14, v15 int64 var v16, v19, v22, v25, v28, v31, v34, v37, v40, v43, v46, v49, v52, v55, v58, v61, v64 TTcl_Size var v18, v21, v24, v27, v30, v33, v36, v39, v42, v45, v48, v51, v54, v57, v60, v63, v66 bool var _ /* done at bp+56 */ int32 var _ /* index at bp+0 */ int32 var _ /* keyObj at bp+16 */ uintptr var _ /* satisfied at bp+60 */ int32 var _ /* search at bp+32 */ TTcl_DictSearch var _ /* valueObj at bp+24 */ uintptr var _ /* varc at bp+64 */ TTcl_Size var _ /* varv at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = boolObj, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr12, cachePtr13, cachePtr14, cachePtr15, cachePtr16, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, i, i1, iPtr, keyVarObj, pattern, result, resultObj, scriptObj, valueVarObj, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v8, v9 iPtr = interp *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = libc.UintptrFromInt32(0) if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+26937) return int32(TCL_ERROR) } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 2*8)), uintptr(unsafe.Pointer(&_filters)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+26969, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v18 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v18 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v18 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, keyVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = keyVarObj (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, keyVarObj) } } v20 = valueVarObj v19 = *(*TTcl_Size)(unsafe.Pointer(v20)) *(*TTcl_Size)(unsafe.Pointer(v20))-- if !(v19 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v21 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v21 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v21 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, valueVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valueVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = valueVarObj (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, valueVarObj) } } v23 = scriptObj v22 = *(*TTcl_Size)(unsafe.Pointer(v23)) *(*TTcl_Size)(unsafe.Pointer(v23))-- if !(v22 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Flength = int64(-libc.Int32FromInt32(1)) if v24 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v24 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v24 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, scriptObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(scriptObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = scriptObj (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, scriptObj) } } return int32(TCL_ERROR) } resultObj = XTcl_NewDictObj(tls) for !(*(*int32)(unsafe.Pointer(bp + 56)) != 0) { /* * Stop the value from getting hit in any way by any traces on the * key variable. */ (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++ (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FrefCount++ if XTcl_ObjSetVar2(tls, interp, keyVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 16)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+27037, int64(-int32(1)))) result = int32(TCL_ERROR) goto abnormalResult } if XTcl_ObjSetVar2(tls, interp, valueVarObj, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 24)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+27085, int64(-int32(1)))) result = int32(TCL_ERROR) goto abnormalResult } /* * TIP #280. Make invoking context available to loop body. */ result = XTclEvalObjEx(tls, interp, scriptObj, 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, int32(4)) switch result { case TCL_OK: boolObj = XTcl_GetObjResult(tls, interp) (*TTcl_Obj)(unsafe.Pointer(boolObj)).FrefCount++ XTcl_ResetResult(tls, interp) if XTcl_GetBoolFromObj(tls, interp, boolObj, (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp+60) != TCL_OK { v26 = boolObj v25 = *(*TTcl_Size)(unsafe.Pointer(v26)) *(*TTcl_Size)(unsafe.Pointer(v26))-- if !(v25 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = int64(-libc.Int32FromInt32(1)) if v27 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v27 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v27 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, boolObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = boolObj (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, boolObj) } } result = int32(TCL_ERROR) goto abnormalResult } v29 = boolObj v28 = *(*TTcl_Size)(unsafe.Pointer(v29)) *(*TTcl_Size)(unsafe.Pointer(v29))-- if !(v28 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(boolObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(boolObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(boolObj)).Flength = int64(-libc.Int32FromInt32(1)) if v30 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v30 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v30 || ((*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, boolObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(boolObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = boolObj (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++ } } else { XTclFreeObj(tls, boolObj) } } if *(*int32)(unsafe.Pointer(bp + 60)) != 0 { XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), resultObj, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 24))) } case int32(TCL_BREAK): /* * Force loop termination by calling Tcl_DictObjDone; this * makes the next Tcl_DictObjNext say there is nothing more to * do. */ XTcl_ResetResult(tls, interp) XTcl_DictObjDone(tls, bp+32) /* FALLTHRU */ fallthrough case int32(TCL_CONTINUE): result = TCL_OK case int32(TCL_ERROR): XTcl_AppendObjToErrorInfo(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+27135, libc.VaList(bp+80, XTcl_GetErrorLine(tls, interp)))) fallthrough default: goto abnormalResult } v32 = *(*uintptr)(unsafe.Pointer(bp + 16)) v31 = *(*TTcl_Size)(unsafe.Pointer(v32)) *(*TTcl_Size)(unsafe.Pointer(v32))-- if !(v31 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int64(-libc.Int32FromInt32(1)) if v33 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v33 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v33 || ((*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } } v35 = *(*uintptr)(unsafe.Pointer(bp + 24)) v34 = *(*TTcl_Size)(unsafe.Pointer(v35)) *(*TTcl_Size)(unsafe.Pointer(v35))-- if !(v34 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Flength = int64(-libc.Int32FromInt32(1)) if v36 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v36 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v36 || ((*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 24)) (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) } } XTcl_DictObjNext(tls, bp+32, bp+16, bp+24, bp+56) } /* * Stop holding a reference to these objects. */ v38 = keyVarObj v37 = *(*TTcl_Size)(unsafe.Pointer(v38)) *(*TTcl_Size)(unsafe.Pointer(v38))-- if !(v37 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v39 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v39 { cachePtr7 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v39 || ((*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, keyVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr7)).FfirstObjPtr = keyVarObj (*TAllocCache)(unsafe.Pointer(cachePtr7)).FnumObjects++ } } else { XTclFreeObj(tls, keyVarObj) } } v41 = valueVarObj v40 = *(*TTcl_Size)(unsafe.Pointer(v41)) *(*TTcl_Size)(unsafe.Pointer(v41))-- if !(v40 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v42 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v42 { cachePtr8 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v42 || ((*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, valueVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valueVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr8)).FfirstObjPtr = valueVarObj (*TAllocCache)(unsafe.Pointer(cachePtr8)).FnumObjects++ } } else { XTclFreeObj(tls, valueVarObj) } } v44 = scriptObj v43 = *(*TTcl_Size)(unsafe.Pointer(v44)) *(*TTcl_Size)(unsafe.Pointer(v44))-- if !(v43 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Flength = int64(-libc.Int32FromInt32(1)) if v45 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v45 { cachePtr9 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v45 || ((*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, scriptObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(scriptObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr9)).FfirstObjPtr = scriptObj (*TAllocCache)(unsafe.Pointer(cachePtr9)).FnumObjects++ } } else { XTclFreeObj(tls, scriptObj) } } XTcl_DictObjDone(tls, bp+32) if result == TCL_OK { XTcl_SetObjResult(tls, interp, resultObj) } else { v47 = resultObj v46 = *(*TTcl_Size)(unsafe.Pointer(v47)) *(*TTcl_Size)(unsafe.Pointer(v47))-- if !(v46 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(resultObj)).Flength = int64(-libc.Int32FromInt32(1)) if v48 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v48 { cachePtr10 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v48 || ((*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, resultObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr10)).FfirstObjPtr = resultObj (*TAllocCache)(unsafe.Pointer(cachePtr10)).FnumObjects++ } } else { XTclFreeObj(tls, resultObj) } } } return result goto abnormalResult abnormalResult: ; XTcl_DictObjDone(tls, bp+32) v50 = *(*uintptr)(unsafe.Pointer(bp + 16)) v49 = *(*TTcl_Size)(unsafe.Pointer(v50)) *(*TTcl_Size)(unsafe.Pointer(v50))-- if !(v49 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int64(-libc.Int32FromInt32(1)) if v51 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v51 { cachePtr11 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v51 || ((*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr11)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) (*TAllocCache)(unsafe.Pointer(cachePtr11)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } } v53 = *(*uintptr)(unsafe.Pointer(bp + 24)) v52 = *(*TTcl_Size)(unsafe.Pointer(v53)) *(*TTcl_Size)(unsafe.Pointer(v53))-- if !(v52 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).Flength = int64(-libc.Int32FromInt32(1)) if v54 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v54 { cachePtr12 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v54 || ((*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr12)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 24)) (*TAllocCache)(unsafe.Pointer(cachePtr12)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) } } v56 = keyVarObj v55 = *(*TTcl_Size)(unsafe.Pointer(v56)) *(*TTcl_Size)(unsafe.Pointer(v56))-- if !(v55 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keyVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(keyVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v57 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v57 { cachePtr13 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v57 || ((*TAllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, keyVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keyVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr13)).FfirstObjPtr = keyVarObj (*TAllocCache)(unsafe.Pointer(cachePtr13)).FnumObjects++ } } else { XTclFreeObj(tls, keyVarObj) } } v59 = valueVarObj v58 = *(*TTcl_Size)(unsafe.Pointer(v59)) *(*TTcl_Size)(unsafe.Pointer(v59))-- if !(v58 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(valueVarObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(valueVarObj)).Flength = int64(-libc.Int32FromInt32(1)) if v60 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v60 { cachePtr14 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v60 || ((*TAllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, valueVarObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(valueVarObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr14)).FfirstObjPtr = valueVarObj (*TAllocCache)(unsafe.Pointer(cachePtr14)).FnumObjects++ } } else { XTclFreeObj(tls, valueVarObj) } } v62 = scriptObj v61 = *(*TTcl_Size)(unsafe.Pointer(v62)) *(*TTcl_Size)(unsafe.Pointer(v62))-- if !(v61 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(scriptObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(scriptObj)).Flength = int64(-libc.Int32FromInt32(1)) if v63 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v63 { cachePtr15 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v63 || ((*TAllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, scriptObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(scriptObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr15)).FfirstObjPtr = scriptObj (*TAllocCache)(unsafe.Pointer(cachePtr15)).FnumObjects++ } } else { XTclFreeObj(tls, scriptObj) } } v65 = resultObj v64 = *(*TTcl_Size)(unsafe.Pointer(v65)) *(*TTcl_Size)(unsafe.Pointer(v65))-- if !(v64 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(resultObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(resultObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(resultObj)).Flength = int64(-libc.Int32FromInt32(1)) if v66 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v66 { cachePtr16 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v66 || ((*TAllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, resultObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(resultObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr16)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr16)).FfirstObjPtr = resultObj (*TAllocCache)(unsafe.Pointer(cachePtr16)).FnumObjects++ } } else { XTclFreeObj(tls, resultObj) } } return result _4: ; XTcl_Panic(tls, __ccgo_ts+11006, 0) /* Control never reaches this point. */ return int32(TCL_ERROR) } var _filters = [4]uintptr{ 0: __ccgo_ts + 25055, 1: __ccgo_ts + 3702, 2: __ccgo_ts + 3605, 3: libc.UintptrFromInt32(0), } /* *---------------------------------------------------------------------- * * DictUpdateCmd -- * * This function implements the "dict update" Tcl command. See the user * documentation for details on what it does, and TIP#212 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictUpdateCmd(tls *libc.TLS, dummy3493 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, dictPtr, iPtr, v10, v3, v5, v7 uintptr var i int32 var v11, v12, v4, v8 bool var v2, v6, v9 TTcl_Size var _ /* _callbackPtr at bp+16 */ uintptr var _ /* dummy at bp+8 */ TTcl_Size var _ /* objPtr at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, dictPtr, i, iPtr, v10, v11, v12, v2, v3, v4, v5, v6, v7, v8, v9 iPtr = interp if objc < int32(5) || !(objc&libc.Int32FromInt32(1) != 0) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+27171) return int32(TCL_ERROR) } dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), int32(TCL_LEAVE_ERR_MSG)) if dictPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if XTcl_DictObjSize(tls, interp, dictPtr, bp+8) != TCL_OK { return int32(TCL_ERROR) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount++ i = int32(2) for { if !(i+int32(2) < objc) { break } if XTcl_DictObjGet(tls, interp, dictPtr, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8)), bp) != TCL_OK { v3 = dictPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if !(v2 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } return int32(TCL_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { /* ??? */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)))).Fbytes != 0 { v5 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)))).Fbytes } else { v5 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)), libc.UintptrFromInt32(0)) } XTcl_UnsetVar2(tls, interp, v5, libc.UintptrFromInt32(0), 0) } else { if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(i+int32(1))*8)), libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v7 = dictPtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if !(v6 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } return int32(TCL_ERROR) } } goto _1 _1: ; i += int32(2) } v10 = dictPtr v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if !(v9 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v11 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v11 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v11 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } /* * Execute the body after setting up the NRE handler to process the * results. */ *(*uintptr)(unsafe.Pointer(bp)) = XTcl_NewListObj(tls, int64(objc-int32(3)), objv+uintptr(2)*8) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount++ (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FrefCount++ if v12 = interp == libc.UintptrFromInt32(0); !v12 { cachePtr3 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v12 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 16)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FprocPtr = __ccgo_fp(_FinalizeDictUpdate) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8)) = *(*uintptr)(unsafe.Pointer(objv + 1*8)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 1*8)) = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, objc-int32(1)) } func _FinalizeDictUpdate(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var argsObj, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, dictPtr, objPtr, varName, v11, v18, v2, v21, v24, v5, v8 uintptr var i, v1, v10, v17, v20, v23, v4, v7 TTcl_Size var state TTcl_InterpState var v12, v19, v22, v25, v3, v6, v9 bool var v14, v15 int64 var _ /* objc at bp+8 */ TTcl_Size var _ /* objv at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = argsObj, cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, dictPtr, i, objPtr, state, varName, v1, v10, v11, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v3, v4, v5, v6, v7, v8, v9 varName = *(*uintptr)(unsafe.Pointer(data)) argsObj = *(*uintptr)(unsafe.Pointer(data + 1*8)) /* * ErrorInfo handling. */ if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+27220, int64(-int32(1)))) } /* * If the dictionary variable doesn't exist, drop everything silently. */ dictPtr = XTcl_ObjGetVar2(tls, interp, varName, libc.UintptrFromInt32(0), 0) if dictPtr == libc.UintptrFromInt32(0) { v2 = varName v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(varName)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, varName) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varName + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = varName (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, varName) } } v5 = argsObj v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if !(v4 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(argsObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(argsObj)).Flength = int64(-libc.Int32FromInt32(1)) if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, argsObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = argsObj (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, argsObj) } } return result } /* * Double-check that it is still a dictionary. */ state = XTcl_SaveInterpState(tls, interp, result) if XTcl_DictObjSize(tls, interp, dictPtr, bp+8) != TCL_OK { XTcl_DiscardInterpState(tls, state) v8 = varName v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if !(v7 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(varName)).Flength = int64(-libc.Int32FromInt32(1)) if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, varName) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varName + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = varName (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, varName) } } v11 = argsObj v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if !(v10 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(argsObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(argsObj)).Flength = int64(-libc.Int32FromInt32(1)) if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, argsObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = argsObj (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, argsObj) } } return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { dictPtr = XTcl_DuplicateObj(tls, dictPtr) } /* * Write back the values from the variables, treating failure to read as * an instruction to remove the key. */ if (*TTcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr2 != 0 { v14 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr2)).FspanStart } else { v14 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr1 + 40 + uintptr(v14)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr2 != 0 { v15 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr2)).FspanLength } else { v15 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v15 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), argsObj, bp+8, bp) } i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } objPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i+int64(1))*8)), libc.UintptrFromInt32(0), 0) if objPtr == libc.UintptrFromInt32(0) { XTcl_DictObjRemove(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i)*8))) } else { if objPtr == dictPtr { /* * Someone is messing us around, trying to build a recursive * structure. [Bug 1786481] */ XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i)*8)), XTcl_DuplicateObj(tls, objPtr)) } else { /* Shouldn't fail */ XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), dictPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i)*8)), objPtr) } } goto _16 _16: ; i += int64(2) } v18 = argsObj v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if !(v17 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(argsObj)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(argsObj)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(argsObj)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(argsObj)).Flength = int64(-libc.Int32FromInt32(1)) if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || ((*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, argsObj) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(argsObj + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = argsObj (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++ } } else { XTclFreeObj(tls, argsObj) } } /* * Write the dictionary back to its variable. */ if XTcl_ObjSetVar2(tls, interp, varName, libc.UintptrFromInt32(0), dictPtr, int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { XTcl_DiscardInterpState(tls, state) v21 = varName v20 = *(*TTcl_Size)(unsafe.Pointer(v21)) *(*TTcl_Size)(unsafe.Pointer(v21))-- if !(v20 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(varName)).Flength = int64(-libc.Int32FromInt32(1)) if v22 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v22 { cachePtr5 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v22 || ((*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, varName) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varName + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr5)).FfirstObjPtr = varName (*TAllocCache)(unsafe.Pointer(cachePtr5)).FnumObjects++ } } else { XTclFreeObj(tls, varName) } } return int32(TCL_ERROR) } v24 = varName v23 = *(*TTcl_Size)(unsafe.Pointer(v24)) *(*TTcl_Size)(unsafe.Pointer(v24))-- if !(v23 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(varName)).Flength = int64(-libc.Int32FromInt32(1)) if v25 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v25 { cachePtr6 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v25 || ((*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, varName) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varName + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr6)).FfirstObjPtr = varName (*TAllocCache)(unsafe.Pointer(cachePtr6)).FnumObjects++ } } else { XTclFreeObj(tls, varName) } } return XTcl_RestoreInterpState(tls, interp, state) } /* *---------------------------------------------------------------------- * * DictWithCmd -- * * This function implements the "dict with" Tcl command. See the user * documentation for details on what it does, and TIP#212 for the formal * specification. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ func _DictWithCmd(tls *libc.TLS, dummy3652 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, cachePtr, dictPtr, iPtr, keysPtr, pathPtr uintptr var v1 bool var _ /* _callbackPtr at bp+0 */ uintptr _, _, _, _, _, _, _ = _objPtr, cachePtr, dictPtr, iPtr, keysPtr, pathPtr, v1 iPtr = interp if objc < int32(3) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+27249) return int32(TCL_ERROR) } /* * Get the dictionary to open out. */ dictPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), libc.UintptrFromInt32(0), int32(TCL_LEAVE_ERR_MSG)) if dictPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } keysPtr = XTclDictWithInit(tls, interp, dictPtr, int64(objc-int32(3)), objv+uintptr(2)*8) if keysPtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } (*TTcl_Obj)(unsafe.Pointer(keysPtr)).FrefCount++ /* * Execute the body, while making the invoking context available to the * loop body (TIP#280) and postponing the cleanup until later (NRE). */ pathPtr = libc.UintptrFromInt32(0) if objc > int32(3) { pathPtr = XTcl_NewListObj(tls, int64(objc-int32(3)), objv+uintptr(2)*8) (*TTcl_Obj)(unsafe.Pointer(pathPtr)).FrefCount++ } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FrefCount++ if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_FinalizeDictWith) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = *(*uintptr)(unsafe.Pointer(objv + 1*8)) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = keysPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = pathPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) return XTclNREvalObjEx(tls, interp, *(*uintptr)(unsafe.Pointer(objv + uintptr(objc-int32(1))*8)), 0, (*TInterp)(unsafe.Pointer(iPtr)).FcmdFramePtr, objc-int32(1)) } func _FinalizeDictWith(tls *libc.TLS, data uintptr, interp uintptr, result int32) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var cachePtr, cachePtr1, cachePtr2, keysPtr, pathPtr, varName, varPtr, v11, v5, v8 uintptr var state TTcl_InterpState var v10, v4, v7 TTcl_Size var v12, v6, v9 bool var v2, v3 int64 var _ /* arrayPtr at bp+16 */ uintptr var _ /* pathc at bp+8 */ TTcl_Size var _ /* pathv at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, keysPtr, pathPtr, state, varName, varPtr, v10, v11, v12, v2, v3, v4, v5, v6, v7, v8, v9 varName = *(*uintptr)(unsafe.Pointer(data)) keysPtr = *(*uintptr)(unsafe.Pointer(data + 1*8)) pathPtr = *(*uintptr)(unsafe.Pointer(data + 2*8)) if result == int32(TCL_ERROR) { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+27278, int64(-int32(1)))) } /* * Save the result state; TDWF doesn't guarantee to not modify that on * TCL_OK result. */ state = XTcl_SaveInterpState(tls, interp, result) if pathPtr != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(pathPtr + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(pathPtr + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(pathPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(pathPtr + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(pathPtr + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(pathPtr + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(pathPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v3 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), pathPtr, bp+8, bp) } } else { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = 0 *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) } /* * Pack from local variables back into the dictionary. */ varPtr = XTclObjLookupVarEx(tls, interp, varName, libc.UintptrFromInt32(0), int32(TCL_LEAVE_ERR_MSG), __ccgo_ts+5383, int32(1), int32(1), bp+16) if varPtr == libc.UintptrFromInt32(0) { result = int32(TCL_ERROR) } else { result = XTclDictWithFinish(tls, interp, varPtr, *(*uintptr)(unsafe.Pointer(bp + 16)), varName, libc.UintptrFromInt32(0), -int32(1), int32(*(*TTcl_Size)(unsafe.Pointer(bp + 8))), *(*uintptr)(unsafe.Pointer(bp)), keysPtr) } /* * Tidy up and return the real result (unless we had an error). */ v5 = varName v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if !(v4 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(varName)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(varName)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(varName)).Flength = int64(-libc.Int32FromInt32(1)) if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, varName) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varName + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = varName (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, varName) } } v8 = keysPtr v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if !(v7 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v9 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v9 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v9 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, keysPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = keysPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, keysPtr) } } if pathPtr != libc.UintptrFromInt32(0) { v11 = pathPtr v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if !(v10 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(pathPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(pathPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v12 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v12 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v12 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, pathPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(pathPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = pathPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, pathPtr) } } } if result != TCL_OK { XTcl_DiscardInterpState(tls, state) return int32(TCL_ERROR) } return XTcl_RestoreInterpState(tls, interp, state) } /* *---------------------------------------------------------------------- * * TclDictWithInit -- * * Part of the core of [dict with]. Pokes into a dictionary and converts * the mappings there into assignments to (presumably) local variables. * Returns a list of all the names that were mapped so that removal of * either the variable or the dictionary entry won't surprise us when we * come to stuffing everything back. * * Result: * List of mapped names, or NULL if there was an error. * * Side effects: * Assigns to variables, so potentially legion due to traces. * *---------------------------------------------------------------------- */ func XTclDictWithInit(tls *libc.TLS, interp uintptr, dictPtr uintptr, pathc TTcl_Size, pathv uintptr) (r uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var cachePtr, cachePtr1, keysPtr, v4 uintptr var v1, v5 bool var v3 TTcl_Size var _ /* done at bp+40 */ int32 var _ /* keyPtr at bp+24 */ uintptr var _ /* s at bp+0 */ TTcl_DictSearch var _ /* valPtr at bp+32 */ uintptr _, _, _, _, _, _, _ = cachePtr, cachePtr1, keysPtr, v1, v3, v4, v5 if pathc > 0 { dictPtr = XTclTraceDictPath(tls, interp, dictPtr, pathc, pathv, DICT_PATH_READ) if dictPtr == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } } /* * Go over the list of keys and write each corresponding value to a * variable in the current context with the same name. Also keep a copy of * the keys so we can write back properly later on even if the dictionary * has been structurally modified. */ if XTcl_DictObjFirst(tls, interp, dictPtr, bp, bp+24, bp+32, bp+40) != TCL_OK { return libc.UintptrFromInt32(0) } if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { keysPtr = XTclThreadAllocObj(tls) } else { keysPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(keysPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr = libc.UintptrFromInt32(0) for { if !!(*(*int32)(unsafe.Pointer(bp + 40)) != 0) { break } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), keysPtr, *(*uintptr)(unsafe.Pointer(bp + 24))) if XTcl_ObjSetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 24)), libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 32)), int32(TCL_LEAVE_ERR_MSG)) == libc.UintptrFromInt32(0) { v4 = keysPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if !(v3 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(keysPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, keysPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = keysPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, keysPtr) } } XTcl_DictObjDone(tls, bp) return libc.UintptrFromInt32(0) } goto _2 _2: ; XTcl_DictObjNext(tls, bp, bp+24, bp+32, bp+40) } return keysPtr } /* *---------------------------------------------------------------------- * * TclDictWithFinish -- * * Part of the core of [dict with]. Reassembles the piece of the dict (in * varName, location given by pathc/pathv) from the variables named in * the keysPtr argument. NB, does not try to preserve errors or manage * argument lifetimes. * * Result: * TCL_OK if we succeeded, or TCL_ERROR if we failed. * * Side effects: * Assigns to a variable, so potentially legion due to traces. Updates * the dictionary in the named variable. * *---------------------------------------------------------------------- */ func XTclDictWithFinish(tls *libc.TLS, interp uintptr, varPtr uintptr, arrayPtr uintptr, part1Ptr uintptr, part2Ptr uintptr, index int32, pathc int32, pathv uintptr, keysPtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* List of keys to be synchronized. This is * the result value from TclDictWithInit. */ var allocdict, v1, v11, v4 TTcl_Size var cachePtr, cachePtr1, cachePtr2, dictPtr, leafPtr, valPtr, v12, v2, v5 uintptr var v13, v3, v6 bool var v8, v9 int64 var _ /* i at bp+0 */ TTcl_Size var _ /* keyc at bp+8 */ TTcl_Size var _ /* keyv at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = allocdict, cachePtr, cachePtr1, cachePtr2, dictPtr, leafPtr, valPtr, v1, v11, v12, v13, v2, v3, v4, v5, v6, v8, v9 /* * If the dictionary variable doesn't exist, drop everything silently. */ dictPtr = XTclPtrGetVarIdx(tls, interp, varPtr, arrayPtr, part1Ptr, part2Ptr, int32(TCL_LEAVE_ERR_MSG), index) if dictPtr == libc.UintptrFromInt32(0) { return TCL_OK } /* * Double-check that it is still a dictionary. */ if XTcl_DictObjSize(tls, interp, dictPtr, bp) != TCL_OK { return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).FrefCount > int64(1) { dictPtr = XTcl_DuplicateObj(tls, dictPtr) allocdict = int64(1) } else { allocdict = 0 } if pathc > 0 { /* * Want to get to the dictionary which we will update; need to do * prepare-for-update unsharing along the path *but* avoid generating * an error on a non-extant path (we'll treat that the same as a * non-extant variable. Luckily, the unsharing operation isn't * deeply damaging if we don't go on to update; it's just less than * perfectly efficient (but no memory should be leaked). */ leafPtr = XTclTraceDictPath(tls, interp, dictPtr, int64(pathc), pathv, libc.Int32FromInt32(DICT_PATH_EXISTS)|libc.Int32FromInt32(DICT_PATH_UPDATE)) if leafPtr == libc.UintptrFromInt32(0) { if allocdict != 0 { v2 = dictPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if !(v1 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } } return int32(TCL_ERROR) } if leafPtr == libc.UintptrFromInt32(1) { if allocdict != 0 { v5 = dictPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if !(v4 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v6 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v6 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v6 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } } return TCL_OK } } else { leafPtr = dictPtr } /* * Now process our updates on the leaf dictionary. */ if (*TTcl_Obj)(unsafe.Pointer(keysPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr2 != 0 { v8 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr2)).FspanStart } else { v8 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr1 + 40 + uintptr(v8)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr2 != 0 { v9 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr2)).FspanLength } else { v9 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(keysPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v9 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), keysPtr, bp+8, bp+16) } *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 for { if !(*(*TTcl_Size)(unsafe.Pointer(bp)) < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } valPtr = XTcl_ObjGetVar2(tls, interp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*8)), libc.UintptrFromInt32(0), 0) if valPtr == libc.UintptrFromInt32(0) { XTcl_DictObjRemove(tls, libc.UintptrFromInt32(0), leafPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*8))) } else { if leafPtr == valPtr { /* * Someone is messing us around, trying to build a recursive * structure. [Bug 1786481] */ XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), leafPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*8)), XTcl_DuplicateObj(tls, valPtr)) } else { XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), leafPtr, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*8)), valPtr) } } goto _10 _10: ; *(*TTcl_Size)(unsafe.Pointer(bp))++ } /* * Ensure that none of the dictionaries in the chain still have a string * rep. */ if pathc > 0 { _InvalidateDictChain(tls, leafPtr) } /* * Write back the outermost dictionary to the variable. */ if XTclPtrSetVarIdx(tls, interp, varPtr, arrayPtr, part1Ptr, part2Ptr, dictPtr, int32(TCL_LEAVE_ERR_MSG), index) == libc.UintptrFromInt32(0) { if allocdict != 0 { v12 = dictPtr v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if !(v11 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(dictPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(dictPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v13 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v13 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v13 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, dictPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(dictPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = dictPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, dictPtr) } } } return int32(TCL_ERROR) } return TCL_OK } /* *---------------------------------------------------------------------- * * TclInitDictCmd -- * * This function is create the "dict" Tcl command. See the user * documentation for details on what it does, and TIP#111 for the formal * specification. * * Results: * A Tcl command handle. * * Side effects: * May advance compilation epoch. * *---------------------------------------------------------------------- */ func XTclInitDictCmd(tls *libc.TLS, interp uintptr) (r TTcl_Command) { return XTclMakeEnsemble(tls, interp, __ccgo_ts+19222, uintptr(unsafe.Pointer(&_implementationMap))) } type TChainEntry1 = struct { Fentry TTcl_HashEntry FprevPtr uintptr FnextPtr uintptr } /* * The structure below defines an instruction name Tcl object to allow * reporting of inner contexts in errorstack without string allocation. */ var _instNameType = TTcl_ObjType{ Fname: __ccgo_ts + 27305, } func init() { p := unsafe.Pointer(&_instNameType) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_UpdateStringOfInstName) } /* *---------------------------------------------------------------------- * * GetLocationInformation -- * * This procedure looks up the information about where a procedure was * originally declared. * * Results: * Writes to the variables pointed at by fileObjPtr and linePtr. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _GetLocationInformation(tls *libc.TLS, procPtr uintptr, fileObjPtr uintptr, linePtr uintptr) { /* Where to write the information about what * line number represented the start of the * code in question. Will be written to, * either with the line number or with -1 if * the information is not available. */ var cfPtr uintptr _ = cfPtr cfPtr = XTclGetCmdFrameForProcedure(tls, procPtr) *(*uintptr)(unsafe.Pointer(fileObjPtr)) = libc.UintptrFromInt32(0) *(*int32)(unsafe.Pointer(linePtr)) = -int32(1) if cfPtr == libc.UintptrFromInt32(0) { return } /* * Get the source location data out of the CmdFrame. */ *(*int32)(unsafe.Pointer(linePtr)) = int32(*(*TTcl_Size)(unsafe.Pointer((*TCmdFrame)(unsafe.Pointer(cfPtr)).Fline))) if (*TCmdFrame)(unsafe.Pointer(cfPtr)).Ftype1 == int32(TCL_LOCATION_SOURCE) { *(*uintptr)(unsafe.Pointer(fileObjPtr)) = (*TCmdFrame)(unsafe.Pointer(cfPtr)).Fdata.Feval.Fpath } } /* *---------------------------------------------------------------------- * * DisassembleByteCodeObj -- * * Given an object which is of bytecode type, return a disassembled * version of the bytecode (in a new refcount 0 object). No guarantees * are made about the details of the contents of the result. * *---------------------------------------------------------------------- */ func _DisassembleByteCodeObj(tls *libc.TLS, objPtr uintptr) (r uintptr) { bp := tls.Alloc(80) defer tls.Free(80) /* The bytecode object to disassemble. */ var bufferObj, cachePtr, codeDeltaNext, codeLengthNext, codeLimit, codePtr, codeStart, iPtr, irPtr, localPtr, pc, procPtr, rangePtr, srcDeltaNext, srcLengthNext, v1, v10, v11, v12, v14, v17, v2, v5, v7, v8, v9 uintptr var codeLen, codeOffset, delta, numCmds, srcLen, srcOffset, v15, v18, v20 int32 var i, numCompiledLocals TTcl_Size var v3 bool var v4 int64 var _ /* fileObj at bp+8 */ uintptr var _ /* line at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bufferObj, cachePtr, codeDeltaNext, codeLen, codeLengthNext, codeLimit, codeOffset, codePtr, codeStart, delta, i, iPtr, irPtr, localPtr, numCmds, numCompiledLocals, pc, procPtr, rangePtr, srcDeltaNext, srcLen, srcLengthNext, srcOffset, v1, v10, v11, v12, v14, v15, v17, v18, v2, v20, v3, v4, v5, v7, v8, v9 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteCodeType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } codePtr = v2 iPtr = *(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FinterpHandle)) if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { bufferObj = XTclThreadAllocObj(tls) } else { bufferObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bufferObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(bufferObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(bufferObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(bufferObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(bufferObj)).FtypePtr = libc.UintptrFromInt32(0) if !((*TByteCode)(unsafe.Pointer(codePtr)).FrefCount != 0) { return bufferObj /* Already freed. */ } codeStart = (*TByteCode)(unsafe.Pointer(codePtr)).FcodeStart codeLimit = codeStart + uintptr((*TByteCode)(unsafe.Pointer(codePtr)).FnumCodeBytes) numCmds = int32((*TByteCode)(unsafe.Pointer(codePtr)).FnumCommands) /* * Print header lines describing the ByteCode. */ XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27314, libc.VaList(bp+24, codePtr, (*TByteCode)(unsafe.Pointer(codePtr)).FrefCount, (*TByteCode)(unsafe.Pointer(codePtr)).FcompileEpoch, iPtr, (*TInterp)(unsafe.Pointer(iPtr)).FcompileEpoch)) XTcl_AppendToObj(tls, bufferObj, __ccgo_ts+27372, int64(-int32(1))) if libc.Uint64FromInt64((*TByteCode)(unsafe.Pointer(codePtr)).FnumSrcBytes)+uint64(1) < libc.Uint64FromInt32(55)+libc.Uint64FromInt32(1) { v4 = (*TByteCode)(unsafe.Pointer(codePtr)).FnumSrcBytes } else { v4 = int64(libc.Int32FromInt32(55)) } _PrintSourceToObj(tls, bufferObj, (*TByteCode)(unsafe.Pointer(codePtr)).Fsource, v4) _GetLocationInformation(tls, (*TByteCode)(unsafe.Pointer(codePtr)).FprocPtr, bp+8, bp) if *(*int32)(unsafe.Pointer(bp)) >= 0 && *(*uintptr)(unsafe.Pointer(bp + 8)) != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 { v5 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes } else { v5 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), libc.UintptrFromInt32(0)) } XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27382, libc.VaList(bp+24, v5, *(*int32)(unsafe.Pointer(bp)))) } XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27403, libc.VaList(bp+24, numCmds, (*TByteCode)(unsafe.Pointer(codePtr)).FnumSrcBytes, (*TByteCode)(unsafe.Pointer(codePtr)).FnumCodeBytes, (*TByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects, (*TByteCode)(unsafe.Pointer(codePtr)).FnumAuxDataItems, (*TByteCode)(unsafe.Pointer(codePtr)).FmaxStackDepth, float64(0))) /* * If the ByteCode is the compiled body of a Tcl procedure, print * information about that procedure. Note that we don't know the * procedure's name since ByteCode's can be shared among procedures. */ if (*TByteCode)(unsafe.Pointer(codePtr)).FprocPtr != libc.UintptrFromInt32(0) { procPtr = (*TByteCode)(unsafe.Pointer(codePtr)).FprocPtr numCompiledLocals = (*TProc)(unsafe.Pointer(procPtr)).FnumCompiledLocals XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27485, libc.VaList(bp+24, procPtr, (*TProc)(unsafe.Pointer(procPtr)).FrefCount, (*TProc)(unsafe.Pointer(procPtr)).FnumArgs, numCompiledLocals)) if numCompiledLocals > 0 { localPtr = (*TProc)(unsafe.Pointer(procPtr)).FfirstLocalPtr i = 0 for { if !(i < numCompiledLocals) { break } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&(libc.Int32FromInt32(VAR_ARRAY)|libc.Int32FromInt32(VAR_LINK)) != 0 { v7 = __ccgo_ts + 1945 } else { v7 = __ccgo_ts + 27538 } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_ARRAY) != 0 { v8 = __ccgo_ts + 27547 } else { v8 = __ccgo_ts + 1945 } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_LINK) != 0 { v9 = __ccgo_ts + 27555 } else { v9 = __ccgo_ts + 1945 } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_ARGUMENT) != 0 { v10 = __ccgo_ts + 27562 } else { v10 = __ccgo_ts + 1945 } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_TEMPORARY) != 0 { v11 = __ccgo_ts + 27568 } else { v11 = __ccgo_ts + 1945 } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_RESOLVED) != 0 { v12 = __ccgo_ts + 27575 } else { v12 = __ccgo_ts + 1945 } XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27586, libc.VaList(bp+24, i, v7, v8, v9, v10, v11, v12)) if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_TEMPORARY) != 0 { XTcl_AppendToObj(tls, bufferObj, __ccgo_ts+286, int64(-int32(1))) } else { XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27613, libc.VaList(bp+24, localPtr+44)) } localPtr = (*TCompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr goto _6 _6: ; i++ } } } /* * Print the ExceptionRange array. */ if int32((*TByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges) > 0 { XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27621, libc.VaList(bp+24, (*TByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges, (*TByteCode)(unsafe.Pointer(codePtr)).FmaxExceptDepth)) i = 0 for { if !(i < int64(int32((*TByteCode)(unsafe.Pointer(codePtr)).FnumExceptRanges))) { break } rangePtr = (*TByteCode)(unsafe.Pointer(codePtr)).FexceptArrayPtr + uintptr(i)*56 if (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 == int32(LOOP_EXCEPTION_RANGE) { v14 = __ccgo_ts + 21703 } else { v14 = __ccgo_ts + 5129 } XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27657, libc.VaList(bp+24, i, (*TExceptionRange)(unsafe.Pointer(rangePtr)).FnestingLevel, v14, (*TExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset, (*TExceptionRange)(unsafe.Pointer(rangePtr)).FcodeOffset+(*TExceptionRange)(unsafe.Pointer(rangePtr)).FnumCodeBytes-int64(1))) switch (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1 { case int32(LOOP_EXCEPTION_RANGE): XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27696, libc.VaList(bp+24, (*TExceptionRange)(unsafe.Pointer(rangePtr)).FcontinueOffset, (*TExceptionRange)(unsafe.Pointer(rangePtr)).FbreakOffset)) case int32(CATCH_EXCEPTION_RANGE): XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27721, libc.VaList(bp+24, (*TExceptionRange)(unsafe.Pointer(rangePtr)).FcatchOffset)) default: XTcl_Panic(tls, __ccgo_ts+27732, libc.VaList(bp+24, (*TExceptionRange)(unsafe.Pointer(rangePtr)).Ftype1)) } goto _13 _13: ; i++ } } /* * If there were no commands (e.g., an expression or an empty string was * compiled), just print all instructions and return. */ if numCmds == 0 { pc = codeStart for pc < codeLimit { XTcl_AppendToObj(tls, bufferObj, __ccgo_ts+27783, int64(-int32(1))) pc += uintptr(_FormatInstruction(tls, codePtr, pc, bufferObj)) } return bufferObj } /* * Print table showing the code offset, source offset, and source length * for each command. These are encoded as a sequence of bytes. */ XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27788, libc.VaList(bp+24, numCmds)) codeDeltaNext = (*TByteCode)(unsafe.Pointer(codePtr)).FcodeDeltaStart codeLengthNext = (*TByteCode)(unsafe.Pointer(codePtr)).FcodeLengthStart srcDeltaNext = (*TByteCode)(unsafe.Pointer(codePtr)).FsrcDeltaStart srcLengthNext = (*TByteCode)(unsafe.Pointer(codePtr)).FsrcLengthStart v15 = libc.Int32FromInt32(0) srcOffset = v15 codeOffset = v15 i = 0 for { if !(i < int64(numCmds)) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(codeDeltaNext))) == int32(0xFF) { codeDeltaNext++ delta = libc.Int32FromUint32(uint32(*(*uint8)(unsafe.Pointer(codeDeltaNext)))< 0 { XTcl_AppendToObj(tls, bufferObj, __ccgo_ts+286, int64(-int32(1))) } /* * Print each instruction. If the instruction corresponds to the start of * a command, print the command's source. Note that we don't need the code * length here. */ codeDeltaNext = (*TByteCode)(unsafe.Pointer(codePtr)).FcodeDeltaStart srcDeltaNext = (*TByteCode)(unsafe.Pointer(codePtr)).FsrcDeltaStart srcLengthNext = (*TByteCode)(unsafe.Pointer(codePtr)).FsrcLengthStart v18 = libc.Int32FromInt32(0) srcOffset = v18 codeOffset = v18 pc = codeStart i = 0 for { if !(i < int64(numCmds)) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(codeDeltaNext))) == int32(0xFF) { codeDeltaNext++ delta = libc.Int32FromUint32(uint32(*(*uint8)(unsafe.Pointer(codeDeltaNext)))<= -int32(1) { XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27921, libc.VaList(bp+144, opnd)) } else { if opnd == -int32(2) { XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27925, 0) } else { XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+27930, libc.VaList(bp+144, -int32(2)-opnd)) } } goto _19 _14: ; opnd = libc.Int32FromUint32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))) numBytes++ goto printLVTindex _15: ; opnd = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))<= localCt { XTcl_Panic(tls, __ccgo_ts+27938, libc.VaList(bp+144, opnd, localCt)) } j = 0 for { if !(j < opnd) { break } localPtr = (*TCompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr goto _20 _20: ; j++ } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_TEMPORARY) != 0 { libc.X__builtin_snprintf(tls, bp, uint64(128), __ccgo_ts+27993, libc.VaList(bp+144, opnd)) } else { libc.X__builtin_snprintf(tls, bp, uint64(128), __ccgo_ts+28005, 0) suffixSrc = localPtr + 44 } } XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+28010, libc.VaList(bp+144, opnd)) goto _19 _16: ; opnd = libc.Int32FromUint32(uint32(*(*uint8)(unsafe.Pointer(pc + uintptr(numBytes))))) numBytes++ XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+28017, libc.VaList(bp+144, uintptr(unsafe.Pointer(&XtclStringClassTable))+uintptr(opnd)*16)) goto _19 _18: ; _17: ; goto _19 _19: ; goto _3 _3: ; i++ } if suffixObj != 0 { XTcl_AppendToObj(tls, bufferObj, __ccgo_ts+28021, int64(-int32(1))) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(opnd)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 128)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(opnd)*8)))).Flength v21 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(opnd)*8)))).Fbytes } else { v21 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(opnd)*8)), bp+128) } bytes = v21 if libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 128)))+uint64(1) < libc.Uint64FromInt32(40)+libc.Uint64FromInt32(1) { v22 = *(*TTcl_Size)(unsafe.Pointer(bp + 128)) } else { v22 = int64(libc.Int32FromInt32(40)) } _PrintSourceToObj(tls, bufferObj, bytes, v22) } else { if (*(*[128]uint8)(unsafe.Pointer(bp)))[0] != 0 { XTcl_AppendPrintfToObj(tls, bufferObj, __ccgo_ts+28025, libc.VaList(bp+144, bp)) if suffixSrc != 0 { _PrintSourceToObj(tls, bufferObj, suffixSrc, int64(40)) } } } XTcl_AppendToObj(tls, bufferObj, __ccgo_ts+286, int64(-int32(1))) if auxPtr != 0 && (*TAuxDataType)(unsafe.Pointer((*TAuxData)(unsafe.Pointer(auxPtr)).Ftype1)).FprintProc != 0 { XTcl_AppendToObj(tls, bufferObj, __ccgo_ts+28031, int64(-int32(1))) (*(*func(*libc.TLS, uintptr, uintptr, uintptr, Tsize_t))(unsafe.Pointer(&struct{ uintptr }{(*TAuxDataType)(unsafe.Pointer((*TAuxData)(unsafe.Pointer(auxPtr)).Ftype1)).FprintProc})))(tls, (*TAuxData)(unsafe.Pointer(auxPtr)).FclientData, bufferObj, codePtr, uint64(pcOffset)) XTcl_AppendToObj(tls, bufferObj, __ccgo_ts+28035, int64(-int32(1))) } return numBytes } /* *---------------------------------------------------------------------- * * TclGetInnerContext -- * * If possible, returns a list capturing the inner context. Otherwise * return NULL. * *---------------------------------------------------------------------- */ func XTclGetInnerContext(tls *libc.TLS, interp uintptr, pc uintptr, tosPtr uintptr) (r uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var _objPtr, iPtr, objPtr, result, v2, v3 uintptr var objc, v1 TTcl_Size var v5 int64 var _ /* len at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _, _ = _objPtr, iPtr, objPtr, objc, result, v1, v2, v3, v5 objc = 0 iPtr = interp switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(pc))) { case int32(INST_STR_LEN): fallthrough case int32(INST_LNOT): fallthrough case int32(INST_BITNOT): fallthrough case int32(INST_UMINUS): fallthrough case int32(INST_UPLUS): fallthrough case int32(INST_TRY_CVT_TO_NUMERIC): fallthrough case int32(INST_EXPAND_STKTOP): fallthrough case int32(INST_EXPR_STK): objc = int64(1) case int32(INST_LIST_IN): fallthrough case int32(INST_LIST_NOT_IN): /* Basic list containment operators. */ fallthrough case int32(INST_STR_EQ): fallthrough case int32(INST_STR_NEQ): /* String (in)equality check */ fallthrough case int32(INST_STR_CMP): /* String compare. */ fallthrough case int32(INST_STR_INDEX): fallthrough case int32(INST_STR_MATCH): fallthrough case int32(INST_REGEXP): fallthrough case int32(INST_EQ): fallthrough case int32(INST_NEQ): fallthrough case int32(INST_LT): fallthrough case int32(INST_GT): fallthrough case int32(INST_LE): fallthrough case int32(INST_GE): fallthrough case int32(INST_MOD): fallthrough case int32(INST_LSHIFT): fallthrough case int32(INST_RSHIFT): fallthrough case int32(INST_BITOR): fallthrough case int32(INST_BITXOR): fallthrough case int32(INST_BITAND): fallthrough case int32(INST_EXPON): fallthrough case int32(INST_ADD): fallthrough case int32(INST_SUB): fallthrough case int32(INST_DIV): fallthrough case int32(INST_MULT): objc = int64(2) case int32(INST_RETURN_STK): /* early pop. TODO: dig out opt dict too :/ */ objc = int64(1) case int32(INST_SYNTAX): fallthrough case int32(INST_RETURN_IMM): objc = int64(2) case int32(INST_INVOKE_STK4): objc = libc.Int64FromUint32(libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(pc + libc.UintptrFromInt32(1))))< int64(1) { _objPtr = result v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } v3 = XTcl_NewListObj(tls, objc+int64(1), libc.UintptrFromInt32(0)) result = v3 (*TInterp)(unsafe.Pointer(iPtr)).FinnerContext = v3 (*TTcl_Obj)(unsafe.Pointer(result)).FrefCount++ } else { /* * Reset while keeping the list internalrep as much as possible. */ if (*TTcl_Obj)(unsafe.Pointer(result)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(result + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(result + 32))).Fptr2)).FspanLength } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(result + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v5 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjLength(tls, interp, result, bp) } XTcl_ListObjReplace(tls, interp, result, 0, *(*TTcl_Size)(unsafe.Pointer(bp)), 0, libc.UintptrFromInt32(0)) } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), result, XTclNewInstNameObj(tls, *(*uint8)(unsafe.Pointer(pc)))) for { if !(objc > 0) { break } objPtr = *(*uintptr)(unsafe.Pointer(tosPtr + uintptr(int64(1)-objc)*8)) if !(objPtr != 0) { XTcl_Panic(tls, __ccgo_ts+28038, 0) } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount <= 0 { XTcl_Panic(tls, __ccgo_ts+28085, libc.VaList(bp+16, objPtr)) } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), result, objPtr) goto _6 _6: ; objc-- } return result } /* *---------------------------------------------------------------------- * * TclNewInstNameObj -- * * Creates a new InstName Tcl_Obj based on the given instruction * *---------------------------------------------------------------------- */ func XTclNewInstNameObj(tls *libc.TLS, inst uint8) (r uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _isobjPtr, cachePtr, objPtr uintptr var v1 bool var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _, _ = _isobjPtr, cachePtr, objPtr, v1 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) _isobjPtr = objPtr if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(_isobjPtr)).Fbytes = libc.UintptrFromInt32(0) } *(*TTcl_WideInt)(unsafe.Pointer(&*(*TTcl_ObjInternalRep)(unsafe.Pointer(bp)))) = libc.Int64FromUint8(inst) XTcl_StoreInternalRep(tls, objPtr, uintptr(unsafe.Pointer(&_instNameType)), bp) return objPtr } /* *---------------------------------------------------------------------- * * UpdateStringOfInstName -- * * Update the string representation for an instruction name object. * *---------------------------------------------------------------------- */ func _UpdateStringOfInstName(tls *libc.TLS, objPtr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var dst, irPtr, s, v1 uintptr var inst, len1 Tsize_t var v2, v3, v4, v5 bool _, _, _, _, _, _, _, _, _, _ = dst, inst, irPtr, len1, s, v1, v2, v3, v4, v5 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_instNameType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 inst = libc.Uint64FromInt64(*(*TTcl_WideInt)(unsafe.Pointer(irPtr))) if inst >= uint64(LAST_INST_OPCODE) { dst = XTcl_InitStringRep(tls, objPtr, libc.UintptrFromInt32(0), libc.Uint64FromInt32(libc.Int32FromInt32(3)*libc.Int32FromInt64(8)+libc.Int32FromInt32(5))) if v3 = libc.Bool(libc.Int32FromInt32(3)*libc.Int32FromInt64(8)+libc.Int32FromInt32(5) != 0); v3 { if v2 = dst != 0; !v2 { XTcl_Panic(tls, __ccgo_ts+10479, libc.VaList(bp+8, libc.Uint64FromInt32(libc.Int32FromInt32(3)*libc.Int32FromInt64(8)+libc.Int32FromInt32(5)))) } } _ = v3 && (v2 || libc.Bool(libc.Int32FromInt32(1) != 0)) libc.X__builtin_snprintf(tls, dst, libc.Uint64FromInt32(libc.Int32FromInt32(3)*libc.Int32FromInt64(8)+libc.Int32FromInt32(5)), __ccgo_ts+28136, libc.VaList(bp+8, inst)) XTcl_InitStringRep(tls, objPtr, libc.UintptrFromInt32(0), libc.Xstrlen(tls, dst)) } else { s = XtclInstructionTable[inst].Fname len1 = libc.Xstrlen(tls, s) dst = XTcl_InitStringRep(tls, objPtr, s, len1) if v5 = len1 != 0; v5 { if v4 = dst != 0; !v4 { XTcl_Panic(tls, __ccgo_ts+10479, libc.VaList(bp+8, len1)) } } _ = v5 && (v4 || libc.Bool(libc.Int32FromInt32(1) != 0)) } } /* *---------------------------------------------------------------------- * * PrintSourceToObj -- * * Appends a quoted representation of a string to a Tcl_Obj. * *---------------------------------------------------------------------- */ func _PrintSourceToObj(tls *libc.TLS, appendObj uintptr, stringPtr uintptr, maxChars TTcl_Size) { bp := tls.Alloc(32) defer tls.Free(32) /* Maximum number of chars to print. */ var i, len1 TTcl_Size var p uintptr var v2 int64 var _ /* ucs4 at bp+0 */ int32 _, _, _, _ = i, len1, p, v2 i = 0 if stringPtr == libc.UintptrFromInt32(0) { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+28145, int64(-int32(1))) return } XTcl_AppendToObj(tls, appendObj, __ccgo_ts+14586, int64(-int32(1))) p = stringPtr for { if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) != int32('\000') && i < maxChars) { break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) v2 = int64(libc.Int32FromInt32(1)) } else { v2 = XTcl_UtfToUniChar(tls, p, bp) } len1 = v2 switch *(*int32)(unsafe.Pointer(bp)) { case int32('"'): XTcl_AppendToObj(tls, appendObj, __ccgo_ts+28148, int64(-int32(1))) i += int64(2) goto _1 case int32('\f'): XTcl_AppendToObj(tls, appendObj, __ccgo_ts+28151, int64(-int32(1))) i += int64(2) goto _1 case int32('\n'): XTcl_AppendToObj(tls, appendObj, __ccgo_ts+28154, int64(-int32(1))) i += int64(2) goto _1 case int32('\r'): XTcl_AppendToObj(tls, appendObj, __ccgo_ts+28157, int64(-int32(1))) i += int64(2) goto _1 case int32('\t'): XTcl_AppendToObj(tls, appendObj, __ccgo_ts+28160, int64(-int32(1))) i += int64(2) goto _1 case int32('\v'): XTcl_AppendToObj(tls, appendObj, __ccgo_ts+28163, int64(-int32(1))) i += int64(2) goto _1 default: if *(*int32)(unsafe.Pointer(bp)) > int32(0xFFFF) { XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+28166, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(bp)))) i += int64(10) } else { if *(*int32)(unsafe.Pointer(bp)) < int32(0x20) || *(*int32)(unsafe.Pointer(bp)) >= int32(0x7F) { XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+28173, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(bp)))) i += int64(6) } else { XTcl_AppendPrintfToObj(tls, appendObj, __ccgo_ts+28180, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(bp)))) i++ } } goto _1 } goto _1 _1: ; p += uintptr(len1) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) != int32('\000') { XTcl_AppendToObj(tls, appendObj, __ccgo_ts+8560, int64(-int32(1))) } XTcl_AppendToObj(tls, appendObj, __ccgo_ts+14586, int64(-int32(1))) } /* *---------------------------------------------------------------------- * * DisassembleByteCodeAsDicts -- * * Given an object which is of bytecode type, return a disassembled * version of the bytecode (in a new refcount 0 object) in a dictionary. * No guarantees are made about the details of the contents of the * result, but it is intended to be more readable than the old output * format. * *---------------------------------------------------------------------- */ func _DisassembleByteCodeAsDicts(tls *libc.TLS, objPtr uintptr) (r uintptr) { bp := tls.Alloc(96) defer tls.Free(96) /* The bytecode-holding value to take apart */ var address, codeLength, codeOffset, sourceLength, sourceOffset, val, v34, v36, v37, v38, v39 int32 var aux, auxData, auxDesc, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, cmd, codeLenPtr, codeOffPtr, codePtr, commands, desc, desc1, description, exn, inst, instDesc, instructions, irPtr, literals, localPtr, opnd, pc, rangePtr, srcLenPtr, srcOffPtr, variables, v1, v2 uintptr var i, localCount TTcl_Size var v10, v27, v29, v3, v30, v31, v33, v40, v41, v5, v7, v8 bool var _ /* descriptor at bp+16 */ [2]uintptr var _ /* file at bp+0 */ uintptr var _ /* line at bp+8 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = address, aux, auxData, auxDesc, cachePtr, cachePtr1, cachePtr10, cachePtr11, cachePtr2, cachePtr3, cachePtr4, cachePtr5, cachePtr6, cachePtr7, cachePtr8, cachePtr9, cmd, codeLenPtr, codeLength, codeOffPtr, codeOffset, codePtr, commands, desc, desc1, description, exn, i, inst, instDesc, instructions, irPtr, literals, localCount, localPtr, opnd, pc, rangePtr, sourceLength, sourceOffset, srcLenPtr, srcOffPtr, val, variables, v1, v10, v2, v27, v29, v3, v30, v31, v33, v34, v36, v37, v38, v39, v40, v41, v5, v7, v8 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclByteCodeType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } codePtr = v2 /* * Get the literals from the bytecode. */ if v3 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v3 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v3 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { literals = XTclThreadAllocObj(tls) } else { literals = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(literals + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(literals)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(literals)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(literals)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(literals)).FtypePtr = libc.UintptrFromInt32(0) i = 0 for { if !(i < (*TByteCode)(unsafe.Pointer(codePtr)).FnumLitObjects) { break } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), literals, *(*uintptr)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FobjArrayPtr + uintptr(i)*8))) goto _4 _4: ; i++ } /* * Get the variables from the bytecode. */ if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { variables = XTclThreadAllocObj(tls) } else { variables = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(variables + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(variables)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(variables)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(variables)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(variables)).FtypePtr = libc.UintptrFromInt32(0) if (*TByteCode)(unsafe.Pointer(codePtr)).FprocPtr != 0 { localCount = (*TProc)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FprocPtr)).FnumCompiledLocals localPtr = (*TProc)(unsafe.Pointer((*TByteCode)(unsafe.Pointer(codePtr)).FprocPtr)).FfirstLocalPtr i = 0 for { if !(i < localCount) { break } if v7 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v7 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v7 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0] = XTclThreadAllocObj(tls) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0] = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0] + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0])).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0])).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0])).Flength = 0 (*TTcl_Obj)(unsafe.Pointer((*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0])).FtypePtr = libc.UintptrFromInt32(0) if !((*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&(libc.Int32FromInt32(VAR_ARRAY)|libc.Int32FromInt32(VAR_LINK)) != 0) { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0], XTcl_NewStringObj(tls, __ccgo_ts+28183, int64(-int32(1)))) } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_ARRAY) != 0 { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0], XTcl_NewStringObj(tls, __ccgo_ts+28190, int64(-int32(1)))) } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_LINK) != 0 { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0], XTcl_NewStringObj(tls, __ccgo_ts+5730, int64(-int32(1)))) } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_ARGUMENT) != 0 { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0], XTcl_NewStringObj(tls, __ccgo_ts+28196, int64(-int32(1)))) } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_TEMPORARY) != 0 { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0], XTcl_NewStringObj(tls, __ccgo_ts+28200, int64(-int32(1)))) } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_RESOLVED) != 0 { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[0], XTcl_NewStringObj(tls, __ccgo_ts+28205, int64(-int32(1)))) } if (*TCompiledLocal)(unsafe.Pointer(localPtr)).Fflags&int32(VAR_TEMPORARY) != 0 { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), variables, XTcl_NewListObj(tls, int64(1), bp+16)) } else { (*(*[2]uintptr)(unsafe.Pointer(bp + 16)))[int32(1)] = XTcl_NewStringObj(tls, localPtr+44, int64(-int32(1))) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), variables, XTcl_NewListObj(tls, int64(2), bp+16)) } goto _6 _6: ; i++ localPtr = (*TCompiledLocal)(unsafe.Pointer(localPtr)).FnextPtr } } /* * Get the instructions from the bytecode. */ if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == libc.Uint64FromInt32(0) { instructions = XTclThreadAllocObj(tls) } else { instructions = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(instructions + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(instructions)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(instructions)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(instructions)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(instructions)).FtypePtr = libc.UintptrFromInt32(0) pc = (*TByteCode)(unsafe.Pointer(codePtr)).FcodeStart for { if !(pc < (*TByteCode)(unsafe.Pointer(codePtr)).FcodeStart+uintptr((*TByteCode)(unsafe.Pointer(codePtr)).FnumCodeBytes)) { break } instDesc = uintptr(unsafe.Pointer(&XtclInstructionTable)) + uintptr(*(*uint8)(unsafe.Pointer(pc)))*32 address = int32(int64(pc) - int64((*TByteCode)(unsafe.Pointer(codePtr)).FcodeStart)) if v10 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v10 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v10 || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == libc.Uint64FromInt32(0) { inst = XTclThreadAllocObj(tls) } else { inst = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(inst + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(inst)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(inst)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(inst)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(inst)).FtypePtr = libc.UintptrFromInt32(0) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), inst, XTcl_NewStringObj(tls, (*TInstructionDesc)(unsafe.Pointer(instDesc)).Fname, int64(-int32(1)))) opnd = pc + uintptr(1) i = 0 for { if !(i < int64((*TInstructionDesc)(unsafe.Pointer(instDesc)).FnumOperands)) { break } switch *(*TInstOperandType)(unsafe.Pointer(instDesc + 24 + uintptr(i)*4)) { case int32(OPERAND_INT1): goto _12 case int32(OPERAND_UINT1): goto _13 case int32(OPERAND_INT4): goto _14 case int32(OPERAND_UINT4): goto _15 case int32(OPERAND_OFFSET1): goto _16 case int32(OPERAND_OFFSET4): goto _17 case int32(OPERAND_LIT1): goto _18 case int32(OPERAND_LIT4): goto _19 case int32(OPERAND_LVT1): goto _20 case int32(OPERAND_LVT4): goto _21 case int32(OPERAND_IDX4): goto _22 case int32(OPERAND_AUX4): goto _23 case int32(OPERAND_SCLS1): goto _24 case int32(OPERAND_NONE): goto _25 } goto _26 _12: ; val = int32(*(*int8)(unsafe.Pointer(opnd))) opnd += uintptr(1) goto formatNumber _13: ; val = libc.Int32FromUint32(uint32(*(*uint8)(unsafe.Pointer(opnd)))) opnd += uintptr(1) goto formatNumber _14: ; val = libc.Int32FromUint32(uint32(*(*uint8)(unsafe.Pointer(opnd)))<= -int32(1) { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), inst, XTcl_ObjPrintf(tls, __ccgo_ts+28229, libc.VaList(bp+40, val))) } else { if val == -int32(2) { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), inst, XTcl_NewStringObj(tls, __ccgo_ts+28233, int64(-int32(1)))) } else { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), inst, XTcl_ObjPrintf(tls, __ccgo_ts+28238, libc.VaList(bp+40, -int32(2)-val))) } } goto _26 _23: ; val = libc.Int32FromUint32(uint32(*(*uint8)(unsafe.Pointer(opnd)))<= 0 { XTclDictPut(tls, libc.UintptrFromInt32(0), description, __ccgo_ts+28500, XTcl_NewWideIntObj(tls, int64(*(*int32)(unsafe.Pointer(bp + 8))))) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { XTclDictPut(tls, libc.UintptrFromInt32(0), description, __ccgo_ts+28518, *(*uintptr)(unsafe.Pointer(bp))) } return description } /* *---------------------------------------------------------------------- * * Tcl_DisassembleObjCmd -- * * Implementation of the "::tcl::unsupported::disassemble" command. This * command is not documented, but will disassemble procedures, lambda * terms and general scripts. Note that will compile terms if necessary * in order to disassemble them. * *---------------------------------------------------------------------- */ func XTcl_DisassembleObjCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(560) defer tls.Free(560) /* Argument objects. */ var codeObjPtr, codePtr, hPtr, irPtr, methodPtr, oPtr, procPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v24, v25, v26, v27, v28 uintptr var result int32 var _ /* cmd at bp+144 */ TCommand var _ /* cmd at bp+264 */ TCommand var _ /* cmd at bp+384 */ TCommand var _ /* cmd at bp+8 */ TCommand var _ /* idx at bp+0 */ int32 var _ /* nsObjPtr at bp+128 */ uintptr var _ /* nsPtr at bp+136 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = codeObjPtr, codePtr, hPtr, irPtr, methodPtr, oPtr, procPtr, result, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v24, v25, v26, v27, v28 codeObjPtr = libc.UintptrFromInt32(0) procPtr = libc.UintptrFromInt32(0) if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+28576) return int32(TCL_ERROR) } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&_types)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+5851, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< $dir entry in the map. if the "foo" encoding * is needed later, the $dir/foo.enc name can be quickly constructed in * order to read the encoding data. * * Results: * None. * * Side effects: * Entries are added to the encoding file map. * *--------------------------------------------------------------------------- */ func _FillEncodingFileMap(tls *libc.TLS) { bp := tls.Alloc(64) defer tls.Free(64) var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, cachePtr, encoding, fileObj, map1, matchFileList, searchPath, v10, v12, v14, v16, v18, v20 uintptr var i, j, v11, v13, v15, v17, v19, v9 TTcl_Size var v2, v6, v7 int64 var v4 bool var _ /* directory at bp+16 */ uintptr var _ /* filev at bp+24 */ uintptr var _ /* numDirs at bp+0 */ TTcl_Size var _ /* numFiles at bp+8 */ TTcl_Size var _ /* readableFiles at bp+32 */ TTcl_GlobTypeData _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, cachePtr, encoding, fileObj, i, j, map1, matchFileList, searchPath, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v4, v6, v7, v9 *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 searchPath = XTcl_GetEncodingSearchPath(tls) (*TTcl_Obj)(unsafe.Pointer(searchPath)).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(searchPath)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), searchPath, bp) } map1 = XTcl_NewDictObj(tls) (*TTcl_Obj)(unsafe.Pointer(map1)).FrefCount++ i = *(*TTcl_Size)(unsafe.Pointer(bp)) - int64(1) for { if !(i != int64(-libc.Int32FromInt32(1))) { break } *(*TTcl_GlobTypeData)(unsafe.Pointer(bp + 32)) = TTcl_GlobTypeData{ Ftype1: libc.Int32FromInt32(1) << libc.Int32FromInt32(4), Fperm: libc.Int32FromInt32(1) << libc.Int32FromInt32(2), } if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { matchFileList = XTclThreadAllocObj(tls) } else { matchFileList = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(matchFileList + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(matchFileList)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(matchFileList)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(matchFileList)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(matchFileList)).FtypePtr = libc.UintptrFromInt32(0) XTcl_ListObjIndex(tls, libc.UintptrFromInt32(0), searchPath, i, bp+16) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++ (*TTcl_Obj)(unsafe.Pointer(matchFileList)).FrefCount++ XTcl_FSMatchInDirectory(tls, libc.UintptrFromInt32(0), matchFileList, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+29074, bp+32) if (*TTcl_Obj)(unsafe.Pointer(matchFileList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(matchFileList + 32))).Fptr2 != 0 { v6 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(matchFileList + 32))).Fptr2)).FspanStart } else { v6 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(matchFileList + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 24)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(matchFileList + 32))).Fptr1 + 40 + uintptr(v6)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(matchFileList + 32))).Fptr2 != 0 { v7 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(matchFileList + 32))).Fptr2)).FspanLength } else { v7 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(matchFileList + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v7 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), matchFileList, bp+8, bp+24) } j = 0 for { if !(j < *(*TTcl_Size)(unsafe.Pointer(bp + 8))) { break } fileObj = XTclPathPart(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + uintptr(j)*8)), int32(TCL_PATH_TAIL)) encoding = XTclPathPart(tls, libc.UintptrFromInt32(0), fileObj, int32(TCL_PATH_ROOT)) XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), map1, encoding, *(*uintptr)(unsafe.Pointer(bp + 16))) _objPtr = fileObj v10 = _objPtr v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if v9 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = encoding v12 = _objPtr1 v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if v11 <= int64(1) { XTclFreeObj(tls, _objPtr1) } goto _8 _8: ; j++ } _objPtr2 = matchFileList v14 = _objPtr2 v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if v13 <= int64(1) { XTclFreeObj(tls, _objPtr2) } _objPtr3 = *(*uintptr)(unsafe.Pointer(bp + 16)) v16 = _objPtr3 v15 = *(*TTcl_Size)(unsafe.Pointer(v16)) *(*TTcl_Size)(unsafe.Pointer(v16))-- if v15 <= int64(1) { XTclFreeObj(tls, _objPtr3) } goto _3 _3: ; i-- } _objPtr4 = searchPath v18 = _objPtr4 v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if v17 <= int64(1) { XTclFreeObj(tls, _objPtr4) } XTclSetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&_encodingFileMap)), map1) _objPtr5 = map1 v20 = _objPtr5 v19 = *(*TTcl_Size)(unsafe.Pointer(v20)) *(*TTcl_Size)(unsafe.Pointer(v20))-- if v19 <= int64(1) { XTclFreeObj(tls, _objPtr5) } } /* *--------------------------------------------------------------------------- * * TclInitEncodingSubsystem -- * * Initialize all resources used by this subsystem on a per-process * basis. * * Results: * None. * * Side effects: * Depends on the memory, object, and IO subsystems. * *--------------------------------------------------------------------------- */ /* * NOTE: THESE BIT DEFINITIONS SHOULD NOT OVERLAP WITH INTERNAL USE BITS * DEFINED IN tcl.h (TCL_ENCODING_* et al). Be cognizant of this * when adding bits. TODO - should really be defined in a single file. * * To prevent conflicting bits, only define bits within 0xff00 mask here. */ type InternalEncodingFlags = int32 const TCL_ENCODING_LE = 256 const /* Used to distinguish LE/BE variants */ ENCODING_UTF = 512 const /* For UTF-8 encoding, allow 4-byte output * sequences */ ENCODING_INPUT = 1024 func XTclInitEncodingSubsystem(tls *libc.TLS) { bp := tls.Alloc(64) defer tls.Free(64) var dataPtr uintptr var i uint16 var leFlags, v1 int32 var size uint32 var _ /* isLe at bp+48 */ struct { Fs [0]int16 Fc uint8 F__ccgo_pad2 [1]byte } var _ /* type at bp+0 */ TTcl_EncodingType _, _, _, _, _ = dataPtr, i, leFlags, size, v1 if _encodingsInitialized != 0 { return } /* Note: This DEPENDS on TCL_ENCODING_LE being defined in least sig byte */ *(*int16)(unsafe.Pointer(bp + 48)) = int16(1) if (*(*struct { Fs [0]int16 Fc uint8 F__ccgo_pad2 [1]byte })(unsafe.Pointer(bp + 48))).Fc != 0 { v1 = int32(TCL_ENCODING_LE) } else { v1 = 0 } leFlags = v1 XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) XTcl_InitHashTable(tls, uintptr(unsafe.Pointer(&_encodingTable)), TCL_STRING_KEYS) XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) /* * Create a few initial encodings. UTF-8 to UTF-8 translation is not a * no-op because it turns a stream of improperly formed UTF-8 into a * properly formed stream. */ (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = libc.UintptrFromInt32(0) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FtoUtfProc = __ccgo_fp(_BinaryProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfromUtfProc = __ccgo_fp(_BinaryProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfreeProc = libc.UintptrFromInt32(0) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FnullSize = int64(1) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = libc.UintptrFromInt32(0) XtclIdentityEncoding = XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29080 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FtoUtfProc = __ccgo_fp(_UtfToUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfromUtfProc = __ccgo_fp(_UtfToUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfreeProc = libc.UintptrFromInt32(0) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FnullSize = int64(1) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = uintptr(int64(int32(ENCODING_UTF))) XtclUtf8Encoding = XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = libc.UintptrFromInt32(0) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29086 XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FtoUtfProc = __ccgo_fp(_Utf16ToUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfromUtfProc = __ccgo_fp(_UtfToUcs2Proc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfreeProc = libc.UintptrFromInt32(0) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FnullSize = int64(2) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29093 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = uintptr(int64(int32(TCL_ENCODING_LE))) XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29101 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = libc.UintptrFromInt32(0) XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29109 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = uintptr(int64(leFlags)) XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FtoUtfProc = __ccgo_fp(_Utf32ToUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfromUtfProc = __ccgo_fp(_UtfToUtf32Proc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfreeProc = libc.UintptrFromInt32(0) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FnullSize = int64(4) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29115 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = uintptr(int64(int32(TCL_ENCODING_LE))) XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29124 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = libc.UintptrFromInt32(0) XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29133 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = uintptr(int64(leFlags)) XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FtoUtfProc = __ccgo_fp(_Utf16ToUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfromUtfProc = __ccgo_fp(_UtfToUtf16Proc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfreeProc = libc.UintptrFromInt32(0) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FnullSize = int64(2) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29140 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = uintptr(int64(int32(TCL_ENCODING_LE))) XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29149 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = libc.UintptrFromInt32(0) XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29158 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = uintptr(int64(leFlags)) XTcl_CreateEncoding(tls, bp) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29165 XTcl_CreateEncoding(tls, bp) /* * Need the iso8859-1 encoding in order to process binary data, so force * it to always be embedded. Note that this encoding *must* be a proper * table encoding or some of the escape encodings crash! Hence the ugly * code to duplicate the structure of a table encoding here. */ dataPtr = XTcl_Alloc(tls, uint64(280)) libc.Xmemset(tls, dataPtr, 0, uint64(280)) (*TTableEncodingData)(unsafe.Pointer(dataPtr)).Ffallback = int32('?') size = uint32(libc.Uint64FromInt32(256) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2))) (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode = XTcl_Alloc(tls, uint64(size)) libc.Xmemset(tls, (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode, 0, uint64(size)) (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode = XTcl_Alloc(tls, uint64(size)) libc.Xmemset(tls, (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode, 0, uint64(size)) *(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode)) = (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + libc.UintptrFromInt32(256)*8 *(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode)) = (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + libc.UintptrFromInt32(256)*8 i = uint16(1) for { if !(libc.Int32FromUint16(i) < int32(256)) { break } *(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(i)*8)) = uintptr(unsafe.Pointer(&_emptyPage)) *(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(i)*8)) = uintptr(unsafe.Pointer(&_emptyPage)) goto _2 _2: ; i++ } i = uint16(0) for { if !(libc.Int32FromUint16(i) < int32(256)) { break } *(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode)) + uintptr(i)*2)) = i *(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode)) + uintptr(i)*2)) = i goto _3 _3: ; i++ } (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName = __ccgo_ts + 29173 (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FtoUtfProc = __ccgo_fp(_Iso88591ToUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfromUtfProc = __ccgo_fp(_Iso88591FromUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FfreeProc = __ccgo_fp(_TableFreeProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FnullSize = int64(1) (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FclientData = dataPtr _defaultEncoding = XTcl_CreateEncoding(tls, bp) _systemEncoding = XTcl_GetEncoding(tls, libc.UintptrFromInt32(0), (*(*TTcl_EncodingType)(unsafe.Pointer(bp))).FencodingName) _encodingsInitialized = int32(1) } /* *---------------------------------------------------------------------- * * TclFinalizeEncodingSubsystem -- * * Release the state associated with the encoding subsystem. * * Results: * None. * * Side effects: * Frees all of the encodings. * *---------------------------------------------------------------------- */ func XTclFinalizeEncodingSubsystem(tls *libc.TLS) { bp := tls.Alloc(32) defer tls.Free(32) var hPtr uintptr var _ /* search at bp+0 */ TTcl_HashSearch _ = hPtr XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) _encodingsInitialized = 0 _FreeEncoding(tls, _systemEncoding) _systemEncoding = libc.UintptrFromInt32(0) _defaultEncoding = libc.UintptrFromInt32(0) _FreeEncoding(tls, XtclIdentityEncoding) XtclIdentityEncoding = libc.UintptrFromInt32(0) _FreeEncoding(tls, XtclUtf8Encoding) XtclUtf8Encoding = libc.UintptrFromInt32(0) hPtr = XTcl_FirstHashEntry(tls, uintptr(unsafe.Pointer(&_encodingTable)), bp) for hPtr != libc.UintptrFromInt32(0) { /* * Call FreeEncoding instead of doing it directly to handle refcounts * like escape encodings use. [Bug 524674] Make sure to call * Tcl_FirstHashEntry repeatedly so that all encodings are eventually * cleaned up. */ _FreeEncoding(tls, (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData) hPtr = XTcl_FirstHashEntry(tls, uintptr(unsafe.Pointer(&_encodingTable)), bp) } XTcl_DeleteHashTable(tls, uintptr(unsafe.Pointer(&_encodingTable))) XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) } /* *------------------------------------------------------------------------- * * Tcl_GetEncoding -- * * Given the name of a encoding, find the corresponding Tcl_Encoding * token. If the encoding did not already exist, Tcl attempts to * dynamically load an encoding by that name. * * Results: * Returns a token that represents the encoding. If the name didn't refer * to any known or loadable encoding, NULL is returned. If NULL was * returned, an error message is left in interp's result object, unless * interp was NULL. * * Side effects: * LoadEncodingFile is called if necessary. * *------------------------------------------------------------------------- */ func XTcl_GetEncoding(tls *libc.TLS, interp uintptr, name uintptr) (r TTcl_Encoding) { /* The name of the desired encoding. */ var encodingPtr, hPtr uintptr _, _ = encodingPtr, hPtr XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) if name == libc.UintptrFromInt32(0) { encodingPtr = _systemEncoding (*TEncoding)(unsafe.Pointer(encodingPtr)).FrefCount++ XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) return _systemEncoding } hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&_encodingTable)))).FfindProc})))(tls, uintptr(unsafe.Pointer(&_encodingTable)), name) if hPtr != libc.UintptrFromInt32(0) { encodingPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData (*TEncoding)(unsafe.Pointer(encodingPtr)).FrefCount++ XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) return encodingPtr } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) return _LoadEncodingFile(tls, interp, name) } /* *--------------------------------------------------------------------------- * * Tcl_FreeEncoding -- * * Releases an encoding allocated by Tcl_CreateEncoding() or * Tcl_GetEncoding(). * * Results: * None. * * Side effects: * The reference count associated with the encoding is decremented and * the encoding is deleted if nothing is using it anymore. * *--------------------------------------------------------------------------- */ func XTcl_FreeEncoding(tls *libc.TLS, encoding TTcl_Encoding) { XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) _FreeEncoding(tls, encoding) XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) } /* *---------------------------------------------------------------------- * * FreeEncoding -- * * Decrements the reference count of an encoding. The caller must hold * encodingMutes. * * Results: * None. * * Side effects: * Releases the resource for an encoding if it is now unused. * The reference count associated with the encoding is decremented and * the encoding may be deleted if nothing is using it anymore. * *---------------------------------------------------------------------- */ func _FreeEncoding(tls *libc.TLS, encoding TTcl_Encoding) { var encodingPtr, v2 uintptr var v1 Tsize_t _, _, _ = encodingPtr, v1, v2 encodingPtr = encoding if encodingPtr == libc.UintptrFromInt32(0) { return } v2 = encodingPtr + 56 v1 = *(*Tsize_t)(unsafe.Pointer(v2)) *(*Tsize_t)(unsafe.Pointer(v2))-- if v1 <= uint64(1) { if (*TEncoding)(unsafe.Pointer(encodingPtr)).FfreeProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TEncoding)(unsafe.Pointer(encodingPtr)).FfreeProc})))(tls, (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData) } if (*TEncoding)(unsafe.Pointer(encodingPtr)).FhPtr != libc.UintptrFromInt32(0) { XTcl_DeleteHashEntry(tls, (*TEncoding)(unsafe.Pointer(encodingPtr)).FhPtr) } if (*TEncoding)(unsafe.Pointer(encodingPtr)).Fname != 0 { XTclpFree(tls, (*TEncoding)(unsafe.Pointer(encodingPtr)).Fname) } XTclpFree(tls, encodingPtr) } } /* *------------------------------------------------------------------------- * * Tcl_GetEncodingName -- * * Given an encoding, return the name that was used to construct the * encoding. * * Results: * The name of the encoding. * * Side effects: * None. * *--------------------------------------------------------------------------- */ func XTcl_GetEncodingName(tls *libc.TLS, encoding TTcl_Encoding) (r uintptr) { /* The encoding whose name to fetch. */ if encoding == libc.UintptrFromInt32(0) { encoding = _systemEncoding } return (*TEncoding)(unsafe.Pointer(encoding)).Fname } /* *------------------------------------------------------------------------- * * Tcl_GetEncodingNames -- * * Get the list of all known encodings, including the ones stored as * files on disk in the encoding path. * * Results: * Modifies interp's result object to hold a list of all the available * encodings. * * Side effects: * None. * *------------------------------------------------------------------------- */ func XTcl_GetEncodingNames(tls *libc.TLS, interp uintptr) { bp := tls.Alloc(176) defer tls.Free(176) /* Interp to hold result. */ var cachePtr, encodingPtr, hPtr, map1, result, v5 uintptr var v1 bool var _ /* done at bp+164 */ int32 var _ /* dummy at bp+160 */ int32 var _ /* mapSearch at bp+136 */ TTcl_DictSearch var _ /* name at bp+128 */ uintptr var _ /* search at bp+104 */ TTcl_HashSearch var _ /* table at bp+0 */ TTcl_HashTable _, _, _, _, _, _, _ = cachePtr, encodingPtr, hPtr, map1, result, v1, v5 *(*int32)(unsafe.Pointer(bp + 164)) = 0 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { result = XTclThreadAllocObj(tls) } else { result = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(result + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(result)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(result)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(result)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(result)).FtypePtr = libc.UintptrFromInt32(0) XTcl_InitObjHashTable(tls, bp) /* * Copy encoding names from loaded encoding table to table. */ XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) hPtr = XTcl_FirstHashEntry(tls, uintptr(unsafe.Pointer(&_encodingTable)), bp+104) for { if !(hPtr != libc.UintptrFromInt32(0)) { break } encodingPtr = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(bp)).FcreateProc})))(tls, bp, XTcl_NewStringObj(tls, (*TEncoding)(unsafe.Pointer(encodingPtr)).Fname, int64(-libc.Int32FromInt32(1))), bp+160) goto _2 _2: ; hPtr = XTcl_NextHashEntry(tls, bp+104) } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) _FillEncodingFileMap(tls) map1 = XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&_encodingFileMap))) /* * Copy encoding names from encoding file map to table. */ XTcl_DictObjFirst(tls, libc.UintptrFromInt32(0), map1, bp+136, bp+128, libc.UintptrFromInt32(0), bp+164) for { if !!(*(*int32)(unsafe.Pointer(bp + 164)) != 0) { break } (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(bp)).FcreateProc})))(tls, bp, *(*uintptr)(unsafe.Pointer(bp + 128)), bp+160) goto _3 _3: ; XTcl_DictObjNext(tls, bp+136, bp+128, libc.UintptrFromInt32(0), bp+164) } /* * Pull all encoding names from table into the result list. */ hPtr = XTcl_FirstHashEntry(tls, bp, bp+104) for { if !(hPtr != libc.UintptrFromInt32(0)) { break } if (*TTcl_HashTable)(unsafe.Pointer(bp)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(bp)).FkeyType == -int32(1) { v5 = *(*uintptr)(unsafe.Pointer(hPtr + 32)) } else { v5 = hPtr + 32 } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), result, v5) goto _4 _4: ; hPtr = XTcl_NextHashEntry(tls, bp+104) } XTcl_SetObjResult(tls, interp, result) XTcl_DeleteHashTable(tls, bp) } // C documentation // // /* // *------------------------------------------------------------------------- // * // * Tcl_GetEncodingNulLength -- // * // * Given an encoding, return the number of nul bytes used for the // * string termination. // * // * Results: // * The number of nul bytes used for the string termination. // * // * Side effects: // * None. // * // *--------------------------------------------------------------------------- // */ func XTcl_GetEncodingNulLength(tls *libc.TLS, encoding TTcl_Encoding) (r TTcl_Size) { if encoding == libc.UintptrFromInt32(0) { encoding = _systemEncoding } return (*TEncoding)(unsafe.Pointer(encoding)).FnullSize } /* *------------------------------------------------------------------------ * * Tcl_SetSystemEncoding -- * * Sets the default encoding that should be used whenever the user passes * a NULL value in to one of the conversion routines. If the supplied * name is NULL, the system encoding is reset to the default system * encoding. * * Results: * The return value is TCL_OK if the system encoding was successfully set * to the encoding specified by name, TCL_ERROR otherwise. If TCL_ERROR * is returned, an error message is left in interp's result object, * unless interp was NULL. * * Side effects: * The reference count of the new system encoding is incremented. The * reference count of the old system encoding is decremented and it may * be freed. All VFS cached information is invalidated. * *------------------------------------------------------------------------ */ func XTcl_SetSystemEncoding(tls *libc.TLS, interp uintptr, name uintptr) (r int32) { /* The name of the desired encoding, or NULL/"" * to reset to default encoding. */ var encoding TTcl_Encoding var encodingPtr uintptr _, _ = encoding, encodingPtr if !(name != 0) || !(*(*uint8)(unsafe.Pointer(name)) != 0) { XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) encoding = _defaultEncoding encodingPtr = encoding (*TEncoding)(unsafe.Pointer(encodingPtr)).FrefCount++ XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) } else { encoding = XTcl_GetEncoding(tls, interp, name) if encoding == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } } XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) _FreeEncoding(tls, _systemEncoding) _systemEncoding = encoding XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) XTcl_FSMountsChanged(tls, libc.UintptrFromInt32(0)) return TCL_OK } /* *--------------------------------------------------------------------------- * * Tcl_CreateEncoding -- * * Defines a new encoding, along with the functions that are used to * convert to and from Unicode. * * Results: * Returns a token that represents the encoding. If an encoding with the * same name already existed, the old encoding token remains valid and * continues to behave as it used to, and is eventually garbage collected * when the last reference to it goes away. Any subsequent calls to * Tcl_GetEncoding with the specified name retrieve the most recent * encoding token. * * Side effects: * A new record having the name of the encoding is entered into a table of * encodings visible to all interpreters. For each call to this function, * there should eventually be a call to Tcl_FreeEncoding, which cleans * deletes the record in the table when an encoding is no longer needed. * *--------------------------------------------------------------------------- */ func XTcl_CreateEncoding(tls *libc.TLS, typePtr uintptr) (r TTcl_Encoding) { bp := tls.Alloc(16) defer tls.Free(16) /* The encoding type. */ var encodingPtr, hPtr, name, replaceMe uintptr var _ /* isNew at bp+0 */ int32 _, _, _, _ = encodingPtr, hPtr, name, replaceMe encodingPtr = XTcl_Alloc(tls, uint64(72)) (*TEncoding)(unsafe.Pointer(encodingPtr)).Fname = libc.UintptrFromInt32(0) (*TEncoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc = (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FtoUtfProc (*TEncoding)(unsafe.Pointer(encodingPtr)).FfromUtfProc = (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FfromUtfProc (*TEncoding)(unsafe.Pointer(encodingPtr)).FfreeProc = (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FfreeProc (*TEncoding)(unsafe.Pointer(encodingPtr)).FnullSize = (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FnullSize (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData = (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FclientData if (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FnullSize == int64(2) { (*TEncoding)(unsafe.Pointer(encodingPtr)).FlengthProc = __ccgo_fp(_unilen) } else { if (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FnullSize == int64(4) { (*TEncoding)(unsafe.Pointer(encodingPtr)).FlengthProc = __ccgo_fp(_unilen4) } else { (*TEncoding)(unsafe.Pointer(encodingPtr)).FlengthProc = __ccgo_fp(libc.Xstrlen) } } (*TEncoding)(unsafe.Pointer(encodingPtr)).FrefCount = uint64(1) (*TEncoding)(unsafe.Pointer(encodingPtr)).FhPtr = libc.UintptrFromInt32(0) if (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FencodingName != 0 { XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(uintptr(unsafe.Pointer(&_encodingTable)))).FcreateProc})))(tls, uintptr(unsafe.Pointer(&_encodingTable)), (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FencodingName, bp) if *(*int32)(unsafe.Pointer(bp)) == 0 { /* * Remove old encoding from hash table, but don't delete it until last * reference goes away. */ replaceMe = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData (*TEncoding)(unsafe.Pointer(replaceMe)).FhPtr = libc.UintptrFromInt32(0) } name = XTcl_Alloc(tls, libc.Xstrlen(tls, (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FencodingName)+uint64(1)) (*TEncoding)(unsafe.Pointer(encodingPtr)).Fname = libc.Xstrcpy(tls, name, (*TTcl_EncodingType)(unsafe.Pointer(typePtr)).FencodingName) (*TEncoding)(unsafe.Pointer(encodingPtr)).FhPtr = hPtr (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = encodingPtr XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_encodingMutex))) } return encodingPtr } /* *------------------------------------------------------------------------- * * Tcl_ExternalToUtfDString -- * * Convert a source buffer from the specified encoding into UTF-8. If any * of the bytes in the source buffer are invalid or cannot be represented * in the target encoding, a default fallback character will be * substituted. * * Results: * The converted bytes are stored in the DString, which is then NULL * terminated. The return value is a pointer to the value stored in the * DString. * * Side effects: * None. * *------------------------------------------------------------------------- */ func XTcl_ExternalToUtfDString(tls *libc.TLS, encoding TTcl_Encoding, src uintptr, srcLen TTcl_Size, dstPtr uintptr) (r uintptr) { /* Uninitialized or free DString in which the * converted string is stored. */ XTcl_ExternalToUtfDStringEx(tls, libc.UintptrFromInt32(0), encoding, src, srcLen, int32(TCL_ENCODING_PROFILE_TCL8), dstPtr, libc.UintptrFromInt32(0)) return (*TTcl_DString)(unsafe.Pointer(dstPtr)).Fstring1 } /* *------------------------------------------------------------------------- * * Tcl_ExternalToUtfDStringEx -- * * Convert a source buffer from the specified encoding into UTF-8. * "flags" controls the behavior if any of the bytes in * the source buffer are invalid or cannot be represented in utf-8. * Possible flags values: * target encoding. It should be composed by OR-ing the following: * - *At most one* of TCL_ENCODING_PROFILE{DEFAULT,TCL8,STRICT} * * Results: * The return value is one of * TCL_OK: success. Converted string in *dstPtr * TCL_ERROR: error in passed parameters. Error message in interp * TCL_CONVERT_MULTIBYTE: source ends in truncated multibyte sequence * TCL_CONVERT_SYNTAX: source is not conformant to encoding definition * TCL_CONVERT_UNKNOWN: source contained a character that could not * be represented in target encoding. * * Side effects: * TCL_OK: The converted bytes are stored in the DString and NUL * terminated in an encoding-specific manner. * TCL_ERROR: an error, message is stored in the interp if not NULL. * TCL_CONVERT_*: if errorLocPtr is NULL, an error message is stored * in the interpreter (if not NULL). If errorLocPtr is not NULL, * no error message is stored as it is expected the caller is * interested in whatever is decoded so far and not treating this * as an error condition. * * In addition, *dstPtr is always initialized and must be cleared * by the caller irrespective of the return code. * *------------------------------------------------------------------------- */ func XTcl_ExternalToUtfDStringEx(tls *libc.TLS, interp uintptr, encoding TTcl_Encoding, src uintptr, srcLen TTcl_Size, flags int32, dstPtr uintptr, errorLocPtr uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) /* Where to store the error location * (or TCL_INDEX_NONE if no error). May * be NULL. */ var dst, encodingPtr, srcStart uintptr var dstChunkLen, result, srcChunkLen, v3 int32 var dstLen, nBytesProcessed, soFar TTcl_Size var v1, v2 int64 var _ /* buf at bp+20 */ [24]uint8 var _ /* dstChunkChars at bp+16 */ int32 var _ /* dstChunkWrote at bp+12 */ int32 var _ /* srcChunkRead at bp+8 */ int32 var _ /* state at bp+0 */ TTcl_EncodingState _, _, _, _, _, _, _, _, _, _, _, _ = dst, dstChunkLen, dstLen, encodingPtr, nBytesProcessed, result, soFar, srcChunkLen, srcStart, v1, v2, v3 srcStart = src /* DO FIRST - Must always be initialized before returning */ XTcl_DStringInit(tls, dstPtr) dst = (*TTcl_DString)(unsafe.Pointer(dstPtr)).Fstring1 dstLen = (*TTcl_DString)(unsafe.Pointer(dstPtr)).FspaceAvl - int64(1) if encoding == libc.UintptrFromInt32(0) { encoding = _systemEncoding } encodingPtr = encoding if src == libc.UintptrFromInt32(0) { srcLen = 0 } else { if srcLen == int64(-libc.Int32FromInt32(1)) { srcLen = libc.Int64FromUint64((*(*func(*libc.TLS, uintptr) Tsize_t)(unsafe.Pointer(&struct{ uintptr }{(*TEncoding)(unsafe.Pointer(encodingPtr)).FlengthProc})))(tls, src)) } } flags &= ^libc.Int32FromInt32(TCL_ENCODING_END) flags |= int32(TCL_ENCODING_START) if (*TEncoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc == __ccgo_fp(_UtfToUtfProc) { flags |= int32(ENCODING_INPUT) } for int32(1) != 0 { if srcLen > int64(INT_MAX) { srcChunkLen = int32(INT_MAX) } else { srcChunkLen = int32(srcLen) flags |= int32(TCL_ENCODING_END) /* Last chunk */ } if dstLen > int64(INT_MAX) { v1 = int64(INT_MAX) } else { v1 = dstLen } dstChunkLen = int32(v1) result = (*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TEncoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc})))(tls, (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData, src, srcChunkLen, flags, bp, dst, dstChunkLen, bp+8, bp+12, bp+16) soFar = int64(dst+uintptr(*(*int32)(unsafe.Pointer(bp + 12)))) - int64((*TTcl_DString)(unsafe.Pointer(dstPtr)).Fstring1) src += uintptr(*(*int32)(unsafe.Pointer(bp + 8))) /* * Keep looping in two case - * - our destination buffer did not have enough room * - we had not passed in all the data and error indicated fragment * of a multibyte character * In both cases we have to grow buffer, move the input source pointer * and loop. Otherwise, return the result we got. */ if result != -int32(4) && !(result == -int32(1) && flags&int32(TCL_ENCODING_END) != 0) { nBytesProcessed = int64(src) - int64(srcStart) XTcl_DStringSetLength(tls, dstPtr, soFar) if errorLocPtr != 0 { /* * Do not write error message into interpreter if caller * wants to know error location. */ if result == TCL_OK { v2 = int64(-libc.Int32FromInt32(1)) } else { v2 = nBytesProcessed } *(*TTcl_Size)(unsafe.Pointer(errorLocPtr)) = v2 } else { /* Caller wants error message on failure */ if result != TCL_OK && interp != libc.UintptrFromInt32(0) { libc.X__builtin_snprintf(tls, bp+20, uint64(24), __ccgo_ts+29183, libc.VaList(bp+56, nBytesProcessed)) XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+29187, libc.VaList(bp+56, nBytesProcessed, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(srcStart + uintptr(nBytesProcessed))))))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, __ccgo_ts+2004, __ccgo_ts+15139, __ccgo_ts+29244, bp+20, libc.UintptrFromInt32(0))) } } if result != TCL_OK { if result == -int32(4) { v3 = int32(ENOMEM) } else { v3 = int32(EILSEQ) } *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = v3 } return result } /* Expand space and continue */ flags &= ^libc.Int32FromInt32(TCL_ENCODING_START) srcLen -= int64(*(*int32)(unsafe.Pointer(bp + 8))) if (*TTcl_DString)(unsafe.Pointer(dstPtr)).Flength == 0 { XTcl_DStringSetLength(tls, dstPtr, dstLen) } XTcl_DStringSetLength(tls, dstPtr, int64(2)*(*TTcl_DString)(unsafe.Pointer(dstPtr)).Flength+int64(1)) dst = (*TTcl_DString)(unsafe.Pointer(dstPtr)).Fstring1 + uintptr(soFar) dstLen = (*TTcl_DString)(unsafe.Pointer(dstPtr)).Flength - soFar - int64(1) } return r } /* *------------------------------------------------------------------------- * * Tcl_ExternalToUtf -- * * Convert a source buffer from the specified encoding into UTF-8. * * Results: * The return value is one of TCL_OK, TCL_CONVERT_MULTIBYTE, * TCL_CONVERT_SYNTAX, TCL_CONVERT_UNKNOWN, or TCL_CONVERT_NOSPACE, as * documented in tcl.h. * * Side effects: * The converted bytes are stored in the output buffer. * *------------------------------------------------------------------------- */ func XTcl_ExternalToUtf(tls *libc.TLS, dummy1295 uintptr, encoding TTcl_Encoding, src uintptr, srcLen TTcl_Size, flags int32, statePtr uintptr, dst uintptr, dstLen TTcl_Size, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var charLimited, maxChars, noTerminate, result int32 var encodingPtr uintptr var savedState TTcl_EncodingState var _ /* dstChars at bp+8 */ int32 var _ /* dstWrote at bp+4 */ int32 var _ /* srcRead at bp+0 */ int32 var _ /* state at bp+16 */ TTcl_EncodingState _, _, _, _, _, _ = charLimited, encodingPtr, maxChars, noTerminate, result, savedState *(*int32)(unsafe.Pointer(bp + 8)) = 0 noTerminate = flags & int32(TCL_ENCODING_NO_TERMINATE) charLimited = libc.BoolInt32(flags&int32(TCL_ENCODING_CHAR_LIMIT) != 0 && dstCharsPtr != 0) maxChars = int32(INT_MAX) if encoding == libc.UintptrFromInt32(0) { encoding = _systemEncoding } encodingPtr = encoding if src == libc.UintptrFromInt32(0) { srcLen = 0 } else { if srcLen == int64(-libc.Int32FromInt32(1)) { srcLen = libc.Int64FromUint64((*(*func(*libc.TLS, uintptr) Tsize_t)(unsafe.Pointer(&struct{ uintptr }{(*TEncoding)(unsafe.Pointer(encodingPtr)).FlengthProc})))(tls, src)) } } if statePtr == libc.UintptrFromInt32(0) { flags |= libc.Int32FromInt32(TCL_ENCODING_START) | libc.Int32FromInt32(TCL_ENCODING_END) statePtr = bp + 16 } if srcLen > int64(INT_MAX) { srcLen = int64(INT_MAX) flags &= ^libc.Int32FromInt32(TCL_ENCODING_END) } if dstLen > int64(INT_MAX) { dstLen = int64(INT_MAX) } if srcReadPtr == libc.UintptrFromInt32(0) { srcReadPtr = bp } if dstWrotePtr == libc.UintptrFromInt32(0) { dstWrotePtr = bp + 4 } if dstCharsPtr == libc.UintptrFromInt32(0) { dstCharsPtr = bp + 8 flags &= ^libc.Int32FromInt32(TCL_ENCODING_CHAR_LIMIT) } else { if charLimited != 0 { maxChars = *(*int32)(unsafe.Pointer(dstCharsPtr)) } } if !(noTerminate != 0) { if dstLen < int64(1) { return -int32(4) } /* * If there are any null characters in the middle of the buffer, * they will converted to the UTF-8 null character (\xC0\x80). To get * the actual \0 at the end of the destination buffer, we need to * append it manually. First make room for it... */ dstLen-- } else { if dstLen <= 0 && srcLen > 0 { return -int32(4) } } if (*TEncoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc == __ccgo_fp(_UtfToUtfProc) { flags |= int32(ENCODING_INPUT) } for cond := true; cond; cond = int32(1) != 0 { savedState = *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) result = (*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TEncoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc})))(tls, (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData, src, int32(srcLen), flags, statePtr, dst, int32(dstLen), srcReadPtr, dstWrotePtr, dstCharsPtr) if *(*int32)(unsafe.Pointer(dstCharsPtr)) <= maxChars { break } dstLen = int64(XTcl_UtfAtIndex(tls, dst, int64(maxChars))) - int64(dst) + int64(libc.Int32FromInt32(TCL_UTF_MAX)-libc.Int32FromInt32(1)) *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) = savedState } if !(noTerminate != 0) { /* ...and then append it */ *(*uint8)(unsafe.Pointer(dst + uintptr(*(*int32)(unsafe.Pointer(dstWrotePtr))))) = uint8('\000') } return result } // C documentation // // /* // *------------------------------------------------------------------------- // * // * Tcl_UtfToExternalDString -- // * // * Convert a source buffer from UTF-8 to the specified encoding. If any // * of the bytes in the source buffer are invalid or cannot be represented // * in the target encoding, a default fallback character is substituted. // * // * Results: // * The converted bytes are stored in the DString, which is then NULL // * terminated in an encoding-specific manner. The return value is a // * pointer to the value stored in the DString. // * // * Side effects: // * None. // * // *------------------------------------------------------------------------- // */ func XTcl_UtfToExternalDString(tls *libc.TLS, encoding TTcl_Encoding, src uintptr, srcLen TTcl_Size, dstPtr uintptr) (r uintptr) { /* Uninitialized or free DString in which the * converted string is stored. */ XTcl_UtfToExternalDStringEx(tls, libc.UintptrFromInt32(0), encoding, src, srcLen, int32(TCL_ENCODING_PROFILE_TCL8), dstPtr, libc.UintptrFromInt32(0)) return (*TTcl_DString)(unsafe.Pointer(dstPtr)).Fstring1 } /* *------------------------------------------------------------------------- * * Tcl_UtfToExternalDStringEx -- * * Convert a source buffer from UTF-8 to the specified encoding. * The parameter flags controls the behavior, if any of the bytes in * the source buffer are invalid or cannot be represented in the * target encoding. It should be composed by OR-ing the following: * - *At most one* of TCL_ENCODING_PROFILE_* * * Results: * The return value is one of * TCL_OK: success. Converted string in *dstPtr * TCL_ERROR: error in passed parameters. Error message in interp * TCL_CONVERT_MULTIBYTE: source ends in truncated multibyte sequence * TCL_CONVERT_SYNTAX: source is not conformant to encoding definition * TCL_CONVERT_UNKNOWN: source contained a character that could not * be represented in target encoding. * * Side effects: * TCL_OK: The converted bytes are stored in the DString and NUL * terminated in an encoding-specific manner * TCL_ERROR: an error, message is stored in the interp if not NULL. * TCL_CONVERT_*: if errorLocPtr is NULL, an error message is stored * in the interpreter (if not NULL). If errorLocPtr is not NULL, * no error message is stored as it is expected the caller is * interested in whatever is decoded so far and not treating this * as an error condition. * * In addition, *dstPtr is always initialized and must be cleared * by the caller irrespective of the return code. * *------------------------------------------------------------------------- */ func XTcl_UtfToExternalDStringEx(tls *libc.TLS, interp uintptr, encoding TTcl_Encoding, src uintptr, srcLen TTcl_Size, flags int32, dstPtr uintptr, errorLocPtr uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) /* Where to store the error location * (or TCL_INDEX_NONE if no error). May * be NULL. */ var dst, encodingPtr, srcStart uintptr var dstChunkLen, result, srcChunkLen, v5 int32 var dstLen, i, nBytesProcessed, pos, soFar, v2 TTcl_Size var v1, v3 int64 var _ /* buf at bp+24 */ [24]uint8 var _ /* dstChunkChars at bp+16 */ int32 var _ /* dstChunkWrote at bp+12 */ int32 var _ /* srcChunkRead at bp+8 */ int32 var _ /* state at bp+0 */ TTcl_EncodingState var _ /* ucs4 at bp+20 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dst, dstChunkLen, dstLen, encodingPtr, i, nBytesProcessed, pos, result, soFar, srcChunkLen, srcStart, v1, v2, v3, v5 srcStart = src /* DO FIRST - must always be initialized on return */ XTcl_DStringInit(tls, dstPtr) dst = (*TTcl_DString)(unsafe.Pointer(dstPtr)).Fstring1 dstLen = (*TTcl_DString)(unsafe.Pointer(dstPtr)).FspaceAvl - int64(1) if encoding == libc.UintptrFromInt32(0) { encoding = _systemEncoding } encodingPtr = encoding if src == libc.UintptrFromInt32(0) { srcLen = 0 } else { if srcLen == int64(-libc.Int32FromInt32(1)) { srcLen = libc.Int64FromUint64(libc.Xstrlen(tls, src)) } } flags &= ^libc.Int32FromInt32(TCL_ENCODING_END) flags |= int32(TCL_ENCODING_START) for int32(1) != 0 { if srcLen > int64(INT_MAX) { srcChunkLen = int32(INT_MAX) } else { srcChunkLen = int32(srcLen) flags |= int32(TCL_ENCODING_END) /* Last chunk */ } if dstLen > int64(INT_MAX) { v1 = int64(INT_MAX) } else { v1 = dstLen } dstChunkLen = int32(v1) result = (*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TEncoding)(unsafe.Pointer(encodingPtr)).FfromUtfProc})))(tls, (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData, src, srcChunkLen, flags, bp, dst, dstChunkLen, bp+8, bp+12, bp+16) soFar = int64(dst+uintptr(*(*int32)(unsafe.Pointer(bp + 12)))) - int64((*TTcl_DString)(unsafe.Pointer(dstPtr)).Fstring1) /* Move past the part processed in this go around */ src += uintptr(*(*int32)(unsafe.Pointer(bp + 8))) /* * Keep looping in two case - * - our destination buffer did not have enough room * - we had not passed in all the data and error indicated fragment * of a multibyte character * In both cases we have to grow buffer, move the input source pointer * and loop. Otherwise, return the result we got. */ if result != -int32(4) && !(result == -int32(1) && flags&int32(TCL_ENCODING_END) != 0) { nBytesProcessed = int64(src) - int64(srcStart) i = soFar + (*TEncoding)(unsafe.Pointer(encodingPtr)).FnullSize - int64(1) /* Loop as DStringSetLength only stores one nul byte at a time */ for i >= soFar { v2 = i i-- XTcl_DStringSetLength(tls, dstPtr, v2) } if errorLocPtr != 0 { /* * Do not write error message into interpreter if caller * wants to know error location. */ if result == TCL_OK { v3 = int64(-libc.Int32FromInt32(1)) } else { v3 = nBytesProcessed } *(*TTcl_Size)(unsafe.Pointer(errorLocPtr)) = v3 } else { /* Caller wants error message on failure */ if result != TCL_OK && interp != libc.UintptrFromInt32(0) { pos = XTcl_NumUtfChars(tls, srcStart, nBytesProcessed) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(srcStart + uintptr(nBytesProcessed)))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp + 20)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(srcStart + uintptr(nBytesProcessed)))) _ = libc.Int32FromInt32(1) } else { XTcl_UtfToUniChar(tls, srcStart+uintptr(nBytesProcessed), bp+20) } libc.X__builtin_snprintf(tls, bp+24, uint64(24), __ccgo_ts+29183, libc.VaList(bp+56, nBytesProcessed)) XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+29260, libc.VaList(bp+56, pos, *(*int32)(unsafe.Pointer(bp + 20))))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+56, __ccgo_ts+2004, __ccgo_ts+15139, __ccgo_ts+29244, bp+24, libc.UintptrFromInt32(0))) } } if result != TCL_OK { if result == -int32(4) { v5 = int32(ENOMEM) } else { v5 = int32(EILSEQ) } *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = v5 } return result } flags &= ^libc.Int32FromInt32(TCL_ENCODING_START) srcLen -= int64(*(*int32)(unsafe.Pointer(bp + 8))) if (*TTcl_DString)(unsafe.Pointer(dstPtr)).Flength == 0 { XTcl_DStringSetLength(tls, dstPtr, dstLen) } XTcl_DStringSetLength(tls, dstPtr, int64(2)*(*TTcl_DString)(unsafe.Pointer(dstPtr)).Flength+int64(1)) dst = (*TTcl_DString)(unsafe.Pointer(dstPtr)).Fstring1 + uintptr(soFar) dstLen = (*TTcl_DString)(unsafe.Pointer(dstPtr)).Flength - soFar - int64(1) } return r } /* *------------------------------------------------------------------------- * * Tcl_UtfToExternal -- * * Convert a buffer from UTF-8 into the specified encoding. * * Results: * The return value is one of TCL_OK, TCL_CONVERT_MULTIBYTE, * TCL_CONVERT_SYNTAX, TCL_CONVERT_UNKNOWN, or TCL_CONVERT_NOSPACE, as * documented in tcl.h. * * Side effects: * The converted bytes are stored in the output buffer. * *------------------------------------------------------------------------- */ func XTcl_UtfToExternal(tls *libc.TLS, dummy1617 uintptr, encoding TTcl_Encoding, src uintptr, srcLen TTcl_Size, flags int32, statePtr uintptr, dst uintptr, dstLen TTcl_Size, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var encodingPtr uintptr var result int32 var _ /* dstChars at bp+8 */ int32 var _ /* dstWrote at bp+4 */ int32 var _ /* srcRead at bp+0 */ int32 var _ /* state at bp+16 */ TTcl_EncodingState _, _ = encodingPtr, result if encoding == libc.UintptrFromInt32(0) { encoding = _systemEncoding } encodingPtr = encoding if src == libc.UintptrFromInt32(0) { srcLen = 0 } else { if srcLen == int64(-libc.Int32FromInt32(1)) { srcLen = libc.Int64FromUint64(libc.Xstrlen(tls, src)) } } if statePtr == libc.UintptrFromInt32(0) { flags |= libc.Int32FromInt32(TCL_ENCODING_START) | libc.Int32FromInt32(TCL_ENCODING_END) statePtr = bp + 16 } if srcLen > int64(INT_MAX) { srcLen = int64(INT_MAX) flags &= ^libc.Int32FromInt32(TCL_ENCODING_END) } if dstLen > int64(INT_MAX) { dstLen = int64(INT_MAX) } if srcReadPtr == libc.UintptrFromInt32(0) { srcReadPtr = bp } if dstWrotePtr == libc.UintptrFromInt32(0) { dstWrotePtr = bp + 4 } if dstCharsPtr == libc.UintptrFromInt32(0) { dstCharsPtr = bp + 8 } if dstLen < (*TEncoding)(unsafe.Pointer(encodingPtr)).FnullSize { return -int32(4) } dstLen -= (*TEncoding)(unsafe.Pointer(encodingPtr)).FnullSize result = (*(*func(*libc.TLS, uintptr, uintptr, int32, int32, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TEncoding)(unsafe.Pointer(encodingPtr)).FfromUtfProc})))(tls, (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData, src, int32(srcLen), flags, statePtr, dst, int32(dstLen), srcReadPtr, dstWrotePtr, dstCharsPtr) /* * Buffer is terminated irrespective of result. Not sure this is * reasonable but keep for historical/compatibility reasons. */ libc.Xmemset(tls, dst+uintptr(*(*int32)(unsafe.Pointer(dstWrotePtr))), int32('\000'), libc.Uint64FromInt64((*TEncoding)(unsafe.Pointer(encodingPtr)).FnullSize)) return result } // C documentation // // /* // *--------------------------------------------------------------------------- // * // * Tcl_FindExecutable -- // * // * This function computes the absolute path name of the current // * application, given its argv[0] value. // * // * Results: // * None. // * // * Side effects: // * The absolute pathname for the application is computed and stored to be // * returned later by [info nameofexecutable]. // * // *--------------------------------------------------------------------------- // */ func XTcl_FindExecutable(tls *libc.TLS, argv0 uintptr) (r uintptr) { /* The value of the application's argv[0] * (native). */ var version uintptr _ = version version = XTcl_InitSubsystems(tls) XTclpSetInitialEncodings(tls) XTclpFindExecutable(tls, argv0) return version } /* *--------------------------------------------------------------------------- * * OpenEncodingFileChannel -- * * Open the file believed to hold data for the encoding, "name". * * Results: * Returns the readable Tcl_Channel from opening the file, or NULL if the * file could not be successfully opened. If NULL was returned, an error * message is left in interp's result object, unless interp was NULL. * * Side effects: * Channel may be opened. Information about the filesystem may be cached * to speed later calls. * *--------------------------------------------------------------------------- */ func _OpenEncodingFileChannel(tls *libc.TLS, interp uintptr, name uintptr) (r TTcl_Channel) { bp := tls.Alloc(80) defer tls.Free(80) /* The name of the encoding file on disk and * also the name for new encoding. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, dirString, map1, path, searchPath, v11, v14, v16, v18, v5, v7, v9 uintptr var chan1 TTcl_Channel var i, v10, v13, v15, v17, v8 TTcl_Size var verified int32 var v2, v3 int64 var _ /* dir at bp+8 */ uintptr var _ /* directory at bp+16 */ uintptr var _ /* fileNameObj at bp+0 */ uintptr var _ /* numDirs at bp+24 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, chan1, dirString, i, map1, path, searchPath, verified, v10, v11, v13, v14, v15, v16, v17, v18, v2, v3, v5, v7, v8, v9 *(*uintptr)(unsafe.Pointer(bp)) = XTcl_ObjPrintf(tls, __ccgo_ts+29304, libc.VaList(bp+40, name)) searchPath = XTcl_DuplicateObj(tls, XTcl_GetEncodingSearchPath(tls)) map1 = XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&_encodingFileMap))) *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0) chan1 = libc.UintptrFromInt32(0) if (*TTcl_Obj)(unsafe.Pointer(searchPath)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPath + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 24)) = v3 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), searchPath, bp+24, bp+8) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount++ XTclDictGet(tls, libc.UintptrFromInt32(0), map1, name, bp+16) /* * Check that any cached directory is still on the encoding search path. */ if libc.UintptrFromInt32(0) != *(*uintptr)(unsafe.Pointer(bp + 16)) { verified = 0 i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 24)) && !(verified != 0)) { break } if *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)) == *(*uintptr)(unsafe.Pointer(bp + 16)) { verified = int32(1) } goto _4 _4: ; i++ } if !(verified != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 { v5 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes } else { v5 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), libc.UintptrFromInt32(0)) } dirString = v5 i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 24)) && !(verified != 0)) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes != 0 { v7 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)))).Fbytes } else { v7 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)), libc.UintptrFromInt32(0)) } if libc.Xstrcmp(tls, dirString, v7) == 0 { verified = int32(1) } goto _6 _6: ; i++ } } if !(verified != 0) { /* * Directory no longer on the search path. Remove from cache. */ map1 = XTcl_DuplicateObj(tls, map1) XTclDictRemove(tls, libc.UintptrFromInt32(0), map1, name) XTclSetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&_encodingFileMap)), map1) *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0) } } if libc.UintptrFromInt32(0) != *(*uintptr)(unsafe.Pointer(bp + 16)) { /* * Got a directory from the cache. Try to use it first. */ (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++ path = XTcl_FSJoinToPath(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), int64(1), bp) (*TTcl_Obj)(unsafe.Pointer(path)).FrefCount++ _objPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) v9 = _objPtr v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr) } chan1 = XTcl_FSOpenFileChannel(tls, libc.UintptrFromInt32(0), path, __ccgo_ts+25877, 0) _objPtr1 = path v11 = _objPtr1 v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if v10 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } /* * Scan the search path until we find it. */ i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 24)) && chan1 == libc.UintptrFromInt32(0)) { break } path = XTcl_FSJoinToPath(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8)), int64(1), bp) (*TTcl_Obj)(unsafe.Pointer(path)).FrefCount++ chan1 = XTcl_FSOpenFileChannel(tls, libc.UintptrFromInt32(0), path, __ccgo_ts+25877, 0) _objPtr2 = path v14 = _objPtr2 v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if v13 <= int64(1) { XTclFreeObj(tls, _objPtr2) } if chan1 != libc.UintptrFromInt32(0) { /* * Save directory in the cache. */ map1 = XTcl_DuplicateObj(tls, XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&_encodingFileMap)))) XTclDictPut(tls, libc.UintptrFromInt32(0), map1, name, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + uintptr(i)*8))) XTclSetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&_encodingFileMap)), map1) } goto _12 _12: ; i++ } if libc.UintptrFromInt32(0) == chan1 && interp != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+29311, libc.VaList(bp+40, name))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+40, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+15139, name, libc.UintptrFromInt32(0))) } _objPtr3 = *(*uintptr)(unsafe.Pointer(bp)) v16 = _objPtr3 v15 = *(*TTcl_Size)(unsafe.Pointer(v16)) *(*TTcl_Size)(unsafe.Pointer(v16))-- if v15 <= int64(1) { XTclFreeObj(tls, _objPtr3) } _objPtr4 = searchPath v18 = _objPtr4 v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if v17 <= int64(1) { XTclFreeObj(tls, _objPtr4) } return chan1 } /* *--------------------------------------------------------------------------- * * LoadEncodingFile -- * * Read a file that describes an encoding and create a new Encoding from * the data. * * Results: * The return value is the newly loaded Tcl_Encoding or NULL if the file * didn't exist or could not be processed. If NULL is returned and interp * is not NULL, an error message is left in interp's result object. * * Side effects: * A corresponding encoding file might be read from persistent storage, in * which case LoadTableEncoding is called. * *--------------------------------------------------------------------------- */ func _LoadEncodingFile(tls *libc.TLS, interp uintptr, name uintptr) (r TTcl_Encoding) { bp := tls.Alloc(272) defer tls.Free(272) /* The name of both the encoding file * and the new encoding. */ var ch int32 var chan1 TTcl_Channel var encoding TTcl_Encoding var _ /* ds at bp+0 */ TTcl_DString _, _, _ = ch, chan1, encoding chan1 = libc.UintptrFromInt32(0) encoding = libc.UintptrFromInt32(0) chan1 = _OpenEncodingFileChannel(tls, interp, name) if chan1 == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } XTcl_SetChannelOption(tls, libc.UintptrFromInt32(0), chan1, __ccgo_ts+19036, __ccgo_ts+29080) for int32(1) != 0 { XTcl_DStringInit(tls, bp) XTcl_Gets(tls, chan1, bp) ch = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TTcl_DString)(unsafe.Pointer(bp)).Fstring1))) XTcl_DStringFree(tls, bp) if ch != int32('#') { break } } switch ch { case int32('S'): encoding = _LoadTableEncoding(tls, name, int32(ENCODING_SINGLEBYTE), chan1) case int32('D'): encoding = _LoadTableEncoding(tls, name, int32(ENCODING_DOUBLEBYTE), chan1) case int32('M'): encoding = _LoadTableEncoding(tls, name, int32(ENCODING_MULTIBYTE), chan1) case int32('E'): encoding = _LoadEscapeEncoding(tls, name, chan1) break } if encoding == libc.UintptrFromInt32(0) && interp != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+29333, libc.VaList(bp+232, name))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+232, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+15139, name, libc.UintptrFromInt32(0))) } XTcl_CloseEx(tls, libc.UintptrFromInt32(0), chan1, 0) return encoding } /* *------------------------------------------------------------------------- * * LoadTableEncoding -- * * Helper function for LoadEncodingFile(). Creates a Tcl_EncodingType * structure along with its corresponding TableEncodingData structure, and * passes it to Tcl_Createncoding. * * The file contains binary data but begins with a marker to indicate * byte-ordering so a single binary file can be read on big or * little-endian systems. * * Results: * Returns the new Tcl_Encoding, or NULL if it could * not be created because the file contained invalid data. * * Side effects: * See Tcl_CreateEncoding(). * *------------------------------------------------------------------------- */ func _LoadTableEncoding(tls *libc.TLS, name uintptr, type1 int32, chan1 TTcl_Channel) (r TTcl_Encoding) { bp := tls.Alloc(544) defer tls.Free(544) /* File containing new encoding. */ var cachePtr, cachePtr1, dataPtr, objPtr, p, p1, page, pageMemPtr, v3, v6 uintptr var ch, ch1, fallback, from, hi, i, len1, lo, numPages, symbol, to, v14, v16, v18 int32 var expected, v5 TTcl_Size var size uint32 var v1, v7 bool var _ /* encType at bp+488 */ TTcl_EncodingType var _ /* line at bp+224 */ uintptr var _ /* lineString at bp+0 */ TTcl_DString var _ /* used at bp+232 */ [256]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, ch, ch1, dataPtr, expected, fallback, from, hi, i, len1, lo, numPages, objPtr, p, p1, page, pageMemPtr, size, symbol, to, v1, v14, v16, v18, v3, v5, v6, v7 XTcl_DStringInit(tls, bp) if XTcl_Gets(tls, chan1, bp) < 0 { return libc.UintptrFromInt32(0) } *(*uintptr)(unsafe.Pointer(bp + 224)) = (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1 fallback = int32(libc.Xstrtol(tls, *(*uintptr)(unsafe.Pointer(bp + 224)), bp+224, int32(16))) symbol = int32(libc.Xstrtol(tls, *(*uintptr)(unsafe.Pointer(bp + 224)), bp+224, int32(10))) numPages = int32(libc.Xstrtol(tls, *(*uintptr)(unsafe.Pointer(bp + 224)), bp+224, int32(10))) XTcl_DStringFree(tls, bp) if numPages < 0 { numPages = 0 } else { if numPages > int32(256) { numPages = int32(256) } } libc.Xmemset(tls, bp+232, 0, uint64(256)) dataPtr = XTcl_Alloc(tls, uint64(280)) libc.Xmemset(tls, dataPtr, 0, uint64(280)) (*TTableEncodingData)(unsafe.Pointer(dataPtr)).Ffallback = fallback /* * Read the table that maps characters to Unicode. Performs a single * malloc to get the memory for the array and all the pages needed by the * array. */ size = uint32(libc.Uint64FromInt32(256)*libc.Uint64FromInt64(8) + libc.Uint64FromInt32(numPages)*(libc.Uint64FromInt32(256)*libc.Uint64FromInt64(2))) (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode = XTcl_Alloc(tls, uint64(size)) libc.Xmemset(tls, (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode, 0, uint64(size)) pageMemPtr = (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + libc.UintptrFromInt32(256)*8 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ i = 0 for { if !(i < numPages) { break } expected = int64(libc.Int32FromInt32(3) + libc.Int32FromInt32(16)*(libc.Int32FromInt32(16)*libc.Int32FromInt32(4)+libc.Int32FromInt32(1))) if XTcl_ReadChars(tls, chan1, objPtr, expected, 0) != expected { return libc.UintptrFromInt32(0) } if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, objPtr, libc.UintptrFromInt32(0)) } p = v3 hi = libc.Int32FromUint8(_staticHex[*(*uint8)(unsafe.Pointer(p))])<>int32(8)] = uint8(1) } *(*uint16)(unsafe.Pointer(pageMemPtr)) = libc.Uint16FromInt32(ch) pageMemPtr += 2 p += uintptr(4) goto _4 _4: ; lo++ } goto _2 _2: ; i++ } v6 = objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if !(v5 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v7 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v7 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v7 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, objPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = objPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, objPtr) } } if type1 == int32(ENCODING_DOUBLEBYTE) { libc.Xmemset(tls, dataPtr+4, int32(1), uint64(256)) } else { hi = int32(1) for { if !(hi < int32(256)) { break } if *(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(hi)*8)) != libc.UintptrFromInt32(0) { *(*uint8)(unsafe.Pointer(dataPtr + 4 + uintptr(hi))) = uint8(1) } goto _8 _8: ; hi++ } } /* * Invert the toUnicode array to produce the fromUnicode array. Performs a * single malloc to get the memory for the array and all the pages needed * by the array. While reading in the toUnicode array remember what * pages are needed for the fromUnicode array. */ if symbol != 0 { (*(*[256]uint8)(unsafe.Pointer(bp + 232)))[0] = uint8(1) } numPages = 0 hi = 0 for { if !(hi < int32(256)) { break } if (*(*[256]uint8)(unsafe.Pointer(bp + 232)))[hi] != 0 { numPages++ } goto _9 _9: ; hi++ } size = uint32(libc.Uint64FromInt32(256)*libc.Uint64FromInt64(8) + libc.Uint64FromInt32(numPages)*(libc.Uint64FromInt32(256)*libc.Uint64FromInt64(2))) (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode = XTcl_Alloc(tls, uint64(size)) libc.Xmemset(tls, (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode, 0, uint64(size)) pageMemPtr = (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + libc.UintptrFromInt32(256)*8 hi = 0 for { if !(hi < int32(256)) { break } if *(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(hi)*8)) == libc.UintptrFromInt32(0) { *(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(hi)*8)) = uintptr(unsafe.Pointer(&_emptyPage)) goto _10 } lo = 0 for { if !(lo < int32(256)) { break } ch1 = libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode + uintptr(hi)*8)) + uintptr(lo)*2))) if ch1 != 0 { page = *(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(ch1>>int32(8))*8)) if page == libc.UintptrFromInt32(0) { page = pageMemPtr pageMemPtr += uintptr(256) * 2 *(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode + uintptr(ch1>>int32(8))*8)) = page } *(*uint16)(unsafe.Pointer(page + uintptr(ch1&int32(0xFF))*2)) = libc.Uint16FromInt32(hi<= 0 && *(*uint8)(unsafe.Pointer(p1)) != 0) { break } from = libc.Int32FromUint8(_staticHex[*(*uint8)(unsafe.Pointer(p1))])<>int32(8))*8)) + uintptr(from&int32(0xFF))*2)) = libc.Uint16FromInt32(to) goto _17 _17: ; p1 += uintptr(5) len1 -= int32(5) } goto _15 _15: ; XTcl_DStringSetLength(tls, bp, 0) } goto doneParse doneParse: ; XTcl_DStringFree(tls, bp) /* * Package everything into an encoding structure. */ (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 488))).FencodingName = name (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 488))).FtoUtfProc = __ccgo_fp(_TableToUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 488))).FfromUtfProc = __ccgo_fp(_TableFromUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 488))).FfreeProc = __ccgo_fp(_TableFreeProc) if type1 == int32(ENCODING_DOUBLEBYTE) { v18 = int32(2) } else { v18 = int32(1) } (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 488))).FnullSize = int64(v18) (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 488))).FclientData = dataPtr return XTcl_CreateEncoding(tls, bp+488) } /* * Speed over memory. Use a full 256 character table to decode hex * sequences in the encoding files. */ var _staticHex = [256]uint8{ 49: uint8(1), 50: uint8(2), 51: uint8(3), 52: uint8(4), 53: uint8(5), 54: uint8(6), 55: uint8(7), 56: uint8(8), 57: uint8(9), 65: uint8(10), 66: uint8(11), 67: uint8(12), 68: uint8(13), 69: uint8(14), 70: uint8(15), 97: uint8(10), 98: uint8(11), 99: uint8(12), 100: uint8(13), 101: uint8(14), 102: uint8(15), 113: uint8(1), 114: uint8(2), 115: uint8(3), 116: uint8(4), 117: uint8(5), 118: uint8(6), 119: uint8(7), 120: uint8(8), 121: uint8(9), } /* *------------------------------------------------------------------------- * * LoadEscapeEncoding -- * * Helper function for LoadEncodingTable(). Loads a state machine that * converts between Unicode and some other encoding. * * File contains text data that describes the escape sequences that are * used to choose an encoding and the associated names for the * sub-encodings. * * Results: * The return value is the new encoding, or NULL if the encoding could * not be created (because the file contained invalid data). * * Side effects: * None. * *------------------------------------------------------------------------- */ func _LoadEscapeEncoding(tls *libc.TLS, name uintptr, chan1 TTcl_Channel) (r TTcl_Encoding) { bp := tls.Alloc(608) defer tls.Free(608) /* File containing new encoding. */ var dataPtr, e, line uintptr var i int32 var size uint32 var _ /* argc at bp+304 */ TTcl_Size var _ /* argv at bp+312 */ uintptr var _ /* escapeData at bp+0 */ TTcl_DString var _ /* est at bp+544 */ TEscapeSubTable var _ /* final at bp+240 */ [16]uint8 var _ /* init at bp+224 */ [16]uint8 var _ /* lineString at bp+320 */ TTcl_DString var _ /* type at bp+256 */ TTcl_EncodingType _, _, _, _, _ = dataPtr, e, i, line, size (*(*[16]uint8)(unsafe.Pointer(bp + 224)))[0] = uint8('\000') (*(*[16]uint8)(unsafe.Pointer(bp + 240)))[0] = uint8('\000') XTcl_DStringInit(tls, bp) for int32(1) != 0 { XTcl_DStringInit(tls, bp+320) if XTcl_Gets(tls, chan1, bp+320) < 0 { break } line = (*TTcl_DString)(unsafe.Pointer(bp + 320)).Fstring1 if XTcl_SplitList(tls, libc.UintptrFromInt32(0), line, bp+304, bp+312) != TCL_OK { XTcl_DStringFree(tls, bp+320) continue } if *(*TTcl_Size)(unsafe.Pointer(bp + 304)) >= int64(2) { if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)))), __ccgo_ts+3726) == 0 { /* do nothing */ } else { if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)))), __ccgo_ts+29360) == 0 { libc.Xstrncpy(tls, bp+224, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + 1*8)), uint64(16)) (*(*[16]uint8)(unsafe.Pointer(bp + 224)))[libc.Uint64FromInt64(16)-libc.Uint64FromInt32(1)] = uint8('\000') } else { if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)))), __ccgo_ts+29365) == 0 { libc.Xstrncpy(tls, bp+240, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + 1*8)), uint64(16)) (*(*[16]uint8)(unsafe.Pointer(bp + 240)))[libc.Uint64FromInt64(16)-libc.Uint64FromInt32(1)] = uint8('\000') } else { libc.Xstrncpy(tls, bp+544+4, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)) + 1*8)), uint64(16)) *(*uint8)(unsafe.Pointer(bp + 544 + 4 + uintptr(libc.Uint64FromInt64(16)-libc.Uint64FromInt32(1)))) = uint8('\000') (*(*TEscapeSubTable)(unsafe.Pointer(bp + 544))).FsequenceLen = uint32(libc.Xstrlen(tls, bp+544+4)) libc.Xstrncpy(tls, bp+544+20, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 312)))), uint64(32)) *(*uint8)(unsafe.Pointer(bp + 544 + 20 + uintptr(libc.Uint64FromInt64(32)-libc.Uint64FromInt32(1)))) = uint8('\000') /* * To avoid infinite recursion in [encoding system iso2022-*] */ e = XTcl_GetEncoding(tls, libc.UintptrFromInt32(0), bp+544+20) if e != libc.UintptrFromInt32(0) && (*TEncoding)(unsafe.Pointer(e)).FtoUtfProc != __ccgo_fp(_TableToUtfProc) && (*TEncoding)(unsafe.Pointer(e)).FtoUtfProc != __ccgo_fp(_Iso88591ToUtfProc) { XTcl_FreeEncoding(tls, e) e = libc.UintptrFromInt32(0) } (*(*TEscapeSubTable)(unsafe.Pointer(bp + 544))).FencodingPtr = e XTcl_DStringAppend(tls, bp, bp+544, int64(64)) } } } } XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 312))) XTcl_DStringFree(tls, bp+320) } size = uint32(uint64(libc.UintptrFromInt32(0)+304) + libc.Uint64FromInt64((*TTcl_DString)(unsafe.Pointer(bp)).Flength)) dataPtr = XTcl_Alloc(tls, uint64(size)) (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen = uint32(libc.Xstrlen(tls, bp+224)) libc.Xmemcpy(tls, dataPtr+8, bp+224, uint64((*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen+uint32(1))) (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen = uint32(libc.Xstrlen(tls, bp+240)) libc.Xmemcpy(tls, dataPtr+28, bp+240, uint64((*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen+uint32(1))) (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables = libc.Int32FromUint64(libc.Uint64FromInt64((*TTcl_DString)(unsafe.Pointer(bp)).Flength) / uint64(64)) libc.Xmemcpy(tls, dataPtr+304, (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1, libc.Uint64FromInt64((*TTcl_DString)(unsafe.Pointer(bp)).Flength)) XTcl_DStringFree(tls, bp) libc.Xmemset(tls, dataPtr+44, 0, uint64(256)) i = 0 for { if !(i < (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables) { break } *(*uint8)(unsafe.Pointer(dataPtr + 44 + uintptr(*(*uint8)(unsafe.Pointer(dataPtr + 304 + uintptr(i)*64 + 4))))) = uint8(1) goto _1 _1: ; i++ } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(dataPtr + 8))) != int32('\000') { *(*uint8)(unsafe.Pointer(dataPtr + 44 + uintptr(*(*uint8)(unsafe.Pointer(dataPtr + 8))))) = uint8(1) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(dataPtr + 28))) != int32('\000') { *(*uint8)(unsafe.Pointer(dataPtr + 44 + uintptr(*(*uint8)(unsafe.Pointer(dataPtr + 28))))) = uint8(1) } /* * Package everything into an encoding structure. */ (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 256))).FencodingName = name (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 256))).FtoUtfProc = __ccgo_fp(_EscapeToUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 256))).FfromUtfProc = __ccgo_fp(_EscapeFromUtfProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 256))).FfreeProc = __ccgo_fp(_EscapeFreeProc) (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 256))).FnullSize = int64(1) (*(*TTcl_EncodingType)(unsafe.Pointer(bp + 256))).FclientData = dataPtr return XTcl_CreateEncoding(tls, bp+256) } /* *------------------------------------------------------------------------- * * BinaryProc -- * * The default conversion when no other conversion is specified. No * translation is done; source bytes are copied directly to destination * bytes. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _BinaryProc(tls *libc.TLS, dummy2363 uintptr, src uintptr, srcLen int32, flags int32, dummy2367 uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var result int32 _ = result result = TCL_OK dstLen -= libc.Int32FromInt32(TCL_UTF_MAX) - libc.Int32FromInt32(1) if dstLen < 0 { dstLen = 0 } if flags&int32(TCL_ENCODING_CHAR_LIMIT) != 0 && srcLen > *(*int32)(unsafe.Pointer(dstCharsPtr)) { srcLen = *(*int32)(unsafe.Pointer(dstCharsPtr)) } if srcLen > dstLen { srcLen = dstLen result = -int32(4) } *(*int32)(unsafe.Pointer(srcReadPtr)) = srcLen *(*int32)(unsafe.Pointer(dstWrotePtr)) = srcLen *(*int32)(unsafe.Pointer(dstCharsPtr)) = srcLen libc.Xmemcpy(tls, dst, src, libc.Uint64FromInt32(srcLen)) return result } /* *------------------------------------------------------------------------- * * UtfToUtfProc -- * * Converts from UTF-8 to UTF-8. Note that the UTF-8 to UTF-8 translation * is not a no-op, because it turns a stream of improperly formed * UTF-8 into a properly-formed stream. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _UtfToUtfProc(tls *libc.TLS, clientData uintptr, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var charLimit, numChars, profile, result, v1, v16, v17, v18, v19, v6 int32 var dstEnd, dstStart, saveSrc, srcClose, srcEnd, srcStart, v10, v11, v12, v13, v14, v15, v3, v4, v5, v7 uintptr var high, high1, high2, high3, savedSurrogate TTcl_UniChar var len1 Tsize_t var v9 int64 var _ /* ch at bp+0 */ int32 var _ /* chbuf at bp+4 */ [2]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = charLimit, dstEnd, dstStart, high, high1, high2, high3, len1, numChars, profile, result, saveSrc, savedSurrogate, srcClose, srcEnd, srcStart, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v3, v4, v5, v6, v7, v9 charLimit = int32(INT_MAX) if flags&int32(TCL_ENCODING_START) != 0 { /* *statePtr will hold high surrogate in a split surrogate pair */ *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(0) } result = TCL_OK srcStart = src srcEnd = src + uintptr(srcLen) srcClose = srcEnd if flags&int32(TCL_ENCODING_END) == 0 { srcClose -= uintptr(6) } if flags&int32(TCL_ENCODING_CHAR_LIMIT) != 0 { charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr)) } dstStart = dst flags = int32(int64(flags) | int64(clientData)) /* * If output is UTF-8 or encoding for Tcl's internal encoding, * max space needed is TCL_UTF_MAX. Otherwise, need 6 bytes (CESU-8) */ if flags&(int32(ENCODING_INPUT)|int32(ENCODING_UTF)) != 0 { v1 = int32(TCL_UTF_MAX) } else { v1 = int32(6) } dstEnd = dst + uintptr(dstLen) - uintptr(v1) /* * Macro to output an isolated high surrogate when it is not followed * by a low surrogate. NOT to be called for strict profile since * that should raise an error. */ /* * Macro to check for isolated surrogate and either break with * an error if profile is strict, or output an appropriate * character for replace and tcl8 profiles and continue. */ profile = libc.Int32FromUint32(libc.Uint32FromInt32(flags) & libc.Uint32FromUint32(ENCODING_PROFILE_MASK)) numChars = 0 for { if !(src < srcEnd && numChars <= charLimit) { break } if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int64(srcEnd)-int64(src)) != 0) { /* * If there is more string to follow, this will ensure that the * last UTF-8 character in the source buffer hasn't been cut off. */ result = -int32(1) break } if dst > dstEnd { result = -int32(4) break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) < int32(0x80) && !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) == 0 && flags&int32(ENCODING_INPUT) != 0) { if *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) != 0 { if !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) break } if libc.Uint32FromInt32(profile)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { high = int32(UNICODE_REPLACE_CHAR) } else { high = int32(int64(*(*TTcl_EncodingState)(unsafe.Pointer(statePtr)))) } dst += uintptr(XTcl_UniCharToUtf(tls, high, dst)) *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(0) /* Reset state */ goto _2 /* Rerun loop so length checks etc. repeated */ } else { } /* * Copy 7bit characters, but skip null-bytes when we are in input * mode, so that they get converted to \xC0\x80. */ v3 = dst dst++ v4 = src src++ *(*uint8)(unsafe.Pointer(v3)) = *(*uint8)(unsafe.Pointer(v4)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) == int32(0xC0) && src+uintptr(1) < srcEnd && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src + 1))) == int32(0x80) && (!(flags&int32(ENCODING_INPUT) != 0) || !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8))) { /* Special sequence \xC0\x80 */ if *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) != 0 { if !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) break } if libc.Uint32FromInt32(profile)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { high1 = int32(UNICODE_REPLACE_CHAR) } else { high1 = int32(int64(*(*TTcl_EncodingState)(unsafe.Pointer(statePtr)))) } dst += uintptr(XTcl_UniCharToUtf(tls, high1, dst)) *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(0) /* Reset state */ goto _2 /* Rerun loop so length checks etc. repeated */ } else { } if !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && flags&int32(ENCODING_INPUT) != 0 { if libc.Uint32FromInt32(profile)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { dst += uintptr(XTcl_UniCharToUtf(tls, int32(UNICODE_REPLACE_CHAR), dst)) src += uintptr(2) } else { /* PROFILE_STRICT */ result = -int32(2) break } } else { /* * Convert 0xC080 to real nulls when we are in output mode, * irrespective of the profile. */ v5 = dst dst++ *(*uint8)(unsafe.Pointer(v5)) = uint8(0) src += uintptr(2) } } else { if !(XTcl_UtfCharComplete(tls, src, int64(srcEnd)-int64(src)) != 0) { /* * Incomplete byte sequence not because there are insufficient * bytes in source buffer (have already checked that above) but * because the UTF-8 sequence is truncated. */ if *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) != 0 { if !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) break } if libc.Uint32FromInt32(profile)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { high2 = int32(UNICODE_REPLACE_CHAR) } else { high2 = int32(int64(*(*TTcl_EncodingState)(unsafe.Pointer(statePtr)))) } dst += uintptr(XTcl_UniCharToUtf(tls, high2, dst)) *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(0) /* Reset state */ goto _2 /* Rerun loop so length checks etc. repeated */ } else { } if flags&int32(ENCODING_INPUT) != 0 { /* Incomplete bytes for modified UTF-8 target */ if !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { if flags&int32(TCL_ENCODING_CHAR_LIMIT) != 0 { v6 = -int32(1) } else { v6 = -int32(2) } result = v6 break } } if libc.Uint32FromInt32(profile)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(UNICODE_REPLACE_CHAR) src++ } else { v7 = src src++ (*(*[2]uint8)(unsafe.Pointer(bp + 4)))[0] = *(*uint8)(unsafe.Pointer(v7)) (*(*[2]uint8)(unsafe.Pointer(bp + 4)))[int32(1)] = uint8(0) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp + 4))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp + 4))) _ = libc.Int32FromInt32(1) } else { XTcl_UtfToUniChar(tls, bp+4, bp) } } dst += uintptr(XTcl_UniCharToUtf(tls, *(*int32)(unsafe.Pointer(bp)), dst)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) v9 = int64(libc.Int32FromInt32(1)) } else { v9 = XTcl_UtfToUniChar(tls, src, bp) } /* Have a complete character */ len1 = libc.Uint64FromInt64(v9) savedSurrogate = int32(int64(*(*TTcl_EncodingState)(unsafe.Pointer(statePtr)))) *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(0) /* Reset surrogate */ if flags&int32(ENCODING_INPUT) != 0 { if len1 < uint64(2) && *(*int32)(unsafe.Pointer(bp)) != 0 || *(*int32)(unsafe.Pointer(bp)) > int32(0xFFFF) && !(flags&int32(ENCODING_UTF) != 0) { if !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) break } else { if libc.Uint32FromInt32(profile)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(UNICODE_REPLACE_CHAR) } } } } saveSrc = src src += uintptr(len1) if !(flags&int32(ENCODING_UTF) != 0) && !(flags&int32(ENCODING_INPUT) != 0) && *(*int32)(unsafe.Pointer(bp)) > int32(0x7FF) { /* Since this flag combo will never set *statePtr */ if *(*int32)(unsafe.Pointer(bp)) > int32(0xFFFF) { /* CESU-8 6-byte sequence for chars > U+FFFF */ *(*int32)(unsafe.Pointer(bp)) -= int32(0x10000) v10 = dst dst++ *(*uint8)(unsafe.Pointer(v10)) = uint8(0xED) v11 = dst dst++ *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp))>>libc.Int32FromInt32(16)&libc.Int32FromInt32(0x0F) | libc.Int32FromInt32(0xA0)) v12 = dst dst++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp))>>libc.Int32FromInt32(10)&libc.Int32FromInt32(0x3F) | libc.Int32FromInt32(0x80)) *(*int32)(unsafe.Pointer(bp)) = *(*int32)(unsafe.Pointer(bp))&int32(0x03FF) | int32(0xDC00) } v13 = dst dst++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32((*(*int32)(unsafe.Pointer(bp))>>libc.Int32FromInt32(12) | libc.Int32FromInt32(0xE0)) & libc.Int32FromInt32(0xEF)) v14 = dst dst++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32((*(*int32)(unsafe.Pointer(bp))>>libc.Int32FromInt32(6) | libc.Int32FromInt32(0x80)) & libc.Int32FromInt32(0xBF)) v15 = dst dst++ *(*uint8)(unsafe.Pointer(v15)) = libc.Uint8FromInt32((*(*int32)(unsafe.Pointer(bp)) | libc.Int32FromInt32(0x80)) & libc.Int32FromInt32(0xBF)) goto _2 } else { if *(*int32)(unsafe.Pointer(bp)) & ^libc.Int32FromInt32(0x7FF) == int32(0xD800) { if flags&int32(ENCODING_UTF) != 0 { /* UTF-8, not CESU-8, so surrogates should not appear */ if !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(profile)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { if flags&int32(ENCODING_INPUT) != 0 { v16 = -int32(2) } else { v16 = -int32(3) } result = v16 src = saveSrc break } else { if libc.Uint32FromInt32(profile)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(UNICODE_REPLACE_CHAR) } else { /* PROFILE_TCL8 - output as is */ } } } else { /* CESU-8 */ if *(*int32)(unsafe.Pointer(bp)) & ^libc.Int32FromInt32(0x3FF) == int32(0xDC00) { if savedSurrogate != 0 { *(*int32)(unsafe.Pointer(bp)) = int32(0x10000) + (savedSurrogate-int32(0xd800))< dstEnd { result = -int32(4) break } if flags&int32(TCL_ENCODING_LE) != 0 { ch = libc.Int32FromUint32(libc.Uint32FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src + 3)))&libc.Int32FromInt32(0xFF))< uint32(0x10FFFF) { if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) break } ch = int32(UNICODE_REPLACE_CHAR) } else { if ch & ^libc.Int32FromInt32(0x7FF) == int32(0xD800) { if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) break } if libc.Uint32FromInt32(flags)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { ch = int32(UNICODE_REPLACE_CHAR) } } } /* * Special case for 1-byte utf chars for speed. Make sure we work with * unsigned short-size data. */ if libc.Uint32FromInt32(ch)-uint32(1) < uint32(0x7F) { v2 = dst dst++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(ch & libc.Int32FromInt32(0xFF)) } else { dst += uintptr(XTcl_UniCharToUtf(tls, ch, dst)) } src += uintptr(4) goto _1 _1: ; numChars++ } if flags&int32(TCL_ENCODING_END) != 0 && result == -int32(1) { /* We have a code fragment left-over at the end */ if dst > dstEnd { result = -int32(4) } else { /* destination is not full, so we really are at the end now */ if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) } else { /* PROFILE_REPLACE or PROFILE_TCL8 */ result = TCL_OK dst += uintptr(XTcl_UniCharToUtf(tls, int32(UNICODE_REPLACE_CHAR), dst)) numChars++ src += uintptr(bytesLeft) /* Go past truncated code unit */ } } } *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *------------------------------------------------------------------------- * * UtfToUtf32Proc -- * * Convert from UTF-8 to UTF-32. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _UtfToUtf32Proc(tls *libc.TLS, clientData uintptr, src uintptr, srcLen int32, flags int32, dummy2878 uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var dstEnd, dstStart, srcClose, srcEnd, srcStart, v10, v3, v4, v5, v6, v7, v8, v9 uintptr var len1, numChars, result int32 var v2 int64 var _ /* ch at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dstEnd, dstStart, len1, numChars, result, srcClose, srcEnd, srcStart, v10, v2, v3, v4, v5, v6, v7, v8, v9 srcStart = src srcEnd = src + uintptr(srcLen) srcClose = srcEnd if flags&int32(TCL_ENCODING_END) == 0 { srcClose -= uintptr(TCL_UTF_MAX) } dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(4) flags = int32(int64(flags) | int64(clientData)) result = TCL_OK numChars = 0 for { if !(src < srcEnd) { break } if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int64(srcEnd)-int64(src)) != 0) { /* * If there is more string to follow, this will ensure that the * last UTF-8 character in the source buffer hasn't been cut off. */ result = -int32(1) break } if dst > dstEnd { result = -int32(4) break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) v2 = int64(libc.Int32FromInt32(1)) } else { v2 = XTcl_UtfToUniChar(tls, src, bp) } len1 = int32(v2) if *(*int32)(unsafe.Pointer(bp)) & ^libc.Int32FromInt32(0x7FF) == int32(0xD800) { if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(3) break } if libc.Uint32FromInt32(flags)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(UNICODE_REPLACE_CHAR) } } src += uintptr(len1) if flags&int32(TCL_ENCODING_LE) != 0 { v3 = dst dst++ *(*uint8)(unsafe.Pointer(v3)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0xFF)) v4 = dst dst++ *(*uint8)(unsafe.Pointer(v4)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8) & libc.Int32FromInt32(0xFF)) v5 = dst dst++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(16) & libc.Int32FromInt32(0xFF)) v6 = dst dst++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(24) & libc.Int32FromInt32(0xFF)) } else { v7 = dst dst++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(24) & libc.Int32FromInt32(0xFF)) v8 = dst dst++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(16) & libc.Int32FromInt32(0xFF)) v9 = dst dst++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8) & libc.Int32FromInt32(0xFF)) v10 = dst dst++ *(*uint8)(unsafe.Pointer(v10)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0xFF)) } goto _1 _1: ; numChars++ } *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *------------------------------------------------------------------------- * * Utf16ToUtfProc -- * * Convert from UTF-16 to UTF-8. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _Utf16ToUtfProc(tls *libc.TLS, clientData uintptr, src uintptr, srcLen int32, flags int32, dummy2977 uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var ch, prev uint16 var charLimit, numChars, result int32 var dstEnd, dstStart, srcEnd, srcStart, v2 uintptr _, _, _, _, _, _, _, _, _, _ = ch, charLimit, dstEnd, dstStart, numChars, prev, result, srcEnd, srcStart, v2 charLimit = int32(INT_MAX) ch = uint16(0) flags = int32(int64(flags) | int64(clientData)) if flags&int32(TCL_ENCODING_CHAR_LIMIT) != 0 { charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr)) } result = TCL_OK /* * Check alignment with utf-16 (2 == sizeof(UTF-16)) */ if srcLen%int32(2) != 0 { result = -int32(1) srcLen-- } srcStart = src srcEnd = src + uintptr(srcLen) dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(TCL_UTF_MAX) numChars = 0 for { if !(src < srcEnd && numChars <= charLimit) { break } if dst > dstEnd && !(libc.Int32FromUint16(ch) & ^libc.Int32FromInt32(0x3FF) == libc.Int32FromInt32(0xD800)) { result = -int32(4) break } prev = ch if flags&int32(TCL_ENCODING_LE) != 0 { ch = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src + 1)))&int32(0xFF)< dstEnd { result = -int32(4) } else { if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) } else { /* PROFILE_REPLACE or PROFILE_TCL8 */ result = TCL_OK dst += uintptr(XTcl_UniCharToUtf(tls, int32(UNICODE_REPLACE_CHAR), dst)) numChars++ src++ } } } } case -int32(2): break /* Nothing to do */ } *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *------------------------------------------------------------------------- * * UtfToUtf16Proc -- * * Convert from UTF-8 to UTF-16. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _UtfToUtf16Proc(tls *libc.TLS, clientData uintptr, src uintptr, srcLen int32, flags int32, dummy3215 uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var dstEnd, dstStart, srcClose, srcEnd, srcStart, v10, v11, v12, v13, v14, v3, v4, v5, v6, v7, v8, v9 uintptr var len1, numChars, result int32 var v2 int64 var _ /* ch at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dstEnd, dstStart, len1, numChars, result, srcClose, srcEnd, srcStart, v10, v11, v12, v13, v14, v2, v3, v4, v5, v6, v7, v8, v9 srcStart = src srcEnd = src + uintptr(srcLen) srcClose = srcEnd if flags&int32(TCL_ENCODING_END) == 0 { srcClose -= uintptr(TCL_UTF_MAX) } dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(2) /* 2 -> sizeof a UTF-16 code unit */ flags = int32(int64(flags) | int64(clientData)) result = TCL_OK numChars = 0 for { if !(src < srcEnd) { break } if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int64(srcEnd)-int64(src)) != 0) { /* * If there is more string to follow, this will ensure that the * last UTF-8 character in the source buffer hasn't been cut off. */ result = -int32(1) break } if dst > dstEnd { result = -int32(4) break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) < int32(0x80) { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) v2 = int64(libc.Int32FromInt32(1)) } else { v2 = XTcl_UtfToUniChar(tls, src, bp) } len1 = int32(v2) if *(*int32)(unsafe.Pointer(bp)) & ^libc.Int32FromInt32(0x7FF) == int32(0xD800) { if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(3) break } if libc.Uint32FromInt32(flags)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(UNICODE_REPLACE_CHAR) } } if *(*int32)(unsafe.Pointer(bp)) <= int32(0xFFFF) { if flags&int32(TCL_ENCODING_LE) != 0 { v3 = dst dst++ *(*uint8)(unsafe.Pointer(v3)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0xFF)) v4 = dst dst++ *(*uint8)(unsafe.Pointer(v4)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8)) } else { v5 = dst dst++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8)) v6 = dst dst++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0xFF)) } } else { if dst+uintptr(2) > dstEnd { /* Surrogates need 2 more bytes! Bug [66da4d4228] */ result = -int32(4) break } if flags&int32(TCL_ENCODING_LE) != 0 { v7 = dst dst++ *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32((*(*int32)(unsafe.Pointer(bp)) - libc.Int32FromInt32(0x10000)) >> libc.Int32FromInt32(10) & libc.Int32FromInt32(0xFF)) v8 = dst dst++ *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32((*(*int32)(unsafe.Pointer(bp))-int32(0x10000))>>int32(18)&int32(0x3) | int32(0xD8)) v9 = dst dst++ *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0xFF)) v10 = dst dst++ *(*uint8)(unsafe.Pointer(v10)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp))>>int32(8)&int32(0x3) | int32(0xDC)) } else { v11 = dst dst++ *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32((*(*int32)(unsafe.Pointer(bp))-int32(0x10000))>>int32(18)&int32(0x3) | int32(0xD8)) v12 = dst dst++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32((*(*int32)(unsafe.Pointer(bp)) - libc.Int32FromInt32(0x10000)) >> libc.Int32FromInt32(10) & libc.Int32FromInt32(0xFF)) v13 = dst dst++ *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp))>>int32(8)&int32(0x3) | int32(0xDC)) v14 = dst dst++ *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0xFF)) } } src += uintptr(len1) goto _1 _1: ; numChars++ } *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *------------------------------------------------------------------------- * * UtfToUcs2Proc -- * * Convert from UTF-8 to UCS-2. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _UtfToUcs2Proc(tls *libc.TLS, clientData uintptr, src uintptr, srcLen int32, flags int32, dummy3328 uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var dstEnd, dstStart, srcClose, srcEnd, srcStart, v3, v4, v5, v6 uintptr var len1, numChars, result int32 var v2 int64 var _ /* ch at bp+0 */ TTcl_UniChar _, _, _, _, _, _, _, _, _, _, _, _, _ = dstEnd, dstStart, len1, numChars, result, srcClose, srcEnd, srcStart, v2, v3, v4, v5, v6 *(*TTcl_UniChar)(unsafe.Pointer(bp)) = 0 flags = int32(int64(flags) | int64(clientData)) srcStart = src srcEnd = src + uintptr(srcLen) srcClose = srcEnd if flags&int32(TCL_ENCODING_END) == 0 { srcClose -= uintptr(TCL_UTF_MAX) } dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(2) /* 2 - size of UCS code unit */ result = TCL_OK numChars = 0 for { if !(src < srcEnd) { break } if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int64(srcEnd)-int64(src)) != 0) { /* * If there is more string to follow, this will ensure that the * last UTF-8 character in the source buffer hasn't been cut off. */ result = -int32(1) break } if dst > dstEnd { result = -int32(4) break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) v2 = int64(libc.Int32FromInt32(1)) } else { v2 = XTcl_UtfToUniChar(tls, src, bp) } len1 = int32(v2) if *(*TTcl_UniChar)(unsafe.Pointer(bp)) > int32(0xFFFF) { if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(3) break } *(*TTcl_UniChar)(unsafe.Pointer(bp)) = int32(UNICODE_REPLACE_CHAR) } if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) && *(*TTcl_UniChar)(unsafe.Pointer(bp)) & ^libc.Int32FromInt32(0x7FF) == int32(0xD800) { result = -int32(2) break } src += uintptr(len1) /* * Need to handle this in a way that won't cause misalignment by * casting dst to a Tcl_UniChar. [Bug 1122671] */ if flags&int32(TCL_ENCODING_LE) != 0 { v3 = dst dst++ *(*uint8)(unsafe.Pointer(v3)) = libc.Uint8FromInt32(*(*TTcl_UniChar)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0xFF)) v4 = dst dst++ *(*uint8)(unsafe.Pointer(v4)) = libc.Uint8FromInt32(*(*TTcl_UniChar)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8)) } else { v5 = dst dst++ *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(*(*TTcl_UniChar)(unsafe.Pointer(bp)) >> libc.Int32FromInt32(8)) v6 = dst dst++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(*(*TTcl_UniChar)(unsafe.Pointer(bp)) & libc.Int32FromInt32(0xFF)) } goto _1 _1: ; numChars++ } *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *------------------------------------------------------------------------- * * TableToUtfProc -- * * Convert from the encoding specified by the TableEncodingData into * UTF-8. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _TableToUtfProc(tls *libc.TLS, clientData uintptr, src uintptr, srcLen int32, flags int32, dummy3433 uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var byte1, charLimit, numChars, result int32 var dataPtr, dstEnd, dstStart, pageZero, prefixBytes, srcEnd, srcStart, toUnicode, v2, v4 uintptr var _ /* ch at bp+0 */ TTcl_UniChar var _ /* chbuf at bp+4 */ [2]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _ = byte1, charLimit, dataPtr, dstEnd, dstStart, numChars, pageZero, prefixBytes, result, srcEnd, srcStart, toUnicode, v2, v4 charLimit = int32(INT_MAX) *(*TTcl_UniChar)(unsafe.Pointer(bp)) = 0 dataPtr = clientData if flags&int32(TCL_ENCODING_CHAR_LIMIT) != 0 { charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr)) } srcStart = src srcEnd = src + uintptr(srcLen) dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(TCL_UTF_MAX) toUnicode = (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode prefixBytes = dataPtr + 4 pageZero = *(*uintptr)(unsafe.Pointer(toUnicode)) result = TCL_OK numChars = 0 for { if !(src < srcEnd && numChars <= charLimit) { break } if dst > dstEnd { result = -int32(4) break } byte1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) if *(*uint8)(unsafe.Pointer(prefixBytes + uintptr(byte1))) != 0 { if src >= srcEnd-uintptr(1) { /* Prefix byte but nothing after it */ if !(flags&libc.Int32FromInt32(TCL_ENCODING_END) != 0) { /* More data to come */ result = -int32(1) break } else { if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) break } else { if libc.Uint32FromInt32(flags)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = int32(UNICODE_REPLACE_CHAR) } else { /* For prefix bytes, we don't fallback to cp1252, see [1355b9a874] */ *(*TTcl_UniChar)(unsafe.Pointer(bp)) = byte1 } } } } else { src++ v2 = src *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(toUnicode + uintptr(byte1)*8)) + uintptr(*(*uint8)(unsafe.Pointer(v2)))*2))) } } else { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(pageZero + uintptr(byte1)*2))) } if *(*TTcl_UniChar)(unsafe.Pointer(bp)) == 0 && byte1 != 0 { /* Prefix+suffix pair is invalid */ if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) break } if *(*uint8)(unsafe.Pointer(prefixBytes + uintptr(byte1))) != 0 { src-- } if libc.Uint32FromInt32(flags)&uint32(ENCODING_PROFILE_MASK) == uint32(TCL_ENCODING_PROFILE_REPLACE) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = int32(UNICODE_REPLACE_CHAR) } else { (*(*[2]uint8)(unsafe.Pointer(bp + 4)))[0] = libc.Uint8FromInt32(byte1) (*(*[2]uint8)(unsafe.Pointer(bp + 4)))[int32(1)] = uint8(0) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp + 4))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bp + 4))) _ = libc.Int32FromInt32(1) } else { XTcl_UtfToUniChar(tls, bp+4, bp) } } } /* * Special case for 1-byte Utf chars for speed. */ if libc.Uint32FromInt32(*(*TTcl_UniChar)(unsafe.Pointer(bp)))-uint32(1) < uint32(0x7F) { v4 = dst dst++ *(*uint8)(unsafe.Pointer(v4)) = libc.Uint8FromInt32(*(*TTcl_UniChar)(unsafe.Pointer(bp))) } else { dst += uintptr(XTcl_UniCharToUtf(tls, *(*TTcl_UniChar)(unsafe.Pointer(bp)), dst)) } src++ goto _1 _1: ; numChars++ } *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *------------------------------------------------------------------------- * * TableFromUtfProc -- * * Convert from UTF-8 into the encoding specified by the * TableEncodingData. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _TableFromUtfProc(tls *libc.TLS, clientData uintptr, src uintptr, srcLen int32, flags int32, dummy3561 uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var dataPtr, dstEnd, dstStart, fromUnicode, prefixBytes, srcClose, srcEnd, srcStart uintptr var len1, numChars, result, word int32 var v2 int64 var _ /* ch at bp+0 */ TTcl_UniChar _, _, _, _, _, _, _, _, _, _, _, _, _ = dataPtr, dstEnd, dstStart, fromUnicode, len1, numChars, prefixBytes, result, srcClose, srcEnd, srcStart, word, v2 *(*TTcl_UniChar)(unsafe.Pointer(bp)) = 0 dataPtr = clientData result = TCL_OK prefixBytes = dataPtr + 4 fromUnicode = (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode srcStart = src srcEnd = src + uintptr(srcLen) srcClose = srcEnd if flags&int32(TCL_ENCODING_END) == 0 { srcClose -= uintptr(TCL_UTF_MAX) } dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(1) numChars = 0 for { if !(src < srcEnd) { break } if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int64(srcEnd)-int64(src)) != 0) { /* * If there is more string to follow, this will ensure that the * last UTF-8 character in the source buffer hasn't been cut off. */ result = -int32(1) break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) v2 = int64(libc.Int32FromInt32(1)) } else { v2 = XTcl_UtfToUniChar(tls, src, bp) } len1 = int32(v2) /* Unicode chars > +U0FFFF cannot be represented in any table encoding */ if libc.Uint32FromInt32(*(*TTcl_UniChar)(unsafe.Pointer(bp)))&uint32(0xFFFF0000) != 0 { word = 0 } else { word = libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromUnicode + uintptr(*(*TTcl_UniChar)(unsafe.Pointer(bp))>>libc.Int32FromInt32(8))*8)) + uintptr(*(*TTcl_UniChar)(unsafe.Pointer(bp))&int32(0xFF))*2))) } if word == 0 && *(*TTcl_UniChar)(unsafe.Pointer(bp)) != 0 { if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(3) break } word = (*TTableEncodingData)(unsafe.Pointer(dataPtr)).Ffallback /* Both profiles REPLACE and TCL8 */ } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(prefixBytes + uintptr(word>>libc.Int32FromInt32(8))))) != 0 { if dst+uintptr(1) > dstEnd { result = -int32(4) break } *(*uint8)(unsafe.Pointer(dst)) = libc.Uint8FromInt32(word >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(dst + 1)) = libc.Uint8FromInt32(word) dst += uintptr(2) } else { if dst > dstEnd { result = -int32(4) break } *(*uint8)(unsafe.Pointer(dst)) = libc.Uint8FromInt32(word) dst++ } src += uintptr(len1) goto _1 _1: ; numChars++ } *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *------------------------------------------------------------------------- * * Iso88591ToUtfProc -- * * Convert from the "iso8859-1" encoding into UTF-8. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _Iso88591ToUtfProc(tls *libc.TLS, dummy3669 uintptr, src uintptr, srcLen int32, flags int32, dummy3673 uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var ch TTcl_UniChar var charLimit, numChars, result int32 var dstEnd, dstStart, srcEnd, srcStart, v2 uintptr _, _, _, _, _, _, _, _, _ = ch, charLimit, dstEnd, dstStart, numChars, result, srcEnd, srcStart, v2 charLimit = int32(INT_MAX) if flags&int32(TCL_ENCODING_CHAR_LIMIT) != 0 { charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr)) } srcStart = src srcEnd = src + uintptr(srcLen) dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(TCL_UTF_MAX) result = TCL_OK numChars = 0 for { if !(src < srcEnd && numChars <= charLimit) { break } ch = 0 if dst > dstEnd { result = -int32(4) break } ch = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) /* * Special case for 1-byte utf chars for speed. */ if libc.Uint32FromInt32(ch)-uint32(1) < uint32(0x7F) { v2 = dst dst++ *(*uint8)(unsafe.Pointer(v2)) = libc.Uint8FromInt32(ch) } else { dst += uintptr(XTcl_UniCharToUtf(tls, ch, dst)) } src++ goto _1 _1: ; numChars++ } *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *------------------------------------------------------------------------- * * Iso88591FromUtfProc -- * * Convert from UTF-8 into the encoding "iso8859-1". * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _Iso88591FromUtfProc(tls *libc.TLS, dummy3749 uintptr, src uintptr, srcLen int32, flags int32, dummy3753 uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var dstEnd, dstStart, srcClose, srcEnd, srcStart, v3 uintptr var len1, numChars, result int32 var v2 int64 var _ /* ch at bp+0 */ TTcl_UniChar _, _, _, _, _, _, _, _, _, _ = dstEnd, dstStart, len1, numChars, result, srcClose, srcEnd, srcStart, v2, v3 result = TCL_OK *(*TTcl_UniChar)(unsafe.Pointer(bp)) = 0 srcStart = src srcEnd = src + uintptr(srcLen) srcClose = srcEnd if flags&int32(TCL_ENCODING_END) == 0 { srcClose -= uintptr(TCL_UTF_MAX) } dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(1) numChars = 0 for { if !(src < srcEnd) { break } if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int64(srcEnd)-int64(src)) != 0) { /* * If there is more string to follow, this will ensure that the * last UTF-8 character in the source buffer hasn't been cut off. */ result = -int32(1) break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) v2 = int64(libc.Int32FromInt32(1)) } else { v2 = XTcl_UtfToUniChar(tls, src, bp) } len1 = int32(v2) /* * Check for illegal characters. */ if *(*TTcl_UniChar)(unsafe.Pointer(bp)) > int32(0xFF) { if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(3) break } /* * Plunge on, using '?' as a fallback character. */ *(*TTcl_UniChar)(unsafe.Pointer(bp)) = int32('?') /* Profiles TCL8 and REPLACE */ } if dst > dstEnd { result = -int32(4) break } v3 = dst dst++ *(*uint8)(unsafe.Pointer(v3)) = libc.Uint8FromInt32(*(*TTcl_UniChar)(unsafe.Pointer(bp))) src += uintptr(len1) goto _1 _1: ; numChars++ } *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *--------------------------------------------------------------------------- * * TableFreeProc -- * * This function is invoked when an encoding is deleted. It deletes the * memory used by the TableEncodingData. * * Results: * None. * * Side effects: * Memory freed. * *--------------------------------------------------------------------------- */ func _TableFreeProc(tls *libc.TLS, clientData uintptr) { /* TableEncodingData that specifies * encoding. */ var dataPtr uintptr _ = dataPtr dataPtr = clientData /* * Make sure we aren't freeing twice on shutdown. [Bug 219314] */ XTclpFree(tls, (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode) (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FtoUnicode = libc.UintptrFromInt32(0) XTclpFree(tls, (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode) (*TTableEncodingData)(unsafe.Pointer(dataPtr)).FfromUnicode = libc.UintptrFromInt32(0) XTclpFree(tls, dataPtr) } /* *------------------------------------------------------------------------- * * EscapeToUtfProc -- * * Convert from the encoding specified by the EscapeEncodingData into * UTF-8. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _EscapeToUtfProc(tls *libc.TLS, clientData uintptr, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var byte1, ch, charLimit, checked, hi, i, lo, numChars, result, state int32 var dataPtr, dstEnd, dstStart, encodingPtr, prefixBytes, srcEnd, srcStart, subTablePtr, tableDataPtr, tablePrefixBytes, tableToUnicode uintptr var left, len1, longest, skip, v3 uint32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = byte1, ch, charLimit, checked, dataPtr, dstEnd, dstStart, encodingPtr, hi, i, left, len1, lo, longest, numChars, prefixBytes, result, skip, srcEnd, srcStart, state, subTablePtr, tableDataPtr, tablePrefixBytes, tableToUnicode, v3 dataPtr = clientData charLimit = int32(INT_MAX) if flags&int32(TCL_ENCODING_CHAR_LIMIT) != 0 { charLimit = *(*int32)(unsafe.Pointer(dstCharsPtr)) } result = TCL_OK tablePrefixBytes = libc.UintptrFromInt32(0) tableToUnicode = libc.UintptrFromInt32(0) prefixBytes = dataPtr + 44 encodingPtr = libc.UintptrFromInt32(0) srcStart = src srcEnd = src + uintptr(srcLen) dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(TCL_UTF_MAX) state = int32(int64(*(*TTcl_EncodingState)(unsafe.Pointer(statePtr)))) if flags&int32(TCL_ENCODING_START) != 0 { state = 0 } numChars = 0 for { if !(src < srcEnd && numChars <= charLimit) { break } if dst > dstEnd { result = -int32(4) break } byte1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) if *(*uint8)(unsafe.Pointer(prefixBytes + uintptr(byte1))) != 0 { /* * Saw the beginning of an escape sequence. */ left = libc.Uint32FromInt64(int64(srcEnd) - int64(src)) len1 = (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen longest = len1 checked = 0 if len1 <= left { checked++ if len1 > uint32(0) && libc.Xmemcmp(tls, src, dataPtr+8, uint64(len1)) == 0 { /* * If we see initialization string, skip it, even if we're * not at the beginning of the buffer. */ src += uintptr(len1) goto _1 } } len1 = (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen if len1 > longest { longest = len1 } if len1 <= left { checked++ if len1 > uint32(0) && libc.Xmemcmp(tls, src, dataPtr+28, uint64(len1)) == 0 { /* * If we see finalization string, skip it, even if we're * not at the end of the buffer. */ src += uintptr(len1) goto _1 } } subTablePtr = dataPtr + 304 i = 0 for { if !(i < (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables) { break } len1 = (*TEscapeSubTable)(unsafe.Pointer(subTablePtr)).FsequenceLen if len1 > longest { longest = len1 } if len1 <= left { checked++ if len1 > uint32(0) && libc.Xmemcmp(tls, src, subTablePtr+4, uint64(len1)) == 0 { state = i encodingPtr = libc.UintptrFromInt32(0) subTablePtr = libc.UintptrFromInt32(0) src += uintptr(len1) break } } subTablePtr += 64 goto _2 _2: ; i++ } if subTablePtr == libc.UintptrFromInt32(0) { /* * A match was found, the escape sequence was consumed, and * the state was updated. */ goto _1 } /* * We have a split-up or unrecognized escape sequence. If we * checked all the sequences, then it's a syntax error, otherwise * we need more bytes to determine a match. */ if checked == (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables+int32(2) || flags&int32(TCL_ENCODING_END) != 0 { if !(!(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE))) { if longest > left { v3 = left } else { v3 = longest } skip = v3 /* Unknown escape sequence */ dst += uintptr(XTcl_UniCharToUtf(tls, int32(UNICODE_REPLACE_CHAR), dst)) src += uintptr(skip) goto _1 } result = -int32(2) } else { result = -int32(1) } break } if encodingPtr == libc.UintptrFromInt32(0) { encodingPtr = _GetTableEncoding(tls, dataPtr, state) tableDataPtr = (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData tablePrefixBytes = tableDataPtr + 4 tableToUnicode = (*TTableEncodingData)(unsafe.Pointer(tableDataPtr)).FtoUnicode } if *(*uint8)(unsafe.Pointer(tablePrefixBytes + uintptr(byte1))) != 0 { src++ if src >= srcEnd { src-- result = -int32(1) break } hi = byte1 lo = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) } else { hi = 0 lo = byte1 } ch = libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tableToUnicode + uintptr(hi)*8)) + uintptr(lo)*2))) dst += uintptr(XTcl_UniCharToUtf(tls, ch, dst)) src++ numChars++ goto _1 _1: } *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(int64(state)) *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *------------------------------------------------------------------------- * * EscapeFromUtfProc -- * * Convert from UTF-8 into the encoding specified by the * EscapeEncodingData. * * Results: * Returns TCL_OK if conversion was successful. * * Side effects: * None. * *------------------------------------------------------------------------- */ func _EscapeFromUtfProc(tls *libc.TLS, clientData uintptr, src uintptr, srcLen int32, flags int32, statePtr uintptr, dst uintptr, dstLen int32, srcReadPtr uintptr, dstWrotePtr uintptr, dstCharsPtr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) /* Filled with the number of characters that * correspond to the bytes stored in the * output buffer. */ var dataPtr, dstEnd, dstStart, encodingPtr, srcClose, srcEnd, srcStart, subTablePtr, tableDataPtr, tableFromUnicode, tablePrefixBytes uintptr var len1, len11, v4 uint32 var numChars, oldState, result, state, word int32 var v2 int64 var _ /* ch at bp+0 */ TTcl_UniChar _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dataPtr, dstEnd, dstStart, encodingPtr, len1, len11, numChars, oldState, result, srcClose, srcEnd, srcStart, state, subTablePtr, tableDataPtr, tableFromUnicode, tablePrefixBytes, word, v2, v4 dataPtr = clientData *(*TTcl_UniChar)(unsafe.Pointer(bp)) = 0 result = TCL_OK srcStart = src srcEnd = src + uintptr(srcLen) srcClose = srcEnd if flags&int32(TCL_ENCODING_END) == 0 { srcClose -= uintptr(TCL_UTF_MAX) } dstStart = dst dstEnd = dst + uintptr(dstLen) - uintptr(1) /* * RFC 1468 states that the text starts in ASCII, and switches to Japanese * characters, and that the text must end in ASCII. [Patch 474358] */ if flags&int32(TCL_ENCODING_START) != 0 { state = 0 if dst+uintptr((*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen) > dstEnd { *(*int32)(unsafe.Pointer(srcReadPtr)) = 0 *(*int32)(unsafe.Pointer(dstWrotePtr)) = 0 return -int32(4) } libc.Xmemcpy(tls, dst, dataPtr+8, uint64((*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen)) dst += uintptr((*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FinitLen) } else { state = int32(int64(*(*TTcl_EncodingState)(unsafe.Pointer(statePtr)))) } encodingPtr = _GetTableEncoding(tls, dataPtr, state) tableDataPtr = (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData tablePrefixBytes = tableDataPtr + 4 tableFromUnicode = (*TTableEncodingData)(unsafe.Pointer(tableDataPtr)).FfromUnicode numChars = 0 for { if !(src < srcEnd) { break } if src > srcClose && !(XTcl_UtfCharComplete(tls, src, int64(srcEnd)-int64(src)) != 0) { /* * If there is more string to follow, this will ensure that the * last UTF-8 character in the source buffer hasn't been cut off. */ result = -int32(1) break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) < int32(0x80) { *(*TTcl_UniChar)(unsafe.Pointer(bp)) = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(src))) v2 = int64(libc.Int32FromInt32(1)) } else { v2 = XTcl_UtfToUniChar(tls, src, bp) } len1 = libc.Uint32FromInt64(v2) if *(*TTcl_UniChar)(unsafe.Pointer(bp)) > int32(0xFFFF) { /* Bug 201c7a3aa6 crash - tables are 256x256 (64K) */ if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(2) break } /* Will be encoded as encoding specific replacement below */ *(*TTcl_UniChar)(unsafe.Pointer(bp)) = int32(UNICODE_REPLACE_CHAR) } word = libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(tableFromUnicode + uintptr(*(*TTcl_UniChar)(unsafe.Pointer(bp))>>libc.Int32FromInt32(8))*8)) + uintptr(*(*TTcl_UniChar)(unsafe.Pointer(bp))&int32(0xFF))*2))) if word == 0 && *(*TTcl_UniChar)(unsafe.Pointer(bp)) != 0 { oldState = state state = 0 for { if !(state < (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables) { break } encodingPtr = _GetTableEncoding(tls, dataPtr, state) tableDataPtr = (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData word = libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TTableEncodingData)(unsafe.Pointer(tableDataPtr)).FfromUnicode + uintptr(*(*TTcl_UniChar)(unsafe.Pointer(bp))>>libc.Int32FromInt32(8))*8)) + uintptr(*(*TTcl_UniChar)(unsafe.Pointer(bp))&int32(0xFF))*2))) if word != 0 { break } goto _3 _3: ; state++ } if word == 0 { state = oldState if !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_TCL8)) && !(libc.Uint32FromInt32(flags)&libc.Uint32FromUint32(ENCODING_PROFILE_MASK) == libc.Uint32FromInt32(TCL_ENCODING_PROFILE_REPLACE)) { result = -int32(3) break } encodingPtr = _GetTableEncoding(tls, dataPtr, state) tableDataPtr = (*TEncoding)(unsafe.Pointer(encodingPtr)).FclientData word = (*TTableEncodingData)(unsafe.Pointer(tableDataPtr)).Ffallback } tablePrefixBytes = tableDataPtr + 4 tableFromUnicode = (*TTableEncodingData)(unsafe.Pointer(tableDataPtr)).FfromUnicode /* * The state variable has the value of oldState when word is 0. * In this case, the escape sequence should not be copied to dst * because the current character set is not changed. */ if state != oldState { subTablePtr = dataPtr + 304 + uintptr(state)*64 if dst+uintptr((*TEscapeSubTable)(unsafe.Pointer(subTablePtr)).FsequenceLen) > dstEnd { /* * If there is no space to write the escape sequence, the * state variable must be changed to the value of oldState * variable because this escape sequence must be written * in the next conversion. */ state = oldState result = -int32(4) break } libc.Xmemcpy(tls, dst, subTablePtr+4, uint64((*TEscapeSubTable)(unsafe.Pointer(subTablePtr)).FsequenceLen)) dst += uintptr((*TEscapeSubTable)(unsafe.Pointer(subTablePtr)).FsequenceLen) } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(tablePrefixBytes + uintptr(word>>libc.Int32FromInt32(8))))) != 0 { if dst+uintptr(1) > dstEnd { result = -int32(4) break } *(*uint8)(unsafe.Pointer(dst)) = libc.Uint8FromInt32(word >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(dst + 1)) = libc.Uint8FromInt32(word) dst += uintptr(2) } else { if dst > dstEnd { result = -int32(4) break } *(*uint8)(unsafe.Pointer(dst)) = libc.Uint8FromInt32(word) dst++ } src += uintptr(len1) goto _1 _1: ; numChars++ } if result == TCL_OK && flags&int32(TCL_ENCODING_END) != 0 { len11 = (*(*TEscapeSubTable)(unsafe.Pointer(dataPtr + 304))).FsequenceLen /* * Certain encodings like iso2022-jp need to write an escape sequence * after all characters have been converted. This logic checks that * enough room is available in the buffer for the escape bytes. The * TCL_ENCODING_END flag is cleared after a final escape sequence has * been added to the buffer so that another call to this method does * not attempt to append escape bytes a second time. */ if state != 0 { v4 = len11 } else { v4 = uint32(0) } if dst+uintptr((*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen)+uintptr(v4) > dstEnd { result = -int32(4) } else { if state != 0 { libc.Xmemcpy(tls, dst, dataPtr+304+4, uint64(len11)) dst += uintptr(len11) } libc.Xmemcpy(tls, dst, dataPtr+28, uint64((*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen)) dst += uintptr((*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FfinalLen) state &= ^libc.Int32FromInt32(TCL_ENCODING_END) } } *(*TTcl_EncodingState)(unsafe.Pointer(statePtr)) = uintptr(int64(state)) *(*int32)(unsafe.Pointer(srcReadPtr)) = int32(int64(src) - int64(srcStart)) *(*int32)(unsafe.Pointer(dstWrotePtr)) = int32(int64(dst) - int64(dstStart)) *(*int32)(unsafe.Pointer(dstCharsPtr)) = numChars return result } /* *--------------------------------------------------------------------------- * * EscapeFreeProc -- * * Frees resources used by the encoding. * * Results: * None. * * Side effects: * Memory is freed. * *--------------------------------------------------------------------------- */ func _EscapeFreeProc(tls *libc.TLS, clientData uintptr) { /* EscapeEncodingData that specifies * encoding. */ var dataPtr, subTablePtr uintptr var i int32 _, _, _ = dataPtr, i, subTablePtr dataPtr = clientData if dataPtr == libc.UintptrFromInt32(0) { return } /* * The subTables should be freed recursively in normal operation but not * during TclFinalizeEncodingSubsystem because they are also present as a * weak reference in the toplevel encodingTable (i.e., they don't have a * +1 refcount for this), and unpredictable nuking order could remove them * from under the following loop's feet. [Bug 2891556] * * The encodingsInitialized flag, being reset on entry to TFES, can serve * as a "not in finalization" test. */ if _encodingsInitialized != 0 { subTablePtr = dataPtr + 304 i = 0 for { if !(i < (*TEscapeEncodingData)(unsafe.Pointer(dataPtr)).FnumSubTables) { break } _FreeEncoding(tls, (*TEscapeSubTable)(unsafe.Pointer(subTablePtr)).FencodingPtr) (*TEscapeSubTable)(unsafe.Pointer(subTablePtr)).FencodingPtr = libc.UintptrFromInt32(0) subTablePtr += 64 goto _1 _1: ; i++ } } XTclpFree(tls, dataPtr) } /* *--------------------------------------------------------------------------- * * GetTableEncoding -- * * Helper function for the EscapeEncodingData conversions. Gets the * encoding (of type TextEncodingData) that represents the specified * state. * * Results: * The return value is the encoding. * * Side effects: * If the encoding that represents the specified state has not already * been used by this EscapeEncoding, it will be loaded and cached in the * dataPtr. * *--------------------------------------------------------------------------- */ func _GetTableEncoding(tls *libc.TLS, dataPtr uintptr, state int32) (r uintptr) { /* Index in dataPtr of desired Encoding. */ var encodingPtr, subTablePtr uintptr _, _ = encodingPtr, subTablePtr subTablePtr = dataPtr + 304 + uintptr(state)*64 encodingPtr = (*TEscapeSubTable)(unsafe.Pointer(subTablePtr)).FencodingPtr if encodingPtr == libc.UintptrFromInt32(0) { encodingPtr = XTcl_GetEncoding(tls, libc.UintptrFromInt32(0), subTablePtr+20) if encodingPtr == libc.UintptrFromInt32(0) || (*TEncoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc != __ccgo_fp(_TableToUtfProc) && (*TEncoding)(unsafe.Pointer(encodingPtr)).FtoUtfProc != __ccgo_fp(_Iso88591ToUtfProc) { XTcl_Panic(tls, __ccgo_ts+29371, 0) } (*TEscapeSubTable)(unsafe.Pointer(subTablePtr)).FencodingPtr = encodingPtr } return encodingPtr } /* *--------------------------------------------------------------------------- * * unilen, unilen4 -- * * A helper function for the Tcl_ExternalToUtf functions. This function * is similar to strlen for double-byte characters: it returns the number * of bytes in a 0x0000 terminated string. * * Results: * As above. * * Side effects: * None. * *--------------------------------------------------------------------------- */ func _unilen(tls *libc.TLS, src uintptr) (r Tsize_t) { var p uintptr _ = p p = src for libc.Int32FromUint16(*(*uint16)(unsafe.Pointer(p))) != 0x0000 { p += 2 } return libc.Uint64FromInt64(int64(p) - int64(src)) } func _unilen4(tls *libc.TLS, src uintptr) (r Tsize_t) { var p uintptr _ = p p = src for *(*uint32)(unsafe.Pointer(p)) != uint32(0x00000000) { p += 4 } return libc.Uint64FromInt64(int64(p) - int64(src)) } /* *------------------------------------------------------------------------- * * InitializeEncodingSearchPath -- * * This is the fallback routine that sets the default value of the * encoding search path if the application has not set one via a call to * Tcl_SetEncodingSearchPath() by the first time the search path is needed * to load encoding data. * * The default encoding search path is produced by taking each directory * in the library path, appending a subdirectory named "encoding", and if * the resulting directory exists, adding it to the encoding search path. * * Results: * None. * * Side effects: * Sets the encoding search path to an initial value. * *------------------------------------------------------------------------- */ func _InitializeEncodingSearchPath(tls *libc.TLS, valuePtr uintptr, lengthPtr uintptr, encodingPtr uintptr) { bp := tls.Alloc(176) defer tls.Free(176) var _objPtr, _objPtr1, _objPtr2, _objPtr3, bytes, cachePtr, cachePtr1, libPathObj, pathObj, searchPathObj, v11, v12, v14, v7, v9 uintptr var i, v10, v13, v6, v8 TTcl_Size var v1, v2 bool var v4 int64 var _ /* directoryObj at bp+24 */ uintptr var _ /* encodingObj at bp+16 */ uintptr var _ /* numBytes at bp+8 */ TTcl_Size var _ /* numDirs at bp+0 */ TTcl_Size var _ /* stat at bp+32 */ TTcl_StatBuf _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, bytes, cachePtr, cachePtr1, i, libPathObj, pathObj, searchPathObj, v1, v10, v11, v12, v13, v14, v2, v4, v6, v7, v8, v9 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(bp + 16)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount = 0 if libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes, __ccgo_ts+5615, libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes + uintptr(libc.Uint64FromInt64(9)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(9) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr = libc.UintptrFromInt32(0) if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { searchPathObj = XTclThreadAllocObj(tls) } else { searchPathObj = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(searchPathObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(searchPathObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(searchPathObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(searchPathObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(searchPathObj)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++ (*TTcl_Obj)(unsafe.Pointer(searchPathObj)).FrefCount++ libPathObj = XTclGetProcessGlobalValue(tls, uintptr(unsafe.Pointer(&_libraryPath))) (*TTcl_Obj)(unsafe.Pointer(libPathObj)).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(libPathObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(libPathObj + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(libPathObj + 32))).Fptr2)).FspanLength } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(libPathObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v4 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), libPathObj, bp) } i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp))) { break } XTcl_ListObjIndex(tls, libc.UintptrFromInt32(0), libPathObj, i, bp+24) pathObj = XTcl_FSJoinToPath(tls, *(*uintptr)(unsafe.Pointer(bp + 24)), int64(1), bp+16) (*TTcl_Obj)(unsafe.Pointer(pathObj)).FrefCount++ if 0 == XTcl_FSStat(tls, pathObj, bp+32) && (*(*TTcl_StatBuf)(unsafe.Pointer(bp + 32))).Fst_mode&uint32(S_IFMT) == uint32(S_IFDIR) { XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), searchPathObj, pathObj) } _objPtr = pathObj v7 = _objPtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr) } goto _5 _5: ; i++ } _objPtr1 = libPathObj v9 = _objPtr1 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr1) } _objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 16)) v11 = _objPtr2 v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if v10 <= int64(1) { XTclFreeObj(tls, _objPtr2) } *(*TTcl_Encoding)(unsafe.Pointer(encodingPtr)) = _libraryPath.Fencoding if *(*TTcl_Encoding)(unsafe.Pointer(encodingPtr)) != 0 { (*TEncoding)(unsafe.Pointer(*(*TTcl_Encoding)(unsafe.Pointer(encodingPtr)))).FrefCount++ } if (*TTcl_Obj)(unsafe.Pointer(searchPathObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = (*TTcl_Obj)(unsafe.Pointer(searchPathObj)).Flength v12 = (*TTcl_Obj)(unsafe.Pointer(searchPathObj)).Fbytes } else { v12 = XTcl_GetStringFromObj(tls, searchPathObj, bp+8) } bytes = v12 *(*Tsize_t)(unsafe.Pointer(lengthPtr)) = libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(valuePtr)) = XTcl_Alloc(tls, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8))+int64(1))) libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(valuePtr)), bytes, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 8))+int64(1))) _objPtr3 = searchPathObj v14 = _objPtr3 v13 = *(*TTcl_Size)(unsafe.Pointer(v14)) *(*TTcl_Size)(unsafe.Pointer(v14))-- if v13 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } // C documentation // // /* // *------------------------------------------------------------------------ // * // * TclEncodingProfileParseName -- // * // * Maps an encoding profile name to its integer equivalent. // * // * Results: // * TCL_OK on success or TCL_ERROR on failure. // * // * Side effects: // * Returns the profile enum value in *profilePtr // * // *------------------------------------------------------------------------ // */ func XTclEncodingProfileNameToId(tls *libc.TLS, interp uintptr, profileName uintptr, profilePtr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) /* Output */ var errorObj uintptr var i, numProfiles Tsize_t _, _, _ = errorObj, i, numProfiles numProfiles = libc.Uint64FromInt64(48) / libc.Uint64FromInt64(16) i = uint64(0) for { if !(i < numProfiles) { break } if !(libc.Xstrcmp(tls, profileName, _encodingProfiles[i].Fname) != 0) { *(*int32)(unsafe.Pointer(profilePtr)) = _encodingProfiles[i].Fvalue return TCL_OK } goto _1 _1: ; i++ } if interp != 0 { /* This code assumes at least two profiles :-) */ errorObj = XTcl_ObjPrintf(tls, __ccgo_ts+29406, libc.VaList(bp+8, profileName)) i = uint64(0) for { if !(i < numProfiles-uint64(1)) { break } XTcl_AppendStringsToObj(tls, errorObj, libc.VaList(bp+8, __ccgo_ts+14830, _encodingProfiles[i].Fname, __ccgo_ts+21659, libc.UintptrFromInt32(0))) goto _2 _2: ; i++ } XTcl_AppendStringsToObj(tls, errorObj, libc.VaList(bp+8, __ccgo_ts+29437, _encodingProfiles[numProfiles-uint64(1)].Fname, libc.UintptrFromInt32(0))) XTcl_SetObjResult(tls, interp, errorObj) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+15139, __ccgo_ts+29442, profileName, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } // C documentation // // /* // *------------------------------------------------------------------------ // * // * TclEncodingProfileValueToName -- // * // * Maps an encoding profile value to its name. // * // * Results: // * Pointer to the name or NULL on failure. Caller must not make // * not modify the string and must make a copy to hold on to it. // * // * Side effects: // * None. // *------------------------------------------------------------------------ // */ func XTclEncodingProfileIdToName(tls *libc.TLS, interp uintptr, profileValue int32) (r uintptr) { bp := tls.Alloc(48) defer tls.Free(48) /* Profile #define value */ var i Tsize_t _ = i i = uint64(0) for { if !(i < libc.Uint64FromInt64(48)/libc.Uint64FromInt64(16)) { break } if profileValue == _encodingProfiles[i].Fvalue { return _encodingProfiles[i].Fname } goto _1 _1: ; i++ } if interp != 0 { XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+29450, libc.VaList(bp+8, profileValue))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+15139, __ccgo_ts+29487, libc.UintptrFromInt32(0))) } return libc.UintptrFromInt32(0) } // C documentation // // /* // *------------------------------------------------------------------------ // * // * TclGetEncodingProfiles -- // * // * Get the list of supported encoding profiles. // * // * Results: // * None. // * // * Side effects: // * The list of profile names is stored in the interpreter result. // * // *------------------------------------------------------------------------ // */ func XTclGetEncodingProfiles(tls *libc.TLS, interp uintptr) { var i, n Tsize_t var objPtr uintptr _, _, _ = i, n, objPtr n = libc.Uint64FromInt64(48) / libc.Uint64FromInt64(16) objPtr = XTcl_NewListObj(tls, libc.Int64FromUint64(n), libc.UintptrFromInt32(0)) i = uint64(0) for { if !(i < n) { break } XTcl_ListObjAppendElement(tls, interp, objPtr, XTcl_NewStringObj(tls, _encodingProfiles[i].Fname, int64(-libc.Int32FromInt32(1)))) goto _1 _1: ; i++ } XTcl_SetObjResult(tls, interp, objPtr) } const PAGE_SIZE2 = 4096 /* * The lists of subcommands and options for the [namespace ensemble] command. */ var _ensembleSubcommands = [4]uintptr{ 0: __ccgo_ts + 29497, 1: __ccgo_ts + 26194, 2: __ccgo_ts + 5689, 3: libc.UintptrFromInt32(0), } type EnsSubcmds = int32 const ENS_CONFIG = 0 const ENS_CREATE = 1 const ENS_EXISTS = 2 var _ensembleCreateOptions = [7]uintptr{ 0: __ccgo_ts + 18236, 1: __ccgo_ts + 29507, 2: __ccgo_ts + 29512, 3: __ccgo_ts + 29524, 4: __ccgo_ts + 29534, 5: __ccgo_ts + 29547, 6: libc.UintptrFromInt32(0), } type EnsCreateOpts = int32 const CRT_CMD = 0 const CRT_MAP = 1 const CRT_PARAM = 2 const CRT_PREFIX = 3 const CRT_SUBCMDS = 4 const CRT_UNKNOWN = 5 var _ensembleConfigOptions = [7]uintptr{ 0: __ccgo_ts + 29507, 1: __ccgo_ts + 29556, 2: __ccgo_ts + 29512, 3: __ccgo_ts + 29524, 4: __ccgo_ts + 29534, 5: __ccgo_ts + 29547, 6: libc.UintptrFromInt32(0), } type EnsConfigOpts = int32 const CONF_MAP = 0 const CONF_NAMESPACE = 1 const CONF_PARAM = 2 const CONF_PREFIX = 3 const CONF_SUBCMDS = 4 const CONF_UNKNOWN = 5 /* * ensembleCmdType is a Tcl object type that contains a reference to an * ensemble subcommand, e.g. the "length" in [string length ab]. It is used * to cache the mapping between the subcommand itself and the real command * that implements it. */ var _ensembleCmdType = TTcl_ObjType{ Fname: __ccgo_ts + 29567, } func init() { p := unsafe.Pointer(&_ensembleCmdType) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_FreeEnsembleCmdRep) *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_DupEnsembleCmdRep) } /* * The internal rep for caching ensemble subcommand lookups and spelling * corrections. */ type TEnsembleCmdRep = struct { Fepoch TTcl_Size Ftoken uintptr Ffix uintptr FhPtr uintptr } /* *---------------------------------------------------------------------- * * TclNamespaceEnsembleCmd -- * * Invoked to implement the "namespace ensemble" command that creates and * manipulates ensembles built on top of namespaces. Handles the * following syntax: * * namespace ensemble name ?dictionary? * * Results: * Returns TCL_OK if successful, and TCL_ERROR if anything goes wrong. * * Side effects: * Creates the ensemble for the namespace if one did not previously * exist. Alternatively, alters the way that the ensemble's subcommand => * implementation prefix is configured. * *---------------------------------------------------------------------- */ func XTclNamespaceEnsembleCmd(tls *libc.TLS, dummy152 uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var nsPtr uintptr var token TTcl_Command var _ /* index at bp+0 */ EnsSubcmds _, _ = nsPtr, token nsPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr if nsPtr == libc.UintptrFromInt32(0) || (*TNamespace)(unsafe.Pointer(nsPtr)).Fflags&int32(NS_DEAD) != 0 { if !(XTcl_InterpDeleted(tls, interp) != 0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+29583, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+16, __ccgo_ts+2004, __ccgo_ts+29633, __ccgo_ts+29642, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } if objc < int32(2) { XTcl_WrongNumArgs(tls, interp, int64(1), objv, __ccgo_ts+29647) return int32(TCL_ERROR) } else { if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), uintptr(unsafe.Pointer(&_ensembleSubcommands)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+25008, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< int32(1)) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), uintptr(unsafe.Pointer(&_ensembleCreateOptions)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< 0 { v12 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } else { v12 = libc.UintptrFromInt32(0) } subcmdObj = v12 goto _1 _4: ; if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v14 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v14 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = v14 v13 = libc.Int32FromInt32(TCL_OK) } else { v13 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16) } if v13 != TCL_OK { goto error } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) > 0 { v15 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } else { v15 = libc.UintptrFromInt32(0) } paramObj = v15 goto _1 _5: ; patchedDict = libc.UintptrFromInt32(0) /* * Verify that the map is sensible. */ if XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+72, bp+56, bp+64, bp+96) != TCL_OK { goto error } else { if *(*int32)(unsafe.Pointer(bp + 96)) != 0 { mapObj = libc.UintptrFromInt32(0) goto _1 } } for cond := true; cond; cond = !(*(*int32)(unsafe.Pointer(bp + 96)) != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32))).Fptr2 != 0 { v17 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32))).Fptr2)).FspanStart } else { v17 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 104)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32))).Fptr1 + 40 + uintptr(v17)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32))).Fptr2 != 0 { v18 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32))).Fptr2)).FspanLength } else { v18 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 64)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = v18 v16 = libc.Int32FromInt32(TCL_OK) } else { v16 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 64)), bp+16, bp+104) } if v16 != TCL_OK { goto mapError } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) < int64(1) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+29761, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+128, __ccgo_ts+2004, __ccgo_ts+29633, __ccgo_ts+29821, libc.UintptrFromInt32(0))) goto mapError } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104)))))).Fbytes != 0 { v19 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104)))))).Fbytes } else { v19 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104)))), libc.UintptrFromInt32(0)) } cmd = v19 if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cmd))) == int32(':') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cmd + 1))) == int32(':')) { newList = XTcl_NewListObj(tls, *(*TTcl_Size)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 104))) *(*uintptr)(unsafe.Pointer(bp + 112)) = XTclNewNamespaceObj(tls, nsPtr) if (*TNamespace)(unsafe.Pointer(nsPtr)).FparentPtr != 0 { XTcl_AppendStringsToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 112)), libc.VaList(bp+128, __ccgo_ts+7650, libc.UintptrFromInt32(0))) } XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 112)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 104))))) XTcl_ListObjReplace(tls, libc.UintptrFromInt32(0), newList, 0, int64(1), int64(1), bp+112) if patchedDict == libc.UintptrFromInt32(0) { patchedDict = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) } XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), patchedDict, *(*uintptr)(unsafe.Pointer(bp + 56)), newList) } XTcl_DictObjNext(tls, bp+72, bp+56, bp+64, bp+96) } if allocatedMapFlag != 0 { _objPtr = mapObj v21 = _objPtr v20 = *(*TTcl_Size)(unsafe.Pointer(v21)) *(*TTcl_Size)(unsafe.Pointer(v21))-- if v20 <= int64(1) { XTclFreeObj(tls, _objPtr) } } if patchedDict != 0 { v22 = patchedDict } else { v22 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } mapObj = v22 if patchedDict != 0 { allocatedMapFlag = int32(1) } goto _1 goto mapError mapError: ; XTcl_DictObjDone(tls, bp+72) if patchedDict != 0 { _objPtr1 = patchedDict v24 = _objPtr1 v23 = *(*TTcl_Size)(unsafe.Pointer(v24)) *(*TTcl_Size)(unsafe.Pointer(v24))-- if v23 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } goto error _6: ; if XTcl_GetBoolFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp+48) != TCL_OK { goto error } goto _1 _7: ; if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v26 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v26 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = v26 v25 = libc.Int32FromInt32(TCL_OK) } else { v25 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+16) } if v25 != TCL_OK { goto error } if *(*TTcl_Size)(unsafe.Pointer(bp + 16)) > 0 { v27 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } else { v27 = libc.UintptrFromInt32(0) } unknownObj = v27 goto _1 _8: ; goto _1 _1: ; objc -= int32(2) objv += uintptr(2) * 8 } XTclGetNamespaceForQualName(tls, interp, name, cxtPtr, int32(TCL_CREATE_NS_IF_UNKNOWN), bp+32, bp, bp+8, bp+40) /* * Create the ensemble. Note that this might delete another ensemble * linked to the same namespace, so we must be careful. However, we * should be OK because we only link the namespace into the list once * we've created it (and after any deletions have occurred.) */ if *(*int32)(unsafe.Pointer(bp + 48)) != 0 { v28 = int32(TCL_ENSEMBLE_PREFIX) } else { v28 = 0 } token = XTclCreateEnsembleInNs(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 40)), *(*uintptr)(unsafe.Pointer(bp + 32)), nsPtr, v28) XTcl_SetEnsembleSubcommandList(tls, interp, token, subcmdObj) XTcl_SetEnsembleMappingDict(tls, interp, token, mapObj) XTcl_SetEnsembleUnknownHandler(tls, interp, token, unknownObj) XTcl_SetEnsembleParameterList(tls, interp, token, paramObj) return token goto error error: ; if allocatedMapFlag != 0 { _objPtr2 = mapObj v30 = _objPtr2 v29 = *(*TTcl_Size)(unsafe.Pointer(v30)) *(*TTcl_Size)(unsafe.Pointer(v30))-- if v29 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } return libc.UintptrFromInt32(0) } // C documentation // // /* // *---------------------------------------------------------------------- // * // * ReadOneEnsembleOption -- // * // * Core of implementation of "namespace ensemble configure" with just a // * single option name. // * // * Results: // * Tcl result code. Modifies the interpreter result. // * // * Side effects: // * None. // * // *---------------------------------------------------------------------- // */ func _ReadOneEnsembleOption(tls *libc.TLS, interp uintptr, token TTcl_Command, optionObj uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) /* The name of the option to read. */ var _ /* flags at bp+24 */ int32 var _ /* index at bp+8 */ EnsConfigOpts var _ /* namespacePtr at bp+16 */ uintptr var _ /* resultObj at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0) if XTcl_GetIndexFromObjStruct(tls, interp, optionObj, uintptr(unsafe.Pointer(&_ensembleConfigOptions)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< 0) { break } if XTcl_GetIndexFromObjStruct(tls, interp, *(*uintptr)(unsafe.Pointer(objv)), uintptr(unsafe.Pointer(&_ensembleConfigOptions)), libc.Int64FromUint64(libc.Uint64FromInt64(8)), __ccgo_ts+11057, libc.Int32FromInt32(0)|libc.Int32FromUint64(libc.Uint64FromInt64(4)< 0 { v11 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } else { v11 = libc.UintptrFromInt32(0) } *(*uintptr)(unsafe.Pointer(bp + 8)) = v11 goto _1 _3: ; if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v13 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v13 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v13 v12 = libc.Int32FromInt32(TCL_OK) } else { v12 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } if v12 != TCL_OK { goto freeMapAndError } if *(*TTcl_Size)(unsafe.Pointer(bp)) > 0 { v14 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } else { v14 = libc.UintptrFromInt32(0) } *(*uintptr)(unsafe.Pointer(bp + 24)) = v14 goto _1 _4: ; patchedDict = libc.UintptrFromInt32(0) nsPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr /* * Verify that the map is sensible. */ if XTcl_DictObjFirst(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp+48, bp+88, bp+40, bp+84) != TCL_OK { goto freeMapAndError } else { if *(*int32)(unsafe.Pointer(bp + 84)) != 0 { *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0) goto _1 } } for cond := true; cond; cond = !(*(*int32)(unsafe.Pointer(bp + 84)) != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2 != 0 { v16 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2)).FspanLength } else { v16 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v16 v15 = libc.Int32FromInt32(TCL_OK) } else { v15 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 40)), bp) } if v15 != TCL_OK { goto finishSearchAndError } if *(*TTcl_Size)(unsafe.Pointer(bp)) < int64(1) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+29761, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+120, __ccgo_ts+2004, __ccgo_ts+29633, __ccgo_ts+29821, libc.UintptrFromInt32(0))) goto finishSearchAndError } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2 != 0 { v18 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2)).FspanStart } else { v18 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 96)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr1 + 40 + uintptr(v18)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2 != 0 { v19 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr2)).FspanLength } else { v19 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v19 v17 = libc.Int32FromInt32(TCL_OK) } else { v17 = XTcl_ListObjGetElements(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 40)), bp, bp+96) } if v17 != TCL_OK { goto finishSearchAndError } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))))).Fbytes != 0 { v20 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))))).Fbytes } else { v20 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))), libc.UintptrFromInt32(0)) } cmd = v20 if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cmd))) == int32(':') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(cmd + 1))) == int32(':')) { newList = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) *(*uintptr)(unsafe.Pointer(bp + 104)) = XTclNewNamespaceObj(tls, nsPtr) if (*TNamespace)(unsafe.Pointer(nsPtr)).FparentPtr != 0 { XTcl_AppendStringsToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 104)), libc.VaList(bp+120, __ccgo_ts+7650, libc.UintptrFromInt32(0))) } XTcl_AppendObjToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 104)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96))))) XTcl_ListObjReplace(tls, libc.UintptrFromInt32(0), newList, 0, int64(1), int64(1), bp+104) if patchedDict == libc.UintptrFromInt32(0) { patchedDict = XTcl_DuplicateObj(tls, *(*uintptr)(unsafe.Pointer(objv + 1*8))) } XTcl_DictObjPut(tls, libc.UintptrFromInt32(0), patchedDict, *(*uintptr)(unsafe.Pointer(bp + 88)), newList) } XTcl_DictObjNext(tls, bp+48, bp+88, bp+40, bp+84) } if allocatedMapFlag != 0 { _objPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) v22 = _objPtr v21 = *(*TTcl_Size)(unsafe.Pointer(v22)) *(*TTcl_Size)(unsafe.Pointer(v22))-- if v21 <= int64(1) { XTclFreeObj(tls, _objPtr) } } if patchedDict != 0 { v23 = patchedDict } else { v23 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } *(*uintptr)(unsafe.Pointer(bp + 16)) = v23 if patchedDict != 0 { allocatedMapFlag = int32(1) } goto _1 goto finishSearchAndError finishSearchAndError: ; XTcl_DictObjDone(tls, bp+48) if patchedDict != 0 { _objPtr1 = patchedDict v25 = _objPtr1 v24 = *(*TTcl_Size)(unsafe.Pointer(v25)) *(*TTcl_Size)(unsafe.Pointer(v25))-- if v24 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } goto freeMapAndError _5: ; XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+29834, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+120, __ccgo_ts+2004, __ccgo_ts+29633, __ccgo_ts+29865, libc.UintptrFromInt32(0))) goto freeMapAndError _6: ; if XTcl_GetBoolFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), (libc.Int32FromInt32(TCL_NULL_OK)-libc.Int32FromInt32(2))&libc.Int32FromInt64(4), bp+72) != TCL_OK { goto freeMapAndError } goto _1 _7: ; if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2 != 0 { v27 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr2)).FspanLength } else { v27 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(objv + 1*8)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v27 v26 = libc.Int32FromInt32(TCL_OK) } else { v26 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(objv + 1*8)), bp) } if v26 != TCL_OK { goto freeMapAndError } if *(*TTcl_Size)(unsafe.Pointer(bp)) > 0 { v28 = *(*uintptr)(unsafe.Pointer(objv + 1*8)) } else { v28 = libc.UintptrFromInt32(0) } *(*uintptr)(unsafe.Pointer(bp + 32)) = v28 goto _1 _8: ; goto _1 _1: ; objc -= int32(2) objv += uintptr(2) * 8 } /* * Update the namespace now that we've finished the parsing stage. */ if *(*int32)(unsafe.Pointer(bp + 72)) != 0 { v29 = *(*int32)(unsafe.Pointer(bp + 76)) | int32(TCL_ENSEMBLE_PREFIX) } else { v29 = *(*int32)(unsafe.Pointer(bp + 76)) & ^libc.Int32FromInt32(TCL_ENSEMBLE_PREFIX) } *(*int32)(unsafe.Pointer(bp + 76)) = v29 XTcl_SetEnsembleSubcommandList(tls, interp, token, *(*uintptr)(unsafe.Pointer(bp + 8))) XTcl_SetEnsembleMappingDict(tls, interp, token, *(*uintptr)(unsafe.Pointer(bp + 16))) XTcl_SetEnsembleParameterList(tls, interp, token, *(*uintptr)(unsafe.Pointer(bp + 24))) XTcl_SetEnsembleUnknownHandler(tls, interp, token, *(*uintptr)(unsafe.Pointer(bp + 32))) XTcl_SetEnsembleFlags(tls, interp, token, *(*int32)(unsafe.Pointer(bp + 76))) return TCL_OK goto freeMapAndError freeMapAndError: ; if allocatedMapFlag != 0 { _objPtr2 = *(*uintptr)(unsafe.Pointer(bp + 16)) v31 = _objPtr2 v30 = *(*TTcl_Size)(unsafe.Pointer(v31)) *(*TTcl_Size)(unsafe.Pointer(v31))-- if v30 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * TclCreateEnsembleInNs -- * * Like Tcl_CreateEnsemble, but additionally accepts as an argument the * name of the namespace to create the command in. * *---------------------------------------------------------------------- */ func XTclCreateEnsembleInNs(tls *libc.TLS, interp uintptr, name uintptr, nameNsPtr uintptr, ensembleNsPtr uintptr, flags int32) (r TTcl_Command) { /* Whether we need exact matching and whether * we bytecode-compile the ensemble's uses. */ var ensemblePtr, nsPtr uintptr var token TTcl_Command _, _, _ = ensemblePtr, nsPtr, token nsPtr = ensembleNsPtr ensemblePtr = XTcl_Alloc(tls, uint64(192)) token = XTclNRCreateCommandInNs(tls, interp, name, nameNsPtr, __ccgo_fp(XTclEnsembleImplementationCmd), __ccgo_fp(_NsEnsembleImplementationCmdNR), ensemblePtr, __ccgo_fp(_DeleteEnsembleConfig)) if token == libc.UintptrFromInt32(0) { XTclpFree(tls, ensemblePtr) return libc.UintptrFromInt32(0) } (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr = nsPtr (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch = 0 XTcl_InitHashTable(tls, ensemblePtr+32, TCL_STRING_KEYS) (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr = libc.UintptrFromInt32(0) (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList = libc.UintptrFromInt32(0) (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict = libc.UintptrFromInt32(0) (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags = flags (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters = 0 (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList = libc.UintptrFromInt32(0) (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler = libc.UintptrFromInt32(0) (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken = token (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext = (*TNamespace)(unsafe.Pointer(nsPtr)).Fensembles (*TNamespace)(unsafe.Pointer(nsPtr)).Fensembles = ensemblePtr /* * Trigger an eventual recomputation of the ensemble command set. Note * that this is slightly tricky, as it means that we are not actually * counting the number of namespace export actions, but it is the simplest * way to go! */ (*TNamespace)(unsafe.Pointer(nsPtr)).FexportLookupEpoch++ if flags&int32(ENSEMBLE_COMPILE) != 0 { (*TCommand)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken)).FcompileProc = __ccgo_fp(XTclCompileEnsemble) } return (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken } /* *---------------------------------------------------------------------- * * Tcl_CreateEnsemble * * Create a simple ensemble attached to the given namespace. Deprecated * (internally) by TclCreateEnsembleInNs. * * Value * * The token for the command created. * * Effect * The ensemble is created and marked for compilation. * *---------------------------------------------------------------------- */ func XTcl_CreateEnsemble(tls *libc.TLS, interp uintptr, name uintptr, namespacePtr uintptr, flags int32) (r TTcl_Command) { bp := tls.Alloc(32) defer tls.Free(32) /* Whether we need exact matching and whether * we bytecode-compile the ensemble's uses. */ var nsPtr uintptr var _ /* actualNsPtr at bp+16 */ uintptr var _ /* altNsPtr at bp+8 */ uintptr var _ /* foundNsPtr at bp+0 */ uintptr var _ /* simpleName at bp+24 */ uintptr _ = nsPtr nsPtr = namespacePtr if nsPtr == libc.UintptrFromInt32(0) { nsPtr = (*TCallFrame)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FvarFramePtr)).FnsPtr } XTclGetNamespaceForQualName(tls, interp, name, nsPtr, int32(TCL_CREATE_NS_IF_UNKNOWN), bp, bp+8, bp+16, bp+24) return XTclCreateEnsembleInNs(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*uintptr)(unsafe.Pointer(bp)), nsPtr, flags) } // C documentation // // /* // *---------------------------------------------------------------------- // * // * GetEnsembleFromCommand -- // * // * Standard check to see if a command is an ensemble. // * // * Results: // * The ensemble implementation if the command is an ensemble. NULL if it // * isn't. // * // * Side effects: // * Reports an error in the interpreter (if non-NULL) if the command is // * not an ensemble. // * // *---------------------------------------------------------------------- // */ func _GetEnsembleFromCommand(tls *libc.TLS, interp uintptr, token TTcl_Command) (r uintptr) { bp := tls.Alloc(48) defer tls.Free(48) /* What to check for ensemble-ness. */ var cmdPtr uintptr _ = cmdPtr cmdPtr = token if (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc != __ccgo_fp(XTclEnsembleImplementationCmd) { if interp != libc.UintptrFromInt32(0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+29875, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+29633, __ccgo_ts+29902, libc.UintptrFromInt32(0))) } return libc.UintptrFromInt32(0) } return (*TCommand)(unsafe.Pointer(cmdPtr)).FobjClientData } // C documentation // // /* // *---------------------------------------------------------------------- // * // * BumpEpochIfNecessary -- // * // * Increments the compilation epoch if the (ensemble) command is one where // * changes would be seen by the compiler in some cases. // * // * Results: // * None. // * // * Side effects: // * May trigger later bytecode recompilations. // * // *---------------------------------------------------------------------- // */ func _BumpEpochIfNecessary(tls *libc.TLS, interp uintptr, token TTcl_Command) { /* The ensemble command to check. */ /* * Special hack to make compiling of [info exists] work when the * dictionary is modified. */ if (*TCommand)(unsafe.Pointer(token)).FcompileProc != libc.UintptrFromInt32(0) { (*TInterp)(unsafe.Pointer(interp)).FcompileEpoch++ } } /* *---------------------------------------------------------------------- * * Tcl_SetEnsembleSubcommandList -- * * Set the subcommand list for a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an ensemble * or the subcommand list - if non-NULL - is not a list). * * Side effects: * The ensemble is updated and marked for recompilation. * *---------------------------------------------------------------------- */ func XTcl_SetEnsembleSubcommandList(tls *libc.TLS, interp uintptr, token TTcl_Command, subcmdList uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cachePtr, ensemblePtr, oldList, v4 uintptr var v1 int32 var v2 int64 var v3 TTcl_Size var v5 bool var _ /* length at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _ = cachePtr, ensemblePtr, oldList, v1, v2, v3, v4, v5 ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if subcmdList != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(subcmdList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subcmdList + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subcmdList + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subcmdList + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, subcmdList, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp)) < int64(1) { subcmdList = libc.UintptrFromInt32(0) } } oldList = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList = subcmdList if subcmdList != libc.UintptrFromInt32(0) { (*TTcl_Obj)(unsafe.Pointer(subcmdList)).FrefCount++ } if oldList != libc.UintptrFromInt32(0) { v4 = oldList v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if !(v3 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(oldList)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(oldList)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(oldList)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(oldList)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(oldList)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(oldList)).Flength = int64(-libc.Int32FromInt32(1)) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, oldList) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldList + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldList (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, oldList) } } } /* * Trigger an eventual recomputation of the ensemble command set. Note * that this is slightly tricky, as it means that we are not actually * counting the number of namespace export actions, but it is the simplest * way to go! */ (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++ _BumpEpochIfNecessary(tls, interp, token) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_SetEnsembleParameterList -- * * Set the parameter list for a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an ensemble * or the parameter list - if non-NULL - is not a list). * * Side effects: * The ensemble is updated and marked for recompilation. * *---------------------------------------------------------------------- */ func XTcl_SetEnsembleParameterList(tls *libc.TLS, interp uintptr, token TTcl_Command, paramList uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cachePtr, ensemblePtr, oldList, v4 uintptr var v1 int32 var v2 int64 var v3 TTcl_Size var v5 bool var _ /* length at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _ = cachePtr, ensemblePtr, oldList, v1, v2, v3, v4, v5 ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if paramList == libc.UintptrFromInt32(0) { *(*TTcl_Size)(unsafe.Pointer(bp)) = 0 } else { if (*TTcl_Obj)(unsafe.Pointer(paramList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(paramList + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(paramList + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(paramList + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, paramList, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp)) < int64(1) { paramList = libc.UintptrFromInt32(0) } } oldList = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList = paramList if paramList != libc.UintptrFromInt32(0) { (*TTcl_Obj)(unsafe.Pointer(paramList)).FrefCount++ } if oldList != libc.UintptrFromInt32(0) { v4 = oldList v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if !(v3 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(oldList)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(oldList)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(oldList)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(oldList)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(oldList)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(oldList)).Flength = int64(-libc.Int32FromInt32(1)) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, oldList) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldList + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldList (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, oldList) } } } (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters = *(*TTcl_Size)(unsafe.Pointer(bp)) /* * Trigger an eventual recomputation of the ensemble command set. Note * that this is slightly tricky, as it means that we are not actually * counting the number of namespace export actions, but it is the simplest * way to go! */ (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++ _BumpEpochIfNecessary(tls, interp, token) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_SetEnsembleMappingDict -- * * Set the mapping dictionary for a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an ensemble * or the mapping - if non-NULL - is not a dict). * * Side effects: * The ensemble is updated and marked for recompilation. * *---------------------------------------------------------------------- */ func XTcl_SetEnsembleMappingDict(tls *libc.TLS, interp uintptr, token TTcl_Command, mapDict uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) var bytes, cachePtr, ensemblePtr, oldDict, v2, v4 uintptr var v3 TTcl_Size var v5 bool var _ /* cmdObjPtr at bp+48 */ uintptr var _ /* done at bp+8 */ int32 var _ /* search at bp+16 */ TTcl_DictSearch var _ /* size at bp+0 */ TTcl_Size var _ /* valuePtr at bp+40 */ uintptr _, _, _, _, _, _, _, _ = bytes, cachePtr, ensemblePtr, oldDict, v2, v3, v4, v5 ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if mapDict != libc.UintptrFromInt32(0) { if XTcl_DictObjSize(tls, interp, mapDict, bp) != TCL_OK { return int32(TCL_ERROR) } XTcl_DictObjFirst(tls, libc.UintptrFromInt32(0), mapDict, bp+16, libc.UintptrFromInt32(0), bp+40, bp+8) for { if !!(*(*int32)(unsafe.Pointer(bp + 8)) != 0) { break } if XTcl_ListObjIndex(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 40)), 0, bp+48) != TCL_OK { XTcl_DictObjDone(tls, bp+16) return int32(TCL_ERROR) } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)))).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)))).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 48)), libc.UintptrFromInt32(0)) } bytes = v2 if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes))) != int32(':') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(bytes + 1))) != int32(':') { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+29915, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+64, __ccgo_ts+2004, __ccgo_ts+29633, __ccgo_ts+29964, libc.UintptrFromInt32(0))) XTcl_DictObjDone(tls, bp+16) return int32(TCL_ERROR) } goto _1 _1: ; XTcl_DictObjNext(tls, bp+16, libc.UintptrFromInt32(0), bp+40, bp+8) } if *(*TTcl_Size)(unsafe.Pointer(bp)) < int64(1) { mapDict = libc.UintptrFromInt32(0) } } oldDict = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict = mapDict if mapDict != libc.UintptrFromInt32(0) { (*TTcl_Obj)(unsafe.Pointer(mapDict)).FrefCount++ } if oldDict != libc.UintptrFromInt32(0) { v4 = oldDict v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if !(v3 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(oldDict)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(oldDict)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(oldDict)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(oldDict)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(oldDict)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(oldDict)).Flength = int64(-libc.Int32FromInt32(1)) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, oldDict) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldDict + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldDict (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, oldDict) } } } /* * Trigger an eventual recomputation of the ensemble command set. Note * that this is slightly tricky, as it means that we are not actually * counting the number of namespace export actions, but it is the simplest * way to go! */ (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++ _BumpEpochIfNecessary(tls, interp, token) return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_SetEnsembleUnknownHandler -- * * Set the unknown handler for a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an ensemble * or the unknown handler - if non-NULL - is not a list). * * Side effects: * The ensemble is updated and marked for recompilation. * *---------------------------------------------------------------------- */ func XTcl_SetEnsembleUnknownHandler(tls *libc.TLS, interp uintptr, token TTcl_Command, unknownList uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cachePtr, ensemblePtr, oldList, v4 uintptr var v1 int32 var v2 int64 var v3 TTcl_Size var v5 bool var _ /* length at bp+0 */ TTcl_Size _, _, _, _, _, _, _, _ = cachePtr, ensemblePtr, oldList, v1, v2, v3, v4, v5 ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } if unknownList != libc.UintptrFromInt32(0) { if (*TTcl_Obj)(unsafe.Pointer(unknownList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownList + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownList + 32))).Fptr2)).FspanLength } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownList + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v2 v1 = libc.Int32FromInt32(TCL_OK) } else { v1 = XTcl_ListObjLength(tls, interp, unknownList, bp) } if v1 != TCL_OK { return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp)) < int64(1) { unknownList = libc.UintptrFromInt32(0) } } oldList = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler = unknownList if unknownList != libc.UintptrFromInt32(0) { (*TTcl_Obj)(unsafe.Pointer(unknownList)).FrefCount++ } if oldList != libc.UintptrFromInt32(0) { v4 = oldList v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if !(v3 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(oldList)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(oldList)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(oldList)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(oldList)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(oldList)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(oldList)).Flength = int64(-libc.Int32FromInt32(1)) if v5 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v5 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v5 || ((*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, oldList) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(oldList + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = oldList (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects++ } } else { XTclFreeObj(tls, oldList) } } } /* * Trigger an eventual recomputation of the ensemble command set. Note * that this is slightly tricky, as it means that we are not actually * counting the number of namespace export actions, but it is the simplest * way to go! */ (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++ return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_SetEnsembleFlags -- * * Set the flags for a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an * ensemble). * * Side effects: * The ensemble is updated and marked for recompilation. * *---------------------------------------------------------------------- */ func XTcl_SetEnsembleFlags(tls *libc.TLS, interp uintptr, token TTcl_Command, flags int32) (r int32) { var changedFlags int32 var ensemblePtr, v1 uintptr _, _, _ = changedFlags, ensemblePtr, v1 ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) changedFlags = flags ^ (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * This API refuses to set the ENSEMBLE_DEAD flag... */ *(*int32)(unsafe.Pointer(ensemblePtr + 144)) &= int32(ENSEMBLE_DEAD) *(*int32)(unsafe.Pointer(ensemblePtr + 144)) |= flags & ^libc.Int32FromInt32(ENSEMBLE_DEAD) /* * Trigger an eventual recomputation of the ensemble command set. Note * that this is slightly tricky, as it means that we are not actually * counting the number of namespace export actions, but it is the simplest * way to go! */ (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch++ /* * If the ENSEMBLE_COMPILE flag status was changed, install or remove the * compiler function and bump the interpreter's compilation epoch so that * bytecode gets regenerated. */ if changedFlags&int32(ENSEMBLE_COMPILE) != 0 { if flags&int32(ENSEMBLE_COMPILE) != 0 { v1 = __ccgo_fp(XTclCompileEnsemble) } else { v1 = libc.UintptrFromInt32(0) } (*TCommand)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken)).FcompileProc = v1 (*TInterp)(unsafe.Pointer(interp)).FcompileEpoch++ } return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_GetEnsembleSubcommandList -- * * Get the list of subcommands associated with a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an * ensemble). The list of subcommands is returned by updating the * variable pointed to by the last parameter (NULL if this is to be * derived from the mapping dictionary or the associated namespace's * exported commands). * * Side effects: * None * *---------------------------------------------------------------------- */ func XTcl_GetEnsembleSubcommandList(tls *libc.TLS, interp uintptr, token TTcl_Command, subcmdListPtr uintptr) (r int32) { var ensemblePtr uintptr _ = ensemblePtr ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(subcmdListPtr)) = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_GetEnsembleParameterList -- * * Get the list of parameters associated with a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an * ensemble). The list of parameters is returned by updating the * variable pointed to by the last parameter (NULL if there are * no parameters). * * Side effects: * None * *---------------------------------------------------------------------- */ func XTcl_GetEnsembleParameterList(tls *libc.TLS, interp uintptr, token TTcl_Command, paramListPtr uintptr) (r int32) { var ensemblePtr uintptr _ = ensemblePtr ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(paramListPtr)) = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_GetEnsembleMappingDict -- * * Get the command mapping dictionary associated with a particular * ensemble. * * Results: * Tcl result code (error if command token does not indicate an * ensemble). The mapping dict is returned by updating the variable * pointed to by the last parameter (NULL if none is installed). * * Side effects: * None * *---------------------------------------------------------------------- */ func XTcl_GetEnsembleMappingDict(tls *libc.TLS, interp uintptr, token TTcl_Command, mapDictPtr uintptr) (r int32) { var ensemblePtr uintptr _ = ensemblePtr ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(mapDictPtr)) = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_GetEnsembleUnknownHandler -- * * Get the unknown handler associated with a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an * ensemble). The unknown handler is returned by updating the variable * pointed to by the last parameter (NULL if no handler is installed). * * Side effects: * None * *---------------------------------------------------------------------- */ func XTcl_GetEnsembleUnknownHandler(tls *libc.TLS, interp uintptr, token TTcl_Command, unknownListPtr uintptr) (r int32) { var ensemblePtr uintptr _ = ensemblePtr ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(unknownListPtr)) = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_GetEnsembleFlags -- * * Get the flags for a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an * ensemble). The flags are returned by updating the variable pointed to * by the last parameter. * * Side effects: * None * *---------------------------------------------------------------------- */ func XTcl_GetEnsembleFlags(tls *libc.TLS, interp uintptr, token TTcl_Command, flagsPtr uintptr) (r int32) { var ensemblePtr uintptr _ = ensemblePtr ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*int32)(unsafe.Pointer(flagsPtr)) = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_GetEnsembleNamespace -- * * Get the namespace associated with a particular ensemble. * * Results: * Tcl result code (error if command token does not indicate an * ensemble). Namespace is returned by updating the variable pointed to * by the last parameter. * * Side effects: * None * *---------------------------------------------------------------------- */ func XTcl_GetEnsembleNamespace(tls *libc.TLS, interp uintptr, token TTcl_Command, namespacePtrPtr uintptr) (r int32) { var ensemblePtr uintptr _ = ensemblePtr ensemblePtr = _GetEnsembleFromCommand(tls, interp, token) if ensemblePtr == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } *(*uintptr)(unsafe.Pointer(namespacePtrPtr)) = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr return TCL_OK } /* *---------------------------------------------------------------------- * * Tcl_FindEnsemble -- * * Given a command name, get the ensemble token for it, allowing for * [namespace import]s. [Bug 1017022] * * Results: * The token for the ensemble command with the given name, or NULL if the * command either does not exist or is not an ensemble (when an error * message will be written into the interp if thats non-NULL). * * Side effects: * None * *---------------------------------------------------------------------- */ func XTcl_FindEnsemble(tls *libc.TLS, interp uintptr, cmdNameObj uintptr, flags int32) (r TTcl_Command) { bp := tls.Alloc(48) defer tls.Free(48) /* Either 0 or TCL_LEAVE_ERR_MSG; other flags * are probably not useful. */ var token TTcl_Command var v1, v2, v3 uintptr _, _, _, _ = token, v1, v2, v3 if (*TTcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes != 0 { v1 = (*TTcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes } else { v1 = XTcl_GetStringFromObj(tls, cmdNameObj, libc.UintptrFromInt32(0)) } token = XTcl_FindCommand(tls, interp, v1, libc.UintptrFromInt32(0), flags) if token == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } if (*TCommand)(unsafe.Pointer(token)).FobjProc != __ccgo_fp(XTclEnsembleImplementationCmd) { /* * Reuse existing infrastructure for following import link chains * rather than duplicating it. */ token = XTclGetOriginalCommand(tls, token) if token == libc.UintptrFromInt32(0) || (*TCommand)(unsafe.Pointer(token)).FobjProc != __ccgo_fp(XTclEnsembleImplementationCmd) { if flags&int32(TCL_LEAVE_ERR_MSG) != 0 { if (*TTcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes != 0 { v2 = (*TTcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes } else { v2 = XTcl_GetStringFromObj(tls, cmdNameObj, libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+29983, libc.VaList(bp+8, v2))) if (*TTcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(cmdNameObj)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, cmdNameObj, libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+8, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+29633, v3, libc.UintptrFromInt32(0))) } return libc.UintptrFromInt32(0) } } return token } /* *---------------------------------------------------------------------- * * Tcl_IsEnsemble -- * * Simple test for ensemble-hood that takes into account imported * ensemble commands as well. * * Results: * Boolean value * * Side effects: * None * *---------------------------------------------------------------------- */ func XTcl_IsEnsemble(tls *libc.TLS, token TTcl_Command) (r int32) { /* The command to check. */ var cmdPtr uintptr _ = cmdPtr cmdPtr = token if (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc == __ccgo_fp(XTclEnsembleImplementationCmd) { return int32(1) } cmdPtr = XTclGetOriginalCommand(tls, cmdPtr) if cmdPtr == libc.UintptrFromInt32(0) || (*TCommand)(unsafe.Pointer(cmdPtr)).FobjProc != __ccgo_fp(XTclEnsembleImplementationCmd) { return 0 } return int32(1) } /* *---------------------------------------------------------------------- * * TclMakeEnsemble -- * * Create an ensemble from a table of implementation commands. The * ensemble will be subject to (limited) compilation if any of the * implementation commands are compilable. * * The 'name' parameter may be a single command name or a list if * creating an ensemble subcommand (see the binary implementation). * * Currently, the TCL_ENSEMBLE_PREFIX ensemble flag is only used on * top-level ensemble commands. * * This code is not safe to run in Safe interpreter after user code has * executed. That's OK right now because it's just used to set up Tcl, * but it means we mustn't expose it at all, not even to Tk (until we can * hide commands in namespaces directly). * * Results: * Handle for the new ensemble, or NULL on failure. * * Side effects: * May advance the bytecode compilation epoch. * *---------------------------------------------------------------------- */ func XTclMakeEnsemble(tls *libc.TLS, interp uintptr, name uintptr, map1 uintptr) (r TTcl_Command) { bp := tls.Alloc(480) defer tls.Free(480) /* The subcommands to create */ var cachePtr, cachePtr1, cmdName, cmdPtr, mapDict, ns, toObj, v5, v6 uintptr var ensemble TTcl_Command var ensembleFlags, hiddenLen int32 var i TTcl_Size var v2, v4 bool var _ /* buf at bp+0 */ TTcl_DString var _ /* hiddenBuf at bp+224 */ TTcl_DString var _ /* nameCount at bp+456 */ TTcl_Size var _ /* nameParts at bp+448 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cmdName, cmdPtr, ensemble, ensembleFlags, hiddenLen, i, mapDict, ns, toObj, v2, v4, v5, v6 *(*uintptr)(unsafe.Pointer(bp + 448)) = libc.UintptrFromInt32(0) cmdName = libc.UintptrFromInt32(0) *(*TTcl_Size)(unsafe.Pointer(bp + 456)) = 0 ensembleFlags = 0 /* * Construct the path for the ensemble namespace and create it. */ XTcl_DStringInit(tls, bp) XTcl_DStringInit(tls, bp+224) XTcl_DStringAppend(tls, bp+224, __ccgo_ts+30015, libc.Int64FromUint64(libc.Uint64FromInt64(5)-libc.Uint64FromInt32(1))) XTcl_DStringAppend(tls, bp+224, name, int64(-libc.Int32FromInt32(1))) XTcl_DStringAppend(tls, bp+224, __ccgo_ts+21829, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1))) hiddenLen = int32((*TTcl_DString)(unsafe.Pointer(bp + 224)).Flength) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(name))) == int32(':') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(name + 1))) == int32(':') { /* * An absolute name, so use it directly. */ cmdName = name XTcl_DStringAppend(tls, bp, name, int64(-libc.Int32FromInt32(1))) ensembleFlags = int32(TCL_ENSEMBLE_PREFIX) } else { /* * Not an absolute name, so do munging of it. Note that this treats a * multi-word list differently to a single word. */ XTcl_DStringAppend(tls, bp, __ccgo_ts+23915, libc.Int64FromUint64(libc.Uint64FromInt64(6)-libc.Uint64FromInt32(1))) if XTcl_SplitList(tls, libc.UintptrFromInt32(0), name, bp+456, bp+448) != TCL_OK { XTcl_Panic(tls, __ccgo_ts+30020, libc.VaList(bp+472, name)) } i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 456))) { break } XTcl_DStringAppend(tls, bp, __ccgo_ts+7650, libc.Int64FromUint64(libc.Uint64FromInt64(3)-libc.Uint64FromInt32(1))) XTcl_DStringAppend(tls, bp, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 448)) + uintptr(i)*8)), int64(-libc.Int32FromInt32(1))) goto _1 _1: ; i++ } } ns = XTcl_FindNamespace(tls, interp, (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1, libc.UintptrFromInt32(0), int32(TCL_CREATE_NS_IF_UNKNOWN)) if !(ns != 0) { XTcl_Panic(tls, __ccgo_ts+30047, libc.VaList(bp+472, (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1)) } /* * Create the named ensemble in the correct namespace */ if cmdName == libc.UintptrFromInt32(0) { if *(*TTcl_Size)(unsafe.Pointer(bp + 456)) == int64(1) { ensembleFlags = int32(TCL_ENSEMBLE_PREFIX) cmdName = (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1 + uintptr(5) } else { ns = (*TTcl_Namespace)(unsafe.Pointer(ns)).FparentPtr cmdName = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 448)) + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 456))-int64(1))*8)) } } /* * Switch on compilation always for core ensembles now that we can do * nice bytecode things with them. Do it now. Waiting until later will * just cause pointless epoch bumps. */ ensembleFlags |= int32(ENSEMBLE_COMPILE) ensemble = XTcl_CreateEnsemble(tls, interp, cmdName, ns, ensembleFlags) /* * Create the ensemble mapping dictionary and the ensemble command procs. */ if ensemble != libc.UintptrFromInt32(0) { XTcl_DStringAppend(tls, bp, __ccgo_ts+7650, libc.Int64FromUint64(libc.Uint64FromInt64(3)-libc.Uint64FromInt32(1))) if v2 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v2 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { mapDict = XTclThreadAllocObj(tls) } else { mapDict = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(mapDict + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(mapDict)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(mapDict)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(mapDict)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(mapDict)).FtypePtr = libc.UintptrFromInt32(0) i = 0 for { if !((*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).Fname != libc.UintptrFromInt32(0)) { break } if v4 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v4 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v4 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { toObj = XTclThreadAllocObj(tls) } else { toObj = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(toObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(toObj)).FrefCount = 0 if (*TTcl_DString)(unsafe.Pointer(bp)).Flength == 0 { (*TTcl_Obj)(unsafe.Pointer(toObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(toObj)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(toObj)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64((*TTcl_DString)(unsafe.Pointer(bp)).Flength+libc.Int64FromUint32(1))) if (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1 != 0 { v5 = (*TTcl_DString)(unsafe.Pointer(bp)).Fstring1 } else { v5 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(toObj)).Fbytes, v5, libc.Uint64FromInt64((*TTcl_DString)(unsafe.Pointer(bp)).Flength)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(toObj)).Fbytes + uintptr((*TTcl_DString)(unsafe.Pointer(bp)).Flength))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(toObj)).Flength = (*TTcl_DString)(unsafe.Pointer(bp)).Flength } (*TTcl_Obj)(unsafe.Pointer(toObj)).FtypePtr = libc.UintptrFromInt32(0) XTcl_AppendToObj(tls, toObj, (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).Fname, int64(-libc.Int32FromInt32(1))) XTclDictPut(tls, libc.UintptrFromInt32(0), mapDict, (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).Fname, toObj) if (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).Fproc != 0 || (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).FnreProc != 0 { /* * If the command is unsafe, hide it when we're in a safe * interpreter. The code to do this is really hokey! It also * doesn't work properly yet; this function is always * currently called before the safe-interp flag is set so the * Tcl_IsSafe check fails. */ if (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).Funsafe != 0 && XTcl_IsSafe(tls, interp) != 0 { cmdPtr = XTcl_NRCreateCommand(tls, interp, __ccgo_ts+7297, (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).Fproc, (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).FnreProc, (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).FclientData, libc.UintptrFromInt32(0)) XTcl_DStringSetLength(tls, bp+224, int64(hiddenLen)) if XTcl_HideCommand(tls, interp, __ccgo_ts+7297, XTcl_DStringAppend(tls, bp+224, (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).Fname, int64(-libc.Int32FromInt32(1)))) != 0 { XTcl_Panic(tls, __ccgo_ts+7263, libc.VaList(bp+472, XTcl_GetStringFromObj(tls, XTcl_GetObjResult(tls, interp), libc.UintptrFromInt32(0)))) } /* don't compile unsafe subcommands in safe interp */ (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc = libc.UintptrFromInt32(0) } else { /* * Not hidden, so just create it. Yay! */ if (*TTcl_Obj)(unsafe.Pointer(toObj)).Fbytes != 0 { v6 = (*TTcl_Obj)(unsafe.Pointer(toObj)).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, toObj, libc.UintptrFromInt32(0)) } cmdPtr = XTcl_NRCreateCommand(tls, interp, v6, (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).Fproc, (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).FnreProc, (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).FclientData, libc.UintptrFromInt32(0)) (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc = (*(*TEnsembleImplMap)(unsafe.Pointer(map1 + uintptr(i)*48))).FcompileProc } } goto _3 _3: ; i++ } XTcl_SetEnsembleMappingDict(tls, interp, ensemble, mapDict) } XTcl_DStringFree(tls, bp) XTcl_DStringFree(tls, bp+224) if *(*uintptr)(unsafe.Pointer(bp + 448)) != libc.UintptrFromInt32(0) { XTclpFree(tls, *(*uintptr)(unsafe.Pointer(bp + 448))) } return ensemble } /* *---------------------------------------------------------------------- * * TclEnsembleImplementationCmd -- * * Implements an ensemble of commands (being those exported by a * namespace other than the global namespace) as a command with the same * (short) name as the namespace in the parent namespace. * * Results: * A standard Tcl result code. Will be TCL_ERROR if the command is not an * unambiguous prefix of any command exported by the ensemble's * namespace. * * Side effects: * Depends on the command within the namespace that gets executed. If the * ensemble itself returns TCL_ERROR, a descriptive error message will be * placed in the interpreter's result. * *---------------------------------------------------------------------- */ func XTclEnsembleImplementationCmd(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { return XTcl_NRCallObjProc(tls, interp, __ccgo_fp(_NsEnsembleImplementationCmdNR), clientData, int64(objc), objv) } func _NsEnsembleImplementationCmdNR(tls *libc.TLS, clientData uintptr, interp uintptr, objc int32, objv uintptr) (r int32) { bp := tls.Alloc(336) defer tls.Free(336) var _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr2, copyPtr, ensembleCmd, ensemblePtr, errorObj, fix, fullName, hPtr, irPtr, subObj, subcmdName, v1, v10, v18, v19, v2, v20, v21, v3, v4 uintptr var cmp, reparseCount, v16 int32 var i, i1, subIdx, tableLength, v9 TTcl_Size var v11, v12, v17, v8 bool var v14, v15, v7 int64 var _ /* _callbackPtr at bp+264 */ uintptr var _ /* _callbackPtr at bp+272 */ uintptr var _ /* buf at bp+8 */ TTcl_DString var _ /* copyObjc at bp+248 */ TTcl_Size var _ /* copyObjv at bp+240 */ uintptr var _ /* prefixObj at bp+0 */ uintptr var _ /* prefixObjc at bp+256 */ TTcl_Size var _ /* stringLength at bp+232 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, cachePtr2, cmp, copyPtr, ensembleCmd, ensemblePtr, errorObj, fix, fullName, hPtr, i, i1, irPtr, reparseCount, subIdx, subObj, subcmdName, tableLength, v1, v10, v11, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v7, v8, v9 ensemblePtr = clientData /* Used for efficient lookup of fully * specified but not yet cached command * names. */ reparseCount = 0 /* * Must recheck objc since numParameters might have changed. See test * namespace-53.9. */ goto restartEnsembleParse restartEnsembleParse: ; subIdx = int64(1) + (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters if int64(objc) < subIdx+int64(1) { /* Message being built */ XTcl_DStringInit(tls, bp+8) if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList != 0 { XTclDStringAppendObj(tls, bp+8, (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList) XTcl_DStringAppend(tls, bp+8, __ccgo_ts+14830, libc.Int64FromUint64(libc.Uint64FromInt64(2)-libc.Uint64FromInt32(1))) } XTcl_DStringAppend(tls, bp+8, __ccgo_ts+29647, libc.Int64FromUint64(libc.Uint64FromInt64(21)-libc.Uint64FromInt32(1))) XTcl_WrongNumArgs(tls, interp, int64(1), objv, (*TTcl_DString)(unsafe.Pointer(bp+8)).Fstring1) XTcl_DStringFree(tls, bp+8) return int32(TCL_ERROR) } if (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).Fflags&int32(NS_DEAD) != 0 { /* * Don't know how we got here, but make things give up quickly. */ if !(XTcl_InterpDeleted(tls, interp) != 0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+30086, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+288, __ccgo_ts+2004, __ccgo_ts+29633, __ccgo_ts+29642, libc.UintptrFromInt32(0))) } return int32(TCL_ERROR) } /* * If the table of subcommands is valid just lookup up the command there * and go to dispatch. */ subObj = *(*uintptr)(unsafe.Pointer(objv + uintptr(subIdx)*8)) if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch == (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch { if (*TTcl_Obj)(unsafe.Pointer(subObj)).FtypePtr == uintptr(unsafe.Pointer(&_ensembleCmdType)) { v1 = subObj + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } ensembleCmd = v2 if ensembleCmd != 0 { if (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Fepoch == (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch && (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken == (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken { *(*uintptr)(unsafe.Pointer(bp)) = (*TTcl_HashEntry)(unsafe.Pointer((*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).FhPtr)).FclientData (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount++ if (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix != 0 { XTclSpellFix(tls, interp, objv, int64(objc), subIdx, subObj, (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix) } goto runResultingSubcommand } } } else { _BuildEnsembleConfig(tls, ensemblePtr) (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch = (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportLookupEpoch } /* * Look in the hashtable for the named subcommand. This is the fastest * path if there is no cache in operation. */ if (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes != 0 { v3 = (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes } else { v3 = XTcl_GetStringFromObj(tls, subObj, libc.UintptrFromInt32(0)) } hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(ensemblePtr + 32)).FfindProc})))(tls, ensemblePtr+32, v3) if hPtr != libc.UintptrFromInt32(0) { /* * Cache ensemble in the subcommand object for later. */ _MakeCachedEnsembleCommand(tls, subObj, ensemblePtr, hPtr, libc.UintptrFromInt32(0)) } else { if !((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags&libc.Int32FromInt32(TCL_ENSEMBLE_PREFIX) != 0) { /* * Could not map. No prefixing. Go to unknown/error handling. */ goto unknownOrAmbiguousSubcommand } else { /* Name of the subcommand or unique prefix of * it (a non-unique prefix produces an error). */ fullName = libc.UintptrFromInt32(0) tableLength = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandTable.FnumEntries if (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 232)) = (*TTcl_Obj)(unsafe.Pointer(subObj)).Flength v4 = (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes } else { v4 = XTcl_GetStringFromObj(tls, subObj, bp+232) } subcmdName = v4 i = 0 for { if !(i < tableLength) { break } cmp = libc.Xstrncmp(tls, subcmdName, *(*uintptr)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(i)*8)), libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 232)))) if cmp == 0 { if fullName != libc.UintptrFromInt32(0) { /* * Hash search filters out the exact-match case, so getting * here indicates that the subcommand is an ambiguous * prefix of at least two exported subcommands, which is an * error case. */ goto unknownOrAmbiguousSubcommand } fullName = *(*uintptr)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(i)*8)) } else { if cmp < 0 { /* * The table is sorted so stop searching because a match would * have been found already. */ break } } goto _5 _5: ; i++ } if fullName == libc.UintptrFromInt32(0) { /* * The subcommand is not a prefix of anything. Bail out! */ goto unknownOrAmbiguousSubcommand } hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(ensemblePtr + 32)).FfindProc})))(tls, ensemblePtr+32, fullName) if hPtr == libc.UintptrFromInt32(0) { XTcl_Panic(tls, __ccgo_ts+30127, libc.VaList(bp+288, fullName)) } /* * Record the spelling correction for usage message. */ fix = XTcl_NewStringObj(tls, fullName, int64(-libc.Int32FromInt32(1))) /* * Cache for later in the subcommand object. */ _MakeCachedEnsembleCommand(tls, subObj, ensemblePtr, hPtr, fix) XTclSpellFix(tls, interp, objv, int64(objc), subIdx, subObj, fix) } } *(*uintptr)(unsafe.Pointer(bp)) = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FrefCount++ goto runResultingSubcommand runResultingSubcommand: ; /* * Execute the subcommand by populating an array of objects, which might * not be the same length as the number of arguments to this ensemble * command, and then handing it to the main command-lookup engine. In * theory, the command could be looked up right here using the namespace in * which it is guaranteed to exist, * * ((Q: That's not true if the -map option is used, is it?)) * * but don't do that because caching of the command object should help. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))).Fptr2 != 0 { v7 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))).Fptr2)).FspanLength } else { v7 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 256)) = v7 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjLength(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), bp+256) } if objc == int32(2) { copyPtr = XTclListObjCopy(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp))) } else { copyPtr = XTcl_NewListObj(tls, int64(objc-int32(2))+*(*TTcl_Size)(unsafe.Pointer(bp + 256)), libc.UintptrFromInt32(0)) XTcl_ListObjAppendList(tls, libc.UintptrFromInt32(0), copyPtr, *(*uintptr)(unsafe.Pointer(bp))) XTcl_ListObjReplace(tls, libc.UintptrFromInt32(0), copyPtr, libc.Int64FromUint64((libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))-uint64(libc.UintptrFromInt32(0)+40))/libc.Uint64FromInt64(8)), 0, (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters, objv+uintptr(1)*8) XTcl_ListObjReplace(tls, libc.UintptrFromInt32(0), copyPtr, libc.Int64FromUint64((libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))-uint64(libc.UintptrFromInt32(0)+40))/libc.Uint64FromInt64(8)), 0, int64(objc-int32(2))-(*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters, objv+uintptr(2)*8+uintptr((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters)*8) } (*TTcl_Obj)(unsafe.Pointer(copyPtr)).FrefCount++ if v8 = interp == libc.UintptrFromInt32(0); !v8 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v8 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 264)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264)))).FprocPtr = __ccgo_fp(XTclNRReleaseValues) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264)) + 8)) = copyPtr *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 264)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 264)) v10 = *(*uintptr)(unsafe.Pointer(bp)) v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if !(v9 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Flength = int64(-libc.Int32FromInt32(1)) if v11 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v11 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v11 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp)) (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp))) } } /* * Record the words of the command as given so that routines like * Tcl_WrongNumArgs can produce the correct error message. Parameters * count both as inserted and removed arguments. */ if XTclInitRewriteEnsemble(tls, interp, int64(2)+(*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters, *(*TTcl_Size)(unsafe.Pointer(bp + 256))+(*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnumParameters, objv) != 0 { if v12 = interp == libc.UintptrFromInt32(0); !v12 { cachePtr2 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v12 || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 272)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).FprocPtr = __ccgo_fp(XTclClearRootEnsemble) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)) + 8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 272)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 272)) } /* * Hand off to the target command. */ XTclSkipTailcall(tls, interp) if (*TTcl_Obj)(unsafe.Pointer(copyPtr)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr2 != 0 { v14 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr2)).FspanStart } else { v14 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 240)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr1 + 40 + uintptr(v14)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr2 != 0 { v15 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr2)).FspanLength } else { v15 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyPtr + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 248)) = v15 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), copyPtr, bp+248, bp+240) } (*TInterp)(unsafe.Pointer(interp)).FlookupNsPtr = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr return XTclNREvalObjv(tls, interp, *(*TTcl_Size)(unsafe.Pointer(bp + 248)), *(*uintptr)(unsafe.Pointer(bp + 240)), int32(TCL_EVAL_INVOKE), libc.UintptrFromInt32(0)) goto unknownOrAmbiguousSubcommand unknownOrAmbiguousSubcommand: ; /* * The named subcommand did not match any exported command. If there is a * handler registered unknown subcommands, call it, but not more than once * for this call. */ if v17 = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler != libc.UintptrFromInt32(0); v17 { v16 = reparseCount reparseCount++ } if v17 && v16 < int32(1) { switch _EnsembleUnknownCallback(tls, interp, ensemblePtr, objc, objv, bp) { case TCL_OK: goto runResultingSubcommand case int32(TCL_ERROR): return int32(TCL_ERROR) case int32(TCL_CONTINUE): goto restartEnsembleParse } } /* * Could not find a routine for the named subcommand so generate a standard * failure message. The one odd case compared with a standard * ensemble-like command is where a namespace has no exported commands at * all... */ XTcl_ResetResult(tls, interp) if (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes != 0 { v18 = (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes } else { v18 = XTcl_GetStringFromObj(tls, subObj, libc.UintptrFromInt32(0)) } XTcl_SetErrorCode(tls, interp, libc.VaList(bp+288, __ccgo_ts+2004, __ccgo_ts+7967, __ccgo_ts+7412, v18, libc.UintptrFromInt32(0))) if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandTable.FnumEntries == 0 { if (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes != 0 { v19 = (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes } else { v19 = XTcl_GetStringFromObj(tls, subObj, libc.UintptrFromInt32(0)) } XTcl_SetObjResult(tls, interp, XTcl_ObjPrintf(tls, __ccgo_ts+30182, libc.VaList(bp+288, v19, (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FfullName))) return int32(TCL_ERROR) } if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags&int32(TCL_ENSEMBLE_PREFIX) != 0 { v20 = __ccgo_ts + 30249 } else { v20 = __ccgo_ts + 1945 } if (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes != 0 { v21 = (*TTcl_Obj)(unsafe.Pointer(subObj)).Fbytes } else { v21 = XTcl_GetStringFromObj(tls, subObj, libc.UintptrFromInt32(0)) } errorObj = XTcl_ObjPrintf(tls, __ccgo_ts+30263, libc.VaList(bp+288, v20, v21)) if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandTable.FnumEntries == int64(1) { XTcl_AppendToObj(tls, errorObj, *(*uintptr)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr)), int64(-libc.Int32FromInt32(1))) } else { i1 = 0 for { if !(i1 < (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandTable.FnumEntries-int64(1)) { break } XTcl_AppendToObj(tls, errorObj, *(*uintptr)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(i1)*8)), int64(-libc.Int32FromInt32(1))) XTcl_AppendToObj(tls, errorObj, __ccgo_ts+21617, int64(2)) goto _22 _22: ; i1++ } XTcl_AppendPrintfToObj(tls, errorObj, __ccgo_ts+30299, libc.VaList(bp+288, *(*uintptr)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(i1)*8)))) } XTcl_SetObjResult(tls, interp, errorObj) return int32(TCL_ERROR) } func XTclClearRootEnsemble(tls *libc.TLS, dummy2040 uintptr, interp uintptr, result int32) (r int32) { XTclResetRewriteEnsemble(tls, interp, int32(1)) return result } /* *---------------------------------------------------------------------- * * TclInitRewriteEnsemble -- * * Applies a rewrite of arguments so that an ensemble subcommand * correctly reports any error messages for the overall command. * * Results: * Whether this is the first rewrite applied, a value which must be * passed to TclResetRewriteEnsemble when undoing this command's * behaviour. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclInitRewriteEnsemble(tls *libc.TLS, interp uintptr, numRemoved TTcl_Size, numInserted TTcl_Size, objv uintptr) (r int32) { var iPtr uintptr var isRootEnsemble int32 var numIns TTcl_Size _, _, _ = iPtr, isRootEnsemble, numIns iPtr = interp isRootEnsemble = libc.BoolInt32((*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs == libc.UintptrFromInt32(0)) if isRootEnsemble != 0 { (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs = objv (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs = numRemoved (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs = numInserted } else { numIns = (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs if numIns < numRemoved { (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs += numRemoved - numIns (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs = numInserted } else { (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs += numInserted - numRemoved } } return isRootEnsemble } /* *---------------------------------------------------------------------- * * TclResetRewriteEnsemble -- * * Removes any rewrites applied to support proper reporting of error * messages used in ensembles. Should be paired with * TclInitRewriteEnsemble. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclResetRewriteEnsemble(tls *libc.TLS, interp uintptr, isRootEnsemble int32) { var iPtr uintptr _ = iPtr iPtr = interp if isRootEnsemble != 0 { (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs = libc.UintptrFromInt32(0) (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs = 0 (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs = 0 } } /* *---------------------------------------------------------------------- * * TclSpellFix -- * * Records a spelling correction that needs making in the generation of * the WrongNumArgs usage message. * * Results: * None. * * Side effects: * Can create an alternative ensemble rewrite structure. * *---------------------------------------------------------------------- */ func _FreeER(tls *libc.TLS, data uintptr, dummy2147 uintptr, result int32) (r int32) { var store, tmp uintptr _, _ = store, tmp tmp = *(*uintptr)(unsafe.Pointer(data)) store = *(*uintptr)(unsafe.Pointer(data + 1*8)) XTclpFree(tls, store) XTclpFree(tls, tmp) return result } func XTclSpellFix(tls *libc.TLS, interp uintptr, objv uintptr, objc TTcl_Size, badIdx TTcl_Size, bad uintptr, fix uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr, search, store, tmp uintptr var idx, size TTcl_Size var v1, v2 bool var _ /* _callbackPtr at bp+0 */ uintptr var _ /* _callbackPtr at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, cachePtr, cachePtr1, iPtr, idx, search, size, store, tmp, v1, v2 iPtr = interp if (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs == libc.UintptrFromInt32(0) { (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs = objv (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs = 0 (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs = 0 } /* * Compute the valid length of the ensemble root. */ size = (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs + objc - (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs search = (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs if *(*uintptr)(unsafe.Pointer(search)) == libc.UintptrFromInt32(0) { /* * Awful casting abuse here! */ search = *(*uintptr)(unsafe.Pointer(search + 1*8)) } if badIdx < (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs { /* * Misspelled value was inserted. Cannot directly jump to the bad * value. Must search. */ idx = int64(1) for idx < size { if *(*uintptr)(unsafe.Pointer(search + uintptr(idx)*8)) == bad { break } idx++ } if idx == size { return } } else { /* * Jump to the misspelled value. */ idx = (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs + badIdx - (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs /* Verify */ if *(*uintptr)(unsafe.Pointer(search + uintptr(idx)*8)) != bad { XTcl_Panic(tls, __ccgo_ts+30305, 0) } } search = (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs if *(*uintptr)(unsafe.Pointer(search)) == libc.UintptrFromInt32(0) { store = *(*uintptr)(unsafe.Pointer(search + 2*8)) } else { tmp = XTcl_Alloc(tls, libc.Uint64FromInt32(3)*libc.Uint64FromInt64(8)) store = XTcl_Alloc(tls, libc.Uint64FromInt64(size)*uint64(8)) libc.Xmemcpy(tls, store, (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs, libc.Uint64FromInt64(size)*uint64(8)) /* * Awful casting abuse here! Note that the NULL in the first element * indicates that the initial objects are a raw array in the second * element and the rewritten ones are a raw array in the third. */ *(*uintptr)(unsafe.Pointer(tmp)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(tmp + 1*8)) = (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs *(*uintptr)(unsafe.Pointer(tmp + 2*8)) = store (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs = tmp if v1 = interp == libc.UintptrFromInt32(0); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr = XTclThreadAllocObj(tls) } else { _objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp)) = _objPtr (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FprocPtr = __ccgo_fp(_FreeER) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8)) = tmp *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 1*8)) = store *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp)) } *(*uintptr)(unsafe.Pointer(store + uintptr(idx)*8)) = fix (*TTcl_Obj)(unsafe.Pointer(fix)).FrefCount++ if v2 = interp == libc.UintptrFromInt32(0); !v2 { cachePtr1 = (*TInterp)(unsafe.Pointer(interp)).FallocCache } if v2 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { _objPtr1 = XTclThreadAllocObj(tls) } else { _objPtr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(_objPtr1 + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } *(*uintptr)(unsafe.Pointer(bp + 8)) = _objPtr1 (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FprocPtr = __ccgo_fp(XTclNRReleaseValues) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8)) = fix *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 1*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 2*8)) = libc.UintptrFromInt32(0) *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 8 + 3*8)) = libc.UintptrFromInt32(0) (*TNRE_callback)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FnextPtr = (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr (*TExecEnv1)(unsafe.Pointer((*TInterp)(unsafe.Pointer(interp)).FexecEnvPtr)).FcallbackPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) } // C documentation // // /* // *---------------------------------------------------------------------- // * // * TclEnsembleGetRewriteValues -- // * // * Get the original arguments to the current command before any rewrite // * rules (from aliases, ensembles, and method forwards) were applied. // * // *---------------------------------------------------------------------- // */ func XTclEnsembleGetRewriteValues(tls *libc.TLS, interp uintptr) (r uintptr) { /* Current interpreter. */ var iPtr, origObjv uintptr _, _ = iPtr, origObjv iPtr = interp origObjv = (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs if *(*uintptr)(unsafe.Pointer(origObjv)) == libc.UintptrFromInt32(0) { origObjv = *(*uintptr)(unsafe.Pointer(origObjv + 2*8)) } return origObjv } // C documentation // // /* // *---------------------------------------------------------------------- // * // * TclFetchEnsembleRoot -- // * // * Returns the root of ensemble rewriting, if any. // * If no root exists, returns objv instead. // * // * Results: // * None. // * // * Side effects: // * None. // * // *---------------------------------------------------------------------- // */ func XTclFetchEnsembleRoot(tls *libc.TLS, interp uintptr, objv uintptr, objc TTcl_Size, objcPtr uintptr) (r uintptr) { var iPtr, sourceObjs uintptr _, _ = iPtr, sourceObjs iPtr = interp if (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs != 0 { *(*TTcl_Size)(unsafe.Pointer(objcPtr)) = objc + (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumRemovedObjs - (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FnumInsertedObjs if *(*uintptr)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs)) == libc.UintptrFromInt32(0) { sourceObjs = *(*uintptr)(unsafe.Pointer((*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs + 1*8)) } else { sourceObjs = (*TInterp)(unsafe.Pointer(iPtr)).FensembleRewrite.FsourceObjs } return sourceObjs } *(*TTcl_Size)(unsafe.Pointer(objcPtr)) = objc return objv } /* * ---------------------------------------------------------------------- * * EnsembleUnknownCallback -- * * Helper for the ensemble engine. Calls the routine registered for * "ensemble unknown" case. See the user documentation of the * ensemble unknown handler for details. Only called when such a * function is defined, and is only called once per ensemble dispatch. * I.e. even if a reparse still fails, this isn't called again. * * Results: * TCL_OK - *prefixObjPtr contains the command words to dispatch * to. * TCL_CONTINUE - Need to reparse, i.e. *prefixObjPtr is invalid * TCL_ERROR - Something went wrong. Error message in interpreter. * * Side effects: * Arbitrary, due to evaluation of script provided by client. * * ---------------------------------------------------------------------- */ func _EnsembleUnknownCallback(tls *libc.TLS, interp uintptr, ensemblePtr uintptr, objc int32, objv uintptr, prefixObjPtr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) /* Where to write the prefix suggested by the * unknown callback. Must not be NULL. Only has * a meaningful value on TCL_OK. */ var cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, ensObj, unknownCmd, v12, v15, v18, v7 uintptr var i, v11, v14, v17, v6 TTcl_Size var result, v9 int32 var v1, v13, v16, v19, v8 bool var v10, v4, v5 int64 var _ /* paramc at bp+0 */ TTcl_Size var _ /* paramv at bp+16 */ uintptr var _ /* prefixObjc at bp+8 */ TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cachePtr, cachePtr1, cachePtr2, cachePtr3, cachePtr4, ensObj, i, result, unknownCmd, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v4, v5, v6, v7, v8, v9 /* * Create the "unknown" command callback to determine what to do. */ unknownCmd = XTcl_DuplicateObj(tls, (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler) if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { ensObj = XTclThreadAllocObj(tls) } else { ensObj = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(ensObj + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(ensObj)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(ensObj)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(ensObj)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(ensObj)).FtypePtr = libc.UintptrFromInt32(0) XTcl_GetCommandFullName(tls, interp, (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken, ensObj) XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), unknownCmd, ensObj) i = int64(1) for { if !(i < int64(objc)) { break } XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), unknownCmd, *(*uintptr)(unsafe.Pointer(objv + uintptr(i)*8))) goto _2 _2: ; i++ } if (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownCmd + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownCmd + 32))).Fptr2)).FspanStart } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownCmd + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownCmd + 32))).Fptr1 + 40 + uintptr(v4)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownCmd + 32))).Fptr2 != 0 { v5 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownCmd + 32))).Fptr2)).FspanLength } else { v5 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownCmd + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v5 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), unknownCmd, bp, bp+16) } (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).FrefCount++ /* * Call the "unknown" handler. No attempt to NRE-enable this as deep * recursion through unknown handlers is perverse. It is always an error * for an unknown handler to delete its ensemble. Don't do that. */ XTcl_Preserve(tls, ensemblePtr) XTclSkipTailcall(tls, interp) result = XTcl_EvalObjv(tls, interp, *(*TTcl_Size)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 16)), 0) if result == TCL_OK && (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fflags&int32(ENSEMBLE_DEAD) != 0 { if !(XTcl_InterpDeleted(tls, interp) != 0) { XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+30333, int64(-libc.Int32FromInt32(1)))) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+29633, __ccgo_ts+30381, libc.UintptrFromInt32(0))) } result = int32(TCL_ERROR) } XTcl_Release(tls, ensemblePtr) /* * On success the result is a list of words that form the command to be * executed. If the list is empty, the ensemble should have been updated, * so ask the ensemble engine to reparse the original command. */ if result == TCL_OK { *(*uintptr)(unsafe.Pointer(prefixObjPtr)) = XTcl_GetObjResult(tls, interp) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FrefCount++ v7 = unknownCmd v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if !(v6 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).Flength = int64(-libc.Int32FromInt32(1)) if v8 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v8 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v8 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, unknownCmd) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownCmd + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = unknownCmd (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, unknownCmd) } } XTcl_ResetResult(tls, interp) /* A non-empty list is the replacement command. */ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)) + 32))).Fptr2 != 0 { v10 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)) + 32))).Fptr2)).FspanLength } else { v10 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v10 v9 = libc.Int32FromInt32(TCL_OK) } else { v9 = XTcl_ListObjLength(tls, interp, *(*uintptr)(unsafe.Pointer(prefixObjPtr)), bp+8) } if v9 != TCL_OK { v12 = *(*uintptr)(unsafe.Pointer(prefixObjPtr)) v11 = *(*TTcl_Size)(unsafe.Pointer(v12)) *(*TTcl_Size)(unsafe.Pointer(v12))-- if !(v11 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Flength = int64(-libc.Int32FromInt32(1)) if v13 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v13 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v13 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(prefixObjPtr))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(prefixObjPtr)) (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(prefixObjPtr))) } } XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+30397, int64(-int32(1)))) return int32(TCL_ERROR) } if *(*TTcl_Size)(unsafe.Pointer(bp + 8)) > 0 { return TCL_OK } /* * Empty result => reparse. */ v15 = *(*uintptr)(unsafe.Pointer(prefixObjPtr)) v14 = *(*TTcl_Size)(unsafe.Pointer(v15)) *(*TTcl_Size)(unsafe.Pointer(v15))-- if !(v14 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)))).Flength = int64(-libc.Int32FromInt32(1)) if v16 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v16 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v16 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(prefixObjPtr))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(prefixObjPtr)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(prefixObjPtr)) (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(prefixObjPtr))) } } return int32(TCL_CONTINUE) } /* * Convert exceptional result to an error. */ if !(XTcl_InterpDeleted(tls, interp) != 0) { if result != int32(TCL_ERROR) { XTcl_ResetResult(tls, interp) XTcl_SetObjResult(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+30462, int64(-libc.Int32FromInt32(1)))) switch result { case int32(TCL_RETURN): XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, interp), __ccgo_ts+5371, int64(-libc.Int32FromInt32(1))) case int32(TCL_BREAK): XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, interp), __ccgo_ts+5123, int64(-libc.Int32FromInt32(1))) case int32(TCL_CONTINUE): XTcl_AppendToObj(tls, XTcl_GetObjResult(tls, interp), __ccgo_ts+5141, int64(-libc.Int32FromInt32(1))) default: XTcl_AppendPrintfToObj(tls, XTcl_GetObjResult(tls, interp), __ccgo_ts+260, libc.VaList(bp+32, result)) } XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+30509, int64(-int32(1)))) XTcl_AppendObjToErrorInfo(tls, interp, unknownCmd) XTcl_SetErrorCode(tls, interp, libc.VaList(bp+32, __ccgo_ts+2004, __ccgo_ts+29633, __ccgo_ts+30562, libc.UintptrFromInt32(0))) } else { XTcl_AppendObjToErrorInfo(tls, interp, XTcl_NewStringObj(tls, __ccgo_ts+30577, int64(-int32(1)))) } } v18 = unknownCmd v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if !(v17 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(unknownCmd)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(unknownCmd)).Flength = int64(-libc.Int32FromInt32(1)) if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr4 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || ((*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, unknownCmd) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(unknownCmd + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr4)).FfirstObjPtr = unknownCmd (*TAllocCache)(unsafe.Pointer(cachePtr4)).FnumObjects++ } } else { XTclFreeObj(tls, unknownCmd) } } return int32(TCL_ERROR) } /* *---------------------------------------------------------------------- * * MakeCachedEnsembleCommand -- * * Caches what has been computed so far to minimize string copying. * Starts by deleting any existing representation but reusing the existing * structure if it is an ensembleCmd. * * Results: * None. * * Side effects: * Converts the internal representation of the given object to an * ensembleCmd. * *---------------------------------------------------------------------- */ func _MakeCachedEnsembleCommand(tls *libc.TLS, objPtr uintptr, ensemblePtr uintptr, hPtr uintptr, fix uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* Spelling correction for later error, or NULL * if no correction. */ var _objPtr, ensembleCmd, irPtr, v1, v2, v4, v6 uintptr var v3, v5 TTcl_Size var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _, _, _, _, _, _, _ = _objPtr, ensembleCmd, irPtr, v1, v2, v3, v4, v5, v6 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_ensembleCmdType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } ensembleCmd = v2 if ensembleCmd != 0 { v4 = (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken + 16 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclpFree(tls, (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken) } if (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix != 0 { _objPtr = (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } } } else { /* * Replace any old internal representation with a new one. */ ensembleCmd = XTcl_Alloc(tls, uint64(32)) (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr1 = ensembleCmd (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr2 = libc.UintptrFromInt32(0) XTcl_StoreInternalRep(tls, objPtr, uintptr(unsafe.Pointer(&_ensembleCmdType)), bp) } /* * Populate the internal rep. */ (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Fepoch = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fepoch (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Ftoken (*TCommand)(unsafe.Pointer((*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken)).FrefCount++ if fix != 0 { (*TTcl_Obj)(unsafe.Pointer(fix)).FrefCount++ } (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix = fix (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).FhPtr = hPtr } /* *---------------------------------------------------------------------- * * DeleteEnsembleConfig -- * * Destroys the data structure used to represent an ensemble. Called when * the procedure for the ensemble is deleted, which happens automatically * if the namespace for the ensemble is deleted. Deleting the procedure * for an ensemble is the right way to initiate cleanup. * * Results: * None. * * Side effects: * Memory is eventually deallocated. * *---------------------------------------------------------------------- */ func _ClearTable(tls *libc.TLS, ensemblePtr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* Ensemble to clear table of. */ var _objPtr, hPtr, hash, prefixObj, v2 uintptr var v1 TTcl_Size var _ /* search at bp+0 */ TTcl_HashSearch _, _, _, _, _, _ = _objPtr, hPtr, hash, prefixObj, v1, v2 hash = ensemblePtr + 32 if (*TTcl_HashTable)(unsafe.Pointer(hash)).FnumEntries != 0 { hPtr = XTcl_FirstHashEntry(tls, hash, bp) for hPtr != libc.UintptrFromInt32(0) { prefixObj = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData _objPtr = prefixObj v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } hPtr = XTcl_NextHashEntry(tls, bp) } XTclpFree(tls, (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr) } XTcl_DeleteHashTable(tls, hash) } func _DeleteEnsembleConfig(tls *libc.TLS, clientData uintptr) { /* Ensemble to delete. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, ensPtr, ensemblePtr, nsPtr, v2, v4, v6, v8 uintptr var v1, v3, v5, v7 TTcl_Size _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, ensPtr, ensemblePtr, nsPtr, v1, v2, v3, v4, v5, v6, v7, v8 ensemblePtr = clientData nsPtr = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr /* Unlink from the ensemble chain if it not already marked as unlinked. */ if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext != ensemblePtr { ensPtr = (*TNamespace)(unsafe.Pointer(nsPtr)).Fensembles if ensPtr == ensemblePtr { (*TNamespace)(unsafe.Pointer(nsPtr)).Fensembles = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext } else { for ensPtr != libc.UintptrFromInt32(0) { if (*TEnsembleConfig)(unsafe.Pointer(ensPtr)).Fnext == ensemblePtr { (*TEnsembleConfig)(unsafe.Pointer(ensPtr)).Fnext = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).Fnext break } ensPtr = (*TEnsembleConfig)(unsafe.Pointer(ensPtr)).Fnext } } } /* * Mark the namespace as dead so code that uses Tcl_Preserve() can tell * whether disaster happened anyway. */ *(*int32)(unsafe.Pointer(ensemblePtr + 144)) |= int32(ENSEMBLE_DEAD) /* * Release the fields that contain pointers. */ _ClearTable(tls, ensemblePtr) if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList != libc.UintptrFromInt32(0) { _objPtr = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList v2 = _objPtr v1 = *(*TTcl_Size)(unsafe.Pointer(v2)) *(*TTcl_Size)(unsafe.Pointer(v2))-- if v1 <= int64(1) { XTclFreeObj(tls, _objPtr) } } if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList != libc.UintptrFromInt32(0) { _objPtr1 = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FparameterList v4 = _objPtr1 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr1) } } if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict != libc.UintptrFromInt32(0) { _objPtr2 = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict v6 = _objPtr2 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr2) } } if (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler != libc.UintptrFromInt32(0) { _objPtr3 = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FunknownHandler v8 = _objPtr3 v7 = *(*TTcl_Size)(unsafe.Pointer(v8)) *(*TTcl_Size)(unsafe.Pointer(v8))-- if v7 <= int64(1) { XTclFreeObj(tls, _objPtr3) } } /* * Arrange for the structure to be reclaimed. This is complex because it is * necessary to react sensibly when an ensemble is deleted during its * initialisation, particularly in the case of an unknown callback. */ XTcl_EventuallyFree(tls, ensemblePtr, libc.UintptrFromInt32(3)) } /* *---------------------------------------------------------------------- * * BuildEnsembleConfig -- * * Creates the internal data structures that describe how an ensemble * looks. The structures are a hash map from the full command name to the * Tcl list that describes the implementation prefix words, and a sorted * array of all the full command names to allow for reasonably efficient * handling of an unambiguous prefix. * * Results: * None. * * Side effects: * Reallocates and rebuilds the hash table and array stored at the * ensemblePtr argument. For large ensembles or large namespaces, this is * may be an expensive operation. * *---------------------------------------------------------------------- */ func _BuildEnsembleConfig(tls *libc.TLS, ensemblePtr uintptr) { bp := tls.Alloc(160) defer tls.Free(160) /* Ensemble to set up. */ var _objPtr, cachePtr, cmdPrefixObj, cmdPrefixObj1, hPtr, hash, mapDict, name, name1, nsCmdName, subList, v10, v11, v13, v16, v18, v20, v5, v7, v8 uintptr var i, j, v17, v19, v6 TTcl_Size var v15 bool var v2, v3 int64 var _ /* cmdObj at bp+112 */ uintptr var _ /* cmdObj at bp+56 */ uintptr var _ /* dictSearch at bp+64 */ TTcl_DictSearch var _ /* done at bp+104 */ int32 var _ /* isNew at bp+24 */ int32 var _ /* keyObj at bp+88 */ uintptr var _ /* search at bp+0 */ TTcl_HashSearch var _ /* subc at bp+32 */ TTcl_Size var _ /* subv at bp+40 */ uintptr var _ /* target at bp+48 */ uintptr var _ /* valueObj at bp+96 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cmdPrefixObj, cmdPrefixObj1, hPtr, hash, i, j, mapDict, name, name1, nsCmdName, subList, v10, v11, v13, v15, v16, v17, v18, v19, v2, v20, v3, v5, v6, v7, v8 hash = ensemblePtr + 32 mapDict = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict subList = (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcmdList _ClearTable(tls, ensemblePtr) XTcl_InitHashTable(tls, hash, TCL_STRING_KEYS) if subList != 0 { /* * There is a list of exactly what subcommands go in the table. * Determine the target for each. */ if (*TTcl_Obj)(unsafe.Pointer(subList)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subList + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subList + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subList + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 40)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subList + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subList + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subList + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(subList + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 32)) = v3 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), subList, bp+32, bp+40) } if subList == mapDict { /* * Unusual case where explicit list of subcommands is same value * as the dict mapping to targets. */ i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 32))) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))).Fbytes != 0 { v5 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))).Fbytes } else { v5 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)), libc.UintptrFromInt32(0)) } name = v5 hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})))(tls, hash, name, bp+24) if !(*(*int32)(unsafe.Pointer(bp + 24)) != 0) { *(*uintptr)(unsafe.Pointer(bp + 56)) = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData _objPtr = *(*uintptr)(unsafe.Pointer(bp + 56)) v7 = _objPtr v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr) } } (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+int64(1))*8)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+int64(1))*8)))).FrefCount++ if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+int64(1))*8)))).Fbytes != 0 { v8 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+int64(1))*8)))).Fbytes } else { v8 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i+int64(1))*8)), libc.UintptrFromInt32(0)) } name = v8 hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})))(tls, hash, name, bp+24) if *(*int32)(unsafe.Pointer(bp + 24)) != 0 { *(*uintptr)(unsafe.Pointer(bp + 56)) = XTcl_NewStringObj(tls, name, int64(-libc.Int32FromInt32(1))) cmdPrefixObj = XTcl_NewListObj(tls, int64(1), bp+56) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPrefixObj (*TTcl_Obj)(unsafe.Pointer(cmdPrefixObj)).FrefCount++ } goto _4 _4: ; i += int64(2) } } else { /* * Usual case where we can freely act on the list and dict. */ i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 32))) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))).Fbytes != 0 { v10 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)))).Fbytes } else { v10 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)), libc.UintptrFromInt32(0)) } name = v10 hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})))(tls, hash, name, bp+24) if !(*(*int32)(unsafe.Pointer(bp + 24)) != 0) { goto _9 } /* * Lookup target in the dictionary. */ if mapDict != 0 { XTcl_DictObjGet(tls, libc.UintptrFromInt32(0), mapDict, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 40)) + uintptr(i)*8)), bp+48) if *(*uintptr)(unsafe.Pointer(bp + 48)) != 0 { (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = *(*uintptr)(unsafe.Pointer(bp + 48)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 48)))).FrefCount++ goto _9 } } /* * Target was not in the dictionary. Map onto the namespace. * In this case there is no guarantee that the command is * actually there. It is the responsibility of the programmer * (or [::unknown] of course) to provide the procedure. */ *(*uintptr)(unsafe.Pointer(bp + 56)) = XTcl_NewStringObj(tls, name, int64(-libc.Int32FromInt32(1))) cmdPrefixObj = XTcl_NewListObj(tls, int64(1), bp+56) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPrefixObj (*TTcl_Obj)(unsafe.Pointer(cmdPrefixObj)).FrefCount++ goto _9 _9: ; i++ } } } else { if mapDict != 0 { XTcl_DictObjFirst(tls, libc.UintptrFromInt32(0), (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandDict, bp+64, bp+88, bp+96, bp+104) for !(*(*int32)(unsafe.Pointer(bp + 104)) != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes != 0 { v11 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))).Fbytes } else { v11 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 88)), libc.UintptrFromInt32(0)) } name1 = v11 hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})))(tls, hash, name1, bp+24) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = *(*uintptr)(unsafe.Pointer(bp + 96)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).FrefCount++ XTcl_DictObjNext(tls, bp+64, bp+88, bp+96, bp+104) } } else { /* * Use the array of patterns and the hash table whose keys are the * commands exported by the namespace. The corresponding values do not * matter here. Filter the commands in the namespace against the * patterns in the export list to find out what commands are actually * exported. Use an intermediate hash table to make memory management * easier and to make exact matching much easier. * * Suggestion for future enhancement: Compute the unique prefixes and * place them in the hash too for even faster matching. */ hPtr = XTcl_FirstHashEntry(tls, (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr+184, bp) for { if !(hPtr != libc.UintptrFromInt32(0)) { break } if (*TTcl_HashTable)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr+184)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr+184)).FkeyType == -int32(1) { v13 = *(*uintptr)(unsafe.Pointer(hPtr + 32)) } else { v13 = hPtr + 32 } nsCmdName = v13 i = 0 for { if !(i < (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FnumExportPatterns) { break } if XTcl_StringCaseMatch(tls, nsCmdName, *(*uintptr)(unsafe.Pointer((*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FexportArrayPtr + uintptr(i)*8)), 0) != 0 { hPtr = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(hash)).FcreateProc})))(tls, hash, nsCmdName, bp+24) /* * Remember, hash entries have a full reference to the * substituted part of the command (as a list) as their * content! */ if *(*int32)(unsafe.Pointer(bp + 24)) != 0 { if v15 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v15 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v15 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(bp + 112)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(bp + 112)) = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112)))).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112)))).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 112)))).FtypePtr = libc.UintptrFromInt32(0) if (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FparentPtr != 0 { v16 = __ccgo_ts + 7650 } else { v16 = __ccgo_ts + 1945 } XTcl_AppendStringsToObj(tls, *(*uintptr)(unsafe.Pointer(bp + 112)), libc.VaList(bp+128, (*TNamespace)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FnsPtr)).FfullName, v16, nsCmdName, libc.UintptrFromInt32(0))) cmdPrefixObj1 = XTcl_NewListObj(tls, int64(1), bp+112) (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData = cmdPrefixObj1 (*TTcl_Obj)(unsafe.Pointer(cmdPrefixObj1)).FrefCount++ } break } goto _14 _14: ; i++ } goto _12 _12: ; hPtr = XTcl_NextHashEntry(tls, bp) } } } if (*TTcl_HashTable)(unsafe.Pointer(hash)).FnumEntries == 0 { (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr = libc.UintptrFromInt32(0) return } /* * Create a sorted array of all subcommands in the ensemble. Hash tables * are all very well for a quick look for an exact match, but they can't * determine things like whether a string is a prefix of another, at least * not without a lot of preparation, and they're not useful for generating * the error message either. * * Do this by filling an array with the names: Use the hash keys * directly to save a copy since any time we change the array we change * the hash too, and vice versa, and run quicksort over the array. */ (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr = XTcl_Alloc(tls, uint64(8)*libc.Uint64FromInt64((*TTcl_HashTable)(unsafe.Pointer(hash)).FnumEntries)) /* * Fill the array from both ends as this reduces the likelihood of * performance problems in qsort(). This makes this code much more opaque, * but the naive alternatve: * * for (hPtr=Tcl_FirstHashEntry(hash,&search),i=0 ; * hPtr!=NULL ; hPtr=Tcl_NextHashEntry(&search),i++) { * ensemblePtr->subcommandArrayPtr[i] = Tcl_GetHashKey(hash, &hPtr); * } * * can produce long runs of precisely ordered table entries when the * commands in the namespace are declared in a sorted fashion, which is an * ordering some people like, and the hashing functions or the command * names themselves are fairly unfortunate. Filling from both ends means * that it requires active malice, and probably a debugger, to get qsort() * to have awful runtime behaviour. */ i = 0 j = (*TTcl_HashTable)(unsafe.Pointer(hash)).FnumEntries hPtr = XTcl_FirstHashEntry(tls, hash, bp) for hPtr != libc.UintptrFromInt32(0) { v17 = i i++ if (*TTcl_HashTable)(unsafe.Pointer(hash)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(hash)).FkeyType == -int32(1) { v18 = *(*uintptr)(unsafe.Pointer(hPtr + 32)) } else { v18 = hPtr + 32 } *(*uintptr)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(v17)*8)) = v18 hPtr = XTcl_NextHashEntry(tls, bp) if hPtr == libc.UintptrFromInt32(0) { break } j-- v19 = j if (*TTcl_HashTable)(unsafe.Pointer(hash)).FkeyType == int32(TCL_ONE_WORD_KEYS) || (*TTcl_HashTable)(unsafe.Pointer(hash)).FkeyType == -int32(1) { v20 = *(*uintptr)(unsafe.Pointer(hPtr + 32)) } else { v20 = hPtr + 32 } *(*uintptr)(unsafe.Pointer((*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr + uintptr(v19)*8)) = v20 hPtr = XTcl_NextHashEntry(tls, bp) } if (*TTcl_HashTable)(unsafe.Pointer(hash)).FnumEntries > int64(1) { libc.Xqsort(tls, (*TEnsembleConfig)(unsafe.Pointer(ensemblePtr)).FsubcommandArrayPtr, libc.Uint64FromInt64((*TTcl_HashTable)(unsafe.Pointer(hash)).FnumEntries), uint64(8), __ccgo_fp(_NsEnsembleStringOrder)) } } /* *---------------------------------------------------------------------- * * NsEnsembleStringOrder -- * * Helper to for use with qsort() that compares two array entries that * contain string pointers. * * Results: * -1 if the first string is smaller, 1 if the second string is smaller, * and 0 if they are equal. * * Side effects: * None. * *---------------------------------------------------------------------- */ func _NsEnsembleStringOrder(tls *libc.TLS, strPtr1 uintptr, strPtr2 uintptr) (r int32) { /* Points to second array entry */ return libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(strPtr1)), *(*uintptr)(unsafe.Pointer(strPtr2))) } /* *---------------------------------------------------------------------- * * FreeEnsembleCmdRep -- * * Destroys the internal representation of a Tcl_Obj that has been * holding information about a command in an ensemble. * * Results: * None. * * Side effects: * Memory is deallocated. If this held the last reference to a * namespace's main structure, that main structure will also be * destroyed. * *---------------------------------------------------------------------- */ func _FreeEnsembleCmdRep(tls *libc.TLS, objPtr uintptr) { var _objPtr, ensembleCmd, irPtr, v1, v2, v4, v6 uintptr var v3, v5 TTcl_Size _, _, _, _, _, _, _, _, _ = _objPtr, ensembleCmd, irPtr, v1, v2, v3, v4, v5, v6 if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_ensembleCmdType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } ensembleCmd = v2 v4 = (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken + 16 v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclpFree(tls, (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken) } if (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix != 0 { _objPtr = (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix v6 = _objPtr v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr) } } XTclpFree(tls, ensembleCmd) } /* *---------------------------------------------------------------------- * * DupEnsembleCmdRep -- * * Makes one Tcl_Obj into a copy of another that is a subcommand of an * ensemble. * * Results: * None. * * Side effects: * Memory is allocated, and the namespace that the ensemble is built on * top of gains another reference. * *---------------------------------------------------------------------- */ func _DupEnsembleCmdRep(tls *libc.TLS, objPtr uintptr, copyPtr uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var ensembleCmd, ensembleCopy, irPtr, v1, v2 uintptr var _ /* ir at bp+0 */ TTcl_ObjInternalRep _, _, _, _, _ = ensembleCmd, ensembleCopy, irPtr, v1, v2 ensembleCopy = XTcl_Alloc(tls, uint64(32)) if (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr == uintptr(unsafe.Pointer(&_ensembleCmdType)) { v1 = objPtr + 32 } else { v1 = libc.UintptrFromInt32(0) } irPtr = v1 if irPtr != 0 { v2 = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(irPtr))).Fptr1 } else { v2 = libc.UintptrFromInt32(0) } ensembleCmd = v2 (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr1 = ensembleCopy (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(bp))).Fptr2 = libc.UintptrFromInt32(0) XTcl_StoreInternalRep(tls, copyPtr, uintptr(unsafe.Pointer(&_ensembleCmdType)), bp) (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Fepoch = (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Fepoch (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ftoken = (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ftoken (*TCommand)(unsafe.Pointer((*TEnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ftoken)).FrefCount++ (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ffix = (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).Ffix if (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ffix != 0 { (*TTcl_Obj)(unsafe.Pointer((*TEnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).Ffix)).FrefCount++ } (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCopy)).FhPtr = (*TEnsembleCmdRep)(unsafe.Pointer(ensembleCmd)).FhPtr } /* *---------------------------------------------------------------------- * * TclCompileEnsemble -- * * Procedure called to compile an ensemble command. Note that most * ensembles are not compiled, since modifying a compiled ensemble causes * a invalidation of all existing bytecode (expensive!) which is not * normally warranted. * * Results: * Returns TCL_OK for a successful compile. Returns TCL_ERROR to defer * evaluation to runtime. * * Side effects: * Instructions are added to envPtr to execute the subcommands of the * ensemble at runtime if a compile-time mapping is possible. * *---------------------------------------------------------------------- */ func XTclCompileEnsemble(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { bp := tls.Alloc(112) defer tls.Free(112) /* Holds resulting instructions. */ var _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, mapPtr, matchObj, newCmdPtr, oldCmdPtr, replaced, replacement, str, tokenPtr, word, v10, v12, v18, v21, v6, v8 uintptr var depth, invokeAnyway, matched, ourResult, result, v13, v14, v2 int32 var eclIndex, i, numBytes, v17, v20, v9 TTcl_Size var ensemble TTcl_Command var v1, v11, v19, v7 bool var v15, v16, v3, v4 int64 var _ /* done at bp+88 */ int32 var _ /* elems at bp+32 */ uintptr var _ /* flags at bp+40 */ int32 var _ /* len at bp+48 */ TTcl_Size var _ /* listObj at bp+24 */ uintptr var _ /* mapObj at bp+0 */ uintptr var _ /* s at bp+64 */ TTcl_DictSearch var _ /* sclen at bp+56 */ TTcl_Size var _ /* subcmdObj at bp+8 */ uintptr var _ /* targetCmdObj at bp+16 */ uintptr var _ /* tmpObj at bp+96 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, cachePtr, cachePtr1, cachePtr2, cachePtr3, depth, eclIndex, ensemble, i, invokeAnyway, mapPtr, matchObj, matched, newCmdPtr, numBytes, oldCmdPtr, ourResult, replaced, replacement, result, str, tokenPtr, word, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v6, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) tokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 ensemble = cmdPtr oldCmdPtr = cmdPtr *(*int32)(unsafe.Pointer(bp + 40)) = 0 depth = int32(1) invokeAnyway = 0 ourResult = int32(TCL_ERROR) if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { replaced = XTclThreadAllocObj(tls) } else { replaced = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(replaced + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(replaced)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(replaced)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(replaced)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(replaced)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(replaced)).FrefCount++ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords <= int64(depth) { goto tryCompileToInv } if (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { /* * Too hard. */ goto tryCompileToInv } /* * This is where we return to if we are parsing multiple nested compiled * ensembles. [info object] is such a beast. */ goto checkNextWord checkNextWord: ; word = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fstart numBytes = (*(*TTcl_Token)(unsafe.Pointer(tokenPtr + 1*32))).Fsize /* * There's a sporting chance we'll be able to compile this. But now we * must check properly. To do that, check that we're compiling an ensemble * that has a compilable command as its appropriate subcommand. */ if XTcl_GetEnsembleMappingDict(tls, libc.UintptrFromInt32(0), ensemble, bp) != TCL_OK || *(*uintptr)(unsafe.Pointer(bp)) == libc.UintptrFromInt32(0) { /* * Either not an ensemble or a mapping isn't installed. Crud. Too hard * to proceed. */ goto tryCompileToInv } /* * Also refuse to compile anything that uses a formal parameter list for * now, on the grounds that it is too complex. */ if XTcl_GetEnsembleParameterList(tls, libc.UintptrFromInt32(0), ensemble, bp+24) != TCL_OK || *(*uintptr)(unsafe.Pointer(bp + 24)) != libc.UintptrFromInt32(0) { /* * Figuring out how to compile this has become too much. Bail out. */ goto tryCompileToInv } /* * Next, get the flags. We need them on several code paths so that we can * know whether we're to do prefix matching. */ XTcl_GetEnsembleFlags(tls, libc.UintptrFromInt32(0), ensemble, bp+40) /* * Check to see if there's also a subcommand list; must check to see if * the subcommand we are calling is in that list if it exists, since that * list filters the entries in the map. */ XTcl_GetEnsembleSubcommandList(tls, libc.UintptrFromInt32(0), ensemble, bp+24) if *(*uintptr)(unsafe.Pointer(bp + 24)) != libc.UintptrFromInt32(0) { matchObj = libc.UintptrFromInt32(0) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))).Fptr2)).FspanStart } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 32)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))).Fptr1 + 40 + uintptr(v3)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))).Fptr2 != 0 { v4 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))).Fptr2)).FspanLength } else { v4 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 48)) = v4 v2 = libc.Int32FromInt32(TCL_OK) } else { v2 = XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 24)), bp+48, bp+32) } if v2 != TCL_OK { goto tryCompileToInv } i = 0 for { if !(i < *(*TTcl_Size)(unsafe.Pointer(bp + 48))) { break } if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i)*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 56)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i)*8)))).Flength v6 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i)*8)))).Fbytes } else { v6 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i)*8)), bp+56) } str = v6 if *(*TTcl_Size)(unsafe.Pointer(bp + 56)) == numBytes && !(libc.Xmemcmp(tls, word, str, libc.Uint64FromInt64(numBytes)) != 0) { /* * Exact match! Excellent! */ result = XTcl_DictObjGet(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i)*8)), bp+16) if result != TCL_OK || *(*uintptr)(unsafe.Pointer(bp + 16)) == libc.UintptrFromInt32(0) { goto tryCompileToInv } replacement = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i)*8)) goto doneMapLookup } /* * Check to see if we've got a prefix match. A single prefix match * is fine, and allows us to refine our dictionary lookup, but * multiple prefix matches is a Bad Thing and will prevent us from * making progress. Note that we cannot do the lookup immediately * in the prefix case; might be another entry later in the list * that causes things to fail. */ if *(*int32)(unsafe.Pointer(bp + 40))&int32(TCL_ENSEMBLE_PREFIX) != 0 && libc.Xstrncmp(tls, word, str, libc.Uint64FromInt64(numBytes)) == 0 { if matchObj != libc.UintptrFromInt32(0) { goto tryCompileToInv } matchObj = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(i)*8)) } goto _5 _5: ; i++ } if matchObj == libc.UintptrFromInt32(0) { goto tryCompileToInv } result = XTcl_DictObjGet(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), matchObj, bp+16) if result != TCL_OK || *(*uintptr)(unsafe.Pointer(bp + 16)) == libc.UintptrFromInt32(0) { goto tryCompileToInv } replacement = matchObj } else { /* * No map, so check the dictionary directly. */ if v7 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v7 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v7 || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == libc.Uint64FromInt32(0) { *(*uintptr)(unsafe.Pointer(bp + 8)) = XTclThreadAllocObj(tls) } else { *(*uintptr)(unsafe.Pointer(bp + 8)) = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FrefCount = 0 if numBytes == 0 { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(numBytes+libc.Int64FromUint32(1))) if word != 0 { v8 = word } else { v8 = uintptr(unsafe.Pointer(&XtclEmptyString)) } libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes, v8, libc.Uint64FromInt64(numBytes)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes + uintptr(numBytes))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = numBytes } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr = libc.UintptrFromInt32(0) result = XTcl_DictObjGet(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), bp+16) if result == TCL_OK && *(*uintptr)(unsafe.Pointer(bp + 16)) != libc.UintptrFromInt32(0) { /* * Got it. Skip the fiddling around with prefixes. */ replacement = *(*uintptr)(unsafe.Pointer(bp + 8)) goto doneMapLookup } v10 = *(*uintptr)(unsafe.Pointer(bp + 8)) v9 = *(*TTcl_Size)(unsafe.Pointer(v10)) *(*TTcl_Size)(unsafe.Pointer(v10))-- if !(v9 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Flength = int64(-libc.Int32FromInt32(1)) if v11 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v11 { cachePtr2 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v11 || ((*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr2)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TAllocCache)(unsafe.Pointer(cachePtr2)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } } /* * We've not literally got a valid subcommand. But maybe we have a * prefix. Check if prefix matches are allowed. */ if !(*(*int32)(unsafe.Pointer(bp + 40))&libc.Int32FromInt32(TCL_ENSEMBLE_PREFIX) != 0) { goto tryCompileToInv } /* * Iterate over the keys in the dictionary, checking to see if we're a * prefix. */ XTcl_DictObjFirst(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp)), bp+64, bp+8, bp+96, bp+88) matched = 0 replacement = libc.UintptrFromInt32(0) /* Silence, fool compiler! */ for !(*(*int32)(unsafe.Pointer(bp + 88)) != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes != 0 { v12 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).Fbytes } else { v12 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), libc.UintptrFromInt32(0)) } if libc.Xstrncmp(tls, v12, word, libc.Uint64FromInt64(numBytes)) == 0 { v13 = matched matched++ if v13 != 0 { /* * Must have matched twice! Not unique, so no point * looking further. */ break } replacement = *(*uintptr)(unsafe.Pointer(bp + 8)) *(*uintptr)(unsafe.Pointer(bp + 16)) = *(*uintptr)(unsafe.Pointer(bp + 96)) } XTcl_DictObjNext(tls, bp+64, bp+8, bp+96, bp+88) } XTcl_DictObjDone(tls, bp+64) /* * If we have anything other than a single match, we've failed the * unique prefix check. */ if matched != int32(1) { invokeAnyway = int32(1) goto tryCompileToInv } } /* * OK, we definitely map to something. But what? * * The command we map to is the first word out of the map element. Note * that we also reject dealing with multi-element rewrites if we are in a * safe interpreter, as there is otherwise a (highly gnarly!) way to make * Tcl crash open to exploit. */ goto doneMapLookup doneMapLookup: ; XTcl_ListObjAppendElement(tls, libc.UintptrFromInt32(0), replaced, replacement) if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr2 != 0 { v15 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr2)).FspanStart } else { v15 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 32)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 + 40 + uintptr(v15)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr2 != 0 { v16 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr2)).FspanLength } else { v16 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 48)) = v16 v14 = libc.Int32FromInt32(TCL_OK) } else { v14 = XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(bp + 16)), bp+48, bp+32) } if v14 != TCL_OK { goto tryCompileToInv } else { if *(*TTcl_Size)(unsafe.Pointer(bp + 48)) != int64(1) { /* * Note that at this point we know we can't issue any special * instruction sequence as the mapping isn't one that we support at * the compiled level. */ goto cleanup } } *(*uintptr)(unsafe.Pointer(bp + 16)) = *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))) oldCmdPtr = cmdPtr (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FrefCount++ newCmdPtr = XTcl_GetCommandFromObj(tls, interp, *(*uintptr)(unsafe.Pointer(bp + 16))) v18 = *(*uintptr)(unsafe.Pointer(bp + 16)) v17 = *(*TTcl_Size)(unsafe.Pointer(v18)) *(*TTcl_Size)(unsafe.Pointer(v18))-- if !(v17 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).Flength = int64(-libc.Int32FromInt32(1)) if v19 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v19 { cachePtr3 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v19 || ((*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)) + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr3)).FfirstObjPtr = *(*uintptr)(unsafe.Pointer(bp + 16)) (*TAllocCache)(unsafe.Pointer(cachePtr3)).FnumObjects++ } } else { XTclFreeObj(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } } if newCmdPtr == libc.UintptrFromInt32(0) || XTcl_IsSafe(tls, interp) != 0 && !((*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc != 0) || (*TNamespace)(unsafe.Pointer((*TCommand)(unsafe.Pointer(newCmdPtr)).FnsPtr)).Fflags&int32(NS_SUPPRESS_COMPILATION) != 0 || (*TCommand)(unsafe.Pointer(newCmdPtr)).Fflags&int32(CMD_HAS_EXEC_TRACES) != 0 || (*TInterp)(unsafe.Pointer(interp)).Fflags&int32(DONT_COMPILE_CMDS_INLINE) != 0 { /* * Maps to an undefined command or a command without a compiler. * Cannot compile. */ goto cleanup } cmdPtr = newCmdPtr depth++ /* * See whether we have a nested ensemble. If we do, we can go round the * mulberry bush again, consuming the next word. */ if (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc == __ccgo_fp(XTclCompileEnsemble) { tokenPtr = tokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < depth+int32(1) || (*TTcl_Token)(unsafe.Pointer(tokenPtr)).Ftype1 != int32(TCL_TOKEN_SIMPLE_WORD) { /* * Too hard because the user has done something unpleasant like * omitting the sub-ensemble's command name or used a non-constant * name for a sub-ensemble's command name; we respond by bailing * out completely (this is a rare case). [Bug 6d2f249a01] */ goto cleanup } ensemble = cmdPtr goto checkNextWord } /* * Now that the mapping process is done we actually try to compile. * If there is a subcommand compiler and that successfully produces code, * we'll use that. Otherwise, we fall back to generating opcodes to do the * invoke at runtime. */ invokeAnyway = int32(1) if TCL_OK == XTclAttemptCompileProc(tls, interp, parsePtr, int64(depth), cmdPtr, envPtr) { ourResult = TCL_OK goto cleanup } /* * Throw out any line information generated by the failed compile attempt. */ for (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc > eclIndex+int64(1) { (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc-- XTclpFree(tls, (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc)*32))).Fline) (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc)*32))).Fline = libc.UintptrFromInt32(0) } /* * Reset the index of next command. Toss out any from failed nested * partial compiles. */ (*TCompileEnv)(unsafe.Pointer(envPtr)).FnumCommands = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc /* * Failed to do a full compile for some reason. Try to do a direct invoke * instead of going through the ensemble lookup process again. */ goto tryCompileToInv tryCompileToInv: ; if depth < int32(250) { if depth > int32(1) { if !(invokeAnyway != 0) { cmdPtr = oldCmdPtr depth-- } } /* * The length of the "replaced" list must be depth-1. Trim back * any extra elements that might have been appended by failing * pathways above. */ XTcl_ListObjReplace(tls, libc.UintptrFromInt32(0), replaced, int64(depth-int32(1)), libc.Int64FromUint64((libc.Uint64FromInt64(libc.Int64FromUint64(libc.Uint64FromInt32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(1)))-uint64(libc.UintptrFromInt32(0)+40))/libc.Uint64FromInt64(8)), 0, libc.UintptrFromInt32(0)) /* * TODO: Reconsider whether we ought to call CompileToInvokedCommand() * when depth==1. In that case we are choosing to emit the * INST_INVOKE_REPLACE bytecode when there is in fact no replacing * to be done. It would be equally functional and presumably more * performant to fall through to cleanup below, return TCL_ERROR, * and let the compiler harness emit the INST_INVOKE_STK * implementation for us. */ _CompileToInvokedCommand(tls, interp, parsePtr, replaced, cmdPtr, envPtr) ourResult = TCL_OK } /* * Release the memory we allocated. If we've got here, we've either done * something useful or we're in a case that we can't compile at all and * we're just giving up. */ goto cleanup cleanup: ; _objPtr = replaced v21 = _objPtr v20 = *(*TTcl_Size)(unsafe.Pointer(v21)) *(*TTcl_Size)(unsafe.Pointer(v21))-- if v20 <= int64(1) { XTclFreeObj(tls, _objPtr) } return ourResult } func XTclAttemptCompileProc(tls *libc.TLS, interp uintptr, parsePtr uintptr, depth TTcl_Size, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ var auxDataEnd, auxDataPtr, auxPtr, mapPtr, saveTokenPtr uintptr var eclIndex, i, savedAuxDataArrayNext, savedCodeNext, savedExceptArrayNext, savedStackDepth TTcl_Size var result int32 _, _, _, _, _, _, _, _, _, _, _, _ = auxDataEnd, auxDataPtr, auxPtr, eclIndex, i, mapPtr, result, saveTokenPtr, savedAuxDataArrayNext, savedCodeNext, savedExceptArrayNext, savedStackDepth mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) saveTokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr savedStackDepth = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth savedCodeNext = int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext) - int64((*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart) savedAuxDataArrayNext = (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext savedExceptArrayNext = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext if (*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc == libc.UintptrFromInt32(0) { return int32(TCL_ERROR) } /* * Advance parsePtr->tokenPtr so that it points at the last subcommand. * This will be wrong but it will not matter, and it will put the * tokens for the arguments in the right place without the need to * allocate a synthetic Tcl_Parse struct or copy tokens around. */ i = 0 for { if !(i < depth-int64(1)) { break } (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr + uintptr((*TTcl_Token)(unsafe.Pointer((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr)).FnumComponents+libc.Int64FromInt32(1))*32 goto _1 _1: ; i++ } *(*TTcl_Size)(unsafe.Pointer(parsePtr + 32)) -= depth - int64(1) /* * Shift the line information arrays to account for different word * index values. */ (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline += uintptr(depth-libc.Int64FromInt32(1)) * 8 (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext += uintptr(depth-libc.Int64FromInt32(1)) * 8 /* * Hand off compilation to the subcommand compiler. At last! */ result = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TCommand)(unsafe.Pointer(cmdPtr)).FcompileProc})))(tls, interp, parsePtr, cmdPtr, envPtr) /* * Undo the shift. */ (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline -= uintptr(depth-libc.Int64FromInt32(1)) * 8 (*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext -= uintptr(depth-libc.Int64FromInt32(1)) * 8 *(*TTcl_Size)(unsafe.Pointer(parsePtr + 32)) += depth - int64(1) (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr = saveTokenPtr /* * If our target failed to compile, revert any data from failed partial * compiles. Note that envPtr->numCommands need not be checked because * we avoid compiling subcommands that recursively call TclCompileScript(). */ if result != TCL_OK { auxPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptAuxArrayPtr i = 0 for { if !(i < savedExceptArrayNext) { break } for (*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets > 0 && libc.Int64FromUint64(*(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FbreakTargets + uintptr((*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets-int64(1))*8))) >= savedCodeNext { (*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumBreakTargets-- } for (*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets > 0 && libc.Int64FromUint64(*(*Tsize_t)(unsafe.Pointer((*TExceptionAux)(unsafe.Pointer(auxPtr)).FcontinueTargets + uintptr((*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets-int64(1))*8))) >= savedCodeNext { (*TExceptionAux)(unsafe.Pointer(auxPtr)).FnumContinueTargets-- } auxPtr += 80 goto _2 _2: ; i++ } (*TCompileEnv)(unsafe.Pointer(envPtr)).FexceptArrayNext = savedExceptArrayNext if savedAuxDataArrayNext != (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext { auxDataPtr = (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayPtr auxDataEnd = auxDataPtr auxDataPtr += uintptr(savedAuxDataArrayNext) * 16 auxDataEnd += uintptr((*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext) * 16 for auxDataPtr < auxDataEnd { if (*TAuxDataType)(unsafe.Pointer((*TAuxData)(unsafe.Pointer(auxDataPtr)).Ftype1)).FfreeProc != libc.UintptrFromInt32(0) { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TAuxDataType)(unsafe.Pointer((*TAuxData)(unsafe.Pointer(auxDataPtr)).Ftype1)).FfreeProc})))(tls, (*TAuxData)(unsafe.Pointer(auxDataPtr)).FclientData) } auxDataPtr += 16 } (*TCompileEnv)(unsafe.Pointer(envPtr)).FauxDataArrayNext = savedAuxDataArrayNext } (*TCompileEnv)(unsafe.Pointer(envPtr)).FcurrStackDepth = savedStackDepth (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeNext = (*TCompileEnv)(unsafe.Pointer(envPtr)).FcodeStart + uintptr(savedCodeNext) } return result } /* * How to compile a subcommand to a _replacing_ invoke of its implementation * command. */ func _CompileToInvokedCommand(tls *libc.TLS, interp uintptr, parsePtr uintptr, replacements uintptr, cmdPtr uintptr, envPtr2 uintptr) { bp := tls.Alloc(48) defer tls.Free(48) /* Holds resulting instructions. */ var _objIndexCopy, _objIndexCopy1, _objIndexCopy2, cmdLit, delta1, extraLiteralFlags, literal, v10, v22, v28, v40, v48, v60 int32 var bytes, cachePtr, cachePtr1, mapPtr, objPtr, tokPtr, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v23, v24, v25, v26, v27, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v41, v43, v44, v45, v46, v47, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v61, v63, v7, v8, v9 uintptr var eclIndex, i1, v62 TTcl_Size var v2, v3 int64 var v42, v64 bool var _ /* length at bp+16 */ TTcl_Size var _ /* numWords at bp+8 */ TTcl_Size var _ /* words at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objIndexCopy, _objIndexCopy1, _objIndexCopy2, bytes, cachePtr, cachePtr1, cmdLit, delta1, eclIndex, extraLiteralFlags, i1, literal, mapPtr, objPtr, tokPtr, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v7, v8, v9 mapPtr = (*TCompileEnv)(unsafe.Pointer(envPtr2)).FextCmdMapPtr eclIndex = (*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Fnuloc - int64(1) extraLiteralFlags = int32(LITERAL_CMD_NAME) /* * Push the words of the command. Take care; the command words may be * scripts that have backslashes in them, and [info frame 0] can see the * difference. Hence the call to TclContinuationsEnterDerived... */ if (*TTcl_Obj)(unsafe.Pointer(replacements)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(replacements + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(replacements + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(replacements + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(replacements + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(replacements + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(replacements + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(replacements + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp + 8)) = v3 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), replacements, bp+8, bp) } i1 = 0 tokPtr = (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr for { if !(i1 < (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) { break } if i1 > 0 && i1 <= *(*TTcl_Size)(unsafe.Pointer(bp + 8)) { if (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i1-int64(1))*8)))).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i1-int64(1))*8)))).Flength v5 = (*TTcl_Obj)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i1-int64(1))*8)))).Fbytes } else { v5 = XTcl_GetStringFromObj(tls, *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + uintptr(i1-int64(1))*8)), bp+16) } bytes = v5 _objIndexCopy = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 16)), 0) if _objIndexCopy <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v7 = envPtr2 + 152 v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7))++ *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v9 = envPtr2 + 152 v8 = *(*uintptr)(unsafe.Pointer(v9)) *(*uintptr)(unsafe.Pointer(v9))++ *(*uint8)(unsafe.Pointer(v8)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v10 = delta1 v11 = envPtr2 if v10 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v11)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v11)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v11 + 64)) += int64(v10) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v13 = envPtr2 + 152 v12 = *(*uintptr)(unsafe.Pointer(v13)) *(*uintptr)(unsafe.Pointer(v13))++ *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v15 = envPtr2 + 152 v14 = *(*uintptr)(unsafe.Pointer(v15)) *(*uintptr)(unsafe.Pointer(v15))++ *(*uint8)(unsafe.Pointer(v14)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(24)) v17 = envPtr2 + 152 v16 = *(*uintptr)(unsafe.Pointer(v17)) *(*uintptr)(unsafe.Pointer(v17))++ *(*uint8)(unsafe.Pointer(v16)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(16)) v19 = envPtr2 + 152 v18 = *(*uintptr)(unsafe.Pointer(v19)) *(*uintptr)(unsafe.Pointer(v19))++ *(*uint8)(unsafe.Pointer(v18)) = uint8(libc.Uint32FromInt32(_objIndexCopy) >> libc.Int32FromInt32(8)) v21 = envPtr2 + 152 v20 = *(*uintptr)(unsafe.Pointer(v21)) *(*uintptr)(unsafe.Pointer(v21))++ *(*uint8)(unsafe.Pointer(v20)) = uint8(libc.Uint32FromInt32(_objIndexCopy)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy } v22 = delta1 v23 = envPtr2 if v22 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v23)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v23)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v23 + 64)) += int64(v22) } } goto _4 } (*TCompileEnv)(unsafe.Pointer(envPtr2)).Fline = *(*TTcl_Size)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fline + uintptr(i1)*8)) (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext = *(*uintptr)(unsafe.Pointer((*(*TECL)(unsafe.Pointer((*TExtCmdLoc)(unsafe.Pointer(mapPtr)).Floc + uintptr(eclIndex)*32))).Fnext + uintptr(i1)*8)) if (*TTcl_Token)(unsafe.Pointer(tokPtr)).Ftype1 == int32(TCL_TOKEN_SIMPLE_WORD) { literal = XTclRegisterLiteral(tls, envPtr2, (*(*TTcl_Token)(unsafe.Pointer(tokPtr + 1*32))).Fstart, (*(*TTcl_Token)(unsafe.Pointer(tokPtr + 1*32))).Fsize, 0) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext != 0 { XTclContinuationsEnterDerived(tls, XTclFetchLiteral(tls, envPtr2, int64(literal)), int64((*(*TTcl_Token)(unsafe.Pointer(tokPtr + 1*32))).Fstart)-int64((*TCompileEnv)(unsafe.Pointer(envPtr2)).Fsource), (*TCompileEnv)(unsafe.Pointer(envPtr2)).FclNext) } _objIndexCopy1 = literal if _objIndexCopy1 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v25 = envPtr2 + 152 v24 = *(*uintptr)(unsafe.Pointer(v25)) *(*uintptr)(unsafe.Pointer(v25))++ *(*uint8)(unsafe.Pointer(v24)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v27 = envPtr2 + 152 v26 = *(*uintptr)(unsafe.Pointer(v27)) *(*uintptr)(unsafe.Pointer(v27))++ *(*uint8)(unsafe.Pointer(v26)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v28 = delta1 v29 = envPtr2 if v28 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v29)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v29)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v29 + 64)) += int64(v28) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v31 = envPtr2 + 152 v30 = *(*uintptr)(unsafe.Pointer(v31)) *(*uintptr)(unsafe.Pointer(v31))++ *(*uint8)(unsafe.Pointer(v30)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v33 = envPtr2 + 152 v32 = *(*uintptr)(unsafe.Pointer(v33)) *(*uintptr)(unsafe.Pointer(v33))++ *(*uint8)(unsafe.Pointer(v32)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(24)) v35 = envPtr2 + 152 v34 = *(*uintptr)(unsafe.Pointer(v35)) *(*uintptr)(unsafe.Pointer(v35))++ *(*uint8)(unsafe.Pointer(v34)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(16)) v37 = envPtr2 + 152 v36 = *(*uintptr)(unsafe.Pointer(v37)) *(*uintptr)(unsafe.Pointer(v37))++ *(*uint8)(unsafe.Pointer(v36)) = uint8(libc.Uint32FromInt32(_objIndexCopy1) >> libc.Int32FromInt32(8)) v39 = envPtr2 + 152 v38 = *(*uintptr)(unsafe.Pointer(v39)) *(*uintptr)(unsafe.Pointer(v39))++ *(*uint8)(unsafe.Pointer(v38)) = uint8(libc.Uint32FromInt32(_objIndexCopy1)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy1 } v40 = delta1 v41 = envPtr2 if v40 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v41)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v41)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v41 + 64)) += int64(v40) } } } else { XTclCompileTokens(tls, interp, tokPtr+uintptr(1)*32, libc.Uint64FromInt64((*TTcl_Token)(unsafe.Pointer(tokPtr)).FnumComponents), envPtr2) } goto _4 _4: ; i1++ tokPtr = tokPtr + uintptr((*TTcl_Token)(unsafe.Pointer(tokPtr)).FnumComponents+libc.Int64FromInt32(1))*32 } /* * Push the name of the command we're actually dispatching to as part of * the implementation. */ if v42 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v42 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v42 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) XTcl_GetCommandFullName(tls, interp, cmdPtr, objPtr) if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 { *(*TTcl_Size)(unsafe.Pointer(bp + 16)) = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength v43 = (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes } else { v43 = XTcl_GetStringFromObj(tls, objPtr, bp+16) } bytes = v43 if cmdPtr != libc.UintptrFromInt32(0) && (*TCommand)(unsafe.Pointer(cmdPtr)).Fflags&int32(CMD_VIA_RESOLVER) != 0 { extraLiteralFlags |= int32(LITERAL_UNSHARED) } cmdLit = XTclRegisterLiteral(tls, envPtr2, bytes, *(*TTcl_Size)(unsafe.Pointer(bp + 16)), extraLiteralFlags) XTclSetCmdNameObj(tls, interp, XTclFetchLiteral(tls, envPtr2, int64(cmdLit)), cmdPtr) _objIndexCopy2 = cmdLit if _objIndexCopy2 <= int32(255) { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(2) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v45 = envPtr2 + 152 v44 = *(*uintptr)(unsafe.Pointer(v45)) *(*uintptr)(unsafe.Pointer(v45))++ *(*uint8)(unsafe.Pointer(v44)) = libc.Uint8FromInt32(int32(INST_PUSH1)) v47 = envPtr2 + 152 v46 = *(*uintptr)(unsafe.Pointer(v47)) *(*uintptr)(unsafe.Pointer(v47))++ *(*uint8)(unsafe.Pointer(v46)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH1)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v48 = delta1 v49 = envPtr2 if v48 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v49)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v49)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v49 + 64)) += int64(v48) } } else { if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeNext+uintptr(5) > (*TCompileEnv)(unsafe.Pointer(envPtr2)).FcodeEnd { XTclExpandCodeArray(tls, envPtr2) } v51 = envPtr2 + 152 v50 = *(*uintptr)(unsafe.Pointer(v51)) *(*uintptr)(unsafe.Pointer(v51))++ *(*uint8)(unsafe.Pointer(v50)) = libc.Uint8FromInt32(int32(INST_PUSH4)) v53 = envPtr2 + 152 v52 = *(*uintptr)(unsafe.Pointer(v53)) *(*uintptr)(unsafe.Pointer(v53))++ *(*uint8)(unsafe.Pointer(v52)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(24)) v55 = envPtr2 + 152 v54 = *(*uintptr)(unsafe.Pointer(v55)) *(*uintptr)(unsafe.Pointer(v55))++ *(*uint8)(unsafe.Pointer(v54)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(16)) v57 = envPtr2 + 152 v56 = *(*uintptr)(unsafe.Pointer(v57)) *(*uintptr)(unsafe.Pointer(v57))++ *(*uint8)(unsafe.Pointer(v56)) = uint8(libc.Uint32FromInt32(_objIndexCopy2) >> libc.Int32FromInt32(8)) v59 = envPtr2 + 152 v58 = *(*uintptr)(unsafe.Pointer(v59)) *(*uintptr)(unsafe.Pointer(v59))++ *(*uint8)(unsafe.Pointer(v58)) = uint8(libc.Uint32FromInt32(_objIndexCopy2)) if (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart < int32(2) { (*TCompileEnv)(unsafe.Pointer(envPtr2)).FatCmdStart = 0 } delta1 = XtclInstructionTable[uint8(INST_PUSH4)].FstackEffect if delta1 != 0 { if delta1 == -libc.Int32FromInt32(1)-libc.Int32FromInt32(0x7fffffff) { delta1 = int32(1) - _objIndexCopy2 } v60 = delta1 v61 = envPtr2 if v60 < libc.Int32FromInt32(0) { if int32((*TCompileEnv)(unsafe.Pointer(v61)).FmaxStackDepth) < int32((*TCompileEnv)(unsafe.Pointer(v61)).FcurrStackDepth) { (*TCompileEnv)(unsafe.Pointer(v61)).FmaxStackDepth = (*TCompileEnv)(unsafe.Pointer(v61)).FcurrStackDepth } } *(*TTcl_Size)(unsafe.Pointer(v61 + 64)) += int64(v60) } } v63 = objPtr v62 = *(*TTcl_Size)(unsafe.Pointer(v63)) *(*TTcl_Size)(unsafe.Pointer(v63))-- if !(v62 > int64(1)) { if !((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr != 0) || !((*TTcl_ObjType)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr)).FfreeIntRepProc != 0) { if (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != 0 && (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes != uintptr(unsafe.Pointer(&XtclEmptyString)) { XTclpFree(tls, (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes) } (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = int64(-libc.Int32FromInt32(1)) if v64 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v64 { cachePtr1 = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v64 || ((*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects == uint64(0) || (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects >= uint64(ALLOC_NOBJHIGH)) { XTclThreadFreeObj(tls, objPtr) } else { (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 = (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FfirstObjPtr = objPtr (*TAllocCache)(unsafe.Pointer(cachePtr1)).FnumObjects++ } } else { XTclFreeObj(tls, objPtr) } } /* * Do the replacing dispatch. */ XTclEmitInvoke(tls, envPtr2, int32(INST_INVOKE_REPLACE), libc.VaList(bp+32, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords, *(*TTcl_Size)(unsafe.Pointer(bp + 8))+int64(1))) } /* * Helpers that do issuing of instructions for commands that "don't have * compilers" (well, they do; these). They all work by just generating base * code to invoke the command; they're intended for ensemble subcommands so * that the costs of INST_INVOKE_REPLACE can be avoided where we can work out * that they're not needed. * * Note that these are NOT suitable for commands where there's an argument * that is a script, as an [info level] or [info frame] in the inner context * can see the difference. */ func _CompileBasicNArgCommand(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ var _objPtr, cachePtr, objPtr, v3 uintptr var v1 bool var v2 TTcl_Size _, _, _, _, _, _ = _objPtr, cachePtr, objPtr, v1, v2, v3 if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { objPtr = XTclThreadAllocObj(tls) } else { objPtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(objPtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(objPtr)).Flength = 0 (*TTcl_Obj)(unsafe.Pointer(objPtr)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(objPtr)).FrefCount++ XTcl_GetCommandFullName(tls, interp, cmdPtr, objPtr) XTclCompileInvocation(tls, interp, (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FtokenPtr, objPtr, libc.Uint64FromInt64((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords), envPtr) _objPtr = objPtr v3 = _objPtr v2 = *(*TTcl_Size)(unsafe.Pointer(v3)) *(*TTcl_Size)(unsafe.Pointer(v3))-- if v2 <= int64(1) { XTclFreeObj(tls, _objPtr) } return TCL_OK } func XTclCompileBasic0ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(1) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasic1ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasic2ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasic3ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(4) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasic0Or1ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(1) && (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasic1Or2ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(2) && (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasic2Or3ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(3) && (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords != int64(4) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasic0To2ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < int64(1) || (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > int64(3) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasic1To3ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords < int64(2) || (*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords > int64(4) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasicMin0ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(1) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasicMin1ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(2) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } func XTclCompileBasicMin2ArgCmd(tls *libc.TLS, interp uintptr, parsePtr uintptr, cmdPtr uintptr, envPtr uintptr) (r int32) { /* Holds resulting instructions. */ /* * Verify that the number of arguments is correct; that's the only case * that we know will avoid the call to Tcl_WrongNumArgs() at invoke time, * which is the only code that sees the shenanigans of ensemble dispatch. */ if int32((*TTcl_Parse)(unsafe.Pointer(parsePtr)).FnumWords) < int32(3) { return int32(TCL_ERROR) } return _CompileBasicNArgCommand(tls, interp, parsePtr, cmdPtr, envPtr) } const tNTL = 0 const techar = 0 const tenviron = 0 /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ var _envMutex TTcl_Mutex /* To serialize access to environ. */ var _env struct { FcacheSize TTcl_Size Fcache uintptr FourEnviron uintptr FourEnvironSize TTcl_Size } /* *---------------------------------------------------------------------- * * TclSetupEnv -- * * This function is invoked for an interpreter to make environment * variables accessible from that interpreter via the "env" associative * array. * * Results: * None. * * Side effects: * The interpreter is added to a list of interpreters managed by us, so * that its view of envariables can be kept consistent with the view in * other interpreters. If this is the first call to TclSetupEnv, then * additional initialization happens, such as copying the environment to * dynamically-allocated space for ease of management. * *---------------------------------------------------------------------- */ func XTclSetupEnv(tls *libc.TLS, interp uintptr) { bp := tls.Alloc(368) defer tls.Free(368) /* Interpreter whose "env" array is to be * managed. */ var _objPtr, _objPtr1, _objPtr2, cachePtr, elemName, hPtr, obj1, obj2, p1, p2, varNamePtr, varPtr, v4, v6, v9 uintptr var i int32 var v1 bool var v3, v5, v8 TTcl_Size var _ /* arrayPtr at bp+0 */ uintptr var _ /* envString at bp+8 */ TTcl_DString var _ /* namesHash at bp+232 */ TTcl_HashTable var _ /* search at bp+336 */ TTcl_HashSearch _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, cachePtr, elemName, hPtr, i, obj1, obj2, p1, p2, varNamePtr, varPtr, v1, v3, v4, v5, v6, v8, v9 /* * Synchronize the values in the environ array with the contents of the * Tcl "env" variable. To do this: * 1) Remove the trace that fires when the "env" var is updated. * 2) Find the existing contents of the "env", storing in a hash table. * 3) Create/update elements for each environ variable, removing * elements from the hash table as we go. * 4) Remove the elements for each remaining entry in the hash table, * which must have existed before yet have no analog in the environ * variable. * 5) Add a trace that synchronizes the "env" array. */ XTcl_UntraceVar2(tls, interp, __ccgo_ts+30620, libc.UintptrFromInt32(0), libc.Int32FromInt32(TCL_GLOBAL_ONLY)|libc.Int32FromInt32(TCL_TRACE_WRITES)|libc.Int32FromInt32(TCL_TRACE_UNSETS)|libc.Int32FromInt32(TCL_TRACE_READS)|libc.Int32FromInt32(TCL_TRACE_ARRAY), __ccgo_fp(_EnvTraceProc), libc.UintptrFromInt32(0)) /* * Find out what elements are currently in the global env array. */ if v1 = libc.Bool(libc.UintptrFromInt32(0) == libc.UintptrFromInt32(0)); !v1 { cachePtr = (*TInterp)(unsafe.Pointer(libc.UintptrFromInt32(0))).FallocCache } if v1 || (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects == libc.Uint64FromInt32(0) { varNamePtr = XTclThreadAllocObj(tls) } else { varNamePtr = (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr (*TAllocCache)(unsafe.Pointer(cachePtr)).FfirstObjPtr = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(varNamePtr + 32))).Fptr1 (*TAllocCache)(unsafe.Pointer(cachePtr)).FnumObjects-- } (*TTcl_Obj)(unsafe.Pointer(varNamePtr)).FrefCount = 0 if libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1) == uint64(0) { (*TTcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes = uintptr(unsafe.Pointer(&XtclEmptyString)) (*TTcl_Obj)(unsafe.Pointer(varNamePtr)).Flength = int64(libc.Int32FromInt32(0)) } else { (*TTcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes = XTcl_Alloc(tls, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)+libc.Uint64FromUint32(1)) libc.Xmemcpy(tls, (*TTcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes, __ccgo_ts+30620, libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)) *(*uint8)(unsafe.Pointer((*TTcl_Obj)(unsafe.Pointer(varNamePtr)).Fbytes + uintptr(libc.Uint64FromInt64(4)-libc.Uint64FromInt32(1)))) = uint8('\000') (*TTcl_Obj)(unsafe.Pointer(varNamePtr)).Flength = libc.Int64FromUint64(libc.Uint64FromInt64(4) - libc.Uint64FromInt32(1)) } (*TTcl_Obj)(unsafe.Pointer(varNamePtr)).FtypePtr = libc.UintptrFromInt32(0) (*TTcl_Obj)(unsafe.Pointer(varNamePtr)).FrefCount++ XTcl_InitObjHashTable(tls, bp+232) varPtr = XTclObjLookupVarEx(tls, interp, varNamePtr, libc.UintptrFromInt32(0), int32(TCL_GLOBAL_ONLY), uintptr(0), 0, 0, bp) XTclFindArrayPtrElements(tls, varPtr, bp+232) /* * Go through the environment array and transfer its values into Tcl. At * the same time, remove those elements we add/update from the hash table * of existing elements, so that after this part processes, that table * will hold just the parts to remove. */ if *(*uintptr)(unsafe.Pointer(libc.Xenviron)) != libc.UintptrFromInt32(0) { XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_envMutex))) i = 0 for { if !(*(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(i)*8)) != libc.UintptrFromInt32(0)) { break } p1 = XTcl_ExternalToUtfDString(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(i)*8)), int64(-int32(1)), bp+8) if p1 == libc.UintptrFromInt32(0) { /* Ignore what cannot be decoded (should not happen) */ goto _2 } p2 = libc.Xstrchr(tls, p1, int32('=')) if p2 == libc.UintptrFromInt32(0) { /* * This condition seem to happen occasionally under some * versions of Solaris, or when encoding accidents swallow the * '='; ignore the entry. */ XTcl_DStringFree(tls, bp+8) goto _2 } p2++ *(*uint8)(unsafe.Pointer(p2 + uintptr(-libc.Int32FromInt32(1)))) = uint8('\000') obj1 = XTcl_NewStringObj(tls, p1, int64(-int32(1))) obj2 = XTcl_NewStringObj(tls, p2, int64(-int32(1))) XTcl_DStringFree(tls, bp+8) (*TTcl_Obj)(unsafe.Pointer(obj1)).FrefCount++ (*TTcl_Obj)(unsafe.Pointer(obj2)).FrefCount++ XTcl_ObjSetVar2(tls, interp, varNamePtr, obj1, obj2, int32(TCL_GLOBAL_ONLY)) hPtr = (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TTcl_HashTable)(unsafe.Pointer(bp + 232)).FfindProc})))(tls, bp+232, obj1) if hPtr != libc.UintptrFromInt32(0) { XTcl_DeleteHashEntry(tls, hPtr) } _objPtr = obj1 v4 = _objPtr v3 = *(*TTcl_Size)(unsafe.Pointer(v4)) *(*TTcl_Size)(unsafe.Pointer(v4))-- if v3 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = obj2 v6 = _objPtr1 v5 = *(*TTcl_Size)(unsafe.Pointer(v6)) *(*TTcl_Size)(unsafe.Pointer(v6))-- if v5 <= int64(1) { XTclFreeObj(tls, _objPtr1) } goto _2 _2: ; i++ } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_envMutex))) } /* * Delete those elements that existed in the array but which had no * counterparts in the environment array. */ hPtr = XTcl_FirstHashEntry(tls, bp+232, bp+336) for { if !(hPtr != libc.UintptrFromInt32(0)) { break } elemName = (*TTcl_HashEntry)(unsafe.Pointer(hPtr)).FclientData XTclObjUnsetVar2(tls, interp, varNamePtr, elemName, int32(TCL_GLOBAL_ONLY)) goto _7 _7: ; hPtr = XTcl_NextHashEntry(tls, bp+336) } XTcl_DeleteHashTable(tls, bp+232) _objPtr2 = varNamePtr v9 = _objPtr2 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr2) } /* * Re-establish the trace. */ XTcl_TraceVar2(tls, interp, __ccgo_ts+30620, libc.UintptrFromInt32(0), libc.Int32FromInt32(TCL_GLOBAL_ONLY)|libc.Int32FromInt32(TCL_TRACE_WRITES)|libc.Int32FromInt32(TCL_TRACE_UNSETS)|libc.Int32FromInt32(TCL_TRACE_READS)|libc.Int32FromInt32(TCL_TRACE_ARRAY), __ccgo_fp(_EnvTraceProc), libc.UintptrFromInt32(0)) } /* *---------------------------------------------------------------------- * * TclSetEnv -- * * Set an environment variable, replacing an existing value or creating a * new variable if there doesn't exist a variable by the given name. This * function is intended to be a stand-in for the UNIX "setenv" function * so that applications using that function will interface properly to * Tcl. To make it a stand-in, the Makefile must define "TclSetEnv" to * "setenv". * * Results: * None. * * Side effects: * The environ array gets updated. * *---------------------------------------------------------------------- */ func XTclSetEnv(tls *libc.TLS, name uintptr, value uintptr) { bp := tls.Alloc(240) defer tls.Free(240) /* New value for variable (UTF-8). */ var index, nameLength, valueLength TTcl_Size var newEnviron, oldEnv, oldValue, p, p2, v1 uintptr var _ /* envString at bp+0 */ TTcl_DString var _ /* length at bp+224 */ TTcl_Size _, _, _, _, _, _, _, _, _ = index, nameLength, newEnviron, oldEnv, oldValue, p, p2, valueLength, v1 /* * Figure out where the entry is going to go. If the name doesn't already * exist, enlarge the array if necessary to make room. If the name exists, * free its old entry. */ XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_envMutex))) index = XTclpFindVariable(tls, name, bp+224) if index == int64(-libc.Int32FromInt32(1)) { /* * We need to handle the case where the environment may be changed * outside our control. ourEnvironSize is only valid if the current * environment is the one we allocated. [Bug 979640] */ if _env.FourEnviron != libc.Xenviron || *(*TTcl_Size)(unsafe.Pointer(bp + 224))+int64(2) > _env.FourEnvironSize { newEnviron = XTcl_Alloc(tls, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 224))+libc.Int64FromInt32(5))*uint64(8)) libc.Xmemcpy(tls, newEnviron, libc.Xenviron, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp + 224)))*uint64(8)) if _env.FourEnvironSize != 0 && _env.FourEnviron != libc.UintptrFromInt32(0) { XTclpFree(tls, _env.FourEnviron) } v1 = newEnviron _env.FourEnviron = v1 libc.Xenviron = v1 _env.FourEnvironSize = *(*TTcl_Size)(unsafe.Pointer(bp + 224)) + int64(5) } index = *(*TTcl_Size)(unsafe.Pointer(bp + 224)) *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index+int64(1))*8)) = libc.UintptrFromInt32(0) oldValue = libc.UintptrFromInt32(0) nameLength = libc.Int64FromUint64(libc.Xstrlen(tls, name)) } else { /* * Compare the new value to the existing value. If they're the same * then quit immediately (e.g. don't rewrite the value or propagate it * to other interpreters). Otherwise, when there are N interpreters * there will be N! propagations of the same value among the * interpreters. */ oldEnv = XTcl_ExternalToUtfDString(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)), int64(-int32(1)), bp) if oldEnv == libc.UintptrFromInt32(0) || libc.Xstrcmp(tls, value, oldEnv+uintptr(*(*TTcl_Size)(unsafe.Pointer(bp + 224))+libc.Int64FromInt32(1))) == 0 { XTcl_DStringFree(tls, bp) /* OK even if oldEnv is NULL */ XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_envMutex))) return } XTcl_DStringFree(tls, bp) oldValue = *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)) nameLength = *(*TTcl_Size)(unsafe.Pointer(bp + 224)) } /* * Create a new entry. Build a complete UTF string that contains a * "name=value" pattern. Then convert the string to the native encoding, * and set the environ array value. */ valueLength = libc.Int64FromUint64(libc.Xstrlen(tls, value)) p = XTcl_Alloc(tls, libc.Uint64FromInt64(nameLength+valueLength+int64(2))) libc.Xmemcpy(tls, p, name, libc.Uint64FromInt64(nameLength)) *(*uint8)(unsafe.Pointer(p + uintptr(nameLength))) = uint8('=') libc.Xmemcpy(tls, p+uintptr(nameLength)+uintptr(1), value, libc.Uint64FromInt64(valueLength+int64(1))) p2 = XTcl_UtfToExternalDString(tls, libc.UintptrFromInt32(0), p, int64(-int32(1)), bp) if p2 == libc.UintptrFromInt32(0) { /* No way to signal error from here :-( but should not happen */ XTclpFree(tls, p) XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_envMutex))) return } /* * Copy the native string to heap memory. */ p = XTcl_Realloc(tls, p, libc.Uint64FromInt64((*TTcl_DString)(unsafe.Pointer(bp)).Flength)+uint64(1)) libc.Xmemcpy(tls, p, p2, libc.Uint64FromInt64((*TTcl_DString)(unsafe.Pointer(bp)).Flength)+uint64(1)) XTcl_DStringFree(tls, bp) *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)) = p /* * Watch out for versions of putenv that copy the string (e.g. VC++). In * this case we need to free the string immediately. Otherwise update the * string in the cache. */ if index != int64(-libc.Int32FromInt32(1)) && *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)) == p { _ReplaceString(tls, oldValue, p) } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_envMutex))) } /* *---------------------------------------------------------------------- * * Tcl_PutEnv -- * * Set an environment variable. Similar to setenv except that the * information is passed in a single string of the form NAME=value, * rather than as separate name strings. This function is intended to be * a stand-in for the UNIX "putenv" function so that applications using * that function will interface properly to Tcl. To make it a stand-in, * the Makefile will define "Tcl_PutEnv" to "putenv". * * Results: * None. * * Side effects: * The environ array gets updated, as do all of the interpreters that we * manage. * *---------------------------------------------------------------------- */ func XTcl_PutEnv(tls *libc.TLS, assignment uintptr) (r int32) { bp := tls.Alloc(224) defer tls.Free(224) /* Info about environment variable in the form * NAME=value. (native) */ var name, value uintptr var _ /* nameString at bp+0 */ TTcl_DString _, _ = name, value if assignment == libc.UintptrFromInt32(0) { return 0 } /* * First convert the native string to Utf. Then separate the string into * name and value parts, and call TclSetEnv to do all of the real work. */ name = XTcl_ExternalToUtfDString(tls, libc.UintptrFromInt32(0), assignment, int64(-libc.Int32FromInt32(1)), bp) value = libc.Xstrchr(tls, name, int32('=')) if value != libc.UintptrFromInt32(0) && value != name { *(*uint8)(unsafe.Pointer(value)) = uint8('\000') XTclSetEnv(tls, name, value+uintptr(1)) } XTclEnvEpoch++ XTcl_DStringFree(tls, bp) return 0 } /* *---------------------------------------------------------------------- * * TclUnsetEnv -- * * Remove an environment variable, updating the "env" arrays in all * interpreters managed by us. This function is intended to replace the * UNIX "unsetenv" function (but to do this the Makefile must be modified * to redefine "TclUnsetEnv" to "unsetenv". * * Results: * None. * * Side effects: * Interpreters are updated, as is environ. * *---------------------------------------------------------------------- */ func XTclUnsetEnv(tls *libc.TLS, name uintptr) { bp := tls.Alloc(16) defer tls.Free(16) /* Name of variable to remove (UTF-8). */ var envPtr, oldValue uintptr var index TTcl_Size var _ /* length at bp+0 */ TTcl_Size _, _, _ = envPtr, index, oldValue XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_envMutex))) index = XTclpFindVariable(tls, name, bp) /* * First make sure that the environment variable exists to avoid doing * needless work and to avoid recursion on the unset. */ if index == int64(-int32(1)) { XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_envMutex))) return } /* * Remember the old value so we can free it if Tcl created the string. */ oldValue = *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)) /* * Update the system environment. This must be done before we update the * interpreters or we will recurse. */ envPtr = libc.Xenviron + uintptr(index)*8 + libc.UintptrFromInt32(1)*8 for { *(*uintptr)(unsafe.Pointer(envPtr + uintptr(-libc.Int32FromInt32(1))*8)) = *(*uintptr)(unsafe.Pointer(envPtr)) if *(*uintptr)(unsafe.Pointer(envPtr)) == libc.UintptrFromInt32(0) { break } goto _1 _1: ; envPtr += 8 } _ReplaceString(tls, oldValue, libc.UintptrFromInt32(0)) XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_envMutex))) } /* *--------------------------------------------------------------------------- * * TclGetEnv -- * * Retrieve the value of an environment variable. * * Results: * The result is a pointer to a string specifying the value of the * environment variable, or NULL if that environment variable does not * exist. Storage for the result string is allocated in valuePtr; the * caller must call Tcl_DStringFree() when the result is no longer * needed. * * Side effects: * None. * *---------------------------------------------------------------------- */ func XTclGetEnv(tls *libc.TLS, name uintptr, valuePtr uintptr) (r uintptr) { bp := tls.Alloc(240) defer tls.Free(240) /* Uninitialized or free DString in which the * value of the environment variable is * stored. */ var index TTcl_Size var result uintptr var _ /* envStr at bp+8 */ TTcl_DString var _ /* length at bp+0 */ TTcl_Size _, _ = index, result XTcl_MutexLock(tls, uintptr(unsafe.Pointer(&_envMutex))) index = XTclpFindVariable(tls, name, bp) result = libc.UintptrFromInt32(0) if index != int64(-int32(1)) { result = XTcl_ExternalToUtfDString(tls, libc.UintptrFromInt32(0), *(*uintptr)(unsafe.Pointer(libc.Xenviron + uintptr(index)*8)), int64(-int32(1)), bp+8) if result != 0 { result += uintptr(*(*TTcl_Size)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(result))) == int32('=') { result++ XTcl_DStringInit(tls, valuePtr) XTcl_DStringAppend(tls, valuePtr, result, int64(-int32(1))) result = (*TTcl_DString)(unsafe.Pointer(valuePtr)).Fstring1 } else { result = libc.UintptrFromInt32(0) } XTcl_DStringFree(tls, bp+8) } } XTcl_MutexUnlock(tls, uintptr(unsafe.Pointer(&_envMutex))) return result } /* *---------------------------------------------------------------------- * * EnvTraceProc -- * * This function is invoked whenever an environment variable is read, * modified or deleted. It propagates the change to the global "environ" * array. * * Results: * Returns NULL to indicate success, or an error-message if the array * element being handled doesn't exist. * * Side effects: * Environment variable changes get propagated. If the whole "env" array * is deleted, then we stop managing things for this interpreter (usually * this happens because the whole interpreter is being deleted). * *---------------------------------------------------------------------- */ func _EnvTraceProc(tls *libc.TLS, dummy634 uintptr, interp uintptr, name1 uintptr, name2 uintptr, flags int32) (r uintptr) { bp := tls.Alloc(448) defer tls.Free(448) /* Indicates what's happening. */ var value, value1 uintptr var _ /* ds at bp+0 */ TTcl_DString var _ /* valueString at bp+224 */ TTcl_DString _, _ = value, value1 /* * For array traces, let TclSetupEnv do all the work. */ if flags&int32(TCL_TRACE_ARRAY) != 0 { XTclSetupEnv(tls, interp) XTclEnvEpoch++ return libc.UintptrFromInt32(0) } /* * If name2 is NULL, then return and do nothing. */ if name2 == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } /* * If a value is being set, call TclSetEnv to do all of the work. */ if flags&int32(TCL_TRACE_WRITES) != 0 { value = XTcl_GetVar2(tls, interp, __ccgo_ts+30620, name2, int32(TCL_GLOBAL_ONLY)) XTcl_DStringInit(tls, bp) if XTcl_UtfToExternalDStringEx(tls, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), name2, int64(-int32(1)), 0, bp, libc.UintptrFromInt32(0)) != TCL_OK { XTcl_DStringFree(tls, bp) return __ccgo_ts + 30624 } if XTcl_UtfToExternalDStringEx(tls, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0), value, int64(-int32(1)), 0, bp, libc.UintptrFromInt32(0)) != TCL_OK { XTcl_DStringFree(tls, bp) return __ccgo_ts + 30624 } XTcl_DStringFree(tls, bp) XTclSetEnv(tls, name2, value) XTclEnvEpoch++ } /* * If a value is being read, call TclGetEnv to do all of the work. */ if flags&int32(TCL_TRACE_READS) != 0 { value1 = XTclGetEnv(tls, name2, bp+224) if value1 == libc.UintptrFromInt32(0) { return __ccgo_ts + 30639 } XTcl_SetVar2(tls, interp, name1, name2, value1, 0) XTcl_DStringFree(tls, bp+224) } /* * For unset traces, let TclUnsetEnv do all the work. */ if flags&int32(TCL_TRACE_UNSETS) != 0 { XTclUnsetEnv(tls, name2) XTclEnvEpoch++ } return libc.UintptrFromInt32(0) } /* *---------------------------------------------------------------------- * * ReplaceString -- * * Replace one string with another in the environment variable cache. The * cache keeps track of all of the environment variables that Tcl has * modified so they can be freed later. * * Results: * None. * * Side effects: * May free the old string. * *---------------------------------------------------------------------- */ func _ReplaceString(tls *libc.TLS, oldStr uintptr, newStr uintptr) { /* New environment string. */ var growth int32 var i TTcl_Size _, _ = growth, i /* * Check to see if the old value was allocated by Tcl. If so, it needs to * be deallocated to avoid memory leaks. Note that this algorithm is O(n), * not O(1). This will result in n-squared behavior if lots of environment * changes are being made. */ i = 0 for { if !(i < _env.FcacheSize) { break } if *(*uintptr)(unsafe.Pointer(_env.Fcache + uintptr(i)*8)) == oldStr || *(*uintptr)(unsafe.Pointer(_env.Fcache + uintptr(i)*8)) == libc.UintptrFromInt32(0) { break } goto _1 _1: ; i++ } if i < _env.FcacheSize { /* * Replace or delete the old value. */ if *(*uintptr)(unsafe.Pointer(_env.Fcache + uintptr(i)*8)) != 0 { XTclpFree(tls, *(*uintptr)(unsafe.Pointer(_env.Fcache + uintptr(i)*8))) } if newStr != 0 { *(*uintptr)(unsafe.Pointer(_env.Fcache + uintptr(i)*8)) = newStr } else { for { if !(i < _env.FcacheSize-int64(1)) { break } *(*uintptr)(unsafe.Pointer(_env.Fcache + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_env.Fcache + uintptr(i+int64(1))*8)) goto _2 _2: ; i++ } *(*uintptr)(unsafe.Pointer(_env.Fcache + uintptr(_env.FcacheSize-int64(1))*8)) = libc.UintptrFromInt32(0) } } else { /* * We need to grow the cache in order to hold the new string. */ growth = int32(5) _env.Fcache = XTcl_Realloc(tls, _env.Fcache, libc.Uint64FromInt64(_env.FcacheSize+int64(growth))*uint64(8)) *(*uintptr)(unsafe.Pointer(_env.Fcache + uintptr(_env.FcacheSize)*8)) = newStr libc.Xmemset(tls, _env.Fcache+uintptr(_env.FcacheSize)*8+uintptr(1)*8, 0, libc.Uint64FromInt32(growth-libc.Int32FromInt32(1))*uint64(8)) _env.FcacheSize += int64(growth) } } /* *---------------------------------------------------------------------- * * TclFinalizeEnvironment -- * * This function releases any storage allocated by this module that isn't * still in use by the global environment. Any strings that are still in * the environment will be leaked. * * Results: * None. * * Side effects: * May deallocate storage. * *---------------------------------------------------------------------- */ func XTclFinalizeEnvironment(tls *libc.TLS) { /* * For now we just deallocate the cache array and none of the environment * strings. This may leak more memory that strictly necessary, since some * of the strings may no longer be in the environment. However, * determining which ones are ok to delete is n-squared, and is pretty * unlikely, so we don't bother. However, in the case of DPURIFY, just * free all strings in the cache. */ if _env.Fcache != 0 { XTclpFree(tls, _env.Fcache) _env.Fcache = libc.UintptrFromInt32(0) _env.FcacheSize = 0 if _env.FourEnviron != libc.UintptrFromInt32(0) { XTclpFree(tls, _env.FourEnviron) _env.FourEnviron = libc.UintptrFromInt32(0) } _env.FourEnvironSize = 0 } } const TCL_PATCH_LEVEL1 = "9.0.1+10a450bde9d304cbb6a4c2fa54ceaeea7de025dae402aff4c2884a2cce2ce595.gcc-1002.static.tommath-0103" const TCL_VERSION_UUID = 0 /* Epoch of the tcl environment * (if changed with tcl-env). */ /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * End: */ /* * The data structure below is used to report background errors. One such * structure is allocated for each error; it holds information about the * interpreter and the error until an idle handler command can be invoked. */ type TBgError = struct { FerrorMsg uintptr FreturnOpts uintptr FnextPtr uintptr } /* * One of the structures below is associated with the "tclBgError" assoc data * for each interpreter. It keeps track of the head and tail of the list of * pending background errors for the interpreter. */ type TErrAssocData = struct { Finterp uintptr FcmdPrefix uintptr FfirstBgPtr uintptr FlastBgPtr uintptr } /* * For each "vwait" event source a structure of the following type * is used: */ type TVwaitItem = struct { FdonePtr uintptr Fsequence int32 Fmask int32 FsourceObj uintptr } /* * For each exit handler created with a call to Tcl_Create(Late)ExitHandler * there is a structure of the following type: */ type TExitHandler = struct { Fproc uintptr FclientData uintptr FnextPtr uintptr } /* * There is both per-process and per-thread exit handlers. The first list is * controlled by a mutex. The other is in thread local storage. */ var _firstExitPtr = libc.UintptrFromInt32(0) // C documentation // // /* First in list of all exit handlers for // * application. */ var _firstLateExitPtr = libc.UintptrFromInt32(0) // C documentation // // /* First in list of all late exit handlers for // * application. */ var _exitMutex TTcl_Mutex /* * This variable is set to 1 when Tcl_Exit is called. The variable is checked * by TclInExit() to allow different behavior for exit-time processing, e.g., * in closing of files and pipes. */ var _inExit = int32(0) var _subsystemsInitialized = int32(0) var _ENCODING_ERROR = [29]uint8{10, 9, '(', 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g', ' ', 'e', 'r', 'r', 'o', 'r', ' ', 'i', 'n', ' ', 's', 't', 'd', 'e', 'r', 'r', ')'} /* * This variable contains the application wide exit handler. It will be called * by Tcl_Exit instead of the C-runtime exit if this variable is set to a * non-NULL value. */ var _appExitPtr = uintptr(0) func init() { p := unsafe.Pointer(&_appExitPtr) *(*uintptr)(unsafe.Add(p, 0)) = libc.UintptrFromInt32(0) } type TThreadSpecificData2 = struct { FfirstExitPtr uintptr FinExit int32 } var _dataKey1 TTcl_ThreadDataKey type TThreadClientData = struct { Fproc uintptr FclientData uintptr } /* *---------------------------------------------------------------------- * * Tcl_BackgroundException -- * * This function is invoked to handle errors that occur in Tcl commands * that are invoked in "background" (e.g. from event or timer bindings). * * Results: * None. * * Side effects: * A handler command is invoked later as an idle handler to process the * error, passing it the interp result and return options. * *---------------------------------------------------------------------- */ func XTcl_BackgroundException(tls *libc.TLS, interp uintptr, code int32) { /* The exception code value */ var assocPtr, errPtr uintptr _, _ = assocPtr, errPtr if code == TCL_OK { return } errPtr = XTcl_Alloc(tls, uint64(24)) (*TBgError)(unsafe.Pointer(errPtr)).FerrorMsg = XTcl_GetObjResult(tls, interp) (*TTcl_Obj)(unsafe.Pointer((*TBgError)(unsafe.Pointer(errPtr)).FerrorMsg)).FrefCount++ (*TBgError)(unsafe.Pointer(errPtr)).FreturnOpts = XTcl_GetReturnOptions(tls, interp, code) (*TTcl_Obj)(unsafe.Pointer((*TBgError)(unsafe.Pointer(errPtr)).FreturnOpts)).FrefCount++ (*TBgError)(unsafe.Pointer(errPtr)).FnextPtr = libc.UintptrFromInt32(0) XTclGetBgErrorHandler(tls, interp) assocPtr = XTcl_GetAssocData(tls, interp, __ccgo_ts+30656, libc.UintptrFromInt32(0)) if (*TErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr == libc.UintptrFromInt32(0) { (*TErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr = errPtr XTcl_DoWhenIdle(tls, __ccgo_fp(_HandleBgErrors), assocPtr) } else { (*TBgError)(unsafe.Pointer((*TErrAssocData)(unsafe.Pointer(assocPtr)).FlastBgPtr)).FnextPtr = errPtr } (*TErrAssocData)(unsafe.Pointer(assocPtr)).FlastBgPtr = errPtr XTcl_ResetResult(tls, interp) } /* *---------------------------------------------------------------------- * * HandleBgErrors -- * * This function is invoked as an idle handler to process all of the * accumulated background errors. * * Results: * None. * * Side effects: * Depends on what actions the handler command takes for the errors. * *---------------------------------------------------------------------- */ func _HandleBgErrors(tls *libc.TLS, clientData uintptr) { bp := tls.Alloc(32) defer tls.Free(32) /* Pointer to ErrAssocData structure. */ var _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, assocPtr, copyObj, errPtr, interp, options, tempObjv, v11, v13, v15, v5, v7, v9 uintptr var code int32 var errChannel TTcl_Channel var v10, v12, v14, v4, v6, v8 TTcl_Size var v2, v3 int64 var _ /* prefixObjc at bp+0 */ TTcl_Size var _ /* prefixObjv at bp+8 */ uintptr var _ /* valuePtr at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = _objPtr, _objPtr1, _objPtr2, _objPtr3, _objPtr4, _objPtr5, assocPtr, code, copyObj, errChannel, errPtr, interp, options, tempObjv, v10, v11, v12, v13, v14, v15, v2, v3, v4, v5, v6, v7, v8, v9 assocPtr = clientData interp = (*TErrAssocData)(unsafe.Pointer(assocPtr)).Finterp /* * Not bothering to save/restore the interp state. Assume that any code * that has interp state it needs to keep will make its own * Tcl_SaveInterpState call before calling something like Tcl_DoOneEvent() * that could lead us here. */ XTcl_Preserve(tls, assocPtr) XTcl_Preserve(tls, interp) for (*TErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr != libc.UintptrFromInt32(0) { /* * Note we copy the handler command prefix each pass through, so we do * support one handler setting another handler. */ copyObj = XTclListObjCopy(tls, libc.UintptrFromInt32(0), (*TErrAssocData)(unsafe.Pointer(assocPtr)).FcmdPrefix) errPtr = (*TErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr if (*TTcl_Obj)(unsafe.Pointer(copyObj)).FtypePtr == uintptr(unsafe.Pointer(&XtclListType)) { if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyObj + 32))).Fptr2 != 0 { v2 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyObj + 32))).Fptr2)).FspanStart } else { v2 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyObj + 32))).Fptr1)).FfirstUsed } *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyObj + 32))).Fptr1 + 40 + uintptr(v2)*8 if (*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyObj + 32))).Fptr2 != 0 { v3 = (*TListSpan)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyObj + 32))).Fptr2)).FspanLength } else { v3 = (*TListStore)(unsafe.Pointer((*(*struct { Fptr1 uintptr Fptr2 uintptr })(unsafe.Pointer(copyObj + 32))).Fptr1)).FnumUsed } *(*TTcl_Size)(unsafe.Pointer(bp)) = v3 _ = libc.Int32FromInt32(TCL_OK) } else { XTcl_ListObjGetElements(tls, libc.UintptrFromInt32(0), copyObj, bp, bp+8) } tempObjv = XTcl_Alloc(tls, libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp))+libc.Int64FromInt32(2))*uint64(8)) libc.Xmemcpy(tls, tempObjv, *(*uintptr)(unsafe.Pointer(bp + 8)), libc.Uint64FromInt64(*(*TTcl_Size)(unsafe.Pointer(bp)))*uint64(8)) *(*uintptr)(unsafe.Pointer(tempObjv + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp)))*8)) = (*TBgError)(unsafe.Pointer(errPtr)).FerrorMsg *(*uintptr)(unsafe.Pointer(tempObjv + uintptr(*(*TTcl_Size)(unsafe.Pointer(bp))+int64(1))*8)) = (*TBgError)(unsafe.Pointer(errPtr)).FreturnOpts XTcl_AllowExceptions(tls, interp) code = XTcl_EvalObjv(tls, interp, *(*TTcl_Size)(unsafe.Pointer(bp))+int64(2), tempObjv, int32(TCL_EVAL_GLOBAL)) /* * Discard the command and the information about the error report. */ _objPtr = copyObj v5 = _objPtr v4 = *(*TTcl_Size)(unsafe.Pointer(v5)) *(*TTcl_Size)(unsafe.Pointer(v5))-- if v4 <= int64(1) { XTclFreeObj(tls, _objPtr) } _objPtr1 = (*TBgError)(unsafe.Pointer(errPtr)).FerrorMsg v7 = _objPtr1 v6 = *(*TTcl_Size)(unsafe.Pointer(v7)) *(*TTcl_Size)(unsafe.Pointer(v7))-- if v6 <= int64(1) { XTclFreeObj(tls, _objPtr1) } _objPtr2 = (*TBgError)(unsafe.Pointer(errPtr)).FreturnOpts v9 = _objPtr2 v8 = *(*TTcl_Size)(unsafe.Pointer(v9)) *(*TTcl_Size)(unsafe.Pointer(v9))-- if v8 <= int64(1) { XTclFreeObj(tls, _objPtr2) } (*TErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr = (*TBgError)(unsafe.Pointer(errPtr)).FnextPtr XTclpFree(tls, errPtr) XTclpFree(tls, tempObjv) if code == int32(TCL_BREAK) { /* * Break means cancel any remaining error reports for this * interpreter. */ for (*TErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr != libc.UintptrFromInt32(0) { errPtr = (*TErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr (*TErrAssocData)(unsafe.Pointer(assocPtr)).FfirstBgPtr = (*TBgError)(unsafe.Pointer(errPtr)).FnextPtr _objPtr3 = (*TBgError)(unsafe.Pointer(errPtr)).FerrorMsg v11 = _objPtr3 v10 = *(*TTcl_Size)(unsafe.Pointer(v11)) *(*TTcl_Size)(unsafe.Pointer(v11))-- if v10 <= int64(1) { XTclFreeObj(tls, _objPtr3) } _objPtr4 = (*TBgError)(unsafe.Pointer(errPtr)).FreturnOpts v13 = _objPtr4 v12 = *(*TTcl_Size)(unsafe.Pointer(v13)) *(*TTcl_Size)(unsafe.Pointer(v13))-- if v12 <= int64(1) { XTclFreeObj(tls, _objPtr4) } XTclpFree(tls, errPtr) } } else { if code == int32(TCL_ERROR) && !(XTcl_IsSafe(tls, interp) != 0) { errChannel = XTcl_GetStdChannel(tls, libc.Int32FromInt32(1)<