Skip to content

Commit afcc2b0

Browse files
committed
8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis
Reviewed-by: rcastanedalo, rrich
1 parent 175e58b commit afcc2b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,9 @@ static const Node* get_base_and_offset(const MachNode* mach, intptr_t& offset) {
558558
// The memory address is computed by 'base' and fed to 'mach' via an
559559
// indirect memory operand (indicated by offset == 0). The ultimate base and
560560
// offset can be fetched directly from the inputs and Ideal type of 'base'.
561-
offset = base->bottom_type()->isa_oopptr()->offset();
561+
const TypeOopPtr* oopptr = base->bottom_type()->isa_oopptr();
562+
if (oopptr == nullptr) return nullptr;
563+
offset = oopptr->offset();
562564
// Even if 'base' is not an Ideal AddP node anymore, Matcher::ReduceInst()
563565
// guarantees that the base address is still available at the same slot.
564566
base = base->in(AddPNode::Base);

0 commit comments

Comments
 (0)