Skip to content

Commit 46a1464

Browse files
committed
8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis
Backport-of: afcc2b03afc77f730300e1d92471466d56ed75fb
1 parent d279d44 commit 46a1464

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
@@ -618,7 +618,9 @@ static const Node* get_base_and_offset(const MachNode* mach, intptr_t& offset) {
618618
// The memory address is computed by 'base' and fed to 'mach' via an
619619
// indirect memory operand (indicated by offset == 0). The ultimate base and
620620
// offset can be fetched directly from the inputs and Ideal type of 'base'.
621-
offset = base->bottom_type()->isa_oopptr()->offset();
621+
const TypeOopPtr* oopptr = base->bottom_type()->isa_oopptr();
622+
if (oopptr == nullptr) return nullptr;
623+
offset = oopptr->offset();
622624
// Even if 'base' is not an Ideal AddP node anymore, Matcher::ReduceInst()
623625
// guarantees that the base address is still available at the same slot.
624626
base = base->in(AddPNode::Base);

0 commit comments

Comments
 (0)