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
|
@ -573,8 +573,6 @@ const Type *AddPNode::bottom_type() const {
|
|||
intptr_t txoffset = Type::OffsetBot;
|
||||
if (tx->is_con()) { // Left input is an add of a constant?
|
||||
txoffset = tx->get_con();
|
||||
if (txoffset != (int)txoffset)
|
||||
txoffset = Type::OffsetBot; // oops: add_offset will choke on it
|
||||
}
|
||||
return tp->add_offset(txoffset);
|
||||
}
|
||||
|
@ -595,8 +593,6 @@ const Type *AddPNode::Value( PhaseTransform *phase ) const {
|
|||
intptr_t p2offset = Type::OffsetBot;
|
||||
if (p2->is_con()) { // Left input is an add of a constant?
|
||||
p2offset = p2->get_con();
|
||||
if (p2offset != (int)p2offset)
|
||||
p2offset = Type::OffsetBot; // oops: add_offset will choke on it
|
||||
}
|
||||
return p1->add_offset(p2offset);
|
||||
}
|
||||
|
@ -675,7 +671,7 @@ const Type *AddPNode::mach_bottom_type( const MachNode* n) {
|
|||
// Check for any interesting operand info.
|
||||
// In particular, check for both memory and non-memory operands.
|
||||
// %%%%% Clean this up: use xadd_offset
|
||||
int con = opnd->constant();
|
||||
intptr_t con = opnd->constant();
|
||||
if ( con == TypePtr::OffsetBot ) goto bottom_out;
|
||||
offset += con;
|
||||
con = opnd->constant_disp();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue