Closed Kojoley closed 1 year ago
So the deal here I believe was that this particular unsafe method wasn't ensuring the field wrapper had been resolved before generating the delegate. So, it might have been working with a FieldBuilder instead of a real runtime field. Other things in the runtime can cause the field to be resolved, so, this bug would only appear if nothing up to the point had caused it to be resolved.
Also, more info: there are only a handful actual calls to Unsafe in the BCL anyways. Most of them are intrinsified. The actual Unsafe class only really exists for people like the reporter who are circumventing the visibility from the outside.
Reproducer based on
guava/src/com/google/common/util/concurrent/AbstractFuture.java