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

Unreachable code in nmethod.cpp inside #ifdef DEBUG

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16, 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Introduced In Build:
      b16
    • Introduced In Version:
      14
    • Resolved In Build:
      b19

      Description

      HotSpot doesn't define the DEBUG macro, so the assert assert_lock_strong call is not included even in a debug build.

      The code should be changed to #ifdef ASSERT instead.

      bool nmethod::try_transition(int new_state_int) {
        signed char new_state = new_state_int;
      #ifdef DEBUG
        if (new_state != unloaded) {
          assert_lock_strong(CompiledMethod_lock);
        }
      #endif

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rehn Robbin Ehn
              Reporter:
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: