• Andy McFadden's avatar
    Defer reporting of certain verifier failures. · b51ea11c
    Andy McFadden authored
    The verifier currently reports all failures immediately.  Certain failures,
    such as the failure to resolve a method, or the determination that access
    to a field is not allowed, are supposed to deferred until the first time
    that executing code does something that could cause the resolution.
    
    With this change, several kinds of verification failures are deferred.
    This is done by making a writable copy of the bytecode and replacing the
    failing instruction with an "always throw" opcode.
    
    Gory details:
    - Added throw-verification-error instruction.  Implemented in "portable"
      and ARM interpreters.  x86 uses portable form through stub.
    - Added a function that creates a copy of a DexCode area and makes the
      bytecodes writable.
    - Added code that replaces a single instruction with an "always throw".
    - Replaced runtime check for abstract/interface in new-instance with a
      check at verification time.
    - Added a test to exercise the deferred error mechanism.
    - Minor cleanups (replaced tab, bad valgrind command, ...).
    b51ea11c
DexFile.c 35.6 KB