Method::checked_resolve_jmethod_id() could do better checks

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • 18
    • Affects Version/s: 12
    • Component/s: hotspot
    • None

      Method* Method::checked_resolve_jmethod_id(jmethodID mid) {
        if (mid == NULL) return NULL;
        Method* o = resolve_jmethod_id(mid);
        if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
          return NULL;
        }
        return o;
      };

      We could, in addition, test that:
      - Method* is a valid metaspace pointer
      - Method* is a method

      see Metaspace::contains() and Method::is_valid_method(), respectively.

      Can be done either unconditionally, or at least as assert, if it costs too much time.



            Assignee:
            Coleen Phillimore
            Reporter:
            Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: