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

Dangling references after MethodComparator::methods_EMCP

XMLWordPrintable

    • b14

      SonarCloud reports the following problem in MethodComparator::methods_EMCP:
       "Address of stack memory associated with local variable 's_new' is still referred to by the global variable '_s_new' upon returning to the caller. This will be a dangling reference"

      Code inspection reveals the assignment to static variables is only needed to pass them to helper methods. So, while this is not a detectable bug (yet), it is still cleaner not to expose stack variables in globals.

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: