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

Parse::Block construction using undefined behavior

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b126
    • CPU:
      generic
    • OS:
      generic

      Description

      In opto/parse.hpp, the Parse class has a nested Block class. The only constructor for this class is not callable; it's body consists entirely of a call to ShouldNotReachHere.

      Apparently we're "constructing" Block objects by calling the init_node/init_graph member functions on pointers to *uninitialized* memory cast to Block*, which is undefined behavior.

      Maybe someone didn't understand placement new?

        Attachments

          Activity

            People

            • Assignee:
              thartmann Tobias Hartmann
              Reporter:
              kbarrett Kim Barrett
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: