Skip to content

Commit 6a3a8ae

Browse files
author
jan.nijtmans
committed
Suggested fix for [b0f84119c8]: TEBCresume(): undefined behavior for INST_LSHIFT
1 parent 22325d1 commit 6a3a8ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

generic/tclExecute.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6379,10 +6379,10 @@ TEBCresume(
63796379
* Handle shifts within the native long range.
63806380
*/
63816381

6382-
if ((size_t) shift < CHAR_BIT*sizeof(long) && (l1 != 0)
6382+
if (((size_t) shift < CHAR_BIT*sizeof(long))
63836383
&& !((l1>0 ? l1 : ~l1) &
6384-
-(1L<<(CHAR_BIT*sizeof(long) - 1 - shift)))) {
6385-
lResult = l1 << shift;
6384+
-(1UL<<(CHAR_BIT*sizeof(long) - 1 - shift)))) {
6385+
lResult = (unsigned long)l1 << shift;
63866386
goto longResultOfArithmetic;
63876387
}
63886388
}

0 commit comments

Comments
 (0)