mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
Set offset to OffsetBot when the add overflows in TypePtr::add_offset() Reviewed-by: jrose, never
This commit is contained in:
parent
37306315b2
commit
3c4879eb9a
6 changed files with 84 additions and 40 deletions
|
@ -594,7 +594,7 @@ bool PhaseMacroExpand::scalar_replacement(AllocateNode *alloc, GrowableArray <Sa
|
|||
|
||||
// Scan object's fields adding an input to the safepoint for each field.
|
||||
for (int j = 0; j < nfields; j++) {
|
||||
int offset;
|
||||
intptr_t offset;
|
||||
ciField* field = NULL;
|
||||
if (iklass != NULL) {
|
||||
field = iklass->nonstatic_field_at(j);
|
||||
|
@ -602,7 +602,7 @@ bool PhaseMacroExpand::scalar_replacement(AllocateNode *alloc, GrowableArray <Sa
|
|||
elem_type = field->type();
|
||||
basic_elem_type = field->layout_type();
|
||||
} else {
|
||||
offset = array_base + j * element_size;
|
||||
offset = array_base + j * (intptr_t)element_size;
|
||||
}
|
||||
|
||||
const Type *field_type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue