-
Bug
-
Resolution: Fixed
-
P3
-
21, 22
-
b04
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8312889 | 21.0.1 | Tobias Hartmann | P3 | Resolved | Fixed | b04 |
JDK-8311582 | 21 | Tobias Hartmann | P3 | Resolved | Fixed | b31 |
jvmciCompilerToVM does not properly handle dynamic constants that are null.
C2V_VMENTRY_NULL(jobject, resolvePossiblyCachedConstantInPool, (JNIEnv* env, jobject, ARGUMENT_PAIR(cp), jint index))
constantPoolHandle cp(THREAD, UNPACK_PAIR(ConstantPool, cp));
oop obj = cp->resolve_possibly_cached_constant_at(index, CHECK_NULL);
constantTag tag = cp->tag_at(index);
if (tag.is_dynamic_constant() || tag.is_dynamic_constant_in_error()) {
if (obj == Universe::the_null_sentinel()) {
return JVMCIENV->get_jobject(JVMCIENV->get_JavaConstant_NULL_POINTER());
}
checks for the null sentinel however resolve_possibly_cached_constant_at will return nullptr for null dynamic constants.
This lets the TestConstantDynamic test fail with jvmci and graal.
Also, we dont have to check for the dynamic constant error because in that case cp->resolve_possibly_cached_constant_at already throws.
C2V_VMENTRY_NULL(jobject, resolvePossiblyCachedConstantInPool, (JNIEnv* env, jobject, ARGUMENT_PAIR(cp), jint index))
constantPoolHandle cp(THREAD, UNPACK_PAIR(ConstantPool, cp));
oop obj = cp->resolve_possibly_cached_constant_at(index, CHECK_NULL);
constantTag tag = cp->tag_at(index);
if (tag.is_dynamic_constant() || tag.is_dynamic_constant_in_error()) {
if (obj == Universe::the_null_sentinel()) {
return JVMCIENV->get_jobject(JVMCIENV->get_JavaConstant_NULL_POINTER());
}
checks for the null sentinel however resolve_possibly_cached_constant_at will return nullptr for null dynamic constants.
This lets the TestConstantDynamic test fail with jvmci and graal.
Also, we dont have to check for the dynamic constant error because in that case cp->resolve_possibly_cached_constant_at already throws.
- backported by
-
JDK-8311582 [JVMCI] compiler/runtime/TestConstantDynamic: lookupConstant returned an object of incorrect type: null
-
- Resolved
-
-
JDK-8312889 [JVMCI] compiler/runtime/TestConstantDynamic: lookupConstant returned an object of incorrect type: null
-
- Resolved
-
- links to
-
Commit openjdk/jdk21/830279e0
-
Commit openjdk/jdk/15878360
-
Review openjdk/jdk21/101
-
Review openjdk/jdk/14582
(1 links to)