https://bugs.winehq.org/show_bug.cgi?id=37117
Bug ID: 37117 Summary: PVS-Studio Error: Shifting a negative number Product: Wine Version: 1.7.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: lukebenes@hotmail.com
PVS-Studio Error: V610 Undefined behavior. Check the shift operator '<<. The left operand '(LONGLONG) - 1' is negative. propvar.c 127
... if (*res >= ((LONGLONG)1 << (dest_bits-1)) || *res < ((LONGLONG)-1 << (dest_bits-1))) return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); ...
The LONGLONG type is declared as 'typedef signed __int64 LONGLONG;', i.e. it is a signed type. According to the new standard, shifting negative numbers leads to undefined or unspecified behavior. To find out why such code still may work and how to fix it best, see the article Wade not in unknown waters - part three.
details on the V610 error here: http://www.viva64.com/en/d/0225/
https://bugs.winehq.org/show_bug.cgi?id=37117
Luke lukebenes@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |http://www.viva64.com/en/b/ | |0272/
https://bugs.winehq.org/show_bug.cgi?id=37117
--- Comment #1 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.51 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=37117
winetest@luukku.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest@luukku.com
--- Comment #2 from winetest@luukku.com --- The exact location is here
http://source.winehq.org/git/wine.git/blob/fa542355e97b943f6d58faf68e78c9b1c...
There has been no change wine 1.9.23.