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

Signature::basic_type should check length of signature Symbol

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 16
    • 16
    • hotspot

      here's Signature code that unconditionally reads _body[0], which would assert (but class loading checks for invalid signatures that prevents this from happening)

      BasicType Signature::basic_type(const Symbol* signature) {
        return basic_type(signature->char_at(0));
      }

      char Symbol::char_at(int index) const {
        assert(index >=0 && index < length(), "symbol index overflow");
        return (char)base()[index];
      }

      Signature::basic_type() should be fixed to either check for length, and/or assert that signature is a valid signature.

            lfoltan Lois Foltan
            lfoltan Lois Foltan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: