JDK-8292972 : Initialize fields if CodeBlobIterator shortcuts without heaps
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-08-26
  • Updated: 2022-08-29
  • Resolved: 2022-08-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 masterFixed
Related Reports
Relates :  
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.
Comments
Changeset: 512fee1d Author: Aleksey Shipilev <shade@openjdk.org> Date: 2022-08-29 07:47:50 +0000 URL: https://git.openjdk.org/jdk/commit/512fee1d1eee4aa4bb7362cc9cb48d63e129a525
29-08-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10041 Date: 2022-08-26 09:35:04 +0000
26-08-2022