Integrated: 8292972: Initialize fields if CodeBlobIterator shortcuts without heaps

Aleksey Shipilev shade at openjdk.org
Mon Aug 29 07:50:19 UTC 2022


On Fri, 26 Aug 2022 09:35:04 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: 512fee1d
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/512fee1d1eee4aa4bb7362cc9cb48d63e129a525
Stats:     4 lines in 1 file changed: 4 ins; 0 del; 0 mod

8292972: Initialize fields if CodeBlobIterator shortcuts without heaps

Reviewed-by: kvn, chagedorn

-------------

PR: https://git.openjdk.org/jdk/pull/10041


More information about the hotspot-compiler-dev mailing list