Mercurial > hg > truffle
comparison src/share/vm/opto/macro.cpp @ 306:af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
Summary: Set offset to OffsetBot when the add overflows in TypePtr::add_offset()
Reviewed-by: jrose, never
author | kvn |
---|---|
date | Wed, 27 Aug 2008 14:47:32 -0700 |
parents | b0fe4deeb9fb |
children | f8199438385b |
comparison
equal
deleted
inserted
replaced
305:ab075d07f1ba | 306:af945ba2e739 |
---|---|
592 sobj->init_req(0, sfpt->in(TypeFunc::Control)); | 592 sobj->init_req(0, sfpt->in(TypeFunc::Control)); |
593 transform_later(sobj); | 593 transform_later(sobj); |
594 | 594 |
595 // Scan object's fields adding an input to the safepoint for each field. | 595 // Scan object's fields adding an input to the safepoint for each field. |
596 for (int j = 0; j < nfields; j++) { | 596 for (int j = 0; j < nfields; j++) { |
597 int offset; | 597 intptr_t offset; |
598 ciField* field = NULL; | 598 ciField* field = NULL; |
599 if (iklass != NULL) { | 599 if (iklass != NULL) { |
600 field = iklass->nonstatic_field_at(j); | 600 field = iklass->nonstatic_field_at(j); |
601 offset = field->offset(); | 601 offset = field->offset(); |
602 elem_type = field->type(); | 602 elem_type = field->type(); |
603 basic_elem_type = field->layout_type(); | 603 basic_elem_type = field->layout_type(); |
604 } else { | 604 } else { |
605 offset = array_base + j * element_size; | 605 offset = array_base + j * (intptr_t)element_size; |
606 } | 606 } |
607 | 607 |
608 const Type *field_type; | 608 const Type *field_type; |
609 // The next code is taken from Parse::do_get_xxx(). | 609 // The next code is taken from Parse::do_get_xxx(). |
610 if (basic_elem_type == T_OBJECT || basic_elem_type == T_ARRAY) { | 610 if (basic_elem_type == T_OBJECT || basic_elem_type == T_ARRAY) { |