Skip to content

Commit 5bcf941

Browse files
author
duke
committed
Backport afcc2b03afc77f730300e1d92471466d56ed75fb
1 parent 96bd21d commit 5bcf941

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

0 commit comments

Comments
 (0)