Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-187

Verification error when an invoke references a method defined in superclass

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 6.0
    • Component/s: Verifier
    • Labels:
      None
    • Severity:
      normal

      Description

      Assuming a class A with a method foo() and a class B subclass of A. If an invoke opcode references the method B.foo() then the bytecode verifier raises an error with the following error message:

      Referenced method 'foo' with expected signature '()void' not found in class 'B'. The native verifier does allow the method to be declared in some superinterface, which the Java Virtual Machine Specification, Second Edition does not.

      I can't find where in the Java Virtual Machine Specification, Second Edition this restriction is defined.

      The verification of the bytecode generated by the following code fails:

      public class TestLegalInvokeInterface01{
      
          public static void test1(Interface01 t){
              t.run();
          }
      }
      
      interface Interface01 extends Runnable {
          
      }
      

        Attachments

        1. BCEL-187-tests-src.zip
          2 kB
          Jérôme Leroux
        2. BCEL-187.zip
          4 kB
          Jérôme Leroux
        3. BCEL-187.patch
          15 kB
          Jérôme Leroux

          Activity

            People

            • Assignee:
              chonton Charles Honton
              Reporter:
              jejecool Jérôme Leroux
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: