summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-08 15:21:25 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-08 15:21:25 (GMT)
commitaaead6c7ae251886735590603d20616cc63a497f (patch)
treeb94cc228084f456d467f529b4427630df26a6bad /generic
parent9c28f4fc5f89366f31d58cf585b33aff028ea5d6 (diff)
downloadtcl-aaead6c7ae251886735590603d20616cc63a497f.zip
tcl-aaead6c7ae251886735590603d20616cc63a497f.tar.gz
tcl-aaead6c7ae251886735590603d20616cc63a497f.tar.bz2
Fix [1c7f179710]: undefined behavior for INST_LSHIFT in ExecuteExtendedBinaryMathOp()
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index b96eab4..a26aae1 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -8661,9 +8661,9 @@ ExecuteExtendedBinaryMathOp(
&& ((size_t)shift < CHAR_BIT*sizeof(Tcl_WideInt))) {
TclGetWideIntFromObj(NULL, valuePtr, &w1);
if (!((w1>0 ? w1 : ~w1)
- & -(((Tcl_WideInt)1)
+ & -(((Tcl_WideUInt)1)
<< (CHAR_BIT*sizeof(Tcl_WideInt) - 1 - shift)))) {
- WIDE_RESULT(w1 << shift);
+ WIDE_RESULT((Tcl_WideUInt)w1 << shift);
}
}
} else {