mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8150186: Folding mismatched accesses with @Stable is incorrect
Reviewed-by: kvn, jrose, shade
This commit is contained in:
parent
88575c5de7
commit
abebc2da5c
3 changed files with 81 additions and 4 deletions
|
@ -107,8 +107,9 @@ ciConstant ciArray::element_value_by_offset(intptr_t element_offset) {
|
|||
intptr_t header = arrayOopDesc::base_offset_in_bytes(elembt);
|
||||
intptr_t index = (element_offset - header) >> shift;
|
||||
intptr_t offset = header + ((intptr_t)index << shift);
|
||||
if (offset != element_offset || index != (jint)index)
|
||||
if (offset != element_offset || index != (jint)index || index < 0 || index >= length()) {
|
||||
return ciConstant();
|
||||
}
|
||||
return element_value((jint) index);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue