Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8071996

split_if accesses NULL region of ConstraintCast

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • b52

        split_if() in IfNode reasons about the region of ConstraintCasts (ifnode.cpp:149). This fails
        if the region is NULL.

        We see this happen with a CastPP node created in load_String_value / cast_array_to_stable. It is created without a region. The node is subject to optimizations and ends up with a Phi as in[1]. Still no region is needed for the node.

        The fix is to check for NULL before accessing in[0] of the ConstraintCast. If in[0] == NULL the fix returns NULL to deny splitting the if. As I understand, the CastPP would be fine for split_if, but this seems to be a rare case and I do not have a test case for the good case. The error case denies the optimization one step later anyways.

              goetz Goetz Lindenmaier
              goetz Goetz Lindenmaier
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: