From ea37e7d256f526f2b60023754da3985b7e9842cc Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 23 Aug 2023 15:31:20 +0000 Subject: Backport [bae0d30c7f5047a4]. Don't suggest that TCL_UTF_MAX=1 might work any more. See: [457523] --- generic/tcl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index 2b6d8b7..01eafba 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2186,8 +2186,7 @@ typedef struct Tcl_EncodingType { /* * The maximum number of bytes that are necessary to represent a single - * Unicode character in UTF-8. The valid values should be 3, 4 or 6 - * (or perhaps 1 if we want to support a non-unicode enabled core). If 3 or + * Unicode character in UTF-8. The valid values should be 3, 4 or 6. If 3 or * 4, then Tcl_UniChar must be 2-bytes in size (UCS-2) (the default). If 6, * then Tcl_UniChar must be 4-bytes in size (UCS-4). At this time UCS-2 mode * is the default and recommended mode. UCS-4 is experimental and not -- cgit v0.12 From 813e29b286e73dc7e4d3a40eddb9aff2988689ad Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 23 Aug 2023 16:13:58 +0000 Subject: Fix [84a5355235] (not visible in 8.6, but meant to be forwared to 8.7) --- generic/tclExecute.c | 16 ++++++++-------- tests/expr.test | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 44ace68..3373079 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -4,12 +4,12 @@ * This file contains procedures that execute byte-compiled Tcl commands. * * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-2000 by Scriptics Corporation. - * Copyright (c) 2001 by Kevin B. Kenny. All rights reserved. - * Copyright (c) 2002-2010 by Miguel Sofer. - * Copyright (c) 2005-2007 by Donal K. Fellows. + * Copyright (c) 1998-2000 Scriptics Corporation. + * Copyright (c) 2001 Kevin B. Kenny. All rights reserved. + * Copyright (c) 2002-2010 Miguel Sofer. + * Copyright (c) 2005-2007 Donal K. Fellows. * Copyright (c) 2007 Daniel A. Steffen - * Copyright (c) 2006-2008 by Joe Mistachkin. All rights reserved. + * Copyright (c) 2006-2008 Joe Mistachkin. All rights reserved. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -6314,7 +6314,7 @@ TEBCresume( * Quickly force large right shifts to 0 or -1. */ - if (l2 >= (long)(CHAR_BIT*sizeof(long))) { + if (l2 >= (long)(CHAR_BIT*sizeof(l1))) { /* * We assume that INT_MAX is much larger than the * number of bits in a long. This is a pretty safe @@ -6382,9 +6382,9 @@ TEBCresume( * Handle shifts within the native long range. */ - if (((size_t) shift < CHAR_BIT*sizeof(long)) + if (((size_t) shift < CHAR_BIT*sizeof(l1)) && !((l1>0 ? l1 : ~l1) & - -(1UL<<(CHAR_BIT*sizeof(long) - 1 - shift)))) { + -(1UL<<(CHAR_BIT*sizeof(l1) - 1 - shift)))) { lResult = (unsigned long)l1 << shift; goto longResultOfArithmetic; } diff --git a/tests/expr.test b/tests/expr.test index 01f832e..2a0c7ed 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -1451,6 +1451,7 @@ test expr-24.8 {expr edge cases; shifting} {expr wide(10<<63)} 0 test expr-24.9 {expr edge cases; shifting} {expr 5>>32} 0 test expr-24.10 {INST_LSHIFT: Bug 1567222} {expr 500000000000000<<28} 134217728000000000000000 +test expr-24.11 {INST_LSHIFT: Bug 84a5355235} {expr -549755813888>>32} -128 # List membership tests test expr-25.1 {'in' operator} {expr {"a" in "a b c"}} 1 -- cgit v0.12