Print this page
rev 4505 : 8014189: JVM crash with SEGV in ConnectionGraph::record_for_escape_analysis()
Summary: Add NULL checks and asserts for Type::make_ptr() returned value.
Reviewed-by: kvn

Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/opto/machnode.cpp
          +++ new/src/share/vm/opto/machnode.cpp
↓ open down ↓ 340 lines elided ↑ open up ↑
 341  341      }
 342  342      // %%% make offset be intptr_t
 343  343      assert(!Universe::heap()->is_in_reserved((oop)offset), "must be a raw ptr");
 344  344      return TypeRawPtr::BOTTOM;
 345  345    }
 346  346  
 347  347    // base of -1 with no particular offset means all of memory
 348  348    if (base == NodeSentinel)  return TypePtr::BOTTOM;
 349  349  
 350  350    const Type* t = base->bottom_type();
 351      -  if (UseCompressedOops && Universe::narrow_oop_shift() == 0) {
      351 +  if (t->isa_narrowoop() && Universe::narrow_oop_shift() == 0) {
 352  352      // 32-bit unscaled narrow oop can be the base of any address expression
 353  353      t = t->make_ptr();
 354  354    }
 355  355    if (t->isa_intptr_t() && offset != 0 && offset != Type::OffsetBot) {
 356  356      // We cannot assert that the offset does not look oop-ish here.
 357  357      // Depending on the heap layout the cardmark base could land
 358  358      // inside some oopish region.  It definitely does for Win2K.
 359  359      // The sum of cardmark-base plus shift-by-9-oop lands outside
 360  360      // the oop-ish area but we can't assert for that statically.
 361  361      return TypeRawPtr::BOTTOM;
↓ open down ↓ 398 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX