diff options
author | 2017-08-01 09:54:49 -0700 | |
---|---|---|
committer | 2017-08-02 14:58:10 -0700 | |
commit | afb664701734c6edbea07431382ee33f1677d42b (patch) | |
tree | bd67954a08efb59e7bee75dfe46d1230abe4443b /test/075-verification-error/src/Main.java | |
parent | 7f14c2ec37c70010d99cab6806d85018df56c555 (diff) |
Fix verifier checks on interface methods.
We were disallowing interfaces in the IsInheritedMethod even though
the function can be called with them. This could cause some failing
DCHECKS if the verifier cannot find methods in some situations.
We also fixed a small issue in the verifier where we allowed
non-public java.lang.Object methods to be considered valid for
interface dispatch.
Test: ./test.py --host -j50
Test: Compile an app with bad bytecodes (See bug)
Bug: 64158483
Bug: 64274113
Change-Id: Ia79f25be0001efc4069a411a0b34476bd0871803
Diffstat (limited to 'test/075-verification-error/src/Main.java')
-rw-r--r-- | test/075-verification-error/src/Main.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/075-verification-error/src/Main.java b/test/075-verification-error/src/Main.java index 3f2881eb10..13aeaee7e4 100644 --- a/test/075-verification-error/src/Main.java +++ b/test/075-verification-error/src/Main.java @@ -28,6 +28,20 @@ public class Main { testClassNewInstance(); testMissingStuff(); testBadAccess(); + testBadInterfaceMethod(); + } + /** + * Try to create and invoke a non-existant interface method. + */ + static void testBadInterfaceMethod() { + BadInterface badiface = new BadIfaceImpl(); + try { + badiface.internalClone(); + } catch (IncompatibleClassChangeError icce) { + // TODO b/64274113 This should really be an NSME + System.out.println("Got expected IncompatibleClassChangeError (interface)"); + if (VERBOSE) System.out.println("--- " + icce); + } } /** |