Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
P3
-
Resolution: Duplicate
-
Affects Version/s: 11, 13, 14
-
Fix Version/s: None
-
Component/s: hotspot
-
Labels:
Description
The java/lang/StackFrameInfo class declares a field called 'bci' with type short.
The support in the JVM to update this field incorrectly uses a method writing an int:
void java_lang_StackFrameInfo::set_bci(oop element, int value) {
element->int_field_put(_bci_offset, value);
}
The size of an int being 4 bytes, and the size of a short being 2 bytes, when this method is called, it overwrites the next two bytes after the bci field.
Correct implementation of this method is:
void java_lang_StackFrameInfo::set_bci(oop element, int value) {
element->short_field_put(_bci_offset, value);
}
The support in the JVM to update this field incorrectly uses a method writing an int:
void java_lang_StackFrameInfo::set_bci(oop element, int value) {
element->int_field_put(_bci_offset, value);
}
The size of an int being 4 bytes, and the size of a short being 2 bytes, when this method is called, it overwrites the next two bytes after the bci field.
Correct implementation of this method is:
void java_lang_StackFrameInfo::set_bci(oop element, int value) {
element->short_field_put(_bci_offset, value);
}