JDK 21 |
---|
21 b13Fixed |
Blocks :
|
|
Blocks :
|
|
Blocks :
|
|
Blocks :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
HotSpot assertion failures and similar operations should have the reporting function called in the failure case marked with attribute `[[noreturn]]`. This may permit the compiler to generate better code in some cases. This matters even for production, since some of the operations (such as `guarantee` and `ShouldNotReachHere`) are present in product builds, not just debug builds. This also addresses the problems encountered in JDK-8294031. Because the failure reporting function used by assert is not "noreturn", the compiler is analyzing the continuation from a failed assert as potentially having the values that would result in an assertion failure (in this case, a variable having a null value). Doing so, it discovers a use of that variable in a context where a null value is UB, and so issues a warning. Of course, marking these functions noreturn will require actually making them not return. That's going to require some significant changes.
|