[lworld] RFR: 8280524: [lworld] Interpreter incorrectly handles uninitialized static inline type field
Tobias Hartmann
thartmann at openjdk.java.net
Tue Jan 25 12:24:46 UTC 2022
On Tue, 25 Jan 2022 10:57:57 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> Code in the interpreter that's supposed to check if the type of a static, null-free inline type field is initialized assumes that `rcx` contains the `InlineKlass*`. However, `rcx` is only initialized for non-static fields:
> https://github.com/openjdk/valhalla/blob/ba87b167f2fe2327508a06ec8652c6ddaa9402c1/src/hotspot/cpu/x86/templateTable_x86.cpp#L2939-L2943
>
> As a result, the check spuriously fails, leading to an "impossible" NPE because the null value is not replaced by the default value. This patch also fixes an unrelated issue where an `instanceHandle` should be used instead of an `instanceOop`.
>
> I found this with compiler stress testing and initially assumed that it is a compiler bug. The patch was contributed by @fparain.
>
> Thanks,
> Tobias
Thanks, Fred!
-------------
PR: https://git.openjdk.java.net/valhalla/pull/617
More information about the valhalla-dev
mailing list