- 
    Bug 
- 
    Resolution: Fixed
- 
     P4 P4
- 
    22
- 
        b12
                    SonarCloud has a new warning after JDK-8140326:
```
bool yielded;
bool mark_aborted = yield_if_necessary(yielded);
if (mark_aborted) {
...
} else if (yielded && !should_rebuild_or_scrub(hr)) { // <--- Branch condition evaluates to a garbage value
...
}
```
This warning is about `yielded` being not initialized on some paths, reading the garbage value from it on branch checks.
There are other uses of `yield_if_necessary`, and at some uses we initialize `yielded = true`. This seems a bit awkward in itself: we are assuming the yield happened even without checking it in yield_if_necessary. It is therefore unclear what should be the default value in other cases.
```
bool yielded;
bool mark_aborted = yield_if_necessary(yielded);
if (mark_aborted) {
...
} else if (yielded && !should_rebuild_or_scrub(hr)) { // <--- Branch condition evaluates to a garbage value
...
}
```
This warning is about `yielded` being not initialized on some paths, reading the garbage value from it on branch checks.
There are other uses of `yield_if_necessary`, and at some uses we initialize `yielded = true`. This seems a bit awkward in itself: we are assuming the yield happened even without checking it in yield_if_necessary. It is therefore unclear what should be the default value in other cases.
- relates to
- 
                    JDK-8140326 G1: Consider putting regions where evacuation failed into next collection set -           
- Resolved
 
-         
 
        