Sometimes C2 eliminates non-null branch in the following code as if it proved that ThreadCont.getAndSet() can't return non-null:
val cont = ThreadCont.getAndSet(threads[i], null)
if (cont != null) { /* do something */ }
Detailed problem description & reproducer (by Roman Elizarov):
https://github.com/ktorio/ktor/blob/resumeAnyThread_HotSpotBug/BUG_README_FIRST.md
val cont = ThreadCont.getAndSet(threads[i], null)
if (cont != null) { /* do something */ }
Detailed problem description & reproducer (by Roman Elizarov):
https://github.com/ktorio/ktor/blob/resumeAnyThread_HotSpotBug/BUG_README_FIRST.md
- duplicates
-
JDK-8198543 C2: Wrong type of return value from Unsafe.getAndSetObject() call
- Closed