FIX: JIT Loses Shift Results in Arrays (214621)
The information in this article applies to:
- Microsoft virtual machine
This article was previously published under Q214621 SYMPTOMS
When you perform a left-shift, a right-shift, or execute code that would
result in a right-shift (such as multiplication on an element of a byte or
short array where the result is immediately assigned back to the array),
you receive incorrect results. This problem only occurs in the Just In
Time (JIT) compiler found in versions 3100 - 3158 of the Microsoft virtual
machine.
CAUSE
This is caused by a bug in the JIT where certain shift operations are
incorrectly optimized. As a result, the shift operation is not executed,
effectively "commenting out" the instructions.
RESOLUTION
Create a temporary variable where the results of the operation can be
stored and then assigned back to the array element.
Another possible workaround is to turn off the JIT, although this can
cause some Java programs to run at a slower speed.
For additional information about the JIT, please see the following
article in the Microsoft Knowledge Base: STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This problem was corrected in Microsoft virtual machine builds 3165 and greater.
REFERENCES
For the latest Knowledge Base articles and other support information on
Visual J++ and the SDK for Java, see the following pages on the Microsoft
Technical Support site:
Modification Type: | Major | Last Reviewed: | 7/23/2001 |
---|
Keywords: | kbbug kbJIT KB214621 |
---|
|