Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8310425

[JVMCI] compiler/runtime/TestConstantDynamic: lookupConstant returned an object of incorrect type: null

XMLWordPrintable

    • b04

        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.

              davleopo David Leopoldseder
              davleopo David Leopoldseder
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: