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:
Vladimir Kozlov 2008-08-27 14:47:32 -07:00
parent 37306315b2
commit 3c4879eb9a
6 changed files with 84 additions and 40 deletions

View file

@ -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;