Skip to content

Commit 0c07aaa

Browse files
author
Vladimir Kozlov
committed
8383420: SIGSEGV in PhaseChaitin::gather_lrg_masks
Reviewed-by: dlong, qamai
1 parent 855d591 commit 0c07aaa

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/hotspot/share/opto/callGenerator.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,12 @@ void CallGenerator::do_late_inline_helper() {
646646
for (uint i1 = 0; i1 < size; i1++) {
647647
map->init_req(i1, call->in(i1));
648648
}
649+
// Call node has in(ReturnAdr) set to top() node.
650+
// We have to set map->in(ReturnAdr) to correct value
651+
// because it is used by uncommon traps.
652+
Node* ret_adr = C->start()->proj_out_or_null(TypeFunc::ReturnAdr);
653+
precond(ret_adr != nullptr);
654+
map->set_req(TypeFunc::ReturnAdr, ret_adr);
649655

650656
// Make sure the state is a MergeMem for parsing.
651657
if (!map->in(TypeFunc::Memory)->is_MergeMem()) {
@@ -661,6 +667,7 @@ void CallGenerator::do_late_inline_helper() {
661667
map->set_req(TypeFunc::Parms + i1, top);
662668
}
663669
jvms->set_map(map);
670+
precond(ret_adr == jvms->map()->returnadr());
664671

665672
// Make enough space in the expression stack to transfer
666673
// the incoming arguments and return value.

src/hotspot/share/opto/chaitin.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ class LiveRangeMap {
353353
return _names.at(idx);
354354
}
355355

356-
uint live_range_id(const Node *node) const {
356+
uint live_range_id(const Node* node) const {
357+
precond(node != nullptr);
357358
return _names.at(node->_idx);
358359
}
359360

src/hotspot/share/opto/loopTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4145,7 +4145,7 @@ bool PhaseIdealLoop::intrinsify_fill(IdealLoopTree* lpt) {
41454145
call->init_req(TypeFunc::Control, head->init_control());
41464146
call->init_req(TypeFunc::I_O, C->top()); // Does no I/O.
41474147
call->init_req(TypeFunc::Memory, mem_phi->in(LoopNode::EntryControl));
4148-
call->init_req(TypeFunc::ReturnAdr, C->start()->proj_out_or_null(TypeFunc::ReturnAdr));
4148+
call->init_req(TypeFunc::ReturnAdr, C->top());
41494149
Node* frame = new ParmNode(C->start(), TypeFunc::FramePtr);
41504150
_igvn.register_new_node_with_optimizer(frame);
41514151
call->init_req(TypeFunc::FramePtr, frame);

0 commit comments

Comments
 (0)