Skip to content

Commit

Permalink
8348562: ZGC: segmentation fault due to missing node type check in ba…
Browse files Browse the repository at this point in the history
…rrier elision analysis

Backport-of: afcc2b0
  • Loading branch information
TheRealMDoerr committed Feb 7, 2025
1 parent d279d44 commit 46a1464
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,9 @@ static const Node* get_base_and_offset(const MachNode* mach, intptr_t& offset) {
// The memory address is computed by 'base' and fed to 'mach' via an
// indirect memory operand (indicated by offset == 0). The ultimate base and
// offset can be fetched directly from the inputs and Ideal type of 'base'.
offset = base->bottom_type()->isa_oopptr()->offset();
const TypeOopPtr* oopptr = base->bottom_type()->isa_oopptr();
if (oopptr == nullptr) return nullptr;
offset = oopptr->offset();
// Even if 'base' is not an Ideal AddP node anymore, Matcher::ReduceInst()
// guarantees that the base address is still available at the same slot.
base = base->in(AddPNode::Base);
Expand Down

0 comments on commit 46a1464

Please sign in to comment.