Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
There are some checks for the max value that will fit in a short.
These are of the form:
if (Math.abs(value) >= 32767)
This seems wrong, as Short.MAX_VALUE = 32767, so the check should be
if (Math.abs(value) > 32767)
There's a further problem, which is that Short.MIN_VALUE = -32768.
This will be disallowed, unless the condition is written as:
if ((value >= -32768) && (value <= 32767))
This is how the ctor generic.PUSH.PUSH(ConstantPoolGen cp, int value) does the check.