From 7aaede4825001926ae223b8c47ef9e4d0d6021ba Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Sun, 12 Apr 2020 23:02:10 +0300 Subject: 12974 libc: left shift of negative value Reviewed by: Igor Kozhukhov Reviewed by: Gary Mills Approved by: Dan McDonald --- usr/src/lib/libc/port/gen/_ftoll.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'usr/src/lib') diff --git a/usr/src/lib/libc/port/gen/_ftoll.c b/usr/src/lib/libc/port/gen/_ftoll.c index 857a52b8a1..66d71f566c 100644 --- a/usr/src/lib/libc/port/gen/_ftoll.c +++ b/usr/src/lib/libc/port/gen/_ftoll.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "lint.h" #include #include @@ -104,7 +102,7 @@ __dtoll(double dval) default: if (exp > 30) { m1 = (m0 << (exp - 30)) | - (m1 >> (62 - exp)) & ~(-1 << (exp - 30)); + (m1 >> (62 - exp)) & ~(UINT_MAX << (exp - 30)); m0 >>= 62 - exp; } else { m1 = m0 >> (30 - exp); @@ -275,7 +273,7 @@ _Q_qtoll(long double longdbl) default: if (exp > 30) { m1 = (m0 << (exp - 30)) | - (m1 >> (62 - exp)) & ~(-1 << (exp - 30)); + (m1 >> (62 - exp)) & ~(UINT_MAX << (exp - 30)); m0 >>= 62 - exp; } else { m1 = m0 >> (30 - exp); -- cgit v1.2.3