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

Initialize fields if CodeBlobIterator shortcuts without heaps

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 20
    • 20
    • hotspot
    • b13

    Description

      SonarCloud reports that `CodeBlobIterator::_code_blob` is not initialized on shortcut path:

      ```
        CodeBlobIterator(LivenessFilter filter, T* nm = NULL)
          : _only_not_unloading(filter == only_not_unloading)
        {
          if (Filter::heaps() == NULL) {
            return; <---- here
          }
      ```

      It seems that we don't have an actual bug here, as iterator shortcuts on `_heap == _end`, but it would be cleaner to avoid garbage anyway.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: