8037157: Verify <init> call

Mon, 07 Apr 2014 09:27:31 -0400

author
hseigel
date
Mon, 07 Apr 2014 09:27:31 -0400
changeset 6771
b5ae226b7516
parent 6768
0037e964ce48
child 6772
4c40343ecdb3
child 6818
096a7e12d63f

8037157: Verify <init> call
Summary: Check for null method
Reviewed-by: coleenp, acorn, mschoene

src/share/vm/classfile/verifier.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/classfile/verifier.cpp	Thu Apr 03 11:46:36 2014 -0700
     1.2 +++ b/src/share/vm/classfile/verifier.cpp	Mon Apr 07 09:27:31 2014 -0400
     1.3 @@ -2307,6 +2307,11 @@
     1.4        Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
     1.5          vmSymbols::object_initializer_name(),
     1.6          cp->signature_ref_at(bcs->get_index_u2()));
     1.7 +      if (m == NULL) {
     1.8 +        verify_error(ErrorContext::bad_code(bci),
     1.9 +            "Call to missing <init> method");
    1.10 +        return;
    1.11 +      }
    1.12        instanceKlassHandle mh(THREAD, m->method_holder());
    1.13        if (m->is_protected() && !mh->is_same_class_package(_klass())) {
    1.14          bool assignable = current_type().is_assignable_from(

mercurial