diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-08-23 20:18:27 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-08-23 20:18:27 (GMT) |
commit | 0290bc2e58cb093288dc525ba21d14af1beb127f (patch) | |
tree | 28b08237d407c42c048a19dcc5a287ad8a8d5e3e | |
parent | 264cdba5ac8f4b4e416b3cc5a519e5066b743304 (diff) | |
parent | 4408536018394acb35a880248f28f608650ca736 (diff) | |
download | tcl-0290bc2e58cb093288dc525ba21d14af1beb127f.zip tcl-0290bc2e58cb093288dc525ba21d14af1beb127f.tar.gz tcl-0290bc2e58cb093288dc525ba21d14af1beb127f.tar.bz2 |
Merge 8.7
-rw-r--r-- | generic/tclExecute.c | 6 | ||||
-rw-r--r-- | tests/expr.test | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index ecc9a5b..b177b4d 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5923,7 +5923,7 @@ TEBCresume( * Quickly force large right shifts to 0 or -1. */ - if (w2 >= (Tcl_WideInt)(CHAR_BIT*sizeof(long))) { + if (w2 >= (Tcl_WideInt)(CHAR_BIT*sizeof(w1))) { /* * We assume that INT_MAX is much larger than the * number of bits in a long. This is a pretty safe @@ -5991,9 +5991,9 @@ TEBCresume( * Handle shifts within the native long range. */ - if (((size_t)shift < CHAR_BIT*sizeof(long)) + if (((size_t)shift < CHAR_BIT*sizeof(w1)) && !((w1>0 ? w1 : ~w1) & - -(1UL<<(CHAR_BIT*sizeof(long) - 1 - shift)))) { + -(1UL<<(CHAR_BIT*sizeof(w1) - 1 - shift)))) { wResult = (Tcl_WideUInt)w1 << shift; goto wideResultOfArithmetic; } diff --git a/tests/expr.test b/tests/expr.test index 6ff8b21..bf60fed 100644 --- a/tests/expr.test +++ b/tests/expr.test @@ -1426,6 +1426,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 |